@lightdash/cli 0.3467.0 → 0.3469.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.
@@ -20,6 +20,7 @@ export type DownloadHandlerOptions = {
20
20
  project?: string;
21
21
  languageMap: boolean;
22
22
  skipSpaceCreate: boolean;
23
+ skipSpaceAccess?: boolean;
23
24
  public: boolean;
24
25
  includeCharts: boolean;
25
26
  nested: boolean;
@@ -74,7 +75,7 @@ export declare const testHelpers: {
74
75
  detail: string;
75
76
  variant?: ContentAsCodeOutputVariant;
76
77
  };
77
- upsertSpaces: (projectId: string, files: SpaceCodeFile[], changes: Record<string, number>, skipSpaceCreate: boolean, publicSpaceCreate: boolean) => Promise<Record<string, number>>;
78
+ upsertSpaces: (projectId: string, files: SpaceCodeFile[], changes: Record<string, number>, skipSpaceCreate: boolean, publicSpaceCreate: boolean, skipSpaceAccess?: boolean) => Promise<Record<string, number>>;
78
79
  upsertVirtualViews: (projectId: string, slugs: string[], changes: Record<string, number>, force: boolean, canUpload: boolean, customPath?: string) => Promise<Record<string, number>>;
79
80
  validateSpaceIdentity: (parsed: unknown, filePath: string) => SpaceAsCode;
80
81
  writeSpaceFiles: (spaces: SpaceAsCode[], projectName: string, customPath?: string, folderScheme?: "flat" | "nested", flatSpaceLayout?: "folder" | "root", preserveExistingPolicy?: boolean) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/handlers/download.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EAuBX,WAAW,EAGX,eAAe,EAef,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAIH,KAAK,0BAA0B,EAClC,MAAM,iCAAiC,CAAC;AA+DzC,OAAO,EAmBH,KAAK,aAAa,EACrB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE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EAAE,0BAA0B,CAAA;KAAE;;oCAzjC5C,MAAM,SACV,MAAM,EAAE,WACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SACxB,OAAO,aACH,OAAO,eACL,MAAM,KACpB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;CA6sEjC,CAAC"}
@@ -1463,7 +1463,7 @@ const uploadHandler = async (options) => {
1463
1463
  output,
1464
1464
  label: 'Spaces',
1465
1465
  changes,
1466
- action: () => (0, spacesAsCode_1.upsertSpaces)(projectId, spaceFiles, changes, options.skipSpaceCreate, options.public),
1466
+ action: () => (0, spacesAsCode_1.upsertSpaces)(projectId, spaceFiles, changes, options.skipSpaceCreate, options.public, options.skipSpaceAccess),
1467
1467
  });
1468
1468
  }
1469
1469
  else if (hasFilters) {
@@ -773,6 +773,42 @@ version: 99
773
773
  : '{}').slug)).toEqual(['a', 'a/b']);
774
774
  logSpy.mockRestore();
775
775
  });
