@malloy-publisher/server 0.0.91 → 0.0.92

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 (306) hide show
  1. package/.prettierignore +1 -0
  2. package/dist/app/assets/{index-CwH8v8Pf.js → index-DYO_URL-.js} +100 -100
  3. package/dist/app/assets/{index-DJPvt7yu.js → index-Dg-zTLb3.js} +1 -1
  4. package/dist/app/assets/{index.es139-nr8meTUp.js → index.es126-CKC26ttZ.js} +1 -1
  5. package/dist/app/assets/{index.es140-f9ybcYUt.js → index.es127-CBKpWhIe.js} +1 -1
  6. package/dist/app/assets/{index.es143-BrmH4hWW.js → index.es130-5z_n6lm6.js} +1 -1
  7. package/dist/app/assets/{index.es148-KJPSzIi5.js → index.es135-aJw1Xr-9.js} +1 -1
  8. package/dist/app/assets/{index.es156-AslbYSUk.js → index.es143-CAt8G2AV.js} +1 -1
  9. package/dist/app/assets/{index.es157-CGx9vJCM.js → index.es144-CaWYrbVR.js} +1 -1
  10. package/dist/app/assets/{index.es160-B4514fRp.js → index.es147-B_4j3qbz.js} +1 -1
  11. package/dist/app/assets/{index.es164-BdfNgGb4.js → index.es151-Byg3j7QH.js} +1 -1
  12. package/dist/app/assets/{index.es167-Cytvwvs5.js → index.es154-D8PMiD5x.js} +1 -1
  13. package/dist/app/assets/{index.es170-BF0Mj3Dj.js → index.es157-qx6EMeW2.js} +1 -1
  14. package/dist/app/assets/{index.es171-bDBK09mk.js → index.es158-CJWvYXRx.js} +1 -1
  15. package/dist/app/assets/{index.es185-BECCJjWR.js → index.es172-BamsV9CN.js} +1 -1
  16. package/dist/app/assets/{index.es186-DORBN8KQ.js → index.es173-CXyGU58j.js} +1 -1
  17. package/dist/app/assets/{index.es187-C1QXB69O.js → index.es174-C2o3B3o8.js} +1 -1
  18. package/dist/app/assets/{index.es189-BxZOchW8.js → index.es176-BB-1P5bb.js} +1 -1
  19. package/dist/app/assets/{index.es194-AsRZMTWT.js → index.es181-2PlTGcYG.js} +1 -1
  20. package/dist/app/assets/{index.es196-x3jX2idz.js → index.es183-DgoVwe-N.js} +1 -1
  21. package/dist/app/assets/{index.es197-Dtz8tRxv.js → index.es184-Cmc38osU.js} +1 -1
  22. package/dist/app/assets/{index.es202-BMtZpqF-.js → index.es189-DuMu0KfI.js} +1 -1
  23. package/dist/app/assets/{index.es203-gWIQWffw.js → index.es190-C117wYiK.js} +1 -1
  24. package/dist/app/assets/{index.es205-D7Lk4BX7.js → index.es192-Bm2ZoxNH.js} +1 -1
  25. package/dist/app/assets/{index.es206-BiJF4jj3.js → index.es193-BBtnt1bZ.js} +1 -1
  26. package/dist/app/assets/{index.es207-B-UJ_bzC.js → index.es194-CB2Nn3wg.js} +1 -1
  27. package/dist/app/assets/{index.es210-Cuht9bXE.js → index.es197-D91osx4R.js} +1 -1
  28. package/dist/app/assets/{index.es212-OHX8E5rN.js → index.es199-BtpESJSS.js} +1 -1
  29. package/dist/app/assets/{index.es213-ZuPzTQ_g.js → index.es200-BeG9RRw_.js} +1 -1
  30. package/dist/app/assets/{index.es214-D803Db5p.js → index.es201-k2nuCC3B.js} +1 -1
  31. package/dist/app/assets/{index.es220-7QoCPP2j.js → index.es207-C2uQegug.js} +1 -1
  32. package/dist/app/assets/{index.es221-XNqXVFFm.js → index.es208-BTucFWqR.js} +1 -1
  33. package/dist/app/assets/{index.es222-Cdb4luVg.js → index.es209-4dK47W8o.js} +1 -1
  34. package/dist/app/assets/{index.es223-CORMGf1M.js → index.es210-DO6X3-kz.js} +1 -1
  35. package/dist/app/assets/{index.es225-Cq-kOlxp.js → index.es212-CFG-vrrr.js} +1 -1
  36. package/dist/app/assets/{index.es229-E5IGXk-q.js → index.es216-TWO3Mhor.js} +1 -1
  37. package/dist/app/assets/{index.es230-Fc3aBcCM.js → index.es217-0tHVUThG.js} +1 -1
  38. package/dist/app/assets/{index.es238-PSs3scPq.js → index.es225-DHGKCs7a.js} +1 -1
  39. package/dist/app/assets/{index.es241-CL-_GK9e.js → index.es228-Bz0ZvI5L.js} +1 -1
  40. package/dist/app/assets/{index.es244-DKPCX9xC.js → index.es231-D1HdFvsl.js} +1 -1
  41. package/dist/app/assets/{index.es247-BSAYNLHy.js → index.es234-1j9jt1V9.js} +1 -1
  42. package/dist/app/assets/{index.es251--0-h5QiV.js → index.es238-DBm7c9HR.js} +1 -1
  43. package/dist/app/assets/{index.es253-BEn9NcoZ.js → index.es240-DCqDESzD.js} +1 -1
  44. package/dist/app/assets/{index.es261-MjZ_rv4c.js → index.es248-BEYN2dFo.js} +1 -1
  45. package/dist/app/assets/{index.es262-HBJu6fHJ.js → index.es249-DKdYiZA_.js} +1 -1
  46. package/dist/app/assets/{index.es269-DLa2GgqN.js → index.es256-CgBAGaDx.js} +1 -1
  47. package/dist/app/assets/{index.es270-CalwIzIq.js → index.es257-DMI3dJGJ.js} +1 -1
  48. package/dist/app/assets/{index.es280-BmnnGhn2.js → index.es267-B5ei8o6D.js} +1 -1
  49. package/dist/app/assets/{index.es284-C2YEYS8h.js → index.es271-DDBsSlrj.js} +1 -1
  50. package/dist/app/assets/{index.es290-BHjEYaA_.js → index.es277-aI_iYBJv.js} +1 -1
  51. package/dist/app/assets/{index.es295-CLE8Egbz.js → index.es282-DZQyCurk.js} +1 -1
  52. package/dist/app/assets/{index.es296-Bsq8yJGD.js → index.es283-DRQxI154.js} +1 -1
  53. package/dist/app/assets/{index.es298-CTsw_aX6.js → index.es285-DrT3oe3D.js} +1 -1
  54. package/dist/app/assets/{index.es302-BgJs_s58.js → index.es289-CKYiktdr.js} +1 -1
  55. package/dist/app/assets/{index.es304-Y67tbm3o.js → index.es291-BRH8qn2R.js} +1 -1
  56. package/dist/app/assets/{index.es306-Dsx0880i.js → index.es293-B_x7Y2b5.js} +1 -1
  57. package/dist/app/assets/{index.es309-COa7lSGF.js → index.es296-CMhur-CK.js} +1 -1
  58. package/dist/app/assets/{index.es310-C11TmHug.js → index.es297-BY9kHC-p.js} +1 -1
  59. package/dist/app/assets/{index.es314-BExIez_V.js → index.es301-CmwjGLCv.js} +1 -1
  60. package/dist/app/assets/{index.es316-DFqBRZWD.js → index.es303-BOa5F89I.js} +1 -1
  61. package/dist/app/assets/{index.es323-BClNDw1H.js → index.es310-BF6kc0UE.js} +1 -1
  62. package/dist/app/assets/{index.es325-f5hVUVjI.js → index.es312-CoCT5fTV.js} +1 -1
  63. package/dist/app/assets/{index.es327-DsTyRd6E.js → index.es314-CMYE9lCS.js} +1 -1
  64. package/dist/app/assets/{index.es331-BLhdwz0E.js → index.es318-C2_Stmju.js} +1 -1
  65. package/dist/app/assets/{index.es341-oDRBDM86.js → index.es328-DxiHjjdV.js} +1 -1
  66. package/dist/app/assets/{index.es342-DialnTnH.js → index.es329-D4H4qJV5.js} +1 -1
  67. package/dist/app/assets/{index.es349-DrBCM5L2.js → index.es336-DMBcHb9l.js} +1 -1
  68. package/dist/app/assets/{index.es350-B1R-_5vW.js → index.es337-BOcmfyvS.js} +1 -1
  69. package/dist/app/assets/{index.es50-Dwe0S21o.js → index.es50-CDMydA2o.js} +1 -1
  70. package/dist/app/assets/mui-UpaxdnvH.js +159 -0
  71. package/dist/app/index.html +2 -2
  72. package/dist/server.js +294 -92
  73. package/eslint.config.mjs +8 -0
  74. package/package.json +2 -1
  75. package/publisher.config.json +25 -5
  76. package/src/config.ts +25 -2
  77. package/src/constants.ts +1 -1
  78. package/src/controller/package.controller.ts +1 -0
  79. package/src/controller/watch-mode.controller.ts +19 -4
  80. package/src/data_styles.ts +10 -3
  81. package/src/mcp/prompts/index.ts +9 -1
  82. package/src/mcp/resources/package_resource.ts +2 -1
  83. package/src/mcp/resources/source_resource.ts +1 -0
  84. package/src/mcp/resources/view_resource.ts +1 -0
  85. package/src/server.ts +9 -9
  86. package/src/service/connection.ts +17 -4
  87. package/src/service/db_utils.ts +3 -2
  88. package/src/service/model.ts +2 -0
  89. package/src/service/package.spec.ts +76 -54
  90. package/src/service/project.ts +159 -44
  91. package/src/service/project_store.spec.ts +477 -165
  92. package/src/service/project_store.ts +315 -68
  93. package/src/service/scheduler.ts +3 -2
  94. package/src/utils.ts +0 -1
  95. package/tests/harness/e2e.ts +60 -58
  96. package/tests/harness/uris.ts +21 -24
  97. package/tests/integration/mcp/mcp_resource.integration.spec.ts +10 -0
  98. package/dist/app/assets/mui-Bcj8oDBR.js +0 -161
  99. /package/dist/app/assets/{index.es128-CG6Dc4jp.js → index.es115-CG6Dc4jp.js} +0 -0
  100. /package/dist/app/assets/{index.es136-DsBKuouk.js → index.es123-DsBKuouk.js} +0 -0
  101. /package/dist/app/assets/{index.es137-D_z4Izcz.js → index.es124-D_z4Izcz.js} +0 -0
  102. /package/dist/app/assets/{index.es138-727ZlQH0.js → index.es125-727ZlQH0.js} +0 -0
  103. /package/dist/app/assets/{index.es141-Dn00JSTd.js → index.es128-Dn00JSTd.js} +0 -0
  104. /package/dist/app/assets/{index.es142-COJ4H7py.js → index.es129-COJ4H7py.js} +0 -0
  105. /package/dist/app/assets/{index.es144-Bu5BbsvL.js → index.es131-Bu5BbsvL.js} +0 -0
  106. /package/dist/app/assets/{index.es145-7O62HKoU.js → index.es132-7O62HKoU.js} +0 -0
  107. /package/dist/app/assets/{index.es146-BPT9niGB.js → index.es133-BPT9niGB.js} +0 -0
  108. /package/dist/app/assets/{index.es147-Dhn9LcZ4.js → index.es134-Dhn9LcZ4.js} +0 -0
  109. /package/dist/app/assets/{index.es149-eg146-Ew.js → index.es136-eg146-Ew.js} +0 -0
  110. /package/dist/app/assets/{index.es150-Du268qiB.js → index.es137-Du268qiB.js} +0 -0
  111. /package/dist/app/assets/{index.es151-fje9CFhw.js → index.es138-fje9CFhw.js} +0 -0
  112. /package/dist/app/assets/{index.es152-BwXTMy5W.js → index.es139-BwXTMy5W.js} +0 -0
  113. /package/dist/app/assets/{index.es153-3xVqZejG.js → index.es140-3xVqZejG.js} +0 -0
  114. /package/dist/app/assets/{index.es154-xW4inM5L.js → index.es141-xW4inM5L.js} +0 -0
  115. /package/dist/app/assets/{index.es155-DHo0CJ0O.js → index.es142-DHo0CJ0O.js} +0 -0
  116. /package/dist/app/assets/{index.es158-C3t2pwGQ.js → index.es145-C3t2pwGQ.js} +0 -0
  117. /package/dist/app/assets/{index.es159-DNquZEk8.js → index.es146-DNquZEk8.js} +0 -0
  118. /package/dist/app/assets/{index.es161-BHOwM8T6.js → index.es148-BHOwM8T6.js} +0 -0
  119. /package/dist/app/assets/{index.es162-DxSadP1t.js → index.es149-DxSadP1t.js} +0 -0
  120. /package/dist/app/assets/{index.es163-DbXoA79R.js → index.es150-DbXoA79R.js} +0 -0
  121. /package/dist/app/assets/{index.es165-Bp6g37R7.js → index.es152-Bp6g37R7.js} +0 -0
  122. /package/dist/app/assets/{index.es166-sacFqUAJ.js → index.es153-sacFqUAJ.js} +0 -0
  123. /package/dist/app/assets/{index.es168-C7gG9l05.js → index.es155-C7gG9l05.js} +0 -0
  124. /package/dist/app/assets/{index.es169-Dsg_Bt_b.js → index.es156-Dsg_Bt_b.js} +0 -0
  125. /package/dist/app/assets/{index.es172-D9R-vmeu.js → index.es159-D9R-vmeu.js} +0 -0
  126. /package/dist/app/assets/{index.es173-BPhBrDlE.js → index.es160-BPhBrDlE.js} +0 -0
  127. /package/dist/app/assets/{index.es174-C-TU5hQ_.js → index.es161-C-TU5hQ_.js} +0 -0
  128. /package/dist/app/assets/{index.es175-DtFQj3wx.js → index.es162-DtFQj3wx.js} +0 -0
  129. /package/dist/app/assets/{index.es176-m2LEI-9-.js → index.es163-m2LEI-9-.js} +0 -0
  130. /package/dist/app/assets/{index.es177-BoXegm-a.js → index.es164-BoXegm-a.js} +0 -0
  131. /package/dist/app/assets/{index.es178-B9wLZaAG.js → index.es165-B9wLZaAG.js} +0 -0
  132. /package/dist/app/assets/{index.es179-ClGRhx96.js → index.es166-ClGRhx96.js} +0 -0
  133. /package/dist/app/assets/{index.es180-DEIpsLCJ.js → index.es167-DEIpsLCJ.js} +0 -0
  134. /package/dist/app/assets/{index.es181-BgYniUM_.js → index.es168-BgYniUM_.js} +0 -0
  135. /package/dist/app/assets/{index.es182-COcR7UxN.js → index.es169-COcR7UxN.js} +0 -0
  136. /package/dist/app/assets/{index.es183-BjQB5zDj.js → index.es170-BjQB5zDj.js} +0 -0
  137. /package/dist/app/assets/{index.es184-C-nORZOA.js → index.es171-C-nORZOA.js} +0 -0
  138. /package/dist/app/assets/{index.es188-BX77sIaO.js → index.es175-BX77sIaO.js} +0 -0
  139. /package/dist/app/assets/{index.es190-B-DoSBHF.js → index.es177-B-DoSBHF.js} +0 -0
  140. /package/dist/app/assets/{index.es191-bCA53EVm.js → index.es178-bCA53EVm.js} +0 -0
  141. /package/dist/app/assets/{index.es192-w-ucz2PV.js → index.es179-w-ucz2PV.js} +0 -0
  142. /package/dist/app/assets/{index.es193-Dayu4EKP.js → index.es180-Dayu4EKP.js} +0 -0
  143. /package/dist/app/assets/{index.es195-DKXYxT9g.js → index.es182-DKXYxT9g.js} +0 -0
  144. /package/dist/app/assets/{index.es198-DfxzS6Rs.js → index.es185-DfxzS6Rs.js} +0 -0
  145. /package/dist/app/assets/{index.es199-SKMF96pI.js → index.es186-SKMF96pI.js} +0 -0
  146. /package/dist/app/assets/{index.es200-ajMbGru0.js → index.es187-ajMbGru0.js} +0 -0
  147. /package/dist/app/assets/{index.es201--30QC5Em.js → index.es188--30QC5Em.js} +0 -0
  148. /package/dist/app/assets/{index.es204-B430Bg39.js → index.es191-B430Bg39.js} +0 -0
  149. /package/dist/app/assets/{index.es208-CM8KxXT1.js → index.es195-CM8KxXT1.js} +0 -0
  150. /package/dist/app/assets/{index.es209-B1SYOhNW.js → index.es196-B1SYOhNW.js} +0 -0
  151. /package/dist/app/assets/{index.es211-DkBy-JyN.js → index.es198-DkBy-JyN.js} +0 -0
  152. /package/dist/app/assets/{index.es215-BILxekzW.js → index.es202-BILxekzW.js} +0 -0
  153. /package/dist/app/assets/{index.es216-C5wWYbrZ.js → index.es203-C5wWYbrZ.js} +0 -0
  154. /package/dist/app/assets/{index.es217-HzYwdGDm.js → index.es204-HzYwdGDm.js} +0 -0
  155. /package/dist/app/assets/{index.es218-T-Tgc4AT.js → index.es205-T-Tgc4AT.js} +0 -0
  156. /package/dist/app/assets/{index.es219-ifBTmRxC.js → index.es206-ifBTmRxC.js} +0 -0
  157. /package/dist/app/assets/{index.es224-BMj5Y0dO.js → index.es211-BMj5Y0dO.js} +0 -0
  158. /package/dist/app/assets/{index.es226-BjABl1g7.js → index.es213-BjABl1g7.js} +0 -0
  159. /package/dist/app/assets/{index.es227-xI-RfyKK.js → index.es214-xI-RfyKK.js} +0 -0
  160. /package/dist/app/assets/{index.es228-ySlJ1b_l.js → index.es215-ySlJ1b_l.js} +0 -0
  161. /package/dist/app/assets/{index.es231-BQoSv7ci.js → index.es218-BQoSv7ci.js} +0 -0
  162. /package/dist/app/assets/{index.es232-w8dY5SsB.js → index.es219-w8dY5SsB.js} +0 -0
  163. /package/dist/app/assets/{index.es233-TU54ms6u.js → index.es220-TU54ms6u.js} +0 -0
  164. /package/dist/app/assets/{index.es234-DREVFZK8.js → index.es221-DREVFZK8.js} +0 -0
  165. /package/dist/app/assets/{index.es235-BfivnA6A.js → index.es222-BfivnA6A.js} +0 -0
  166. /package/dist/app/assets/{index.es236-P4WzXJd0.js → index.es223-P4WzXJd0.js} +0 -0
  167. /package/dist/app/assets/{index.es237-BAng5TT0.js → index.es224-BAng5TT0.js} +0 -0
  168. /package/dist/app/assets/{index.es239-B5lbUyaz.js → index.es226-B5lbUyaz.js} +0 -0
  169. /package/dist/app/assets/{index.es240-mebxcVVE.js → index.es227-mebxcVVE.js} +0 -0
  170. /package/dist/app/assets/{index.es242-XBlWyCtg.js → index.es229-XBlWyCtg.js} +0 -0
  171. /package/dist/app/assets/{index.es243-BfCpw3nA.js → index.es230-BfCpw3nA.js} +0 -0
  172. /package/dist/app/assets/{index.es245-Cc5clBb7.js → index.es232-Cc5clBb7.js} +0 -0
  173. /package/dist/app/assets/{index.es246-IuBKFhSY.js → index.es233-IuBKFhSY.js} +0 -0
  174. /package/dist/app/assets/{index.es248-Du5NY7AG.js → index.es235-Du5NY7AG.js} +0 -0
  175. /package/dist/app/assets/{index.es249-Bvotw-X0.js → index.es236-Bvotw-X0.js} +0 -0
  176. /package/dist/app/assets/{index.es250-UIAJJxZW.js → index.es237-UIAJJxZW.js} +0 -0
  177. /package/dist/app/assets/{index.es252-D9-PGadD.js → index.es239-D9-PGadD.js} +0 -0
  178. /package/dist/app/assets/{index.es254-sdHcTMYB.js → index.es241-sdHcTMYB.js} +0 -0
  179. /package/dist/app/assets/{index.es255-Ci6OQyBP.js → index.es242-Ci6OQyBP.js} +0 -0
  180. /package/dist/app/assets/{index.es256-BC5c_5Pe.js → index.es243-BC5c_5Pe.js} +0 -0
  181. /package/dist/app/assets/{index.es257-Tz6hzZYG.js → index.es244-Tz6hzZYG.js} +0 -0
  182. /package/dist/app/assets/{index.es258-DB_GagMm.js → index.es245-DB_GagMm.js} +0 -0
  183. /package/dist/app/assets/{index.es259-DLbgOhZU.js → index.es246-DLbgOhZU.js} +0 -0
  184. /package/dist/app/assets/{index.es260-B0XVJmRM.js → index.es247-B0XVJmRM.js} +0 -0
  185. /package/dist/app/assets/{index.es263-shcSOmrb.js → index.es250-shcSOmrb.js} +0 -0
  186. /package/dist/app/assets/{index.es264-D4Tzg5kh.js → index.es251-D4Tzg5kh.js} +0 -0
  187. /package/dist/app/assets/{index.es265-Deuh7S70.js → index.es252-Deuh7S70.js} +0 -0
  188. /package/dist/app/assets/{index.es266-BUEGK8hf.js → index.es253-BUEGK8hf.js} +0 -0
  189. /package/dist/app/assets/{index.es267-BNioltXt.js → index.es254-BNioltXt.js} +0 -0
  190. /package/dist/app/assets/{index.es268-JqZropPD.js → index.es255-JqZropPD.js} +0 -0
  191. /package/dist/app/assets/{index.es271-LKU2TuZ1.js → index.es258-LKU2TuZ1.js} +0 -0
  192. /package/dist/app/assets/{index.es272-BFLt1xDp.js → index.es259-BFLt1xDp.js} +0 -0
  193. /package/dist/app/assets/{index.es273-DKykz6zU.js → index.es260-DKykz6zU.js} +0 -0
  194. /package/dist/app/assets/{index.es274-B3ZDOciz.js → index.es261-B3ZDOciz.js} +0 -0
  195. /package/dist/app/assets/{index.es275-CSHBycmS.js → index.es262-CSHBycmS.js} +0 -0
  196. /package/dist/app/assets/{index.es276-BIEUsx6d.js → index.es263-BIEUsx6d.js} +0 -0
  197. /package/dist/app/assets/{index.es277-B48N-Iqd.js → index.es264-B48N-Iqd.js} +0 -0
  198. /package/dist/app/assets/{index.es278-BY-TUvya.js → index.es265-BY-TUvya.js} +0 -0
  199. /package/dist/app/assets/{index.es279-zocC4JxJ.js → index.es266-zocC4JxJ.js} +0 -0
  200. /package/dist/app/assets/{index.es281-Cza_XSSt.js → index.es268-Cza_XSSt.js} +0 -0
  201. /package/dist/app/assets/{index.es282-Bg-kzb6g.js → index.es269-Bg-kzb6g.js} +0 -0
  202. /package/dist/app/assets/{index.es283-DhUJRlN_.js → index.es270-DhUJRlN_.js} +0 -0
  203. /package/dist/app/assets/{index.es285-C8lEn-DE.js → index.es272-C8lEn-DE.js} +0 -0
  204. /package/dist/app/assets/{index.es286-DhMKtDLN.js → index.es273-DhMKtDLN.js} +0 -0
  205. /package/dist/app/assets/{index.es287-CwjWoCRV.js → index.es274-CwjWoCRV.js} +0 -0
  206. /package/dist/app/assets/{index.es288-CzouJOBO.js → index.es275-CzouJOBO.js} +0 -0
  207. /package/dist/app/assets/{index.es289-B1bQXN8T.js → index.es276-B1bQXN8T.js} +0 -0
  208. /package/dist/app/assets/{index.es291-5LuOXUq_.js → index.es278-5LuOXUq_.js} +0 -0
  209. /package/dist/app/assets/{index.es292-DWJ3fJO_.js → index.es279-DWJ3fJO_.js} +0 -0
  210. /package/dist/app/assets/{index.es293-DJlmqQ1C.js → index.es280-DJlmqQ1C.js} +0 -0
  211. /package/dist/app/assets/{index.es294-QhoSD0DR.js → index.es281-QhoSD0DR.js} +0 -0
  212. /package/dist/app/assets/{index.es297-Be6lgOlo.js → index.es284-Be6lgOlo.js} +0 -0
  213. /package/dist/app/assets/{index.es299-BJ4Li9vH.js → index.es286-BJ4Li9vH.js} +0 -0
  214. /package/dist/app/assets/{index.es300-DQVVAn-B.js → index.es287-DQVVAn-B.js} +0 -0
  215. /package/dist/app/assets/{index.es301-BJGe-b2p.js → index.es288-BJGe-b2p.js} +0 -0
  216. /package/dist/app/assets/{index.es303-BLhTXw86.js → index.es290-BLhTXw86.js} +0 -0
  217. /package/dist/app/assets/{index.es305-atvbtKCR.js → index.es292-atvbtKCR.js} +0 -0
  218. /package/dist/app/assets/{index.es307-DkLiglaE.js → index.es294-DkLiglaE.js} +0 -0
  219. /package/dist/app/assets/{index.es308-C1w2a3ep.js → index.es295-C1w2a3ep.js} +0 -0
  220. /package/dist/app/assets/{index.es311-Cf8iN4DR.js → index.es298-Cf8iN4DR.js} +0 -0
  221. /package/dist/app/assets/{index.es312-COK4E0Yg.js → index.es299-COK4E0Yg.js} +0 -0
  222. /package/dist/app/assets/{index.es313-BknIz3MU.js → index.es300-BknIz3MU.js} +0 -0
  223. /package/dist/app/assets/{index.es315-BeQkCIfX.js → index.es302-BeQkCIfX.js} +0 -0
  224. /package/dist/app/assets/{index.es317-BSxZ-RaX.js → index.es304-BSxZ-RaX.js} +0 -0
  225. /package/dist/app/assets/{index.es318-C7L56vO4.js → index.es305-C7L56vO4.js} +0 -0
  226. /package/dist/app/assets/{index.es319-CUnW07Te.js → index.es306-CUnW07Te.js} +0 -0
  227. /package/dist/app/assets/{index.es320-C1XDQQGZ.js → index.es307-C1XDQQGZ.js} +0 -0
  228. /package/dist/app/assets/{index.es321-CQjiPCtT.js → index.es308-CQjiPCtT.js} +0 -0
  229. /package/dist/app/assets/{index.es322-DQ1-QYvQ.js → index.es309-DQ1-QYvQ.js} +0 -0
  230. /package/dist/app/assets/{index.es324-BbSNqyBO.js → index.es311-BbSNqyBO.js} +0 -0
  231. /package/dist/app/assets/{index.es326-CB2ApiWb.js → index.es313-CB2ApiWb.js} +0 -0
  232. /package/dist/app/assets/{index.es328-B_m7g4N7.js → index.es315-B_m7g4N7.js} +0 -0
  233. /package/dist/app/assets/{index.es329-B6W0miNI.js → index.es316-B6W0miNI.js} +0 -0
  234. /package/dist/app/assets/{index.es330-BMR_PYu6.js → index.es317-BMR_PYu6.js} +0 -0
  235. /package/dist/app/assets/{index.es332-Dj6nwHGl.js → index.es319-Dj6nwHGl.js} +0 -0
  236. /package/dist/app/assets/{index.es333-BpWG_bgh.js → index.es320-BpWG_bgh.js} +0 -0
  237. /package/dist/app/assets/{index.es334-BVUVsWT6.js → index.es321-BVUVsWT6.js} +0 -0
  238. /package/dist/app/assets/{index.es335-CAQ2eGtk.js → index.es322-CAQ2eGtk.js} +0 -0
  239. /package/dist/app/assets/{index.es336-BFOHcciG.js → index.es323-BFOHcciG.js} +0 -0
  240. /package/dist/app/assets/{index.es337-CdO5JTpU.js → index.es324-CdO5JTpU.js} +0 -0
  241. /package/dist/app/assets/{index.es338-CJaU5se_.js → index.es325-CJaU5se_.js} +0 -0
  242. /package/dist/app/assets/{index.es339-DYoNaHQp.js → index.es326-DYoNaHQp.js} +0 -0
  243. /package/dist/app/assets/{index.es340-m4uW47V2.js → index.es327-m4uW47V2.js} +0 -0
  244. /package/dist/app/assets/{index.es343-nyqBNV6O.js → index.es330-nyqBNV6O.js} +0 -0
  245. /package/dist/app/assets/{index.es344-C6j12Q_x.js → index.es331-C6j12Q_x.js} +0 -0
  246. /package/dist/app/assets/{index.es345-7A4Fjokl.js → index.es332-7A4Fjokl.js} +0 -0
  247. /package/dist/app/assets/{index.es346-CB0Krxn9.js → index.es333-CB0Krxn9.js} +0 -0
  248. /package/dist/app/assets/{index.es347-DCE3LsBG.js → index.es334-DCE3LsBG.js} +0 -0
  249. /package/dist/app/assets/{index.es348-C3FkfJm5.js → index.es335-C3FkfJm5.js} +0 -0
  250. /package/dist/app/assets/{index.es351-CVw76BM1.js → index.es338-CVw76BM1.js} +0 -0
  251. /package/dist/app/assets/{index.es352-HnGAYVZD.js → index.es339-HnGAYVZD.js} +0 -0
  252. /package/dist/app/assets/{index.es353-BVz_zdnA.js → index.es340-BVz_zdnA.js} +0 -0
  253. /package/dist/app/assets/{index.es354-C3khCPGq.js → index.es341-C3khCPGq.js} +0 -0
  254. /package/dist/app/assets/{index.es355-D-2ljcwZ.js → index.es342-D-2ljcwZ.js} +0 -0
  255. /package/dist/app/assets/{index.es356-Cv9koXgw.js → index.es343-Cv9koXgw.js} +0 -0
  256. /package/dist/app/assets/{index.es357-CD_QflpE.js → index.es344-CD_QflpE.js} +0 -0
  257. /package/dist/app/assets/{index.es358-DRW-0cLl.js → index.es345-DRW-0cLl.js} +0 -0
  258. /package/dist/app/assets/{index.es359-C-_shW-Y.js → index.es346-C-_shW-Y.js} +0 -0
  259. /package/dist/app/assets/{index.es360-LGGdnPYs.js → index.es347-LGGdnPYs.js} +0 -0
  260. /package/dist/app/assets/{index.es361-C3mMm8J8.js → index.es348-C3mMm8J8.js} +0 -0
  261. /package/dist/app/assets/{index.es362-BzJJZx-M.js → index.es349-BzJJZx-M.js} +0 -0
  262. /package/dist/app/assets/{index.es363-BXkSAIEj.js → index.es350-BXkSAIEj.js} +0 -0
  263. /package/dist/app/assets/{index.es364-BgDCqdQA.js → index.es351-BgDCqdQA.js} +0 -0
  264. /package/dist/app/assets/{index.es365-C8M2exoo.js → index.es352-C8M2exoo.js} +0 -0
  265. /package/dist/app/assets/{index.es366-DHJKELXO.js → index.es353-DHJKELXO.js} +0 -0
  266. /package/dist/app/assets/{index.es367-Cuk6v7N8.js → index.es354-Cuk6v7N8.js} +0 -0
  267. /package/dist/app/assets/{index.es368-DH5Ifo-i.js → index.es355-DH5Ifo-i.js} +0 -0
  268. /package/dist/app/assets/{index.es369-E3gJ1_iC.js → index.es356-E3gJ1_iC.js} +0 -0
  269. /package/dist/app/assets/{index.es370-DAi9KRSo.js → index.es357-DAi9KRSo.js} +0 -0
  270. /package/dist/app/assets/{index.es371-D7oLnXFd.js → index.es358-D7oLnXFd.js} +0 -0
  271. /package/dist/app/assets/{index.es372-BfjtVDDH.js → index.es359-BfjtVDDH.js} +0 -0
  272. /package/dist/app/assets/{index.es373-DnULxvSX.js → index.es360-DnULxvSX.js} +0 -0
  273. /package/dist/app/assets/{index.es374-CkXjmgJE.js → index.es361-CkXjmgJE.js} +0 -0
  274. /package/dist/app/assets/{index.es375-CfQXZHmo.js → index.es362-CfQXZHmo.js} +0 -0
  275. /package/dist/app/assets/{index.es376-DWedfzmr.js → index.es363-DWedfzmr.js} +0 -0
  276. /package/dist/app/assets/{index.es377-DUszq2jm.js → index.es364-DUszq2jm.js} +0 -0
  277. /package/dist/app/assets/{index.es378-B7mTdjB0.js → index.es365-B7mTdjB0.js} +0 -0
  278. /package/dist/app/assets/{index.es379-D5KoaKCx.js → index.es366-D5KoaKCx.js} +0 -0
  279. /package/dist/app/assets/{index.es380-BfHTSMKl.js → index.es367-BfHTSMKl.js} +0 -0
  280. /package/dist/app/assets/{index.es381-B0m2ddpp.js → index.es368-B0m2ddpp.js} +0 -0
  281. /package/dist/app/assets/{index.es382-CyktbL80.js → index.es369-CyktbL80.js} +0 -0
  282. /package/dist/app/assets/{index.es383-Csfq5Kiy.js → index.es370-Csfq5Kiy.js} +0 -0
  283. /package/dist/app/assets/{index.es384-CafNBF8u.js → index.es371-CafNBF8u.js} +0 -0
  284. /package/dist/app/assets/{index.es385-CTRr51gU.js → index.es372-CTRr51gU.js} +0 -0
  285. /package/dist/app/assets/{index.es386-D4h5O-jR.js → index.es373-D4h5O-jR.js} +0 -0
  286. /package/dist/app/assets/{index.es387-C39BiMTA.js → index.es374-C39BiMTA.js} +0 -0
  287. /package/dist/app/assets/{index.es388-Ddv68eIx.js → index.es375-Ddv68eIx.js} +0 -0
  288. /package/dist/app/assets/{index.es389-GBQ2dnAY.js → index.es376-GBQ2dnAY.js} +0 -0
  289. /package/dist/app/assets/{index.es390-PoHY5YXO.js → index.es377-PoHY5YXO.js} +0 -0
  290. /package/dist/app/assets/{index.es391-3e1v2bzS.js → index.es378-3e1v2bzS.js} +0 -0
  291. /package/dist/app/assets/{index.es392-CS3Unz2-.js → index.es379-CS3Unz2-.js} +0 -0
  292. /package/dist/app/assets/{index.es393-bN70gL4F.js → index.es380-bN70gL4F.js} +0 -0
  293. /package/dist/app/assets/{index.es394-CmCqftbK.js → index.es381-CmCqftbK.js} +0 -0
  294. /package/dist/app/assets/{index.es395-Ds-gbosJ.js → index.es382-Ds-gbosJ.js} +0 -0
  295. /package/dist/app/assets/{index.es396-CjDtw9vr.js → index.es383-CjDtw9vr.js} +0 -0
  296. /package/dist/app/assets/{index.es397-BthQWCQV.js → index.es384-BthQWCQV.js} +0 -0
  297. /package/dist/app/assets/{index.es398-DqwNpetd.js → index.es385-DqwNpetd.js} +0 -0
  298. /package/dist/app/assets/{index.es399-Bw305WKR.js → index.es386-Bw305WKR.js} +0 -0
  299. /package/dist/app/assets/{index.es400-DXbdFlpD.js → index.es387-DXbdFlpD.js} +0 -0
  300. /package/dist/app/assets/{index.es401-L9t79GZl.js → index.es388-L9t79GZl.js} +0 -0
  301. /package/dist/app/assets/{index.es402-CbfX1IO0.js → index.es389-CbfX1IO0.js} +0 -0
  302. /package/dist/app/assets/{index.es403-DBQeEorK.js → index.es390-DBQeEorK.js} +0 -0
  303. /package/dist/app/assets/{index.es404-BEBZ7ncR.js → index.es391-BEBZ7ncR.js} +0 -0
  304. /package/dist/app/assets/{index.es405-Bkuqu6BP.js → index.es392-Bkuqu6BP.js} +0 -0
  305. /package/dist/app/assets/{index.es406-D0r3Knsf.js → index.es393-D0r3Knsf.js} +0 -0
  306. /package/dist/app/assets/{index.es407-CVO1_9PV.js → index.es394-CVO1_9PV.js} +0 -0
