@lightdash/cli 0.2363.0 → 0.2364.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":"createProject.d.ts","sourceRoot":"","sources":["../../src/handlers/createProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,+BAA+B,EAG/B,WAAW,EAGX,KAAK,uBAAuB,EAG/B,MAAM,mBAAmB,CAAC;AA6D3B,eAAO,MAAM,kCAAkC,SACrC,MAAM,KACb,OAAO,CAAC,MAAM,CAyChB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAYF,eAAO,MAAM,aAAa,YACb,oBAAoB,KAC9B,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAuK7C,CAAC"}
1
+ {"version":3,"file":"createProject.d.ts","sourceRoot":"","sources":["../../src/handlers/createProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,+BAA+B,EAI/B,WAAW,EAGX,KAAK,uBAAuB,EAI/B,MAAM,mBAAmB,CAAC;AA6D3B,eAAO,MAAM,kCAAkC,SACrC,MAAM,KACb,OAAO,CAAC,MAAM,CAyChB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAYF,eAAO,MAAM,aAAa,YACb,oBAAoB,KAC9B,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAsL7C,CAAC"}
@@ -100,13 +100,20 @@ const createProject = async (options) => {
100
100
  organizationWarehouseCredentialsUuid =
101
101
  await (0, exports.resolveOrganizationCredentialsName)(options.organizationCredentials);
102
102
  }
103
- const dbtVersion = await (0, getDbtVersion_1.getDbtVersion)();
104
103
  const absoluteProjectPath = path_1.default.resolve(options.projectDir);
105
104
  let targetName;
106
105
  let credentials;
106
+ let isDbtCloudCLI = false;
107
+ let dbtVersionOption = (0, common_1.getLatestSupportDbtVersion)();
107
108
  // If using organization credentials, don't load warehouse credentials from profiles
108
109
  if (organizationWarehouseCredentialsUuid) {
109
110
  globalState_1.default.debug(`> Using organization warehouse credentials: ${options.organizationCredentials}`);
111
+ const dbtVersionResult = await (0, getDbtVersion_1.tryGetDbtVersion)();
112
+ if (!dbtVersionResult.success) {
113
+ throw dbtVersionResult.error;
114
+ }
115
+ isDbtCloudCLI = dbtVersionResult.version.isDbtCloudCLI;
116
+ dbtVersionOption = dbtVersionResult.version.versionOption;
110
117
  // Still need to get target name for dbt connection
111
118
  const context = await (0, context_1.getDbtContext)({
112
119
  projectDir: absoluteProjectPath,
@@ -114,7 +121,7 @@ const createProject = async (options) => {
114
121
  });
115
122
  globalState_1.default.debug(`> Using profiles dir ${options.profilesDir} and profile ${options.profile || context.profileName}`);
116
123
  targetName = await (0, getDbtProfileTargetName_1.default)({
117
- isDbtCloudCLI: dbtVersion.isDbtCloudCLI,
124
+ isDbtCloudCLI,
118
125
  profilesDir: options.profilesDir,
119
126
  profile: options.profile || context.profileName,
120
127
  target: options.target,
@@ -123,15 +130,22 @@ const createProject = async (options) => {
123
130
  }
124
131
  else if (options.warehouseCredentials === false) {
125
132
  globalState_1.default.debug('> Creating project without warehouse credentials');
133
+ // No dbt needed - use defaults set above
126
134
  }
127
135
  else {
136
+ const dbtVersionResult = await (0, getDbtVersion_1.tryGetDbtVersion)();
137
+ if (!dbtVersionResult.success) {
138
+ throw dbtVersionResult.error;
139
+ }
140
+ isDbtCloudCLI = dbtVersionResult.version.isDbtCloudCLI;
141
+ dbtVersionOption = dbtVersionResult.version.versionOption;
128
142
  const context = await (0, context_1.getDbtContext)({
129
143
  projectDir: absoluteProjectPath,
130
144
  targetPath: options.targetPath,
131
145
  });
132
146
  globalState_1.default.debug(`> Using profiles dir ${options.profilesDir} and profile ${options.profile || context.profileName}`);
133
147
  targetName = await (0, getDbtProfileTargetName_1.default)({
134
- isDbtCloudCLI: dbtVersion.isDbtCloudCLI,
148
+ isDbtCloudCLI,
135
149
  profilesDir: options.profilesDir,
136
150
  profile: options.profile || context.profileName,
137
151
  target: options.target,
@@ -143,7 +157,7 @@ const createProject = async (options) => {
143
157
  return undefined;
144
158
  }
145
159
  const result = await (0, getWarehouseClient_1.default)({
146
- isDbtCloudCLI: dbtVersion.isDbtCloudCLI,
160
+ isDbtCloudCLI,
147
161
  profilesDir: options.profilesDir,
148
162
  profile: options.profile || context.profileName,
149
163
  target: options.target,
@@ -196,13 +210,13 @@ For a better user experience, we recommend enabling Snowflake OAuth authenticati
196
210
  name: options.name,
197
211
  type: options.type,
198
212
  warehouseConnection: credentials,
199
- copyWarehouseConnectionFromUpstreamProject: dbtVersion.isDbtCloudCLI,
213
+ copyWarehouseConnectionFromUpstreamProject: isDbtCloudCLI,
200
214
  dbtConnection: {
201
215
  type: common_1.DbtProjectType.NONE,
202
216
  target: targetName,
203
217
  },
204
218
  upstreamProjectUuid: options.upstreamProjectUuid,
205
- dbtVersion: dbtVersion.versionOption,
219
+ dbtVersion: dbtVersionOption,
206
220
  tableConfiguration: options.tableConfiguration,
207
221
  copyContent: options.copyContent,
208
222
  organizationWarehouseCredentialsUuid,
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/handlers/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,OAAO,EACP,YAAY,EASf,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,KAAK,UAAU,GAAG,oBAAoB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAkCF,eAAO,MAAM,MAAM,aACL,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,WAC3B,UAAU,KACpB,OAAO,CAAC,IAAI,CAmEd,CAAC;AA8FF,eAAO,MAAM,aAAa,oBAA2B,oBAAoB,kBA+ExE,CAAC"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/handlers/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,OAAO,EACP,YAAY,EASf,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,KAAK,UAAU,GAAG,oBAAoB,GAAG;IACrC,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAkCF,eAAO,MAAM,MAAM,aACL,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,WAC3B,UAAU,KACpB,OAAO,CAAC,IAAI,CAmEd,CAAC;AA8FF,eAAO,MAAM,aAAa,oBAA2B,oBAAoB,kBAmFxE,CAAC"}
@@ -177,7 +177,7 @@ const deployHandler = async (originalOptions) => {
177
177
  process.exit(1);
178
178
  }
179
179
  }
180
- const dbtVersion = await (0, getDbtVersion_1.getDbtVersion)();
180
+ const dbtVersionResult = await (0, getDbtVersion_1.tryGetDbtVersion)();
181
181
  await (0, apiClient_1.checkLightdashVersion)();
182
182
  const executionId = (0, uuid_1.v4)();
183
183
  const explores = await (0, compile_1.compile)(options);
@@ -209,7 +209,9 @@ const deployHandler = async (originalOptions) => {
209
209
  ? `${serverUrl}/createProject/cli?projectUuid=${projectUuid}`
210
210
  : `${serverUrl}/projects/${projectUuid}/home`;
211
211
  let successMessage = 'Successfully deployed project:';
212
- if (dbtVersion.isDbtCloudCLI && options.create) {
212
+ if (dbtVersionResult.success &&
213
+ dbtVersionResult.version.isDbtCloudCLI &&
214
+ options.create) {
213
215
  successMessage =
214
216
  'Successfully deployed project! Complete the setup by adding warehouse connection details here:';
215
217
  displayUrl = `${serverUrl}/generalSettings/projectManagement/${projectUuid}/settings`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.2363.0",
3
+ "version": "0.2364.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,8 +38,8 @@
38
38
  "unique-names-generator": "^4.7.1",
39
39
  "uuid": "^11.0.3",
40
40
  "yaml": "^2.7.0",
41
- "@lightdash/common": "0.2363.0",
42
- "@lightdash/warehouses": "0.2363.0"
41
+ "@lightdash/warehouses": "0.2364.0",
42
+ "@lightdash/common": "0.2364.0"
43
43
  },
44
44
  "description": "Lightdash CLI tool",
45
45
  "devDependencies": {