776
+ it('omits access and warns when skip-space-access is enabled', async () => {
777
+ const logSpy = vitest_1.vi
778
+ .spyOn(globalState_1.default, 'log')
779
+ .mockImplementation(() => undefined);
780
+ vitest_1.vi.mocked(apiClient_1.lightdashApi).mockResolvedValueOnce({
781
+ action: common_1.SpaceAsCodeAction.CREATE,
782
+ });
783
+ await upsertSpaces('project-uuid', [{ filePath: 'space.space.yml', space: accessSpace('finance') }], {}, false, true, true);
784
+ const [request] = vitest_1.vi.mocked(apiClient_1.lightdashApi).mock.calls[0];
785
+ expect(JSON.parse(String(request.body))).toEqual({
786
+ contentType: 'space',
787
+ version: 1,
788
+ spaceName: 'finance',
789
+ slug: 'finance',
790
+ });
791
+ expect(request.url).toContain('publicSpaceCreate=true');
792
+ expect(logSpy).toHaveBeenCalledWith(expect.stringContaining('Existing destination access will be preserved'));
793
+ logSpy.mockRestore();
794
+ });
795
+ it.each([
796
+ 'User example@lightdash.com is not a member of this organization',
797
+ 'Group finance does not exist in this organization',
798
+ ])('suggests skip-space-access when a destination identity is missing: %s', async (errorMessage) => {
799
+ const logSpy = vitest_1.vi
800
+ .spyOn(globalState_1.default, 'log')
801
+ .mockImplementation(() => undefined);
802
+ vitest_1.vi.mocked(apiClient_1.lightdashApi).mockRejectedValueOnce(new Error(errorMessage));
803
+ await expect(upsertSpaces('project-uuid', [
804
+ {
805
+ filePath: 'space.space.yml',
806
+ space: accessSpace('finance'),
807
+ },
808
+ ], {}, false, false)).rejects.toThrow('content upload was not started');
809
+ expect(logSpy).toHaveBeenCalledWith(expect.stringContaining('Hint: use --skip-space-access to upload the space without applying its access policy.'));
810
+ logSpy.mockRestore();
811
+ });
776
812
  it('treats missing spaces and descendants as nonfatal with skip-space-create', async () => {
777
813
  vitest_1.vi.mocked(apiClient_1.lightdashApi)
778
814
  .mockRejectedValueOnce(new common_1.LightdashError({
@@ -24,6 +24,6 @@ export declare const downloadSpaces: (projectId: string, projectName: string, cu
24
24
  export declare const createSpaceAsCodeUploadError: (message: string) => ParameterError;
25
25
  export declare const isSpaceAsCodeUploadError: (error: unknown) => error is Error;
26
26
  export declare const logUploadChanges: (changes: Record<string, number>) => void;
27
- export declare const upsertSpaces: (projectId: string, files: SpaceCodeFile[], changes: Record<string, number>, skipSpaceCreate: boolean, publicSpaceCreate: boolean) => Promise<Record<string, number>>;
27
+ export declare const upsertSpaces: (projectId: string, files: SpaceCodeFile[], changes: Record<string, number>, skipSpaceCreate: boolean, publicSpaceCreate: boolean, skipSpaceAccess?: boolean) => Promise<Record<string, number>>;
28
28
  export {};
29
29
  //# sourceMappingURL=spacesAsCode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spacesAsCode.d.ts","sourceRoot":"","sources":["../../src/handlers/spacesAsCode.ts"],"names":[],"mappings":"AAEA,OAAO,EASH,cAAc,EAId,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;AAgB3B,KAAK,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AACtC,KAAK,eAAe,GAAG,QAAQ,GAAG,MAAM,C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AAC,MAAM,CAmDhB,CAAC;AAIF,eAAO,MAAM,4BAA4B,GACrC,SAAS,MAAM,KAChB,cAIF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,KACS,CAAC;AAE7E,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAY/D,CAAC;AAEF,eAAO,MAAM,YAAY,GACrB,WAAW,MAAM,EACjB,OAAO,aAAa,EAAE,EACtB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,iBAAiB,OAAO,EACxB,mBAAmB,OAAO,EAC1B,kBAAiB,OAAe,KACjC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+HhC,CAAC"}
@@ -533,9 +533,13 @@ const logUploadChanges = (changes) => {
533
533
  }
534
534
  };
535
535
  exports.logUploadChanges = logUploadChanges;
536
- const upsertSpaces = async (projectId, files, changes, skipSpaceCreate, publicSpaceCreate) => {
536
+ const upsertSpaces = async (projectId, files, changes, skipSpaceCreate, publicSpaceCreate, skipSpaceAccess = false) => {
537
537
  if (files.length === 0)
538
538
  return changes;
539
+ if (skipSpaceAccess &&
540
+ files.some(({ space }) => space.access !== undefined)) {
541
+ globalState_1.default.log(styles.warning('Space access policies will be skipped. Existing destination access will be preserved; new spaces will use default access.'));
542
+ }
539
543
  const failedPaths = new Set();
540
544
  const skippedPaths = new Set();
541
545
  for (const { filePath, space } of (0, exports.sortSpaceFilesParentFirst)(files)) {
@@ -554,14 +558,17 @@ const upsertSpaces = async (projectId, files, changes, skipSpaceCreate, publicSp
554
558
  }
555
559
  else {
556
560
  try {
561
+ const spaceToUpload = skipSpaceAccess
562
+ ? { ...space, access: undefined }
563
+ : space;
557
564
  const params = new URLSearchParams({
558
565
  skipSpaceCreate: String(skipSpaceCreate),
559
- publicSpaceCreate: String(publicSpaceCreate && space.access === undefined),
566
+ publicSpaceCreate: String(publicSpaceCreate && spaceToUpload.access === undefined),
560
567
  });
561
568
  const result = await (0, apiClient_1.lightdashApi)({
562
569
  method: 'POST',
563
570
  url: `/api/v1/projects/${projectId}/code/spaces?${params.toString()}`,
564
- body: JSON.stringify(space),
571
+ body: JSON.stringify(spaceToUpload),
565
572
  });
566
573
  const action = getSpacePromoteAction(result.action);
567
574
  const key = `spaces ${action}`;
@@ -579,10 +586,18 @@ const upsertSpaces = async (projectId, files, changes, skipSpaceCreate, publicSp
579
586
  globalState_1.default.log(styles.warning(`Skipped space "${space.slug}" (${filePath}) because it does not exist and --skip-space-create is true`));
580
587
  }
581
588
  else {
589
+ const errorMessage = (0, common_1.getErrorMessage)(error);
590
+ const accessIdentityError = errorMessage.includes(' is not a member of this organization') ||
591
+ errorMessage.includes(' does not exist in this organization') ||
592
+ errorMessage.includes(' is ambiguous in this organization') ||
593
+ errorMessage.includes(' cannot be assigned through space access as code');
594
+ const skipAccessHint = accessIdentityError
595
+ ? '\nHint: use --skip-space-access to upload the space without applying its access policy.'
596
+ : '';
582
597
  failedPaths.add(space.slug);
583
598
  changes['spaces with errors'] =
584
599
  (changes['spaces with errors'] ?? 0) + 1;
585
- globalState_1.default.log(styles.error(`Error upserting space "${space.slug}" (${filePath}): ${(0, common_1.getErrorMessage)(error)}`));
600
+ globalState_1.default.log(styles.error(`Error upserting space "${space.slug}" (${filePath}): ${errorMessage}${skipAccessHint}`));
586
601
  }
587
602
  }
588
603
  }
package/dist/index.js CHANGED
@@ -390,6 +390,7 @@ const uploadCommand = commander_1.program
390
390
  .option('-p, --path <path>', 'specify a custom path to upload content from', undefined)
391
391
  .option('--project <project uuid>', 'specify a project UUID to upload', parseProjectArgument, undefined)
392
392
  .option('--skip-space-create', 'Skip space creation if it does not exist', false)
393
+ .option('--skip-space-access', 'upload spaces without applying their access policies', false)
393
394
  .option('--skip-spaces', 'skip uploading space definitions and access', false)
394
395
  .option('--spaces-only', 'upload only space definitions and access', false)
395
396
  .option('--public', 'Create new spaces as public instead of private', false)
@@ -1,6 +1,6 @@
1
1
  /* Lightdash chart palette + template-managed floating-surface chrome.
2
2
 
3
- Two responsibilities:
3
+ Three responsibilities:
4
4
  1. Replaces shadcn's monochrome chart tokens with the categorical palette used by
5
5
  every native Lightdash chart. Source of truth: ECHARTS_DEFAULT_COLORS in
6
6
  packages/common/src/types/savedCharts.ts.
@@ -9,6 +9,7 @@
9
9
  class used by custom Recharts tooltips. Self-adapts to whatever theme the generated
10
10
  app picks by mixing --background toward --foreground (which is always the opposite
11
11
  end of the lightness scale in a well-formed theme).
12
+ 3. Makes `max-h-*` on shadcn's ScrollArea actually scroll (see below).
12
13
 
13
14
  Imported after index.css in main.jsx — CSS cascade gives these declarations the win
14
15
  without needing @layer wrapping (which would also break Tailwind's per-file processing). */
@@ -37,6 +38,20 @@
37
38
  --chart-9: #ea7ccc;
38
39
  }
39
40
 
41
+ /* ── ScrollArea max-height fix ─────────────────────────────────────────────
42
+ shadcn's ScrollArea puts the caller's className on the Radix Root
43
+ (overflow-hidden) while the Viewport inside it is h-full. A max-h-* on the
44
+ Root therefore never constrains the Viewport: height:100% resolves against
45
+ the Root's auto height, the Viewport grows to the full content height, and
46
+ the Root clips it — so `<ScrollArea className="max-h-[600px]">` (the
47
+ pattern skill.md prescribes for tables) renders clipped and unscrollable.
48
+ Inheriting the Root's max-height makes the Viewport the element that
49
+ actually scrolls. Roots without a max-height inherit `none` — no change. */
50
+
51
+ [data-radix-scroll-area-viewport] {
52
+ max-height: inherit;
53
+ }
54
+
40
55
  /* ── Floating-surface chrome ───────────────────────────────────────────────
41
56
  Targets Radix portals via their data attributes (so styling lands wherever
42
57
  the Portal renders, regardless of where the theme wrapper sits in the React
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.3467.0",
3
+ "version": "0.3469.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "unique-names-generator": "4.7.1",
42
42
  "uuid": "11.1.1",
43
43
  "yaml": "2.8.3",
44
- "@lightdash/common": "0.3467.0",
45
- "@lightdash/warehouses": "0.3467.0"
44
+ "@lightdash/common": "0.3469.0",
45
+ "@lightdash/warehouses": "0.3469.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",