@powerhousedao/workflow 6.2.3-dev.24 → 6.2.3-dev.25

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/README.md +37 -0
  2. package/dist/browser/BlockSelector-QQgOCVH3.js +1355 -0
  3. package/dist/browser/BlockSelector-QQgOCVH3.js.map +1 -0
  4. package/dist/browser/{PieceMarkdown-CZYNY1qQ.js → PieceMarkdown-BY_aQD0M.js} +120 -86
  5. package/dist/browser/PieceMarkdown-BY_aQD0M.js.map +1 -0
  6. package/dist/browser/assets/{entry-CSJBrcX5.js → entry-GDzXcBs1.js} +2 -3
  7. package/dist/browser/assets/{projection-entry-D67cdPsg.js → projection-entry-BJpyPvov.js} +7 -13
  8. package/dist/browser/{connection-DEe5aDuU.js → connection-BUum0hJI.js} +2 -2
  9. package/dist/browser/{connection-DEe5aDuU.js.map → connection-BUum0hJI.js.map} +1 -1
  10. package/dist/browser/connection-form-XKR4zQgQ.js +533 -0
  11. package/dist/browser/connection-form-XKR4zQgQ.js.map +1 -0
  12. package/dist/browser/data-tree-DKrDFeQg.js +1896 -0
  13. package/dist/browser/data-tree-DKrDFeQg.js.map +1 -0
  14. package/dist/browser/document-models/connection/index.js +2 -2
  15. package/dist/browser/document-models/index.js +3 -3
  16. package/dist/browser/document-models/workflow/index.js +2 -2
  17. package/dist/browser/{document-models-BYheX-te.js → document-models-C6ebrsd9.js} +3 -3
  18. package/dist/browser/{document-models-BYheX-te.js.map → document-models-C6ebrsd9.js.map} +1 -1
  19. package/dist/browser/{editor-D0sdUxJa.js → editor-BxtfhdPP.js} +3348 -1610
  20. package/dist/browser/editor-BxtfhdPP.js.map +1 -0
  21. package/dist/browser/editor-C_E_JTp6.js +257 -0
  22. package/dist/browser/editor-C_E_JTp6.js.map +1 -0
  23. package/dist/browser/editor-kbIdHU7F.js +1511 -0
  24. package/dist/browser/editor-kbIdHU7F.js.map +1 -0
  25. package/dist/browser/editors/connection-editor/module.js +1 -1
  26. package/dist/browser/editors/connection-editor/module.js.map +1 -1
  27. package/dist/browser/editors/workflow-editor/module.js +1 -1
  28. package/dist/browser/editors/workflow-editor/module.js.map +1 -1
  29. package/dist/browser/editors/workflow-studio/module.js +1 -1
  30. package/dist/browser/editors/workflow-studio/module.js.map +1 -1
  31. package/dist/browser/index.js +7 -5
  32. package/dist/browser/index.js.map +1 -1
  33. package/dist/browser/{module-CYQnNZWl.js → module-Bkms70LV.js} +3 -3
  34. package/dist/browser/{module-CYQnNZWl.js.map → module-Bkms70LV.js.map} +1 -1
  35. package/dist/{node/module-IA-Ay7ig.mjs → browser/module-jDZ4pq3W.js} +2 -2
  36. package/dist/browser/{module-12vI18HY.js.map → module-jDZ4pq3W.js.map} +1 -1
  37. package/dist/browser/piece-auth-Z4mZEOtL.js +113 -0
  38. package/dist/browser/piece-auth-Z4mZEOtL.js.map +1 -0
  39. package/dist/browser/reactor/index.js +2 -2
  40. package/dist/browser/{chunk-BoAXSpZd.js → rolldown-runtime-DC62tzP2.js} +2 -2
  41. package/dist/browser/{runtime-api-DKlnn45K.js → runtime-api-xwvg5PzA.js} +40 -123
  42. package/dist/browser/runtime-api-xwvg5PzA.js.map +1 -0
  43. package/dist/browser/style.css +26 -0
  44. package/dist/browser/trigger-text-CdNxQOHw.js +551 -0
  45. package/dist/browser/trigger-text-CdNxQOHw.js.map +1 -0
  46. package/dist/browser/upgrade-manifests-BLrv3cf2.js +8 -0
  47. package/dist/browser/{upgrade-manifests-Cnpfo6kC.js.map → upgrade-manifests-BLrv3cf2.js.map} +1 -1
  48. package/dist/browser/{workflow-CFZUezoY.js → workflow-CGtVlhr8.js} +2 -2
  49. package/dist/browser/{workflow-CFZUezoY.js.map → workflow-CGtVlhr8.js.map} +1 -1
  50. package/dist/node/BlockSelector-COZm6-ev.mjs +1355 -0
  51. package/dist/node/BlockSelector-COZm6-ev.mjs.map +1 -0
  52. package/dist/node/{PieceMarkdown-D9nI2gI2.mjs → PieceMarkdown-Ejo9UTqJ.mjs} +113 -81
  53. package/dist/node/PieceMarkdown-Ejo9UTqJ.mjs.map +1 -0
  54. package/dist/node/{connection-DGsS2Db3.mjs → connection-D544oqVW.mjs} +2 -2
  55. package/dist/node/{connection-DGsS2Db3.mjs.map → connection-D544oqVW.mjs.map} +1 -1
  56. package/dist/node/connection-form-BLduFusc.mjs +533 -0
  57. package/dist/node/connection-form-BLduFusc.mjs.map +1 -0
  58. package/dist/node/data-tree-CmiGqG7C.mjs +1903 -0
  59. package/dist/node/data-tree-CmiGqG7C.mjs.map +1 -0
  60. package/dist/node/document-models/connection/index.mjs +2 -2
  61. package/dist/node/document-models/index.mjs +3 -3
  62. package/dist/node/document-models/workflow/index.mjs +2 -2
  63. package/dist/node/editor-BNgGzvAL.mjs +1511 -0
  64. package/dist/node/editor-BNgGzvAL.mjs.map +1 -0
  65. package/dist/node/{editor-sVzt1o51.mjs → editor-CLDjPgdl.mjs} +3200 -1508
  66. package/dist/node/editor-CLDjPgdl.mjs.map +1 -0
  67. package/dist/node/editor-CN4PEGrW.mjs +257 -0
  68. package/dist/node/editor-CN4PEGrW.mjs.map +1 -0
  69. package/dist/node/editors/connection-editor/module.mjs +1 -1
  70. package/dist/node/editors/connection-editor/module.mjs.map +1 -1
  71. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  72. package/dist/node/editors/workflow-editor/module.mjs.map +1 -1
  73. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  74. package/dist/node/editors/workflow-studio/module.mjs.map +1 -1
  75. package/dist/node/index.mjs +8 -6
  76. package/dist/node/index.mjs.map +1 -1
  77. package/dist/{browser/module-12vI18HY.js → node/module-BMwJQh65.mjs} +2 -2
  78. package/dist/node/{module-IA-Ay7ig.mjs.map → module-BMwJQh65.mjs.map} +1 -1
  79. package/dist/node/{module-IRMgzJC1.mjs → module-DuxxhgKs.mjs} +3 -3
  80. package/dist/node/{module-IRMgzJC1.mjs.map → module-DuxxhgKs.mjs.map} +1 -1
  81. package/dist/node/piece-auth-Z4mZEOtL.mjs +113 -0
  82. package/dist/node/piece-auth-Z4mZEOtL.mjs.map +1 -0
  83. package/dist/node/pieces/index.mjs.map +1 -1
  84. package/dist/node/pieces/reactor/index.mjs +226 -488
  85. package/dist/node/pieces/reactor/index.mjs.map +1 -1
  86. package/dist/node/{chunk-BSw8zbkd.mjs → rolldown-runtime-BMI-E3GI.mjs} +11 -4
  87. package/dist/node/{runtime-api-CtvvFHut.mjs → runtime-api-xwvg5PzA.mjs} +40 -123
  88. package/dist/node/runtime-api-xwvg5PzA.mjs.map +1 -0
  89. package/dist/node/style.css +26 -0
  90. package/dist/node/trigger-text-qj_U3Qzd.mjs +551 -0
  91. package/dist/node/trigger-text-qj_U3Qzd.mjs.map +1 -0
  92. package/dist/node/upgrade-manifests-C1sl_M-H.mjs +8 -0
  93. package/dist/node/{upgrade-manifests-3VN0Bfcf.mjs.map → upgrade-manifests-C1sl_M-H.mjs.map} +1 -1
  94. package/dist/node/{workflow-fFvyypuu.mjs → workflow-C-uuQPnf.mjs} +2 -2
  95. package/dist/node/{workflow-fFvyypuu.mjs.map → workflow-C-uuQPnf.mjs.map} +1 -1
  96. package/dist/style.css +927 -252
  97. package/dist/types/document-models/connection/upgrades/versions.d.ts.map +1 -1
  98. package/dist/types/document-models/connection/v1/actions.d.ts +6 -10
  99. package/dist/types/document-models/connection/v1/actions.d.ts.map +1 -1
  100. package/dist/types/document-models/connection/v1/gen/config/creators.d.ts.map +1 -1
  101. package/dist/types/document-models/connection/v1/gen/config/error.d.ts.map +1 -1
  102. package/dist/types/document-models/connection/v1/gen/connection/creators.d.ts.map +1 -1
  103. package/dist/types/document-models/connection/v1/gen/health/creators.d.ts.map +1 -1
  104. package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts.map +1 -1
  105. package/dist/types/document-models/connection/v1/module.d.ts +6 -10
  106. package/dist/types/document-models/connection/v1/module.d.ts.map +1 -1
  107. package/dist/types/document-models/connection/v1/tests/document-model.test.d.ts +0 -8
  108. package/dist/types/document-models/connection/v1/tests/document-model.test.d.ts.map +1 -1
  109. package/dist/types/document-models/document-models.d.ts +15 -23
  110. package/dist/types/document-models/document-models.d.ts.map +1 -1
  111. package/dist/types/document-models/workflow/upgrades/versions.d.ts.map +1 -1
  112. package/dist/types/document-models/workflow/v1/actions.d.ts +9 -13
  113. package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
  114. package/dist/types/document-models/workflow/v1/gen/edges/creators.d.ts.map +1 -1
  115. package/dist/types/document-models/workflow/v1/gen/edges/error.d.ts.map +1 -1
  116. package/dist/types/document-models/workflow/v1/gen/policy/creators.d.ts.map +1 -1
  117. package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts.map +1 -1
  118. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
  119. package/dist/types/document-models/workflow/v1/gen/steps/creators.d.ts.map +1 -1
  120. package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts.map +1 -1
  121. package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts.map +1 -1
  122. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
  123. package/dist/types/document-models/workflow/v1/gen/variables/creators.d.ts.map +1 -1
  124. package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts.map +1 -1
  125. package/dist/types/document-models/workflow/v1/gen/workflow/creators.d.ts.map +1 -1
  126. package/dist/types/document-models/workflow/v1/module.d.ts +9 -13
  127. package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
  128. package/dist/types/document-models/workflow/v1/tests/document-model.test.d.ts +0 -8
  129. package/dist/types/document-models/workflow/v1/tests/document-model.test.d.ts.map +1 -1
  130. package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts +2 -0
  131. package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -1
  132. package/dist/types/editors/connection-editor/UsedBy.d.ts +6 -0
  133. package/dist/types/editors/connection-editor/UsedBy.d.ts.map +1 -0
  134. package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
  135. package/dist/types/editors/connection-editor/connection-callbacks.test.d.ts +2 -0
  136. package/dist/types/editors/connection-editor/connection-callbacks.test.d.ts.map +1 -0
  137. package/dist/types/editors/connection-editor/connection-form.d.ts +5 -1
  138. package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
  139. package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -0
  140. package/dist/types/editors/connection-editor/connection-usage.test.d.ts.map +1 -0
  141. package/dist/types/editors/connection-editor/editor.d.ts.map +1 -1
  142. package/dist/types/editors/connection-editor/piece-auth.d.ts +2 -0
  143. package/dist/types/editors/connection-editor/piece-auth.d.ts.map +1 -1
  144. package/dist/types/editors/connection-editor/status.d.ts +3 -1
  145. package/dist/types/editors/connection-editor/status.d.ts.map +1 -1
  146. package/dist/types/editors/shared/DocumentErrorBoundary.d.ts.map +1 -1
  147. package/dist/types/editors/shared/controls.d.ts +98 -0
  148. package/dist/types/editors/shared/controls.d.ts.map +1 -0
  149. package/dist/types/editors/shared/data-tree.d.ts +5 -0
  150. package/dist/types/editors/shared/data-tree.d.ts.map +1 -0
  151. package/dist/types/editors/shared/data-viewer.d.ts +7 -0
  152. package/dist/types/editors/shared/data-viewer.d.ts.map +1 -0
  153. package/dist/types/editors/shared/editor-chrome.d.ts +7 -0
  154. package/dist/types/editors/shared/editor-chrome.d.ts.map +1 -0
  155. package/dist/types/editors/shared/icons.d.ts +36 -0
  156. package/dist/types/editors/shared/icons.d.ts.map +1 -0
  157. package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
  158. package/dist/types/editors/workflow-editor/runtime-api.d.ts +2 -0
  159. package/dist/types/editors/workflow-editor/runtime-api.d.ts.map +1 -1
  160. package/dist/types/editors/workflow-editor/ui/ActionListEditor.d.ts.map +1 -1
  161. package/dist/types/editors/workflow-editor/ui/Autocomplete.d.ts +1 -0
  162. package/dist/types/editors/workflow-editor/ui/Autocomplete.d.ts.map +1 -1
  163. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts +1 -0
  164. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -1
  165. package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts.map +1 -1
  166. package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts +1 -1
  167. package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -1
  168. package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts.map +1 -1
  169. package/dist/types/editors/workflow-editor/ui/PieceMarkdown.d.ts.map +1 -1
  170. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
  171. package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts +5 -0
  172. package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -0
  173. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +1 -0
  174. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
  175. package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts.map +1 -1
  176. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts +3 -0
  177. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
  178. package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -1
  179. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts +1 -0
  180. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -1
  181. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -1
  182. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +6 -0
  183. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -1
  184. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts +1 -1
  185. package/dist/types/editors/workflow-editor/ui/connection-create.d.ts.map +1 -1
  186. package/dist/types/editors/workflow-editor/ui/forms.d.ts +14 -0
  187. package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -1
  188. package/dist/types/editors/workflow-editor/ui/model.test.d.ts +2 -0
  189. package/dist/types/editors/workflow-editor/ui/model.test.d.ts.map +1 -0
  190. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts +35 -0
  191. package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts.map +1 -0
  192. package/dist/types/editors/workflow-editor/ui/schedule-draft.test.d.ts +2 -0
  193. package/dist/types/editors/workflow-editor/ui/schedule-draft.test.d.ts.map +1 -0
  194. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts +9 -0
  195. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -0
  196. package/dist/types/editors/workflow-editor/ui/trigger-text.test.d.ts +2 -0
  197. package/dist/types/editors/workflow-editor/ui/trigger-text.test.d.ts.map +1 -0
  198. package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
  199. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +2 -0
  200. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
  201. package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -1
  202. package/dist/types/editors/workflow-studio/components/Sidebar.d.ts +1 -1
  203. package/dist/types/editors/workflow-studio/components/Sidebar.d.ts.map +1 -1
  204. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts +8 -0
  205. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -0
  206. package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts.map +1 -1
  207. package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts.map +1 -1
  208. package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -1
  209. package/dist/types/editors/workflow-studio/components/chain.d.ts +18 -0
  210. package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -0
  211. package/dist/types/editors/workflow-studio/components/run-format.d.ts +29 -6
  212. package/dist/types/editors/workflow-studio/components/run-format.d.ts.map +1 -1
  213. package/dist/types/editors/workflow-studio/components/run-format.test.d.ts +2 -0
  214. package/dist/types/editors/workflow-studio/components/run-format.test.d.ts.map +1 -0
  215. package/dist/types/editors/workflow-studio/components/run-timeline.test.d.ts +2 -0
  216. package/dist/types/editors/workflow-studio/components/run-timeline.test.d.ts.map +1 -0
  217. package/dist/types/editors/workflow-studio/components/ui.d.ts +20 -0
  218. package/dist/types/editors/workflow-studio/components/ui.d.ts.map +1 -0
  219. package/dist/types/editors/workflow-studio/components/useRuns.d.ts +1 -1
  220. package/dist/types/editors/workflow-studio/components/useRuns.d.ts.map +1 -1
  221. package/dist/types/pieces/index.d.ts.map +1 -1
  222. package/dist/types/pieces/reactor/index.d.ts.map +1 -1
  223. package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -1
  224. package/dist/types/pieces/reactor/lib/triggers/document-event.d.ts +12 -12
  225. package/dist/types/playwright.config.d.ts +3 -0
  226. package/dist/types/playwright.config.d.ts.map +1 -0
  227. package/dist/types/scripts/ui-shots.d.ts +2 -0
  228. package/dist/types/scripts/ui-shots.d.ts.map +1 -0
  229. package/dist/types/scripts/ui-stack.d.ts +77 -0
  230. package/dist/types/scripts/ui-stack.d.ts.map +1 -0
  231. package/dist/types/test/ui/connection-editor.spec.d.ts +2 -0
  232. package/dist/types/test/ui/connection-editor.spec.d.ts.map +1 -0
  233. package/dist/types/test/ui/data-viewer.spec.d.ts +2 -0
  234. package/dist/types/test/ui/data-viewer.spec.d.ts.map +1 -0
  235. package/dist/types/test/ui/fixtures.d.ts +9 -0
  236. package/dist/types/test/ui/fixtures.d.ts.map +1 -0
  237. package/dist/types/test/ui/global-setup.d.ts +2 -0
  238. package/dist/types/test/ui/global-setup.d.ts.map +1 -0
  239. package/dist/types/test/ui/pieces.spec.d.ts +2 -0
  240. package/dist/types/test/ui/pieces.spec.d.ts.map +1 -0
  241. package/dist/types/test/ui/step-panel.spec.d.ts +2 -0
  242. package/dist/types/test/ui/step-panel.spec.d.ts.map +1 -0
  243. package/dist/types/test/ui/studio.spec.d.ts +2 -0
  244. package/dist/types/test/ui/studio.spec.d.ts.map +1 -0
  245. package/dist/types/vitest.config.d.ts.map +1 -1
  246. package/package.json +17 -11
  247. package/dist/browser/PieceMarkdown-CZYNY1qQ.js.map +0 -1
  248. package/dist/browser/ap-layout-BpKqIHQt.js +0 -337
  249. package/dist/browser/ap-layout-BpKqIHQt.js.map +0 -1
  250. package/dist/browser/connection-form-B1SkwNgY.js +0 -453
  251. package/dist/browser/connection-form-B1SkwNgY.js.map +0 -1
  252. package/dist/browser/editor-CCKpl-Gd.js +0 -1550
  253. package/dist/browser/editor-CCKpl-Gd.js.map +0 -1
  254. package/dist/browser/editor-CIZRPdKM.js +0 -134
  255. package/dist/browser/editor-CIZRPdKM.js.map +0 -1
  256. package/dist/browser/editor-D0sdUxJa.js.map +0 -1
  257. package/dist/browser/runtime-api-DKlnn45K.js.map +0 -1
  258. package/dist/browser/status-kpDX5CIA.js +0 -11
  259. package/dist/browser/status-kpDX5CIA.js.map +0 -1
  260. package/dist/browser/upgrade-manifests-Cnpfo6kC.js +0 -8
  261. package/dist/browser/use-runtime-url-By5q3sa_.js +0 -174
  262. package/dist/browser/use-runtime-url-By5q3sa_.js.map +0 -1
  263. package/dist/node/PieceMarkdown-D9nI2gI2.mjs.map +0 -1
  264. package/dist/node/ap-layout-Dzhi9JFC.mjs +0 -337
  265. package/dist/node/ap-layout-Dzhi9JFC.mjs.map +0 -1
  266. package/dist/node/connection-form-DejaNF09.mjs +0 -453
  267. package/dist/node/connection-form-DejaNF09.mjs.map +0 -1
  268. package/dist/node/editor-DfFRZS9L.mjs +0 -134
  269. package/dist/node/editor-DfFRZS9L.mjs.map +0 -1
  270. package/dist/node/editor-NbAB78He.mjs +0 -1550
  271. package/dist/node/editor-NbAB78He.mjs.map +0 -1
  272. package/dist/node/editor-sVzt1o51.mjs.map +0 -1
  273. package/dist/node/runtime-api-CtvvFHut.mjs.map +0 -1
  274. package/dist/node/status-CDRcDUMS.mjs +0 -11
  275. package/dist/node/status-CDRcDUMS.mjs.map +0 -1
  276. package/dist/node/upgrade-manifests-3VN0Bfcf.mjs +0 -8
  277. package/dist/node/use-runtime-url-BbFEkaZy.mjs +0 -174
  278. package/dist/node/use-runtime-url-BbFEkaZy.mjs.map +0 -1
  279. package/dist/types/document-models/connection/v1/tests/config.test.d.ts +0 -2
  280. package/dist/types/document-models/connection/v1/tests/config.test.d.ts.map +0 -1
  281. package/dist/types/document-models/connection/v1/tests/connection.test.d.ts +0 -2
  282. package/dist/types/document-models/connection/v1/tests/connection.test.d.ts.map +0 -1
  283. package/dist/types/document-models/connection/v1/tests/health.test.d.ts +0 -2
  284. package/dist/types/document-models/connection/v1/tests/health.test.d.ts.map +0 -1
  285. package/dist/types/document-models/workflow/v1/tests/edges.test.d.ts +0 -2
  286. package/dist/types/document-models/workflow/v1/tests/edges.test.d.ts.map +0 -1
  287. package/dist/types/document-models/workflow/v1/tests/policy.test.d.ts +0 -2
  288. package/dist/types/document-models/workflow/v1/tests/policy.test.d.ts.map +0 -1
  289. package/dist/types/document-models/workflow/v1/tests/runtime.test.d.ts +0 -2
  290. package/dist/types/document-models/workflow/v1/tests/runtime.test.d.ts.map +0 -1
  291. package/dist/types/document-models/workflow/v1/tests/steps.test.d.ts +0 -2
  292. package/dist/types/document-models/workflow/v1/tests/steps.test.d.ts.map +0 -1
  293. package/dist/types/document-models/workflow/v1/tests/trigger.test.d.ts +0 -2
  294. package/dist/types/document-models/workflow/v1/tests/trigger.test.d.ts.map +0 -1
  295. package/dist/types/document-models/workflow/v1/tests/variables.test.d.ts +0 -2
  296. package/dist/types/document-models/workflow/v1/tests/variables.test.d.ts.map +0 -1
  297. package/dist/types/document-models/workflow/v1/tests/workflow.test.d.ts +0 -2
  298. package/dist/types/document-models/workflow/v1/tests/workflow.test.d.ts.map +0 -1
  299. package/dist/types/editors/workflow-studio/components/ConnectionView.d.ts +0 -7
  300. package/dist/types/editors/workflow-studio/components/ConnectionView.d.ts.map +0 -1
  301. package/dist/types/editors/workflow-studio/components/EditorToolbar.d.ts +0 -8
  302. package/dist/types/editors/workflow-studio/components/EditorToolbar.d.ts.map +0 -1
  303. package/dist/types/editors/workflow-studio/components/connection-usage.d.ts.map +0 -1
  304. package/dist/types/editors/workflow-studio/components/connection-usage.test.d.ts.map +0 -1
  305. /package/dist/types/editors/{workflow-studio/components → connection-editor}/connection-usage.d.ts +0 -0
  306. /package/dist/types/editors/{workflow-studio/components → connection-editor}/connection-usage.test.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"module-12vI18HY.js","names":["z","connectionConnectionActions","connectionConfigActions","connectionHealthActions","utils","genUtils","customUtils"],"sources":["../../document-models/connection/v1/gen/schema/zod.ts","../../document-models/connection/v1/gen/config/creators.ts","../../document-models/connection/v1/gen/connection/creators.ts","../../document-models/connection/v1/gen/health/creators.ts","../../document-models/connection/v1/actions.ts","../../document-models/connection/v1/gen/document-model.ts","../../document-models/connection/v1/gen/config/error.ts","../../document-models/connection/v1/src/reducers/config.ts","../../document-models/connection/v1/src/reducers/connection.ts","../../document-models/connection/v1/src/reducers/health.ts","../../document-models/connection/v1/gen/reducer.ts","../../document-models/connection/upgrades/versions.ts","../../document-models/connection/upgrades/upgrade-manifest.ts","../../document-models/connection/v1/gen/document-type.ts","../../document-models/connection/v1/gen/document-schema.ts","../../document-models/connection/v1/gen/utils.ts","../../document-models/connection/v1/src/utils.ts","../../document-models/connection/v1/utils.ts","../../document-models/connection/v1/module.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as z from \"zod\";\nimport type {\n ConnectionAuthType,\n ConnectionState,\n ConnectionStatus,\n RecordCheckResultInput,\n RemoveSecretRefInput,\n SecretRef,\n SetAccountLabelInput,\n SetConfigInput,\n SetConnectionNameInput,\n SetConnectorInput,\n SetSecretRefInput,\n} from \"./types.js\";\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny =>\n v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\n\nexport const ConnectionAuthTypeSchema = z.enum([\n \"BASIC_AUTH\",\n \"CUSTOM_AUTH\",\n \"NONE\",\n \"OAUTH2\",\n \"OIDC\",\n \"SECRET_TEXT\",\n]);\n\nexport const ConnectionStatusSchema = z.enum([\n \"ERROR\",\n \"OK\",\n \"REVOKED\",\n \"UNCONFIGURED\",\n]);\n\nexport function ConnectionStateSchema(): z.ZodObject<\n Properties<ConnectionState>\n> {\n return z.object({\n __typename: z.literal(\"ConnectionState\").optional(),\n accountLabel: z.string().nullish(),\n authType: ConnectionAuthTypeSchema,\n config: z.unknown(),\n connectorId: z.string(),\n lastCheckedAt: z.iso.datetime().nullish(),\n lastError: z.string().nullish(),\n name: z.string(),\n secretRefs: z.array(z.lazy(() => SecretRefSchema())),\n status: ConnectionStatusSchema,\n });\n}\n\nexport function RecordCheckResultInputSchema(): z.ZodObject<\n Properties<RecordCheckResultInput>\n> {\n return z.object({\n checkedAt: z.iso.datetime(),\n error: z.string().nullish(),\n status: ConnectionStatusSchema,\n });\n}\n\nexport function RemoveSecretRefInputSchema(): z.ZodObject<\n Properties<RemoveSecretRefInput>\n> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function SecretRefSchema(): z.ZodObject<Properties<SecretRef>> {\n return z.object({\n __typename: z.literal(\"SecretRef\").optional(),\n id: z.string(),\n name: z.string(),\n ref: z.string(),\n });\n}\n\nexport function SetAccountLabelInputSchema(): z.ZodObject<\n Properties<SetAccountLabelInput>\n> {\n return z.object({\n accountLabel: z.string().nullish(),\n });\n}\n\nexport function SetConfigInputSchema(): z.ZodObject<\n Properties<SetConfigInput>\n> {\n return z.object({\n config: z.unknown(),\n });\n}\n\nexport function SetConnectionNameInputSchema(): z.ZodObject<\n Properties<SetConnectionNameInput>\n> {\n return z.object({\n name: z.string(),\n });\n}\n\nexport function SetConnectorInputSchema(): z.ZodObject<\n Properties<SetConnectorInput>\n> {\n return z.object({\n authType: ConnectionAuthTypeSchema,\n connectorId: z.string(),\n });\n}\n\nexport function SetSecretRefInputSchema(): z.ZodObject<\n Properties<SetSecretRefInput>\n> {\n return z.object({\n id: z.string(),\n name: z.string(),\n ref: z.string(),\n });\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport {\n RemoveSecretRefInputSchema,\n SetConfigInputSchema,\n SetSecretRefInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n RemoveSecretRefInput,\n SetConfigInput,\n SetSecretRefInput,\n} from \"../types.js\";\nimport type {\n RemoveSecretRefAction,\n SetConfigAction,\n SetSecretRefAction,\n} from \"./actions.js\";\n\nexport const setConfig = (input: SetConfigInput) =>\n createAction<SetConfigAction>(\n \"SET_CONFIG\",\n { ...input },\n undefined,\n SetConfigInputSchema,\n \"global\",\n );\n\nexport const setSecretRef = (input: SetSecretRefInput) =>\n createAction<SetSecretRefAction>(\n \"SET_SECRET_REF\",\n { ...input },\n undefined,\n SetSecretRefInputSchema,\n \"global\",\n );\n\nexport const removeSecretRef = (input: RemoveSecretRefInput) =>\n createAction<RemoveSecretRefAction>(\n \"REMOVE_SECRET_REF\",\n { ...input },\n undefined,\n RemoveSecretRefInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport {\n SetAccountLabelInputSchema,\n SetConnectionNameInputSchema,\n SetConnectorInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n SetAccountLabelInput,\n SetConnectionNameInput,\n SetConnectorInput,\n} from \"../types.js\";\nimport type {\n SetAccountLabelAction,\n SetConnectionNameAction,\n SetConnectorAction,\n} from \"./actions.js\";\n\nexport const setConnectionName = (input: SetConnectionNameInput) =>\n createAction<SetConnectionNameAction>(\n \"SET_CONNECTION_NAME\",\n { ...input },\n undefined,\n SetConnectionNameInputSchema,\n \"global\",\n );\n\nexport const setConnector = (input: SetConnectorInput) =>\n createAction<SetConnectorAction>(\n \"SET_CONNECTOR\",\n { ...input },\n undefined,\n SetConnectorInputSchema,\n \"global\",\n );\n\nexport const setAccountLabel = (input: SetAccountLabelInput) =>\n createAction<SetAccountLabelAction>(\n \"SET_ACCOUNT_LABEL\",\n { ...input },\n undefined,\n SetAccountLabelInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport { RecordCheckResultInputSchema } from \"../schema/zod.js\";\nimport type { RecordCheckResultInput } from \"../types.js\";\nimport type { RecordCheckResultAction } from \"./actions.js\";\n\nexport const recordCheckResult = (input: RecordCheckResultInput) =>\n createAction<RecordCheckResultAction>(\n \"RECORD_CHECK_RESULT\",\n { ...input },\n undefined,\n RecordCheckResultInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { baseActions } from \"document-model\";\nimport {\n connectionConfigActions,\n connectionConnectionActions,\n connectionHealthActions,\n} from \"./gen/creators.js\";\n\n/** Actions for the Connection document model */\n\nexport const actions = {\n ...baseActions,\n ...connectionConnectionActions,\n ...connectionConfigActions,\n ...connectionHealthActions,\n};\n","import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/connection\",\n name: \"Connection\",\n author: {\n name: \"Powerhouse\",\n website: \"https://www.powerhouse.inc\",\n },\n extension: \".conn\",\n description:\n \"A configured connector instance: auth kind, non-secret config and secret handles, shared by many workflows.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n 'enum ConnectionAuthType {\\n SECRET_TEXT\\n BASIC_AUTH\\n CUSTOM_AUTH\\n OAUTH2\\n OIDC\\n NONE\\n}\\n\\nenum ConnectionStatus {\\n UNCONFIGURED\\n OK\\n ERROR\\n REVOKED\\n}\\n\\ntype SecretRef {\\n id: OID!\\n \"Matches an auth property name in the connector\\'s config schema.\"\\n name: String!\\n \"Opaque handle into the host secret provider. Not the secret.\"\\n ref: String!\\n}\\n\\ntype ConnectionState {\\n name: String!\\n \"Fully-qualified connector id: \\'@acme/connector-imap#imap\\'.\"\\n connectorId: String!\\n \"Activepieces auth kind, so a piece\\'s PieceAuth maps directly.\"\\n authType: ConnectionAuthType!\\n \"Non-secret configuration, validated against the connector\\'s auth schema.\"\\n config: Unknown!\\n \"Secret handles; values never appear in state, operations, or the run journal.\"\\n secretRefs: [SecretRef!]!\\n status: ConnectionStatus!\\n lastCheckedAt: DateTime\\n lastError: String\\n \"Populated by the connector\\'s own metadata call. Display only.\"\\n accountLabel: String\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": \"\",\\n \"connectorId\": \"\",\\n \"authType\": \"NONE\",\\n \"config\": {},\\n \"secretRefs\": [],\\n \"status\": \"UNCONFIGURED\",\\n \"lastCheckedAt\": null,\\n \"lastError\": null,\\n \"accountLabel\": null\\n}',\n },\n },\n modules: [\n {\n id: \"d723a91b-329c-46c3-acbf-85533c47b5a4\",\n name: \"connection\",\n description: \"Connection identity and connector binding.\",\n operations: [\n {\n id: \"ece5a33d-0bc1-46ff-87f4-c763d298cb3a\",\n name: \"SET_CONNECTION_NAME\",\n description: \"Sets the connection's display name.\",\n schema: \"input SetConnectionNameInput {\\n name: String!\\n}\",\n template: \"Sets the connection's display name.\",\n reducer: \"state.name = action.input.name;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"e668be97-82c8-433e-8af7-1644cfa25723\",\n name: \"SET_CONNECTOR\",\n description:\n \"Binds the connection to a connector and auth kind; resets status to UNCONFIGURED.\",\n schema:\n \"input SetConnectorInput {\\n connectorId: String!\\n authType: ConnectionAuthType!\\n}\",\n template:\n \"Binds the connection to a connector and auth kind; resets status to UNCONFIGURED.\",\n reducer:\n 'state.connectorId = action.input.connectorId;\\nstate.authType = action.input.authType;\\nstate.status = \"UNCONFIGURED\";',\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"01a28e56-4406-4160-9547-f6239e728afd\",\n name: \"SET_ACCOUNT_LABEL\",\n description: \"Sets or clears the display-only account label.\",\n schema:\n \"input SetAccountLabelInput {\\n accountLabel: String\\n}\",\n template: \"Sets or clears the display-only account label.\",\n reducer:\n \"state.accountLabel = action.input.accountLabel || null;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n {\n id: \"728ec59f-db15-4c52-aa9d-fbe1a6d6a6f9\",\n name: \"config\",\n description: \"Non-secret configuration and secret handles.\",\n operations: [\n {\n id: \"c26f7cd8-c280-4e85-be65-83c3c1217358\",\n name: \"SET_CONFIG\",\n description: \"Replaces the non-secret configuration.\",\n schema: \"input SetConfigInput {\\n config: Unknown!\\n}\",\n template: \"Replaces the non-secret configuration.\",\n reducer: \"state.config = action.input.config;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"1a90e020-6dc5-49e0-9be1-732028dd10d3\",\n name: \"SET_SECRET_REF\",\n description:\n \"Creates or updates a secret handle, keyed by its auth property name.\",\n schema:\n \"input SetSecretRefInput {\\n id: OID!\\n name: String!\\n ref: String!\\n}\",\n template:\n \"Creates or updates a secret handle, keyed by its auth property name.\",\n reducer:\n \"const existing = state.secretRefs.find(\\n (secretRef) => secretRef.name === action.input.name,\\n);\\nif (existing) {\\n existing.ref = action.input.ref;\\n} else {\\n state.secretRefs.push({\\n id: action.input.id,\\n name: action.input.name,\\n ref: action.input.ref,\\n });\\n}\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"0c7214b1-0494-49d8-913f-39ad59ca2a3b\",\n name: \"REMOVE_SECRET_REF\",\n description: \"Removes a secret handle.\",\n schema: \"input RemoveSecretRefInput {\\n id: OID!\\n}\",\n template: \"Removes a secret handle.\",\n reducer:\n 'const index = state.secretRefs.findIndex(\\n (secretRef) => secretRef.id === action.input.id,\\n);\\nif (index === -1) {\\n throw new SecretRefNotFoundError(\"Secret ref not found\");\\n}\\nstate.secretRefs.splice(index, 1);',\n errors: [\n {\n id: \"0c5d799d-d71d-4a75-ab0e-136ea72f1a3b\",\n name: \"SecretRefNotFoundError\",\n code: \"SECRET_REF_NOT_FOUND\",\n description: \"No secret ref exists with the given id.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n {\n id: \"3b02be29-0e8b-400d-ba05-1305e28c86b5\",\n name: \"health\",\n description: \"Connection health, written by connector checks.\",\n operations: [\n {\n id: \"2e8e9df7-3939-425c-9e28-7c8fa5de7d3f\",\n name: \"RECORD_CHECK_RESULT\",\n description:\n \"Records the outcome of a connection check, including revocation.\",\n schema:\n \"input RecordCheckResultInput {\\n status: ConnectionStatus!\\n checkedAt: DateTime!\\n error: String\\n}\",\n template:\n \"Records the outcome of a connection check, including revocation.\",\n reducer:\n \"state.status = action.input.status;\\nstate.lastCheckedAt = action.input.checkedAt;\\nstate.lastError = action.input.error || null;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export type ErrorCode = \"SecretRefNotFoundError\";\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class SecretRefNotFoundError extends Error implements ReducerError {\n errorCode = \"SecretRefNotFoundError\" as ErrorCode;\n constructor(message = \"SecretRefNotFoundError\") {\n super(message);\n }\n}\n\nexport const errors = {\n RemoveSecretRef: { SecretRefNotFoundError },\n};\n","import type { ConnectionConfigOperations } from \"document-models/connection/v1\";\nimport { SecretRefNotFoundError } from \"../../gen/config/error.js\";\n\nexport const connectionConfigOperations: ConnectionConfigOperations = {\n setConfigOperation(state, action) {\n state.config = action.input.config;\n },\n setSecretRefOperation(state, action) {\n const existing = state.secretRefs.find(\n (secretRef) => secretRef.name === action.input.name,\n );\n if (existing) {\n existing.ref = action.input.ref;\n } else {\n state.secretRefs.push({\n id: action.input.id,\n name: action.input.name,\n ref: action.input.ref,\n });\n }\n },\n removeSecretRefOperation(state, action) {\n const index = state.secretRefs.findIndex(\n (secretRef) => secretRef.id === action.input.id,\n );\n if (index === -1) {\n throw new SecretRefNotFoundError(\"Secret ref not found\");\n }\n state.secretRefs.splice(index, 1);\n },\n};\n","import type { ConnectionConnectionOperations } from \"document-models/connection/v1\";\n\nexport const connectionConnectionOperations: ConnectionConnectionOperations = {\n setConnectionNameOperation(state, action) {\n state.name = action.input.name;\n },\n setConnectorOperation(state, action) {\n const rebinding = action.input.connectorId !== state.connectorId;\n state.connectorId = action.input.connectorId;\n state.authType = action.input.authType;\n state.status = \"UNCONFIGURED\";\n // A different connector invalidates the old one's config/secrets/health;\n // a same-connector call (e.g. re-declaring authType) leaves them alone.\n if (rebinding) {\n state.config = {};\n state.secretRefs = [];\n state.accountLabel = null;\n state.lastCheckedAt = null;\n state.lastError = null;\n }\n },\n setAccountLabelOperation(state, action) {\n state.accountLabel = action.input.accountLabel || null;\n },\n};\n","import type { ConnectionHealthOperations } from \"document-models/connection/v1\";\n\nexport const connectionHealthOperations: ConnectionHealthOperations = {\n recordCheckResultOperation(state, action) {\n state.status = action.input.status;\n state.lastCheckedAt = action.input.checkedAt;\n state.lastError = action.input.error || null;\n },\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport type { Reducer, StateReducer } from \"document-model\";\nimport { createReducer, isDocumentAction } from \"document-model\";\nimport type { ConnectionPHState } from \"document-models/connection/v1\";\n\nimport { connectionConfigOperations } from \"../src/reducers/config.js\";\nimport { connectionConnectionOperations } from \"../src/reducers/connection.js\";\nimport { connectionHealthOperations } from \"../src/reducers/health.js\";\n\nimport {\n RecordCheckResultInputSchema,\n RemoveSecretRefInputSchema,\n SetAccountLabelInputSchema,\n SetConfigInputSchema,\n SetConnectionNameInputSchema,\n SetConnectorInputSchema,\n SetSecretRefInputSchema,\n} from \"./schema/zod.js\";\n\nconst stateReducer: StateReducer<ConnectionPHState> = (\n state,\n action,\n dispatch,\n) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case \"SET_CONNECTION_NAME\": {\n SetConnectionNameInputSchema().parse(action.input);\n\n connectionConnectionOperations.setConnectionNameOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_CONNECTOR\": {\n SetConnectorInputSchema().parse(action.input);\n\n connectionConnectionOperations.setConnectorOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_ACCOUNT_LABEL\": {\n SetAccountLabelInputSchema().parse(action.input);\n\n connectionConnectionOperations.setAccountLabelOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_CONFIG\": {\n SetConfigInputSchema().parse(action.input);\n\n connectionConfigOperations.setConfigOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_SECRET_REF\": {\n SetSecretRefInputSchema().parse(action.input);\n\n connectionConfigOperations.setSecretRefOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"REMOVE_SECRET_REF\": {\n RemoveSecretRefInputSchema().parse(action.input);\n\n connectionConfigOperations.removeSecretRefOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"RECORD_CHECK_RESULT\": {\n RecordCheckResultInputSchema().parse(action.input);\n\n connectionHealthOperations.recordCheckResultOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<ConnectionPHState> = createReducer(stateReducer);\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const connectionUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/connection\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nexport const connectionDocumentType = \"powerhouse/connection\";\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport {\n BaseDocumentHeaderSchema,\n BaseDocumentStateSchema,\n} from \"document-model\";\nimport { z } from \"zod\";\nimport { connectionDocumentType } from \"./document-type.js\";\nimport { ConnectionStateSchema } from \"./schema/zod.js\";\nimport type { ConnectionDocument, ConnectionPHState } from \"./types.js\";\n\n/** Schema for validating the header object of a Connection document */\nexport const ConnectionDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({\n documentType: z.literal(connectionDocumentType),\n});\n\n/** Schema for validating the state object of a Connection document */\nexport const ConnectionPHStateSchema = BaseDocumentStateSchema.extend({\n global: ConnectionStateSchema(),\n});\n\nexport const ConnectionDocumentSchema = z.object({\n header: ConnectionDocumentHeaderSchema,\n state: ConnectionPHStateSchema,\n initialState: ConnectionPHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a Connection document state object */\nexport function isConnectionState(state: unknown): state is ConnectionPHState {\n return ConnectionPHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a Connection document state object */\nexport function assertIsConnectionState(\n state: unknown,\n): asserts state is ConnectionPHState {\n ConnectionPHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a Connection document */\nexport function isConnectionDocument(\n document: unknown,\n): document is ConnectionDocument {\n return ConnectionDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a Connection document */\nexport function assertIsConnectionDocument(\n document: unknown,\n): asserts document is ConnectionDocument {\n ConnectionDocumentSchema.parse(document);\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils, PHBaseState, Reducer } from \"document-model\";\nimport {\n baseCreateDocument,\n baseLoadFromInputVersioned,\n baseSaveToFileHandle,\n createBaseState,\n} from \"document-model\";\nimport { connectionUpgradeManifest } from \"../../upgrades/upgrade-manifest.js\";\nimport {\n assertIsConnectionDocument,\n assertIsConnectionState,\n isConnectionDocument,\n isConnectionState,\n} from \"./document-schema.js\";\nimport { connectionDocumentType } from \"./document-type.js\";\nimport { reducer } from \"./reducer.js\";\nimport type {\n ConnectionGlobalState,\n ConnectionLocalState,\n ConnectionPHState,\n} from \"./types.js\";\n\nexport const initialGlobalState: ConnectionGlobalState = {\n name: \"\",\n connectorId: \"\",\n authType: \"NONE\",\n config: {},\n secretRefs: [],\n status: \"UNCONFIGURED\",\n lastCheckedAt: null,\n lastError: null,\n accountLabel: null,\n};\nexport const initialLocalState: ConnectionLocalState = {};\n\nexport const utils: DocumentModelUtils<ConnectionPHState> = {\n fileExtension: \".conn\",\n createState(state) {\n return {\n ...createBaseState(state?.auth, { version: 1, ...state?.document }),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n return baseCreateDocument(utils.createState, state, connectionDocumentType);\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInputVersioned(input, {\n reducers: { 1: reducer as unknown as Reducer<PHBaseState> },\n upgradeManifest: connectionUpgradeManifest,\n });\n },\n isStateOfType(state) {\n return isConnectionState(state);\n },\n assertIsStateOfType(state) {\n return assertIsConnectionState(state);\n },\n isDocumentOfType(document) {\n return isConnectionDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsConnectionDocument(document);\n },\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { ConnectionPHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the Connection document model */\nexport const utils: DocumentModelUtils<ConnectionPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { ConnectionPHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the Connection document type */\nexport const Connection = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<ConnectionPHState>;\n"],"mappings":";;;;;AAuBA,MAAa,uBAAuB,MAClC,MAAM,KAAA,KAAa,MAAM;AAE3B,MAAa,0BAA0BA,IACpC,KAAK,CACL,QAAQ,MAAM,oBAAoB,EAAE,CAAC;AAExC,MAAa,2BAA2BA,IAAE,KAAK;CAC7C;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,yBAAyBA,IAAE,KAAK;CAC3C;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAgB,wBAEd;AACA,QAAOA,IAAE,OAAO;EACd,YAAYA,IAAE,QAAQ,kBAAkB,CAAC,UAAU;EACnD,cAAcA,IAAE,QAAQ,CAAC,SAAS;EAClC,UAAU;EACV,QAAQA,IAAE,SAAS;EACnB,aAAaA,IAAE,QAAQ;EACvB,eAAeA,IAAE,IAAI,UAAU,CAAC,SAAS;EACzC,WAAWA,IAAE,QAAQ,CAAC,SAAS;EAC/B,MAAMA,IAAE,QAAQ;EAChB,YAAYA,IAAE,MAAMA,IAAE,WAAW,iBAAiB,CAAC,CAAC;EACpD,QAAQ;EACT,CAAC;;AAGJ,SAAgB,+BAEd;AACA,QAAOA,IAAE,OAAO;EACd,WAAWA,IAAE,IAAI,UAAU;EAC3B,OAAOA,IAAE,QAAQ,CAAC,SAAS;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O,qBAAqB,UAAU,MAAM;;CAE9C,cAAc,OAAO;AACnB,SAAO,2BAA2B,OAAO;GACvC,UAAU,EAAE,GAAG,SAA4C;GAC3D,iBAAiB;GAClB,CAAC;;CAEJ,cAAc,OAAO;AACnB,SAAO,kBAAkB,MAAM;;CAEjC,oBAAoB,OAAO;AACzB,SAAO,wBAAwB,MAAM;;CAEvC,iBAAiB,UAAU;AACzB,SAAO,qBAAqB,SAAS;;CAEvC,uBAAuB,UAAU;AAC/B,SAAO,2BAA2B,SAAS;;CAE9C;;;;;;;AE9DD,MAAa,QAA+C;CAC1D,GAAGC;CACH,GAAGC;CACJ;;;;ACAD,MAAa,aAAa;CACxB,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D"}
