@lightdash/cli 2.287.1 → 2.288.1

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.
@@ -11,6 +11,7 @@ type CreateProjectOptions = {
11
11
  upstreamProjectUuid?: string;
12
12
  tableConfiguration?: CreateProjectTableConfiguration;
13
13
  copyContent?: boolean;
14
+ asyncCopyContent?: boolean;
14
15
  warehouseCredentials?: boolean;
15
16
  organizationCredentials?: string;
16
17
  targetPath?: string;
@@ -1 +1 @@
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,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EAExB,MAAM,mBAAmB,CAAC;AAgE3B,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;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAqDF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B,CAAC,EAAE,+BAA+B,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAqDF,KAAK,+BAA+B,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IAClC,WAAW,EAAE,0BAA0B,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,oCAAoC,YACpC,+BAA+B,KACzC,OAAO,CAAC,8BAA8B,GAAG,IAAI,CA2F/C,CAAC;AAEF,eAAO,MAAM,aAAa,YACb,oBAAoB,KAC9B,OAAO,CAAC,uBAAuB,GAAG,SAAS,CA4H7C,CAAC"}
@@ -14,6 +14,7 @@ const apiClient_1 = require("./dbt/apiClient");
14
14
  const getDbtProfileTargetName_1 = tslib_1.__importDefault(require("./dbt/getDbtProfileTargetName"));
15
15
  const getDbtVersion_1 = require("./dbt/getDbtVersion");
16
16
  const getWarehouseClient_1 = tslib_1.__importStar(require("./dbt/getWarehouseClient"));
17
+ const refresh_1 = require("./dbt/refresh");
17
18
  const askToRememberAnswer = async () => {
18
19
  const answers = await inquirer_1.default.prompt([
19
20
  {
@@ -268,15 +269,21 @@ const createProject = async (options) => {
268
269
  dbtVersion: dbtVersionOption,
269
270
  tableConfiguration: options.tableConfiguration,
270
271
  copyContent: options.copyContent,
272
+ asyncCopyContent: options.asyncCopyContent ?? false,
271
273
  organizationWarehouseCredentialsUuid,
272
274
  ...(options.expiresIn !== undefined
273
275
  ? { expiresInHours: options.expiresIn }
274
276
  : {}),
275
277
  };
276
- return (0, apiClient_1.lightdashApi)({
278
+ const result = await (0, apiClient_1.lightdashApi)({
277
279
  method: 'POST',
278
280
  url: `/api/v1/org/projects`,
279
281
  body: JSON.stringify(project),
280
282
  });
283
+ if (result.contentCopyJobUuid) {
284
+ await (0, refresh_1.getFinalJobState)(result.contentCopyJobUuid, 'Copying preview content');
285
+ return { ...result, hasContentCopy: true };
286
+ }
287
+ return result;
281
288
  };
282
289
  exports.createProject = createProject;
@@ -11,6 +11,7 @@ type PreviewHandlerOptions = DbtCompileOptions & {
11
11
  ignoreErrors: boolean;
12
12
  tableConfiguration: CreateProjectTableConfiguration;
13
13
  skipCopyContent?: boolean;
14
+ asyncCopyContent?: boolean;
14
15
  organizationCredentials?: string;
15
16
  assumeYes?: boolean;
16
17
  warehouseCredentials?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/handlers/preview.ts"],"names":[],"mappings":"AACA,OAAO,EACH,+BAA+B,EAKlC,MAAM,mBAAmB,CAAC;AAmB3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAYlD,KAAK,qBAAqB,GAAG,iBAAiB,GAAG;IAC7C,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,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CA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AE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,wBAAwB,EAAE,OAAO,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AA2GF,eAAO,MAAM,cAAc,oBACN,qBAAqB,KACvC,OAAO,CAAC,IAAI,CAuSd,CAAC;AAuDF,eAAO,MAAM,mBAAmB,oBACX,qBAAqB,KACvC,OAAO,CAAC,IAAI,CA2Ld,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAClB,yBAAyB,KACnC,OAAO,CAAC,IAAI,CA0Cd,CAAC"}
package/dist/index.js CHANGED
@@ -273,6 +273,7 @@ commander_1.program
273
273
  .option('--no-combine', 'Skip combining the preview manifest with the manifest served by Lightdash')
274
274
  .option('--table-configuration <prod|all>', `If set to 'prod' it will copy the table configuration from prod project`, 'all')
275
275
  .option('--skip-copy-content', 'Skip copying content from the source project', false)
276
+ .option('--async-copy-content', 'Copy preview content in a background job to avoid request timeouts', false)
276
277
  .option('--disable-timestamp-conversion [true|false]', 'Disable timestamp conversion to UTC for Snowflake warehouses. Applied when creating the preview project; ignored when updating an existing preview (read from project settings).', parseDisableTimestampConversionOption)
277
278
  .option('--no-warehouse-credentials', 'Create preview without warehouse credentials. Copies credentials from upstream project.')
278
279
  .option('--organization-credentials <name>', 'Use organization warehouse credentials with the specified name (Enterprise Edition feature)')
@@ -315,6 +316,7 @@ commander_1.program
315
316
  .option('--no-combine', 'Skip combining the preview manifest with the manifest served by Lightdash')
316
317
  .option('--table-configuration <prod|all>', `If set to 'prod' it will copy the table configuration from prod project`, 'all')
317
318
  .option('--skip-copy-content', 'Skip copying content from the source project', false)
319
+ .option('--async-copy-content', 'Copy preview content in a background job to avoid request timeouts', false)
318
320
  .option('--disable-timestamp-conversion [true|false]', 'Disable timestamp conversion to UTC for Snowflake warehouses. Applied when creating the preview project; ignored when updating an existing preview (read from project settings).', parseDisableTimestampConversionOption)
319
321
  .option('--no-warehouse-credentials', 'Create preview without warehouse credentials (copied from the upstream project). When updating an existing preview, keep the credentials it already has.')
320
322
  .option('-y, --assume-yes', 'assume yes to prompts', false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "2.287.1",
3
+ "version": "2.288.1",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  "@actions/core": "1.11.1",
23
23
  "@aws-sdk/credential-providers": "3.995.0",
24
24
  "@casl/ability": "6.8.0",
25
- "@lightdash/common": "2.287.1",
26
- "@lightdash/warehouses": "2.287.1",
25
+ "@lightdash/common": "2.288.1",
26
+ "@lightdash/warehouses": "2.288.1",
27
27
  "@sidvind/better-ajv-errors": "7.0.0",
28
28
  "@types/columnify": "1.5.1",
29
29
  "ajv": "8.18.0",