@lightdash/cli 2.228.1 → 2.229.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.
Files changed (177) hide show
  1. package/dist/.tsbuildinfo.build +1 -0
  2. package/package.json +4 -4
  3. package/dist/.tsbuildinfo +0 -1
  4. package/dist/config.test.d.ts +0 -2
  5. package/dist/config.test.d.ts.map +0 -1
  6. package/dist/config.test.js +0 -72
  7. package/dist/dbt/context.test.d.ts +0 -2
  8. package/dist/dbt/context.test.d.ts.map +0 -1
  9. package/dist/dbt/context.test.js +0 -152
  10. package/dist/dbt/manifest.test.d.ts +0 -2
  11. package/dist/dbt/manifest.test.d.ts.map +0 -1
  12. package/dist/dbt/manifest.test.js +0 -170
  13. package/dist/dbt/models.test.d.ts +0 -2
  14. package/dist/dbt/models.test.d.ts.map +0 -1
  15. package/dist/dbt/models.test.js +0 -139
  16. package/dist/dbt/profiles.test.d.ts +0 -2
  17. package/dist/dbt/profiles.test.d.ts.map +0 -1
  18. package/dist/dbt/profiles.test.js +0 -50
  19. package/dist/dbt/targets/athena.test.d.ts +0 -2
  20. package/dist/dbt/targets/athena.test.d.ts.map +0 -1
  21. package/dist/dbt/targets/athena.test.js +0 -78
  22. package/dist/dbt/targets/duckdb.test.d.ts +0 -2
  23. package/dist/dbt/targets/duckdb.test.d.ts.map +0 -1
  24. package/dist/dbt/targets/duckdb.test.js +0 -149
  25. package/dist/dbt/targets/redshift.test.d.ts +0 -2
  26. package/dist/dbt/targets/redshift.test.d.ts.map +0 -1
  27. package/dist/dbt/targets/redshift.test.js +0 -198
  28. package/dist/dbt/templating.test.d.ts +0 -2
  29. package/dist/dbt/templating.test.d.ts.map +0 -1
  30. package/dist/dbt/templating.test.js +0 -51
  31. package/dist/dbt/validation.test.d.ts +0 -2
  32. package/dist/dbt/validation.test.d.ts.map +0 -1
  33. package/dist/dbt/validation.test.js +0 -67
  34. package/dist/handlers/apps/appCodeFiles.test.d.ts +0 -2
  35. package/dist/handlers/apps/appCodeFiles.test.d.ts.map +0 -1
  36. package/dist/handlers/apps/appCodeFiles.test.js +0 -391
  37. package/dist/handlers/apps/appsDownload.test.d.ts +0 -2
  38. package/dist/handlers/apps/appsDownload.test.d.ts.map +0 -1
  39. package/dist/handlers/apps/appsDownload.test.js +0 -639
  40. package/dist/handlers/apps/build.test.d.ts +0 -2
  41. package/dist/handlers/apps/build.test.d.ts.map +0 -1
  42. package/dist/handlers/apps/build.test.js +0 -252
  43. package/dist/handlers/apps/createApp.test.d.ts +0 -2
  44. package/dist/handlers/apps/createApp.test.d.ts.map +0 -1
  45. package/dist/handlers/apps/createApp.test.js +0 -340
  46. package/dist/handlers/apps/pathContainment.test.d.ts +0 -2
  47. package/dist/handlers/apps/pathContainment.test.d.ts.map +0 -1
  48. package/dist/handlers/apps/pathContainment.test.js +0 -66
  49. package/dist/handlers/apps/preview.test.d.ts +0 -2
  50. package/dist/handlers/apps/preview.test.d.ts.map +0 -1
  51. package/dist/handlers/apps/preview.test.js +0 -353
  52. package/dist/handlers/apps/previewProxy.test.d.ts +0 -2
  53. package/dist/handlers/apps/previewProxy.test.d.ts.map +0 -1
  54. package/dist/handlers/apps/previewProxy.test.js +0 -178
  55. package/dist/handlers/apps/scaffolding.test.d.ts +0 -2
  56. package/dist/handlers/apps/scaffolding.test.d.ts.map +0 -1
  57. package/dist/handlers/apps/scaffolding.test.js +0 -151
  58. package/dist/handlers/apps/uploadRetry.test.d.ts +0 -2
  59. package/dist/handlers/apps/uploadRetry.test.d.ts.map +0 -1
  60. package/dist/handlers/apps/uploadRetry.test.js +0 -103
  61. package/dist/handlers/apps/validate.test.d.ts +0 -2
  62. package/dist/handlers/apps/validate.test.d.ts.map +0 -1
  63. package/dist/handlers/apps/validate.test.js +0 -526
  64. package/dist/handlers/compile.test.d.ts +0 -2
  65. package/dist/handlers/compile.test.d.ts.map +0 -1
  66. package/dist/handlers/compile.test.js +0 -151
  67. package/dist/handlers/compileProject.test.d.ts +0 -2
  68. package/dist/handlers/compileProject.test.d.ts.map +0 -1
  69. package/dist/handlers/compileProject.test.js +0 -637
  70. package/dist/handlers/compileWarehouseColumnValidation.test.d.ts +0 -2
  71. package/dist/handlers/compileWarehouseColumnValidation.test.d.ts.map +0 -1
  72. package/dist/handlers/compileWarehouseColumnValidation.test.js +0 -493
  73. package/dist/handlers/connectSnowflake.test.d.ts +0 -2
  74. package/dist/handlers/connectSnowflake.test.d.ts.map +0 -1
  75. package/dist/handlers/connectSnowflake.test.js +0 -320
  76. package/dist/handlers/contentAsCode/fileNames.test.d.ts +0 -2
  77. package/dist/handlers/contentAsCode/fileNames.test.d.ts.map +0 -1
  78. package/dist/handlers/contentAsCode/fileNames.test.js +0 -79
  79. package/dist/handlers/contentAsCode/registry.test.d.ts +0 -2
  80. package/dist/handlers/contentAsCode/registry.test.d.ts.map +0 -1
  81. package/dist/handlers/contentAsCode/registry.test.js +0 -18
  82. package/dist/handlers/contentAsCode/resource.test.d.ts +0 -2
  83. package/dist/handlers/contentAsCode/resource.test.d.ts.map +0 -1
  84. package/dist/handlers/contentAsCode/resource.test.js +0 -121
  85. package/dist/handlers/dbt/getDbtVersion.test.d.ts +0 -2
  86. package/dist/handlers/dbt/getDbtVersion.test.d.ts.map +0 -1
  87. package/dist/handlers/dbt/getDbtVersion.test.js +0 -106
  88. package/dist/handlers/deploy.test.d.ts +0 -2
  89. package/dist/handlers/deploy.test.d.ts.map +0 -1
  90. package/dist/handlers/deploy.test.js +0 -244
  91. package/dist/handlers/download.test.d.ts +0 -2
  92. package/dist/handlers/download.test.d.ts.map +0 -1
  93. package/dist/handlers/download.test.js +0 -1739
  94. package/dist/handlers/exportChartImage.test.d.ts +0 -2
  95. package/dist/handlers/exportChartImage.test.d.ts.map +0 -1
  96. package/dist/handlers/exportChartImage.test.js +0 -55
  97. package/dist/handlers/homepagesAsCode.test.d.ts +0 -2
  98. package/dist/handlers/homepagesAsCode.test.d.ts.map +0 -1
  99. package/dist/handlers/homepagesAsCode.test.js +0 -72
  100. package/dist/handlers/lint.test.d.ts +0 -2
  101. package/dist/handlers/lint.test.d.ts.map +0 -1
  102. package/dist/handlers/lint.test.js +0 -221
  103. package/dist/handlers/login.test.d.ts +0 -2
  104. package/dist/handlers/login.test.d.ts.map +0 -1
  105. package/dist/handlers/login.test.js +0 -24
  106. package/dist/handlers/metadataFile.test.d.ts +0 -2
  107. package/dist/handlers/metadataFile.test.d.ts.map +0 -1
  108. package/dist/handlers/metadataFile.test.js +0 -46
  109. package/dist/handlers/organizationContent/customRoles.test.d.ts +0 -2
  110. package/dist/handlers/organizationContent/customRoles.test.d.ts.map +0 -1
  111. package/dist/handlers/organizationContent/customRoles.test.js +0 -179
  112. package/dist/handlers/organizationContent/groups.test.d.ts +0 -2
  113. package/dist/handlers/organizationContent/groups.test.d.ts.map +0 -1
  114. package/dist/handlers/organizationContent/groups.test.js +0 -135
  115. package/dist/handlers/organizationContent/index.test.d.ts +0 -2
  116. package/dist/handlers/organizationContent/index.test.d.ts.map +0 -1
  117. package/dist/handlers/organizationContent/index.test.js +0 -212
  118. package/dist/handlers/organizationContent/themes.test.d.ts +0 -2
  119. package/dist/handlers/organizationContent/themes.test.d.ts.map +0 -1
  120. package/dist/handlers/organizationContent/themes.test.js +0 -180
  121. package/dist/handlers/organizationContent/users.test.d.ts +0 -2
  122. package/dist/handlers/organizationContent/users.test.d.ts.map +0 -1
  123. package/dist/handlers/organizationContent/users.test.js +0 -155
  124. package/dist/handlers/preAggregateAudit.test.d.ts +0 -2
  125. package/dist/handlers/preAggregateAudit.test.d.ts.map +0 -1
  126. package/dist/handlers/preAggregateAudit.test.js +0 -102
  127. package/dist/handlers/renameHandler.test.d.ts +0 -2
  128. package/dist/handlers/renameHandler.test.d.ts.map +0 -1
  129. package/dist/handlers/renameHandler.test.js +0 -189
  130. package/dist/handlers/resolveProjectFlag.test.d.ts +0 -2
  131. package/dist/handlers/resolveProjectFlag.test.d.ts.map +0 -1
  132. package/dist/handlers/resolveProjectFlag.test.js +0 -48
  133. package/dist/handlers/selectProject.test.d.ts +0 -2
  134. package/dist/handlers/selectProject.test.d.ts.map +0 -1
  135. package/dist/handlers/selectProject.test.js +0 -224
  136. package/dist/handlers/setProject.test.d.ts +0 -2
  137. package/dist/handlers/setProject.test.d.ts.map +0 -1
  138. package/dist/handlers/setProject.test.js +0 -63
  139. package/dist/handlers/slugUpdate.test.d.ts +0 -2
  140. package/dist/handlers/slugUpdate.test.d.ts.map +0 -1
  141. package/dist/handlers/slugUpdate.test.js +0 -265
  142. package/dist/handlers/timestampConversion.test.d.ts +0 -2
  143. package/dist/handlers/timestampConversion.test.d.ts.map +0 -1
  144. package/dist/handlers/timestampConversion.test.js +0 -87
  145. package/dist/handlers/upgradeCheck.test.d.ts +0 -2
  146. package/dist/handlers/upgradeCheck.test.d.ts.map +0 -1
  147. package/dist/handlers/upgradeCheck.test.js +0 -227
  148. package/dist/handlers/validate.test.d.ts +0 -2
  149. package/dist/handlers/validate.test.d.ts.map +0 -1
  150. package/dist/handlers/validate.test.js +0 -318
  151. package/dist/handlers/validateSpaceFilter.test.d.ts +0 -2
  152. package/dist/handlers/validateSpaceFilter.test.d.ts.map +0 -1
  153. package/dist/handlers/validateSpaceFilter.test.js +0 -79
  154. package/dist/handlers/warehouseConnection.test.d.ts +0 -2
  155. package/dist/handlers/warehouseConnection.test.d.ts.map +0 -1
  156. package/dist/handlers/warehouseConnection.test.js +0 -75
  157. package/dist/lightdash-config/lightdash-config.test.d.ts +0 -2
  158. package/dist/lightdash-config/lightdash-config.test.d.ts.map +0 -1
  159. package/dist/lightdash-config/lightdash-config.test.js +0 -69
  160. package/dist/prompts/fuzzySearchPrompt.test.d.ts +0 -2
  161. package/dist/prompts/fuzzySearchPrompt.test.d.ts.map +0 -1
  162. package/dist/prompts/fuzzySearchPrompt.test.js +0 -53
  163. package/dist/refsArgument.test.d.ts +0 -2
  164. package/dist/refsArgument.test.d.ts.map +0 -1
  165. package/dist/refsArgument.test.js +0 -42
  166. package/dist/releaseSafety/index.test.d.ts +0 -2
  167. package/dist/releaseSafety/index.test.d.ts.map +0 -1
  168. package/dist/releaseSafety/index.test.js +0 -154
  169. package/dist/releaseSafety/version.test.d.ts +0 -2
  170. package/dist/releaseSafety/version.test.d.ts.map +0 -1
  171. package/dist/releaseSafety/version.test.js +0 -22
  172. package/dist/skills.test.d.ts +0 -2
  173. package/dist/skills.test.d.ts.map +0 -1
  174. package/dist/skills.test.js +0 -112
  175. package/dist/terminal/contentAsCodeOutput.test.d.ts +0 -2
  176. package/dist/terminal/contentAsCodeOutput.test.d.ts.map +0 -1
  177. package/dist/terminal/contentAsCodeOutput.test.js +0 -231
