@get-dx/cli 0.5.3 → 0.5.4

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.
@@ -329,8 +329,20 @@ async function readYamlStdin() {
329
329
  });
330
330
  }
331
331
  function buildCreateReportPayload(raw) {
332
- const { id: _id, ...rest } = parseYamlObject(raw);
333
- return rest;
332
+ const { id: _id, tiles, ...rest } = parseYamlObject(raw);
333
+ const payload = rest;
334
+ if (Array.isArray(tiles)) {
335
+ // A new report always gets fresh tiles, so drop any tile IDs carried over
336
+ // from an `init --id` scaffold (those IDs belong to the source report).
337
+ payload.tiles = tiles.map((tile) => {
338
+ if (!tile || typeof tile !== "object") {
339
+ return tile;
340
+ }
341
+ const { id: _tileId, ...tileRest } = tile;
342
+ return tileRest;
343
+ });
344
+ }
345
+ return payload;
334
346
  }
335
347
  function buildUpdateReportPayload(id, raw) {
336
348
  return { ...parseYamlObject(raw), id };
@@ -353,6 +365,7 @@ function studioReportToYaml(report) {
353
365
  edit_access_type: report.edit_access_type,
354
366
  editor_emails: [],
355
367
  tiles: report.tiles.map((tile) => ({
368
+ id: tile.id,
356
369
  title: tile.title,
357
370
  sql: tile.sql,
358
371
  chart_type: tile.chart_type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-dx/cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "DX CLI",
5
5
  "author": "DX <developers@getdx.com>",
6
6
  "bugs": {