@vizzly/cli
Advanced tools
Comparing version 0.0.21-rc to 0.0.21-rc-1
@@ -65,2 +65,3 @@ #!/usr/bin/env node | ||
var commands = __importStar(require("./commands")); | ||
var VizzlyConfig_1 = require("./Models/VizzlyConfig"); | ||
var program = new commander_1.Command(); | ||
@@ -101,2 +102,3 @@ program.description("Vizzly CLI."); | ||
.description("Create skeleton of the Vizzly config file.") | ||
.addOption(new commander_1.Option('-i, --integration <integration>', 'Integration type').choices(VizzlyConfig_1.SUPPORTED_CLIENTS).makeOptionMandatory()) | ||
.option("-pub, --public-key <type>", "Path to your public key.", commands.DEFAULT_PUBLIC_KEY_FILE_PATH) | ||
@@ -103,0 +105,0 @@ .action(commands.initVizzlyConfig); |
@@ -45,3 +45,3 @@ "use strict"; | ||
if (publicKeyContent) { | ||
var initialVizzlyConfig = VizzlyConfig.init(publicKeyContent); | ||
var initialVizzlyConfig = VizzlyConfig.init(args.integration, publicKeyContent); | ||
var configAsString = JSON.stringify(initialVizzlyConfig, null, 2); | ||
@@ -51,2 +51,3 @@ var vizzlyConfigFilePath = exports.DEFAULT_VIZZLY_CONFIG_FILE; | ||
console.log(chalk_1.default.cyanBright("Written Vizzly config to '".concat(vizzlyConfigFilePath, "'."))); | ||
console.log(chalk_1.default.gray("Values in curly braces {{...}} can be interpolated environment variables.\nOr you can hardcode the values in the config.")); | ||
} | ||
@@ -53,0 +54,0 @@ else { |
@@ -22,3 +22,5 @@ "use strict"; | ||
var validateConfig = function (params) { | ||
var configFile = loadConfigFile(params.config || initVizzlyConfig_1.DEFAULT_VIZZLY_CONFIG_FILE); | ||
var configFilePath = params.config || initVizzlyConfig_1.DEFAULT_VIZZLY_CONFIG_FILE; | ||
var configFile = loadConfigFile(configFilePath); | ||
console.log("Validating Vizzly config: '".concat(configFilePath, "'")); | ||
if (configFile) { | ||
@@ -25,0 +27,0 @@ var error = (0, validate_1.default)(configFile).error; |
@@ -22,2 +22,10 @@ "use strict"; | ||
var SUPPORTED_ALLOWED_GRANULARITIES = ['second', 'minute', 'hour', 'day', 'month', 'year']; | ||
var SUPPORTED_JOINS = [ | ||
"rightJoin", | ||
"leftJoin", | ||
"innerJoin", | ||
"outerJoin", | ||
"leftOuterJoin", | ||
"rightOuterJoin" | ||
]; | ||
var bigQueryConnectionSchema = joi_1.default.object({ | ||
@@ -47,3 +55,13 @@ projectId: joi_1.default.string().required(), | ||
}); | ||
var sqlJoinSchema = joi_1.default.object({}); | ||
var sqlJoinSchema = joi_1.default.object({ | ||
type: joi_1.default.valid.apply(joi_1.default, SUPPORTED_JOINS).required(), | ||
left: joi_1.default.object({ | ||
field: joi_1.default.string().required(), | ||
table: joi_1.default.string().required(), | ||
}).required(), | ||
right: joi_1.default.object({ | ||
field: joi_1.default.string().required(), | ||
table: joi_1.default.string().required(), | ||
}).required(), | ||
}); | ||
var baseDataSetSchema = function (fieldSchema) { return ({ | ||
@@ -50,0 +68,0 @@ id: joi_1.default.string().required(), |
"use strict"; | ||
// TODO initiate the different integration configs... | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.init = void 0; | ||
var init = function (publicKey) { return ({ | ||
connection: { client: "postgres", connection: { | ||
password: "{{VIZZLY_POSTGRES_PASSWORD}}", | ||
database: "{{VIZZLY_POSTGRES_DATABASE}}", | ||
user: "{{VIZZLY_POSTGRES_USER}}", | ||
host: "{{VIZZLY_POSTGRES_HOST}}", | ||
port: 5432 | ||
} }, | ||
exports.init = exports.SUPPORTED_CLIENTS = void 0; | ||
exports.SUPPORTED_CLIENTS = ["mariadb", "postgres", "bigquery", "elasticsearch"]; | ||
var buildConnection = function (client) { | ||
switch (client) { | ||
case "bigquery": | ||
return ({ | ||
client: "bigquery", | ||
connection: { | ||
"projectId": "{{VIZZLY_BIGQUERY_PROJECT_ID}}", | ||
"location": "{{VIZZLY_BIGQUERY_REGION}}", | ||
"keyFilename": "/etc/vizzly/bq/service-account.json" | ||
} | ||
}); | ||
case "elasticsearch": | ||
return ({ | ||
client: "elasticsearch", | ||
node: "{{VIZZLY_ELASTICSEARCH_NODE}}", | ||
auth: { | ||
apiKey: "{{VIZZLY_ELASTICSEARCH_API_KEY}}" | ||
} | ||
}); | ||
case "mariadb": | ||
return ({ | ||
client: "mariadb", | ||
connection: { | ||
database: "{{VIZZLY_MARIADB_DATABASE}}", | ||
host: "{{VIZZLY_MARIADB_HOST}}", | ||
password: "{{VIZZLY_MARIADB_PASSWORD}}", | ||
port: 3306, | ||
user: "{{VIZZLY_MARIADB_USER}}", | ||
} | ||
}); | ||
case "postgres": | ||
return ({ | ||
client: "postgres", | ||
connection: { | ||
database: "{{VIZZLY_POSTGRES_DATABASE}}", | ||
host: "{{VIZZLY_POSTGRES_HOST}}", | ||
password: "{{VIZZLY_POSTGRES_PASSWORD}}", | ||
port: 5432, | ||
user: "{{VIZZLY_POSTGRES_USER}}", | ||
} | ||
}); | ||
} | ||
}; | ||
var init = function (client, publicKey) { return ({ | ||
dataSets: [], | ||
publicKeyCertificates: [publicKey], | ||
connection: buildConnection(client) | ||
}); }; | ||
exports.init = init; |
{ | ||
"name": "@vizzly/cli", | ||
"version": "0.0.21-rc", | ||
"version": "0.0.21-rc-1", | ||
"main": "index.js", | ||
@@ -35,3 +35,3 @@ "repository": "git@github.com:vizzly-co/cli.git", | ||
"package": "pkg . --targets node14-macos-x64 --output vizzly", | ||
"test": "jest --colors src/**", | ||
"test": "jest --colors", | ||
"format": "yarn prettier --write ./src/**", | ||
@@ -38,0 +38,0 @@ "prepare": "yarn build", |
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
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
44967
874