@vizzly/semantic-layer-public 0.0.113 → 0.0.115
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import validate, { ConfigValidationOptions } from './validate';
|
|
2
|
-
export { validate, ConfigValidationOptions };
|
|
1
|
+
import validate, { ConfigValidationOptions, ALLOWED_ID_REGEX, ID_REGEX_ERROR_MESSAGE } from './validate';
|
|
2
|
+
export { validate, ConfigValidationOptions, ALLOWED_ID_REGEX, ID_REGEX_ERROR_MESSAGE };
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validate = void 0;
|
|
7
|
-
const validate_1 =
|
|
26
|
+
exports.ID_REGEX_ERROR_MESSAGE = exports.ALLOWED_ID_REGEX = exports.validate = void 0;
|
|
27
|
+
const validate_1 = __importStar(require("./validate"));
|
|
8
28
|
exports.validate = validate_1.default;
|
|
29
|
+
Object.defineProperty(exports, "ALLOWED_ID_REGEX", { enumerable: true, get: function () { return validate_1.ALLOWED_ID_REGEX; } });
|
|
30
|
+
Object.defineProperty(exports, "ID_REGEX_ERROR_MESSAGE", { enumerable: true, get: function () { return validate_1.ID_REGEX_ERROR_MESSAGE; } });
|
|
@@ -11,5 +11,12 @@ export type ConfigValidationOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const _fieldSchema: (client: Client) => Joi.ObjectSchema<any>;
|
|
13
13
|
export declare const _sqlDataSetSchema: (fieldSchema: Joi.Schema) => Joi.ObjectSchema<any>;
|
|
14
|
+
export declare const bigQuerySchema: Joi.ObjectSchema<any>;
|
|
15
|
+
export declare const postgresSchema: Joi.ObjectSchema<any>;
|
|
16
|
+
export declare const mariadbSchema: Joi.ObjectSchema<any>;
|
|
17
|
+
export declare const mySQLSchema: Joi.ObjectSchema<any>;
|
|
18
|
+
export declare const snowflakeSchema: Joi.ObjectSchema<any>;
|
|
19
|
+
export declare const microsoftSQLServerSchema: Joi.ObjectSchema<any>;
|
|
20
|
+
export declare const redshiftSchema: Joi.ObjectSchema<any>;
|
|
14
21
|
declare const _default: (config: any, options?: Partial<ConfigValidationOptions>) => Joi.ValidationResult;
|
|
15
22
|
export default _default;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports._sqlDataSetSchema = exports._fieldSchema = exports.ID_REGEX_ERROR_MESSAGE = exports.ALLOWED_ID_REGEX = void 0;
|
|
6
|
+
exports.redshiftSchema = exports.microsoftSQLServerSchema = exports.snowflakeSchema = exports.mySQLSchema = exports.mariadbSchema = exports.postgresSchema = exports.bigQuerySchema = exports._sqlDataSetSchema = exports._fieldSchema = exports.ID_REGEX_ERROR_MESSAGE = exports.ALLOWED_ID_REGEX = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("@vizzly/joi"));
|
|
8
8
|
const getQueryEngineConfig_1 = require("../QueryEngineConfig/getQueryEngineConfig");
|
|
9
9
|
const constants_1 = require("./constants");
|
|
@@ -213,6 +213,13 @@ const configSchema = (fullObj, options) => joi_1.default.object({
|
|
|
213
213
|
.pattern(joi_1.default.string(), joi_1.default.object({ name: joi_1.default.string().required(), sql: joi_1.default.string().allow('').required() }))
|
|
214
214
|
.optional(),
|
|
215
215
|
});
|
|
216
|
+
exports.bigQuerySchema = configSchema({}, { onlyClients: ['bigquery'] });
|
|
217
|
+
exports.postgresSchema = configSchema({}, { onlyClients: ['postgres'] });
|
|
218
|
+
exports.mariadbSchema = configSchema({}, { onlyClients: ['mariadb'] });
|
|
219
|
+
exports.mySQLSchema = configSchema({}, { onlyClients: ['mysql'] });
|
|
220
|
+
exports.snowflakeSchema = configSchema({}, { onlyClients: ['snowflake'] });
|
|
221
|
+
exports.microsoftSQLServerSchema = configSchema({}, { onlyClients: ['microsoftSQLServer'] });
|
|
222
|
+
exports.redshiftSchema = configSchema({}, { onlyClients: ['redshift'] });
|
|
216
223
|
exports.default = (config, options = {}) => {
|
|
217
224
|
const validationResult = configSchema(config, Object.assign(Object.assign(Object.assign({}, DEFAULT_SCHEMA_OPTIONS), options), { dataSetIdToClientMapping: buildDataSetToClientTypeMapping(config) })).validate(config, joiOptions);
|
|
218
225
|
if (validationResult.error) {
|