@@ -1,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const globalState_1 = tslib_1.__importDefault(require("../globalState"));
5
- const contentAsCodeOutput_1 = require("./contentAsCodeOutput");
6
- describe('content as code terminal output', () => {
7
- it('formats fallback actions with aligned labels and muted metadata', () => {
8
- const output = (0, contentAsCodeOutput_1.formatContentAsCodeAction)({
9
- label: 'Custom roles',
10
- detail: '34 downloaded',
11
- durationMs: 245,
12
- });
13
- expect(output).toContain('Custom roles 34 downloaded (245ms)');
14
- });
15
- it('formats running progress as a tree', () => {
16
- const output = (0, contentAsCodeOutput_1.formatContentAsCodeProgress)({
17
- operation: 'download',
18
- scope: 'organization',
19
- activeLabel: 'Groups',
20
- items: [
21
- {
22
- label: 'Custom roles',
23
- detail: '34 downloaded',
24
- durationMs: 85,
25
- },
26
- {
27
- label: 'Users',
28
- detail: '9 downloaded',
29
- durationMs: 107,
30
- },
31
- ],
32
- });
33
- expect(output).toContain('Downloading content as code (organization)');
34
- expect(output).toContain('└ ✓ Custom roles · 34 downloaded (85ms)');
35
- expect(output).toContain('└ ✓ Users · 9 downloaded (107ms)');
36
- expect(output).toContain('└ ◐ Groups · downloading…');
37
- });
38
- it('renders one borderless completion tree', () => {
39
- const output = (0, contentAsCodeOutput_1.formatContentAsCodeComplete)({
40
- operation: 'upload',
41
- scope: 'organization',
42
- path: '/tmp/lightdash',
43
- elapsedSeconds: 1.2,
44
- items: [
45
- {
46
- label: 'Custom roles',
47
- detail: '1 created, 2 unchanged',
48
- durationMs: 245,
49
- },
50
- { label: 'Users', detail: '4 updated', durationMs: 31 },
51
- {
52
- label: 'Groups',
53
- detail: 'service unavailable',
54
- durationMs: 12,
55
- variant: 'warning',
56
- },
57
- ],
58
- });
59
- expect(output).toContain('✓ Uploaded content as code (organization) · 1.2s');
60
- expect(output).toContain('└ ✓ Custom roles');
61
- expect(output).toContain('(245ms)');
62
- expect(output).toContain('└ ⚠ Groups');
63
- expect(output).toContain('└ Read from /tmp/lightdash');
64
- expect(output).not.toMatch(/[╭╮╰╯│─]/);
65
- });
66
- it('formats failures with completed and failed tree rows', () => {
67
- const output = (0, contentAsCodeOutput_1.formatContentAsCodeFailure)({
68
- operation: 'download',
69
- scope: 'organization',
70
- elapsedSeconds: 0.4,
71
- items: [
72
- {
73
- label: 'Custom roles',
74
- detail: '34 downloaded',
75
- durationMs: 85,
76
- },
77
- ],
78
- failedItem: {
79
- label: 'Users',
80
- detail: '403 forbidden',
81
- durationMs: 52,
82
- },
83
- });
84
- expect(output).toContain('Failed to download content as code (organization) · 0.4s');
85
- expect(output).toContain('└ ✓ Custom roles · 34 downloaded (85ms)');
86
- expect(output).toContain('└ × Users · 403 forbidden (52ms)');
87
- });
88
- it('replaces running progress with one persistent completion tree', () => {
89
- const originalIsTTY = process.stderr.isTTY;
90
- Object.defineProperty(process.stderr, 'isTTY', {
91
- configurable: true,
92
- value: true,
93
- });
94
- vi.stubEnv('CI', 'false');
95
- vi.stubEnv('TERM', 'xterm');
96
- vi.stubEnv('NO_UNICODE', 'false');
97
- const spinner = {
98
- text: '',
99
- start: vi.fn(),
100
- succeed: vi.fn(),
101
- warn: vi.fn(),
102
- stop: vi.fn(),
103
- fail: vi.fn(),
104
- };
105
- vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
106
- const write = vi
107
- .spyOn(process.stderr, 'write')
108
- .mockImplementation(() => true);
109
- const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
110
- operation: 'download',
111
- scope: 'organization',
112
- });
113
- output.startItem('Custom roles');
114
- output.completeItem('34 downloaded');
115
- output.startItem('Users');
116
- expect(spinner.succeed).not.toHaveBeenCalled();
117
- expect(spinner.text).toContain('└ ◐ Users · downloading…');
118
- expect(output.complete('/tmp/lightdash', 0.6)).toBe(true);
119
- expect(spinner.stop).toHaveBeenCalledOnce();
120
- expect(write).toHaveBeenCalledOnce();
121
- Object.defineProperty(process.stderr, 'isTTY', {
122
- configurable: true,
123
- value: originalIsTTY,
124
- });
125
- vi.unstubAllEnvs();
126
- vi.restoreAllMocks();
127
- });
128
- it('pauses the spinner around a prompt and resumes with progress text', async () => {
129
- const originalIsTTY = process.stderr.isTTY;
130
- Object.defineProperty(process.stderr, 'isTTY', {
131
- configurable: true,
132
- value: true,
133
- });
134
- vi.stubEnv('CI', 'false');
135
- vi.stubEnv('TERM', 'xterm');
136
- vi.stubEnv('NO_UNICODE', 'false');
137
- const spinner = {
138
- text: '',
139
- start: vi.fn(),
140
- succeed: vi.fn(),
141
- warn: vi.fn(),
142
- stop: vi.fn(),
143
- fail: vi.fn(),
144
- };
145
- vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
146
- const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
147
- operation: 'upload',
148
- scope: 'project',
149
- });
150
- output.startItem('Data apps');
151
- // The spinner must be stopped BEFORE the prompt runs (a spinning
152
- // repaint hides the prompt and the command looks hung).
153
- const answer = await output.promptWhilePaused(() => {
154
- expect(spinner.stop).toHaveBeenCalledOnce();
155
- expect(spinner.start).not.toHaveBeenCalled();
156
- return Promise.resolve('yes');
157
- });
158
- expect(answer).toBe('yes');
159
- expect(spinner.start).toHaveBeenCalledOnce();
160
- expect(String(spinner.start.mock.calls[0][0])).toContain('Data apps');
161
- // A rejecting prompt still resumes the spinner.
162
- await expect(output.promptWhilePaused(() => Promise.reject(new Error('nope')))).rejects.toThrow('nope');
163
- expect(spinner.start).toHaveBeenCalledTimes(2);
164
- Object.defineProperty(process.stderr, 'isTTY', {
165
- configurable: true,
166
- value: originalIsTTY,
167
- });
168
- vi.unstubAllEnvs();
169
- vi.restoreAllMocks();
170
- });
171
- it('updates the active tree item with resource progress', () => {
172
- const originalIsTTY = process.stderr.isTTY;
173
- Object.defineProperty(process.stderr, 'isTTY', {
174
- configurable: true,
175
- value: true,
176
- });
177
- vi.stubEnv('CI', 'false');
178
- vi.stubEnv('TERM', 'xterm');
179
- vi.stubEnv('NO_UNICODE', 'false');
180
- const spinner = {
181
- text: '',
182
- start: vi.fn(),
183
- succeed: vi.fn(),
184
- warn: vi.fn(),
185
- stop: vi.fn(),
186
- fail: vi.fn(),
187
- };
188
- vi.spyOn(globalState_1.default, 'startSpinner').mockReturnValue(spinner);
189
- const output = (0, contentAsCodeOutput_1.createContentAsCodeOutput)({
190
- operation: 'download',
191
- scope: 'project',
192
- });
193
- output.startItem('Charts');
194
- output.updateActive('25 of 100 downloaded');
195
- expect(spinner.text).toContain('└ ◐ Charts · 25 of 100 downloaded');
196
- Object.defineProperty(process.stderr, 'isTTY', {
197
- configurable: true,
198
- value: originalIsTTY,
199
- });
200
- vi.unstubAllEnvs();
201
- vi.restoreAllMocks();
202
- });
203
- it('hides routine discovery in tree mode unless verbose output is enabled', () => {
204
- const originalIsTTY = process.stderr.isTTY;
205
- Object.defineProperty(process.stderr, 'isTTY', {
206
- configurable: true,
207
- value: true,
208
- });
209
- vi.stubEnv('CI', 'false');
210
- vi.stubEnv('TERM', 'xterm');
211
- vi.stubEnv('NO_UNICODE', 'false');
212
- const debug = vi
213
- .spyOn(globalState_1.default, 'debug')
214
- .mockImplementation(() => undefined);
215
- const log = vi
216
- .spyOn(globalState_1.default, 'log')
217
- .mockImplementation(() => undefined);
218
- (0, contentAsCodeOutput_1.logContentAsCodeDiscovery)('Found 3 chart files');
219
- expect(debug).toHaveBeenCalledWith('Found 3 chart files');
220
- expect(log).not.toHaveBeenCalled();
221
- vi.stubEnv('CI', 'true');
222
- (0, contentAsCodeOutput_1.logContentAsCodeDiscovery)('Found 3 chart files');
223
- expect(log).toHaveBeenCalledWith('Found 3 chart files');
224
- Object.defineProperty(process.stderr, 'isTTY', {
225
- configurable: true,
226
- value: originalIsTTY,
227
- });
228
- vi.unstubAllEnvs();
229
- vi.restoreAllMocks();
230
- });
231
- });