@lightdash/cli 2.136.2 → 2.137.0

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 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/dbt/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,eAAe,EACf,YAAY,EAOZ,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAG3B,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAaF,eAAO,MAAM,gBAAgB,gBACZ,MAAM,mBACF,kBAAkB,UAC3B,eAAe,EAAE,mBACT,WAAW,CAAC,MAAM,CAAC,KACpC,OAAO,CAAC,uBAAuB,CAuEjC,CAAC"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/dbt/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,eAAe,EACf,YAAY,EAMZ,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAI3B,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAaF,eAAO,MAAM,gBAAgB,gBACZ,MAAM,mBACF,kBAAkB,UAC3B,eAAe,EAAE,mBACT,WAAW,CAAC,MAAM,CAAC,KACpC,OAAO,CAAC,uBAAuB,CAuEjC,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateDbtModel = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@lightdash/common");
6
+ const validation_1 = require("@lightdash/common/dbt/validation");
6
7
  const globalState_1 = tslib_1.__importDefault(require("../globalState"));
7
8
  const formatServedManifestValidationError = (message) => {
8
9
  const details = message
@@ -14,7 +15,7 @@ const formatServedManifestValidationError = (message) => {
14
15
  const validateDbtModel = async (adapterType, manifestVersion, models, servedModelIds = new Set()) => {
15
16
  globalState_1.default.debug(`> Validating ${models.length} models from dbt manifest`);
16
17
  globalState_1.default.debug(`> Validating models using dbt manifest version ${manifestVersion}`);
17
- const validator = new common_1.ManifestValidator(manifestVersion);
18
+ const validator = new validation_1.ManifestValidator(manifestVersion);
18
19
  const results = models.reduce((acc, model) => {
19
20
  let error;
20
21
  // Match against json schema
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const common_1 = require("@lightdash/common");
4
- const validation_1 = require("./validation");
4
+ const validation_1 = require("@lightdash/common/dbt/validation");
5
+ const validation_2 = require("./validation");
5
6
  const makeModel = (name) => ({
6
7
  unique_id: `model.test.${name}`,
7
8
  name,
@@ -19,11 +20,11 @@ describe('validateDbtModel', () => {
19
20
  const invalidValidator = Object.assign(vi.fn().mockReturnValue(false), {
20
21
  errors: [],
21
22
  });
22
- vi.spyOn(common_1.ManifestValidator, 'getValidator').mockReturnValue(invalidValidator);
23
- vi.spyOn(common_1.ManifestValidator, 'formatAjvErrors').mockReturnValue(validationMessage);
23
+ vi.spyOn(validation_1.ManifestValidator, 'getValidator').mockReturnValue(invalidValidator);
24
+ vi.spyOn(validation_1.ManifestValidator, 'formatAjvErrors').mockReturnValue(validationMessage);
24
25
  const servedModel = makeModel('served_orders');
25
26
  const localModel = makeModel('local_orders');
26
- const result = await (0, validation_1.validateDbtModel)('postgres', common_1.DbtManifestVersion.V11, [servedModel, localModel], new Set([servedModel.unique_id]));
27
+ const result = await (0, validation_2.validateDbtModel)('postgres', common_1.DbtManifestVersion.V11, [servedModel, localModel], new Set([servedModel.unique_id]));
27
28
  const servedMessage = result.invalid[0].errors[0].message;
28
29
  const localMessage = result.invalid[1].errors[0].message;
29
30
  expect(servedMessage).toContain('The served manifest is outdated.');
@@ -54,7 +55,7 @@ describe('validateDbtModel', () => {
54
55
  },
55
56
  },
56
57
  };
57
- const result = await (0, validation_1.validateDbtModel)('postgres', common_1.DbtManifestVersion.V12, [validModel, invalidModel]);
58
+ const result = await (0, validation_2.validateDbtModel)('postgres', common_1.DbtManifestVersion.V12, [validModel, invalidModel]);
58
59
  expect(result.valid.map(({ name }) => name)).toEqual(['valid_orders']);
59
60
  expect(result.invalid).toMatchObject([
60
61
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "2.136.2",
3
+ "version": "2.137.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,8 +45,8 @@
45
45
  "unique-names-generator": "4.7.1",
46
46
  "uuid": "11.1.1",
47
47
  "yaml": "2.8.3",
48
- "@lightdash/warehouses": "2.136.2",
49
- "@lightdash/common": "2.136.2"
48
+ "@lightdash/common": "2.137.0",
49
+ "@lightdash/warehouses": "2.137.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/inquirer": "8.2.4",