1
+ {"version":3,"file":"module-jDZ4pq3W.js","names":["z","connectionConnectionActions","connectionConfigActions","connectionHealthActions","utils","genUtils","customUtils"],"sources":["../../document-models/connection/v1/gen/schema/zod.ts","../../document-models/connection/v1/gen/config/creators.ts","../../document-models/connection/v1/gen/connection/creators.ts","../../document-models/connection/v1/gen/health/creators.ts","../../document-models/connection/v1/actions.ts","../../document-models/connection/v1/gen/document-model.ts","../../document-models/connection/v1/gen/config/error.ts","../../document-models/connection/v1/src/reducers/config.ts","../../document-models/connection/v1/src/reducers/connection.ts","../../document-models/connection/v1/src/reducers/health.ts","../../document-models/connection/v1/gen/reducer.ts","../../document-models/connection/upgrades/versions.ts","../../document-models/connection/upgrades/upgrade-manifest.ts","../../document-models/connection/v1/gen/document-type.ts","../../document-models/connection/v1/gen/document-schema.ts","../../document-models/connection/v1/gen/utils.ts","../../document-models/connection/v1/src/utils.ts","../../document-models/connection/v1/utils.ts","../../document-models/connection/v1/module.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as z from \"zod\";\nimport type {\n ConnectionAuthType,\n ConnectionState,\n ConnectionStatus,\n RecordCheckResultInput,\n RemoveSecretRefInput,\n SecretRef,\n SetAccountLabelInput,\n SetConfigInput,\n SetConnectionNameInput,\n SetConnectorInput,\n SetSecretRefInput,\n} from \"./types.js\";\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny =>\n v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\n\nexport const ConnectionAuthTypeSchema = z.enum([\n \"BASIC_AUTH\",\n \"CUSTOM_AUTH\",\n \"NONE\",\n \"OAUTH2\",\n \"OIDC\",\n \"SECRET_TEXT\",\n]);\n\nexport const ConnectionStatusSchema = z.enum([\n \"ERROR\",\n \"OK\",\n \"REVOKED\",\n \"UNCONFIGURED\",\n]);\n\nexport function ConnectionStateSchema(): z.ZodObject<\n Properties<ConnectionState>\n> {\n return z.object({\n __typename: z.literal(\"ConnectionState\").optional(),\n accountLabel: z.string().nullish(),\n authType: ConnectionAuthTypeSchema,\n config: z.unknown(),\n connectorId: z.string(),\n lastCheckedAt: z.iso.datetime().nullish(),\n lastError: z.string().nullish(),\n name: z.string(),\n secretRefs: z.array(z.lazy(() => SecretRefSchema())),\n status: ConnectionStatusSchema,\n });\n}\n\nexport function RecordCheckResultInputSchema(): z.ZodObject<\n Properties<RecordCheckResultInput>\n> {\n return z.object({\n checkedAt: z.iso.datetime(),\n error: z.string().nullish(),\n status: ConnectionStatusSchema,\n });\n}\n\nexport function RemoveSecretRefInputSchema(): z.ZodObject<\n Properties<RemoveSecretRefInput>\n> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function SecretRefSchema(): z.ZodObject<Properties<SecretRef>> {\n return z.object({\n __typename: z.literal(\"SecretRef\").optional(),\n id: z.string(),\n name: z.string(),\n ref: z.string(),\n });\n}\n\nexport function SetAccountLabelInputSchema(): z.ZodObject<\n Properties<SetAccountLabelInput>\n> {\n return z.object({\n accountLabel: z.string().nullish(),\n });\n}\n\nexport function SetConfigInputSchema(): z.ZodObject<\n Properties<SetConfigInput>\n> {\n return z.object({\n config: z.unknown(),\n });\n}\n\nexport function SetConnectionNameInputSchema(): z.ZodObject<\n Properties<SetConnectionNameInput>\n> {\n return z.object({\n name: z.string(),\n });\n}\n\nexport function SetConnectorInputSchema(): z.ZodObject<\n Properties<SetConnectorInput>\n> {\n return z.object({\n authType: ConnectionAuthTypeSchema,\n connectorId: z.string(),\n });\n}\n\nexport function SetSecretRefInputSchema(): z.ZodObject<\n Properties<SetSecretRefInput>\n> {\n return z.object({\n id: z.string(),\n name: z.string(),\n ref: z.string(),\n });\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport {\n RemoveSecretRefInputSchema,\n SetConfigInputSchema,\n SetSecretRefInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n RemoveSecretRefInput,\n SetConfigInput,\n SetSecretRefInput,\n} from \"../types.js\";\nimport type {\n RemoveSecretRefAction,\n SetConfigAction,\n SetSecretRefAction,\n} from \"./actions.js\";\n\nexport const setConfig = (input: SetConfigInput) =>\n createAction<SetConfigAction>(\n \"SET_CONFIG\",\n { ...input },\n undefined,\n SetConfigInputSchema,\n \"global\",\n );\n\nexport const setSecretRef = (input: SetSecretRefInput) =>\n createAction<SetSecretRefAction>(\n \"SET_SECRET_REF\",\n { ...input },\n undefined,\n SetSecretRefInputSchema,\n \"global\",\n );\n\nexport const removeSecretRef = (input: RemoveSecretRefInput) =>\n createAction<RemoveSecretRefAction>(\n \"REMOVE_SECRET_REF\",\n { ...input },\n undefined,\n RemoveSecretRefInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport {\n SetAccountLabelInputSchema,\n SetConnectionNameInputSchema,\n SetConnectorInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n SetAccountLabelInput,\n SetConnectionNameInput,\n SetConnectorInput,\n} from \"../types.js\";\nimport type {\n SetAccountLabelAction,\n SetConnectionNameAction,\n SetConnectorAction,\n} from \"./actions.js\";\n\nexport const setConnectionName = (input: SetConnectionNameInput) =>\n createAction<SetConnectionNameAction>(\n \"SET_CONNECTION_NAME\",\n { ...input },\n undefined,\n SetConnectionNameInputSchema,\n \"global\",\n );\n\nexport const setConnector = (input: SetConnectorInput) =>\n createAction<SetConnectorAction>(\n \"SET_CONNECTOR\",\n { ...input },\n undefined,\n SetConnectorInputSchema,\n \"global\",\n );\n\nexport const setAccountLabel = (input: SetAccountLabelInput) =>\n createAction<SetAccountLabelAction>(\n \"SET_ACCOUNT_LABEL\",\n { ...input },\n undefined,\n SetAccountLabelInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport { RecordCheckResultInputSchema } from \"../schema/zod.js\";\nimport type { RecordCheckResultInput } from \"../types.js\";\nimport type { RecordCheckResultAction } from \"./actions.js\";\n\nexport const recordCheckResult = (input: RecordCheckResultInput) =>\n createAction<RecordCheckResultAction>(\n \"RECORD_CHECK_RESULT\",\n { ...input },\n undefined,\n RecordCheckResultInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { baseActions } from \"document-model\";\nimport {\n connectionConfigActions,\n connectionConnectionActions,\n connectionHealthActions,\n} from \"./gen/creators.js\";\n\n/** Actions for the Connection document model */\n\nexport const actions = {\n ...baseActions,\n ...connectionConnectionActions,\n ...connectionConfigActions,\n ...connectionHealthActions,\n};\n","import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/connection\",\n name: \"Connection\",\n author: {\n name: \"Powerhouse\",\n website: \"https://www.powerhouse.inc\",\n },\n extension: \".conn\",\n description:\n \"A configured connector instance: auth kind, non-secret config and secret handles, shared by many workflows.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n 'enum ConnectionAuthType {\\n SECRET_TEXT\\n BASIC_AUTH\\n CUSTOM_AUTH\\n OAUTH2\\n OIDC\\n NONE\\n}\\n\\nenum ConnectionStatus {\\n UNCONFIGURED\\n OK\\n ERROR\\n REVOKED\\n}\\n\\ntype SecretRef {\\n id: OID!\\n \"Matches an auth property name in the connector\\'s config schema.\"\\n name: String!\\n \"Opaque handle into the host secret provider. Not the secret.\"\\n ref: String!\\n}\\n\\ntype ConnectionState {\\n name: String!\\n \"Fully-qualified connector id: \\'@acme/connector-imap#imap\\'.\"\\n connectorId: String!\\n \"Activepieces auth kind, so a piece\\'s PieceAuth maps directly.\"\\n authType: ConnectionAuthType!\\n \"Non-secret configuration, validated against the connector\\'s auth schema.\"\\n config: Unknown!\\n \"Secret handles; values never appear in state, operations, or the run journal.\"\\n secretRefs: [SecretRef!]!\\n status: ConnectionStatus!\\n lastCheckedAt: DateTime\\n lastError: String\\n \"Populated by the connector\\'s own metadata call. Display only.\"\\n accountLabel: String\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": \"\",\\n \"connectorId\": \"\",\\n \"authType\": \"NONE\",\\n \"config\": {},\\n \"secretRefs\": [],\\n \"status\": \"UNCONFIGURED\",\\n \"lastCheckedAt\": null,\\n \"lastError\": null,\\n \"accountLabel\": null\\n}',\n },\n },\n modules: [\n {\n id: \"d723a91b-329c-46c3-acbf-85533c47b5a4\",\n name: \"connection\",\n description: \"Connection identity and connector binding.\",\n operations: [\n {\n id: \"ece5a33d-0bc1-46ff-87f4-c763d298cb3a\",\n name: \"SET_CONNECTION_NAME\",\n description: \"Sets the connection's display name.\",\n schema: \"input SetConnectionNameInput {\\n name: String!\\n}\",\n template: \"Sets the connection's display name.\",\n reducer: \"state.name = action.input.name;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"e668be97-82c8-433e-8af7-1644cfa25723\",\n name: \"SET_CONNECTOR\",\n description:\n \"Binds the connection to a connector and auth kind; resets status to UNCONFIGURED.\",\n schema:\n \"input SetConnectorInput {\\n connectorId: String!\\n authType: ConnectionAuthType!\\n}\",\n template:\n \"Binds the connection to a connector and auth kind; resets status to UNCONFIGURED.\",\n reducer:\n 'state.connectorId = action.input.connectorId;\\nstate.authType = action.input.authType;\\nstate.status = \"UNCONFIGURED\";',\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"01a28e56-4406-4160-9547-f6239e728afd\",\n name: \"SET_ACCOUNT_LABEL\",\n description: \"Sets or clears the display-only account label.\",\n schema:\n \"input SetAccountLabelInput {\\n accountLabel: String\\n}\",\n template: \"Sets or clears the display-only account label.\",\n reducer:\n \"state.accountLabel = action.input.accountLabel || null;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n {\n id: \"728ec59f-db15-4c52-aa9d-fbe1a6d6a6f9\",\n name: \"config\",\n description: \"Non-secret configuration and secret handles.\",\n operations: [\n {\n id: \"c26f7cd8-c280-4e85-be65-83c3c1217358\",\n name: \"SET_CONFIG\",\n description: \"Replaces the non-secret configuration.\",\n schema: \"input SetConfigInput {\\n config: Unknown!\\n}\",\n template: \"Replaces the non-secret configuration.\",\n reducer: \"state.config = action.input.config;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"1a90e020-6dc5-49e0-9be1-732028dd10d3\",\n name: \"SET_SECRET_REF\",\n description:\n \"Creates or updates a secret handle, keyed by its auth property name.\",\n schema:\n \"input SetSecretRefInput {\\n id: OID!\\n name: String!\\n ref: String!\\n}\",\n template:\n \"Creates or updates a secret handle, keyed by its auth property name.\",\n reducer:\n \"const existing = state.secretRefs.find(\\n (secretRef) => secretRef.name === action.input.name,\\n);\\nif (existing) {\\n existing.ref = action.input.ref;\\n} else {\\n state.secretRefs.push({\\n id: action.input.id,\\n name: action.input.name,\\n ref: action.input.ref,\\n });\\n}\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"0c7214b1-0494-49d8-913f-39ad59ca2a3b\",\n name: \"REMOVE_SECRET_REF\",\n description: \"Removes a secret handle.\",\n schema: \"input RemoveSecretRefInput {\\n id: OID!\\n}\",\n template: \"Removes a secret handle.\",\n reducer:\n 'const index = state.secretRefs.findIndex(\\n (secretRef) => secretRef.id === action.input.id,\\n);\\nif (index === -1) {\\n throw new SecretRefNotFoundError(\"Secret ref not found\");\\n}\\nstate.secretRefs.splice(index, 1);',\n errors: [\n {\n id: \"0c5d799d-d71d-4a75-ab0e-136ea72f1a3b\",\n name: \"SecretRefNotFoundError\",\n code: \"SECRET_REF_NOT_FOUND\",\n description: \"No secret ref exists with the given id.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n {\n id: \"3b02be29-0e8b-400d-ba05-1305e28c86b5\",\n name: \"health\",\n description: \"Connection health, written by connector checks.\",\n operations: [\n {\n id: \"2e8e9df7-3939-425c-9e28-7c8fa5de7d3f\",\n name: \"RECORD_CHECK_RESULT\",\n description:\n \"Records the outcome of a connection check, including revocation.\",\n schema:\n \"input RecordCheckResultInput {\\n status: ConnectionStatus!\\n checkedAt: DateTime!\\n error: String\\n}\",\n template:\n \"Records the outcome of a connection check, including revocation.\",\n reducer:\n \"state.status = action.input.status;\\nstate.lastCheckedAt = action.input.checkedAt;\\nstate.lastError = action.input.error || null;\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export type ErrorCode = \"SecretRefNotFoundError\";\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class SecretRefNotFoundError extends Error implements ReducerError {\n errorCode = \"SecretRefNotFoundError\" as ErrorCode;\n constructor(message = \"SecretRefNotFoundError\") {\n super(message);\n }\n}\n\nexport const errors = {\n RemoveSecretRef: { SecretRefNotFoundError },\n};\n","import type { ConnectionConfigOperations } from \"document-models/connection/v1\";\nimport { SecretRefNotFoundError } from \"../../gen/config/error.js\";\n\nexport const connectionConfigOperations: ConnectionConfigOperations = {\n setConfigOperation(state, action) {\n state.config = action.input.config;\n },\n setSecretRefOperation(state, action) {\n const existing = state.secretRefs.find(\n (secretRef) => secretRef.name === action.input.name,\n );\n if (existing) {\n existing.ref = action.input.ref;\n } else {\n state.secretRefs.push({\n id: action.input.id,\n name: action.input.name,\n ref: action.input.ref,\n });\n }\n },\n removeSecretRefOperation(state, action) {\n const index = state.secretRefs.findIndex(\n (secretRef) => secretRef.id === action.input.id,\n );\n if (index === -1) {\n throw new SecretRefNotFoundError(\"Secret ref not found\");\n }\n state.secretRefs.splice(index, 1);\n },\n};\n","import type { ConnectionConnectionOperations } from \"document-models/connection/v1\";\n\nexport const connectionConnectionOperations: ConnectionConnectionOperations = {\n setConnectionNameOperation(state, action) {\n state.name = action.input.name;\n },\n setConnectorOperation(state, action) {\n const rebinding = action.input.connectorId !== state.connectorId;\n state.connectorId = action.input.connectorId;\n state.authType = action.input.authType;\n state.status = \"UNCONFIGURED\";\n // A different connector invalidates the old one's config/secrets/health;\n // a same-connector call (e.g. re-declaring authType) leaves them alone.\n if (rebinding) {\n state.config = {};\n state.secretRefs = [];\n state.accountLabel = null;\n state.lastCheckedAt = null;\n state.lastError = null;\n }\n },\n setAccountLabelOperation(state, action) {\n state.accountLabel = action.input.accountLabel || null;\n },\n};\n","import type { ConnectionHealthOperations } from \"document-models/connection/v1\";\n\nexport const connectionHealthOperations: ConnectionHealthOperations = {\n recordCheckResultOperation(state, action) {\n state.status = action.input.status;\n state.lastCheckedAt = action.input.checkedAt;\n state.lastError = action.input.error || null;\n },\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport type { Reducer, StateReducer } from \"document-model\";\nimport { createReducer, isDocumentAction } from \"document-model\";\nimport type { ConnectionPHState } from \"document-models/connection/v1\";\n\nimport { connectionConfigOperations } from \"../src/reducers/config.js\";\nimport { connectionConnectionOperations } from \"../src/reducers/connection.js\";\nimport { connectionHealthOperations } from \"../src/reducers/health.js\";\n\nimport {\n RecordCheckResultInputSchema,\n RemoveSecretRefInputSchema,\n SetAccountLabelInputSchema,\n SetConfigInputSchema,\n SetConnectionNameInputSchema,\n SetConnectorInputSchema,\n SetSecretRefInputSchema,\n} from \"./schema/zod.js\";\n\nconst stateReducer: StateReducer<ConnectionPHState> = (\n state,\n action,\n dispatch,\n) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case \"SET_CONNECTION_NAME\": {\n SetConnectionNameInputSchema().parse(action.input);\n\n connectionConnectionOperations.setConnectionNameOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_CONNECTOR\": {\n SetConnectorInputSchema().parse(action.input);\n\n connectionConnectionOperations.setConnectorOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_ACCOUNT_LABEL\": {\n SetAccountLabelInputSchema().parse(action.input);\n\n connectionConnectionOperations.setAccountLabelOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_CONFIG\": {\n SetConfigInputSchema().parse(action.input);\n\n connectionConfigOperations.setConfigOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_SECRET_REF\": {\n SetSecretRefInputSchema().parse(action.input);\n\n connectionConfigOperations.setSecretRefOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"REMOVE_SECRET_REF\": {\n RemoveSecretRefInputSchema().parse(action.input);\n\n connectionConfigOperations.removeSecretRefOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"RECORD_CHECK_RESULT\": {\n RecordCheckResultInputSchema().parse(action.input);\n\n connectionHealthOperations.recordCheckResultOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<ConnectionPHState> = createReducer(stateReducer);\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const connectionUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/connection\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nexport const connectionDocumentType = \"powerhouse/connection\";\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport {\n BaseDocumentHeaderSchema,\n BaseDocumentStateSchema,\n} from \"document-model\";\nimport { z } from \"zod\";\nimport { connectionDocumentType } from \"./document-type.js\";\nimport { ConnectionStateSchema } from \"./schema/zod.js\";\nimport type { ConnectionDocument, ConnectionPHState } from \"./types.js\";\n\n/** Schema for validating the header object of a Connection document */\nexport const ConnectionDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({\n documentType: z.literal(connectionDocumentType),\n});\n\n/** Schema for validating the state object of a Connection document */\nexport const ConnectionPHStateSchema = BaseDocumentStateSchema.extend({\n global: ConnectionStateSchema(),\n});\n\nexport const ConnectionDocumentSchema = z.object({\n header: ConnectionDocumentHeaderSchema,\n state: ConnectionPHStateSchema,\n initialState: ConnectionPHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a Connection document state object */\nexport function isConnectionState(state: unknown): state is ConnectionPHState {\n return ConnectionPHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a Connection document state object */\nexport function assertIsConnectionState(\n state: unknown,\n): asserts state is ConnectionPHState {\n ConnectionPHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a Connection document */\nexport function isConnectionDocument(\n document: unknown,\n): document is ConnectionDocument {\n return ConnectionDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a Connection document */\nexport function assertIsConnectionDocument(\n document: unknown,\n): asserts document is ConnectionDocument {\n ConnectionDocumentSchema.parse(document);\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils, PHBaseState, Reducer } from \"document-model\";\nimport {\n baseCreateDocument,\n baseLoadFromInputVersioned,\n baseSaveToFileHandle,\n createBaseState,\n} from \"document-model\";\nimport { connectionUpgradeManifest } from \"../../upgrades/upgrade-manifest.js\";\nimport {\n assertIsConnectionDocument,\n assertIsConnectionState,\n isConnectionDocument,\n isConnectionState,\n} from \"./document-schema.js\";\nimport { connectionDocumentType } from \"./document-type.js\";\nimport { reducer } from \"./reducer.js\";\nimport type {\n ConnectionGlobalState,\n ConnectionLocalState,\n ConnectionPHState,\n} from \"./types.js\";\n\nexport const initialGlobalState: ConnectionGlobalState = {\n name: \"\",\n connectorId: \"\",\n authType: \"NONE\",\n config: {},\n secretRefs: [],\n status: \"UNCONFIGURED\",\n lastCheckedAt: null,\n lastError: null,\n accountLabel: null,\n};\nexport const initialLocalState: ConnectionLocalState = {};\n\nexport const utils: DocumentModelUtils<ConnectionPHState> = {\n fileExtension: \".conn\",\n createState(state) {\n return {\n ...createBaseState(state?.auth, { version: 1, ...state?.document }),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n return baseCreateDocument(utils.createState, state, connectionDocumentType);\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInputVersioned(input, {\n reducers: { 1: reducer as unknown as Reducer<PHBaseState> },\n upgradeManifest: connectionUpgradeManifest,\n });\n },\n isStateOfType(state) {\n return isConnectionState(state);\n },\n assertIsStateOfType(state) {\n return assertIsConnectionState(state);\n },\n isDocumentOfType(document) {\n return isConnectionDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsConnectionDocument(document);\n },\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { ConnectionPHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the Connection document model */\nexport const utils: DocumentModelUtils<ConnectionPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { ConnectionPHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the Connection document type */\nexport const Connection = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<ConnectionPHState>;\n"],"mappings":";;;;;AAuBA,MAAa,uBAAuB,MAClC,MAAM,KAAA,KAAa,MAAM;AAE3B,MAAa,0BAA0BA,IACpC,IAAI,CAAC,CACL,QAAQ,MAAM,oBAAoB,CAAC,CAAC;AAEvC,MAAa,2BAA2BA,IAAE,KAAK;CAC7C;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,yBAAyBA,IAAE,KAAK;CAC3C;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,wBAEd;CACA,OAAOA,IAAE,OAAO;EACd,YAAYA,IAAE,QAAQ,iBAAiB,CAAC,CAAC,SAAS;EAClD,cAAcA,IAAE,OAAO,CAAC,CAAC,QAAQ;EACjC,UAAU;EACV,QAAQA,IAAE,QAAQ;EAClB,aAAaA,IAAE,OAAO;EACtB,eAAeA,IAAE,IAAI,SAAS,CAAC,CAAC,QAAQ;EACxC,WAAWA,IAAE,OAAO,CAAC,CAAC,QAAQ;EAC9B,MAAMA,IA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,qBACA,EAAE,GAAG,MAAM,GACX,KAAA,GACA,4BACA,QACF;;;;;;;;;;;;ACzBF,MAAa,qBAAqB,UAChC,aACE,uBACA,EAAE,GAAG,MAAM,GACX,KAAA,GACA,8BACA,QACF;AAEF,MAAa,gBAAgB,UAC3B,aACE,iBACA,EAAE,GAAG,MAAM,GACX,KAAA,GACA,yBACA,QACF;AAEF,MAAa,mBAAmB,UAC9B,aACE,qBACA,EAAE,GAAG,MAAM,GACX,KAAA,GACA,4BACA,QACF;;;;;;;;ACrCF,MAAa,qBAAqB,UAChC,aACE,uBACA,EAAE,GAAG,MAAM,GACX,KAAA,GACA,8BACA,QACF;;;;;;;;ACHF,MAAa,UAAU;CACrB,GAAG;CACH,GAAGC;CACH,GAAGC;CACH,GAAGC;AACL;;;AChBA,MAAa,gBAA0C;CACrD,IAAI;CACJ,MAAM;CACN,QAAQ;EACN,MAAM;EACN,SAAS;CACX;CACA,WAAW;CACX,aACE;CACF,gBAAgB,CACd;EACE,OAAO;GACL,OAAO;IACL,QAAQ;IACR,UAAU,CAAC;IACX,cAAc;GAChB;GACA,QAAQ;IACN,QACE;IACF,UAAU,CAAC;IACX,cACE;GACJ;EACF;EACA,SAAS;GACP;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SAAS;MACT,QAAQ,CAAC;MACT,UAAU,CAAC;MACX,OAAO;KACT;KACA;MACE,IAAI;MACJ,MAAM;MACN,aACE;MACF,QACE;MACF,UACE;MACF,SACE;MACF,QAAQ,CAAC;MACT,UAAU,CAAC;MACX,OAAO;KACT;KACA;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QACE;MACF,UAAU;MACV,SACE;MACF,QAAQ,CAAC;MACT,UAAU,CAAC;MACX,OAAO;KACT;IACF;GACF;GACA;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ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AAaC,UAA+C;CAC1D,eAAe;CACf,YAAY,OAAO;EACjB,OAAO;GACL,GAAG,gBAAgB,OAAO,MAAM;IAAE,SAAS;IAAG,GAAG,OAAO;GAAS,CAAC;GAClE,QAAQ;IAAE,GAAG;IAAoB,GAAG,OAAO;GAAO;GAClD,OAAO;IAAE,GAAG;IAAmB,GAAG,OAAO;GAAM;EACjD;CACF;CACA,eAAe,OAAO;EACpB,OAAO,mBAAmBA,QAAM,aAAa,OAAO,sBAAsB;CAC5E;CACA,iBAAiB,UAAU,OAAO;EAChC,OAAO,qBAAqB,UAAU,KAAK;CAC7C;CACA,cAAc,OAAO;EACnB,OAAO,2BAA2B,OAAO;GACvC,UAAU,EAAE,GAAG,QAA2C;GAC1D,iBAAiB;EACnB,CAAC;CACH;CACA,cAAc,OAAO;EACnB,OAAO,kBAAkB,KAAK;CAChC;CACA,oBAAoB,OAAO;EACzB,OAAO,wBAAwB,KAAK;CACtC;CACA,iBAAiB,UAAU;EACzB,OAAO,qBAAqB,QAAQ;CACtC;CACA,uBAAuB,UAAU;EAC/B,OAAO,2BAA2B,QAAQ;CAC5C;AACF;;;;;;;AE9DA,MAAa,QAA+C;CAC1D,GAAGC;CACH,GAAGC;AACL;;;;ACAA,MAAa,aAAa;CACxB,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,iBAAiB,GAAG,aAAa;AAC9D"}
@@ -0,0 +1,113 @@
1
+ //#region editors/connection-editor/piece-auth.ts
2
+ function isConfigValueMissing(value) {
3
+ return value === void 0 || value === null || value === "";
4
+ }
5
+ function isAuthComplete(plan, config, refs) {
6
+ const configOk = plan.configFields.every((field) => !field.required || !isConfigValueMissing(config[field.name]));
7
+ const secretsOk = plan.secretFields.every((field) => !field.required || Boolean(refs.get(field.name)));
8
+ return configOk && secretsOk;
9
+ }
10
+ function toField(name, prop) {
11
+ return {
12
+ name,
13
+ displayName: prop.displayName ?? name,
14
+ required: prop.required ?? false,
15
+ description: prop.description,
16
+ inputType: prop.type,
17
+ options: prop.options?.options?.filter((option) => option.value !== void 0).map((option) => ({
18
+ label: option.label ?? String(option.value),
19
+ value: option.value
20
+ }))
21
+ };
22
+ }
23
+ function plansFromAuth(auth) {
24
+ const plans = (Array.isArray(auth) ? auth : [auth]).map(planFromAuth);
25
+ return plans.filter((plan, index) => plans.findIndex((other) => other.authType === plan.authType) === index);
26
+ }
27
+ function planForConnection(auth, authType) {
28
+ return plansFromAuth(auth).find((plan) => plan.authType === authType && plan.supported) ?? planFromAuth(auth);
29
+ }
30
+ function planFromAuth(auth) {
31
+ if (Array.isArray(auth)) {
32
+ const plans = auth.map(planFromAuth);
33
+ return plans.find((plan) => plan.supported && plan.authType !== "NONE") ?? plans.at(0) ?? planFromAuth(null);
34
+ }
35
+ const descriptor = auth ?? null;
36
+ const plan = planForDescriptor(descriptor);
37
+ return descriptor?.unsupported ? {
38
+ ...plan,
39
+ supported: false
40
+ } : plan;
41
+ }
42
+ function planForDescriptor(descriptor) {
43
+ const base = {
44
+ displayName: descriptor?.displayName,
45
+ description: descriptor?.description
46
+ };
47
+ switch (descriptor?.type) {
48
+ case "SECRET_TEXT": return {
49
+ ...base,
50
+ authType: "SECRET_TEXT",
51
+ configFields: [],
52
+ secretFields: [{
53
+ name: "value",
54
+ displayName: descriptor.displayName ?? "Secret",
55
+ required: descriptor.required ?? true,
56
+ description: descriptor.description
57
+ }],
58
+ supported: true
59
+ };
60
+ case "BASIC_AUTH": {
61
+ const props = descriptor.props ?? {};
62
+ return {
63
+ ...base,
64
+ authType: "BASIC_AUTH",
65
+ configFields: [toField("username", props.username ?? { displayName: "Username" })],
66
+ secretFields: [toField("password", props.password ?? { displayName: "Password" })],
67
+ supported: true
68
+ };
69
+ }
70
+ case "CUSTOM_AUTH": {
71
+ const entries = Object.entries(descriptor.props ?? {}).filter((entry) => entry[1] !== void 0);
72
+ return {
73
+ ...base,
74
+ authType: "CUSTOM_AUTH",
75
+ configFields: entries.filter(([, prop]) => prop.type !== "SECRET_TEXT").map(([name, prop]) => toField(name, prop)),
76
+ secretFields: entries.filter(([, prop]) => prop.type === "SECRET_TEXT").map(([name, prop]) => toField(name, prop)),
77
+ supported: true
78
+ };
79
+ }
80
+ case "OAUTH2": return {
81
+ ...base,
82
+ authType: "OAUTH2",
83
+ configFields: [],
84
+ secretFields: [],
85
+ supported: false
86
+ };
87
+ case "OIDC": return {
88
+ ...base,
89
+ authType: "OIDC",
90
+ configFields: [],
91
+ secretFields: [],
92
+ supported: false
93
+ };
94
+ default: return {
95
+ ...base,
96
+ authType: "NONE",
97
+ configFields: [],
98
+ secretFields: [],
99
+ supported: true
100
+ };
101
+ }
102
+ }
103
+ function connectorIdForPiece(packageName) {
104
+ return `${packageName}#${packageName.split("/").pop()?.replace(/^piece-/, "") ?? packageName}`;
105
+ }
106
+ function packageFromConnectorId(connectorId) {
107
+ const separator = connectorId.lastIndexOf("#");
108
+ return separator > 0 ? connectorId.slice(0, separator) : connectorId;
109
+ }
110
+ //#endregion
111
+ export { planForConnection as a, packageFromConnectorId as i, isAuthComplete as n, planFromAuth as o, isConfigValueMissing as r, plansFromAuth as s, connectorIdForPiece as t };
112
+
113
+ //# sourceMappingURL=piece-auth-Z4mZEOtL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piece-auth-Z4mZEOtL.js","names":[],"sources":["../../editors/connection-editor/piece-auth.ts"],"sourcesContent":["// Turns a piece's PieceAuth descriptor into a concrete field plan that maps\n// onto powerhouse/connection state: config fields vs secret refs.\nimport type { ConnectionAuthType } from \"document-models/connection\";\n\nexport interface AuthField {\n name: string;\n displayName: string;\n required: boolean;\n description?: string;\n // Non-secret fields only: SHORT_TEXT | NUMBER | CHECKBOX | STATIC_DROPDOWN.\n inputType?: string;\n options?: { label: string; value: unknown }[];\n}\n\nexport interface AuthPlan {\n authType: ConnectionAuthType;\n displayName?: string;\n description?: string;\n configFields: AuthField[];\n secretFields: AuthField[];\n // OAUTH2 / OIDC are declared but not executable by the runtime yet.\n supported: boolean;\n}\n\n// Missing means unset, explicitly null, or emptied to \"\" - not `false`/`0`.\nexport function isConfigValueMissing(value: unknown): boolean {\n return value === undefined || value === null || value === \"\";\n}\n\n// Whether every required config/secret field of the plan is filled; pure so\n// it can drive a live re-check as the user edits, not just a one-time mark.\nexport function isAuthComplete(\n plan: AuthPlan,\n config: Record<string, unknown>,\n refs: Map<string, string>,\n): boolean {\n const configOk = plan.configFields.every(\n (field) => !field.required || !isConfigValueMissing(config[field.name]),\n );\n const secretsOk = plan.secretFields.every(\n (field) => !field.required || Boolean(refs.get(field.name)),\n );\n return configOk && secretsOk;\n}\n\ninterface AuthPropDescriptor {\n displayName?: string;\n description?: string;\n required?: boolean;\n type?: string;\n options?: { options?: { label?: string; value?: unknown }[] };\n}\n\ninterface PieceAuthDescriptor {\n type?: string;\n unsupported?: string;\n displayName?: string;\n description?: string;\n required?: boolean;\n props?: Partial<Record<string, AuthPropDescriptor>>;\n}\n\nfunction toField(name: string, prop: AuthPropDescriptor): AuthField {\n return {\n name,\n displayName: prop.displayName ?? name,\n required: prop.required ?? false,\n description: prop.description,\n inputType: prop.type,\n options: prop.options?.options\n ?.filter((option) => option.value !== undefined)\n .map((option) => ({\n label: option.label ?? String(option.value as string),\n value: option.value,\n })),\n };\n}\n\n// Every sign-in method a piece offers, in its order, one per auth type.\nexport function plansFromAuth(auth: unknown): AuthPlan[] {\n const plans = (Array.isArray(auth) ? auth : [auth]).map(planFromAuth);\n return plans.filter(\n (plan, index) =>\n plans.findIndex((other) => other.authType === plan.authType) === index,\n );\n}\n\n// The method a connection signs in with: the one of its auth type when the\n// runtime can run it, otherwise the piece's default.\nexport function planForConnection(\n auth: unknown,\n authType: ConnectionAuthType,\n): AuthPlan {\n return (\n plansFromAuth(auth).find(\n (plan) => plan.authType === authType && plan.supported,\n ) ?? planFromAuth(auth)\n );\n}\n\nexport function planFromAuth(auth: unknown): AuthPlan {\n // Some pieces declare multiple auth methods; prefer one the runtime supports.\n if (Array.isArray(auth)) {\n const plans = auth.map(planFromAuth);\n return (\n plans.find((plan) => plan.supported && plan.authType !== \"NONE\") ??\n plans.at(0) ??\n planFromAuth(null)\n );\n }\n const descriptor = (auth ?? null) as PieceAuthDescriptor | null;\n const plan = planForDescriptor(descriptor);\n // The runtime's own verdict, e.g. a CUSTOM_AUTH that needs token refresh.\n return descriptor?.unsupported ? { ...plan, supported: false } : plan;\n}\n\nfunction planForDescriptor(descriptor: PieceAuthDescriptor | null): AuthPlan {\n const base = {\n displayName: descriptor?.displayName,\n description: descriptor?.description,\n };\n switch (descriptor?.type) {\n case \"SECRET_TEXT\":\n return {\n ...base,\n authType: \"SECRET_TEXT\",\n configFields: [],\n secretFields: [\n {\n name: \"value\",\n displayName: descriptor.displayName ?? \"Secret\",\n required: descriptor.required ?? true,\n description: descriptor.description,\n },\n ],\n supported: true,\n };\n case \"BASIC_AUTH\": {\n const props = descriptor.props ?? {};\n return {\n ...base,\n authType: \"BASIC_AUTH\",\n configFields: [\n toField(\"username\", props.username ?? { displayName: \"Username\" }),\n ],\n secretFields: [\n toField(\"password\", props.password ?? { displayName: \"Password\" }),\n ],\n supported: true,\n };\n }\n case \"CUSTOM_AUTH\": {\n const entries = Object.entries(descriptor.props ?? {}).filter(\n (entry): entry is [string, AuthPropDescriptor] =>\n entry[1] !== undefined,\n );\n return {\n ...base,\n authType: \"CUSTOM_AUTH\",\n configFields: entries\n .filter(([, prop]) => prop.type !== \"SECRET_TEXT\")\n .map(([name, prop]) => toField(name, prop)),\n secretFields: entries\n .filter(([, prop]) => prop.type === \"SECRET_TEXT\")\n .map(([name, prop]) => toField(name, prop)),\n supported: true,\n };\n }\n case \"OAUTH2\":\n return {\n ...base,\n authType: \"OAUTH2\",\n configFields: [],\n secretFields: [],\n supported: false,\n };\n case \"OIDC\":\n return {\n ...base,\n authType: \"OIDC\",\n configFields: [],\n secretFields: [],\n supported: false,\n };\n default:\n return {\n ...base,\n authType: \"NONE\",\n configFields: [],\n secretFields: [],\n supported: true,\n };\n }\n}\n\n// \"@activepieces/piece-gotify\" -> \"@activepieces/piece-gotify#gotify\"\nexport function connectorIdForPiece(packageName: string): string {\n const short =\n packageName\n .split(\"/\")\n .pop()\n ?.replace(/^piece-/, \"\") ?? packageName;\n return `${packageName}#${short}`;\n}\n\nexport function packageFromConnectorId(connectorId: string): string {\n const separator = connectorId.lastIndexOf(\"#\");\n return separator > 0 ? connectorId.slice(0, separator) : connectorId;\n}\n"],"mappings":";AAyBA,SAAgB,qBAAqB,OAAyB;CAC5D,OAAO,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU;AAC5D;AAIA,SAAgB,eACd,MACA,QACA,MACS;CACT,MAAM,WAAW,KAAK,aAAa,OAChC,UAAU,CAAC,MAAM,YAAY,CAAC,qBAAqB,OAAO,MAAM,KAAK,CACxE;CACA,MAAM,YAAY,KAAK,aAAa,OACjC,UAAU,CAAC,MAAM,YAAY,QAAQ,KAAK,IAAI,MAAM,IAAI,CAAC,CAC5D;CACA,OAAO,YAAY;AACrB;AAmBA,SAAS,QAAQ,MAAc,MAAqC;CAClE,OAAO;EACL;EACA,aAAa,KAAK,eAAe;EACjC,UAAU,KAAK,YAAY;EAC3B,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,SAAS,KAAK,SAAS,SACnB,QAAQ,WAAW,OAAO,UAAU,KAAA,CAAS,CAAC,CAC/C,KAAK,YAAY;GAChB,OAAO,OAAO,SAAS,OAAO,OAAO,KAAe;GACpD,OAAO,OAAO;EAChB,EAAE;CACN;AACF;AAGA,SAAgB,cAAc,MAA2B;CACvD,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI,EAAA,CAAG,IAAI,YAAY;CACpE,OAAO,MAAM,QACV,MAAM,UACL,MAAM,WAAW,UAAU,MAAM,aAAa,KAAK,QAAQ,MAAM,KACrE;AACF;AAIA,SAAgB,kBACd,MACA,UACU;CACV,OACE,cAAc,IAAI,CAAC,CAAC,MACjB,SAAS,KAAK,aAAa,YAAY,KAAK,SAC/C,KAAK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D,KAAK,CAAC,MAAM,UAAU,QAAQ,MAAM,IAAI,CAAC;IAC5C,WAAW;GACb;EACF;EACA,KAAK,UACH,OAAO;GACL,GAAG;GACH,UAAU;GACV,cAAc,CAAC;GACf,cAAc,CAAC;GACf,WAAW;EACb;EACF,KAAK,QACH,OAAO;GACL,GAAG;GACH,UAAU;GACV,cAAc,CAAC;GACf,cAAc,CAAC;GACf,WAAW;EACb;EACF,SACE,OAAO;GACL,GAAG;GACH,UAAU;GACV,cAAc,CAAC;GACf,cAAc,CAAC;GACf,WAAW;EACb;CACJ;AACF;AAGA,SAAgB,oBAAoB,aAA6B;CAM/D,OAAO,GAAG,YAAY,GAJpB,YACG,MAAM,GAAG,CAAC,CACV,IAAI,CAAC,EACJ,QAAQ,WAAW,EAAE,KAAK;AAElC;AAEA,SAAgB,uBAAuB,aAA6B;CAClE,MAAM,YAAY,YAAY,YAAY,GAAG;CAC7C,OAAO,YAAY,IAAI,YAAY,MAAM,GAAG,SAAS,IAAI;AAC3D"}
@@ -1,5 +1,5 @@
1
- import { n as powerhouse_manifest_default, t as documentModels } from "../document-models-BYheX-te.js";
2
- import { t as upgradeManifests } from "../upgrade-manifests-Cnpfo6kC.js";
1
+ import { n as powerhouse_manifest_default, t as documentModels } from "../document-models-C6ebrsd9.js";
2
+ import { t as upgradeManifests } from "../upgrade-manifests-BLrv3cf2.js";
3
3
  //#region reactor/index.ts