@@ -12,9 +12,9 @@
12
12
  href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
13
13
  />
14
14
  <title>Malloy Publisher</title>
15
- <script type="module" crossorigin src="/assets/index-CwH8v8Pf.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-DYO_URL-.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="/assets/vendor-c5ypKtDW.js">
17
- <link rel="modulepreload" crossorigin href="/assets/mui-Bcj8oDBR.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/mui-UpaxdnvH.js">
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-CcIq0aEZ.css">
19
19
  </head>
20
20
  <body>
package/dist/server.js CHANGED
@@ -231303,7 +231303,7 @@ var ROW_LIMIT = 1000;
231303
231303
  var publisherPath = "/etc/publisher";
231304
231304
  try {
231305
231305
  import_fs.default.accessSync(publisherPath, import_fs.default.constants.W_OK);
231306
- } catch (e) {
231306
+ } catch {
231307
231307
  publisherPath = "/tmp/publisher";
231308
231308
  }
231309
231309
 
@@ -231718,7 +231718,7 @@ async function getSnowflakeSchemas(connection) {
231718
231718
  return new Promise((resolve, reject) => {
231719
231719
  connection.execute({
231720
231720
  sqlText: "SHOW SCHEMAS",
231721
- complete: (err, stmt, rows) => {
231721
+ complete: (err, _stmt, rows) => {
231722
231722
  if (err) {
231723
231723
  reject(err);
231724
231724
  } else {
@@ -231966,7 +231966,7 @@ class PackageController {
231966
231966
  if (packageLocation.endsWith(".zip")) {
231967
231967
  packageLocation = await this.projectStore.unzipProject(packageLocation);
231968
231968
  }
231969
- await this.projectStore.mountLocalDirectory(packageLocation, absoluteTargetPath, projectName);
231969
+ await this.projectStore.mountLocalDirectory(packageLocation, absoluteTargetPath, projectName, packageName);
231970
231970
  }
231971
231971
  }
231972
231972
  }
@@ -233583,9 +233583,9 @@ var import_path4 = __toESM(require("path"));
233583
233583
  // src/service/project_store.ts
233584
233584
  var import_client_s3 = __toESM(require_dist_cjs72());
233585
233585
  var import_storage = require("@google-cloud/storage");
233586
+ var import_adm_zip = __toESM(require_adm_zip());
233586
233587
  var fs9 = __toESM(require("fs"));
233587
233588
  var path7 = __toESM(require("path"));
233588
- var import_adm_zip = __toESM(require_adm_zip());
233589
233589
 
233590
233590
  // ../../node_modules/simple-git/dist/esm/index.js
233591
233591
  var import_node_buffer = require("node:buffer");
@@ -237575,7 +237575,11 @@ var import_fs5 = __toESM(require("fs"));
237575
237575
  var import_path2 = __toESM(require("path"));
237576
237576
  var getPublisherConfig = (serverRoot) => {
237577
237577
  const publisherConfigPath = import_path2.default.join(serverRoot, PUBLISHER_CONFIG_NAME);
237578
- return JSON.parse(import_fs5.default.readFileSync(publisherConfigPath, "utf8"));
237578
+ const rawConfig = JSON.parse(import_fs5.default.readFileSync(publisherConfigPath, "utf8"));
237579
+ if (rawConfig.projects && typeof rawConfig.projects === "object" && !Array.isArray(rawConfig.projects)) {
237580
+ throw new Error("Config has changed. Please update your config to the new format.");
237581
+ }
237582
+ return rawConfig;
237579
237583
  };
237580
237584
  var isPublisherConfigFrozen = (serverRoot) => {
237581
237585
  const publisherConfig = getPublisherConfig(serverRoot);
@@ -237815,13 +237819,20 @@ async function readConnectionConfig(basePath) {
237815
237819
  async function createConnections(basePath, defaultConnections = []) {
237816
237820
  const connectionMap = new Map;
237817
237821
  const connectionConfig = await readConnectionConfig(basePath);
237818
- for (const connection of [...defaultConnections, ...connectionConfig]) {
237822
+ const allConnections = [...defaultConnections, ...connectionConfig];
237823
+ const processedConnections = new Set;
237824
+ const apiConnections = [];
237825
+ for (const connection of allConnections) {
237826
+ if (connection.name && processedConnections.has(connection.name)) {
237827
+ continue;
237828
+ }
237819
237829
  logger2.info(`Adding connection ${connection.name}`, {
237820
237830
  connection
237821
237831
  });
237822
237832
  if (!connection.name) {
237823
237833
  throw "Invalid connection configuration. No name.";
237824
237834
  }
237835
+ processedConnections.add(connection.name);
237825
237836
  switch (connection.type) {
237826
237837
  case "postgres": {
237827
237838
  const configReader = async () => {
@@ -237933,10 +237944,11 @@ async function createConnections(basePath, defaultConnections = []) {
237933
237944
  throw new Error(`Unsupported connection type: ${connection.type}`);
237934
237945
  }
237935
237946
  }
237947
+ apiConnections.push(connection);
237936
237948
  }
237937
237949
  return {
237938
237950
  malloyConnections: connectionMap,
237939
- apiConnections: connectionConfig
237951
+ apiConnections
237940
237952
  };
237941
237953
  }
237942
237954
  function getConnectionAttributes(connection) {
@@ -238748,6 +238760,7 @@ class Package {
238748
238760
  class Project {
238749
238761
  packages = new Map;
238750
238762
  packageMutexes = new Map;
238763
+ packageStatuses = new Map;
238751
238764
  malloyConnections;
238752
238765
  apiConnections;
238753
238766
  internalConnections;
@@ -238768,28 +238781,33 @@ class Project {
238768
238781
  this.reloadProjectMetadata();
238769
238782
  }
238770
238783
  async update(payload) {
238771
- if (payload.name) {
238772
- this.projectName = payload.name;
238773
- this.packages.forEach((_package) => {
238774
- _package.setProjectName(this.projectName);
238775
- });
238776
- this.metadata.name = this.projectName;
238784
+ if (payload.readme !== undefined) {
238785
+ this.metadata.readme = payload.readme;
238777
238786
  }
238778
- if (payload.resource) {
238779
- this.projectPath = payload.resource.replace(`${API_PREFIX}/projects/`, "");
238780
- if (!await fs8.promises.exists(this.projectPath)) {
238781
- throw new ProjectNotFoundError(`Project path "${this.projectPath}" not found`);
238782
- }
238783
- this.metadata.resource = payload.resource;
238787
+ if (payload.connections) {
238788
+ logger2.info(`Updating ${payload.connections.length} connections for project ${this.projectName}`);
238789
+ const { malloyConnections, apiConnections } = await createConnections(this.projectPath, payload.connections);
238790
+ this.malloyConnections = malloyConnections;
238791
+ this.apiConnections = apiConnections;
238792
+ this.internalConnections = apiConnections;
238793
+ logger2.info(`Successfully updated connections for project ${this.projectName}`, {
238794
+ malloyConnections: malloyConnections.size,
238795
+ apiConnections: apiConnections.length,
238796
+ internalConnections: apiConnections.length
238797
+ });
238784
238798
  }
238785
- this.metadata.readme = payload.readme;
238786
238799
  return this;
238787
238800
  }
238788
238801
  static async create(projectName, projectPath, defaultConnections) {
238789
238802
  if (!(await fs8.promises.stat(projectPath)).isDirectory()) {
238790
238803
  throw new ProjectNotFoundError(`Project path ${projectPath} not found`);
238791
238804
  }
238792
- const { malloyConnections, apiConnections } = await createConnections(projectPath, defaultConnections);
238805
+ let malloyConnections = new Map;
238806
+ let apiConnections = [];
238807
+ logger2.info(`Creating project with connection configuration`);
238808
+ const result = await createConnections(projectPath, defaultConnections);
238809
+ malloyConnections = result.malloyConnections;
238810
+ apiConnections = result.apiConnections;
238793
238811
  logger2.info(`Loaded ${malloyConnections.size + apiConnections.length} connections for project ${projectName}`, {
238794
238812
  malloyConnections,
238795
238813
  apiConnections
@@ -238848,14 +238866,18 @@ class Project {
238848
238866
  const packageDirectories = files.filter((file) => file.isDirectory() && fs8.existsSync(path6.join(this.projectPath, file.name, PACKAGE_MANIFEST_NAME)));
238849
238867
  const packageMetadata = await Promise.all(packageDirectories.map(async (directory) => {
238850
238868
  try {
238851
- return (await this.getPackage(directory.name, false)).getPackageMetadata();
238869
+ return (this.packageStatuses.get(directory.name)?.status === "loading" /* LOADING */ ? undefined : await this.getPackage(directory.name, false))?.getPackageMetadata();
238852
238870
  } catch (error) {
238853
238871
  logger2.error(`Failed to load package: ${directory.name} due to : ${error}`);
238854
238872
  return;
238855
238873
  }
238856
238874
  }));
238857
238875
  const filteredMetadata = packageMetadata.filter((metadata) => metadata);
238858
- return filteredMetadata;
238876
+ const finalMetadata = filteredMetadata.filter((metadata) => {
238877
+ const packageStatus = this.packageStatuses.get(metadata.name || "");
238878
+ return packageStatus?.status !== "unloading" /* UNLOADING */;
238879
+ });
238880
+ return finalMetadata;
238859
238881
  } catch (error) {
238860
238882
  logger2.error("Error listing packages", { error });
238861
238883
  console.error(error);
@@ -238863,41 +238885,56 @@ class Project {
238863
238885
  }
238864
238886
  }
238865
238887
  async getPackage(packageName, reload = false) {
238888
+ const _package = this.packages.get(packageName);
238889
+ if (_package !== undefined && !reload) {
238890
+ return _package;
238891
+ }
238866
238892
  let packageMutex = this.packageMutexes.get(packageName);
238867
238893
  if (packageMutex?.isLocked()) {
238868
238894
  await packageMutex.waitForUnlock();
238869
- return this.packages.get(packageName);
238895
+ const existingPackage = this.packages.get(packageName);
238896
+ if (existingPackage) {
238897
+ return existingPackage;
238898
+ }
238870
238899
  }
238871
238900
  packageMutex = new Mutex;
238872
238901
  this.packageMutexes.set(packageName, packageMutex);
238873
238902
  return packageMutex.runExclusive(async () => {
238874
- const _package = this.packages.get(packageName);
238875
- if (_package !== undefined && !reload) {
238876
- return _package;
238903
+ const existingPackage = this.packages.get(packageName);
238904
+ if (existingPackage !== undefined && !reload) {
238905
+ return existingPackage;
238877
238906
  }
238907
+ this.setPackageStatus(packageName, "loading" /* LOADING */);
238878
238908
  try {
238879
238909
  const _package2 = await Package.create(this.projectName, packageName, path6.join(this.projectPath, packageName), this.malloyConnections);
238880
238910
  this.packages.set(packageName, _package2);
238911
+ this.setPackageStatus(packageName, "serving" /* SERVING */);
238881
238912
  return _package2;
238882
238913
  } catch (error) {
238883
238914
  this.packages.delete(packageName);
238915
+ this.packageStatuses.delete(packageName);
238884
238916
  throw error;
238885
- } finally {
238886
- packageMutex.release();
238887
- this.packageMutexes.delete(packageName);
238888
238917
  }
238889
238918
  });
238890
238919
  }
238891
238920
  async addPackage(packageName) {
238892
238921
  const packagePath = path6.join(this.projectPath, packageName);
238893
- if (!await fs8.promises.exists(packagePath) || !(await fs8.promises.stat(packagePath)).isDirectory()) {
238922
+ if (!await fs8.promises.access(packagePath).then(() => true).catch(() => false) || !(await fs8.promises.stat(packagePath)).isDirectory()) {
238894
238923
  throw new PackageNotFoundError(`Package ${packageName} not found`);
238895
238924
  }
238896
238925
  logger2.info(`Adding package ${packageName} to project ${this.projectName}`, {
238897
238926
  packagePath,
238898
238927
  malloyConnections: this.malloyConnections
238899
238928
  });
238900
- this.packages.set(packageName, await Package.create(this.projectName, packageName, packagePath, this.malloyConnections));
238929
+ this.setPackageStatus(packageName, "loading" /* LOADING */);
238930
+ try {
238931
+ this.packages.set(packageName, await Package.create(this.projectName, packageName, packagePath, this.malloyConnections));
238932
+ } catch (error) {
238933
+ logger2.error("Error adding package", { error });
238934
+ this.deletePackageStatus(packageName);
238935
+ throw error;
238936
+ }
238937
+ this.setPackageStatus(packageName, "serving" /* SERVING */);
238901
238938
  return this.packages.get(packageName);
238902
238939
  }
238903
238940
  async updatePackage(packageName, body) {
@@ -238916,15 +238953,45 @@ class Project {
238916
238953
  });
238917
238954
  return _package.getPackageMetadata();
238918
238955
  }
238956
+ getPackageStatus(packageName) {
238957
+ return this.packageStatuses.get(packageName);
238958
+ }
238959
+ setPackageStatus(packageName, status) {
238960
+ const currentStatus = this.packageStatuses.get(packageName);
238961
+ this.packageStatuses.set(packageName, {
238962
+ name: packageName,
238963
+ loadTimestamp: currentStatus?.loadTimestamp || Date.now(),
238964
+ status
238965
+ });
238966
+ }
238967
+ deletePackageStatus(packageName) {
238968
+ this.packageStatuses.delete(packageName);
238969
+ }
238919
238970
  async deletePackage(packageName) {
238920
238971
  const _package = this.packages.get(packageName);
238921
238972
  if (!_package) {
238922
238973
  return;
238923
238974
  }
238924
- await fs8.promises.rm(path6.join(this.projectPath, packageName), {
238925
- recursive: true
238926
- });
238975
+ const packageStatus = this.packageStatuses.get(packageName);
238976
+ if (packageStatus?.status === "loading" /* LOADING */) {
238977
+ logger2.error("Package loading. Can't unload.", {
238978
+ projectName: this.projectName,
238979
+ packageName
238980
+ });
238981
+ throw new Error("Package loading. Can't unload. " + this.projectName + " " + packageName);
238982
+ } else if (packageStatus?.status === "serving" /* SERVING */) {
238983
+ this.setPackageStatus(packageName, "unloading" /* UNLOADING */);
238984
+ }
238985
+ try {
238986
+ await fs8.promises.rm(path6.join(this.projectPath, packageName), {
238987
+ recursive: true,
238988
+ force: true
238989
+ });
238990
+ } catch (err) {
238991
+ logger2.error("Error removing package directory while unloading package", { error: err, projectName: this.projectName, packageName });
238992
+ }
238927
238993
  this.packages.delete(packageName);
238994
+ this.packageStatuses.delete(packageName);
238928
238995
  }
238929
238996
  async serialize() {
238930
238997
  return {
@@ -238941,12 +239008,14 @@ class ProjectStore {
238941
239008
  projects = new Map;
238942
239009
  publisherConfigIsFrozen;
238943
239010
  finishedInitialization;
239011
+ isInitialized = false;
238944
239012
  s3Client = new import_client_s3.S3({
238945
239013
  followRegionRedirects: true
238946
239014
  });
238947
- gcsClient = new import_storage.Storage;
239015
+ gcsClient;
238948
239016
  constructor(serverRootPath) {
238949
239017
  this.serverRootPath = serverRootPath;
239018
+ this.gcsClient = new import_storage.Storage;
238950
239019
  this.finishedInitialization = this.initialize();
238951
239020
  }
238952
239021
  async initialize() {
@@ -238955,15 +239024,15 @@ class ProjectStore {
238955
239024
  this.publisherConfigIsFrozen = isPublisherConfigFrozen(this.serverRootPath);
238956
239025
  const projectManifest = await ProjectStore.reloadProjectManifest(this.serverRootPath);
238957
239026
  logger2.info(`Initializing project store.`);
238958
- await Promise.all(Object.keys(projectManifest.projects).map(async (projectName) => {
238959
- logger2.info(`Adding project "${projectName}"`);
238960
- const project = await this.addProject({
238961
- name: projectName,
238962
- resource: `${API_PREFIX}/projects/${projectName}`,
238963
- location: projectManifest.projects[projectName]
239027
+ await Promise.all(projectManifest.projects.map(async (project) => {
239028
+ logger2.info(`Adding project "${project.name}"`);
239029
+ const projectInstance = await this.addProject({
239030
+ name: project.name,
239031
+ resource: `${API_PREFIX}/projects/${project.name}`
238964
239032
  }, true);
238965
- return project.listPackages();
239033
+ return projectInstance.listPackages();
238966
239034
  }));
239035
+ this.isInitialized = true;
238967
239036
  logger2.info(`Project store successfully initialized in ${performance.now() - initialTime}ms`);
238968
239037
  } catch (error) {
238969
239038
  logger2.error("Error initializing project store", { error });
@@ -238971,16 +239040,55 @@ class ProjectStore {
238971
239040
  process.exit(1);
238972
239041
  }
238973
239042
  }
238974
- async listProjects() {
238975
- await this.finishedInitialization;
239043
+ async listProjects(skipInitializationCheck = false) {
239044
+ if (!skipInitializationCheck) {
239045
+ await this.finishedInitialization;
239046
+ }
238976
239047
  return Promise.all(Array.from(this.projects.values()).map((project) => project.serialize()));
238977
239048
  }
239049
+ async getStatus() {
239050
+ const status = {
239051
+ timestamp: Date.now(),
239052
+ projects: [],
239053
+ initialized: this.isInitialized
239054
+ };
239055
+ const projects = await this.listProjects(true);
239056
+ await Promise.all(projects.map(async (project) => {
239057
+ try {
239058
+ const packages = project.packages;
239059
+ const connections = project.connections;
239060
+ logger2.info(`Project ${project.name} status:`, {
239061
+ connectionsCount: project.connections?.length || 0,
239062
+ packagesCount: packages?.length || 0
239063
+ });
239064
+ const _connections = connections?.map((connection) => {
239065
+ return {
239066
+ ...connection,
239067
+ attributes: undefined
239068
+ };
239069
+ });
239070
+ const _project = {
239071
+ ...project,
239072
+ connections: _connections
239073
+ };
239074
+ project.connections = _connections;
239075
+ status.projects.push(_project);
239076
+ } catch (error) {
239077
+ logger2.error("Error listing packages and connections", {
239078
+ error
239079
+ });
239080
+ throw new Error("Error listing packages and connections: " + error);
239081
+ }
239082
+ }));
239083
+ return status;
239084
+ }
238978
239085
  async getProject(projectName, reload = false) {
238979
239086
  await this.finishedInitialization;
238980
239087
  let project = this.projects.get(projectName);
238981
239088
  if (project === undefined || reload) {
238982
239089
  const projectManifest = await ProjectStore.reloadProjectManifest(this.serverRootPath);
238983
- const projectPath = project?.metadata.location || projectManifest.projects[projectName];
239090
+ const projectConfig = projectManifest.projects.find((p) => p.name === projectName);
239091
+ const projectPath = project?.metadata.location || projectConfig?.packages[0]?.location;
238984
239092
  if (!projectPath) {
238985
239093
  throw new ProjectNotFoundError(`Project "${projectName}" could not be resolved to a path.`);
238986
239094
  }
@@ -239002,11 +239110,20 @@ class ProjectStore {
239002
239110
  if (!projectName) {
239003
239111
  throw new Error("Project name is required");
239004
239112
  }
239113
+ const existingProject = this.projects.get(projectName);
239114
+ if (existingProject) {
239115
+ logger2.info(`Project ${projectName} already exists, updating it`);
239116
+ const updatedProject = await existingProject.update(project);
239117
+ this.projects.set(projectName, updatedProject);
239118
+ return updatedProject;
239119
+ }
239005
239120
  const projectManifest = await ProjectStore.reloadProjectManifest(this.serverRootPath);
239006
- const projectPath = project.location || projectManifest.projects[projectName];
239121
+ const projectConfig = projectManifest.projects.find((p) => p.name === projectName);
239122
+ const hasPackages = project?.packages && project.packages.length > 0 || projectConfig?.packages && projectConfig.packages.length > 0;
239007
239123
  let absoluteProjectPath;
239008
- if (projectPath) {
239009
- absoluteProjectPath = await this.loadProjectIntoDisk(projectName, projectPath);
239124
+ if (hasPackages) {
239125
+ const packagesToProcess = project?.packages || projectConfig?.packages || [];
239126
+ absoluteProjectPath = await this.loadProjectIntoDisk(projectName, projectName, packagesToProcess);
239010
239127
  if (absoluteProjectPath.endsWith(".zip")) {
239011
239128
  absoluteProjectPath = await this.unzipProject(absoluteProjectPath);
239012
239129
  }
@@ -239064,16 +239181,24 @@ class ProjectStore {
239064
239181
  } catch (error) {
239065
239182
  if (error.code !== "ENOENT") {
239066
239183
  logger2.error(`Error reading ${PUBLISHER_CONFIG_NAME}. Generating from directory`, { error });
239067
- return { projects: {} };
239184
+ return { projects: [] };
239068
239185
  } else {
239069
239186
  try {
239070
239187
  const entries = await fs9.promises.readdir(serverRootPath, {
239071
239188
  withFileTypes: true
239072
239189
  });
239073
- const projects = {};
239190
+ const projects = [];
239074
239191
  for (const entry of entries) {
239075
239192
  if (entry.isDirectory()) {
239076
- projects[entry.name] = entry.name;
239193
+ projects.push({
239194
+ name: entry.name,
239195
+ packages: [
239196
+ {
239197
+ name: entry.name,
239198
+ location: entry.name
239199
+ }
239200
+ ]
239201
+ });
239077
239202
  }
239078
239203
  }
239079
239204
  return { projects };
@@ -239081,7 +239206,7 @@ class ProjectStore {
239081
239206
  logger2.error(`Error listing directories in ${serverRootPath}`, {
239082
239207
  error: lsError
239083
239208
  });
239084
- return { projects: {} };
239209
+ return { projects: [] };
239085
239210
  }
239086
239211
  }
239087
239212
  }
@@ -239098,59 +239223,125 @@ class ProjectStore {
239098
239223
  }
239099
239224
  return absoluteProjectPath;
239100
239225
  }
239101
- async loadProjectIntoDisk(projectName, projectPath) {
239102
- const absoluteTargetPath = `${publisherPath}/${projectName}`;
239103
- if (projectPath.startsWith("/") || projectPath.startsWith("./")) {
239226
+ async loadProjectIntoDisk(projectName, projectPath, packages) {
239227
+ const absoluteTargetPath = `${publisherPath}/${projectPath}`;
239228
+ if (!packages || packages.length === 0) {
239229
+ throw new PackageNotFoundError(`No packages found for project ${projectName}`);
239230
+ }
239231
+ const locationGroups = new Map;
239232
+ for (const _package of packages) {
239233
+ if (!_package.name) {
239234
+ throw new PackageNotFoundError(`Package has no name specified`);
239235
+ }
239236
+ if (!_package.location) {
239237
+ throw new PackageNotFoundError(`Package ${_package.name} has no location specified`);
239238
+ }
239239
+ const location = _package.location;
239240
+ const packageName = _package.name;
239241
+ if (!locationGroups.has(location)) {
239242
+ locationGroups.set(location, []);
239243
+ }
239244
+ locationGroups.get(location).push({ name: packageName, location });
239245
+ }
239246
+ for (const [location, packagesForLocation] of locationGroups) {
239247
+ const tempDownloadPath = `${absoluteTargetPath}/.temp_${Buffer.from(location).toString("base64").replace(/[^a-zA-Z0-9]/g, "")}`;
239248
+ await fs9.promises.mkdir(tempDownloadPath, { recursive: true });
239249
+ try {
239250
+ await this.downloadOrMountLocation(location, tempDownloadPath, projectName, "shared");
239251
+ for (const _package of packagesForLocation) {
239252
+ const packageDir = _package.name;
239253
+ const absolutePackagePath = `${absoluteTargetPath}/${packageDir}`;
239254
+ const packagePathInDownload = path7.join(tempDownloadPath, packageDir);
239255
+ const packageExists = await fs9.promises.access(packagePathInDownload).then(() => true).catch(() => false);
239256
+ if (packageExists) {
239257
+ await fs9.promises.mkdir(absolutePackagePath, {
239258
+ recursive: true
239259
+ });
239260
+ await fs9.promises.cp(packagePathInDownload, absolutePackagePath, { recursive: true });
239261
+ logger2.info(`Extracted package "${packageDir}" from shared download`);
239262
+ } else {
239263
+ await fs9.promises.mkdir(absolutePackagePath, {
239264
+ recursive: true
239265
+ });
239266
+ await fs9.promises.cp(tempDownloadPath, absolutePackagePath, {
239267
+ recursive: true
239268
+ });
239269
+ logger2.info(`Copied entire download as package "${packageDir}"`);
239270
+ }
239271
+ }
239272
+ const connectionsFileInDownload = path7.join(tempDownloadPath, CONNECTIONS_MANIFEST_NAME);
239273
+ const connectionsFileInProject = path7.join(absoluteTargetPath, CONNECTIONS_MANIFEST_NAME);
239274
+ try {
239275
+ await fs9.promises.access(connectionsFileInDownload, fs9.constants.F_OK);
239276
+ await fs9.promises.cp(connectionsFileInDownload, connectionsFileInProject);
239277
+ logger2.info(`Copied ${CONNECTIONS_MANIFEST_NAME} to project directory`);
239278
+ } catch (error) {
239279
+ console.error(error);
239280
+ logger2.info(`No ${CONNECTIONS_MANIFEST_NAME} found`);
239281
+ }
239282
+ } finally {
239283
+ await fs9.promises.rm(tempDownloadPath, {
239284
+ recursive: true,
239285
+ force: true
239286
+ });
239287
+ }
239288
+ }
239289
+ return absoluteTargetPath;
239290
+ }
239291
+ async downloadOrMountLocation(location, targetPath, projectName, packageName) {
239292
+ if (location.startsWith("/")) {
239104
239293
  try {
239105
- logger2.info(`Mounting local directory at "${projectPath}"`);
239106
- await this.mountLocalDirectory(projectPath, absoluteTargetPath, projectName);
239107
- return absoluteTargetPath;
239294
+ logger2.info(`Mounting local directory at "${location}" to "${targetPath}"`);
239295
+ await this.mountLocalDirectory(location, targetPath, projectName, packageName);
239296
+ return;
239108
239297
  } catch (error) {
239109
- logger2.error(`Failed to mount local directory "${projectPath}"`, {
239298
+ logger2.error(`Failed to mount local directory "${location}"`, {
239110
239299
  error
239111
239300
  });
239112
- throw error;
239301
+ throw new PackageNotFoundError(`Failed to mount local directory: ${location}`);
239113
239302
  }
239114
239303
  }
239115
- if (projectPath.startsWith("gs://")) {
239304
+ if (location.startsWith("gs://")) {
239116
239305
  try {
239117
- logger2.info(`Downloading GCS path "${projectPath}" to "${absoluteTargetPath}"`);
239118
- await this.downloadGcsDirectory(projectPath, projectName, absoluteTargetPath);
239306
+ logger2.info(`Downloading GCS directory from "${location}" to "${targetPath}"`);
239307
+ await this.downloadGcsDirectory(location, projectName, targetPath);
239308
+ return;
239119
239309
  } catch (error) {
239120
- logger2.error(`Failed to download GCS path "${projectPath}"`, {
239310
+ logger2.error(`Failed to download GCS directory "${location}"`, {
239121
239311
  error
239122
239312
  });
239123
- throw error;
239313
+ throw new PackageNotFoundError(`Failed to download GCS directory: ${location}`);
239124
239314
  }
239125
- return absoluteTargetPath;
239126
239315
  }
239127
- if (projectPath.startsWith("s3://")) {
239316
+ if (location.startsWith("https://github.com/") || location.startsWith("git@")) {
239128
239317
  try {
239129
- logger2.info(`Mounting S3 path "${projectPath}"`);
239130
- await this.downloadS3Directory(projectPath, projectName, absoluteTargetPath);
239131
- return absoluteTargetPath;
239318
+ logger2.info(`Cloning GitHub repository from "${location}" to "${targetPath}"`);
239319
+ await this.downloadGitHubDirectory(location, targetPath);
239320
+ return;
239132
239321
  } catch (error) {
239133
- logger2.error(`Failed to mount S3 path "${projectPath}"`, { error });
239134
- throw error;
239322
+ logger2.error(`Failed to clone GitHub repository "${location}"`, {
239323
+ error
239324
+ });
239325
+ throw new PackageNotFoundError(`Failed to clone GitHub repository: ${location}`);
239135
239326
  }
239136
239327
  }
239137
- if (projectPath.startsWith("https://github.com/") || projectPath.startsWith("git@")) {
239328
+ if (location.startsWith("s3://")) {
239138
239329
  try {
239139
- logger2.info(`Mounting GitHub path "${projectPath}"`);
239140
- await this.downloadGitHubDirectory(projectPath, absoluteTargetPath);
239141
- return absoluteTargetPath;
239330
+ logger2.info(`Downloading S3 directory from "${location}" to "${targetPath}"`);
239331
+ await this.downloadS3Directory(location, projectName, targetPath);
239332
+ return;
239142
239333
  } catch (error) {
239143
- logger2.error(`Failed to mount GitHub path "${projectPath}"`, {
239334
+ logger2.error(`Failed to download S3 directory "${location}"`, {
239144
239335
  error
239145
239336
  });
239146
- throw error;
239337
+ throw new PackageNotFoundError(`Failed to download S3 directory: ${location}`);
239147
239338
  }
239148
239339
  }
239149
- const errorMsg = `Invalid project path: "${projectPath}". Paths must start with "/" or "./" or a GCS/S3/GitHub URI.`;
239150
- logger2.error(errorMsg, { projectName, projectPath });
239151
- throw new ProjectNotFoundError(errorMsg);
239340
+ const errorMsg = `Invalid package path: "${location}". Must be an absolute mounted path or a GCS/S3/GitHub URI.`;
239341
+ logger2.error(errorMsg, { projectName, location });
239342
+ throw new PackageNotFoundError(errorMsg);
239152
239343
  }
239153
- async mountLocalDirectory(projectPath, absoluteTargetPath, projectName) {
239344
+ async mountLocalDirectory(projectPath, absoluteTargetPath, projectName, packageName) {
239154
239345
  if (projectPath.endsWith(".zip")) {
239155
239346
  projectPath = await this.unzipProject(projectPath);
239156
239347
  }
@@ -239165,7 +239356,7 @@ class ProjectStore {
239165
239356
  recursive: true
239166
239357
  });
239167
239358
  } else {
239168
- throw new ProjectNotFoundError(`Project ${projectName} not found in "${projectPath}"`);
239359
+ throw new PackageNotFoundError(`Package ${packageName} for project ${projectName} not found in "${projectPath}"`);
239169
239360
  }
239170
239361
  }
239171
239362
  async downloadGcsDirectory(gcsPath, projectName, absoluteDirPath) {
@@ -239273,14 +239464,21 @@ class WatchModeController {
239273
239464
  startWatching = async (req, res) => {
239274
239465
  const projectManifest = await ProjectStore.reloadProjectManifest(this.projectStore.serverRootPath);
239275
239466
  this.watchingProjectName = req.body.projectName;
239276
- this.watchingPath = import_path4.default.join(this.projectStore.serverRootPath, projectManifest.projects[req.body.projectName]);
239467
+ const project = projectManifest.projects.find((p) => p.name === req.body.projectName);
239468
+ if (!project || !project.packages || project.packages.length === 0) {
239469
+ res.status(404).json({
239470
+ error: `Project ${req.body.projectName} not found or has no packages`
239471
+ });
239472
+ return;
239473
+ }
239474
+ this.watchingPath = import_path4.default.join(this.projectStore.serverRootPath, req.body.projectName);
239277
239475
  this.watcher = esm_default.watch(this.watchingPath, {
239278
239476
  ignored: (path9, stats) => !!stats?.isFile() && !path9.endsWith(".malloy") && !path9.endsWith(".md"),
239279
239477
  ignoreInitial: true
239280
239478
  });
239281
239479
  const reloadProject = async () => {
239282
- const project = await this.projectStore.getProject(req.body.projectName, true);
239283
- await this.projectStore.addProject(project.metadata);
239480
+ const project2 = await this.projectStore.getProject(req.body.projectName, true);
239481
+ await this.projectStore.addProject(project2.metadata);
239284
239482
  logger2.info(`Reloaded ${req.body.projectName}`);
239285
239483
  };
239286
239484
  this.watcher.on("add", async (path9) => {
@@ -242428,7 +242626,7 @@ async function handleGetPackageContents(uri, params, projectStore) {
242428
242626
  }
242429
242627
  const project = await projectStore.getProject(projectName, false);
242430
242628
  const packageInstance = await project.getPackage(packageName, false);
242431
- const entries = packageInstance.listModels();
242629
+ const entries = await packageInstance.listModels();
242432
242630
  const resourceDefinitions = [];
242433
242631
  for (const entry of entries) {
242434
242632
  const entryPath = entry.path;
@@ -243271,10 +243469,14 @@ var setVersionIdError = (res) => {
243271
243469
  app.use(import_cors.default());
243272
243470
  app.use(bodyParser.json());
243273
243471
  app.get(`${API_PREFIX2}/status`, async (_req, res) => {
243274
- res.status(200).json({
243275
- timestamp: Date.now(),
243276
- projects: await projectStore.listProjects()
243277
- });
243472
+ try {
243473
+ const status = await projectStore.getStatus();
243474
+ res.status(200).json(status);
243475
+ } catch (error) {
243476
+ logger2.error("Error getting status", { error });
243477
+ const { json: json2, status } = internalErrorToHttpError(error);
243478
+ res.status(status).json(json2);
243479
+ }
243278
243480
  });
243279
243481
  app.get(`${API_PREFIX2}/watch-mode/status`, watchModeController.getWatchStatus);
243280
243482
  app.post(`${API_PREFIX2}/watch-mode/start`, watchModeController.startWatching);