@malloy-publisher/sdk 0.0.34 → 0.0.35

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 (332) hide show
  1. package/README.md +21 -0
  2. package/dist/{RenderedResult-9A74lwfO.cjs → RenderedResult-DphykkT6.cjs} +1 -1
  3. package/dist/client/api.d.ts +18 -0
  4. package/dist/components/ApiErrorDisplay.d.ts +13 -0
  5. package/dist/components/Model/ModelCell.d.ts +1 -6
  6. package/dist/components/Package/Config.d.ts +1 -9
  7. package/dist/components/Package/Connections.d.ts +1 -8
  8. package/dist/components/Package/Databases.d.ts +1 -9
  9. package/dist/components/Package/Models.d.ts +1 -6
  10. package/dist/components/Package/Notebooks.d.ts +2 -7
  11. package/dist/components/Package/Package.d.ts +1 -6
  12. package/dist/components/Package/PackageProvider.d.ts +14 -0
  13. package/dist/components/Package/Schedules.d.ts +1 -9
  14. package/dist/components/Package/index.d.ts +2 -1
  15. package/dist/components/Project/About.d.ts +1 -7
  16. package/dist/components/Project/ConnectionExplorer.d.ts +1 -4
  17. package/dist/components/Project/Packages.d.ts +2 -5
  18. package/dist/components/Project/Project.d.ts +11 -3
  19. package/dist/components/Project/index.d.ts +1 -1
  20. package/dist/components/QueryResult/QueryResult.d.ts +1 -6
  21. package/dist/{index-TNDWxBXR.cjs → index-nKbldp0y.cjs} +598 -598
  22. package/dist/index.cjs.js +1 -1
  23. package/package.json +1 -1
  24. package/src/components/ApiErrorDisplay.tsx +40 -0
  25. package/src/components/Home/Home.tsx +8 -1
  26. package/src/components/Model/Model.tsx +59 -28
  27. package/src/components/Model/ModelCell.tsx +26 -63
  28. package/src/components/Model/NamedQueries.tsx +2 -2
  29. package/src/components/Model/SourcesExplorer.tsx +14 -15
  30. package/src/components/MutableNotebook/ModelPicker.tsx +13 -3
  31. package/src/components/MutableNotebook/MutableCell.tsx +5 -14
  32. package/src/components/MutableNotebook/MutableNotebook.tsx +2 -2
  33. package/src/components/Notebook/Notebook.tsx +48 -24
  34. package/src/components/Package/Config.tsx +10 -18
  35. package/src/components/Package/Connections.tsx +10 -12
  36. package/src/components/Package/Databases.tsx +93 -198
  37. package/src/components/Package/FileTreeView.tsx +21 -4
  38. package/src/components/Package/Models.tsx +21 -31
  39. package/src/components/Package/Notebooks.tsx +22 -32
  40. package/src/components/Package/Package.tsx +31 -89
  41. package/src/components/Package/PackageProvider.tsx +46 -0
  42. package/src/components/Package/Schedules.tsx +10 -19
  43. package/src/components/Package/index.ts +6 -1
  44. package/src/components/Project/About.tsx +7 -15
  45. package/src/components/Project/ConnectionExplorer.tsx +131 -52
  46. package/src/components/Project/Packages.tsx +12 -13
  47. package/src/components/Project/Project.tsx +35 -16
  48. package/src/components/Project/index.ts +1 -1
  49. package/src/components/QueryResult/QueryResult.tsx +12 -15
  50. package/src/components/RenderedResult/ResultContainer.tsx +0 -1
  51. package/dist/RenderedResult-CKEsEevp.js +0 -51
  52. package/dist/abap-BmBUA35e.js +0 -6
  53. package/dist/actionscript-3-zFUbzQa9.js +0 -6
  54. package/dist/ada-CBvPkFpZ.js +0 -6
  55. package/dist/andromeeda-uXNdzNpk.js +0 -4
  56. package/dist/angular-html-0fTdLuKf.js +0 -32
  57. package/dist/angular-ts-wkniW60G.js +0 -21
  58. package/dist/apache-CVNlsSDc.js +0 -6
  59. package/dist/apex-DFk3KRB1.js +0 -6
  60. package/dist/apl-TLDHFJX6.js +0 -16
  61. package/dist/applescript-CYMR_y0g.js +0 -6
  62. package/dist/ara-4QmU5e04.js +0 -6
  63. package/dist/asciidoc-v_1bjgUg.js +0 -6
  64. package/dist/asm-RC0Yh-NZ.js +0 -6
  65. package/dist/astro-Uf8_VxKJ.js +0 -16
  66. package/dist/aurora-x-BwoVEUWZ.js +0 -4
  67. package/dist/awk-gPH8MVMW.js +0 -6
  68. package/dist/ayu-dark-CxPZkpb2.js +0 -4
  69. package/dist/ballerina-kvLnRU_e.js +0 -6
  70. package/dist/bat-BHYy44sT.js +0 -6
  71. package/dist/beancount-D-MADTs_.js +0 -6
  72. package/dist/berry-Ci9U0o4h.js +0 -6
  73. package/dist/bibtex-CX618D15.js +0 -6
  74. package/dist/bicep-iuYiPopT.js +0 -6
  75. package/dist/blade-BtR00Gx0.js +0 -18
  76. package/dist/bsl-BIXPNqL4.js +0 -8
  77. package/dist/c-DASdrs7p.js +0 -6
  78. package/dist/cadence-BDALQi26.js +0 -6
  79. package/dist/cairo-tXZKA2PT.js +0 -8
  80. package/dist/catppuccin-frappe-BrTOiad2.js +0 -4
  81. package/dist/catppuccin-latte-D-dc_R4m.js +0 -4
  82. package/dist/catppuccin-macchiato-DN4jOp0G.js +0 -4
  83. package/dist/catppuccin-mocha-B8yCE3-3.js +0 -4
  84. package/dist/clarity-CNgV2Ths.js +0 -6
  85. package/dist/clojure-CsKKFGwv.js +0 -6
  86. package/dist/cmake-Dr-A3iJx.js +0 -6
  87. package/dist/cobol-DMssKNmC.js +0 -10
  88. package/dist/codeowners-Bt9yU6NX.js +0 -6
  89. package/dist/codeql-DBNTqJi1.js +0 -6
  90. package/dist/coffee-D_GzM8k1.js +0 -8
  91. package/dist/common-lisp-r7ZEOG7T.js +0 -6
  92. package/dist/components/Package/PublisherPackageProvider.d.ts +0 -14
  93. package/dist/components/Project/TablesInSchema.d.ts +0 -10
  94. package/dist/coq-CB6Pv_W9.js +0 -6
  95. package/dist/cpp-CJF2i3ah.js +0 -18
  96. package/dist/crystal-BKWnaU3g.js +0 -18
  97. package/dist/csharp-CYWRhZ2R.js +0 -6
  98. package/dist/css-D1aVdRIU.js +0 -6
  99. package/dist/csv-DvCncUGQ.js +0 -6
  100. package/dist/cue-BXMrmvay.js +0 -6
  101. package/dist/cypher-DTm5zNR1.js +0 -6
  102. package/dist/d-D6ZXmn3l.js +0 -6
  103. package/dist/dark-plus-pUHDTVV0.js +0 -4
  104. package/dist/dart-Dz59Is3F.js +0 -6
  105. package/dist/dax-DTVGzydb.js +0 -6
  106. package/dist/desktop-Db9vb-dl.js +0 -6
  107. package/dist/diff-XmNrvgM1.js +0 -6
  108. package/dist/docker-DWH2onkn.js +0 -6
  109. package/dist/dotenv-4337wvzu.js +0 -6
  110. package/dist/dracula-BtZx2Kac.js +0 -4
  111. package/dist/dracula-soft-BKa-aqBv.js +0 -4
  112. package/dist/dream-maker-CvvfrJSx.js +0 -6
  113. package/dist/edge-CgxR-qhM.js +0 -12
  114. package/dist/elixir-DZkeSPwW.js +0 -8
  115. package/dist/elm-BKuV1HE1.js +0 -8
  116. package/dist/emacs-lisp-BAefI874.js +0 -6
  117. package/dist/erb-BLwkpXUJ.js +0 -10
  118. package/dist/erlang-CmIiwF3I.js +0 -6
  119. package/dist/everforest-dark-DMCBqXCK.js +0 -4
  120. package/dist/everforest-light-BbXl82Em.js +0 -4
  121. package/dist/fennel-DNqkz9pE.js +0 -6
  122. package/dist/fish-DIm72t2T.js +0 -6
  123. package/dist/fluent-BapTxJsC.js +0 -6
  124. package/dist/fortran-fixed-form-s9Hnb3av.js +0 -8
  125. package/dist/fortran-free-form-CNDsBFUj.js +0 -6
  126. package/dist/fsharp-Cv0x43wb.js +0 -8
  127. package/dist/gdresource-CMcKXvgJ.js +0 -10
  128. package/dist/gdscript-D7aheHm-.js +0 -6
  129. package/dist/gdshader-BGJEsM2Z.js +0 -6
  130. package/dist/genie-C9gPjc6J.js +0 -6
  131. package/dist/gherkin-bka1Exbx.js +0 -6
  132. package/dist/git-commit-BspYIY3P.js +0 -8
  133. package/dist/git-rebase--zLBTjUa.js +0 -8
  134. package/dist/github-dark-DenFmJkN.js +0 -4
  135. package/dist/github-dark-default-BJPUVz4H.js +0 -4
  136. package/dist/github-dark-dimmed-DUshB20C.js +0 -4
  137. package/dist/github-dark-high-contrast-D3aGCnF8.js +0 -4
  138. package/dist/github-light-JYsPkUQd.js +0 -4
  139. package/dist/github-light-default-D99KPAby.js +0 -4
  140. package/dist/github-light-high-contrast-BbmZE-Mp.js +0 -4
  141. package/dist/gleam-B4k9YFGD.js +0 -6
  142. package/dist/glimmer-js-DhY9umHJ.js +0 -14
  143. package/dist/glimmer-ts-CCrHcYH5.js +0 -14
  144. package/dist/glsl-XLGYNq5B.js +0 -8
  145. package/dist/gnuplot-DnWoRZt-.js +0 -6
  146. package/dist/go-BErP6iv1.js +0 -6
  147. package/dist/graphql-DWpQF4JI.js +0 -14
  148. package/dist/groovy-IWs5-NIO.js +0 -6
  149. package/dist/hack-CQrV-ytR.js +0 -10
  150. package/dist/haml-CMN0hQaL.js +0 -10
  151. package/dist/handlebars-Cc-7fXX5.js +0 -14
  152. package/dist/haskell-CtlGos0K.js +0 -6
  153. package/dist/haxe-CZZ33vZw.js +0 -6
  154. package/dist/hcl-6hOg9WP4.js +0 -6
  155. package/dist/hjson-CgwED-oz.js +0 -6
  156. package/dist/hlsl-3-lv4gi7.js +0 -6
  157. package/dist/houston-BDYrDoDW.js +0 -4
  158. package/dist/html-B0P_v3yU.js +0 -10
  159. package/dist/html-derivative-D59SHfh8.js +0 -8
  160. package/dist/http-Dcjm_K1m.js +0 -14
  161. package/dist/hxml-BNKImryz.js +0 -8
  162. package/dist/hy-C2xHhR6I.js +0 -6
  163. package/dist/imba-Drd0AMDo.js +0 -8
  164. package/dist/index-DahUc0AC.js +0 -139511
  165. package/dist/index.es.js +0 -19
  166. package/dist/ini-BUcvsX-U.js +0 -6
  167. package/dist/java-B7odJ7Ap.js +0 -6
  168. package/dist/javascript-fa8UlHZE.js +0 -6
  169. package/dist/jinja-CCSYduCH.js +0 -11
  170. package/dist/jison-BygvlveW.js +0 -8
  171. package/dist/json-71t8ZF9g.js +0 -6
  172. package/dist/json5-Z7F6rA6a.js +0 -6
  173. package/dist/jsonc-Dphhs4m2.js +0 -6
  174. package/dist/jsonl-D9jj92Gg.js +0 -6
  175. package/dist/jsonnet-DEQ7IUoJ.js +0 -6
  176. package/dist/jssm-j74e88UX.js +0 -6
  177. package/dist/jsx-Bkesy5tT.js +0 -6
  178. package/dist/julia-CiahampL.js +0 -16
  179. package/dist/kanagawa-dragon-CiKur4Hl.js +0 -4
  180. package/dist/kanagawa-lotus-BKu-smKu.js +0 -4
  181. package/dist/kanagawa-wave-CQwozSzG.js +0 -4
  182. package/dist/kotlin-DCgZY7Ii.js +0 -6
  183. package/dist/kusto-Cw029H-v.js +0 -6
  184. package/dist/laserwave-6a00oqik.js +0 -4
  185. package/dist/latex-LfGCYGw5.js +0 -8
  186. package/dist/lean-CYSet4vs.js +0 -6
  187. package/dist/less-DQA4v-Nm.js +0 -6
  188. package/dist/light-plus-CZuVqSLX.js +0 -4
  189. package/dist/liquid-CvufO3kO.js +0 -14
  190. package/dist/log-D2eRfqDn.js +0 -6
  191. package/dist/logo-QEAtGWZ9.js +0 -6
  192. package/dist/lua-BVfhNLDr.js +0 -8
  193. package/dist/luau-BjYGiqID.js +0 -6
  194. package/dist/make-BjuHP00g.js +0 -6
  195. package/dist/malloy-explorer.css +0 -468
  196. package/dist/markdown-B6guhLWd.js +0 -6
  197. package/dist/marko-CHlMS8w5.js +0 -14
  198. package/dist/material-theme-D6KBX41T.js +0 -4
  199. package/dist/material-theme-darker-CkRroheE.js +0 -4
  200. package/dist/material-theme-lighter-BUBw43Yz.js +0 -4
  201. package/dist/material-theme-ocean-ClGX14Ja.js +0 -4
  202. package/dist/material-theme-palenight-C1RVm8K1.js +0 -4
  203. package/dist/matlab-BpQlIJiw.js +0 -6
  204. package/dist/mdc-4K6B6lHG.js +0 -12
  205. package/dist/mdx-DIoECIFU.js +0 -6
  206. package/dist/mermaid-BZ7WHNIe.js +0 -6
  207. package/dist/min-dark-C7ak0t6c.js +0 -4
  208. package/dist/min-light-CKFxVcPp.js +0 -4
  209. package/dist/mipsasm-DusDYkFc.js +0 -6
  210. package/dist/mojo-CY9jaezJ.js +0 -6
  211. package/dist/monokai-C1KBYcO0.js +0 -4
  212. package/dist/move-ChphFumd.js +0 -6
  213. package/dist/narrat-Dz4d7OmN.js +0 -6
  214. package/dist/nextflow-DW0Yq9a2.js +0 -6
  215. package/dist/nginx-Can2eAjw.js +0 -8
  216. package/dist/night-owl-Bm2rzalh.js +0 -4
  217. package/dist/nim-B3r2RtQZ.js +0 -20
  218. package/dist/nix-Cg5uV_xg.js +0 -6
  219. package/dist/nord-CC5OiUXg.js +0 -4
  220. package/dist/nushell-BfRnzRWn.js +0 -6
  221. package/dist/objective-c-BGg9R27G.js +0 -6
  222. package/dist/objective-cpp-CJ3y3V_5.js +0 -6
  223. package/dist/ocaml-BZLsfx_o.js +0 -6
  224. package/dist/one-dark-pro-D7-kP8fv.js +0 -4
  225. package/dist/one-light-D9sNaUtq.js +0 -4
  226. package/dist/pascal-l2bqd7Dz.js +0 -6
  227. package/dist/perl-DaMQyPwp.js +0 -16
  228. package/dist/php-BL3EfPBi.js +0 -18
  229. package/dist/plastic-CSTz3KZp.js +0 -4
  230. package/dist/plsql-oVq_K_wH.js +0 -6
  231. package/dist/po-5jaeIyVd.js +0 -6
  232. package/dist/poimandres-C-VADXHD.js +0 -4
  233. package/dist/polar-wcLp8ci7.js +0 -6
  234. package/dist/postcss-BZ3MNRIJ.js +0 -6
  235. package/dist/powerquery-CgRa2XRw.js +0 -6
  236. package/dist/powershell-Diwyv8Eh.js +0 -6
  237. package/dist/prisma-COL_v1x4.js +0 -6
  238. package/dist/prolog-CuvJOxqT.js +0 -6
  239. package/dist/proto-o9HLmF90.js +0 -6
  240. package/dist/pug-HKe4Luo3.js +0 -12
  241. package/dist/puppet-wpGOnQp5.js +0 -6
  242. package/dist/purescript-B_1NgE2N.js +0 -6
  243. package/dist/python-xYxLFJY-.js +0 -6
  244. package/dist/qml-FlMIyjU9.js +0 -8
  245. package/dist/qmldir-BInDYbpo.js +0 -6
  246. package/dist/qss-D-h4NdUG.js +0 -6
  247. package/dist/r-F-9I-ITZ.js +0 -6
  248. package/dist/racket-BoD1TBFT.js +0 -6
  249. package/dist/raku-IaYcw19m.js +0 -6
  250. package/dist/razor-CeqqNtyB.js +0 -10
  251. package/dist/red-7y8PH7HH.js +0 -4
  252. package/dist/reg-CMUdAgIP.js +0 -6
  253. package/dist/regexp-GiFkbxS-.js +0 -6
  254. package/dist/rel-BaRn3QX7.js +0 -6
  255. package/dist/riscv-B9V3SsvW.js +0 -6
  256. package/dist/rose-pine-DhT-HZE9.js +0 -4
  257. package/dist/rose-pine-dawn-DiCjL2i4.js +0 -4
  258. package/dist/rose-pine-moon-BNmGHlcn.js +0 -4
  259. package/dist/rst-C3D6-dqL.js +0 -22
  260. package/dist/ruby-DcPLUUK3.js +0 -30
  261. package/dist/rust-Pc7DCsZD.js +0 -6
  262. package/dist/sas-tDSYjXcL.js +0 -8
  263. package/dist/sass-iCyS6eP9.js +0 -6
  264. package/dist/scala-Cly-fENF.js +0 -6
  265. package/dist/scheme-Zi24oEYu.js +0 -6
  266. package/dist/scss-DhHc4lxB.js +0 -8
  267. package/dist/sdbl-BBamrXFL.js +0 -6
  268. package/dist/shaderlab-CvqEIoL0.js +0 -8
  269. package/dist/shellscript-Dn0-btNd.js +0 -6
  270. package/dist/shellsession-8OLo3sB6.js +0 -8
  271. package/dist/slack-dark-i7wN4OET.js +0 -4
  272. package/dist/slack-ochin-ndHf0LoP.js +0 -4
  273. package/dist/smalltalk-Cns31tKw.js +0 -6
  274. package/dist/snazzy-light-BlSJXAu4.js +0 -4
  275. package/dist/solarized-dark-UTmkh7lw.js +0 -4
  276. package/dist/solarized-light-BheCkDPT.js +0 -4
  277. package/dist/solidity-BG_k8fA_.js +0 -6
  278. package/dist/soy-EwHMOVPj.js +0 -8
  279. package/dist/sparql-DhuelBut.js +0 -8
  280. package/dist/splunk-CTqDjQdo.js +0 -6
  281. package/dist/sql-DCkt643-.js +0 -6
  282. package/dist/ssh-config-DHHGll-v.js +0 -6
  283. package/dist/stata-Dok6hMw0.js +0 -8
  284. package/dist/stylus-n_9f0QQ5.js +0 -6
  285. package/dist/svelte-01qw6Rxm.js +0 -14
  286. package/dist/swift-BAWqNR8A.js +0 -6
  287. package/dist/synthwave-84-NU3C_KFZ.js +0 -4
  288. package/dist/system-verilog-Cui-g-ut.js +0 -6
  289. package/dist/systemd-CsKYQIQK.js +0 -6
  290. package/dist/talonscript-D2dGh8FO.js +0 -6
  291. package/dist/tasl-D3W8HMV6.js +0 -6
  292. package/dist/tcl-2y0Fuc4S.js +0 -6
  293. package/dist/templ-Hmy8U0DD.js +0 -12
  294. package/dist/terraform-BGW6Oerf.js +0 -6
  295. package/dist/tex-mHs7a43s.js +0 -8
  296. package/dist/tokyo-night-LhP3hHhi.js +0 -4
  297. package/dist/toml-CQSfOn0e.js +0 -6
  298. package/dist/ts-tags-DYZ4SGcN.js +0 -41
  299. package/dist/tsv-BtvSkaG0.js +0 -6
  300. package/dist/tsx-DiGsgWT8.js +0 -6
  301. package/dist/turtle-BJ2wmjPc.js +0 -6
  302. package/dist/twig-BmytkGQV.js +0 -18
  303. package/dist/typescript-buWNZFwO.js +0 -6
  304. package/dist/typespec-bLbdsxJL.js +0 -6
  305. package/dist/typst-Y9_SmXTs.js +0 -6
  306. package/dist/v-wa8Orrdd.js +0 -6
  307. package/dist/vala-DRdriFr_.js +0 -6
  308. package/dist/vb-E2_-jk4M.js +0 -6
  309. package/dist/vendor-DfRellEl.js +0 -75318
  310. package/dist/verilog-B1iBoR5_.js +0 -6
  311. package/dist/vesper-CJsaOsSM.js +0 -4
  312. package/dist/vhdl-CRVaAhXk.js +0 -6
  313. package/dist/viml-B-zWOd7Z.js +0 -6
  314. package/dist/vitesse-black-BoGvW84i.js +0 -4
  315. package/dist/vitesse-dark-Cym-eLtO.js +0 -4
  316. package/dist/vitesse-light-CcmG315c.js +0 -4
  317. package/dist/vue-Bl1uVNsA.js +0 -31
  318. package/dist/vue-html-DHr5wjBG.js +0 -10
  319. package/dist/vyper-DWutKXpa.js +0 -6
  320. package/dist/wasm-Bv5f0gKv.js +0 -6
  321. package/dist/wasm-DQxwEHae.js +0 -7
  322. package/dist/wenyan-BMYnfus1.js +0 -6
  323. package/dist/wgsl-DnPoPGDU.js +0 -6
  324. package/dist/wikitext-CntM04PE.js +0 -6
  325. package/dist/wolfram-Ws5qPlX9.js +0 -6
  326. package/dist/xml-ChBsf5uy.js +0 -8
  327. package/dist/xsl-BefjlXrd.js +0 -8
  328. package/dist/yaml-Bbg74JKr.js +0 -6
  329. package/dist/zenscript-C0RKE4nU.js +0 -6
  330. package/dist/zig-D6SXBGNm.js +0 -6
  331. package/src/components/Package/PublisherPackageProvider.tsx +0 -48
  332. package/src/components/Project/TablesInSchema.tsx +0 -84
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-TNDWxBXR.cjs");exports.BrowserNotebookStorage=e.BrowserNotebookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.Home=e.Home;exports.Model=e.Model;exports.MutableNotebook=e.MutableNotebook;exports.Notebook=e.Notebook;exports.NotebookStorageProvider=e.NotebookStorageProvider;exports.Package=e.Package;exports.Project=e.Project;exports.PublisherPackageProvider=e.PublisherPackageProvider;exports.QueryResult=e.QueryResult;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.useNotebookStorage=e.useNotebookStorage;exports.usePublisherPackage=e.usePublisherPackage;exports.useRouterClickHandler=e.useRouterClickHandler;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-nKbldp0y.cjs");exports.BrowserNotebookStorage=e.BrowserNotebookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.Home=e.Home;exports.Model=e.Model;exports.MutableNotebook=e.MutableNotebook;exports.Notebook=e.Notebook;exports.NotebookStorageProvider=e.NotebookStorageProvider;exports.Package=e.Package;exports.PackageProvider=e.PackageProvider;exports.Project=e.Project;exports.ProjectProvider=e.ProjectProvider;exports.PublisherPackageProvider=e.PackageProvider;exports.QueryResult=e.QueryResult;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.useNotebookStorage=e.useNotebookStorage;exports.usePackage=e.usePackage;exports.useProject=e.useProject;exports.usePublisherPackage=e.usePackage;exports.useRouterClickHandler=e.useRouterClickHandler;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.34",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -0,0 +1,40 @@
1
+ import { Typography } from "@mui/material";
2
+ import React from "react";
3
+
4
+ export interface ApiError extends Error {
5
+ status?: number;
6
+ data?: {
7
+ code: string;
8
+ message: string;
9
+ };
10
+ }
11
+
12
+ interface ApiErrorDisplayProps {
13
+ error: ApiError;
14
+ context?: string;
15
+ }
16
+
17
+ export function ApiErrorDisplay({ error, context }: ApiErrorDisplayProps) {
18
+ return (
19
+ <>
20
+ {context && (
21
+ <Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
22
+ {context}
23
+ </Typography>
24
+ )}
25
+ {error.data && (
26
+ <pre
27
+ style={{
28
+ whiteSpace: "pre-wrap",
29
+ color: "red",
30
+ backgroundColor: "black",
31
+ padding: "10px",
32
+ margin: "auto",
33
+ }}
34
+ >
35
+ {error.data.message}
36
+ </pre>
37
+ )}
38
+ </>
39
+ );
40
+ }
@@ -2,6 +2,7 @@ import { Grid, Typography } from "@mui/material";
2
2
  import { QueryClient, useQuery } from "@tanstack/react-query";