4
4
  const manifest = powerhouse_manifest_default;
5
5
  //#endregion
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
8
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
9
  var __exportAll = (all, no_symbols) => {
10
10
  let target = {};
11
11
  for (var name in all) __defProp(target, name, {
@@ -25,7 +25,7 @@ var __copyProps = (to, from, except, desc) => {
25
25
  }
26
26
  return to;
27
27
  };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
29
  value: mod,
30
30
  enumerable: true
31
31
  }) : target, mod));
@@ -1,103 +1,7 @@
1
1
  import { ambientRenownTokenProvider } from "@powerhousedao/reactor-browser/graphql-client";
2
- //#region editors/connection-editor/piece-auth.ts
3
- function isConfigValueMissing(value) {
4
- return value === void 0 || value === null || value === "";
5
- }
6
- function isAuthComplete(plan, config, refs) {
7
- const configOk = plan.configFields.every((field) => !field.required || !isConfigValueMissing(config[field.name]));
8
- const secretsOk = plan.secretFields.every((field) => !field.required || Boolean(refs.get(field.name)));
9
- return configOk && secretsOk;
10
- }
11
- function toField(name, prop) {
12
- return {
13
- name,
14
- displayName: prop.displayName ?? name,
15
- required: prop.required ?? false,
16
- description: prop.description,
17
- inputType: prop.type,
18
- options: prop.options?.options?.filter((option) => option.value !== void 0).map((option) => ({
19
- label: option.label ?? String(option.value),
20
- value: option.value
21
- }))
22
- };
23
- }
24
- function planFromAuth(auth) {
25
- if (Array.isArray(auth)) {
26
- const plans = auth.map(planFromAuth);
27
- return plans.find((plan) => plan.supported && plan.authType !== "NONE") ?? plans.at(0) ?? planFromAuth(null);
28
- }
29
- const descriptor = auth ?? null;
30
- const base = {
31
- displayName: descriptor?.displayName,
32
- description: descriptor?.description
33
- };
34
- switch (descriptor?.type) {
35
- case "SECRET_TEXT": return {
36
- ...base,
37
- authType: "SECRET_TEXT",
38
- configFields: [],
39
- secretFields: [{
40
- name: "value",
41
- displayName: descriptor.displayName ?? "Secret",
42
- required: descriptor.required ?? true,
43
- description: descriptor.description
44
- }],
45
- supported: true
46
- };
47
- case "BASIC_AUTH": {
48
- const props = descriptor.props ?? {};
49
- return {
50
- ...base,
51
- authType: "BASIC_AUTH",
52
- configFields: [toField("username", props.username ?? { displayName: "Username" })],
53
- secretFields: [toField("password", props.password ?? { displayName: "Password" })],
54
- supported: true
55
- };
56
- }
57
- case "CUSTOM_AUTH": {
58
- const entries = Object.entries(descriptor.props ?? {}).filter((entry) => entry[1] !== void 0);
59
- return {
60
- ...base,
61
- authType: "CUSTOM_AUTH",
62
- configFields: entries.filter(([, prop]) => prop.type !== "SECRET_TEXT").map(([name, prop]) => toField(name, prop)),
63
- secretFields: entries.filter(([, prop]) => prop.type === "SECRET_TEXT").map(([name, prop]) => toField(name, prop)),
64
- supported: true
65
- };
66
- }
67
- case "OAUTH2": return {
68
- ...base,
69
- authType: "OAUTH2",
70
- configFields: [],
71
- secretFields: [],
72
- supported: false
73
- };
74
- case "OIDC": return {
75
- ...base,
76
- authType: "OIDC",
77
- configFields: [],
78
- secretFields: [],
79
- supported: false
80
- };
81
- default: return {
82
- ...base,
83
- authType: "NONE",
84
- configFields: [],
85
- secretFields: [],
86
- supported: true
87
- };
88
- }
89
- }
90
- function connectorIdForPiece(packageName) {
91
- return `${packageName}#${packageName.split("/").pop()?.replace(/^piece-/, "") ?? packageName}`;
92
- }
93
- function packageFromConnectorId(connectorId) {
94
- const separator = connectorId.lastIndexOf("#");
95
- return separator > 0 ? connectorId.slice(0, separator) : connectorId;
96
- }
97
- //#endregion
98
2
  //#region editors/workflow-editor/ui/reactor-piece-form.ts
