@dataform/core
Advanced tools
Comparing version 0.1.0 to 1.0.0-alpha
/// <amd-module name="@dataform/core/assertion" /> | ||
import { Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
import { Session } from "./index"; | ||
export declare type AContextable<T> = T | ((ctx: AssertionContext) => T); | ||
@@ -13,2 +13,8 @@ export declare class Assertion { | ||
} | ||
export declare class SqlxAssertionContext { | ||
private assertion?; | ||
constructor(assertion: Assertion); | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
} | ||
export declare class AssertionContext { | ||
@@ -15,0 +21,0 @@ private assertion?; |
@@ -39,2 +39,15 @@ (function (factory) { | ||
exports.Assertion = Assertion; | ||
class SqlxAssertionContext { | ||
constructor(assertion) { | ||
this.assertion = assertion; | ||
} | ||
ref(name) { | ||
this.assertion.dependencies(name); | ||
return this.resolve(name); | ||
} | ||
resolve(name) { | ||
return this.assertion.session.resolve(name); | ||
} | ||
} | ||
exports.SqlxAssertionContext = SqlxAssertionContext; | ||
class AssertionContext { | ||
@@ -66,2 +79,2 @@ constructor(assertion) { | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9hc3NlcnRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFBQSw2Q0FBNEM7SUFNNUMsTUFBYSxTQUFTO1FBQXRCO1lBQ1MsVUFBSyxHQUF3QixpQkFBUSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQWdDbEUsQ0FBQztRQXhCUSxLQUFLLENBQUMsS0FBMkI7WUFDdEMsSUFBSSxDQUFDLGdCQUFnQixHQUFHLEtBQUssQ0FBQztZQUM5QixPQUFPLElBQUksQ0FBQztRQUNkLENBQUM7UUFFTSxZQUFZLENBQUMsS0FBd0I7WU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ucmVzb2x2ZShuYW1lKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgQXNzZXJ0aW9uQ29udGV4dCB7XG4gIHByaXZhdGUgYXNzZXJ0aW9uPzogQXNzZXJ0aW9uO1xuXG4gIGNvbnN0cnVjdG9yKGFzc2VydGlvbjogQXNzZXJ0aW9uKSB7XG4gICAgdGhpcy5hc3NlcnRpb24gPSBhc3NlcnRpb247XG4gIH1cblxuICBwdWJsaWMgcmVmKG5hbWU6IHN0cmluZykge1xuICAgIHRoaXMuYXNzZXJ0aW9uLmRlcGVuZGVuY2llcyhuYW1lKTtcbiAgICByZXR1cm4gdGhpcy5yZXNvbHZlKG5hbWUpO1xuICB9XG5cbiAgcHVibGljIHJlc29sdmUobmFtZTogc3RyaW5nKSB7XG4gICAgcmV0dXJuIHRoaXMuYXNzZXJ0aW9uLnNlc3Npb24ucmVzb2x2ZShuYW1lKTtcbiAgfVxuXG4gIHB1YmxpYyBkZXBlbmRlbmNpZXMobmFtZTogc3RyaW5nIHwgc3RyaW5nW10pIHtcbiAgICB0aGlzLmFzc2VydGlvbi5kZXBlbmRlbmNpZXMobmFtZSk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgYXBwbHk8VD4odmFsdWU6IEFDb250ZXh0YWJsZTxUPik6IFQge1xuICAgIGlmICh0eXBlb2YgdmFsdWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgcmV0dXJuICh2YWx1ZSBhcyBhbnkpKHRoaXMpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICB9XG59XG4iXX0= |
/// <amd-module name="@dataform/core/compilers" /> | ||
export declare function compile(code: string, path: string): string; | ||
export declare function compileTableSql(code: string, path: string): string; | ||
export declare function compileOperationSql(code: string, path: string): string; | ||
export declare function compileAssertionSql(code: string, path: string): string; | ||
export declare function extractJsBlocks(code: string): { | ||
@@ -10,2 +7,1 @@ sql: string; | ||
}; | ||
export declare function getFunctionPropertyNames(prototype: any): string[]; |
111
compilers.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/compilers", ["require", "exports", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/table", "@dataform/core/utils"], factory); | ||
define("@dataform/core/compilers", ["require", "exports", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/sqlx_parser", "@dataform/core/table", "@dataform/core/utils"], factory); | ||
} | ||
@@ -15,5 +15,9 @@ })(function (require, exports) { | ||
const operation_1 = require("@dataform/core/operation"); | ||
const sqlx_parser_1 = require("@dataform/core/sqlx_parser"); | ||
const table_1 = require("@dataform/core/table"); | ||
const utils = require("@dataform/core/utils"); | ||
function compile(code, path) { | ||
if (path.endsWith(".sqlx")) { | ||
return compileSqlx(sqlx_parser_1.parseSqlx(code), path); | ||
} | ||
if (path.endsWith(".assert.sql")) { | ||
@@ -33,5 +37,4 @@ return compileAssertionSql(code, path); | ||
const { sql, js } = extractJsBlocks(code); | ||
const functionsBindings = getFunctionPropertyNames(table_1.TableContext.prototype).map(name => `const ${name} = !!ctx.${name} ? ctx.${name}.bind(ctx) : () => "";`); | ||
const functionsBindings = getFunctionPropertyNames(table_1.TableContext.prototype).map(name => `const ${name} = ctx.${name}.bind(ctx);`); | ||
return ` | ||
const publish = global.publish || global.materialize; | ||
publish("${utils.baseFilename(path)}").query(ctx => { | ||
@@ -43,6 +46,5 @@ ${functionsBindings.join("\n")} | ||
} | ||
exports.compileTableSql = compileTableSql; | ||
function compileOperationSql(code, path) { | ||
const { sql, js } = extractJsBlocks(code); | ||
const functionsBindings = getFunctionPropertyNames(operation_1.OperationContext.prototype).map(name => `const ${name} = !!ctx.${name} ? ctx.${name}.bind(ctx) : () => "";`); | ||
const functionsBindings = getFunctionPropertyNames(operation_1.OperationContext.prototype).map(name => `const ${name} = ctx.${name}.bind(ctx);`); | ||
return ` | ||
@@ -55,6 +57,5 @@ operate("${utils.baseFilename(path)}").queries(ctx => { | ||
} | ||
exports.compileOperationSql = compileOperationSql; | ||
function compileAssertionSql(code, path) { | ||
const { sql, js } = extractJsBlocks(code); | ||
const functionsBindings = getFunctionPropertyNames(assertion_1.AssertionContext.prototype).map(name => `const ${name} = !!ctx.${name} ? ctx.${name}.bind(ctx) : () => "";`); | ||
const functionsBindings = getFunctionPropertyNames(assertion_1.AssertionContext.prototype).map(name => `const ${name} = ctx.${name}.bind(ctx);`); | ||
return ` | ||
@@ -67,5 +68,4 @@ assert("${utils.baseFilename(path)}").query(ctx => { | ||
} | ||
exports.compileAssertionSql = compileAssertionSql; | ||
function extractJsBlocks(code) { | ||
const JS_REGEX = /\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|\-\-[jJ][sS]\s(.*)/g; | ||
const JS_REGEX = /^\s*\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|^\s*\-\-[jJ][sS]\s(.*)/gm; | ||
const RAW_BACKTICKS_REGEX = /([^\\])`/g; | ||
@@ -90,11 +90,92 @@ const jsBlocks = []; | ||
exports.extractJsBlocks = extractJsBlocks; | ||
function compileSqlx(results, path) { | ||
return ` | ||
const parsedConfig = ${results.config || "{}"}; | ||
// sqlxConfig should conform to the ISqlxConfig interface. | ||
const sqlxConfig = { | ||
name: "${utils.baseFilename(path)}", | ||
type: "operations", | ||
dependencies: [], | ||
...parsedConfig | ||
}; | ||
const sqlStatementCount = ${results.sql.length}; | ||
const hasIncremental = ${!!results.incremental}; | ||
const hasPreOperations = ${results.preOperations.length > 1 || results.preOperations[0] !== ""}; | ||
const hasPostOperations = ${results.postOperations.length > 1 || results.postOperations[0] !== ""}; | ||
const action = session.sqlxAction({ | ||
sqlxConfig, | ||
sqlStatementCount, | ||
hasIncremental, | ||
hasPreOperations, | ||
hasPostOperations | ||
}); | ||
switch (sqlxConfig.type) { | ||
case "view": | ||
case "table": | ||
case "incremental": | ||
case "inline": { | ||
action.query(ctx => { | ||
${getFunctionPropertyNames(table_1.SqlxTableContext.prototype) | ||
.map(name => `const ${name} = ctx.${name}.bind(ctx);`) | ||
.join("\n")} | ||
${results.js} | ||
if (hasIncremental) { | ||
action.where(\`${results.incremental}\`); | ||
} | ||
if (hasPreOperations) { | ||
const preOperations = [${results.preOperations.map(sql => `\`${sql}\``)}]; | ||
action.preOps(preOperations); | ||
} | ||
if (hasPostOperations) { | ||
const postOperations = [${results.postOperations.map(sql => `\`${sql}\``)}]; | ||
action.postOps(postOperations); | ||
} | ||
return \`${results.sql[0]}\`; | ||
}); | ||
break; | ||
} | ||
case "assertion": { | ||
action.query(ctx => { | ||
${getFunctionPropertyNames(assertion_1.SqlxAssertionContext.prototype) | ||
.map(name => `const ${name} = ctx.${name}.bind(ctx);`) | ||
.join("\n")} | ||
${results.js} | ||
return \`${results.sql[0]}\`; | ||
}); | ||
break; | ||
} | ||
case "operations": { | ||
action.queries(ctx => { | ||
${getFunctionPropertyNames(operation_1.SqlxOperationContext.prototype) | ||
.map(name => `const ${name} = ctx.${name}.bind(ctx);`) | ||
.join("\n")} | ||
${results.js} | ||
const operations = [${results.sql.map(sql => `\`${sql}\``)}]; | ||
return operations; | ||
}); | ||
break; | ||
} | ||
default: { | ||
session.compileError(new Error(\`Unrecognized action type: \${sqlxConfig.type}\`)); | ||
break; | ||
} | ||
}`; | ||
} | ||
function getFunctionPropertyNames(prototype) { | ||
return Object.getOwnPropertyNames(prototype).filter(function (e, i, arr) { | ||
if (e != arr[i + 1] && typeof prototype[e] == "function") { | ||
return [ | ||
...new Set(Object.getOwnPropertyNames(prototype).filter(propertyName => { | ||
if (typeof prototype[propertyName] !== "function") { | ||
return false; | ||
} | ||
if (propertyName === "constructor") { | ||
return false; | ||
} | ||
return true; | ||
} | ||
}); | ||
})) | ||
]; | ||
} | ||
exports.getFunctionPropertyNames = getFunctionPropertyNames; | ||
}); | ||
//# sourceMappingURL=data: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jdHguJHtuYW1lfS5iaW5kKGN0eCk7YClcbiAgICAgICAgLmpvaW4oXCJcXG5cIil9XG4gICAgICAke3Jlc3VsdHMuanN9XG4gICAgICBjb25zdCBvcGVyYXRpb25zID0gWyR7cmVzdWx0cy5zcWwubWFwKHNxbCA9PiBgXFxgJHtzcWx9XFxgYCl9XTtcbiAgICAgIHJldHVybiBvcGVyYXRpb25zO1xuICAgIH0pO1xuICAgIGJyZWFrO1xuICB9XG4gIGRlZmF1bHQ6IHtcbiAgICBzZXNzaW9uLmNvbXBpbGVFcnJvcihuZXcgRXJyb3IoXFxgVW5yZWNvZ25pemVkIGFjdGlvbiB0eXBlOiBcXCR7c3FseENvbmZpZy50eXBlfVxcYCkpO1xuICAgIGJyZWFrO1xuICB9XG59YDtcbn1cblxuZnVuY3Rpb24gZ2V0RnVuY3Rpb25Qcm9wZXJ0eU5hbWVzKHByb3RvdHlwZTogYW55KSB7XG4gIHJldHVybiBbXG4gICAgLi4ubmV3IFNldChcbiAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHByb3RvdHlwZSkuZmlsdGVyKHByb3BlcnR5TmFtZSA9PiB7XG4gICAgICAgIGlmICh0eXBlb2YgcHJvdG90eXBlW3Byb3BlcnR5TmFtZV0gIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocHJvcGVydHlOYW1lID09PSBcImNvbnN0cnVjdG9yXCIpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9KVxuICAgIClcbiAgXTtcbn1cbiJdfQ== |
/// <amd-module name="@dataform/core" /> | ||
import { dataform } from "@dataform/protos"; | ||
import { AContextable, Assertion } from "./assertion"; | ||
import { OContextable, Operation } from "./operation"; | ||
import { Session } from "./session"; | ||
import { Table, TableContext, TConfig } from "./table"; | ||
import * as adapters from "./adapters"; | ||
import * as compilers from "./compilers"; | ||
import * as tasks from "./tasks"; | ||
import * as utils from "./utils"; | ||
export { adapters, utils, compilers, tasks, Session, Table, TableContext, TConfig, Operation, Assertion }; | ||
export declare const session: any; | ||
export declare const publish: (name: string, queryOrConfig?: string | TConfig | ((ctx: TableContext) => string)) => any; | ||
export declare const materialize: (name: string, queryOrConfig?: string | TConfig | ((ctx: TableContext) => string)) => any; | ||
export declare const operate: (name: string, statement?: OContextable<string | string[]>) => any; | ||
export declare const assert: (name: string, query?: AContextable<string>) => any; | ||
export declare const compile: () => any; | ||
export declare const init: (rootDir: string, projectConfig?: dataform.IProjectConfig) => any; | ||
import * as adapters from "@dataform/core/adapters"; | ||
import * as compilers from "@dataform/core/compilers"; | ||
import { genIndex } from "@dataform/core/gen_index"; | ||
export declare const indexFileGenerator: typeof genIndex; | ||
export declare const compiler: typeof compilers.compile; | ||
export { adapters }; |
47
index.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core", ["require", "exports", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/session", "@dataform/core/table", "@dataform/core/adapters/index", "@dataform/core/compilers", "@dataform/core/tasks", "@dataform/core/utils"], factory); | ||
define("@dataform/core", ["require", "exports", "@dataform/core/adapters/index", "@dataform/core/compilers", "@dataform/core/gen_index", "@dataform/core/session"], factory); | ||
} | ||
@@ -13,19 +13,9 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const assertion_1 = require("@dataform/core/assertion"); | ||
exports.Assertion = assertion_1.Assertion; | ||
const operation_1 = require("@dataform/core/operation"); | ||
exports.Operation = operation_1.Operation; | ||
const session_1 = require("@dataform/core/session"); | ||
exports.Session = session_1.Session; | ||
const table_1 = require("@dataform/core/table"); | ||
exports.Table = table_1.Table; | ||
exports.TableContext = table_1.TableContext; | ||
const adapters = require("@dataform/core/adapters/index"); | ||
exports.adapters = adapters; | ||
const compilers = require("@dataform/core/compilers"); | ||
exports.compilers = compilers; | ||
const tasks = require("@dataform/core/tasks"); | ||
exports.tasks = tasks; | ||
const utils = require("@dataform/core/utils"); | ||
exports.utils = utils; | ||
const gen_index_1 = require("@dataform/core/gen_index"); | ||
const session_1 = require("@dataform/core/session"); | ||
exports.indexFileGenerator = gen_index_1.genIndex; | ||
exports.compiler = compilers.compile; | ||
if (require.extensions) { | ||
@@ -42,17 +32,14 @@ require.extensions[".sql"] = function (module, file) { | ||
} | ||
const existingGlobalSession = global._DF_SESSION; | ||
exports.session = existingGlobalSession || new session_1.Session(process.cwd()); | ||
global._DF_SESSION = exports.session; | ||
exports.publish = (name, queryOrConfig) => exports.session.publish(name, queryOrConfig); | ||
exports.materialize = exports.publish; | ||
exports.operate = (name, statement) => exports.session.operate(name, statement); | ||
exports.assert = (name, query) => exports.session.assert(name, query); | ||
exports.compile = () => exports.session.compile(); | ||
exports.init = (rootDir, projectConfig) => exports.session.init(rootDir, projectConfig); | ||
global.session = exports.session; | ||
global.materialize = exports.publish; | ||
global.publish = exports.publish; | ||
global.operate = exports.operate; | ||
global.assert = exports.assert; | ||
function globalSession() { | ||
if (!global._DF_SESSION) { | ||
global._DF_SESSION = new session_1.Session(process.cwd()); | ||
} | ||
return global._DF_SESSION; | ||
} | ||
const session = globalSession(); | ||
global.session = session; | ||
global.publish = session.publish.bind(session); | ||
global.operate = session.operate.bind(session); | ||
global.assert = session.assert.bind(session); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQ0Esd0RBQXNEO0lBd0JwRCxvQkF4QnFCLHFCQUFTLENBd0JyQjtJQXZCWCx3REFBc0Q7SUFzQnBELG9CQXRCcUIscUJBQVMsQ0Fz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BhbnkpLl9ERl9TRVNTSU9OID0gbmV3IFNlc3Npb24ocHJvY2Vzcy5jd2QoKSk7XG4gIH1cbiAgcmV0dXJuIChnbG9iYWwgYXMgYW55KS5fREZfU0VTU0lPTiBhcyBTZXNzaW9uO1xufVxuY29uc3Qgc2Vzc2lvbiA9IGdsb2JhbFNlc3Npb24oKTtcblxuKGdsb2JhbCBhcyBhbnkpLnNlc3Npb24gPSBzZXNzaW9uO1xuKGdsb2JhbCBhcyBhbnkpLnB1Ymxpc2ggPSBzZXNzaW9uLnB1Ymxpc2guYmluZChzZXNzaW9uKTtcbihnbG9iYWwgYXMgYW55KS5vcGVyYXRlID0gc2Vzc2lvbi5vcGVyYXRlLmJpbmQoc2Vzc2lvbik7XG4oZ2xvYmFsIGFzIGFueSkuYXNzZXJ0ID0gc2Vzc2lvbi5hc3NlcnQuYmluZChzZXNzaW9uKTtcbiJdfQ== |
/// <amd-module name="@dataform/core/operation" /> | ||
import { Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
import { Session } from "./index"; | ||
export declare type OContextable<T> = T | ((ctx: OperationContext) => T); | ||
@@ -14,2 +14,9 @@ export declare class Operation { | ||
} | ||
export declare class SqlxOperationContext { | ||
private operation?; | ||
constructor(operation: Operation); | ||
self(): string; | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
} | ||
export declare class OperationContext { | ||
@@ -16,0 +23,0 @@ private operation?; |
@@ -43,2 +43,18 @@ (function (factory) { | ||
exports.Operation = Operation; | ||
class SqlxOperationContext { | ||
constructor(operation) { | ||
this.operation = operation; | ||
} | ||
self() { | ||
return this.resolve(this.operation.proto.name); | ||
} | ||
ref(name) { | ||
this.operation.dependencies(name); | ||
return this.resolve(name); | ||
} | ||
resolve(name) { | ||
return this.operation.session.resolve(name); | ||
} | ||
} | ||
exports.SqlxOperationContext = SqlxOperationContext; | ||
class OperationContext { | ||
@@ -77,2 +93,2 @@ constructor(operation) { | ||
}); | ||
//# sourceMappingURL=data:application/json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PdXRwdXQoaGFzT3V0cHV0OiBib29sZWFuKSB7XG4gICAgdGhpcy5vcGVyYXRpb24uaGFzT3V0cHV0KGhhc091dHB1dCk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgYXBwbHk8VD4odmFsdWU6IE9Db250ZXh0YWJsZTxUPik6IFQge1xuICAgIGlmICh0eXBlb2YgdmFsdWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgcmV0dXJuICh2YWx1ZSBhcyBhbnkpKHRoaXMpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICB9XG59XG4iXX0= |
{ | ||
"name": "@dataform/core", | ||
"version": "0.1.0", | ||
"description": "Dataform core API.", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"@dataform/protos": "^0.1.0", | ||
"protobufjs": "^6.8.8" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} | ||
"name": "@dataform/core", | ||
"description": "Dataform core API.", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"@dataform/protos": "1.0.0-alpha", | ||
"moo": "^0.5.0", | ||
"protobufjs": "^6.8.8" | ||
}, | ||
"version": "1.0.0-alpha", | ||
"homepage": "https://github.com/dataform-co/dataform", | ||
"license": "MIT", | ||
"keywords": [ | ||
"dataform", | ||
"etl", | ||
"data-pipeline", | ||
"big-data", | ||
"data-modelling", | ||
"sql", | ||
"bigquery", | ||
"redshift", | ||
"dataops" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
/// <amd-module name="@dataform/core/session" /> | ||
import * as adapters from "@dataform/core/adapters"; | ||
import { AContextable, Assertion } from "@dataform/core/assertion"; | ||
import { OContextable, Operation } from "@dataform/core/operation"; | ||
import { Table, TConfig, TContextable } from "@dataform/core/table"; | ||
import { dataform } from "@dataform/protos"; | ||
import * as adapters from "./adapters"; | ||
import { AContextable, Assertion } from "./assertion"; | ||
import { OContextable, Operation } from "./operation"; | ||
import { Table, TConfig, TContextable } from "./table"; | ||
interface IActionProto { | ||
@@ -12,2 +12,8 @@ name?: string; | ||
} | ||
interface ISqlxConfig extends TConfig { | ||
type: "view" | "table" | "inline" | "incremental" | "assertion" | "operations"; | ||
schema?: string; | ||
name: string; | ||
hasOutput?: boolean; | ||
} | ||
export declare class Session { | ||
@@ -29,9 +35,15 @@ rootDir: string; | ||
adapter(): adapters.IAdapter; | ||
sqlxAction(actionOptions: { | ||
sqlxConfig: ISqlxConfig; | ||
sqlStatementCount: number; | ||
hasIncremental: boolean; | ||
hasPreOperations: boolean; | ||
hasPostOperations: boolean; | ||
}): Operation | Table | Assertion; | ||
target(target: string, defaultSchema?: string): dataform.ITarget; | ||
resolve(name: string): string; | ||
operate(name: string, queries?: OContextable<string | string[]>): Operation; | ||
materialize(name: string, queryOrConfig?: TContextable<string> | TConfig): Table; | ||
publish(name: string, queryOrConfig?: TContextable<string> | TConfig): Table; | ||
assert(name: string, query?: AContextable<string>): Assertion; | ||
compileError(err: Error, path?: string): void; | ||
compileError(err: Error | string, path?: string): void; | ||
compileGraphChunk<T>(part: { | ||
@@ -44,3 +56,4 @@ [name: string]: { | ||
compile(): dataform.ICompiledGraph; | ||
isDatasetType(type: any): boolean; | ||
} | ||
export {}; |
109
session.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/session", ["require", "exports", "@dataform/protos", "@dataform/core/adapters/index", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/table", "@dataform/core/utils"], factory); | ||
define("@dataform/core/session", ["require", "exports", "@dataform/core/adapters/index", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/table", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -13,3 +13,2 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const protos_1 = require("@dataform/protos"); | ||
const adapters = require("@dataform/core/adapters/index"); | ||
@@ -20,2 +19,3 @@ const assertion_1 = require("@dataform/core/assertion"); | ||
const utils = require("@dataform/core/utils"); | ||
const protos_1 = require("@dataform/protos"); | ||
class Session { | ||
@@ -39,2 +39,74 @@ constructor(rootDir, projectConfig) { | ||
} | ||
sqlxAction(actionOptions) { | ||
if (actionOptions.sqlStatementCount > 1 && actionOptions.sqlxConfig.type !== "operations") { | ||
this.compileError("Actions may only contain more than one SQL statement if they are of type 'operations'."); | ||
} | ||
if (actionOptions.sqlxConfig.hasOutput && | ||
(actionOptions.sqlxConfig.type !== "operations" || | ||
this.isDatasetType(actionOptions.sqlxConfig.type))) { | ||
this.compileError("Actions may only specify 'hasOutput: true' if they are of type 'operations' or create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.hasOutput && actionOptions.sqlStatementCount !== 1) { | ||
this.compileError("Operations with 'hasOutput: true' must contain exactly one SQL statement."); | ||
} | ||
if (actionOptions.sqlxConfig.protected && actionOptions.sqlxConfig.type !== "incremental") { | ||
this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'."); | ||
} | ||
if (actionOptions.hasIncremental && actionOptions.sqlxConfig.type !== "incremental") { | ||
this.compileError("Actions may only include incremental_where if they are of type 'incremental'."); | ||
} | ||
if (actionOptions.sqlxConfig.disabled && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'disabled: true' if they create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.redshift && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'redshift: { ... }' if they create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.bigquery && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'bigquery: { ... }' if they create a dataset."); | ||
} | ||
if (actionOptions.hasPreOperations && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only include pre_operations if they create a dataset."); | ||
} | ||
if (actionOptions.hasPostOperations && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only include post_operations if they create a dataset."); | ||
} | ||
const action = (() => { | ||
switch (actionOptions.sqlxConfig.type) { | ||
case "view": | ||
case "table": | ||
case "inline": | ||
case "incremental": { | ||
const dataset = this.publish(actionOptions.sqlxConfig.name); | ||
dataset.config(actionOptions.sqlxConfig); | ||
return dataset; | ||
} | ||
case "assertion": { | ||
const assertion = this.assert(actionOptions.sqlxConfig.name); | ||
assertion.dependencies(actionOptions.sqlxConfig.dependencies); | ||
return assertion; | ||
} | ||
case "operations": { | ||
const operations = this.operate(actionOptions.sqlxConfig.name); | ||
if (!actionOptions.sqlxConfig.hasOutput) { | ||
delete operations.proto.target; | ||
} | ||
operations.dependencies(actionOptions.sqlxConfig.dependencies); | ||
return operations; | ||
} | ||
default: { | ||
throw new Error(`Unrecognized action type: ${actionOptions.sqlxConfig.type}`); | ||
} | ||
} | ||
})(); | ||
if (actionOptions.sqlxConfig.schema) { | ||
action.proto.target.schema = actionOptions.sqlxConfig.schema; | ||
} | ||
if (actionOptions.sqlxConfig.name) { | ||
action.proto.name = actionOptions.sqlxConfig.name; | ||
if (action.proto.target) { | ||
action.proto.target.name = actionOptions.sqlxConfig.name; | ||
} | ||
} | ||
return action; | ||
} | ||
target(target, defaultSchema) { | ||
@@ -73,8 +145,5 @@ const suffix = !!this.config.schemaSuffix ? `_${this.config.schemaSuffix}` : ""; | ||
} | ||
materialize(name, queryOrConfig) { | ||
return this.publish(name, queryOrConfig); | ||
} | ||
publish(name, queryOrConfig) { | ||
if (this.tables[name]) { | ||
const message = `Duplicate node name detected, names must be unique across tables, assertions, and operations: "${name}"`; | ||
const message = `Duplicate action name detected, names must be unique across tables, assertions, and operations: "${name}"`; | ||
this.compileError(new Error(message)); | ||
@@ -113,6 +182,11 @@ } | ||
const compileError = protos_1.dataform.CompilationError.create({ | ||
stack: err.stack, | ||
fileName, | ||
message: err.message | ||
fileName | ||
}); | ||
if (typeof err === "string") { | ||
compileError.message = err; | ||
} | ||
else { | ||
compileError.message = err.message; | ||
compileError.stack = err.stack; | ||
} | ||
this.graphErrors.compilationErrors.push(compileError); | ||
@@ -141,7 +215,7 @@ } | ||
}); | ||
const allNodes = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allNodeNames = allNodes.map(node => node.name); | ||
allNodes.forEach(node => { | ||
const allActions = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allActionNames = allActions.map(action => action.name); | ||
allActions.forEach(action => { | ||
const uniqueDependencies = {}; | ||
const dependencies = node.dependencies || []; | ||
const dependencies = action.dependencies || []; | ||
dependencies | ||
@@ -151,11 +225,14 @@ .filter(dependency => !dependency.includes("*")) | ||
utils | ||
.matchPatterns(dependencies.filter(d => d.includes("*")), allNodeNames) | ||
.matchPatterns(dependencies.filter(d => d.includes("*")), allActionNames) | ||
.forEach(dependency => (uniqueDependencies[dependency] = true)); | ||
node.dependencies = Object.keys(uniqueDependencies); | ||
action.dependencies = Object.keys(uniqueDependencies); | ||
}); | ||
return compiledGraph; | ||
} | ||
isDatasetType(type) { | ||
return type === "view" || type === "table" || type === "inline" || type === "incremental"; | ||
} | ||
} | ||
exports.Session = Session; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Vzc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2NvcmUvc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztJQUFBLDZDQUE0QztJQUM1QywwREFBdUM7SUFDdkMsd0RBQXNEO0lBQ3RELHdEQUFzRDtJQUN0RCxnREFBdUQ7SUFDdkQsOENBQWlDO0lBUWpDLE1BQWEsT0FBTztRQVdsQixZQUFZLE9BQWUsRUFBRSxhQUF1QztZQUNsRSxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sRU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dCBmaWxlTmFtZSA9IHBhdGggfHwgdXRpbHMuZ2V0Q2FsbGVyRmlsZSh0aGlzLnJvb3REaXIpIHx8IF9fZmlsZW5hbWU7XG5cbiAgICBjb25zdCBjb21waWxlRXJyb3IgPSBkYXRhZm9ybS5Db21waWxhdGlvbkVycm9yLmNyZWF0ZSh7XG4gICAgICBmaWxlTmFtZVxuICAgIH0pO1xuICAgIGlmICh0eXBlb2YgZXJyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICBjb21waWxlRXJyb3IubWVzc2FnZSA9IGVycjtcbiAgICB9IGVsc2Uge1xuICAgICAgY29tcGlsZUVycm9yLm1lc3NhZ2UgPSBlcnIubWVzc2FnZTtcbiAgICAgIGNvbXBpbGVFcnJvci5zdGFjayA9IGVyci5zdGFjaztcbiAgICB9XG4gICAgdGhpcy5ncmFwaEVycm9ycy5jb21waWxhdGlvbkVycm9ycy5wdXNoKGNvbXBpbGVFcnJvcik7XG4gIH1cblxuICBwdWJsaWMgY29tcGlsZUdyYXBoQ2h1bms8VD4ocGFydDoge1xuICAgIFtuYW1lOiBzdHJpbmddOiB7IHByb3RvOiBJQWN0aW9uUHJvdG87IGNvbXBpbGUoKTogVCB9O1xuICB9KTogVFtdIHtcbiAgICBjb25zdCBjb21waWxlZENodW5rczogVFtdID0gW107XG5cbiAgICBPYmplY3Qua2V5cyhwYXJ0KS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICB0cnkge1xuICAgICAgICBjb25zdCBjb21waWxlZENodW5rID0gcGFydFtrZXldLmNvbXBpbGUoKTtcbiAgICAgICAgY29tcGlsZWRDaHVua3MucHVzaChjb21waWxlZENodW5rKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgdGhpcy5jb21waWxlRXJyb3IoZSwgcGFydFtrZXldLnByb3RvLmZpbGVOYW1lKTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHJldHVybiBjb21waWxlZENodW5rcztcbiAgfVxuXG4gIHB1YmxpYyBj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xuICAgICAgZGVwZW5kZW5jaWVzXG4gICAgICAgIC5maWx0ZXIoZGVwZW5kZW5jeSA9PiAhZGVwZW5kZW5jeS5pbmNsdWRlcyhcIipcIikpXG4gICAgICAgIC5mb3JFYWNoKGRlcGVuZGVuY3kgPT4gKHVuaXF1ZURlcGVuZGVuY2llc1tkZXBlbmRlbmN5XSA9IHRydWUpKTtcbiAgICAgIC8vIE1hdGNoIHdpbGRjYXJkIGRlcHMgYWdhaW5zdCBhbGwgYWN0aW9uIG5hbWVzLlxuICAgICAgdXRpbHNcbiAgICAgICAgLm1hdGNoUGF0dGVybnMoZGVwZW5kZW5jaWVzLmZpbHRlcihkID0+IGQuaW5jbHVkZXMoXCIqXCIpKSwgYWxsQWN0aW9uTmFtZXMpXG4gICAgICAgIC5mb3JFYWNoKGRlcGVuZGVuY3kgPT4gKHVuaXF1ZURlcGVuZGVuY2llc1tkZXBlbmRlbmN5XSA9IHRydWUpKTtcbiAgICAgIGFjdGlvbi5kZXBlbmRlbmNpZXMgPSBPYmplY3Qua2V5cyh1bmlxdWVEZXBlbmRlbmNpZXMpO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIGNvbXBpbGVkR3JhcGg7XG4gIH1cblxuICBwdWJsaWMgaXNEYXRhc2V0VHlwZSh0eXBlKSB7XG4gICAgcmV0dXJuIHR5cGUgPT09IFwidmlld1wiIHx8IHR5cGUgPT09IFwidGFibGVcIiB8fCB0eXBlID09PSBcImlubGluZVwiIHx8IHR5cGUgPT09IFwiaW5jcmVtZW50YWxcIjtcbiAgfVxufVxuIl19 |
/// <amd-module name="@dataform/core/table" /> | ||
import { Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
import { Session } from "./index"; | ||
export declare enum TableTypes { | ||
@@ -27,6 +27,2 @@ TABLE = "table", | ||
type?: TableType; | ||
query?: TContextable<string>; | ||
where?: TContextable<string>; | ||
preOps?: TContextable<string | string[]>; | ||
postOps?: TContextable<string | string[]>; | ||
dependencies?: string | string[]; | ||
@@ -37,2 +33,3 @@ descriptor?: string[] | { | ||
disabled?: boolean; | ||
protected?: boolean; | ||
redshift?: dataform.IRedshiftOptions; | ||
@@ -66,2 +63,9 @@ bigquery?: dataform.IBigQueryOptions; | ||
} | ||
export declare class SqlxTableContext { | ||
private table?; | ||
constructor(table: Table); | ||
self(): string; | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
} | ||
export declare class TableContext { | ||
@@ -68,0 +72,0 @@ private table?; |
37
table.js
@@ -53,17 +53,5 @@ (function (factory) { | ||
config(config) { | ||
if (config.where) { | ||
this.where(config.where); | ||
} | ||
if (config.type) { | ||
this.type(config.type); | ||
} | ||
if (config.query) { | ||
this.query(config.query); | ||
} | ||
if (config.preOps) { | ||
this.preOps(config.preOps); | ||
} | ||
if (config.postOps) { | ||
this.postOps(config.postOps); | ||
} | ||
if (config.dependencies) { | ||
@@ -182,2 +170,23 @@ this.dependencies(config.dependencies); | ||
exports.Table = Table; | ||
class SqlxTableContext { | ||
constructor(table) { | ||
this.table = table; | ||
} | ||
self() { | ||
return this.resolve(this.table.proto.name); | ||
} | ||
ref(name) { | ||
if (!name) { | ||
const message = `Node name is not specified`; | ||
this.table.session.compileError(new Error(message)); | ||
return ""; | ||
} | ||
this.table.dependencies(name); | ||
return this.resolve(name); | ||
} | ||
resolve(name) { | ||
return this.table.session.resolve(name); | ||
} | ||
} | ||
exports.SqlxTableContext = SqlxTableContext; | ||
class TableContext { | ||
@@ -196,3 +205,3 @@ constructor(table) { | ||
if (!name) { | ||
const message = `Node name is not specified`; | ||
const message = `Action name is not specified`; | ||
this.table.session.compileError(new Error(message)); | ||
@@ -258,2 +267,2 @@ return ""; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3RhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ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cmV0dXJuIGtleTtcbiAgfVxuXG4gIHB1YmxpYyBhcHBseTxUPih2YWx1ZTogVENvbnRleHRhYmxlPFQ+KTogVCB7XG4gICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICByZXR1cm4gKHZhbHVlIGFzIGFueSkodGhpcyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG4gIH1cbn1cbiJdfQ== |
94
utils.js
@@ -99,68 +99,68 @@ (function (factory) { | ||
const validationErrors = []; | ||
const allNodes = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allNodeNames = allNodes.map(node => node.name); | ||
allNodes.forEach(node => { | ||
if (allNodes.filter(subNode => subNode.name == node.name).length > 1) { | ||
const nodeName = node.name; | ||
const message = `Duplicate node name detected, names must be unique across tables, assertions, and operations: "${node.name}"`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
const allActions = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allActionNames = allActions.map(action => action.name); | ||
allActions.forEach(action => { | ||
if (allActions.filter(subAction => subAction.name == action.name).length > 1) { | ||
const actionName = action.name; | ||
const message = `Duplicate action name detected, names must be unique across tables, assertions, and operations: "${action.name}"`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
}); | ||
const nodesByName = {}; | ||
allNodes.forEach(node => (nodesByName[node.name] = node)); | ||
allNodes.forEach(node => { | ||
const nodeName = node.name; | ||
(node.dependencies || []).forEach(dependency => { | ||
if (allNodeNames.indexOf(dependency) < 0) { | ||
const message = `Missing dependency detected: Node "${node.name}" depends on "${dependency}" which does not exist.`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
const actionsByName = {}; | ||
allActions.forEach(action => (actionsByName[action.name] = action)); | ||
allActions.forEach(action => { | ||
const actionName = action.name; | ||
(action.dependencies || []).forEach(dependency => { | ||
if (allActionNames.indexOf(dependency) < 0) { | ||
const message = `Missing dependency detected: Node "${action.name}" depends on "${dependency}" which does not exist.`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
}); | ||
}); | ||
const checkCircular = (node, dependents) => { | ||
if (dependents.indexOf(node) >= 0) { | ||
const nodeName = node.name; | ||
const checkCircular = (action, dependents) => { | ||
if (dependents.indexOf(action) >= 0) { | ||
const actionName = action.name; | ||
const message = `Circular dependency detected in chain: [${dependents | ||
.map(d => d.name) | ||
.join(" > ")} > ${node.name}]`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
.join(" > ")} > ${action.name}]`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
return true; | ||
} | ||
return (node.dependencies || []).some(d => { | ||
return nodesByName[d] && checkCircular(nodesByName[d], dependents.concat([node])); | ||
return (action.dependencies || []).some(d => { | ||
return actionsByName[d] && checkCircular(actionsByName[d], dependents.concat([action])); | ||
}); | ||
}; | ||
for (let i = 0; i < allNodes.length; i++) { | ||
if (checkCircular(allNodes[i], [])) { | ||
for (let i = 0; i < allActions.length; i++) { | ||
if (checkCircular(allActions[i], [])) { | ||
break; | ||
} | ||
} | ||
compiledGraph.tables.forEach(node => { | ||
const nodeName = node.name; | ||
if (!!node.type && | ||
compiledGraph.tables.forEach(action => { | ||
const actionName = action.name; | ||
if (!!action.type && | ||
Object.keys(table_1.TableTypes) | ||
.map(key => table_1.TableTypes[key]) | ||
.indexOf(node.type) === -1) { | ||
.indexOf(action.type) === -1) { | ||
const predefinedTypes = getPredefinedTypes(table_1.TableTypes); | ||
const message = `Wrong type of table detected. Should only use predefined types: ${predefinedTypes}`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
if (node.type === table_1.TableTypes.INCREMENTAL && (!node.where || node.where.length === 0)) { | ||
if (action.type === table_1.TableTypes.INCREMENTAL && (!action.where || action.where.length === 0)) { | ||
const message = `"where" property is not defined. With the type “incremental” you must also specify the property “where”!`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
if (!!node.redshift) { | ||
if (Object.keys(node.redshift).length === 0 || | ||
Object.keys(node.redshift).every(key => !node.redshift[key] || !node.redshift[key].length)) { | ||
if (!!action.redshift) { | ||
if (Object.keys(action.redshift).length === 0 || | ||
Object.keys(action.redshift).every(key => !action.redshift[key] || !action.redshift[key].length)) { | ||
const message = `Missing properties in redshift config`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
const redshiftConfig = []; | ||
if (node.redshift.distStyle || node.redshift.distKey) { | ||
const props = { distStyle: node.redshift.distStyle, distKey: node.redshift.distKey }; | ||
if (action.redshift.distStyle || action.redshift.distKey) { | ||
const props = { distStyle: action.redshift.distStyle, distKey: action.redshift.distKey }; | ||
const types = { distStyle: table_1.DistStyleTypes }; | ||
redshiftConfig.push({ props, types }); | ||
} | ||
if (node.redshift.sortStyle || (node.redshift.sortKeys && node.redshift.sortKeys.length)) { | ||
const props = { sortStyle: node.redshift.sortStyle, sortKeys: node.redshift.sortKeys }; | ||
if (action.redshift.sortStyle || (action.redshift.sortKeys && action.redshift.sortKeys.length)) { | ||
const props = { sortStyle: action.redshift.sortStyle, sortKeys: action.redshift.sortKeys }; | ||
const types = { sortStyle: table_1.SortStyleTypes }; | ||
@@ -173,3 +173,3 @@ redshiftConfig.push({ props, types }); | ||
const message = `Property "${key}" is not defined`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
@@ -185,3 +185,3 @@ }); | ||
const message = `Wrong value of "${type}" property. Should only use predefined values: ${predefinedValues}`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
@@ -191,7 +191,7 @@ }); | ||
} | ||
if (!!table_1.ignoredProps[node.type]) { | ||
table_1.ignoredProps[node.type].forEach(ignoredProp => { | ||
if (objectExistsOrIsNonEmpty(node[ignoredProp])) { | ||
const message = `Unused property was detected: "${ignoredProp}". This property is not used for tables with type "${node.type}" and will be ignored.`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, nodeName })); | ||
if (!!table_1.ignoredProps[action.type]) { | ||
table_1.ignoredProps[action.type].forEach(ignoredProp => { | ||
if (objectExistsOrIsNonEmpty(action[ignoredProp])) { | ||
const message = `Unused property was detected: "${ignoredProp}". This property is not used for tables with type "${action.type}" and will be ignored.`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
@@ -208,2 +208,2 @@ }); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQUEsNkNBQTRDO0lBQzVDLGdEQUFtRjtJQUVuRixTQUFnQixZQUFZLENBQUMsSUFBWSxFQUFFLElBQVk7UUFDckQsSUFBSSxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsRUFBRTtZQUNwQixPQUFPLElBQUksQ0FBQztTQUNiO1FBQ0QsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDMUMsSUFBSSxRQUFRLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxFQUFFO1lBQzVCLE9BQU8sU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b25OYW1lIH0pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIE9iamVjdC5rZXlzKGl0ZW0udHlwZXMpLmZvckVhY2godHlwZSA9PiB7XG4gICAgICAgICAgY29uc3QgY3VycmVudEVudW0gPSBpdGVtLnR5cGVzW3R5cGVdO1xuICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICEhaXRlbS5wcm9wc1t0eXBlXSAmJlxuICAgICAgICAgICAgT2JqZWN0LmtleXMoY3VycmVudEVudW0pXG4gICAgICAgICAgICAgIC5tYXAoa2V5ID0+IGN1cnJlbnRFbnVtW2tleV0pXG4gICAgICAgICAgICAgIC5pbmRleE9mKGl0ZW0ucHJvcHNbdHlwZV0pID09PSAtMVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgcHJlZGVmaW5lZFZhbHVlcyA9IGdldFByZWRlZmluZWRUeXBlcyhjdXJyZW50RW51bSk7XG4gICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gYFdyb25nIHZhbHVlIG9mIFwiJHt0eXBlfVwiIHByb3BlcnR5LiBTaG91bGQgb25seSB1c2UgcHJlZGVmaW5lZCB2YWx1ZXM6ICR7cHJlZGVmaW5lZFZhbHVlc31gO1xuICAgICAgICAgICAgdmFsaWRhdGlvbkVycm9ycy5wdXNoKGRhdGFmb3JtLlZhbGlkYXRpb25FcnJvci5jcmVhdGUoeyBtZXNzYWdlLCBhY3Rpb25OYW1lIH0pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG4gICAgfVxuXG4gICAgLy8gaWdub3JlZCBwcm9wZXJ0aWVzIGluIHRhYmxlc1xuICAgIGlmICghIWlnbm9yZWRQcm9wc1thY3Rpb24udHlwZV0pIHtcbiAgICAgIGlnbm9yZWRQcm9wc1thY3Rpb24udHlwZV0uZm9yRWFjaChpZ25vcmVkUHJvcCA9PiB7XG4gICAgICAgIGlmIChvYmplY3RFeGlzdHNPcklzTm9uRW1wdHkoYWN0aW9uW2lnbm9yZWRQcm9wXSkpIHtcbiAgICAgICAgICBjb25zdCBtZXNzYWdlID0gYFVudXNlZCBwcm9wZXJ0eSB3YXMgZGV0ZWN0ZWQ6IFwiJHtpZ25vcmVkUHJvcH1cIi4gVGhpcyBwcm9wZXJ0eSBpcyBub3QgdXNlZCBmb3IgdGFibGVzIHdpdGggdHlwZSBcIiR7XG4gICAgICAgICAgICBhY3Rpb24udHlwZVxuICAgICAgICAgICAgfVwiIGFuZCB3aWxsIGJlIGlnbm9yZWQuYDtcbiAgICAgICAgICB2YWxpZGF0aW9uRXJyb3JzLnB1c2goZGF0YWZvcm0uVmFsaWRhdGlvbkVycm9yLmNyZWF0ZSh7IG1lc3NhZ2UsIGFjdGlvbk5hbWUgfSkpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9XG4gIH0pO1xuXG4gIGNvbnN0IGNvbXBpbGF0aW9uRXJyb3JzID1cbiAgICBjb21waWxlZEdyYXBoLmdyYXBoRXJyb3JzICYmIGNvbXBpbGVkR3JhcGguZ3JhcGhFcnJvcnMuY29tcGlsYXRpb25FcnJvcnNcbiAgICAgID8gY29tcGlsZWRHcmFwaC5ncmFwaEVycm9ycy5jb21waWxhdGlvbkVycm9yc1xuICAgICAgOiBbXTtcblxuICByZXR1cm4gZGF0YWZvcm0uR3JhcGhFcnJvcnMuY3JlYXRlKHsgdmFsaWRhdGlvbkVycm9ycywgY29tcGlsYXRpb25FcnJvcnMgfSk7XG59XG4iXX0= |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
251528
31
0
2103
1
3
1
+ Addedmoo@^0.5.0
+ Added@dataform/protos@1.0.0-alpha(transitive)
+ Addedmoo@0.5.2(transitive)
- Removed@dataform/protos@0.1.0(transitive)
Updated@dataform/protos@1.0.0-alpha