@lightdash/query-sdk 1.39.2 → 1.40.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
- export declare const SDK_VERSION = "1.39.2";
1
+ export declare const SDK_VERSION = "1.40.0";
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/generateSdkVersion.mjs (prebuild) — do not edit.
2
- export const SDK_VERSION = '1.39.2';
2
+ export const SDK_VERSION = '1.40.0';
package/dist/query.js CHANGED
@@ -41,9 +41,18 @@ export class QueryBuilder {
41
41
  label: undefined,
42
42
  };
43
43
  }
44
- else {
44
+ else if (exploreOrState !== null &&
45
+ typeof exploreOrState === 'object' &&
46
+ Array.isArray(exploreOrState.dimensions)) {
45
47
  this._state = exploreOrState;
46
48
  }
49
+ else {
50
+ // Fail here, at the call site, instead of on a later chained call.
51
+ // The most common cause is a circular import: a model-name
52
+ // constant read before its module initialized is undefined.
53
+ throw new Error(`query() expects a model name string, got ${exploreOrState === null ? 'null' : typeof exploreOrState}. If the model name is a shared constant, make sure it is not ` +
54
+ 'exported from a file that imports this one (circular import).');
55
+ }
47
56
  }
48
57
  _clone(overrides) {
49
58
  return new QueryBuilder({ ...this._state, ...overrides });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/query-sdk",
3
- "version": "1.39.2",
3
+ "version": "1.40.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "SDK for building custom data apps against the Lightdash semantic layer",
@@ -34,7 +34,7 @@
34
34
  "jsdom": "26.1.0",
35
35
  "typescript": "7.0.2",
36
36
  "vitest": "4.1.6",
37
- "@lightdash/common": "1.39.2"
37
+ "@lightdash/common": "1.40.0"
38
38
  },
39
39
  "scripts": {
40
40
  "prebuild": "node ./scripts/generateSdkVersion.mjs",