3
3
  import { ProjectsApi, Configuration } from "../../client";
4
4
  import axios from "axios";
5
+ import { ApiErrorDisplay } from "../ApiErrorDisplay";
5
6
 
6
7
  axios.defaults.baseURL = "http://localhost:4000";
7
8
  const projectsApi = new ProjectsApi(new Configuration());
@@ -13,19 +14,25 @@ interface HomeProps {
13
14
  }
14
15
 
15
16
  export default function Home({ server, navigate }: HomeProps) {
16
- const { data, isSuccess } = useQuery(
17
+ const { data, isSuccess, isError, error } = useQuery(
17
18
  {
18
19
  queryKey: ["projects", server],
19
20
  queryFn: () =>
20
21
  projectsApi.listProjects({
21
22
  baseURL: server,
22
23
  }),
24
+ retry: false,
25
+ throwOnError: false,
23
26
  },
24
27
  queryClient,
25
28
  );
26
29
 
27
30
  console.log(JSON.stringify(data?.data, null, 2));
28
31
 
32
+ if (isError) {
33
+ return <ApiErrorDisplay error={error} context="Projects List" />;
34
+ }
35
+
29
36
  if (isSuccess) {
30
37
  if (data.data.length === 0) {
31
38
  return <Typography variant="h4">No projects found</Typography>;
@@ -14,15 +14,17 @@ import {
14
14
  } from "@mui/material";
15
15
  import { QueryClient, useQuery } from "@tanstack/react-query";
16
16
  import React, { useEffect } from "react";
17
- import { Configuration, ModelsApi } from "../../client";
17
+ import { Configuration, ModelsApi, CompiledModel } from "../../client";
18
18
  import { highlight } from "../highlighter";
19
19
  import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
20
20
  import { ModelCell } from "./ModelCell";
21
+ import { ApiErrorDisplay, ApiError } from "../ApiErrorDisplay";
21
22
 
22
23
  import "@malloydata/malloy-explorer/styles.css";
23
- import { usePublisherPackage } from "../Package/PublisherPackageProvider";
24
+ import { usePackage } from "../Package/PackageProvider";
24
25
  import { SourceExplorerComponent } from "./SourcesExplorer";
25
26
  import NamedQueries from "./NamedQueries";
27
+
26
28
  const modelsApi = new ModelsApi(new Configuration());
27
29
 
28
30
  const queryClient = new QueryClient();
@@ -54,7 +56,7 @@ export default function Model({
54
56
  const [selectedTab, setSelectedTab] = React.useState(0);
55
57
 
56
58
  const { server, projectName, packageName, versionId, accessToken } =
57
- usePublisherPackage();
59
+ usePackage();
58
60
  const modelCodeSnippet = getModelCodeSnippet(server, packageName, modelPath);
59
61
  useEffect(() => {
60
62
  highlight(modelCodeSnippet, "typescript").then((code) => {
@@ -62,7 +64,10 @@ export default function Model({
62
64
  });
63
65
  }, [embeddingExpanded, modelCodeSnippet]);
64
66
 
65
- const { data, isError, isLoading, error } = useQuery(
67
+ const { data, isError, isLoading, error } = useQuery<
68
+ CompiledModel,
69
+ ApiError
70
+ >(
66
71
  {
67
72
  queryKey: [
68
73
  "package",
@@ -72,17 +77,46 @@ export default function Model({
72
77
  modelPath,
73
78
  versionId,
74
79
  ],
75
- queryFn: () =>
76
- modelsApi.getModel(projectName, packageName, modelPath, versionId, {
77
- baseURL: server,
78
- withCredentials: !accessToken,
79
- headers: {
80
- Authorization: accessToken && `Bearer ${accessToken}`,
81
- },
82
- }),
80
+ queryFn: async () => {
81
+ try {
82
+ const response = await modelsApi.getModel(
83
+ projectName,
84
+ packageName,
85
+ modelPath,
86
+ versionId,
87
+ {
88
+ baseURL: server,
89
+ withCredentials: !accessToken,
90
+ headers: {
91
+ Authorization: accessToken && `Bearer ${accessToken}`,
92
+ },
93
+ },
94
+ );
95
+ return response.data;
96
+ } catch (err) {
97
+ // If it's an Axios error, it will have response data
98
+ if (err && typeof err === "object" && "response" in err) {
99
+ console.log("axios err", err);
100
+ const axiosError = err as any;
101
+ if (axiosError.response?.data) {
102
+ const apiError: ApiError = new Error(
103
+ axiosError.response.data.message || axiosError.message,
104
+ );
105
+ apiError.status = axiosError.response.status;
106
+ apiError.data = axiosError.response.data;
107
+ throw apiError;
108
+ }
109
+ }
110
+ // For other errors, throw as is
111
+ throw err;
112
+ }
113
+ },
114
+ retry: false,
115
+ throwOnError: false,
83
116
  },
84
117
  queryClient,
85
118
  );
119
+
86
120
  if (isLoading) {
87
121
  return (
88
122
  <Typography sx={{ p: "20px", m: "auto" }}>
@@ -92,10 +126,12 @@ export default function Model({
92
126
  }
93
127
 
94
128
  if (isError) {
129
+ console.log("error", error);
95
130
  return (
96
- <Typography variant="body2" sx={{ p: "10px", m: "auto" }}>
97
- {`${packageName} > ${modelPath} > ${versionId} - ${error.message}`}
98
- </Typography>
131
+ <ApiErrorDisplay
132
+ error={error}
133
+ context={`${packageName} > ${modelPath}`}
134
+ />
99
135
  );
100
136
  }
101
137
  return (
@@ -107,8 +143,8 @@ export default function Model({
107
143
  justifyContent: "space-between",
108
144
  }}
109
145
  >
110
- {Array.isArray(data.data.sourceInfos) &&
111
- data.data.sourceInfos.length > 0 && (
146
+ {Array.isArray(data.sourceInfos) &&
147
+ data.sourceInfos.length > 0 && (
112
148
  <Tabs
113
149
  value={selectedTab}
114
150
  onChange={(_, newValue) => setSelectedTab(newValue)}
@@ -120,7 +156,7 @@ export default function Model({
120
156
  minHeight: 36,
121
157
  }}
122
158
  >
123
- {data.data.sourceInfos.map((source, idx) => {
159
+ {data.sourceInfos.map((source, idx) => {
124
160
  let sourceInfo;
125
161
  try {
126
162
  sourceInfo = JSON.parse(source);
@@ -203,18 +239,18 @@ export default function Model({
203
239
  <StyledCardMedia>
204
240
  <Stack spacing={2} component="section">
205
241
  {/* Only render the selected sourceInfo */}
206
- {Array.isArray(data.data.sourceInfos) &&
207
- data.data.sourceInfos.length > 0 && (
242
+ {Array.isArray(data.sourceInfos) &&
243
+ data.sourceInfos.length > 0 && (
208
244
  <SourceExplorerComponent
209
245
  sourceAndPath={{
210
246
  modelPath,
211
247
  sourceInfo: JSON.parse(
212
- data.data.sourceInfos[selectedTab],
248
+ data.sourceInfos[selectedTab],
213
249
  ),
214
250
  }}
215
251
  />
216
252
  )}
217
- {data.data.queries?.length > 0 && (
253
+ {data.queries?.length > 0 && (
218
254
  <StyledCard
219
255
  variant="outlined"
220
256
  sx={{ padding: "0px 10px 0px 10px" }}
@@ -225,20 +261,15 @@ export default function Model({
225
261
  </Typography>
226
262
  </StyledCardContent>
227
263
  <Stack spacing={1} component="section">
228
- {data.data.queries.map((query) => (
264
+ {data.queries.map((query) => (
229
265
  <ModelCell
230
266
  key={query.name}
231
- server={server}
232
- projectName={projectName}
233
- packageName={packageName}
234
267
  modelPath={modelPath}
235
- versionId={versionId}
236
268
  queryName={query.name}
237
269
  expandResult={expandResults}
238
270
  hideResultIcon={hideResultIcons}
239
271
  expandEmbedding={expandEmbeddings}
240
272
  hideEmbeddingIcon={hideEmbeddingIcons}
241
- accessToken={accessToken}
242
273
  noView={true}
243
274
  annotations={query.annotations}
244
275
  />
@@ -17,6 +17,7 @@ import LinkOutlinedIcon from "@mui/icons-material/LinkOutlined";
17
17
  import ContentCopyIcon from "@mui/icons-material/ContentCopy";
18
18
  import { useEffect } from "react";
19
19
  import { highlight } from "../highlighter";
20
+ import { usePackage } from "../Package/PackageProvider";
20
21
 
21
22
  const StyledCard = styled(Card)({
22
23
  display: "flex",
@@ -25,75 +26,60 @@ const StyledCard = styled(Card)({
25
26
  });
26
27
 
27
28
  interface ModelCellProps {
28
- server: string;
29
- projectName: string;
30
- packageName: string;
31
29
  modelPath: string;
32
- versionId: string;
33
30
  sourceName?: string;
34
31
  queryName: string;
35
32
  expandResult?: boolean;
36
33
  hideResultIcon?: boolean;
37
34
  expandEmbedding?: boolean;
38
35
  hideEmbeddingIcon?: boolean;
39
- accessToken?: string;
40
36
  noView?: boolean;
41
37
  annotations?: string[];
42
38
  }
43
39
 
44
40
  export function ModelCell({
45
- server,
46
- projectName,
47
- packageName,
48
41
  modelPath,
49
- versionId,
50
42
  sourceName,
51
43
  queryName,
52
44
  expandResult,
53
45
  hideResultIcon,
54
46
  expandEmbedding,
55
47
  hideEmbeddingIcon,
56
- accessToken,
57
48
  noView,
58
49
  annotations,
59
50
  }: ModelCellProps) {
60
51
  const [resultsExpanded, setResultsExpanded] = React.useState(expandResult);
61
52
  const [embeddingExpanded, setEmbeddingExpanded] =
62
- React.useState(expandEmbedding);
53
+ React.useState<boolean>(expandEmbedding);
63
54
  const [highlightedEmbedCode, setHighlightedEmbedCode] =
64
55
  React.useState<string>();
65
56
  const [highlightedAnnotations, setHighlightedAnnotations] =
66
57
  React.useState<string>();
67
58
 
68
- useEffect(() => {
69
- highlight(
70
- getQueryResultCodeSnippet(
71
- server,
72
- projectName,
73
- packageName,
74
- modelPath,
75
- versionId,
76
- sourceName,
77
- queryName,
78
- ),
79
- "typescript",
80
- ).then((code) => {
81
- setHighlightedEmbedCode(code);
82
- });
83
- }, [
59
+ const { server, projectName, packageName, versionId } = usePackage();
60
+
61
+ const queryResultCodeSnippet = getQueryResultCodeSnippet(
84
62
  server,
85
63
  projectName,
86
64
  packageName,
87
- modelPath,
88
65
  versionId,
89
66
  sourceName,
90
67
  queryName,
91
- ]);
68
+ );
69
+
70
+ useEffect(() => {
71
+ highlight(queryResultCodeSnippet, "typescript").then((code) => {
72
+ setHighlightedEmbedCode(code);
73
+ });
74
+ }, [embeddingExpanded, queryResultCodeSnippet]);
92
75
 
93
76
  useEffect(() => {
94
- if (annotations) {
95
- highlight(getAnnotations(annotations), "malloy").then((code) => {
96
- setHighlightedAnnotations(code);
77
+ if (annotations && annotations.length > 0) {
78
+ const code = annotations
79
+ .map((annotation) => `// ${annotation}`)
80
+ .join("\n");
81
+ highlight(code, "typescript").then((highlightedCode) => {
82
+ setHighlightedAnnotations(highlightedCode);
97
83
  });
98
84
  }
99
85
  }, [annotations]);
@@ -155,39 +141,33 @@ export function ModelCell({
155
141
  </CardActions>
156
142
  </Stack>
157
143
  <Collapse in={embeddingExpanded} timeout="auto" unmountOnExit>
158
- <Divider sx={{ mb: "10px" }} />
144
+ <Divider />
159
145
  <Stack
160
146
  sx={{
147
+ p: "10px",
161
148
  borderRadius: 0,
162
149
  flexDirection: "row",
163
150
  justifyContent: "space-between",
164
151
  }}
165
152
  >
166
153
  <Typography
167
- fontSize="12px"
168
- sx={{ fontSize: "12px", "& .line": { textWrap: "wrap" } }}
154
+ sx={{
155
+ fontSize: "12px",
156
+ "& .line": { textWrap: "wrap" },
157
+ }}
169
158
  >
170
159
  <div
171
- className="content"
172
160
  dangerouslySetInnerHTML={{
173
161
  __html: highlightedEmbedCode,
174
162
  }}
175
163
  />
176
164
  </Typography>
177
- <Tooltip title="View Code">
165
+ <Tooltip title="Copy Embeddable Code">
178
166
  <IconButton
179
167
  sx={{ width: "24px", height: "24px" }}
180
168
  onClick={() => {
181
169
  navigator.clipboard.writeText(
182
- getQueryResultCodeSnippet(
183
- server,
184
- projectName,
185
- packageName,
186
- modelPath,
187
- versionId,
188
- sourceName,
189
- queryName,
190
- ),
170
+ queryResultCodeSnippet,
191
171
  );
192
172
  }}
193
173
  >
@@ -227,14 +207,9 @@ export function ModelCell({
227
207
  )}
228
208
  <CardContent>
229
209
  <QueryResult
230
- server={server}
231
- projectName={projectName}
232
- packageName={packageName}
233
210
  modelPath={modelPath}
234
- versionId={versionId}
235
211
  sourceName={sourceName}
236
212
  queryName={queryName}
237
- accessToken={accessToken}
238
213
  />
239
214
  </CardContent>
240
215
  </Collapse>
@@ -247,7 +222,6 @@ function getQueryResultCodeSnippet(
247
222
  server: string,
248
223
  projectName: string,
249
224
  packageName: string,
250
- modelPath: string,
251
225
  versionId: string,
252
226
  sourceName: string,
253
227
  queryName: string,
@@ -257,19 +231,8 @@ server="${server}"
257
231
  accessToken={accessToken}
258
232
  projectName="${projectName}"
259
233
  packageName="${packageName}"
260
- modelPath="${modelPath}"
261
234
  versionId="${versionId}"
262
235
  sourceName="${sourceName}"
263
236
  queryName="${queryName}"
264
237
  />`;
265
238
  }
266
-
267
- function getAnnotations(annotations: string[]): string {
268
- let res = "";
269
-
270
- for (const an of annotations) {
271
- res += an;
272
- }
273
-
274
- return res;
275
- }
@@ -10,7 +10,7 @@ import { StyledCard, StyledCardContent } from "../styles";
10
10
 
11
11
  import { QueryClient, useMutation } from "@tanstack/react-query";
12
12
  import { Configuration } from "../../client";
13
- import { usePublisherPackage } from "../Package";
13
+ import { usePackage } from "../Package";
14
14
  import React from "react";
15
15
  import ResultContainer from "../RenderedResult/ResultContainer";
16
16
 
@@ -27,7 +27,7 @@ export default function NamedQueries({
27
27
  modelPath,
28
28
  }: NamedQueryProps) {
29
29
  const { server, projectName, packageName, versionId, accessToken } =
30
- usePublisherPackage();
30
+ usePackage();
31
31
  const [namedQueryResults, setNamedQueryResults] = React.useState<
32
32
  Record<string, string>
33
33
  >({});
@@ -21,7 +21,7 @@ import { styled } from "@mui/material/styles";
21
21
  import { QueryClient, useMutation } from "@tanstack/react-query";
22
22
  import React from "react";
23
23
  import { Configuration, QueryresultsApi } from "../../client";
24
- import { usePublisherPackage } from "../Package/PublisherPackageProvider";
24
+ import { usePackage } from "../Package/PackageProvider";
25
25
 
26
26
  const queryResultsApi = new QueryresultsApi(new Configuration());
27
27
  const queryClient = new QueryClient();
@@ -87,8 +87,8 @@ export function SourcesExplorer({
87
87
  const [selectedTab, setSelectedTab] = React.useState(
88
88
  existingSourceName
89
89
  ? sourceAndPaths.findIndex(
90
- (entry) => entry.sourceInfo.name === existingSourceName,
91
- )
90
+ (entry) => entry.sourceInfo.name === existingSourceName,
91
+ )
92
92
  : 0,
93
93
  );
94
94
 
@@ -193,7 +193,7 @@ export function SourceExplorerComponent({
193
193
  }
194
194
  }, [onChange, query]);
195
195
  const { server, projectName, packageName, versionId, accessToken } =
196
- usePublisherPackage();
196
+ usePackage();
197
197
  const mutation = useMutation(
198
198
  {
199
199
  mutationFn: () => {
@@ -272,7 +272,6 @@ export function SourceExplorerComponent({
272
272
  onFocusedNestViewPathChange={setFocusedNestViewPath}
273
273
  onDrill={(params) => {
274
274
  console.info(params);
275
- window.alert("Drill!");
276
275
  }}
277
276
  >
278
277
  <div
@@ -324,16 +323,16 @@ export function SourceExplorerComponent({
324
323
  submittedQuery={
325
324
  query?.malloyQuery
326
325
  ? {
327
- executionState: mutation.isPending
328
- ? "running"
329
- : "finished",
330
- response: {
331
- result: query.malloyResult,
332
- },
333
- query: query.malloyQuery,
334
- queryResolutionStartMillis: Date.now(),
335
- onCancel: mutation.reset,
336
- }
326
+ executionState: mutation.isPending
327
+ ? "running"
328
+ : "finished",
329
+ response: {
330
+ result: query.malloyResult,
331
+ },
332
+ query: query.malloyQuery,
333
+ queryResolutionStartMillis: Date.now(),
334
+ onCancel: mutation.reset,
335
+ }
337
336
  : undefined
338
337
  }
339
338
  options={{ showRawQuery: true }}
@@ -18,8 +18,9 @@ import {
18
18
  import { QueryClient, useQuery } from "@tanstack/react-query";
19
19
  import React from "react";
20
20
  import { Configuration, ModelsApi } from "../../client";
21
- import { usePublisherPackage } from "../Package/PublisherPackageProvider";
21
+ import { usePackage } from "../Package/PackageProvider";
22
22
  import { StyledCard } from "../styles";
23
+ import { ApiErrorDisplay } from "../ApiErrorDisplay";
23
24
 
24
25
  const modelsApi = new ModelsApi(new Configuration());
25
26
  const queryClient = new QueryClient();
@@ -38,7 +39,7 @@ export function ModelPicker({
38
39
  onModelChange,
39
40
  }: ModelPickerProps) {
40
41
  const { server, projectName, packageName, versionId, accessToken } =
41
- usePublisherPackage();
42
+ usePackage();
42
43
  const { data, isLoading, isSuccess, isError, error } = useQuery(
43
44
  {
44
45
  queryKey: ["models", server, projectName, packageName, versionId],
@@ -51,6 +52,7 @@ export function ModelPicker({
51
52
  },
52
53
  }),
53
54
  retry: false,
55
+ throwOnError: false,
54
56
  },
55
57
  queryClient,
56
58
  );
@@ -83,6 +85,15 @@ export function ModelPicker({
83
85
  .map((model) => model.path);
84
86
  }
85
87
 
88
+ if (isError) {
89
+ return (
90
+ <ApiErrorDisplay
91
+ error={error}
92
+ context={`${projectName} > ${packageName} > Model Picker`}
93
+ />
94
+ );
95
+ }
96
+
86
97
  return (
87
98
  <StyledCard
88
99
  sx={{ maxWidth: 400, marginLeft: "10px", padding: "10px 5px 5px 5px" }}
@@ -90,7 +101,6 @@ export function ModelPicker({
90
101
  <Typography variant="h6">Imported Models</Typography>
91
102
  <FormControl fullWidth>
92
103
  {isLoading && <Typography>Loading...</Typography>}
93
- {isError && <Typography>Error: {error.message}</Typography>}
94
104
  <Stack
95
105
  direction="row"
96
106
  spacing={1}
@@ -293,20 +293,11 @@ export function MutableCell({
293
293
  />
294
294
  ))}
295
295
  {!editingMalloy && cell.result && (
296
- <>
297
- <CardContent
298
- sx={{ maxHeight: "500px", overflow: "auto" }}
299
- >
300
- {/* TODO: Integrate expando better */}
301
- <Suspense fallback="Loading malloy...">
302
- <ResultContainer
303
- result={cell.result}
304
- minHeight={500}
305
- maxHeight={500}
306
- />
307
- </Suspense>
308
- </CardContent>
309
- </>
296
+ <ResultContainer
297
+ result={cell.result}
298
+ minHeight={300}
299
+ maxHeight={800}
300
+ />
310
301
  )}
311
302
  </>
312
303
  ))}
@@ -20,7 +20,7 @@ import { useRouterClickHandler } from "../click_helper";
20
20
  import { Configuration, ModelsApi } from "../../client";
21
21
  import { SourceAndPath } from "../Model/SourcesExplorer";
22
22
  import { NotebookManager } from "../NotebookManager";
23
- import { usePublisherPackage } from "../Package";
23
+ import { usePackage } from "../Package";
24
24
  import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
25
25
  import { ModelPicker } from "./ModelPicker";
26
26
  import { MutableCell } from "./MutableCell";
@@ -48,7 +48,7 @@ export default function MutableNotebook({
48
48
  }: MutableNotebookProps) {
49
49
  const navigate = useRouterClickHandler();
50
50
  const { server, projectName, packageName, versionId, accessToken } =
51
- usePublisherPackage();
51
+ usePackage();
52
52
  if (!projectName || !packageName) {
53
53
  throw new Error(
54
54
  "Project and package must be provided via PubliserPackageProvider",