@lightdash/common 0.1434.1 → 0.1434.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/types/dbt.d.ts +1 -0
- package/dist/types/dbt.js +12 -1
- package/dist/types/projects.d.ts +0 -2
- package/dist/types/projects.js +1 -23
- package/package.json +1 -1
package/dist/types/dbt.d.ts
CHANGED
@@ -256,6 +256,7 @@ export declare enum DbtManifestVersion {
|
|
256
256
|
V11 = "v11",
|
257
257
|
V12 = "v12"
|
258
258
|
}
|
259
|
+
export declare const getDbtManifestVersion: (manifest: DbtManifest) => DbtManifestVersion;
|
259
260
|
export declare enum DbtExposureType {
|
260
261
|
DASHBOARD = "dashboard",
|
261
262
|
NOTEBOOK = "notebook",
|
package/dist/types/dbt.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DbtExposureType = exports.DbtManifestVersion = exports.convertColumnMetric = exports.convertModelMetric = exports.isDbtRpcRunSqlResults = exports.convertToGroups = exports.isDbtRpcCompileResults = exports.isDbtRpcManifestResults = exports.isSupportedDbtAdapterType = exports.isSupportedDbtAdapter = exports.isV9MetricRef = exports.isDbtPackages = exports.isDbtRpcDocsGenerateResults = exports.buildModelGraph = exports.patchPathParts = exports.normaliseModelDatabase = exports.SupportedDbtAdapter = void 0;
|
3
|
+
exports.DbtExposureType = exports.getDbtManifestVersion = exports.DbtManifestVersion = exports.convertColumnMetric = exports.convertModelMetric = exports.isDbtRpcRunSqlResults = exports.convertToGroups = exports.isDbtRpcCompileResults = exports.isDbtRpcManifestResults = exports.isSupportedDbtAdapterType = exports.isSupportedDbtAdapter = exports.isV9MetricRef = exports.isDbtPackages = exports.isDbtRpcDocsGenerateResults = exports.buildModelGraph = exports.patchPathParts = exports.normaliseModelDatabase = exports.SupportedDbtAdapter = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const dependency_graph_1 = require("dependency-graph");
|
6
6
|
const assertUnreachable_1 = tslib_1.__importDefault(require("../utils/assertUnreachable"));
|
@@ -212,6 +212,17 @@ var DbtManifestVersion;
|
|
212
212
|
DbtManifestVersion["V11"] = "v11";
|
213
213
|
DbtManifestVersion["V12"] = "v12";
|
214
214
|
})(DbtManifestVersion = exports.DbtManifestVersion || (exports.DbtManifestVersion = {}));
|
215
|
+
const getDbtManifestVersion = (manifest) => {
|
216
|
+
const version = manifest.metadata.dbt_schema_version.match(/\/(v\d+).json/)?.[1];
|
217
|
+
if (!version) {
|
218
|
+
throw new Error(`Could not determine dbt manifest version from ${manifest.metadata.dbt_schema_version}`);
|
219
|
+
}
|
220
|
+
if (Object.values(DbtManifestVersion).includes(version)) {
|
221
|
+
return version;
|
222
|
+
}
|
223
|
+
throw new Error(`Unsupported dbt manifest version: ${version}`);
|
224
|
+
};
|
225
|
+
exports.getDbtManifestVersion = getDbtManifestVersion;
|
215
226
|
var DbtExposureType;
|
216
227
|
(function (DbtExposureType) {
|
217
228
|
DbtExposureType["DASHBOARD"] = "dashboard";
|
package/dist/types/projects.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import { type WeekDay } from '../utils/timeFrames';
|
2
|
-
import { DbtManifestVersion } from './dbt';
|
3
2
|
import { type ProjectGroupAccess } from './projectGroupAccess';
|
4
3
|
export declare enum ProjectType {
|
5
4
|
DEFAULT = "DEFAULT",
|
@@ -150,7 +149,6 @@ export declare enum SupportedDbtVersions {
|
|
150
149
|
V1_8 = "v1.8",
|
151
150
|
V1_9 = "v1.9"
|
152
151
|
}
|
153
|
-
export declare const GetDbtManifestVersion: (dbtVersion: SupportedDbtVersions) => DbtManifestVersion;
|
154
152
|
export declare const DefaultSupportedDbtVersion = SupportedDbtVersions.V1_4;
|
155
153
|
export interface DbtProjectCompilerBase extends DbtProjectConfigBase {
|
156
154
|
target?: string;
|
package/dist/types/projects.js
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DefaultSupportedDbtVersion = exports.
|
4
|
-
const tslib_1 = require("tslib");
|
5
|
-
const assertUnreachable_1 = tslib_1.__importDefault(require("../utils/assertUnreachable"));
|
6
|
-
const dbt_1 = require("./dbt");
|
3
|
+
exports.DefaultSupportedDbtVersion = exports.SupportedDbtVersions = exports.sensitiveCredentialsFieldNames = exports.SemanticLayerType = exports.WarehouseTypes = exports.DbtProjectType = exports.ProjectType = void 0;
|
7
4
|
var ProjectType;
|
8
5
|
(function (ProjectType) {
|
9
6
|
ProjectType["DEFAULT"] = "DEFAULT";
|
@@ -51,23 +48,4 @@ var SupportedDbtVersions;
|
|
51
48
|
SupportedDbtVersions["V1_8"] = "v1.8";
|
52
49
|
SupportedDbtVersions["V1_9"] = "v1.9";
|
53
50
|
})(SupportedDbtVersions = exports.SupportedDbtVersions || (exports.SupportedDbtVersions = {}));
|
54
|
-
const GetDbtManifestVersion = (dbtVersion) => {
|
55
|
-
switch (dbtVersion) {
|
56
|
-
case SupportedDbtVersions.V1_4:
|
57
|
-
return dbt_1.DbtManifestVersion.V8;
|
58
|
-
case SupportedDbtVersions.V1_5:
|
59
|
-
return dbt_1.DbtManifestVersion.V9;
|
60
|
-
case SupportedDbtVersions.V1_6:
|
61
|
-
return dbt_1.DbtManifestVersion.V10;
|
62
|
-
case SupportedDbtVersions.V1_7:
|
63
|
-
return dbt_1.DbtManifestVersion.V11;
|
64
|
-
case SupportedDbtVersions.V1_8:
|
65
|
-
case SupportedDbtVersions.V1_9:
|
66
|
-
return dbt_1.DbtManifestVersion.V12;
|
67
|
-
default:
|
68
|
-
(0, assertUnreachable_1.default)(dbtVersion, 'Missing dbt version manifest mapping');
|
69
|
-
}
|
70
|
-
return dbt_1.DbtManifestVersion.V8;
|
71
|
-
};
|
72
|
-
exports.GetDbtManifestVersion = GetDbtManifestVersion;
|
73
51
|
exports.DefaultSupportedDbtVersion = SupportedDbtVersions.V1_4;
|