99
3
  const REACTOR_PIECE = "@powerhousedao/piece-reactor";
100
- const AUTOCOMPLETE_PROPS = new Set([
4
+ const AUTOCOMPLETE_PROPS = /* @__PURE__ */ new Set([
101
5
  "documentType",
102
6
  "documentId",
103
7
  "actionType",
@@ -196,30 +100,43 @@ const CORE_FORMS = {
196
100
  requireAuth: false,
197
101
  auth: "none",
198
102
  props: [
199
- dropdown("mode", "Mode", [{
200
- label: "Cron expression",
201
- value: "cron"
202
- }, {
203
- label: "Fixed interval",
204
- value: "interval"
205
- }], true),
206
- text("cron", "Cron expression", false, "Five fields, e.g. 0 9 * * 1-5 (09:00 on weekdays); cron mode only"),
207
- number("every", "Every", false, "Interval mode only; at least one minute"),
208
- dropdown("unit", "Unit", [
209
- {
210
- label: "Minutes",
211
- value: "minutes"
212
- },
213
- {
214
- label: "Hours",
215
- value: "hours"
216
- },
217
- {
218
- label: "Days",
219
- value: "days"
103
+ {
104
+ ...dropdown("mode", "Runs", [{
105
+ label: "On a cron schedule",
106
+ value: "cron"
107
+ }, {
108
+ label: "At a fixed interval",
109
+ value: "interval"
110
+ }]),
111
+ defaultValue: "cron"
112
+ },
113
+ {
114
+ ...text("cron", "Cron expression", true, "Five fields, e.g. 0 9 * * 1-5 runs at 09:00 on weekdays."),
115
+ showWhen: {
116
+ prop: "mode",
117
+ oneOf: ["cron", void 0],
118
+ unlessSet: "every"
220
119
  }
221
- ]),
222
- text("timezone", "Timezone", false, "IANA name, e.g. Europe/Lisbon; defaults to UTC")
120
+ },
121
+ shownWhen(number("every", "Every", true, "At least one minute."), "mode", ["interval"]),
122
+ shownWhen({
123
+ ...dropdown("unit", "Unit", [
124
+ {
125
+ label: "Minutes",
126
+ value: "minutes"
127
+ },
128
+ {
129
+ label: "Hours",
130
+ value: "hours"
131
+ },
132
+ {
133
+ label: "Days",
134
+ value: "days"
135
+ }
136
+ ]),
137
+ defaultValue: "minutes"
138
+ }, "mode", ["interval"]),
139
+ text("timezone", "Timezone", false, "An IANA name such as Europe/Lisbon. Defaults to UTC.")
223
140
  ]
224
141
  },
225
142
  "core#webhook": {
@@ -506,7 +423,7 @@ async function testTrigger(workflowId) {
506
423
  }
507
424
  const RUN_FIELDS = `id workflowId workflowName workflowVersion triggerKind
508
425
  triggerPayload status error startedAt endedAt rerunOf
509
- steps { stepId stepKey blockType status input output port error }`;
426
+ steps { stepId stepKey blockType status input output port error startedAt endedAt }`;
510
427
  async function fetchRuns(scope = {}) {
511
428
  return (await gql(`query Runs($workflowId: String, $driveId: String, $limit: Int) {
512
429
  workflowRuntime { runs(workflowId: $workflowId, driveId: $driveId, limit: $limit) { ${RUN_FIELDS} } }
@@ -540,6 +457,6 @@ async function loadBlockOptions(blockType, propName, input, connectionId) {
540
457
  })).workflowRuntime.blockOptions;
541
458
  }
542
459
  //#endregion
543
- export { connectorIdForPiece as C, planFromAuth as D, packageFromConnectorId as E, REACTOR_PIECE as S, isConfigValueMissing as T, rotateSecret as _, fetchConnections as a, testTrigger as b, fetchPieceTriggers as c, fetchWebhookEndpoint as d, fireWorkflow as f, rerunRun as g, loadBlockOptions as h, fetchBlockOutputTree as i, fetchRuns as l, invalidateConnections as m, checkConnection as n, fetchPieceActions as o, getBlockForm as p, createSecret as r, fetchPieceCatalog as s, DEFAULT_RUNTIME_URL as t, fetchSecretStat as u, searchBlocks as v, isAuthComplete as w, CORE_FORMS as x, setRuntimeUrl as y };
460
+ export { REACTOR_PIECE as S, rotateSecret as _, fetchConnections as a, testTrigger as b, fetchPieceTriggers as c, fetchWebhookEndpoint as d, fireWorkflow as f, rerunRun as g, loadBlockOptions as h, fetchBlockOutputTree as i, fetchRuns as l, invalidateConnections as m, checkConnection as n, fetchPieceActions as o, getBlockForm as p, createSecret as r, fetchPieceCatalog as s, DEFAULT_RUNTIME_URL as t, fetchSecretStat as u, searchBlocks as v, CORE_FORMS as x, setRuntimeUrl as y };
544
461
 
545
- //# sourceMappingURL=runtime-api-DKlnn45K.js.map
462
+ //# sourceMappingURL=runtime-api-xwvg5PzA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-api-xwvg5PzA.js","names":[],"sources":["../../editors/workflow-editor/ui/reactor-piece-form.ts","../../editors/workflow-editor/ui/forms.ts","../../editors/workflow-editor/runtime-api.ts"],"sourcesContent":["// How this editor renders the reactor piece's props.\n\n// The piece declares what any host could serve: DROPDOWNs with options() and\n// a JSON list of actions. This editor has richer controls for both — an\n// autocomplete that also takes an expression, and a per-action editor — so it\n// substitutes them by prop name. The piece stays portable; the mapping is the\n// one place that knows this editor can do better.\nimport type { BlockFormProp } from \"./forms.js\";\n\n// The piece this package ships, named as pieces/index.ts declares it.\nexport const REACTOR_PIECE = \"@powerhousedao/piece-reactor\";\n\n// Values that name a document or a model: a step is as likely to feed one\n// from an upstream expression as to pick it, which a select cannot express.\nconst AUTOCOMPLETE_PROPS = new Set([\n \"documentType\",\n \"documentId\",\n \"actionType\",\n \"parentId\",\n \"driveId\",\n]);\n\nexport function isReactorPieceBlock(blockType: string): boolean {\n return (\n blockType.startsWith(`${REACTOR_PIECE}#`) ||\n blockType.startsWith(`${REACTOR_PIECE}@`)\n );\n}\n\nexport function adaptReactorProps(props: BlockFormProp[]): BlockFormProp[] {\n const hasActionList = props.some((prop) => prop.name === \"actions\");\n return props.flatMap((prop): BlockFormProp[] => {\n if (prop.name === \"actions\") {\n return [{ ...prop, type: \"PH_ACTIONS\", hasDynamicResolver: true }];\n }\n // Beside an action list this prop is not a field of its own: it is where\n // the list's action types come from.\n if (prop.name === \"actionType\" && hasActionList) return [];\n if (AUTOCOMPLETE_PROPS.has(prop.name)) {\n return [{ ...prop, type: \"PH_AUTOCOMPLETE\", hasDynamicResolver: true }];\n }\n return [prop];\n });\n}\n","// Form descriptors driving property panels; pure data, mirrors the\n// ConnectorPropDescriptor shape from the workflow runtime.\n\nexport interface BlockFormProp {\n name: string;\n displayName: string;\n type: string;\n required: boolean;\n defaultValue?: unknown;\n staticOptions?: { label: string; value: unknown }[];\n hasDynamicResolver?: boolean;\n description?: string;\n placeholder?: string;\n // Sibling prop names whose values feed the resolver; a change re-runs it.\n refreshers?: string[];\n // Nested shape: ARRAY item fields, or what a DYNAMIC resolver produced.\n properties?: BlockFormProp[];\n // Folded behind \"Advanced\": fields with a working default, so the common\n // case is short. Opens expanded when set, else live config would be hidden.\n advanced?: boolean;\n // Shown only while a sibling prop holds one of these values; data, not a\n // predicate, so a piece form arriving as JSON can express it too.\n // Hidden also when `unlessSet` has a value (a mode the runtime infers).\n showWhen?: { prop: string; oneOf: unknown[]; unlessSet?: string };\n}\n\nexport interface BlockForm {\n title: string;\n requireAuth: boolean;\n // Whether the block takes a connection: none hides the field entirely.\n auth?: \"none\" | \"optional\" | \"required\";\n props: BlockFormProp[];\n // Piece triggers only: POLLING | WEBHOOK | APP_WEBHOOK. WEBHOOK triggers\n // are fed by a request, so the panel shows their endpoint URL.\n triggerStrategy?: string;\n}\n\nexport interface ConnectionSummary {\n id: string;\n name: string;\n connectorId: string;\n authType: string;\n status: string;\n accountLabel: string | null;\n}\n\nexport interface SecretStat {\n ref: string;\n label: string | null;\n version: number;\n status: string;\n createdAt: string;\n updatedAt: string;\n}\n\n// Minting seam for PH_SECRET_REF props: the field takes a value and the\n// document only ever receives the ref that comes back.\nexport interface SecretFormService {\n save: (input: {\n ref?: string;\n value: string;\n label: string;\n }) => Promise<SecretStat>;\n stat: (ref: string) => Promise<SecretStat | null>;\n}\n\nexport interface WebhookEndpoint {\n workflowId: string;\n url: string;\n // False when `url` is a bare path because the reactor has no public origin.\n absoluteUrl: boolean;\n armed: boolean;\n createdAt: string;\n}\n\nexport interface DesignTimeService {\n getBlockForm: (blockType: string) => Promise<BlockForm | null>;\n loadOptions: (\n blockType: string,\n propName: string,\n input: Record<string, unknown>,\n connectionId?: string,\n ) => Promise<unknown>;\n // Runs the current workflow's piece trigger test hook; sample items back.\n testTrigger?: () => Promise<unknown>;\n // The current workflow's webhook endpoint, for core#webhook triggers.\n webhookEndpoint?: () => Promise<WebhookEndpoint | null>;\n // Backs PH_SECRET_REF props; absent when the runtime refuses secret writes.\n secrets?: SecretFormService;\n // powerhouse/connection documents for the connection picker.\n listConnections?: () => Promise<ConnectionSummary[]>;\n // Drops the cached listing after the picker creates a connection.\n refreshConnections?: () => void;\n // The current workflow's most recent run, for a step's \"Last run\" preview.\n latestRun?: () => Promise<LatestRun | null>;\n}\n\nexport interface LatestRun {\n status: string;\n startedAt: string;\n triggerPayload: unknown;\n steps: {\n stepKey: string;\n status: string;\n input: unknown;\n output: unknown;\n error: string | null;\n }[];\n}\n\n// Ours, not the piece's: the reactor's poll cadence for a piece trigger.\n// Appended to every piece trigger's form; see splitPollInterval in the runtime.\nexport const POLL_INTERVAL_PROP: BlockFormProp = {\n name: \"pollEverySeconds\",\n displayName: \"Poll every (seconds)\",\n type: \"NUMBER\",\n required: false,\n description:\n \"How often the reactor checks this trigger; 60 at the least. Omit to follow the piece's own cadence.\",\n};\n\nconst text = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"SHORT_TEXT\",\n required,\n description,\n});\n\n// Takes a secret VALUE and commits only the minted ref, the way the\n// connection editor's SecretField does; the document never holds the value.\nconst secretRef = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"PH_SECRET_REF\",\n required,\n description,\n});\n\nconst number = (\n name: string,\n displayName: string,\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"NUMBER\",\n required,\n description,\n});\n\n// Marks a prop for the \"Advanced\" section without repeating the builders.\nconst advanced = (prop: BlockFormProp): BlockFormProp => ({\n ...prop,\n advanced: true,\n});\n\n// Hides a prop until a sibling holds one of `oneOf`.\nconst shownWhen = (\n prop: BlockFormProp,\n sibling: string,\n oneOf: unknown[],\n): BlockFormProp => ({ ...prop, showWhen: { prop: sibling, oneOf } });\n\nconst dropdown = (\n name: string,\n displayName: string,\n options: { label: string; value: unknown }[],\n required = false,\n description?: string,\n): BlockFormProp => ({\n name,\n displayName,\n type: \"STATIC_DROPDOWN\",\n required,\n description,\n staticOptions: options,\n});\n\n// Every scheme that verifies a signature, and so needs a secret.\nconst SIGNED_SCHEMES = [\"token\", \"hmac\", \"hmac-prefixed\", \"hmac-timestamped\"];\n\n// Schemes that compute a digest, and so take a hash and an encoding. `token`\n// presents the secret verbatim, so none of that applies to it.\nconst HMAC_SCHEMES = [\"hmac\", \"hmac-prefixed\", \"hmac-timestamped\"];\n\n// Hand-written forms for core blocks and triggers.\nexport const CORE_FORMS: Record<string, BlockForm> = {\n \"core#manual\": {\n title: \"Manual trigger\",\n requireAuth: false,\n auth: \"none\",\n props: [],\n },\n \"core#schedule\": {\n title: \"Schedule\",\n requireAuth: false,\n auth: \"none\",\n props: [\n // Optional at run time: an omitted mode follows whichever of cron or\n // every is set, so the form defaults to cron rather than demanding one.\n {\n ...dropdown(\"mode\", \"Runs\", [\n { label: \"On a cron schedule\", value: \"cron\" },\n { label: \"At a fixed interval\", value: \"interval\" },\n ]),\n defaultValue: \"cron\",\n },\n // No mode but an `every` is interval mode to the runtime, so no cron.\n {\n ...text(\n \"cron\",\n \"Cron expression\",\n true,\n \"Five fields, e.g. 0 9 * * 1-5 runs at 09:00 on weekdays.\",\n ),\n showWhen: {\n prop: \"mode\",\n oneOf: [\"cron\", undefined],\n unlessSet: \"every\",\n },\n },\n shownWhen(\n number(\"every\", \"Every\", true, \"At least one minute.\"),\n \"mode\",\n [\"interval\"],\n ),\n shownWhen(\n {\n ...dropdown(\"unit\", \"Unit\", [\n { label: \"Minutes\", value: \"minutes\" },\n { label: \"Hours\", value: \"hours\" },\n { label: \"Days\", value: \"days\" },\n ]),\n defaultValue: \"minutes\",\n },\n \"mode\",\n [\"interval\"],\n ),\n text(\n \"timezone\",\n \"Timezone\",\n false,\n \"An IANA name such as Europe/Lisbon. Defaults to UTC.\",\n ),\n ],\n },\n \"core#webhook\": {\n title: \"Webhook\",\n requireAuth: false,\n auth: \"none\",\n props: [\n dropdown(\n \"methods\",\n \"Method\",\n [\n { label: \"POST\", value: \"POST\" },\n { label: \"Any\", value: \"ANY\" },\n { label: \"GET\", value: \"GET\" },\n { label: \"PUT\", value: \"PUT\" },\n { label: \"PATCH\", value: \"PATCH\" },\n { label: \"DELETE\", value: \"DELETE\" },\n ],\n true,\n ),\n // Named by wire format, not by sender: authors match these against their\n // sender's docs, and one brand name would mislead about every other.\n dropdown(\n \"scheme\",\n \"Verification\",\n [\n { label: \"None — the URL's token only\", value: \"none\" },\n { label: \"Shared token in a header\", value: \"token\" },\n { label: \"HMAC digest\", value: \"hmac\" },\n {\n label: \"HMAC digest with a label (sha256=…)\",\n value: \"hmac-prefixed\",\n },\n {\n label: \"HMAC digest, timestamped (t=…,v1=…)\",\n value: \"hmac-timestamped\",\n },\n ],\n true,\n ),\n // Hidden while the scheme is None: a visible secret field on an\n // unverified endpoint invites a secret that is never checked.\n shownWhen(\n secretRef(\n \"secretRef\",\n \"Secret\",\n true,\n \"The shared secret: the value the header must equal, or the key the sender signs with\",\n ),\n \"scheme\",\n SIGNED_SCHEMES,\n ),\n advanced(\n shownWhen(\n text(\n \"header\",\n \"Header\",\n false,\n \"Where the token or signature is read from. Defaults to the header the chosen scheme conventionally uses; set it only if the sender differs\",\n ),\n \"scheme\",\n SIGNED_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n number(\n \"toleranceSeconds\",\n \"Replay window (seconds)\",\n false,\n \"Rejects a delivery signed longer ago than this, so a captured request expires. Default 300\",\n ),\n \"scheme\",\n [\"hmac-timestamped\"],\n ),\n ),\n // The layout frames the signature; these say how its digest was computed.\n // Senders pick them independently, so they are fields, not scheme names.\n advanced(\n shownWhen(\n dropdown(\"algorithm\", \"Hash\", [\n { label: \"SHA-256 (default)\", value: \"sha256\" },\n { label: \"SHA-1\", value: \"sha1\" },\n { label: \"SHA-512\", value: \"sha512\" },\n ]),\n \"scheme\",\n HMAC_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n dropdown(\"encoding\", \"Digest encoding\", [\n { label: \"Hexadecimal (default)\", value: \"hex\" },\n { label: \"Base64\", value: \"base64\" },\n ]),\n \"scheme\",\n HMAC_SCHEMES,\n ),\n ),\n advanced(\n shownWhen(\n text(\n \"prefix\",\n \"Signature label\",\n false,\n \"The literal before the digest. Defaults to the hash and an equals sign, e.g. sha256=. Leave blank for a sender that sends the digest with no label\",\n ),\n \"scheme\",\n [\"hmac-prefixed\"],\n ),\n ),\n advanced(\n text(\n \"dedupeField\",\n \"Event id field\",\n false,\n \"Where the sender puts its own event id, so a redelivery is accepted without a second run. A bare name reads a query param or a top-level body field; prefix with header: or body: to read a header or a nested path (header:x-delivery-id, body:data.object.id)\",\n ),\n ),\n advanced(\n number(\n \"dedupeTtlSeconds\",\n \"Dedupe window (seconds)\",\n false,\n \"How long an event id is remembered. Default 300\",\n ),\n ),\n advanced(\n text(\n \"challengeField\",\n \"Challenge field\",\n false,\n \"Echo this field back instead of running, for senders that verify the endpoint before registering it. Same header:/body: prefixes as the event id field\",\n ),\n ),\n advanced(\n dropdown(\n \"responseMode\",\n \"Response\",\n [\n { label: \"Answer immediately (202)\", value: \"async\" },\n { label: \"Wait for the run (200)\", value: \"sync\" },\n ],\n false,\n \"Waiting holds the sender's socket open for the whole run\",\n ),\n ),\n advanced(\n number(\n \"responseStatus\",\n \"Success status\",\n false,\n \"Status returned on acceptance. Default 202 async, 200 sync\",\n ),\n ),\n ],\n },\n \"core#branch\": {\n title: \"Branch\",\n requireAuth: false,\n auth: \"none\",\n props: [\n text(\n \"condition\",\n \"Condition\",\n true,\n \"e.g. {{steps.fetch.output.body.ok}}\",\n ),\n text(\n \"equals\",\n \"Equals\",\n false,\n \"Take the true port only when the condition matches this; omit for truthiness\",\n ),\n ],\n },\n \"core#assert\": {\n title: \"Assert\",\n requireAuth: false,\n auth: \"none\",\n props: [\n text(\n \"value\",\n \"Value\",\n true,\n \"e.g. {{steps.describe.output}} - the run fails when it is blank\",\n ),\n {\n name: \"rejectValues\",\n displayName: \"Rejected values\",\n type: \"ARRAY\",\n required: false,\n description:\n \"One per line; the run fails when the value matches any of them\",\n },\n {\n name: \"allowValues\",\n displayName: \"Allowed values\",\n type: \"ARRAY\",\n required: false,\n description:\n \"One per line; when set, anything else fails. Safer than a reject list for model output\",\n },\n {\n name: \"allowEmpty\",\n displayName: \"Allow empty\",\n type: \"CHECKBOX\",\n required: false,\n description: \"Accept a blank value instead of failing\",\n },\n text(\"message\", \"Failure message\", false, \"Replaces the default error\"),\n ],\n },\n};\n","// Design-time channel to the workflow-runtime subgraph: piece descriptors\n// and dynamic option resolution. Not document-model coupled.\nimport { ambientRenownTokenProvider } from \"@powerhousedao/reactor-browser/graphql-client\";\nimport {\n adaptReactorProps,\n isReactorPieceBlock,\n} from \"./ui/reactor-piece-form.js\";\nimport {\n CORE_FORMS,\n POLL_INTERVAL_PROP,\n type BlockForm,\n type BlockFormProp,\n} from \"./ui/forms.js\";\n\nexport const DEFAULT_RUNTIME_URL =\n \"http://localhost:4001/graphql/workflow-runtime\";\n\nlet currentRuntimeUrl: string | undefined;\n\n// Set by useSyncWorkflowRuntimeUrl from the drive's resolved switchboard URL.\nexport function setRuntimeUrl(url: string): void {\n if (url === currentRuntimeUrl) return;\n currentRuntimeUrl = url;\n // Cached design-time results belong to the previous switchboard.\n formCache.clear();\n outputTreeCache.clear();\n catalogCache = undefined;\n}\n\nfunction runtimeUrl(): string {\n return currentRuntimeUrl ?? DEFAULT_RUNTIME_URL;\n}\n\nasync function gql<T>(\n query: string,\n variables: Record<string, unknown>,\n): Promise<T> {\n // Mirrors the reactor-browser switchboard AI tool's auth: attach the\n // Renown bearer token when one is available, else go out anonymously.\n const token = await ambientRenownTokenProvider();\n const response = await fetch(runtimeUrl(), {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...(token ? { authorization: `Bearer ${token}` } : {}),\n },\n body: JSON.stringify({ query, variables }),\n });\n const body = (await response.json()) as {\n data?: T;\n errors?: { message: string }[];\n };\n if (body.errors?.length) throw new Error(body.errors[0].message);\n if (!body.data) throw new Error(\"Empty GraphQL response\");\n return body.data;\n}\n\ninterface BlockEntryDescriptor {\n displayName: string;\n requireAuth: boolean;\n props: BlockFormProp[];\n // Triggers only: POLLING | WEBHOOK | APP_WEBHOOK.\n strategy?: string;\n}\n\ninterface BlockDescriptorResult {\n workflowRuntime: {\n blockDescriptor: {\n displayName: string;\n auth?: unknown;\n action?: BlockEntryDescriptor;\n trigger?: BlockEntryDescriptor;\n } | null;\n };\n}\n\nconst formCache = new Map<string, Promise<BlockForm | null>>();\n\nexport function getBlockForm(blockType: string): Promise<BlockForm | null> {\n const core = CORE_FORMS[blockType] as BlockForm | undefined;\n if (core) return Promise.resolve(core);\n let cached = formCache.get(blockType);\n if (!cached) {\n cached = gql<BlockDescriptorResult>(\n `query Descriptor($blockType: String!) {\n workflowRuntime { blockDescriptor(blockType: $blockType) }\n }`,\n { blockType },\n ).then((data) => {\n const descriptor = data.workflowRuntime.blockDescriptor;\n const entry = descriptor?.action ?? descriptor?.trigger;\n if (!descriptor || !entry) return null;\n const isTrigger = !descriptor.action && Boolean(descriptor.trigger);\n // A poll cadence is meaningless for a trigger the provider pushes to,\n // or for one this reactor fires itself, so the prop is only offered\n // where it actually applies.\n const reactorPiece = isReactorPieceBlock(blockType);\n const polled = isTrigger && entry.strategy !== \"WEBHOOK\" && !reactorPiece;\n const props = reactorPiece ? adaptReactorProps(entry.props) : entry.props;\n return {\n title: `${descriptor.displayName} · ${entry.displayName}`,\n requireAuth: entry.requireAuth,\n auth: !descriptor.auth\n ? (\"none\" as const)\n : entry.requireAuth\n ? (\"required\" as const)\n : (\"optional\" as const),\n props: polled ? [...props, POLL_INTERVAL_PROP] : props,\n triggerStrategy: isTrigger ? entry.strategy : undefined,\n };\n });\n formCache.set(blockType, cached);\n cached.catch(() => formCache.delete(blockType));\n }\n return cached;\n}\n\nexport interface PieceSummary {\n name: string;\n displayName: string;\n description: string;\n logoUrl: string;\n version: string;\n actionCount: number;\n triggerCount: number;\n // Activepieces category ids, e.g. ARTIFICIAL_INTELLIGENCE, SALES_AND_CRM.\n categories: string[];\n // PieceAuth descriptor, verbatim from the piece; null when authless.\n auth?: unknown;\n // Why none of the piece's blocks can run on this reactor.\n unsupported?: string | null;\n}\n\nexport interface PieceActionEntry {\n name: string;\n displayName: string;\n description: string;\n blockType: string;\n unsupported?: string | null;\n}\n\nlet catalogCache: Promise<PieceSummary[]> | undefined;\n\nexport function fetchPieceCatalog(): Promise<PieceSummary[]> {\n catalogCache ??= gql<{ workflowRuntime: { pieceCatalog: PieceSummary[] } }>(\n `query Catalog { workflowRuntime { pieceCatalog } }`,\n {},\n ).then((data) => data.workflowRuntime.pieceCatalog);\n catalogCache.catch(() => (catalogCache = undefined));\n return catalogCache;\n}\n\nexport async function fetchPieceActions(\n packageName: string,\n): Promise<PieceActionEntry[]> {\n const data = await gql<{\n workflowRuntime: { pieceActions: { actions: PieceActionEntry[] } };\n }>(\n `query Actions($packageName: String!) {\n workflowRuntime { pieceActions(packageName: $packageName) }\n }`,\n { packageName },\n );\n return data.workflowRuntime.pieceActions.actions;\n}\n\nexport interface PieceTriggerEntry {\n name: string;\n displayName: string;\n description: string;\n strategy: string;\n blockType: string;\n unsupported?: string | null;\n}\n\nexport async function fetchPieceTriggers(\n packageName: string,\n): Promise<PieceTriggerEntry[]> {\n const data = await gql<{\n workflowRuntime: { pieceTriggers: { triggers: PieceTriggerEntry[] } };\n }>(\n `query Triggers($packageName: String!) {\n workflowRuntime { pieceTriggers(packageName: $packageName) }\n }`,\n { packageName },\n );\n return data.workflowRuntime.pieceTriggers.triggers;\n}\n\nexport interface BlockSearchHit {\n blockType: string;\n pieceName: string;\n pieceDisplayName: string;\n logoUrl: string;\n displayName: string;\n description: string;\n kind: \"action\" | \"trigger\";\n strategy: string | null;\n unsupported: string | null;\n}\n\nexport interface BlockSearchResult {\n status: \"ready\" | \"indexing\" | \"error\";\n hits: BlockSearchHit[];\n indexedPieces: number;\n error: string | null;\n}\n\n// Catalog-wide action/trigger search; \"indexing\" on the very first calls.\nexport async function searchBlocks(\n query: string,\n limit = 30,\n): Promise<BlockSearchResult> {\n const data = await gql<{\n workflowRuntime: { searchBlocks: BlockSearchResult };\n }>(\n `query SearchBlocks($query: String!, $limit: Int) {\n workflowRuntime { searchBlocks(query: $query, limit: $limit) {\n status indexedPieces error\n hits { blockType pieceName pieceDisplayName logoUrl displayName description kind strategy unsupported }\n } }\n }`,\n { query, limit },\n );\n return data.workflowRuntime.searchBlocks;\n}\n\nexport interface OutputTreeNode {\n name: string;\n type: string;\n description?: string;\n children?: OutputTreeNode[];\n}\n\nexport interface OutputTree {\n source: \"schema\" | \"sample\" | \"static\" | \"none\";\n nodes: OutputTreeNode[];\n}\n\nconst outputTreeCache = new Map<string, Promise<OutputTree>>();\n\nexport function fetchBlockOutputTree(\n blockType: string,\n config: unknown,\n): Promise<OutputTree> {\n const key = `${blockType}:${JSON.stringify(config ?? {})}`;\n let cached = outputTreeCache.get(key);\n if (!cached) {\n cached = gql<{ workflowRuntime: { blockOutputTree: OutputTree } }>(\n `query OutputTree($blockType: String!, $config: Unknown) {\n workflowRuntime { blockOutputTree(blockType: $blockType, config: $config) }\n }`,\n { blockType, config: config ?? {} },\n ).then((data) => data.workflowRuntime.blockOutputTree);\n outputTreeCache.set(key, cached);\n cached.catch(() => outputTreeCache.delete(key));\n }\n return cached;\n}\n\nexport interface ConnectionSummary {\n id: string;\n name: string;\n connectorId: string;\n authType: string;\n status: string;\n accountLabel: string | null;\n}\n\n// Deliberately uncached. The server scopes this list to the caller's read\n// access, and nothing here identifies the caller to key a cache on.\nexport function fetchConnections(): Promise<ConnectionSummary[]> {\n return gql<{\n workflowRuntime: { connections: ConnectionSummary[] };\n }>(\n `query Connections { workflowRuntime { connections { id name connectorId authType status accountLabel } } }`,\n {},\n ).then((data) => data.workflowRuntime.connections);\n}\n\n// Kept for the picker, which creates connections and then refreshes; there is\n// no longer a cache for it to drop.\nexport function invalidateConnections(): void {}\n\nexport interface ConnectionCheckResult {\n ok: boolean;\n detail: string;\n accountLabel: string | null;\n}\n\n// Runs the piece's own connection check against a document's stored credentials.\n// No secrets cross this boundary: the subgraph resolves refs server-side.\nexport function checkConnection(\n connectionId: string,\n): Promise<ConnectionCheckResult> {\n return gql<{\n workflowRuntime: { checkConnection: ConnectionCheckResult };\n }>(\n `mutation CheckConnection($connectionId: String!) {\n workflowRuntime {\n checkConnection(connectionId: $connectionId) {\n ok\n detail\n accountLabel\n }\n }\n }`,\n { connectionId },\n ).then((data) => data.workflowRuntime.checkConnection);\n}\n\nexport interface SecretStat {\n ref: string;\n label: string | null;\n version: number;\n status: \"ACTIVE\" | \"DELETED\";\n createdAt: string;\n updatedAt: string;\n}\n\nconst SECRET_FIELDS = \"ref label version status createdAt updatedAt\";\n\n// Mints a managed secret; only the returned ref ever enters a document.\nexport async function createSecret(\n value: string,\n label?: string,\n): Promise<SecretStat> {\n const data = await gql<{ workflowRuntime: { createSecret: SecretStat } }>(\n `mutation CreateSecret($value: String!, $label: String) {\n workflowRuntime { createSecret(value: $value, label: $label) { ${SECRET_FIELDS} } }\n }`,\n { value, label: label ?? null },\n );\n return data.workflowRuntime.createSecret;\n}\n\n// Same ref, version+1; referencing documents stay untouched.\nexport async function rotateSecret(\n ref: string,\n value: string,\n): Promise<SecretStat> {\n const data = await gql<{ workflowRuntime: { rotateSecret: SecretStat } }>(\n `mutation RotateSecret($ref: String!, $value: String!) {\n workflowRuntime { rotateSecret(ref: $ref, value: $value) { ${SECRET_FIELDS} } }\n }`,\n { ref, value },\n );\n return data.workflowRuntime.rotateSecret;\n}\n\n// Metadata only; null for unknown or legacy refs.\nexport async function fetchSecretStat(ref: string): Promise<SecretStat | null> {\n const data = await gql<{ workflowRuntime: { secret: SecretStat | null } }>(\n `query Secret($ref: String!) {\n workflowRuntime { secret(ref: $ref) { ${SECRET_FIELDS} } }\n }`,\n { ref },\n );\n return data.workflowRuntime.secret;\n}\n\nexport interface WebhookEndpointRecord {\n workflowId: string;\n url: string;\n // False when `url` is a bare path because the reactor has no public origin.\n absoluteUrl: boolean;\n armed: boolean;\n createdAt: string;\n}\n\n// Never cached: the runtime mints the endpoint on the first call and `armed`\n// tracks the workflow's status.\nexport async function fetchWebhookEndpoint(\n workflowId: string,\n): Promise<WebhookEndpointRecord | null> {\n const data = await gql<{\n workflowRuntime: { webhookEndpoint: WebhookEndpointRecord | null };\n }>(\n `query WebhookEndpoint($workflowId: String!) {\n workflowRuntime {\n webhookEndpoint(workflowId: $workflowId) {\n workflowId url absoluteUrl armed createdAt\n }\n }\n }`,\n { workflowId },\n );\n return data.workflowRuntime.webhookEndpoint;\n}\n\nexport async function testTrigger(workflowId: string): Promise<unknown> {\n const data = await gql<{ workflowRuntime: { testTrigger: unknown } }>(\n `mutation TestTrigger($workflowId: String!) {\n workflowRuntime { testTrigger(workflowId: $workflowId) }\n }`,\n { workflowId },\n );\n return data.workflowRuntime.testTrigger;\n}\n\nexport interface RunStepRecord {\n stepId: string;\n stepKey: string;\n blockType: string;\n status: string;\n input: unknown;\n output: unknown;\n port: string | null;\n error: string | null;\n // Null for skipped and replayed steps, and for runs journaled before timings.\n startedAt: string | null;\n endedAt: string | null;\n}\n\nexport interface RunRecord {\n id: string;\n workflowId: string;\n workflowName: string;\n workflowVersion: number;\n triggerKind: string;\n triggerPayload: unknown;\n status: string;\n error: string | null;\n startedAt: string;\n endedAt: string | null;\n rerunOf: string | null;\n steps: RunStepRecord[];\n}\n\nconst RUN_FIELDS = `id workflowId workflowName workflowVersion triggerKind\n triggerPayload status error startedAt endedAt rerunOf\n steps { stepId stepKey blockType status input output port error startedAt endedAt }`;\n\nexport interface RunsScope {\n workflowId?: string;\n // Scopes runs to the workflows the drive holds; ignored alongside workflowId.\n driveId?: string;\n limit?: number;\n}\n\nexport async function fetchRuns(scope: RunsScope = {}): Promise<RunRecord[]> {\n const data = await gql<{ workflowRuntime: { runs: RunRecord[] } }>(\n `query Runs($workflowId: String, $driveId: String, $limit: Int) {\n workflowRuntime { runs(workflowId: $workflowId, driveId: $driveId, limit: $limit) { ${RUN_FIELDS} } }\n }`,\n {\n workflowId: scope.workflowId ?? null,\n driveId: scope.driveId ?? null,\n limit: scope.limit ?? 30,\n },\n );\n return data.workflowRuntime.runs;\n}\n\nexport interface FireResult {\n runId: string | null;\n status: string;\n error: string | null;\n}\n\nexport async function fireWorkflow(\n workflowId: string,\n payload?: unknown,\n): Promise<FireResult> {\n const data = await gql<{ workflowRuntime: { fire: FireResult } }>(\n `mutation Fire($workflowId: String!, $payload: Unknown) {\n workflowRuntime { fire(workflowId: $workflowId, payload: $payload) { runId status error } }\n }`,\n { workflowId, payload: payload ?? {} },\n );\n return data.workflowRuntime.fire;\n}\n\n// Resume a FAILED run: succeeded steps replay, execution restarts at the\n// failure. Returns the new run.\nexport async function rerunRun(runId: string): Promise<FireResult> {\n const data = await gql<{ workflowRuntime: { rerun: FireResult } }>(\n `mutation Rerun($runId: String!) {\n workflowRuntime { rerun(runId: $runId) { runId status error } }\n }`,\n { runId },\n );\n return data.workflowRuntime.rerun;\n}\n\ninterface BlockOptionsResult {\n workflowRuntime: { blockOptions: unknown };\n}\n\nexport async function loadBlockOptions(\n blockType: string,\n propName: string,\n input: Record<string, unknown>,\n connectionId?: string,\n): Promise<unknown> {\n const data = await gql<BlockOptionsResult>(\n `query Options($blockType: String!, $propName: String!, $input: Unknown, $connectionId: String) {\n workflowRuntime { blockOptions(blockType: $blockType, propName: $propName, input: $input, connectionId: $connectionId) }\n }`,\n { blockType, propName, input, connectionId: connectionId ?? null },\n );\n return data.workflowRuntime.blockOptions;\n}\n"],"mappings":";;AAUA,MAAa,gBAAgB;AAI7B,MAAM,qCAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,oBAAoB,WAA4B;CAC9D,OACE,UAAU,WAAW,+BAAmB,KACxC,UAAU,WAAW,+BAAmB;AAE5C;AAEA,SAAgB,kBAAkB,OAAyC;CACzE,MAAM,gBAAgB,MAAM,MAAM,SAAS,KAAK,SAAS,SAAS;CAClE,OAAO,MAAM,SAAS,SAA0B;EAC9C,IAAI,KAAK,SAAS,WAChB,OAAO,CAAC;GAAE,GAAG;GAAM,MAAM;GAAc,oBAAoB;EAAK,CAAC;EAInE,IAAI,KAAK,SAAS,gBAAgB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E,UACE,SAAS,YAAY,mBAAmB,CACtC;IAAE,OAAO;IAAyB,OAAO;GAAM,GAC/C;IAAE,OAAO;IAAU,OAAO;GAAS,CACrC,CAAC,GACD,UACA,YACF,CACF;GACA,SACE,UACE,KACE,UACA,mBACA,OACA,oJACF,GACA,UACA,CAAC,eAAe,CAClB,CACF;GACA,SACE,KACE,eACA,kBACA,OACA,iQACF,CACF;GACA,SACE,OACE,oBACA,2BACA,OACA,iDACF,CACF;GACA,SACE,KACE,kBACA,mBACA,OACA,wJACF,CACF;GACA,SACE,SACE,gBACA,YACA,CACE;IAAE,OAAO;IAA4B,OAAO;GAAQ,GACpD;IAAE,OAAO;IAA0B,OAAO;GAAO,CACnD,GACA,OACA,0DACF,CACF;GACA,SACE,OACE,kBACA,kBACA,OACA,4DACF,CACF;EACF;CACF;CACA,eAAe;EACb,OAAO;EACP,aAAa;EACb,MAAM;EACN,OAAO,CACL,KACE,aACA,aACA,MACA,qCACF,GACA,KACE,UACA,UACA,OACA,8EACF,CACF;CACF;CACA,eAAe;EACb,OAAO;EACP,aAAa;EACb,MAAM;EACN,OAAO;GACL,KACE,SACA,SACA,MACA,iEACF;GACA;IACE,MAAM;IACN,aAAa;IACb,MAAM;IACN,UAAU;IACV,aACE;GACJ;GACA;IACE,MAAM;IACN,aAAa;IACb,MAAM;IACN,UAAU;IACV,aACE;GACJ;GACA;IACE,MAAM;IACN,aAAa;IACb,MAAM;IACN,UAAU;IACV,aAAa;GACf;GACA,KAAK,WAAW,mBAAmB,OAAO,4BAA4B;EACxE;CACF;AACF;;;ACvcA,MAAa,sBACX;AAEF,IAAI;AAGJ,SAAgB,cAAc,KAAmB;CAC/C,IAAI,QAAQ,mBAAmB;CAC/B,oBAAoB;CAEpB,UAAU,MAAM;CAChB,gBAAgB,MAAM;CACtB,eAAe,KAAA;AACjB;AAEA,SAAS,aAAqB;CAC5B,OAAO,qBAAA;AACT;AAEA,eAAe,IACb,OACA,WACY;CAGZ,MAAM,QAAQ,MAAM,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