@lightdash/common 0.2104.7 → 0.2104.8

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 (752) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -0
  2. package/dist/cjs/authorization/index.d.ts +1 -4
  3. package/dist/cjs/authorization/index.d.ts.map +1 -1
  4. package/dist/cjs/authorization/index.js +0 -4
  5. package/dist/cjs/authorization/index.js.map +1 -1
  6. package/dist/cjs/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
  7. package/dist/cjs/ee/AiAgent/index.d.ts +2 -2
  8. package/dist/cjs/ee/AiAgent/schemas/parser.d.ts +24 -24
  9. package/dist/cjs/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
  10. package/dist/cjs/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
  11. package/dist/cjs/ee/AiAgent/utils.d.ts +8 -8
  12. package/dist/cjs/index.d.ts +23 -449
  13. package/dist/cjs/index.d.ts.map +1 -1
  14. package/dist/cjs/index.js +21 -55
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/cjs/pivot/index.d.ts +1 -0
  17. package/dist/cjs/pivot/index.d.ts.map +1 -1
  18. package/dist/cjs/pivot/index.js +1 -0
  19. package/dist/cjs/pivot/index.js.map +1 -1
  20. package/dist/cjs/pivot/pivotConfig.d.ts +7 -0
  21. package/dist/cjs/pivot/pivotConfig.d.ts.map +1 -0
  22. package/dist/cjs/pivot/pivotConfig.js +32 -0
  23. package/dist/cjs/pivot/pivotConfig.js.map +1 -0
  24. package/dist/cjs/types/api.d.ts +447 -0
  25. package/dist/cjs/types/api.d.ts.map +1 -1
  26. package/dist/cjs/types/api.js +50 -1
  27. package/dist/cjs/types/api.js.map +1 -1
  28. package/dist/cjs/types/auth.d.ts +2 -1
  29. package/dist/cjs/types/auth.d.ts.map +1 -1
  30. package/dist/cjs/types/auth.js +4 -4
  31. package/dist/cjs/types/auth.js.map +1 -1
  32. package/dist/cjs/types/changeset.d.ts +10 -10
  33. package/dist/cjs/types/pivot.d.ts +0 -2
  34. package/dist/cjs/types/pivot.d.ts.map +1 -1
  35. package/dist/cjs/types/pivot.js +0 -29
  36. package/dist/cjs/types/pivot.js.map +1 -1
  37. package/dist/cjs/types/resourceViewItem.d.ts +1 -1
  38. package/dist/esm/.tsbuildinfo +1 -0
  39. package/dist/esm/authorization/index.d.ts +1 -4
  40. package/dist/esm/authorization/index.d.ts.map +1 -1
  41. package/dist/esm/authorization/index.js +0 -4
  42. package/dist/esm/authorization/index.js.map +1 -1
  43. package/dist/esm/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
  44. package/dist/esm/ee/AiAgent/index.d.ts +2 -2
  45. package/dist/esm/ee/AiAgent/schemas/parser.d.ts +24 -24
  46. package/dist/esm/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
  47. package/dist/esm/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
  48. package/dist/esm/ee/AiAgent/utils.d.ts +8 -8
  49. package/dist/esm/index.d.ts +23 -449
  50. package/dist/esm/index.d.ts.map +1 -1
  51. package/dist/esm/index.js +16 -50
  52. package/dist/esm/index.js.map +1 -1
  53. package/dist/esm/pivot/index.d.ts +1 -0
  54. package/dist/esm/pivot/index.d.ts.map +1 -1
  55. package/dist/esm/pivot/index.js +1 -0
  56. package/dist/esm/pivot/index.js.map +1 -1
  57. package/dist/esm/pivot/pivotConfig.d.ts +7 -0
  58. package/dist/esm/pivot/pivotConfig.d.ts.map +1 -0
  59. package/dist/esm/pivot/pivotConfig.js +28 -0
  60. package/dist/esm/pivot/pivotConfig.js.map +1 -0
  61. package/dist/esm/types/api.d.ts +447 -0
  62. package/dist/esm/types/api.d.ts.map +1 -1
  63. package/dist/esm/types/api.js +46 -0
  64. package/dist/esm/types/api.js.map +1 -1
  65. package/dist/esm/types/auth.d.ts +2 -1
  66. package/dist/esm/types/auth.d.ts.map +1 -1
  67. package/dist/esm/types/auth.js +2 -2
  68. package/dist/esm/types/auth.js.map +1 -1
  69. package/dist/esm/types/changeset.d.ts +10 -10
  70. package/dist/esm/types/pivot.d.ts +0 -2
  71. package/dist/esm/types/pivot.d.ts.map +1 -1
  72. package/dist/esm/types/pivot.js +1 -27
  73. package/dist/esm/types/pivot.js.map +1 -1
  74. package/dist/esm/types/resourceViewItem.d.ts +1 -1
  75. package/dist/types/.tsbuildinfo +1 -0
  76. package/dist/types/authorization/buildAccountHelpers.js +11 -0
  77. package/dist/types/authorization/buildAccountHelpers.js.map +1 -0
  78. package/dist/types/authorization/index.d.ts +1 -4
  79. package/dist/types/authorization/index.d.ts.map +1 -1
  80. package/dist/types/authorization/index.js +62 -0
  81. package/dist/types/authorization/index.js.map +1 -0
  82. package/dist/types/authorization/index.mock.js +42 -0
  83. package/dist/types/authorization/index.mock.js.map +1 -0
  84. package/dist/types/authorization/index.test.js +220 -0
  85. package/dist/types/authorization/index.test.js.map +1 -0
  86. package/dist/types/authorization/jwtAbility.js +77 -0
  87. package/dist/types/authorization/jwtAbility.js.map +1 -0
  88. package/dist/types/authorization/jwtAbility.test.js +416 -0
  89. package/dist/types/authorization/jwtAbility.test.js.map +1 -0
  90. package/dist/types/authorization/organizationMemberAbility.js +318 -0
  91. package/dist/types/authorization/organizationMemberAbility.js.map +1 -0
  92. package/dist/types/authorization/organizationMemberAbility.mock.js +34 -0
  93. package/dist/types/authorization/organizationMemberAbility.mock.js.map +1 -0
  94. package/dist/types/authorization/organizationMemberAbility.test.js +1265 -0
  95. package/dist/types/authorization/organizationMemberAbility.test.js.map +1 -0
  96. package/dist/types/authorization/parseAccount.js +28 -0
  97. package/dist/types/authorization/parseAccount.js.map +1 -0
  98. package/dist/types/authorization/parseScopes.js +31 -0
  99. package/dist/types/authorization/parseScopes.js.map +1 -0
  100. package/dist/types/authorization/parseScopes.test.js +102 -0
  101. package/dist/types/authorization/parseScopes.test.js.map +1 -0
  102. package/dist/types/authorization/projectMemberAbility.js +239 -0
  103. package/dist/types/authorization/projectMemberAbility.js.map +1 -0
  104. package/dist/types/authorization/projectMemberAbility.mock.js +27 -0
  105. package/dist/types/authorization/projectMemberAbility.mock.js.map +1 -0
  106. package/dist/types/authorization/projectMemberAbility.test.js +1031 -0
  107. package/dist/types/authorization/projectMemberAbility.test.js.map +1 -0
  108. package/dist/types/authorization/roleToScopeMapping.js +150 -0
  109. package/dist/types/authorization/roleToScopeMapping.js.map +1 -0
  110. package/dist/types/authorization/roleToScopeMapping.test.js +561 -0
  111. package/dist/types/authorization/roleToScopeMapping.test.js.map +1 -0
  112. package/dist/types/authorization/roleToScopeMapping.testUtils.js +319 -0
  113. package/dist/types/authorization/roleToScopeMapping.testUtils.js.map +1 -0
  114. package/dist/types/authorization/roleToScopeParity.test.js +194 -0
  115. package/dist/types/authorization/roleToScopeParity.test.js.map +1 -0
  116. package/dist/types/authorization/scopeAbilityBuilder.js +57 -0
  117. package/dist/types/authorization/scopeAbilityBuilder.js.map +1 -0
  118. package/dist/types/authorization/scopeAbilityBuilder.test.js +1348 -0
  119. package/dist/types/authorization/scopeAbilityBuilder.test.js.map +1 -0
  120. package/dist/types/authorization/scopes.js +613 -0
  121. package/dist/types/authorization/scopes.js.map +1 -0
  122. package/dist/types/authorization/serviceAccountAbility.js +303 -0
  123. package/dist/types/authorization/serviceAccountAbility.js.map +1 -0
  124. package/dist/types/authorization/types.js +2 -0
  125. package/dist/types/authorization/types.js.map +1 -0
  126. package/dist/types/compiler/exploreCompiler.js +462 -0
  127. package/dist/types/compiler/exploreCompiler.js.map +1 -0
  128. package/dist/types/compiler/exploreCompiler.mock.js +2016 -0
  129. package/dist/types/compiler/exploreCompiler.mock.js.map +1 -0
  130. package/dist/types/compiler/exploreCompiler.test.js +679 -0
  131. package/dist/types/compiler/exploreCompiler.test.js.map +1 -0
  132. package/dist/types/compiler/fieldSetExpander.js +119 -0
  133. package/dist/types/compiler/fieldSetExpander.js.map +1 -0
  134. package/dist/types/compiler/fieldSetExpander.test.js +184 -0
  135. package/dist/types/compiler/fieldSetExpander.test.js.map +1 -0
  136. package/dist/types/compiler/filtersCompiler.js +337 -0
  137. package/dist/types/compiler/filtersCompiler.js.map +1 -0
  138. package/dist/types/compiler/filtersCompiler.mock.js +496 -0
  139. package/dist/types/compiler/filtersCompiler.mock.js.map +1 -0
  140. package/dist/types/compiler/filtersCompiler.test.js +570 -0
  141. package/dist/types/compiler/filtersCompiler.test.js.map +1 -0
  142. package/dist/types/compiler/lightdashProjectConfig.js +37 -0
  143. package/dist/types/compiler/lightdashProjectConfig.js.map +1 -0
  144. package/dist/types/compiler/parameters.js +75 -0
  145. package/dist/types/compiler/parameters.js.map +1 -0
  146. package/dist/types/compiler/parameters.test.js +216 -0
  147. package/dist/types/compiler/parameters.test.js.map +1 -0
  148. package/dist/types/compiler/translator.js +707 -0
  149. package/dist/types/compiler/translator.js.map +1 -0
  150. package/dist/types/compiler/translator.mock.js +1901 -0
  151. package/dist/types/compiler/translator.mock.js.map +1 -0
  152. package/dist/types/compiler/translator.test.js +323 -0
  153. package/dist/types/compiler/translator.test.js.map +1 -0
  154. package/dist/types/constants/pivot.js +7 -0
  155. package/dist/types/constants/pivot.js.map +1 -0
  156. package/dist/types/constants/sessionStorageKeys.js +6 -0
  157. package/dist/types/constants/sessionStorageKeys.js.map +1 -0
  158. package/dist/types/constants/sqlRunner.js +3 -0
  159. package/dist/types/constants/sqlRunner.js.map +1 -0
  160. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.js +285 -0
  161. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.js.map +1 -0
  162. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.mock.js +224 -0
  163. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.mock.js.map +1 -0
  164. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.test.js +129 -0
  165. package/dist/types/dbt/DbtSchemaEditor/DbtSchemaEditor.test.js.map +1 -0
  166. package/dist/types/dbt/schemas/lightdashMetadata.json +385 -0
  167. package/dist/types/dbt/schemas/lightdashV10.json +72 -0
  168. package/dist/types/dbt/schemas/lightdashV11.json +72 -0
  169. package/dist/types/dbt/schemas/lightdashV12.json +63 -0
  170. package/dist/types/dbt/schemas/lightdashV7.json +72 -0
  171. package/dist/types/dbt/schemas/lightdashV8.json +76 -0
  172. package/dist/types/dbt/schemas/lightdashV9.json +72 -0
  173. package/dist/types/dbt/schemas/manifestV10.json +5545 -0
  174. package/dist/types/dbt/schemas/manifestV11.json +6041 -0
  175. package/dist/types/dbt/schemas/manifestV12.json +22567 -0
  176. package/dist/types/dbt/schemas/manifestV7.json +6481 -0
  177. package/dist/types/dbt/schemas/manifestV8.json +4358 -0
  178. package/dist/types/dbt/schemas/manifestV9.json +4879 -0
  179. package/dist/types/dbt/validation.js +67 -0
  180. package/dist/types/dbt/validation.js.map +1 -0
  181. package/dist/types/ee/AiAgent/adminTypes.js +2 -0
  182. package/dist/types/ee/AiAgent/adminTypes.js.map +1 -0
  183. package/dist/types/ee/AiAgent/chartConfig/shared/formatFieldLabel.js +10 -0
  184. package/dist/types/ee/AiAgent/chartConfig/shared/formatFieldLabel.js.map +1 -0
  185. package/dist/types/ee/AiAgent/chartConfig/slack/generateBarVizConfigTool/getVerticalBarChartEchartsConfig.js +60 -0
  186. package/dist/types/ee/AiAgent/chartConfig/slack/generateBarVizConfigTool/getVerticalBarChartEchartsConfig.js.map +1 -0
  187. package/dist/types/ee/AiAgent/chartConfig/slack/generateTimeSeriesVizConfigTool/getTimeSeriesChartEchartsConfig.js +60 -0
  188. package/dist/types/ee/AiAgent/chartConfig/slack/generateTimeSeriesVizConfigTool/getTimeSeriesChartEchartsConfig.js.map +1 -0
  189. package/dist/types/ee/AiAgent/chartConfig/slack/getSlackAiEchartsConfig.js +33 -0
  190. package/dist/types/ee/AiAgent/chartConfig/slack/getSlackAiEchartsConfig.js.map +1 -0
  191. package/dist/types/ee/AiAgent/chartConfig/slack/index.js +2 -0
  192. package/dist/types/ee/AiAgent/chartConfig/slack/index.js.map +1 -0
  193. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/getRunQueryEchartsConfig.js +43 -0
  194. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/getRunQueryEchartsConfig.js.map +1 -0
  195. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/bar.js +98 -0
  196. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/bar.js.map +1 -0
  197. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/funnel.js +38 -0
  198. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/funnel.js.map +1 -0
  199. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/horizontalBar.js +65 -0
  200. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/horizontalBar.js.map +1 -0
  201. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/line.js +105 -0
  202. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/line.js.map +1 -0
  203. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/pie.js +34 -0
  204. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/pie.js.map +1 -0
  205. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/scatter.js +66 -0
  206. package/dist/types/ee/AiAgent/chartConfig/slack/runQueryTool/viz/scatter.js.map +1 -0
  207. package/dist/types/ee/AiAgent/chartConfig/slack/shared/getCommonEChartsConfig.js +104 -0
  208. package/dist/types/ee/AiAgent/chartConfig/slack/shared/getCommonEChartsConfig.js.map +1 -0
  209. package/dist/types/ee/AiAgent/chartConfig/slack/types.js +2 -0
  210. package/dist/types/ee/AiAgent/chartConfig/slack/types.js.map +1 -0
  211. package/dist/types/ee/AiAgent/chartConfig/web/generateBarVizConfigTool/getVerticalBarChartConfig.js +65 -0
  212. package/dist/types/ee/AiAgent/chartConfig/web/generateBarVizConfigTool/getVerticalBarChartConfig.js.map +1 -0
  213. package/dist/types/ee/AiAgent/chartConfig/web/generateTableVizConfigTool/getTableChartConfig.js +5 -0
  214. package/dist/types/ee/AiAgent/chartConfig/web/generateTableVizConfigTool/getTableChartConfig.js.map +1 -0
  215. package/dist/types/ee/AiAgent/chartConfig/web/generateTimeSeriesVizConfigTool/getTimeSeriesChartConfig.js +63 -0
  216. package/dist/types/ee/AiAgent/chartConfig/web/generateTimeSeriesVizConfigTool/getTimeSeriesChartConfig.js.map +1 -0
  217. package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.d.ts +8 -8
  218. package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.js +51 -0
  219. package/dist/types/ee/AiAgent/chartConfig/web/getWebAiChartConfig.js.map +1 -0
  220. package/dist/types/ee/AiAgent/chartConfig/web/index.js +6 -0
  221. package/dist/types/ee/AiAgent/chartConfig/web/index.js.map +1 -0
  222. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/getRunQueryChartConfig.js +73 -0
  223. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/getRunQueryChartConfig.js.map +1 -0
  224. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/bar.js +91 -0
  225. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/bar.js.map +1 -0
  226. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/funnel.js +17 -0
  227. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/funnel.js.map +1 -0
  228. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/horizontalBar.js +52 -0
  229. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/horizontalBar.js.map +1 -0
  230. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/line.js +96 -0
  231. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/line.js.map +1 -0
  232. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/pie.js +15 -0
  233. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/pie.js.map +1 -0
  234. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/scatter.js +66 -0
  235. package/dist/types/ee/AiAgent/chartConfig/web/runQueryTool/viz/scatter.js.map +1 -0
  236. package/dist/types/ee/AiAgent/chartConfig/web/shared/canRenderAsChart.js +24 -0
  237. package/dist/types/ee/AiAgent/chartConfig/web/shared/canRenderAsChart.js.map +1 -0
  238. package/dist/types/ee/AiAgent/chartConfig/web/shared/formatPivotValueLabel.js +15 -0
  239. package/dist/types/ee/AiAgent/chartConfig/web/shared/formatPivotValueLabel.js.map +1 -0
  240. package/dist/types/ee/AiAgent/chartConfig/web/shared/getAvailableChartTypes.js +11 -0
  241. package/dist/types/ee/AiAgent/chartConfig/web/shared/getAvailableChartTypes.js.map +1 -0
  242. package/dist/types/ee/AiAgent/chartConfig/web/shared/getGroupByDimensions.js +15 -0
  243. package/dist/types/ee/AiAgent/chartConfig/web/shared/getGroupByDimensions.js.map +1 -0
  244. package/dist/types/ee/AiAgent/chartConfig/web/types.js +2 -0
  245. package/dist/types/ee/AiAgent/chartConfig/web/types.js.map +1 -0
  246. package/dist/types/ee/AiAgent/constants.js +2 -0
  247. package/dist/types/ee/AiAgent/constants.js.map +1 -0
  248. package/dist/types/ee/AiAgent/filterExploreByTags.js +94 -0
  249. package/dist/types/ee/AiAgent/filterExploreByTags.js.map +1 -0
  250. package/dist/types/ee/AiAgent/filterExploreByTags.test.js +634 -0
  251. package/dist/types/ee/AiAgent/filterExploreByTags.test.js.map +1 -0
  252. package/dist/types/ee/AiAgent/followUpTools.js +33 -0
  253. package/dist/types/ee/AiAgent/followUpTools.js.map +1 -0
  254. package/dist/types/ee/AiAgent/index.d.ts +2 -2
  255. package/dist/types/ee/AiAgent/index.js +43 -0
  256. package/dist/types/ee/AiAgent/index.js.map +1 -0
  257. package/dist/types/ee/AiAgent/requestTypes.js +2 -0
  258. package/dist/types/ee/AiAgent/requestTypes.js.map +1 -0
  259. package/dist/types/ee/AiAgent/schemas/customMetrics.js +50 -0
  260. package/dist/types/ee/AiAgent/schemas/customMetrics.js.map +1 -0
  261. package/dist/types/ee/AiAgent/schemas/fieldId.js +11 -0
  262. package/dist/types/ee/AiAgent/schemas/fieldId.js.map +1 -0
  263. package/dist/types/ee/AiAgent/schemas/filters/booleanFilters.js +29 -0
  264. package/dist/types/ee/AiAgent/schemas/filters/booleanFilters.js.map +1 -0
  265. package/dist/types/ee/AiAgent/schemas/filters/dateFilters.js +84 -0
  266. package/dist/types/ee/AiAgent/schemas/filters/dateFilters.js.map +1 -0
  267. package/dist/types/ee/AiAgent/schemas/filters/index.js +98 -0
  268. package/dist/types/ee/AiAgent/schemas/filters/index.js.map +1 -0
  269. package/dist/types/ee/AiAgent/schemas/filters/numberFilters.js +53 -0
  270. package/dist/types/ee/AiAgent/schemas/filters/numberFilters.js.map +1 -0
  271. package/dist/types/ee/AiAgent/schemas/filters/stringFilters.js +33 -0
  272. package/dist/types/ee/AiAgent/schemas/filters/stringFilters.js.map +1 -0
  273. package/dist/types/ee/AiAgent/schemas/index.js +9 -0
  274. package/dist/types/ee/AiAgent/schemas/index.js.map +1 -0
  275. package/dist/types/ee/AiAgent/schemas/outputMetadata.js +5 -0
  276. package/dist/types/ee/AiAgent/schemas/outputMetadata.js.map +1 -0
  277. package/dist/types/ee/AiAgent/schemas/parser.d.ts +24 -24
  278. package/dist/types/ee/AiAgent/schemas/parser.js +43 -0
  279. package/dist/types/ee/AiAgent/schemas/parser.js.map +1 -0
  280. package/dist/types/ee/AiAgent/schemas/sortField.js +14 -0
  281. package/dist/types/ee/AiAgent/schemas/sortField.js.map +1 -0
  282. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcBaseSchemas.js +28 -0
  283. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcBaseSchemas.js.map +1 -0
  284. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentChangeFromPrevious.js +14 -0
  285. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentChangeFromPrevious.js.map +1 -0
  286. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfColumnTotal.js +14 -0
  287. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfColumnTotal.js.map +1 -0
  288. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfPreviousValue.js +14 -0
  289. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcPercentOfPreviousValue.js.map +1 -0
  290. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRankInColumn.js +10 -0
  291. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRankInColumn.js.map +1 -0
  292. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRunningTotal.js +10 -0
  293. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcRunningTotal.js.map +1 -0
  294. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcWindowFunction.js +105 -0
  295. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcWindowFunction.js.map +1 -0
  296. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcs.js +168 -0
  297. package/dist/types/ee/AiAgent/schemas/tableCalcs/tableCalcs.js.map +1 -0
  298. package/dist/types/ee/AiAgent/schemas/toolSchemaBuilder.js +37 -0
  299. package/dist/types/ee/AiAgent/schemas/toolSchemaBuilder.js.map +1 -0
  300. package/dist/types/ee/AiAgent/schemas/tools/index.js +16 -0
  301. package/dist/types/ee/AiAgent/schemas/tools/index.js.map +1 -0
  302. package/dist/types/ee/AiAgent/schemas/tools/toolDashboardArgs.js +103 -0
  303. package/dist/types/ee/AiAgent/schemas/tools/toolDashboardArgs.js.map +1 -0
  304. package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.d.ts +96 -96
  305. package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.js +50 -0
  306. package/dist/types/ee/AiAgent/schemas/tools/toolDashboardV2Args.js.map +1 -0
  307. package/dist/types/ee/AiAgent/schemas/tools/toolFindChartsArgs.js +34 -0
  308. package/dist/types/ee/AiAgent/schemas/tools/toolFindChartsArgs.js.map +1 -0
  309. package/dist/types/ee/AiAgent/schemas/tools/toolFindContentArgs.js +33 -0
  310. package/dist/types/ee/AiAgent/schemas/tools/toolFindContentArgs.js.map +1 -0
  311. package/dist/types/ee/AiAgent/schemas/tools/toolFindDashboardsArgs.js +36 -0
  312. package/dist/types/ee/AiAgent/schemas/tools/toolFindDashboardsArgs.js.map +1 -0
  313. package/dist/types/ee/AiAgent/schemas/tools/toolFindExploresArgs.js +45 -0
  314. package/dist/types/ee/AiAgent/schemas/tools/toolFindExploresArgs.js.map +1 -0
  315. package/dist/types/ee/AiAgent/schemas/tools/toolFindFieldsArgs.js +34 -0
  316. package/dist/types/ee/AiAgent/schemas/tools/toolFindFieldsArgs.js.map +1 -0
  317. package/dist/types/ee/AiAgent/schemas/tools/toolImproveContextArgs.js +60 -0
  318. package/dist/types/ee/AiAgent/schemas/tools/toolImproveContextArgs.js.map +1 -0
  319. package/dist/types/ee/AiAgent/schemas/tools/toolProposeChangeArgs.js +157 -0
  320. package/dist/types/ee/AiAgent/schemas/tools/toolProposeChangeArgs.js.map +1 -0
  321. package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.js +41 -0
  322. package/dist/types/ee/AiAgent/schemas/tools/toolRunMetricQueryArgs.js.map +1 -0
  323. package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.d.ts +48 -48
  324. package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.js +151 -0
  325. package/dist/types/ee/AiAgent/schemas/tools/toolRunQueryArgs.js.map +1 -0
  326. package/dist/types/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.js +46 -0
  327. package/dist/types/ee/AiAgent/schemas/tools/toolSearchFieldValuesArgs.js.map +1 -0
  328. package/dist/types/ee/AiAgent/schemas/tools/toolTableVizArgs.js +53 -0
  329. package/dist/types/ee/AiAgent/schemas/tools/toolTableVizArgs.js.map +1 -0
  330. package/dist/types/ee/AiAgent/schemas/tools/toolTimeSeriesArgs.js +58 -0
  331. package/dist/types/ee/AiAgent/schemas/tools/toolTimeSeriesArgs.js.map +1 -0
  332. package/dist/types/ee/AiAgent/schemas/tools/toolVerticalBarArgs.js +53 -0
  333. package/dist/types/ee/AiAgent/schemas/tools/toolVerticalBarArgs.js.map +1 -0
  334. package/dist/types/ee/AiAgent/schemas/visualizationMetadata.js +9 -0
  335. package/dist/types/ee/AiAgent/schemas/visualizationMetadata.js.map +1 -0
  336. package/dist/types/ee/AiAgent/schemas/visualizations/index.js +58 -0
  337. package/dist/types/ee/AiAgent/schemas/visualizations/index.js.map +1 -0
  338. package/dist/types/ee/AiAgent/schemas/visualizations/tableViz.js +38 -0
  339. package/dist/types/ee/AiAgent/schemas/visualizations/tableViz.js.map +1 -0
  340. package/dist/types/ee/AiAgent/schemas/visualizations/timeSeriesViz.js +63 -0
  341. package/dist/types/ee/AiAgent/schemas/visualizations/timeSeriesViz.js.map +1 -0
  342. package/dist/types/ee/AiAgent/schemas/visualizations/verticalBarViz.js +68 -0
  343. package/dist/types/ee/AiAgent/schemas/visualizations/verticalBarViz.js.map +1 -0
  344. package/dist/types/ee/AiAgent/types.js +12 -0
  345. package/dist/types/ee/AiAgent/types.js.map +1 -0
  346. package/dist/types/ee/AiAgent/utils.d.ts +8 -8
  347. package/dist/types/ee/AiAgent/utils.js +82 -0
  348. package/dist/types/ee/AiAgent/utils.js.map +1 -0
  349. package/dist/types/ee/AiAgent/validators.js +10 -0
  350. package/dist/types/ee/AiAgent/validators.js.map +1 -0
  351. package/dist/types/ee/commercialFeatureFlags.js +10 -0
  352. package/dist/types/ee/commercialFeatureFlags.js.map +1 -0
  353. package/dist/types/ee/embed/index.js +90 -0
  354. package/dist/types/ee/embed/index.js.map +1 -0
  355. package/dist/types/ee/index.js +19 -0
  356. package/dist/types/ee/index.js.map +1 -0
  357. package/dist/types/ee/scim/errors.js +22 -0
  358. package/dist/types/ee/scim/errors.js.map +1 -0
  359. package/dist/types/ee/scim/types.js +2 -0
  360. package/dist/types/ee/scim/types.js.map +1 -0
  361. package/dist/types/ee/serviceAccounts/types.js +8 -0
  362. package/dist/types/ee/serviceAccounts/types.js.map +1 -0
  363. package/dist/types/index.d.ts +23 -449
  364. package/dist/types/index.d.ts.map +1 -1
  365. package/dist/types/index.js +652 -0
  366. package/dist/types/index.js.map +1 -0
  367. package/dist/types/index.mock.js +44 -0
  368. package/dist/types/index.mock.js.map +1 -0
  369. package/dist/types/index.test.js +123 -0
  370. package/dist/types/index.test.js.map +1 -0
  371. package/dist/types/pivot/derivePivotConfigFromChart.js +206 -0
  372. package/dist/types/pivot/derivePivotConfigFromChart.js.map +1 -0
  373. package/dist/types/pivot/derivePivotConfigFromChart.mock.js +112 -0
  374. package/dist/types/pivot/derivePivotConfigFromChart.mock.js.map +1 -0
  375. package/dist/types/pivot/derivePivotConfigFromChart.test.js +418 -0
  376. package/dist/types/pivot/derivePivotConfigFromChart.test.js.map +1 -0
  377. package/dist/types/pivot/index.d.ts +1 -0
  378. package/dist/types/pivot/index.d.ts.map +1 -1
  379. package/dist/types/pivot/index.js +5 -0
  380. package/dist/types/pivot/index.js.map +1 -0
  381. package/dist/types/pivot/pivotConfig.d.ts +7 -0
  382. package/dist/types/pivot/pivotConfig.d.ts.map +1 -0
  383. package/dist/types/pivot/pivotConfig.js +28 -0
  384. package/dist/types/pivot/pivotConfig.js.map +1 -0
  385. package/dist/types/pivot/pivotQueryResults.js +1034 -0
  386. package/dist/types/pivot/pivotQueryResults.js.map +1 -0
  387. package/dist/types/pivot/pivotQueryResults.mock.js +2412 -0
  388. package/dist/types/pivot/pivotQueryResults.mock.js.map +1 -0
  389. package/dist/types/pivot/pivotQueryResults.test.js +1222 -0
  390. package/dist/types/pivot/pivotQueryResults.test.js.map +1 -0
  391. package/dist/types/pivot/utils.js +14 -0
  392. package/dist/types/pivot/utils.js.map +1 -0
  393. package/dist/types/schemas/json/chart-as-code-1.0.json +436 -0
  394. package/dist/types/schemas/json/dashboard-as-code-1.0.json +349 -0
  395. package/dist/types/schemas/json/lightdash-dbt-2.0.json +1417 -0
  396. package/dist/types/schemas/json/lightdash-project-config-1.0.json +138 -0
  397. package/dist/types/templating/template.js +30 -0
  398. package/dist/types/templating/template.js.map +1 -0
  399. package/dist/types/templating/template.mock.js +45 -0
  400. package/dist/types/templating/template.mock.js.map +1 -0
  401. package/dist/types/templating/template.test.js +21 -0
  402. package/dist/types/templating/template.test.js.map +1 -0
  403. package/dist/types/types/SshKeyPair.js +2 -0
  404. package/dist/types/types/SshKeyPair.js.map +1 -0
  405. package/dist/types/types/account.js +2 -0
  406. package/dist/types/types/account.js.map +1 -0
  407. package/dist/types/types/analytics.js +29 -0
  408. package/dist/types/types/analytics.js.map +1 -0
  409. package/dist/types/types/any.js +2 -0
  410. package/dist/types/types/any.js.map +1 -0
  411. package/dist/types/types/api/comments.js +2 -0
  412. package/dist/types/types/api/comments.js.map +1 -0
  413. package/dist/types/types/api/email.js +2 -0
  414. package/dist/types/types/api/email.js.map +1 -0
  415. package/dist/types/types/api/errors.js +2 -0
  416. package/dist/types/types/api/errors.js.map +1 -0
  417. package/dist/types/types/api/notifications.js +5 -0
  418. package/dist/types/types/api/notifications.js.map +1 -0
  419. package/dist/types/types/api/paginatedQuery.js +3 -0
  420. package/dist/types/types/api/paginatedQuery.js.map +1 -0
  421. package/dist/types/types/api/parameters.js +2 -0
  422. package/dist/types/types/api/parameters.js.map +1 -0
  423. package/dist/types/types/api/share.js +2 -0
  424. package/dist/types/types/api/share.js.map +1 -0
  425. package/dist/types/types/api/sort.js +2 -0
  426. package/dist/types/types/api/sort.js.map +1 -0
  427. package/dist/types/types/api/spotlight.js +2 -0
  428. package/dist/types/types/api/spotlight.js.map +1 -0
  429. package/dist/types/types/api/success.js +2 -0
  430. package/dist/types/types/api/success.js.map +1 -0
  431. package/dist/types/types/api/uuid.js +2 -0
  432. package/dist/types/types/api/uuid.js.map +1 -0
  433. package/dist/types/types/api.d.ts +447 -0
  434. package/dist/types/types/api.d.ts.map +1 -1
  435. package/dist/types/types/api.js +57 -0
  436. package/dist/types/types/api.js.map +1 -0
  437. package/dist/types/types/applyDimensionOverrides.test.js +338 -0
  438. package/dist/types/types/applyDimensionOverrides.test.js.map +1 -0
  439. package/dist/types/types/auth.d.ts +2 -1
  440. package/dist/types/types/auth.d.ts.map +1 -1
  441. package/dist/types/types/auth.js +42 -0
  442. package/dist/types/types/auth.js.map +1 -0
  443. package/dist/types/types/bigQuerySSO.js +2 -0
  444. package/dist/types/types/bigQuerySSO.js.map +1 -0
  445. package/dist/types/types/catalog.js +50 -0
  446. package/dist/types/types/catalog.js.map +1 -0
  447. package/dist/types/types/changeset.d.ts +10 -10
  448. package/dist/types/types/changeset.js +72 -0
  449. package/dist/types/types/changeset.js.map +1 -0
  450. package/dist/types/types/coder.js +2 -0
  451. package/dist/types/types/coder.js.map +1 -0
  452. package/dist/types/types/comments.js +2 -0
  453. package/dist/types/types/comments.js.map +1 -0
  454. package/dist/types/types/conditionalFormatting.js +25 -0
  455. package/dist/types/types/conditionalFormatting.js.map +1 -0
  456. package/dist/types/types/content.js +19 -0
  457. package/dist/types/types/content.js.map +1 -0
  458. package/dist/types/types/csv.js +2 -0
  459. package/dist/types/types/csv.js.map +1 -0
  460. package/dist/types/types/dashboard.js +46 -0
  461. package/dist/types/types/dashboard.js.map +1 -0
  462. package/dist/types/types/dbt.js +262 -0
  463. package/dist/types/types/dbt.js.map +1 -0
  464. package/dist/types/types/dbtFromSchema.js +2 -0
  465. package/dist/types/types/dbtFromSchema.js.map +1 -0
  466. package/dist/types/types/deepPartial.js +7 -0
  467. package/dist/types/types/deepPartial.js.map +1 -0
  468. package/dist/types/types/downloadFile.js +9 -0
  469. package/dist/types/types/downloadFile.js.map +1 -0
  470. package/dist/types/types/email.js +2 -0
  471. package/dist/types/types/email.js.map +1 -0
  472. package/dist/types/types/errors.js +496 -0
  473. package/dist/types/types/errors.js.map +1 -0
  474. package/dist/types/types/explore.js +24 -0
  475. package/dist/types/types/explore.js.map +1 -0
  476. package/dist/types/types/featureFlags.js +62 -0
  477. package/dist/types/types/featureFlags.js.map +1 -0
  478. package/dist/types/types/field.js +473 -0
  479. package/dist/types/types/field.js.map +1 -0
  480. package/dist/types/types/field.test.js +90 -0
  481. package/dist/types/types/field.test.js.map +1 -0
  482. package/dist/types/types/fieldMatch.js +2 -0
  483. package/dist/types/types/fieldMatch.js.map +1 -0
  484. package/dist/types/types/filter.js +287 -0
  485. package/dist/types/types/filter.js.map +1 -0
  486. package/dist/types/types/filter.test.js +372 -0
  487. package/dist/types/types/filter.test.js.map +1 -0
  488. package/dist/types/types/filterGrammar.js +358 -0
  489. package/dist/types/types/filterGrammar.js.map +1 -0
  490. package/dist/types/types/filterGrammar.test.js +549 -0
  491. package/dist/types/types/filterGrammar.test.js.map +1 -0
  492. package/dist/types/types/filterGrammarConversion.js +94 -0
  493. package/dist/types/types/filterGrammarConversion.js.map +1 -0
  494. package/dist/types/types/filterGrammarConversion.test.js +260 -0
  495. package/dist/types/types/filterGrammarConversion.test.js.map +1 -0
  496. package/dist/types/types/gdrive.js +2 -0
  497. package/dist/types/types/gdrive.js.map +1 -0
  498. package/dist/types/types/gitIntegration.js +2 -0
  499. package/dist/types/types/gitIntegration.js.map +1 -0
  500. package/dist/types/types/groups.js +4 -0
  501. package/dist/types/types/groups.js.map +1 -0
  502. package/dist/types/types/job.js +67 -0
  503. package/dist/types/types/job.js.map +1 -0
  504. package/dist/types/types/knex-paginate.js +2 -0
  505. package/dist/types/types/knex-paginate.js.map +1 -0
  506. package/dist/types/types/lightdashProjectConfig.js +4 -0
  507. package/dist/types/types/lightdashProjectConfig.js.map +1 -0
  508. package/dist/types/types/metricQuery.js +20 -0
  509. package/dist/types/types/metricQuery.js.map +1 -0
  510. package/dist/types/types/metricsExplorer.js +12 -0
  511. package/dist/types/types/metricsExplorer.js.map +1 -0
  512. package/dist/types/types/notifications.js +2 -0
  513. package/dist/types/types/notifications.js.map +1 -0
  514. package/dist/types/types/oauth.js +2 -0
  515. package/dist/types/types/oauth.js.map +1 -0
  516. package/dist/types/types/openIdIdentity.js +12 -0
  517. package/dist/types/types/openIdIdentity.js.map +1 -0
  518. package/dist/types/types/organization.js +20 -0
  519. package/dist/types/types/organization.js.map +1 -0
  520. package/dist/types/types/organizationMemberProfile.js +30 -0
  521. package/dist/types/types/organizationMemberProfile.js.map +1 -0
  522. package/dist/types/types/organizationWarehouseCredentials.js +2 -0
  523. package/dist/types/types/organizationWarehouseCredentials.js.map +1 -0
  524. package/dist/types/types/paginateResults.js +2 -0
  525. package/dist/types/types/paginateResults.js.map +1 -0
  526. package/dist/types/types/parameters.js +2 -0
  527. package/dist/types/types/parameters.js.map +1 -0
  528. package/dist/types/types/personalAccessToken.js +2 -0
  529. package/dist/types/types/personalAccessToken.js.map +1 -0
  530. package/dist/types/types/pinning.js +5 -0
  531. package/dist/types/types/pinning.js.map +1 -0
  532. package/dist/types/types/pivot.d.ts +0 -2
  533. package/dist/types/types/pivot.d.ts.map +1 -1
  534. package/dist/types/types/pivot.js +2 -0
  535. package/dist/types/types/pivot.js.map +1 -0
  536. package/dist/types/types/projectGroupAccess.js +2 -0
  537. package/dist/types/types/projectGroupAccess.js.map +1 -0
  538. package/dist/types/types/projectMemberProfile.js +2 -0
  539. package/dist/types/types/projectMemberProfile.js.map +1 -0
  540. package/dist/types/types/projectMemberRole.js +30 -0
  541. package/dist/types/types/projectMemberRole.js.map +1 -0
  542. package/dist/types/types/projects.js +149 -0
  543. package/dist/types/types/projects.js.map +1 -0
  544. package/dist/types/types/promotion.js +8 -0
  545. package/dist/types/types/promotion.js.map +1 -0
  546. package/dist/types/types/queryHistory.js +8 -0
  547. package/dist/types/types/queryHistory.js.map +1 -0
  548. package/dist/types/types/rename.js +6 -0
  549. package/dist/types/types/rename.js.map +1 -0
  550. package/dist/types/types/resourceViewItem.d.ts +1 -1
  551. package/dist/types/types/resourceViewItem.js +103 -0
  552. package/dist/types/types/resourceViewItem.js.map +1 -0
  553. package/dist/types/types/results.js +51 -0
  554. package/dist/types/types/results.js.map +1 -0
  555. package/dist/types/types/roles.js +2 -0
  556. package/dist/types/types/roles.js.map +1 -0
  557. package/dist/types/types/savedCharts.js +225 -0
  558. package/dist/types/types/savedCharts.js.map +1 -0
  559. package/dist/types/types/scheduler.js +87 -0
  560. package/dist/types/types/scheduler.js.map +1 -0
  561. package/dist/types/types/schedulerLog.js +2 -0
  562. package/dist/types/types/schedulerLog.js.map +1 -0
  563. package/dist/types/types/schedulerTaskList.js +31 -0
  564. package/dist/types/types/schedulerTaskList.js.map +1 -0
  565. package/dist/types/types/scopes.js +14 -0
  566. package/dist/types/types/scopes.js.map +1 -0
  567. package/dist/types/types/search.js +53 -0
  568. package/dist/types/types/search.js.map +1 -0
  569. package/dist/types/types/share.js +2 -0
  570. package/dist/types/types/share.js.map +1 -0
  571. package/dist/types/types/slack.js +2 -0
  572. package/dist/types/types/slack.js.map +1 -0
  573. package/dist/types/types/slackSettings.js +2 -0
  574. package/dist/types/types/slackSettings.js.map +1 -0
  575. package/dist/types/types/space.js +7 -0
  576. package/dist/types/types/space.js.map +1 -0
  577. package/dist/types/types/spotlightTableConfig.js +17 -0
  578. package/dist/types/types/spotlightTableConfig.js.map +1 -0
  579. package/dist/types/types/sqlRunner.js +41 -0
  580. package/dist/types/types/sqlRunner.js.map +1 -0
  581. package/dist/types/types/table.js +6 -0
  582. package/dist/types/types/table.js.map +1 -0
  583. package/dist/types/types/tags.js +2 -0
  584. package/dist/types/types/tags.js.map +1 -0
  585. package/dist/types/types/timeFrames.js +42 -0
  586. package/dist/types/types/timeFrames.js.map +1 -0
  587. package/dist/types/types/timezone.js +33 -0
  588. package/dist/types/types/timezone.js.map +1 -0
  589. package/dist/types/types/user.js +23 -0
  590. package/dist/types/types/user.js.map +1 -0
  591. package/dist/types/types/userAttributes.js +2 -0
  592. package/dist/types/types/userAttributes.js.map +1 -0
  593. package/dist/types/types/userWarehouseCredentials.js +2 -0
  594. package/dist/types/types/userWarehouseCredentials.js.map +1 -0
  595. package/dist/types/types/validation.js +29 -0
  596. package/dist/types/types/validation.js.map +1 -0
  597. package/dist/types/types/warehouse.js +6 -0
  598. package/dist/types/types/warehouse.js.map +1 -0
  599. package/dist/types/types/yamlSchema.js +2 -0
  600. package/dist/types/types/yamlSchema.js.map +1 -0
  601. package/dist/types/utils/accessors.js +27 -0
  602. package/dist/types/utils/accessors.js.map +1 -0
  603. package/dist/types/utils/accessors.test.js +45 -0
  604. package/dist/types/utils/accessors.test.js.map +1 -0
  605. package/dist/types/utils/additionalMetrics.js +54 -0
  606. package/dist/types/utils/additionalMetrics.js.map +1 -0
  607. package/dist/types/utils/api.js +5 -0
  608. package/dist/types/utils/api.js.map +1 -0
  609. package/dist/types/utils/assertUnreachable.js +10 -0
  610. package/dist/types/utils/assertUnreachable.js.map +1 -0
  611. package/dist/types/utils/booleanConverter.js +27 -0
  612. package/dist/types/utils/booleanConverter.js.map +1 -0
  613. package/dist/types/utils/booleanConverter.test.js +59 -0
  614. package/dist/types/utils/booleanConverter.test.js.map +1 -0
  615. package/dist/types/utils/catalogMetricsTree.js +2 -0
  616. package/dist/types/utils/catalogMetricsTree.js.map +1 -0
  617. package/dist/types/utils/changeset.js +132 -0
  618. package/dist/types/utils/changeset.js.map +1 -0
  619. package/dist/types/utils/changeset.mock.js +146 -0
  620. package/dist/types/utils/changeset.mock.js.map +1 -0
  621. package/dist/types/utils/changeset.test.js +248 -0
  622. package/dist/types/utils/changeset.test.js.map +1 -0
  623. package/dist/types/utils/charts.js +74 -0
  624. package/dist/types/utils/charts.js.map +1 -0
  625. package/dist/types/utils/colors.js +15 -0
  626. package/dist/types/utils/colors.js.map +1 -0
  627. package/dist/types/utils/colors.test.js +85 -0
  628. package/dist/types/utils/colors.test.js.map +1 -0
  629. package/dist/types/utils/conditionalFormatting.js +436 -0
  630. package/dist/types/utils/conditionalFormatting.js.map +1 -0
  631. package/dist/types/utils/conditionalFormatting.test.js +105 -0
  632. package/dist/types/utils/conditionalFormatting.test.js.map +1 -0
  633. package/dist/types/utils/convertCustomDimensionsToYaml.js +115 -0
  634. package/dist/types/utils/convertCustomDimensionsToYaml.js.map +1 -0
  635. package/dist/types/utils/convertCustomMetricsToYaml.js +15 -0
  636. package/dist/types/utils/convertCustomMetricsToYaml.js.map +1 -0
  637. package/dist/types/utils/customDimensions.js +27 -0
  638. package/dist/types/utils/customDimensions.js.map +1 -0
  639. package/dist/types/utils/dashboard.js +35 -0
  640. package/dist/types/utils/dashboard.js.map +1 -0
  641. package/dist/types/utils/dashboard.test.js +36 -0
  642. package/dist/types/utils/dashboard.test.js.map +1 -0
  643. package/dist/types/utils/dbt.js +4 -0
  644. package/dist/types/utils/dbt.js.map +1 -0
  645. package/dist/types/utils/dbt.test.js +39 -0
  646. package/dist/types/utils/dbt.test.js.map +1 -0
  647. package/dist/types/utils/dependencyGraph.js +51 -0
  648. package/dist/types/utils/dependencyGraph.js.map +1 -0
  649. package/dist/types/utils/dependencyGraph.test.js +113 -0
  650. package/dist/types/utils/dependencyGraph.test.js.map +1 -0
  651. package/dist/types/utils/email.js +76 -0
  652. package/dist/types/utils/email.js.map +1 -0
  653. package/dist/types/utils/email.test.js +49 -0
  654. package/dist/types/utils/email.test.js.map +1 -0
  655. package/dist/types/utils/fields.js +183 -0
  656. package/dist/types/utils/fields.js.map +1 -0
  657. package/dist/types/utils/fields.mock.js +150 -0
  658. package/dist/types/utils/fields.mock.js.map +1 -0
  659. package/dist/types/utils/fields.test.js +259 -0
  660. package/dist/types/utils/fields.test.js.map +1 -0
  661. package/dist/types/utils/filters.js +763 -0
  662. package/dist/types/utils/filters.js.map +1 -0
  663. package/dist/types/utils/filters.mock.js +450 -0
  664. package/dist/types/utils/filters.mock.js.map +1 -0
  665. package/dist/types/utils/filters.test.js +360 -0
  666. package/dist/types/utils/filters.test.js.map +1 -0
  667. package/dist/types/utils/formatting.js +552 -0
  668. package/dist/types/utils/formatting.js.map +1 -0
  669. package/dist/types/utils/formatting.mock.js +28 -0
  670. package/dist/types/utils/formatting.mock.js.map +1 -0
  671. package/dist/types/utils/formatting.test.js +1047 -0
  672. package/dist/types/utils/formatting.test.js.map +1 -0
  673. package/dist/types/utils/github.js +11 -0
  674. package/dist/types/utils/github.js.map +1 -0
  675. package/dist/types/utils/i18n/abstract.js +3 -0
  676. package/dist/types/utils/i18n/abstract.js.map +1 -0
  677. package/dist/types/utils/i18n/chartAsCode.js +132 -0
  678. package/dist/types/utils/i18n/chartAsCode.js.map +1 -0
  679. package/dist/types/utils/i18n/chartAsCode.test.js +350 -0
  680. package/dist/types/utils/i18n/chartAsCode.test.js.map +1 -0
  681. package/dist/types/utils/i18n/dashboardAsCode.js +58 -0
  682. package/dist/types/utils/i18n/dashboardAsCode.js.map +1 -0
  683. package/dist/types/utils/i18n/index.js +5 -0
  684. package/dist/types/utils/i18n/index.js.map +1 -0
  685. package/dist/types/utils/i18n/merge.js +20 -0
  686. package/dist/types/utils/i18n/merge.js.map +1 -0
  687. package/dist/types/utils/i18n/types.js +2 -0
  688. package/dist/types/utils/i18n/types.js.map +1 -0
  689. package/dist/types/utils/item.js +154 -0
  690. package/dist/types/utils/item.js.map +1 -0
  691. package/dist/types/utils/loadLightdashProjectConfig.js +49 -0
  692. package/dist/types/utils/loadLightdashProjectConfig.js.map +1 -0
  693. package/dist/types/utils/loadLightdashProjectConfig.mock.js +127 -0
  694. package/dist/types/utils/loadLightdashProjectConfig.mock.js.map +1 -0
  695. package/dist/types/utils/loadLightdashProjectConfig.test.js +137 -0
  696. package/dist/types/utils/loadLightdashProjectConfig.test.js.map +1 -0
  697. package/dist/types/utils/metricsExplorer.js +365 -0
  698. package/dist/types/utils/metricsExplorer.js.map +1 -0
  699. package/dist/types/utils/oauth.js +242 -0
  700. package/dist/types/utils/oauth.js.map +1 -0
  701. package/dist/types/utils/organization.js +23 -0
  702. package/dist/types/utils/organization.js.map +1 -0
  703. package/dist/types/utils/projectMemberRole.js +85 -0
  704. package/dist/types/utils/projectMemberRole.js.map +1 -0
  705. package/dist/types/utils/projectMemberRole.test.js +36 -0
  706. package/dist/types/utils/projectMemberRole.test.js.map +1 -0
  707. package/dist/types/utils/promises.js +5 -0
  708. package/dist/types/utils/promises.js.map +1 -0
  709. package/dist/types/utils/sanitizeHtml.js +111 -0
  710. package/dist/types/utils/sanitizeHtml.js.map +1 -0
  711. package/dist/types/utils/sanitizeHtml.test.js +101 -0
  712. package/dist/types/utils/sanitizeHtml.test.js.map +1 -0
  713. package/dist/types/utils/scheduler.js +85 -0
  714. package/dist/types/utils/scheduler.js.map +1 -0
  715. package/dist/types/utils/scheduler.test.js +41 -0
  716. package/dist/types/utils/scheduler.test.js.map +1 -0
  717. package/dist/types/utils/searchParams.js +8 -0
  718. package/dist/types/utils/searchParams.js.map +1 -0
  719. package/dist/types/utils/sleep.js +6 -0
  720. package/dist/types/utils/sleep.js.map +1 -0
  721. package/dist/types/utils/slug.test.js +129 -0
  722. package/dist/types/utils/slug.test.js.map +1 -0
  723. package/dist/types/utils/slugs.js +55 -0
  724. package/dist/types/utils/slugs.js.map +1 -0
  725. package/dist/types/utils/subtotals.js +4 -0
  726. package/dist/types/utils/subtotals.js.map +1 -0
  727. package/dist/types/utils/time.js +25 -0
  728. package/dist/types/utils/time.js.map +1 -0
  729. package/dist/types/utils/timeFrames.js +529 -0
  730. package/dist/types/utils/timeFrames.js.map +1 -0
  731. package/dist/types/utils/timeFrames.test.js +50 -0
  732. package/dist/types/utils/timeFrames.test.js.map +1 -0
  733. package/dist/types/utils/virtualView.js +98 -0
  734. package/dist/types/utils/virtualView.js.map +1 -0
  735. package/dist/types/utils/warehouse.js +57 -0
  736. package/dist/types/utils/warehouse.js.map +1 -0
  737. package/dist/types/visualizations/CartesianChartDataModel.js +515 -0
  738. package/dist/types/visualizations/CartesianChartDataModel.js.map +1 -0
  739. package/dist/types/visualizations/PieChartDataModel.js +258 -0
  740. package/dist/types/visualizations/PieChartDataModel.js.map +1 -0
  741. package/dist/types/visualizations/TableDataModel.js +96 -0
  742. package/dist/types/visualizations/TableDataModel.js.map +1 -0
  743. package/dist/types/visualizations/chartTransformations.js +107 -0
  744. package/dist/types/visualizations/chartTransformations.js.map +1 -0
  745. package/dist/types/visualizations/helpers/getCartesianAxisFormatterConfig.js +142 -0
  746. package/dist/types/visualizations/helpers/getCartesianAxisFormatterConfig.js.map +1 -0
  747. package/dist/types/visualizations/types/IResultsRunner.js +2 -0
  748. package/dist/types/visualizations/types/IResultsRunner.js.map +1 -0
  749. package/dist/types/visualizations/types/index.js +78 -0
  750. package/dist/types/visualizations/types/index.js.map +1 -0
  751. package/package.json +1 -1
  752. package/dist/tsconfig.types.tsbuildinfo +0 -1
@@ -0,0 +1,1031 @@
1
+ import { Ability, AbilityBuilder, subject } from '@casl/ability';
2
+ import { ProjectType } from '../types/projects';
3
+ import { SpaceMemberRole } from '../types/space';
4
+ import { projectMemberAbilities } from './projectMemberAbility';
5
+ import { PROJECT_ADMIN, PROJECT_DEVELOPER, PROJECT_EDITOR, PROJECT_INTERACTIVE_VIEWER, PROJECT_VIEWER, } from './projectMemberAbility.mock';
6
+ const { projectUuid } = PROJECT_VIEWER;
7
+ const defineAbilityForProjectMember = (member) => {
8
+ const builder = new AbilityBuilder(Ability);
9
+ if (member) {
10
+ projectMemberAbilities[member.role](member, builder);
11
+ }
12
+ return builder.build();
13
+ };
14
+ describe('Project member permissions', () => {
15
+ describe('Member permissions', () => {
16
+ let ability = defineAbilityForProjectMember(PROJECT_ADMIN);
17
+ describe('when user is an project admin', () => {
18
+ beforeEach(() => {
19
+ ability = defineAbilityForProjectMember(PROJECT_ADMIN);
20
+ });
21
+ it('can view and manage all kinds of dashboards', () => {
22
+ expect(ability.can('view', subject('Dashboard', {
23
+ projectUuid,
24
+ isPrivate: false,
25
+ }))).toEqual(true);
26
+ expect(ability.can('manage', subject('Dashboard', {
27
+ projectUuid,
28
+ isPrivate: false,
29
+ }))).toEqual(true);
30
+ expect(ability.can('view', subject('Dashboard', {
31
+ projectUuid,
32
+ isPrivate: true,
33
+ access: [],
34
+ }))).toEqual(true);
35
+ expect(ability.can('manage', subject('Dashboard', {
36
+ projectUuid,
37
+ isPrivate: true,
38
+ access: [],
39
+ }))).toEqual(true);
40
+ expect(ability.can('view', subject('Dashboard', {
41
+ projectUuid,
42
+ isPrivate: true,
43
+ access: [
44
+ {
45
+ userUuid: PROJECT_ADMIN.userUuid,
46
+ role: SpaceMemberRole.VIEWER,
47
+ },
48
+ ],
49
+ }))).toEqual(true);
50
+ expect(ability.can('manage', subject('Dashboard', {
51
+ projectUuid,
52
+ isPrivate: true,
53
+ access: [
54
+ {
55
+ userUuid: PROJECT_ADMIN.userUuid,
56
+ role: SpaceMemberRole.VIEWER,
57
+ },
58
+ ],
59
+ }))).toEqual(true);
60
+ expect(ability.can('view', subject('Dashboard', {
61
+ projectUuid,
62
+ isPrivate: true,
63
+ access: [
64
+ {
65
+ userUuid: PROJECT_ADMIN.userUuid,
66
+ role: SpaceMemberRole.EDITOR,
67
+ },
68
+ ],
69
+ }))).toEqual(true);
70
+ expect(ability.can('manage', subject('Dashboard', {
71
+ projectUuid,
72
+ isPrivate: true,
73
+ access: [
74
+ {
75
+ userUuid: PROJECT_ADMIN.userUuid,
76
+ role: SpaceMemberRole.EDITOR,
77
+ },
78
+ ],
79
+ }))).toEqual(true);
80
+ });
81
+ it('can view and manage all kinds of saved charts', () => {
82
+ expect(ability.can('view', subject('SavedChart', {
83
+ projectUuid,
84
+ isPrivate: false,
85
+ }))).toEqual(true);
86
+ expect(ability.can('manage', subject('SavedChart', {
87
+ projectUuid,
88
+ isPrivate: false,
89
+ }))).toEqual(true);
90
+ expect(ability.can('view', subject('SavedChart', {
91
+ projectUuid,
92
+ isPrivate: true,
93
+ access: [],
94
+ }))).toEqual(true);
95
+ expect(ability.can('manage', subject('SavedChart', {
96
+ projectUuid,
97
+ isPrivate: true,
98
+ access: [],
99
+ }))).toEqual(true);
100
+ expect(ability.can('view', subject('SavedChart', {
101
+ projectUuid,
102
+ isPrivate: true,
103
+ access: [
104
+ {
105
+ userUuid: PROJECT_ADMIN.userUuid,
106
+ role: SpaceMemberRole.VIEWER,
107
+ },
108
+ ],
109
+ }))).toEqual(true);
110
+ expect(ability.can('manage', subject('SavedChart', {
111
+ projectUuid,
112
+ isPrivate: true,
113
+ access: [
114
+ {
115
+ userUuid: PROJECT_ADMIN.userUuid,
116
+ role: SpaceMemberRole.VIEWER,
117
+ },
118
+ ],
119
+ }))).toEqual(true);
120
+ expect(ability.can('view', subject('SavedChart', {
121
+ projectUuid,
122
+ isPrivate: true,
123
+ access: [
124
+ {
125
+ userUuid: PROJECT_ADMIN.userUuid,
126
+ role: SpaceMemberRole.EDITOR,
127
+ },
128
+ ],
129
+ }))).toEqual(true);
130
+ expect(ability.can('manage', subject('SavedChart', {
131
+ projectUuid,
132
+ isPrivate: true,
133
+ access: [
134
+ {
135
+ userUuid: PROJECT_ADMIN.userUuid,
136
+ role: SpaceMemberRole.EDITOR,
137
+ },
138
+ ],
139
+ }))).toEqual(true);
140
+ });
141
+ it('can view and manage all kinds of space', () => {
142
+ expect(ability.can('view', subject('Space', {
143
+ projectUuid,
144
+ isPrivate: false,
145
+ }))).toEqual(true);
146
+ expect(ability.can('manage', subject('Space', {
147
+ projectUuid,
148
+ isPrivate: false,
149
+ }))).toEqual(true);
150
+ expect(ability.can('view', subject('Space', {
151
+ projectUuid,
152
+ isPrivate: true,
153
+ access: [],
154
+ }))).toEqual(true);
155
+ expect(ability.can('manage', subject('Space', {
156
+ projectUuid,
157
+ isPrivate: true,
158
+ access: [],
159
+ }))).toEqual(true);
160
+ expect(ability.can('view', subject('Space', {
161
+ projectUuid,
162
+ isPrivate: true,
163
+ access: [
164
+ {
165
+ userUuid: PROJECT_ADMIN.userUuid,
166
+ role: SpaceMemberRole.VIEWER,
167
+ },
168
+ ],
169
+ }))).toEqual(true);
170
+ expect(ability.can('manage', subject('Space', {
171
+ projectUuid,
172
+ isPrivate: true,
173
+ access: [
174
+ {
175
+ userUuid: PROJECT_ADMIN.userUuid,
176
+ role: SpaceMemberRole.VIEWER,
177
+ },
178
+ ],
179
+ }))).toEqual(true);
180
+ expect(ability.can('view', subject('Space', {
181
+ projectUuid,
182
+ isPrivate: true,
183
+ access: [
184
+ {
185
+ userUuid: PROJECT_ADMIN.userUuid,
186
+ role: SpaceMemberRole.EDITOR,
187
+ },
188
+ ],
189
+ }))).toEqual(true);
190
+ expect(ability.can('manage', subject('Space', {
191
+ projectUuid,
192
+ isPrivate: true,
193
+ access: [
194
+ {
195
+ userUuid: PROJECT_ADMIN.userUuid,
196
+ role: SpaceMemberRole.EDITOR,
197
+ },
198
+ ],
199
+ }))).toEqual(true);
200
+ });
201
+ it('can manage other types of public resources', () => {
202
+ expect(ability.can('manage', subject('Project', { projectUuid }))).toEqual(true);
203
+ expect(ability.can('manage', subject('Job', { projectUuid }))).toEqual(true);
204
+ });
205
+ it('cannot view resources from another projectUuid', () => {
206
+ expect(ability.can('view', subject('SavedChart', {
207
+ projectUuid: '5678',
208
+ isPrivate: false,
209
+ }))).toEqual(false);
210
+ expect(ability.can('view', subject('Dashboard', {
211
+ projectUuid: '5678',
212
+ isPrivate: false,
213
+ }))).toEqual(false);
214
+ expect(ability.can('view', subject('Space', {
215
+ projectUuid: '5678',
216
+ isPrivate: false,
217
+ }))).toEqual(false);
218
+ expect(ability.can('view', subject('Project', { projectUuid: '5678' }))).toEqual(false);
219
+ });
220
+ describe('JobStatus', () => {
221
+ it('can view his own job status', () => {
222
+ expect(ability.can('view', subject('JobStatus', {
223
+ createdByUserUuid: PROJECT_ADMIN.userUuid,
224
+ }))).toEqual(true);
225
+ });
226
+ it('can view job status from another user', () => {
227
+ expect(ability.can('view', subject('JobStatus', {
228
+ projectUuid,
229
+ createdByUserUuid: 'another-admin-user-4567',
230
+ }))).toEqual(true);
231
+ });
232
+ it('can view job status from the project', () => {
233
+ expect(ability.can('view', subject('JobStatus', {
234
+ projectUuid,
235
+ createdByUserUuid: undefined,
236
+ }))).toEqual(true);
237
+ });
238
+ it('cannot view job status from another project', () => {
239
+ expect(ability.can('view', subject('JobStatus', { projectUuid: '5678' }))).toEqual(false);
240
+ });
241
+ it('cannot view job status with undefined details', () => {
242
+ expect(ability.can('view', subject('JobStatus', {
243
+ projectUuid: undefined,
244
+ organizationUuid: undefined,
245
+ }))).toEqual(false);
246
+ });
247
+ });
248
+ describe('AiAgent', () => {
249
+ it('can manage AiAgent', () => {
250
+ expect(ability.can('manage', subject('AiAgent', { projectUuid }))).toEqual(true);
251
+ });
252
+ it('cannot manage AiAgent from another project', () => {
253
+ expect(ability.can('manage', subject('AiAgent', { projectUuid: '5678' }))).toEqual(false);
254
+ });
255
+ });
256
+ describe('AiAgentThread', () => {
257
+ it('can view all AiAgentThreads in the project', () => {
258
+ expect(ability.can('view', subject('AiAgentThread', { projectUuid }))).toEqual(true);
259
+ });
260
+ it('can manage all AiAgentThreads in the project', () => {
261
+ expect(ability.can('manage', subject('AiAgentThread', { projectUuid }))).toEqual(true);
262
+ });
263
+ it('cannot view AiAgentThread from another project', () => {
264
+ expect(ability.can('view', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
265
+ });
266
+ it('cannot manage AiAgentThread from another project', () => {
267
+ expect(ability.can('manage', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
268
+ });
269
+ });
270
+ });
271
+ describe('when user is an editor', () => {
272
+ beforeEach(() => {
273
+ ability = defineAbilityForProjectMember(PROJECT_EDITOR);
274
+ });
275
+ it('can view and manage public & accessible dashboards', () => {
276
+ expect(ability.can('view', subject('Dashboard', {
277
+ projectUuid,
278
+ isPrivate: false,
279
+ }))).toEqual(true);
280
+ expect(ability.can('manage', subject('Dashboard', {
281
+ projectUuid,
282
+ isPrivate: false,
283
+ }))).toEqual(false);
284
+ expect(ability.can('view', subject('Dashboard', {
285
+ projectUuid,
286
+ isPrivate: true,
287
+ access: [],
288
+ }))).toEqual(false);
289
+ expect(ability.can('manage', subject('Dashboard', {
290
+ projectUuid,
291
+ isPrivate: true,
292
+ access: [],
293
+ }))).toEqual(false);
294
+ expect(ability.can('view', subject('Dashboard', {
295
+ projectUuid,
296
+ isPrivate: true,
297
+ access: [
298
+ {
299
+ userUuid: PROJECT_EDITOR.userUuid,
300
+ role: SpaceMemberRole.VIEWER,
301
+ },
302
+ ],
303
+ }))).toEqual(true);
304
+ expect(ability.can('manage', subject('Dashboard', {
305
+ projectUuid,
306
+ isPrivate: true,
307
+ access: [
308
+ {
309
+ userUuid: PROJECT_EDITOR.userUuid,
310
+ role: SpaceMemberRole.VIEWER,
311
+ },
312
+ ],
313
+ }))).toEqual(false);
314
+ expect(ability.can('view', subject('Dashboard', {
315
+ projectUuid,
316
+ isPrivate: true,
317
+ access: [
318
+ {
319
+ userUuid: PROJECT_EDITOR.userUuid,
320
+ role: SpaceMemberRole.EDITOR,
321
+ },
322
+ ],
323
+ }))).toEqual(true);
324
+ expect(ability.can('manage', subject('Dashboard', {
325
+ projectUuid,
326
+ isPrivate: true,
327
+ access: [
328
+ {
329
+ userUuid: PROJECT_EDITOR.userUuid,
330
+ role: SpaceMemberRole.EDITOR,
331
+ },
332
+ ],
333
+ }))).toEqual(true);
334
+ });
335
+ it('can view and manage public & accessable saved charts', () => {
336
+ expect(ability.can('view', subject('SavedChart', {
337
+ projectUuid,
338
+ isPrivate: false,
339
+ }))).toEqual(true);
340
+ expect(ability.can('manage', subject('SavedChart', {
341
+ projectUuid,
342
+ isPrivate: false,
343
+ }))).toEqual(false);
344
+ expect(ability.can('view', subject('SavedChart', {
345
+ projectUuid,
346
+ isPrivate: true,
347
+ access: [],
348
+ }))).toEqual(false);
349
+ expect(ability.can('manage', subject('SavedChart', {
350
+ projectUuid,
351
+ isPrivate: true,
352
+ access: [],
353
+ }))).toEqual(false);
354
+ expect(ability.can('view', subject('SavedChart', {
355
+ projectUuid,
356
+ isPrivate: true,
357
+ access: [
358
+ {
359
+ userUuid: PROJECT_EDITOR.userUuid,
360
+ role: SpaceMemberRole.VIEWER,
361
+ },
362
+ ],
363
+ }))).toEqual(true);
364
+ expect(ability.can('manage', subject('SavedChart', {
365
+ projectUuid,
366
+ isPrivate: true,
367
+ access: [
368
+ {
369
+ userUuid: PROJECT_EDITOR.userUuid,
370
+ role: SpaceMemberRole.VIEWER,
371
+ },
372
+ ],
373
+ }))).toEqual(false);
374
+ expect(ability.can('view', subject('SavedChart', {
375
+ projectUuid,
376
+ isPrivate: true,
377
+ access: [
378
+ {
379
+ userUuid: PROJECT_EDITOR.userUuid,
380
+ role: SpaceMemberRole.EDITOR,
381
+ },
382
+ ],
383
+ }))).toEqual(true);
384
+ expect(ability.can('manage', subject('SavedChart', {
385
+ projectUuid,
386
+ isPrivate: true,
387
+ access: [
388
+ {
389
+ userUuid: PROJECT_EDITOR.userUuid,
390
+ role: SpaceMemberRole.EDITOR,
391
+ },
392
+ ],
393
+ }))).toEqual(true);
394
+ });
395
+ it('can create a space', () => {
396
+ expect(ability.can('create', subject('Space', {
397
+ projectUuid: PROJECT_EDITOR.projectUuid,
398
+ }))).toEqual(true);
399
+ });
400
+ it('can view and manage public & accessable space', () => {
401
+ expect(ability.can('view', subject('Space', {
402
+ projectUuid,
403
+ isPrivate: false,
404
+ }))).toEqual(true);
405
+ expect(ability.can('manage', subject('Space', {
406
+ projectUuid,
407
+ isPrivate: false,
408
+ }))).toEqual(true);
409
+ expect(ability.can('view', subject('Space', {
410
+ projectUuid,
411
+ isPrivate: true,
412
+ access: [],
413
+ }))).toEqual(false);
414
+ expect(ability.can('manage', subject('Space', {
415
+ projectUuid,
416
+ isPrivate: true,
417
+ access: [],
418
+ }))).toEqual(false);
419
+ expect(ability.can('view', subject('Space', {
420
+ projectUuid,
421
+ isPrivate: true,
422
+ access: [
423
+ {
424
+ userUuid: PROJECT_EDITOR.userUuid,
425
+ role: SpaceMemberRole.VIEWER,
426
+ },
427
+ ],
428
+ }))).toEqual(true);
429
+ expect(ability.can('manage', subject('Space', {
430
+ projectUuid,
431
+ isPrivate: true,
432
+ access: [
433
+ {
434
+ userUuid: PROJECT_EDITOR.userUuid,
435
+ role: SpaceMemberRole.VIEWER,
436
+ },
437
+ ],
438
+ }))).toEqual(false);
439
+ expect(ability.can('view', subject('Space', {
440
+ projectUuid,
441
+ isPrivate: true,
442
+ access: [
443
+ {
444
+ userUuid: PROJECT_EDITOR.userUuid,
445
+ role: SpaceMemberRole.EDITOR,
446
+ },
447
+ ],
448
+ }))).toEqual(true);
449
+ expect(ability.can('manage', subject('Space', {
450
+ projectUuid,
451
+ isPrivate: true,
452
+ access: [
453
+ {
454
+ userUuid: PROJECT_EDITOR.userUuid,
455
+ role: SpaceMemberRole.EDITOR,
456
+ },
457
+ ],
458
+ }))).toEqual(false);
459
+ expect(ability.can('manage', subject('Space', {
460
+ projectUuid,
461
+ isPrivate: true,
462
+ access: [
463
+ {
464
+ userUuid: PROJECT_EDITOR.userUuid,
465
+ role: SpaceMemberRole.ADMIN,
466
+ },
467
+ ],
468
+ }))).toEqual(true);
469
+ });
470
+ it('can view other public resources', () => {
471
+ expect(ability.can('view', subject('Project', { projectUuid }))).toEqual(true);
472
+ });
473
+ it('can manage other public resources', () => {
474
+ expect(ability.can('manage', subject('Job', { projectUuid }))).toEqual(true);
475
+ });
476
+ it('cannot manage projects', () => {
477
+ expect(ability.can('manage', subject('Project', { projectUuid }))).toEqual(false);
478
+ });
479
+ it('can download CSV', () => {
480
+ expect(ability.can('manage', subject('ExportCsv', { projectUuid }))).toEqual(true);
481
+ });
482
+ it('can change csv results', () => {
483
+ expect(ability.can('manage', subject('ChangeCsvResults', { projectUuid }))).toEqual(true);
484
+ });
485
+ it('cannot use SQL runner', () => {
486
+ expect(ability.can('manage', subject('SqlRunner', { projectUuid }))).toEqual(false);
487
+ });
488
+ it('can use the SemanticViewer', () => {
489
+ expect(ability.can('view', subject('SemanticViewer', { projectUuid }))).toEqual(true);
490
+ });
491
+ describe('JobStatus', () => {
492
+ it('can view his own job status', () => {
493
+ expect(ability.can('view', subject('JobStatus', {
494
+ projectUuid,
495
+ createdByUserUuid: PROJECT_VIEWER.userUuid,
496
+ }))).toEqual(true);
497
+ });
498
+ it('cannot view job status from the project', () => {
499
+ expect(ability.can('view', subject('JobStatus', {
500
+ projectUuid,
501
+ createdByUserUuid: undefined,
502
+ }))).toEqual(false);
503
+ });
504
+ it('cannot view job status from another project', () => {
505
+ expect(ability.can('view', subject('JobStatus', { projectUuid: '5678' }))).toEqual(false);
506
+ });
507
+ });
508
+ describe('AiAgent', () => {
509
+ it('can view AiAgent', () => {
510
+ expect(ability.can('view', subject('AiAgent', { projectUuid }))).toEqual(true);
511
+ });
512
+ it('cannot manage AiAgent', () => {
513
+ expect(ability.can('manage', subject('AiAgent', { projectUuid }))).toEqual(false);
514
+ });
515
+ it('cannot view AiAgent from another project', () => {
516
+ expect(ability.can('view', subject('AiAgent', { projectUuid: '5678' }))).toEqual(false);
517
+ });
518
+ });
519
+ describe('AiAgentThread', () => {
520
+ it('can view only his own AiAgentThread', () => {
521
+ expect(ability.can('view', subject('AiAgentThread', {
522
+ projectUuid,
523
+ userUuid: PROJECT_EDITOR.userUuid,
524
+ }))).toEqual(true);
525
+ });
526
+ it('can manage only his own AiAgentThread', () => {
527
+ expect(ability.can('manage', subject('AiAgentThread', {
528
+ projectUuid,
529
+ userUuid: PROJECT_EDITOR.userUuid,
530
+ }))).toEqual(true);
531
+ });
532
+ it('cannot view other users AiAgentThread', () => {
533
+ expect(ability.can('view', subject('AiAgentThread', {
534
+ projectUuid,
535
+ userUuid: 'another-user-uuid',
536
+ }))).toEqual(false);
537
+ });
538
+ it('cannot manage other users AiAgentThread', () => {
539
+ expect(ability.can('manage', subject('AiAgentThread', {
540
+ projectUuid,
541
+ userUuid: 'another-user-uuid',
542
+ }))).toEqual(false);
543
+ });
544
+ it('cannot view AiAgentThread from another project', () => {
545
+ expect(ability.can('view', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
546
+ });
547
+ });
548
+ });
549
+ describe('when user is an developer', () => {
550
+ beforeEach(() => {
551
+ ability = defineAbilityForProjectMember(PROJECT_DEVELOPER);
552
+ });
553
+ it('can use SQL runner', () => {
554
+ expect(ability.can('manage', subject('SqlRunner', { projectUuid }))).toEqual(true);
555
+ });
556
+ it('can use the SemanticViewer', () => {
557
+ expect(ability.can('view', subject('SemanticViewer', { projectUuid }))).toEqual(true);
558
+ });
559
+ describe('JobStatus', () => {
560
+ it('can view his own job status', () => {
561
+ expect(ability.can('view', subject('JobStatus', {
562
+ projectUuid,
563
+ createdByUserUuid: PROJECT_DEVELOPER.userUuid,
564
+ }))).toEqual(true);
565
+ });
566
+ it('can view job status from another user', () => {
567
+ expect(ability.can('view', subject('JobStatus', {
568
+ projectUuid,
569
+ createdByUserUuid: 'admin-user-uuid-4567',
570
+ }))).toEqual(true);
571
+ });
572
+ it('can view job status from the project', () => {
573
+ expect(ability.can('view', subject('JobStatus', {
574
+ projectUuid,
575
+ }))).toEqual(true);
576
+ });
577
+ it('cannot view job status from another project', () => {
578
+ expect(ability.can('view', subject('JobStatus', { projectUuid: '5678' }))).toEqual(false);
579
+ });
580
+ });
581
+ describe('AiAgent', () => {
582
+ it('can manage AiAgent', () => {
583
+ expect(ability.can('manage', subject('AiAgent', { projectUuid }))).toEqual(true);
584
+ });
585
+ it('cannot manage AiAgent from another project', () => {
586
+ expect(ability.can('manage', subject('AiAgent', { projectUuid: '5678' }))).toEqual(false);
587
+ });
588
+ });
589
+ describe('AiAgentThread', () => {
590
+ it('can manage only his own AiAgentThread', () => {
591
+ expect(ability.can('manage', subject('AiAgentThread', {
592
+ projectUuid,
593
+ userUuid: PROJECT_DEVELOPER.userUuid,
594
+ }))).toEqual(true);
595
+ });
596
+ it('cannot manage other users AiAgentThread', () => {
597
+ expect(ability.can('manage', subject('AiAgentThread', {
598
+ projectUuid,
599
+ userUuid: 'another-user-uuid',
600
+ }))).toEqual(false);
601
+ });
602
+ it('cannot manage AiAgentThread from another project', () => {
603
+ expect(ability.can('manage', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
604
+ });
605
+ });
606
+ });
607
+ describe('when user is a viewer', () => {
608
+ beforeEach(() => {
609
+ ability = defineAbilityForProjectMember(PROJECT_VIEWER);
610
+ });
611
+ it('can only view public & accessable dashboards', () => {
612
+ expect(ability.can('view', subject('Dashboard', {
613
+ projectUuid,
614
+ isPrivate: false,
615
+ }))).toEqual(true);
616
+ expect(ability.can('manage', subject('Dashboard', {
617
+ projectUuid,
618
+ isPrivate: false,
619
+ }))).toEqual(false);
620
+ expect(ability.can('view', subject('Dashboard', {
621
+ projectUuid,
622
+ isPrivate: true,
623
+ access: [],
624
+ }))).toEqual(false);
625
+ expect(ability.can('manage', subject('Dashboard', {
626
+ projectUuid,
627
+ isPrivate: true,
628
+ access: [],
629
+ }))).toEqual(false);
630
+ expect(ability.can('view', subject('Dashboard', {
631
+ projectUuid,
632
+ isPrivate: true,
633
+ access: [
634
+ {
635
+ userUuid: PROJECT_VIEWER.userUuid,
636
+ role: SpaceMemberRole.VIEWER,
637
+ },
638
+ ],
639
+ }))).toEqual(true);
640
+ expect(ability.can('manage', subject('Dashboard', {
641
+ projectUuid,
642
+ isPrivate: true,
643
+ access: [
644
+ {
645
+ userUuid: PROJECT_VIEWER.userUuid,
646
+ role: SpaceMemberRole.VIEWER,
647
+ },
648
+ ],
649
+ }))).toEqual(false);
650
+ expect(ability.can('view', subject('Dashboard', {
651
+ projectUuid,
652
+ isPrivate: true,
653
+ access: [
654
+ {
655
+ userUuid: PROJECT_VIEWER.userUuid,
656
+ role: SpaceMemberRole.EDITOR,
657
+ },
658
+ ],
659
+ }))).toEqual(true);
660
+ expect(ability.can('manage', subject('Dashboard', {
661
+ projectUuid,
662
+ isPrivate: true,
663
+ access: [
664
+ {
665
+ userUuid: PROJECT_VIEWER.userUuid,
666
+ role: SpaceMemberRole.EDITOR,
667
+ },
668
+ ],
669
+ }))).toEqual(false);
670
+ });
671
+ it('can view and manage public & accessable saved charts', () => {
672
+ expect(ability.can('view', subject('SavedChart', {
673
+ projectUuid,
674
+ isPrivate: false,
675
+ }))).toEqual(true);
676
+ expect(ability.can('manage', subject('SavedChart', {
677
+ projectUuid,
678
+ isPrivate: false,
679
+ }))).toEqual(false);
680
+ expect(ability.can('view', subject('SavedChart', {
681
+ projectUuid,
682
+ isPrivate: true,
683
+ access: [],
684
+ }))).toEqual(false);
685
+ expect(ability.can('manage', subject('SavedChart', {
686
+ projectUuid,
687
+ isPrivate: true,
688
+ access: [],
689
+ }))).toEqual(false);
690
+ expect(ability.can('view', subject('SavedChart', {
691
+ projectUuid,
692
+ isPrivate: true,
693
+ access: [
694
+ {
695
+ userUuid: PROJECT_VIEWER.userUuid,
696
+ role: SpaceMemberRole.VIEWER,
697
+ },
698
+ ],
699
+ }))).toEqual(true);
700
+ expect(ability.can('manage', subject('SavedChart', {
701
+ projectUuid,
702
+ isPrivate: true,
703
+ access: [
704
+ {
705
+ userUuid: PROJECT_VIEWER.userUuid,
706
+ role: SpaceMemberRole.VIEWER,
707
+ },
708
+ ],
709
+ }))).toEqual(false);
710
+ expect(ability.can('view', subject('SavedChart', {
711
+ projectUuid,
712
+ isPrivate: true,
713
+ access: [
714
+ {
715
+ userUuid: PROJECT_VIEWER.userUuid,
716
+ role: SpaceMemberRole.EDITOR,
717
+ },
718
+ ],
719
+ }))).toEqual(true);
720
+ expect(ability.can('manage', subject('SavedChart', {
721
+ projectUuid,
722
+ isPrivate: true,
723
+ access: [
724
+ {
725
+ userUuid: PROJECT_VIEWER.userUuid,
726
+ role: SpaceMemberRole.EDITOR,
727
+ },
728
+ ],
729
+ }))).toEqual(false);
730
+ });
731
+ it('can view and manage public & accessable space', () => {
732
+ expect(ability.can('view', subject('Space', {
733
+ projectUuid,
734
+ isPrivate: false,
735
+ }))).toEqual(true);
736
+ expect(ability.can('manage', subject('Space', {
737
+ projectUuid,
738
+ isPrivate: false,
739
+ }))).toEqual(false);
740
+ expect(ability.can('view', subject('Space', {
741
+ projectUuid,
742
+ isPrivate: true,
743
+ access: [],
744
+ }))).toEqual(false);
745
+ expect(ability.can('manage', subject('Space', {
746
+ projectUuid,
747
+ isPrivate: true,
748
+ access: [],
749
+ }))).toEqual(false);
750
+ expect(ability.can('view', subject('Space', {
751
+ projectUuid,
752
+ isPrivate: true,
753
+ access: [
754
+ {
755
+ userUuid: PROJECT_VIEWER.userUuid,
756
+ role: SpaceMemberRole.VIEWER,
757
+ },
758
+ ],
759
+ }))).toEqual(true);
760
+ expect(ability.can('manage', subject('Space', {
761
+ projectUuid,
762
+ isPrivate: true,
763
+ access: [
764
+ {
765
+ userUuid: PROJECT_VIEWER.userUuid,
766
+ role: SpaceMemberRole.VIEWER,
767
+ },
768
+ ],
769
+ }))).toEqual(false);
770
+ expect(ability.can('view', subject('Space', {
771
+ projectUuid,
772
+ isPrivate: true,
773
+ access: [
774
+ {
775
+ userUuid: PROJECT_VIEWER.userUuid,
776
+ role: SpaceMemberRole.EDITOR,
777
+ },
778
+ ],
779
+ }))).toEqual(true);
780
+ expect(ability.can('manage', subject('Space', {
781
+ projectUuid,
782
+ isPrivate: true,
783
+ access: [
784
+ {
785
+ userUuid: PROJECT_VIEWER.userUuid,
786
+ role: SpaceMemberRole.EDITOR,
787
+ },
788
+ ],
789
+ }))).toEqual(false);
790
+ });
791
+ it('can view other public resources', () => {
792
+ expect(ability.can('view', subject('Project', { projectUuid }))).toEqual(true);
793
+ });
794
+ it('cannot view resources from another project', () => {
795
+ expect(ability.can('view', subject('SavedChart', {
796
+ projectUuid: '5678',
797
+ isPrivate: false,
798
+ }))).toEqual(false);
799
+ expect(ability.can('view', subject('Dashboard', {
800
+ projectUuid: '5678',
801
+ isPrivate: false,
802
+ }))).toEqual(false);
803
+ expect(ability.can('view', subject('Space', {
804
+ projectUuid: '5678',
805
+ isPrivate: false,
806
+ }))).toEqual(false);
807
+ expect(ability.can('view', subject('Project', { projectUuid: '5678' }))).toEqual(false);
808
+ });
809
+ it('cannot manage resources', () => {
810
+ expect(ability.can('manage', subject('Project', { projectUuid }))).toEqual(false);
811
+ expect(ability.can('manage', subject('Job', { projectUuid }))).toEqual(false);
812
+ expect(ability.can('manage', subject('SqlRunner', { projectUuid }))).toEqual(false);
813
+ expect(ability.can('manage', subject('SemanticViewer', { projectUuid }))).toEqual(false);
814
+ });
815
+ it('can download CSV', () => {
816
+ expect(ability.can('manage', subject('ExportCsv', { projectUuid }))).toEqual(true);
817
+ });
818
+ it('cannot change csv results', () => {
819
+ expect(ability.can('manage', subject('ChangeCsvResults', { projectUuid }))).toEqual(false);
820
+ });
821
+ it('cannot Explore', () => {
822
+ expect(ability.can('manage', subject('Explore', { projectUuid }))).toEqual(false);
823
+ });
824
+ it('cannot view underlying data', () => {
825
+ expect(ability.can('view', subject('UnderlyingData', { projectUuid }))).toEqual(false);
826
+ });
827
+ describe('JobStatus', () => {
828
+ it('can view his own job status', () => {
829
+ expect(ability.can('view', subject('JobStatus', {
830
+ createdByUserUuid: PROJECT_VIEWER.userUuid,
831
+ }))).toEqual(true);
832
+ });
833
+ it('cannot view job status from the project', () => {
834
+ expect(ability.can('view', subject('JobStatus', {
835
+ projectUuid,
836
+ createdByUserUuid: undefined,
837
+ }))).toEqual(false);
838
+ });
839
+ it('cannot view job status from another project', () => {
840
+ expect(ability.can('view', subject('JobStatus', { projectUuid: '5678' }))).toEqual(false);
841
+ });
842
+ });
843
+ describe('AiAgent', () => {
844
+ it('cannot view AiAgent', () => {
845
+ expect(ability.can('view', subject('AiAgent', { projectUuid }))).toEqual(false);
846
+ });
847
+ it('cannot manage AiAgent', () => {
848
+ expect(ability.can('manage', subject('AiAgent', { projectUuid }))).toEqual(false);
849
+ });
850
+ });
851
+ describe('AiAgentThread', () => {
852
+ it('can view only his own AiAgentThread', () => {
853
+ expect(ability.can('view', subject('AiAgentThread', {
854
+ projectUuid,
855
+ userUuid: PROJECT_VIEWER.userUuid,
856
+ }))).toEqual(true);
857
+ });
858
+ it('cannot view other users AiAgentThread', () => {
859
+ expect(ability.can('view', subject('AiAgentThread', {
860
+ projectUuid,
861
+ userUuid: 'another-user-uuid',
862
+ }))).toEqual(false);
863
+ });
864
+ it('cannot manage his own AiAgentThread', () => {
865
+ expect(ability.can('manage', subject('AiAgentThread', {
866
+ projectUuid,
867
+ userUuid: PROJECT_VIEWER.userUuid,
868
+ }))).toEqual(false);
869
+ });
870
+ it('cannot create AiAgentThread', () => {
871
+ expect(ability.can('create', subject('AiAgentThread', { projectUuid }))).toEqual(false);
872
+ });
873
+ it('cannot view AiAgentThread from another project', () => {
874
+ expect(ability.can('view', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
875
+ });
876
+ });
877
+ });
878
+ describe('when user is a interactive viewer', () => {
879
+ beforeEach(() => {
880
+ ability = defineAbilityForProjectMember(PROJECT_INTERACTIVE_VIEWER);
881
+ });
882
+ it('can view public resources', () => {
883
+ expect(ability.can('view', subject('SavedChart', {
884
+ projectUuid,
885
+ isPrivate: false,
886
+ }))).toEqual(true);
887
+ expect(ability.can('view', subject('Dashboard', { projectUuid, isPrivate: false }))).toEqual(true);
888
+ expect(ability.can('view', subject('Space', { projectUuid, isPrivate: false }))).toEqual(true);
889
+ expect(ability.can('view', subject('Project', { projectUuid }))).toEqual(true);
890
+ expect(ability.can('view', subject('SemanticViewer', { projectUuid }))).toEqual(true);
891
+ });
892
+ it('can not view private resources', () => {
893
+ expect(ability.can('view', subject('SavedChart', { projectUuid, isPrivate: true }))).toEqual(false);
894
+ expect(ability.can('view', subject('Dashboard', { projectUuid, isPrivate: true }))).toEqual(false);
895
+ expect(ability.can('view', subject('Space', { projectUuid, isPrivate: true }))).toEqual(false);
896
+ });
897
+ it('cannot view resources from another project', () => {
898
+ expect(ability.can('view', subject('SavedChart', {
899
+ projectUuid: '5678',
900
+ isPrivate: false,
901
+ }))).toEqual(false);
902
+ expect(ability.can('view', subject('Dashboard', {
903
+ projectUuid: '5678',
904
+ isPrivate: false,
905
+ }))).toEqual(false);
906
+ expect(ability.can('view', subject('Space', {
907
+ projectUuid: '5678',
908
+ isPrivate: false,
909
+ }))).toEqual(false);
910
+ expect(ability.can('view', subject('Project', { projectUuid: '5678' }))).toEqual(false);
911
+ });
912
+ it('cannot manage resources', () => {
913
+ expect(ability.can('manage', subject('SavedChart', {
914
+ projectUuid,
915
+ isPrivate: false,
916
+ }))).toEqual(false);
917
+ expect(ability.can('manage', subject('Dashboard', { projectUuid, isPrivate: false }))).toEqual(false);
918
+ expect(ability.can('manage', subject('Space', { projectUuid, isPrivate: false }))).toEqual(false);
919
+ expect(ability.can('manage', subject('SavedChart', { projectUuid, isPrivate: true }))).toEqual(false);
920
+ expect(ability.can('manage', subject('Dashboard', { projectUuid, isPrivate: true }))).toEqual(false);
921
+ expect(ability.can('manage', subject('Space', { projectUuid, isPrivate: true }))).toEqual(false);
922
+ expect(ability.can('manage', subject('Project', { projectUuid }))).toEqual(false);
923
+ expect(ability.can('manage', subject('Job', { projectUuid }))).toEqual(false);
924
+ expect(ability.can('manage', subject('SqlRunner', { projectUuid }))).toEqual(false);
925
+ expect(ability.can('manage', subject('SemanticViewer', { projectUuid }))).toEqual(false);
926
+ });
927
+ it('can download CSV', () => {
928
+ expect(ability.can('manage', subject('ExportCsv', { projectUuid }))).toEqual(true);
929
+ });
930
+ it('can Explore', () => {
931
+ expect(ability.can('manage', subject('Explore', { projectUuid }))).toEqual(true);
932
+ });
933
+ it('can view underlying data', () => {
934
+ expect(ability.can('view', subject('UnderlyingData', { projectUuid }))).toEqual(true);
935
+ });
936
+ describe('AiAgent', () => {
937
+ it('can view AiAgent', () => {
938
+ expect(ability.can('view', subject('AiAgent', { projectUuid }))).toEqual(true);
939
+ });
940
+ it('cannot manage AiAgent', () => {
941
+ expect(ability.can('manage', subject('AiAgent', { projectUuid }))).toEqual(false);
942
+ });
943
+ it('cannot view AiAgent from another project', () => {
944
+ expect(ability.can('view', subject('AiAgent', { projectUuid: '5678' }))).toEqual(false);
945
+ });
946
+ });
947
+ describe('AiAgentThread', () => {
948
+ it('can create AiAgentThread', () => {
949
+ expect(ability.can('create', subject('AiAgentThread', { projectUuid }))).toEqual(true);
950
+ });
951
+ it('can view only his own AiAgentThread', () => {
952
+ expect(ability.can('view', subject('AiAgentThread', {
953
+ projectUuid,
954
+ userUuid: PROJECT_INTERACTIVE_VIEWER.userUuid,
955
+ }))).toEqual(true);
956
+ });
957
+ it('cannot view other users AiAgentThread', () => {
958
+ expect(ability.can('view', subject('AiAgentThread', {
959
+ projectUuid,
960
+ userUuid: 'another-user-uuid',
961
+ }))).toEqual(false);
962
+ });
963
+ it('cannot manage his own AiAgentThread', () => {
964
+ expect(ability.can('manage', subject('AiAgentThread', {
965
+ projectUuid,
966
+ userUuid: PROJECT_INTERACTIVE_VIEWER.userUuid,
967
+ }))).toEqual(false);
968
+ });
969
+ it('cannot create AiAgentThread in another project', () => {
970
+ expect(ability.can('create', subject('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
971
+ });
972
+ });
973
+ });
974
+ });
975
+ [
976
+ {
977
+ membership: PROJECT_ADMIN,
978
+ canCreatePreview: true,
979
+ canDeleteTheirOwnPreview: true,
980
+ },
981
+ {
982
+ membership: PROJECT_DEVELOPER,
983
+ canCreatePreview: true,
984
+ canDeleteTheirOwnPreview: true,
985
+ },
986
+ {
987
+ membership: PROJECT_EDITOR,
988
+ canCreatePreview: false,
989
+ canDeleteTheirOwnPreview: false,
990
+ },
991
+ {
992
+ membership: PROJECT_INTERACTIVE_VIEWER,
993
+ canCreatePreview: false,
994
+ canDeleteTheirOwnPreview: false,
995
+ },
996
+ {
997
+ membership: PROJECT_VIEWER,
998
+ canCreatePreview: false,
999
+ canDeleteTheirOwnPreview: false,
1000
+ },
1001
+ ].forEach(({ membership, canCreatePreview, canDeleteTheirOwnPreview }) => {
1002
+ describe('test project preview permissions', () => {
1003
+ const ability = defineAbilityForProjectMember(membership);
1004
+ it('checks if user can create PREVIEW projects', () => {
1005
+ expect(ability.can('create', subject('Project', {
1006
+ upstreamProjectUuid: projectUuid,
1007
+ type: ProjectType.PREVIEW,
1008
+ }))).toEqual(canCreatePreview);
1009
+ });
1010
+ it('checks that users cannot create regular projects', () => {
1011
+ expect(ability.can('create', subject('Project', {
1012
+ upstreamProjectUuid: projectUuid,
1013
+ type: ProjectType.DEFAULT,
1014
+ }))).toEqual(false);
1015
+ });
1016
+ it('checks if user can delete their own PREVIEW projects', () => {
1017
+ expect(ability.can('delete', subject('Project', {
1018
+ createdByUserUuid: membership.userUuid,
1019
+ type: ProjectType.PREVIEW,
1020
+ }))).toEqual(canDeleteTheirOwnPreview);
1021
+ });
1022
+ it('checks that users cannot delete other users PREVIEW projects', () => {
1023
+ expect(ability.can('delete', subject('Project', {
1024
+ createdByUserUuid: '1234',
1025
+ type: ProjectType.PREVIEW,
1026
+ }))).toEqual(false);
1027
+ });
1028
+ });
1029
+ });
1030
+ });
1031
+ //# sourceMappingURL=projectMemberAbility.test.js.map