windmill-components 1.655.2 → 1.665.1

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 (650) hide show
  1. package/package/components/ApiConnectForm.svelte +6 -6
  2. package/package/components/ApiConnectForm.svelte.d.ts +3 -2
  3. package/package/components/AppConnectDrawer.svelte +3 -1
  4. package/package/components/AppConnectDrawer.svelte.d.ts +2 -0
  5. package/package/components/AppConnectInner.svelte +137 -72
  6. package/package/components/AppConnectInner.svelte.d.ts +1 -0
  7. package/package/components/CompareWorkspaces.svelte +32 -24
  8. package/package/components/DBManager.svelte +7 -13
  9. package/package/components/DBTable.svelte +2 -2
  10. package/package/components/DBTableEditor.svelte +39 -31
  11. package/package/components/DBTableEditor.svelte.d.ts +2 -2
  12. package/package/components/DedicatedWorkersSelector.svelte +292 -85
  13. package/package/components/DeployWorkspace.svelte +30 -26
  14. package/package/components/Dev.svelte +7 -2
  15. package/package/components/Dev.svelte.d.ts +3 -0
  16. package/package/components/Editor.svelte +17 -13
  17. package/package/components/EditorBar.svelte.d.ts +1 -1
  18. package/package/components/FilterSearchbar.svelte +1 -1
  19. package/package/components/FirstStepInputs.svelte +0 -1
  20. package/package/components/FlowBuilder.svelte +5 -0
  21. package/package/components/FlowGraphDiffViewer.svelte +3 -0
  22. package/package/components/FlowGraphViewer.svelte +7 -4
  23. package/package/components/FlowGraphViewer.svelte.d.ts +1 -0
  24. package/package/components/FlowGraphViewerStep.svelte +3 -3
  25. package/package/components/FlowGraphViewerStep.svelte.d.ts +1 -0
  26. package/package/components/FlowPreviewContent.svelte +11 -1
  27. package/package/components/FlowStatusViewer.svelte +4 -1
  28. package/package/components/FlowStatusViewer.svelte.d.ts +3 -1
  29. package/package/components/FlowStatusViewerInner.svelte +46 -11
  30. package/package/components/FlowStatusViewerInner.svelte.d.ts +4 -1
  31. package/package/components/FlowStatusWaitingForEvents.svelte +48 -103
  32. package/package/components/FlowTimeline.svelte +76 -84
  33. package/package/components/FlowViewer.svelte +40 -22
  34. package/package/components/FlowViewer.svelte.d.ts +8 -2
  35. package/package/components/GroupEditor.svelte +7 -9
  36. package/package/components/HistoricList.svelte +12 -4
  37. package/package/components/InstanceGroupEditor.svelte +92 -19
  38. package/package/components/InstanceSetting.svelte +16 -6
  39. package/package/components/InstanceSettings.svelte +51 -7
  40. package/package/components/InstanceSettings.svelte.d.ts +2 -1
  41. package/package/components/JobLoader.svelte +5 -4
  42. package/package/components/JobLoader.svelte.d.ts +1 -1
  43. package/package/components/Login.svelte +9 -1
  44. package/package/components/NoMainFuncBadge.svelte +2 -2
  45. package/package/components/OnBehalfOfSelector.svelte +49 -37
  46. package/package/components/OnBehalfOfSelector.svelte.d.ts +16 -6
  47. package/package/components/ResourceEditor.svelte +16 -11
  48. package/package/components/ResourceEditor.svelte.d.ts +1 -0
  49. package/package/components/ResourceEditorDrawer.svelte +3 -1
  50. package/package/components/ResourceEditorDrawer.svelte.d.ts +6 -2
  51. package/package/components/ResourcePicker.svelte +10 -5
  52. package/package/components/ResourcePicker.svelte.d.ts +2 -0
  53. package/package/components/S3FilePickerInner.svelte +12 -4
  54. package/package/components/SchemaForm.svelte +20 -14
  55. package/package/components/SchemaForm.svelte.d.ts +2 -2
  56. package/package/components/ScriptBuilder.svelte +158 -18
  57. package/package/components/ScriptEditor.svelte +674 -150
  58. package/package/components/ScriptEditor.svelte.d.ts +7 -3
  59. package/package/components/SuperadminSettings.svelte +4 -1
  60. package/package/components/SuperadminSettingsInner.svelte +176 -67
  61. package/package/components/SuperadminSettingsInner.svelte.d.ts +3 -1
  62. package/package/components/SyncResourceTypes.svelte +31 -0
  63. package/package/components/SyncResourceTypes.svelte.d.ts +6 -0
  64. package/package/components/TimelineBar.svelte +14 -8
  65. package/package/components/TimelineBar.svelte.d.ts +1 -0
  66. package/package/components/WorkerGroup.svelte +11 -4
  67. package/package/components/WorkflowTimeline.svelte +386 -58
  68. package/package/components/WorkflowTimeline.svelte.d.ts +6 -1
  69. package/package/components/WorkspaceDependenciesEditor.svelte +32 -2
  70. package/package/components/apps/components/display/dbtable/DeleteRow.svelte +2 -2
  71. package/package/components/apps/components/display/dbtable/InsertRowRunnable.svelte +2 -2
  72. package/package/components/apps/components/display/dbtable/UpdateCell.svelte +2 -2
  73. package/package/components/apps/components/display/dbtable/metadata.js +44 -222
  74. package/package/components/apps/components/display/dbtable/queries/count.d.ts +9 -0
  75. package/package/components/apps/components/display/dbtable/queries/delete.d.ts +9 -0
  76. package/package/components/apps/components/display/dbtable/queries/insert.d.ts +9 -0
  77. package/package/components/apps/components/display/dbtable/queries/relationalKeys.d.ts +7 -0
  78. package/package/components/apps/components/display/dbtable/queries/relationalKeys.js +1 -1
  79. package/package/components/apps/components/display/dbtable/queries/select.d.ts +9 -0
  80. package/package/components/apps/components/display/dbtable/queries/update.d.ts +9 -0
  81. package/package/components/apps/editor/AppEditorHeaderDeploy.svelte +11 -9
  82. package/package/components/apps/editor/appUtilsS3.js +2 -2
  83. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +53 -10
  84. package/package/components/common/clearableInput/ClearableInput.svelte +3 -7
  85. package/package/components/common/confirmationModal/ConfirmationModal.svelte +7 -1
  86. package/package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +1 -0
  87. package/package/components/common/drawer/Disposable.svelte +24 -2
  88. package/package/components/common/drawer/Disposable.svelte.d.ts +5 -0
  89. package/package/components/common/modal/Modal.svelte +84 -58
  90. package/package/components/common/table/AppRow.svelte.d.ts +1 -1
  91. package/package/components/common/table/FlowRow.svelte.d.ts +1 -1
  92. package/package/components/common/table/ScriptRow.svelte +31 -3
  93. package/package/components/common/table/ScriptRow.svelte.d.ts +1 -1
  94. package/package/components/copilot/MetadataGen.svelte +8 -5
  95. package/package/components/copilot/MetadataGen.svelte.d.ts +1 -0
  96. package/package/components/copilot/TestAIKey.svelte +2 -1
  97. package/package/components/copilot/TestAIKey.svelte.d.ts +1 -0
  98. package/package/components/copilot/chat/AIChatManager.svelte.js +62 -80
  99. package/package/components/copilot/chat/HistoryManager.svelte.d.ts +1 -0
  100. package/package/components/copilot/chat/HistoryManager.svelte.js +3 -0
  101. package/package/components/copilot/chat/__tests__/app/appChat.eval.test.js +47 -31
  102. package/package/components/copilot/chat/__tests__/app/appEvalComparison.d.ts +1 -6
  103. package/package/components/copilot/chat/__tests__/app/appEvalComparison.js +18 -13
  104. package/package/components/copilot/chat/__tests__/app/appEvalRunner.d.ts +14 -5
  105. package/package/components/copilot/chat/__tests__/app/appEvalRunner.js +13 -12
  106. package/package/components/copilot/chat/__tests__/flow/flowChat.eval.test.js +46 -29
  107. package/package/components/copilot/chat/__tests__/flow/flowEvalComparison.js +1 -4
  108. package/package/components/copilot/chat/__tests__/flow/flowEvalRunner.d.ts +14 -5
  109. package/package/components/copilot/chat/__tests__/flow/flowEvalRunner.js +13 -12
  110. package/package/components/copilot/chat/__tests__/shared/baseEvalRunner.d.ts +5 -8
  111. package/package/components/copilot/chat/__tests__/shared/baseEvalRunner.js +82 -108
  112. package/package/components/copilot/chat/__tests__/shared/baseLLMEvaluator.d.ts +4 -7
  113. package/package/components/copilot/chat/__tests__/shared/baseLLMEvaluator.js +19 -11
  114. package/package/components/copilot/chat/__tests__/shared/types.d.ts +3 -0
  115. package/package/components/copilot/chat/anthropic.d.ts +9 -2
  116. package/package/components/copilot/chat/anthropic.js +12 -6
  117. package/package/components/copilot/chat/app/core.js +5 -12
  118. package/package/components/copilot/chat/chatLoop.d.ts +40 -0
  119. package/package/components/copilot/chat/chatLoop.js +97 -0
  120. package/package/components/copilot/chat/openai-responses.d.ts +8 -2
  121. package/package/components/copilot/chat/openai-responses.js +17 -17
  122. package/package/components/copilot/chat/shared.d.ts +2 -1
  123. package/package/components/copilot/chat/shared.js +2 -2
  124. package/package/components/copilot/lib.d.ts +14 -5
  125. package/package/components/copilot/lib.js +68 -48
  126. package/package/components/dbOps.d.ts +2 -2
  127. package/package/components/dbOps.js +129 -53
  128. package/package/components/debug/debugUtils.d.ts +5 -0
  129. package/package/components/debug/debugUtils.js +20 -0
  130. package/package/components/debug/index.d.ts +1 -1
  131. package/package/components/debug/index.js +3 -7
  132. package/package/components/flows/CreateActionsFlow.svelte +221 -43
  133. package/package/components/flows/DebounceLimit.svelte +42 -9
  134. package/package/components/flows/common/FlowCard.svelte +2 -1
  135. package/package/components/flows/common/FlowCard.svelte.d.ts +1 -0
  136. package/package/components/flows/common/FlowCardHeader.svelte +14 -10
  137. package/package/components/flows/common/FlowCardHeader.svelte.d.ts +1 -0
  138. package/package/components/flows/content/AgentToolWrapper.svelte +2 -1
  139. package/package/components/flows/content/AgentToolWrapper.svelte.d.ts +1 -0
  140. package/package/components/flows/content/FlowEditorPanel.svelte +1 -0
  141. package/package/components/flows/content/FlowModuleComponent.svelte +32 -18
  142. package/package/components/flows/content/FlowModuleComponent.svelte.d.ts +1 -0
  143. package/package/components/flows/content/FlowModuleDebounce.svelte +46 -0
  144. package/package/components/flows/content/FlowModuleDebounce.svelte.d.ts +8 -0
  145. package/package/components/flows/content/FlowModuleEarlyStop.svelte +26 -5
  146. package/package/components/flows/content/FlowModuleWrapper.svelte +1 -0
  147. package/package/components/flows/content/FlowRetries.svelte +57 -57
  148. package/package/components/flows/content/FlowSelectionPanel.svelte +9 -14
  149. package/package/components/flows/content/FlowSelectionPanel.svelte.d.ts +1 -0
  150. package/package/components/flows/content/FlowSettings.svelte +6 -6
  151. package/package/components/flows/content/ScriptEditorDrawer.svelte +1 -1
  152. package/package/components/flows/content/SuspendDrawer.svelte +0 -18
  153. package/package/components/flows/header/FlowYamlEditor.svelte +20 -4
  154. package/package/components/flows/map/FlowErrorHandlerItem.svelte +32 -14
  155. package/package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +1 -0
  156. package/package/components/flows/map/FlowModuleSchemaItem.svelte +7 -10
  157. package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte +1 -8
  158. package/package/components/flows/map/FlowModuleSchemaItemViewer.svelte.d.ts +0 -2
  159. package/package/components/flows/map/FlowModuleSchemaMap.svelte +343 -137
  160. package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -0
  161. package/package/components/flows/map/FlowStickyNode.svelte +24 -16
  162. package/package/components/flows/map/FlowStickyNode.svelte.d.ts +1 -0
  163. package/package/components/flows/map/VirtualItemWrapper.svelte +1 -1
  164. package/package/components/flows/pickers/PickHubScriptQuick.svelte.d.ts +1 -1
  165. package/package/components/flows/propPicker/OutputPickerInner.svelte +5 -1
  166. package/package/components/flows/scheduleUtils.js +3 -1
  167. package/package/components/flows/utils.svelte.js +6 -1
  168. package/package/components/git_sync/GitSyncContext.svelte.js +13 -2
  169. package/package/components/git_sync/GitSyncSection.svelte +135 -99
  170. package/package/components/graph/DragGhost.svelte +11 -2
  171. package/package/components/graph/FlowGraphV2.svelte +138 -42
  172. package/package/components/graph/FlowGraphV2.svelte.d.ts +15 -1
  173. package/package/components/graph/GroupActionBar.svelte +124 -0
  174. package/package/components/graph/GroupActionBar.svelte.d.ts +20 -0
  175. package/package/components/graph/GroupHeader.svelte +98 -0
  176. package/package/components/graph/GroupHeader.svelte.d.ts +11 -0
  177. package/package/components/graph/GroupHeaderBlock.svelte +58 -0
  178. package/package/components/graph/GroupHeaderBlock.svelte.d.ts +13 -0
  179. package/package/components/graph/GroupModuleIcons.svelte +163 -0
  180. package/package/components/graph/GroupModuleIcons.svelte.d.ts +11 -0
  181. package/package/components/graph/GroupNodeCard.svelte +127 -0
  182. package/package/components/graph/GroupNodeCard.svelte.d.ts +18 -0
  183. package/package/components/graph/GroupNoteArea.svelte +132 -0
  184. package/package/components/graph/GroupNoteArea.svelte.d.ts +11 -0
  185. package/package/components/graph/GroupOverlay.svelte +71 -0
  186. package/package/components/graph/GroupOverlay.svelte.d.ts +12 -0
  187. package/package/components/graph/MiniFlowGraph.svelte +17 -2
  188. package/package/components/graph/SelectionBoundingBox.svelte +14 -14
  189. package/package/components/graph/compoundLayout.d.ts +17 -1
  190. package/package/components/graph/compoundLayout.js +129 -14
  191. package/package/components/graph/flowStructure.d.ts +63 -0
  192. package/package/components/graph/flowStructure.js +422 -0
  193. package/package/components/graph/flowStructure.test.d.ts +1 -0
  194. package/package/components/graph/flowStructure.test.js +205 -0
  195. package/package/components/graph/graphBuilder.svelte.d.ts +52 -3
  196. package/package/components/graph/graphBuilder.svelte.js +170 -67
  197. package/package/components/graph/graphContext.d.ts +7 -0
  198. package/package/components/graph/groupDetectionUtils.d.ts +24 -1
  199. package/package/components/graph/groupDetectionUtils.js +101 -1
  200. package/package/components/graph/groupEditor.svelte.d.ts +105 -0
  201. package/package/components/graph/groupEditor.svelte.js +253 -0
  202. package/package/components/graph/groupedModulesProxy.svelte.d.ts +55 -0
  203. package/package/components/graph/groupedModulesProxy.svelte.js +130 -0
  204. package/package/components/graph/model.d.ts +2 -1
  205. package/package/components/graph/moveManager.svelte.js +0 -3
  206. package/package/components/graph/nodeExtraSpace.d.ts +32 -0
  207. package/package/components/graph/nodeExtraSpace.js +113 -0
  208. package/package/components/graph/noteColors.d.ts +1 -0
  209. package/package/components/graph/noteColors.js +20 -10
  210. package/package/components/graph/noteUtils.svelte.d.ts +0 -18
  211. package/package/components/graph/noteUtils.svelte.js +6 -41
  212. package/package/components/graph/renderers/edges/BaseEdge.svelte +26 -11
  213. package/package/components/graph/renderers/nodes/AIToolNode.svelte +24 -49
  214. package/package/components/graph/renderers/nodes/AIToolNode.svelte.d.ts +1 -4
  215. package/package/components/graph/renderers/nodes/AssetNode.svelte +1 -27
  216. package/package/components/graph/renderers/nodes/AssetNode.svelte.d.ts +0 -4
  217. package/package/components/graph/renderers/nodes/CollapsedGroupNode.svelte +85 -0
  218. package/package/components/graph/renderers/nodes/CollapsedGroupNode.svelte.d.ts +8 -0
  219. package/package/components/graph/renderers/nodes/ForLoopStartNode.svelte +3 -2
  220. package/package/components/graph/renderers/nodes/GroupEndNode.svelte +9 -0
  221. package/package/components/graph/renderers/nodes/GroupEndNode.svelte.d.ts +6 -0
  222. package/package/components/graph/renderers/nodes/GroupHeadNode.svelte +20 -0
  223. package/package/components/graph/renderers/nodes/GroupHeadNode.svelte.d.ts +8 -0
  224. package/package/components/graph/renderers/nodes/ModuleNode.svelte +8 -5
  225. package/package/components/graph/renderers/triggers/TriggersWrapper.svelte +1 -1
  226. package/package/components/graph/util.d.ts +5 -1
  227. package/package/components/graph/util.js +7 -5
  228. package/package/components/home/Item.svelte +1 -0
  229. package/package/components/home/ItemsList.svelte +1 -1
  230. package/package/components/icons/ActiveCampaignIcon.svelte +10 -0
  231. package/package/components/icons/ActiveCampaignIcon.svelte.d.ts +7 -0
  232. package/package/components/icons/AlgoliaIcon.svelte +7 -0
  233. package/package/components/icons/AlgoliaIcon.svelte.d.ts +7 -0
  234. package/package/components/icons/ApolloIcon.svelte +7 -0
  235. package/package/components/icons/ApolloIcon.svelte.d.ts +7 -0
  236. package/package/components/icons/BambooHrIcon.svelte +7 -0
  237. package/package/components/icons/BambooHrIcon.svelte.d.ts +7 -0
  238. package/package/components/icons/BaremetricsIcon.svelte +7 -0
  239. package/package/components/icons/BaremetricsIcon.svelte.d.ts +7 -0
  240. package/package/components/icons/BitlyIcon.svelte +7 -0
  241. package/package/components/icons/BitlyIcon.svelte.d.ts +7 -0
  242. package/package/components/icons/BloggerIcon.svelte +7 -0
  243. package/package/components/icons/BloggerIcon.svelte.d.ts +7 -0
  244. package/package/components/icons/BlueskyIcon.svelte +7 -0
  245. package/package/components/icons/BlueskyIcon.svelte.d.ts +7 -0
  246. package/package/components/icons/BoxIcon.svelte +7 -0
  247. package/package/components/icons/BoxIcon.svelte.d.ts +7 -0
  248. package/package/components/icons/BrevoIcon.svelte +7 -0
  249. package/package/components/icons/BrevoIcon.svelte.d.ts +7 -0
  250. package/package/components/icons/BrexIcon.svelte +7 -0
  251. package/package/components/icons/BrexIcon.svelte.d.ts +7 -0
  252. package/package/components/icons/BrowserlessIcon.svelte +7 -0
  253. package/package/components/icons/BrowserlessIcon.svelte.d.ts +7 -0
  254. package/package/components/icons/BubbleIcon.svelte +11 -0
  255. package/package/components/icons/BubbleIcon.svelte.d.ts +7 -0
  256. package/package/components/icons/BuildkiteIcon.svelte +7 -0
  257. package/package/components/icons/BuildkiteIcon.svelte.d.ts +7 -0
  258. package/package/components/icons/CalcomIcon.svelte +1 -1
  259. package/package/components/icons/CalendlyIcon.svelte +7 -0
  260. package/package/components/icons/CalendlyIcon.svelte.d.ts +7 -0
  261. package/package/components/icons/CircleCiIcon.svelte +7 -0
  262. package/package/components/icons/CircleCiIcon.svelte.d.ts +7 -0
  263. package/package/components/icons/CiscoIcon.svelte +7 -0
  264. package/package/components/icons/CiscoIcon.svelte.d.ts +7 -0
  265. package/package/components/icons/ClearbitIcon.svelte +7 -0
  266. package/package/components/icons/ClearbitIcon.svelte.d.ts +7 -0
  267. package/package/components/icons/ClerkIcon.svelte +7 -0
  268. package/package/components/icons/ClerkIcon.svelte.d.ts +7 -0
  269. package/package/components/icons/CloseIcon.svelte +37 -0
  270. package/package/components/icons/CloseIcon.svelte.d.ts +7 -0
  271. package/package/components/icons/CloudinaryIcon.svelte +7 -0
  272. package/package/components/icons/CloudinaryIcon.svelte.d.ts +7 -0
  273. package/package/components/icons/CockroachDbIcon.svelte +7 -0
  274. package/package/components/icons/CockroachDbIcon.svelte.d.ts +7 -0
  275. package/package/components/icons/CodaIcon.svelte +7 -0
  276. package/package/components/icons/CodaIcon.svelte.d.ts +7 -0
  277. package/package/components/icons/CohereIcon.svelte +16 -0
  278. package/package/components/icons/CohereIcon.svelte.d.ts +7 -0
  279. package/package/components/icons/CoinMarketCapIcon.svelte +7 -0
  280. package/package/components/icons/CoinMarketCapIcon.svelte.d.ts +7 -0
  281. package/package/components/icons/CoinbaseIcon.svelte +7 -0
  282. package/package/components/icons/CoinbaseIcon.svelte.d.ts +7 -0
  283. package/package/components/icons/ConfluenceIcon.svelte +7 -0
  284. package/package/components/icons/ConfluenceIcon.svelte.d.ts +7 -0
  285. package/package/components/icons/ContentfulIcon.svelte +7 -0
  286. package/package/components/icons/ContentfulIcon.svelte.d.ts +7 -0
  287. package/package/components/icons/ConvertKitIcon.svelte +7 -0
  288. package/package/components/icons/ConvertKitIcon.svelte.d.ts +7 -0
  289. package/package/components/icons/DatoCmsIcon.svelte +7 -0
  290. package/package/components/icons/DatoCmsIcon.svelte.d.ts +7 -0
  291. package/package/components/icons/DeelIcon.svelte +7 -0
  292. package/package/components/icons/DeelIcon.svelte.d.ts +7 -0
  293. package/package/components/icons/DeepLIcon.svelte +7 -0
  294. package/package/components/icons/DeepLIcon.svelte.d.ts +7 -0
  295. package/package/components/icons/DigitalOceanIcon.svelte +7 -0
  296. package/package/components/icons/DigitalOceanIcon.svelte.d.ts +7 -0
  297. package/package/components/icons/DiscourseIcon.svelte +7 -0
  298. package/package/components/icons/DiscourseIcon.svelte.d.ts +7 -0
  299. package/package/components/icons/DocusignIcon.svelte +7 -0
  300. package/package/components/icons/DocusignIcon.svelte.d.ts +7 -0
  301. package/package/components/icons/DropboxIcon.svelte +7 -0
  302. package/package/components/icons/DropboxIcon.svelte.d.ts +7 -0
  303. package/package/components/icons/EdgeDbIcon.svelte +16 -20
  304. package/package/components/icons/EventbriteIcon.svelte +10 -0
  305. package/package/components/icons/EventbriteIcon.svelte.d.ts +7 -0
  306. package/package/components/icons/FigmaIcon.svelte +7 -0
  307. package/package/components/icons/FigmaIcon.svelte.d.ts +7 -0
  308. package/package/components/icons/FlyIcon.svelte +7 -0
  309. package/package/components/icons/FlyIcon.svelte.d.ts +7 -0
  310. package/package/components/icons/FreshdeskIcon.svelte +7 -0
  311. package/package/components/icons/FreshdeskIcon.svelte.d.ts +7 -0
  312. package/package/components/icons/FrontAppIcon.svelte +7 -0
  313. package/package/components/icons/FrontAppIcon.svelte.d.ts +7 -0
  314. package/package/components/icons/GhostCmsIcon.svelte +7 -0
  315. package/package/components/icons/GhostCmsIcon.svelte.d.ts +7 -0
  316. package/package/components/icons/GiphyIcon.svelte +7 -0
  317. package/package/components/icons/GiphyIcon.svelte.d.ts +7 -0
  318. package/package/components/icons/GitBookIcon.svelte +7 -0
  319. package/package/components/icons/GitBookIcon.svelte.d.ts +7 -0
  320. package/package/components/icons/GroqIcon.svelte +7 -0
  321. package/package/components/icons/GroqIcon.svelte.d.ts +7 -0
  322. package/package/components/icons/HoneybadgerIcon.svelte +7 -0
  323. package/package/components/icons/HoneybadgerIcon.svelte.d.ts +7 -0
  324. package/package/components/icons/HttpIcon.svelte +1 -0
  325. package/package/components/icons/IftttIcon.svelte +7 -0
  326. package/package/components/icons/IftttIcon.svelte.d.ts +7 -0
  327. package/package/components/icons/IntercomIcon.svelte +7 -0
  328. package/package/components/icons/IntercomIcon.svelte.d.ts +7 -0
  329. package/package/components/icons/JoomlaIcon.svelte +7 -0
  330. package/package/components/icons/JoomlaIcon.svelte.d.ts +7 -0
  331. package/package/components/icons/LineIcon.svelte +7 -0
  332. package/package/components/icons/LineIcon.svelte.d.ts +7 -0
  333. package/package/components/icons/LinearIcon.svelte +7 -0
  334. package/package/components/icons/LinearIcon.svelte.d.ts +7 -0
  335. package/package/components/icons/LinodeIcon.svelte +7 -0
  336. package/package/components/icons/LinodeIcon.svelte.d.ts +7 -0
  337. package/package/components/icons/LumaAiIcon.svelte +39 -0
  338. package/package/components/icons/LumaAiIcon.svelte.d.ts +7 -0
  339. package/package/components/icons/MSTeamsIcon.svelte +20 -38
  340. package/package/components/icons/MSTeamsIcon.svelte.d.ts +2 -0
  341. package/package/components/icons/MagentoIcon.svelte +7 -0
  342. package/package/components/icons/MagentoIcon.svelte.d.ts +7 -0
  343. package/package/components/icons/MailchimpIcon.svelte +25 -13
  344. package/package/components/icons/MandrillIcon.svelte +7 -0
  345. package/package/components/icons/MandrillIcon.svelte.d.ts +7 -0
  346. package/package/components/icons/MauticIcon.svelte +7 -0
  347. package/package/components/icons/MauticIcon.svelte.d.ts +7 -0
  348. package/package/components/icons/MediumIcon.svelte +7 -0
  349. package/package/components/icons/MediumIcon.svelte.d.ts +7 -0
  350. package/package/components/icons/MiroIcon.svelte +7 -0
  351. package/package/components/icons/MiroIcon.svelte.d.ts +7 -0
  352. package/package/components/icons/MistralIcon.svelte +7 -0
  353. package/package/components/icons/MistralIcon.svelte.d.ts +7 -0
  354. package/package/components/icons/MixpanelIcon.svelte +7 -0
  355. package/package/components/icons/MixpanelIcon.svelte.d.ts +7 -0
  356. package/package/components/icons/MondayIcon.svelte +7 -0
  357. package/package/components/icons/MondayIcon.svelte.d.ts +7 -0
  358. package/package/components/icons/NeonDbIcon.svelte +23 -0
  359. package/package/components/icons/NeonDbIcon.svelte.d.ts +7 -0
  360. package/package/components/icons/NetlifyIcon.svelte +7 -0
  361. package/package/components/icons/NetlifyIcon.svelte.d.ts +7 -0
  362. package/package/components/icons/OneSignalIcon.svelte +9 -0
  363. package/package/components/icons/OneSignalIcon.svelte.d.ts +7 -0
  364. package/package/components/icons/OpenWeatherIcon.svelte +7 -0
  365. package/package/components/icons/OpenWeatherIcon.svelte.d.ts +7 -0
  366. package/package/components/icons/PagerDutyIcon.svelte +7 -0
  367. package/package/components/icons/PagerDutyIcon.svelte.d.ts +7 -0
  368. package/package/components/icons/PandaDocIcon.svelte +7 -0
  369. package/package/components/icons/PandaDocIcon.svelte.d.ts +7 -0
  370. package/package/components/icons/PaypalIcon.svelte +7 -0
  371. package/package/components/icons/PaypalIcon.svelte.d.ts +7 -0
  372. package/package/components/icons/PersonioIcon.svelte +7 -0
  373. package/package/components/icons/PersonioIcon.svelte.d.ts +7 -0
  374. package/package/components/icons/PinterestIcon.svelte +7 -0
  375. package/package/components/icons/PinterestIcon.svelte.d.ts +7 -0
  376. package/package/components/icons/PipedriveIcon.svelte +11 -0
  377. package/package/components/icons/PipedriveIcon.svelte.d.ts +7 -0
  378. package/package/components/icons/PlanetScaleIcon.svelte +7 -0
  379. package/package/components/icons/PlanetScaleIcon.svelte.d.ts +7 -0
  380. package/package/components/icons/PostmarkIcon.svelte +7 -0
  381. package/package/components/icons/PostmarkIcon.svelte.d.ts +7 -0
  382. package/package/components/icons/PusherIcon.svelte +7 -0
  383. package/package/components/icons/PusherIcon.svelte.d.ts +7 -0
  384. package/package/components/icons/QuickbooksIcon.svelte +13 -1
  385. package/package/components/icons/RaindropIcon.svelte +27 -0
  386. package/package/components/icons/RaindropIcon.svelte.d.ts +7 -0
  387. package/package/components/icons/ReadwiseIcon.svelte +12 -0
  388. package/package/components/icons/ReadwiseIcon.svelte.d.ts +7 -0
  389. package/package/components/icons/RenderIcon.svelte +7 -0
  390. package/package/components/icons/RenderIcon.svelte.d.ts +7 -0
  391. package/package/components/icons/ReplicateIcon.svelte +7 -0
  392. package/package/components/icons/ReplicateIcon.svelte.d.ts +7 -0
  393. package/package/components/icons/ResendIcon.svelte +1 -1
  394. package/package/components/icons/RestIcon.svelte +1 -0
  395. package/package/components/icons/RingCentralIcon.svelte +7 -0
  396. package/package/components/icons/RingCentralIcon.svelte.d.ts +7 -0
  397. package/package/components/icons/RocketChatIcon.svelte +7 -0
  398. package/package/components/icons/RocketChatIcon.svelte.d.ts +7 -0
  399. package/package/components/icons/RunPodIcon.svelte +8 -0
  400. package/package/components/icons/RunPodIcon.svelte.d.ts +7 -0
  401. package/package/components/icons/RustIcon.svelte +74 -56
  402. package/package/components/icons/SalesforceIcon.svelte +7 -0
  403. package/package/components/icons/SalesforceIcon.svelte.d.ts +7 -0
  404. package/package/components/icons/SegmentIcon.svelte +7 -0
  405. package/package/components/icons/SegmentIcon.svelte.d.ts +7 -0
  406. package/package/components/icons/SentryIcon.svelte +7 -0
  407. package/package/components/icons/SentryIcon.svelte.d.ts +7 -0
  408. package/package/components/icons/ServiceNowIcon.svelte +7 -0
  409. package/package/components/icons/ServiceNowIcon.svelte.d.ts +7 -0
  410. package/package/components/icons/ShortcutIcon.svelte +7 -0
  411. package/package/components/icons/ShortcutIcon.svelte.d.ts +7 -0
  412. package/package/components/icons/SigNozIcon.svelte +8 -0
  413. package/package/components/icons/SigNozIcon.svelte.d.ts +7 -0
  414. package/package/components/icons/SmartsheetIcon.svelte +7 -0
  415. package/package/components/icons/SmartsheetIcon.svelte.d.ts +7 -0
  416. package/package/components/icons/SpeechifyIcon.svelte +7 -0
  417. package/package/components/icons/SpeechifyIcon.svelte.d.ts +7 -0
  418. package/package/components/icons/SplitwiseIcon.svelte +7 -0
  419. package/package/components/icons/SplitwiseIcon.svelte.d.ts +7 -0
  420. package/package/components/icons/StravaIcon.svelte +7 -0
  421. package/package/components/icons/StravaIcon.svelte.d.ts +7 -0
  422. package/package/components/icons/TallyIcon.svelte +7 -0
  423. package/package/components/icons/TallyIcon.svelte.d.ts +7 -0
  424. package/package/components/icons/TelnyxIcon.svelte +19 -0
  425. package/package/components/icons/TelnyxIcon.svelte.d.ts +7 -0
  426. package/package/components/icons/ThreadsIcon.svelte +7 -0
  427. package/package/components/icons/ThreadsIcon.svelte.d.ts +7 -0
  428. package/package/components/icons/TodoistIcon.svelte +7 -0
  429. package/package/components/icons/TodoistIcon.svelte.d.ts +7 -0
  430. package/package/components/icons/TogetherAiIcon.svelte +23 -0
  431. package/package/components/icons/TogetherAiIcon.svelte.d.ts +7 -0
  432. package/package/components/icons/TrelloIcon.svelte +22 -1
  433. package/package/components/icons/TursoIcon.svelte +7 -0
  434. package/package/components/icons/TursoIcon.svelte.d.ts +7 -0
  435. package/package/components/icons/TwitchIcon.svelte +7 -0
  436. package/package/components/icons/TwitchIcon.svelte.d.ts +7 -0
  437. package/package/components/icons/TwitterIcon.svelte +7 -0
  438. package/package/components/icons/TwitterIcon.svelte.d.ts +7 -0
  439. package/package/components/icons/TypeformIcon.svelte +1 -1
  440. package/package/components/icons/VercelIcon.svelte +7 -0
  441. package/package/components/icons/VercelIcon.svelte.d.ts +7 -0
  442. package/package/components/icons/WebflowIcon.svelte +7 -0
  443. package/package/components/icons/WebflowIcon.svelte.d.ts +7 -0
  444. package/package/components/icons/WooCommerceIcon.svelte +7 -0
  445. package/package/components/icons/WooCommerceIcon.svelte.d.ts +7 -0
  446. package/package/components/icons/WordpressIcon.svelte +7 -0
  447. package/package/components/icons/WordpressIcon.svelte.d.ts +7 -0
  448. package/package/components/icons/XataIcon.svelte +13 -0
  449. package/package/components/icons/XataIcon.svelte.d.ts +7 -0
  450. package/package/components/icons/YelpIcon.svelte +7 -0
  451. package/package/components/icons/YelpIcon.svelte.d.ts +7 -0
  452. package/package/components/icons/YnabIcon.svelte +7 -0
  453. package/package/components/icons/YnabIcon.svelte.d.ts +7 -0
  454. package/package/components/icons/YoutubeIcon.svelte +7 -0
  455. package/package/components/icons/YoutubeIcon.svelte.d.ts +7 -0
  456. package/package/components/icons/ZendeskIcon.svelte +1 -1
  457. package/package/components/icons/ZeroTierIcon.svelte +7 -0
  458. package/package/components/icons/ZeroTierIcon.svelte.d.ts +7 -0
  459. package/package/components/icons/ZoomIcon.svelte +7 -0
  460. package/package/components/icons/ZoomIcon.svelte.d.ts +7 -0
  461. package/package/components/icons/index.d.ts +111 -1
  462. package/package/components/icons/index.js +225 -2
  463. package/package/components/instanceSettings/GhesAppSettings.svelte +161 -0
  464. package/package/components/instanceSettings/GhesAppSettings.svelte.d.ts +8 -0
  465. package/package/components/instanceSettings/IndexerMemorySettings.svelte +19 -8
  466. package/package/components/instanceSettings/InstanceAISettings.svelte +132 -0
  467. package/package/components/instanceSettings/InstanceAISettings.svelte.d.ts +10 -0
  468. package/package/components/instanceSettings/WorkspaceRegistries.svelte +293 -0
  469. package/package/components/instanceSettings/WorkspaceRegistries.svelte.d.ts +8 -0
  470. package/package/components/instanceSettings/WsConnectivityTest.svelte +177 -0
  471. package/package/components/instanceSettings/WsConnectivityTest.svelte.d.ts +7 -0
  472. package/package/components/instanceSettings.d.ts +3 -1
  473. package/package/components/instanceSettings.js +92 -2
  474. package/package/components/mcp/McpScopeSelector.svelte +408 -0
  475. package/package/components/mcp/McpScopeSelector.svelte.d.ts +7 -0
  476. package/package/components/meltComponents/Popover.svelte +0 -1
  477. package/package/components/raw_apps/RawAppPreview.svelte +6 -2
  478. package/package/components/recording/FlowRecordingReplay.svelte +94 -52
  479. package/package/components/recording/FlowRecordingReplay.svelte.d.ts +10 -1
  480. package/package/components/recording/ScriptRecordingReplay.svelte +139 -76
  481. package/package/components/recording/ScriptRecordingReplay.svelte.d.ts +10 -1
  482. package/package/components/runs/JobRunsPreview.svelte +8 -1
  483. package/package/components/runs/TimeframeSelect.svelte +0 -1
  484. package/package/components/schema/JobSchemaPicker.svelte +8 -2
  485. package/package/components/schema/JobSchemaPicker.svelte.d.ts +1 -0
  486. package/package/components/schema/SchemaFormDND.svelte +15 -3
  487. package/package/components/scriptEditor/LogPanel.svelte +78 -68
  488. package/package/components/script_builder.d.ts +1 -1
  489. package/package/components/scripts/CreateActionsScript.svelte +3 -3
  490. package/package/components/scripts/WacExportDrawer.svelte +127 -0
  491. package/package/components/scripts/WacExportDrawer.svelte.d.ts +8 -0
  492. package/package/components/scripts/scriptStore.svelte.d.ts +2 -0
  493. package/package/components/scripts/scriptStore.svelte.js +2 -0
  494. package/package/components/select/SelectDropdown.svelte +1 -1
  495. package/package/components/settings/AIPromptsModal.svelte +5 -2
  496. package/package/components/settings/AIPromptsModal.svelte.d.ts +1 -1
  497. package/package/components/settings/CloudQuotas.svelte +152 -0
  498. package/package/components/settings/CloudQuotas.svelte.d.ts +3 -0
  499. package/package/components/settings/CreateToken.svelte +15 -430
  500. package/package/components/settings/Trashbin.svelte +248 -0
  501. package/package/components/settings/Trashbin.svelte.d.ts +3 -0
  502. package/package/components/sidebar/MultiplayerMenu.svelte +14 -4
  503. package/package/components/triggers/DeleteTriggerButton.svelte +1 -0
  504. package/package/components/triggers/PermissionedAsLine.svelte +66 -0
  505. package/package/components/triggers/PermissionedAsLine.svelte.d.ts +9 -0
  506. package/package/components/triggers/TriggerEditorToolbar.svelte +2 -2
  507. package/package/components/triggers/TriggerTokens.svelte +3 -3
  508. package/package/components/triggers/email/EmailTriggerEditorInner.svelte +19 -1
  509. package/package/components/triggers/email/utils.js +3 -1
  510. package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +24 -4
  511. package/package/components/triggers/gcp/utils.js +2 -0
  512. package/package/components/triggers/http/RouteEditorConfigSection.svelte +22 -3
  513. package/package/components/triggers/http/RouteEditorInner.svelte +28 -6
  514. package/package/components/triggers/http/RoutesGenerator.svelte +13 -2
  515. package/package/components/triggers/http/utils.js +3 -1
  516. package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +23 -6
  517. package/package/components/triggers/kafka/utils.js +3 -1
  518. package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +27 -5
  519. package/package/components/triggers/mqtt/utils.js +2 -0
  520. package/package/components/triggers/native/NativeTriggerEditor.svelte +23 -1
  521. package/package/components/triggers/native/NativeTriggerTable.svelte +14 -3
  522. package/package/components/triggers/native/utils.js +3 -2
  523. package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +19 -1
  524. package/package/components/triggers/nats/utils.js +2 -0
  525. package/package/components/triggers/postgres/PostgresTriggerEditorInner.svelte +19 -1
  526. package/package/components/triggers/postgres/utils.js +2 -0
  527. package/package/components/triggers/schedules/ScheduleEditorInner.svelte +29 -7
  528. package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +19 -1
  529. package/package/components/triggers/sqs/utils.js +2 -0
  530. package/package/components/triggers/utils.js +9 -2
  531. package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +24 -4
  532. package/package/components/triggers/websocket/utils.js +3 -1
  533. package/package/components/workspaceSettings/AISettings.svelte +342 -214
  534. package/package/components/workspaceSettings/AISettings.svelte.d.ts +18 -10
  535. package/package/components/workspaceSettings/CreateWorkspace.svelte +304 -196
  536. package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +1 -2
  537. package/package/components/workspaceSettings/DucklakeSettings.svelte +1 -1
  538. package/package/components/workspaceSettings/InstanceFallbackSettings.svelte +75 -0
  539. package/package/components/workspaceSettings/InstanceFallbackSettings.svelte.d.ts +9 -0
  540. package/package/components/workspaceSettings/StorageSettings.svelte +4 -35
  541. package/package/components/workspaceSettings/VolumeStorageSettings.svelte +80 -0
  542. package/package/components/workspaceSettings/VolumeStorageSettings.svelte.d.ts +10 -0
  543. package/package/components/workspaceSettings/WorkspaceIntegrations.svelte +4 -1
  544. package/package/forLater.js +4 -0
  545. package/package/gen/core/OpenAPI.js +1 -1
  546. package/package/gen/schemas.gen.d.ts +294 -94
  547. package/package/gen/schemas.gen.js +294 -94
  548. package/package/gen/services.gen.d.ts +121 -5
  549. package/package/gen/services.gen.js +237 -5
  550. package/package/gen/types.gen.d.ts +715 -91
  551. package/package/githubApp.js +19 -1
  552. package/package/hubPaths.json +8 -4
  553. package/package/infer.d.ts +1 -1
  554. package/package/infer.js +5 -1
  555. package/package/logoutRedirect.d.ts +1 -0
  556. package/package/logoutRedirect.js +24 -0
  557. package/package/script_helpers.d.ts +8 -2
  558. package/package/script_helpers.js +15 -1
  559. package/package/services/trashService.d.ts +28 -0
  560. package/package/services/trashService.js +47 -0
  561. package/package/stores.d.ts +1 -0
  562. package/package/stores.js +1 -0
  563. package/package/system_prompts/index.d.ts +1 -0
  564. package/package/system_prompts/index.js +7 -0
  565. package/package/system_prompts/prompts.d.ts +7 -5
  566. package/package/system_prompts/prompts.js +182 -11
  567. package/package/templates/wac_python.py.template +42 -0
  568. package/package/templates/wac_typescript.ts.template +48 -0
  569. package/package/utils_deployable.d.ts +22 -21
  570. package/package/utils_deployable.js +58 -25
  571. package/package/utils_workspace_deploy.d.ts +15 -4
  572. package/package/utils_workspace_deploy.js +19 -15
  573. package/package/wsUrl.d.ts +1 -0
  574. package/package/wsUrl.js +15 -0
  575. package/package.json +13 -5
  576. package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +0 -2
  577. package/dist/sharedUtils/base.d.ts +0 -1
  578. package/dist/sharedUtils/cloud.d.ts +0 -1
  579. package/dist/sharedUtils/common.d.ts +0 -111
  580. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +0 -5
  581. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +0 -5
  582. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +0 -5
  583. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +0 -13
  584. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +0 -11
  585. package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +0 -95
  586. package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +0 -6
  587. package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +0 -7
  588. package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +0 -33
  589. package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +0 -10
  590. package/dist/sharedUtils/components/apps/editor/component/components.d.ts +0 -5371
  591. package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +0 -3
  592. package/dist/sharedUtils/components/apps/editor/component/index.d.ts +0 -3
  593. package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +0 -7
  594. package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +0 -3
  595. package/dist/sharedUtils/components/apps/gridUtils.d.ts +0 -14
  596. package/dist/sharedUtils/components/apps/inputType.d.ts +0 -178
  597. package/dist/sharedUtils/components/apps/rx.d.ts +0 -29
  598. package/dist/sharedUtils/components/apps/sharedTypes.d.ts +0 -21
  599. package/dist/sharedUtils/components/apps/types.d.ts +0 -274
  600. package/dist/sharedUtils/components/assets/lib.d.ts +0 -25
  601. package/dist/sharedUtils/components/common/alert/model.d.ts +0 -2
  602. package/dist/sharedUtils/components/common/badge/model.d.ts +0 -8
  603. package/dist/sharedUtils/components/common/button/model.d.ts +0 -45
  604. package/dist/sharedUtils/components/common/fileInput/model.d.ts +0 -1
  605. package/dist/sharedUtils/components/common/index.d.ts +0 -24
  606. package/dist/sharedUtils/components/common/skeleton/model.d.ts +0 -21
  607. package/dist/sharedUtils/components/dbTypes.d.ts +0 -14
  608. package/dist/sharedUtils/components/diff_drawer.d.ts +0 -26
  609. package/dist/sharedUtils/components/ducklake.d.ts +0 -1
  610. package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +0 -7
  611. package/dist/sharedUtils/components/icons/index.d.ts +0 -101
  612. package/dist/sharedUtils/components/random_positive_adjetive.d.ts +0 -1
  613. package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +0 -10
  614. package/dist/sharedUtils/components/raw_apps/utils.d.ts +0 -15
  615. package/dist/sharedUtils/components/triggers/email/utils.d.ts +0 -4
  616. package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +0 -2
  617. package/dist/sharedUtils/components/triggers/http/utils.d.ts +0 -11
  618. package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +0 -2
  619. package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +0 -2
  620. package/dist/sharedUtils/components/triggers/nats/utils.d.ts +0 -2
  621. package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +0 -8
  622. package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +0 -2
  623. package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +0 -32
  624. package/dist/sharedUtils/components/triggers/utils.d.ts +0 -80
  625. package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +0 -2
  626. package/dist/sharedUtils/components/triggers.d.ts +0 -20
  627. package/dist/sharedUtils/gen/core/ApiError.d.ts +0 -10
  628. package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +0 -13
  629. package/dist/sharedUtils/gen/core/ApiResult.d.ts +0 -7
  630. package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +0 -26
  631. package/dist/sharedUtils/gen/core/OpenAPI.d.ts +0 -27
  632. package/dist/sharedUtils/gen/core/request.d.ts +0 -29
  633. package/dist/sharedUtils/gen/index.d.ts +0 -6
  634. package/dist/sharedUtils/gen/schemas.gen.d.ts +0 -7036
  635. package/dist/sharedUtils/gen/services.gen.d.ts +0 -6047
  636. package/dist/sharedUtils/gen/types.gen.d.ts +0 -21881
  637. package/dist/sharedUtils/history.svelte.d.ts +0 -9
  638. package/dist/sharedUtils/hub.d.ts +0 -49
  639. package/dist/sharedUtils/jsr.json +0 -6
  640. package/dist/sharedUtils/lib.d.ts +0 -5
  641. package/dist/sharedUtils/lib.es.js +0 -1588
  642. package/dist/sharedUtils/package.json +0 -12
  643. package/dist/sharedUtils/schema.d.ts +0 -3
  644. package/dist/sharedUtils/stores.d.ts +0 -97
  645. package/dist/sharedUtils/svelte5Utils.svelte.d.ts +0 -80
  646. package/dist/sharedUtils/toast.d.ts +0 -8
  647. package/dist/sharedUtils/utils.d.ts +0 -265
  648. package/package/components/graph/NodeContextMenu.svelte +0 -36
  649. package/package/components/graph/NodeContextMenu.svelte.d.ts +0 -8
  650. package/package/svelte5Utils.svelte.d.ts +0 -184
@@ -1,1588 +0,0 @@
1
- var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __esmMin = (c, L) => () => (c && (L = c(c = 0)), L), __commonJSMin = (c, L) => () => (L || c((L = { exports: {} }).exports, L), L.exports), __export = (L, R) => {
2
- let z = {};
3
- for (var B in L) __defProp(z, B, {
4
- get: L[B],
5
- enumerable: !0
6
- });
7
- return R && __defProp(z, Symbol.toStringTag, { value: "Module" }), z;
8
- }, __copyProps = (B, V, H, U) => {
9
- if (V && typeof V == "object" || typeof V == "function") for (var W = __getOwnPropNames(V), G = 0, K = W.length, q; G < K; G++) q = W[G], !__hasOwnProp.call(B, q) && q !== H && __defProp(B, q, {
10
- get: ((c) => V[c]).bind(null, q),
11
- enumerable: !(U = __getOwnPropDesc(V, q)) || U.enumerable
12
- });
13
- return B;
14
- }, __toCommonJS = (L) => __hasOwnProp.call(L, "module.exports") ? L["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: !0 }), L), tslib_es6_exports = /* @__PURE__ */ __export({
15
- __assign: () => __assign,
16
- __asyncDelegator: () => __asyncDelegator,
17
- __asyncGenerator: () => __asyncGenerator,
18
- __asyncValues: () => __asyncValues,
19
- __await: () => __await,
20
- __awaiter: () => __awaiter,
21
- __classPrivateFieldGet: () => __classPrivateFieldGet,
22
- __classPrivateFieldSet: () => __classPrivateFieldSet,
23
- __createBinding: () => __createBinding,
24
- __decorate: () => __decorate,
25
- __exportStar: () => __exportStar,
26
- __extends: () => __extends,
27
- __generator: () => __generator,
28
- __importDefault: () => __importDefault,
29
- __importStar: () => __importStar,
30
- __makeTemplateObject: () => __makeTemplateObject,
31
- __metadata: () => __metadata,
32
- __param: () => __param,
33
- __read: () => __read,
34
- __rest: () => __rest,
35
- __spread: () => __spread,
36
- __spreadArrays: () => __spreadArrays,
37
- __values: () => __values
38
- }, 1);
39
- function __extends(c, L) {
40
- extendStatics(c, L);
41
- function R() {
42
- this.constructor = c;
43
- }
44
- c.prototype = L === null ? Object.create(L) : (R.prototype = L.prototype, new R());
45
- }
46
- function __rest(c, L) {
47
- var R = {};
48
- for (var z in c) Object.prototype.hasOwnProperty.call(c, z) && L.indexOf(z) < 0 && (R[z] = c[z]);
49
- if (c != null && typeof Object.getOwnPropertySymbols == "function") for (var B = 0, z = Object.getOwnPropertySymbols(c); B < z.length; B++) L.indexOf(z[B]) < 0 && Object.prototype.propertyIsEnumerable.call(c, z[B]) && (R[z[B]] = c[z[B]]);
50
- return R;
51
- }
52
- function __decorate(c, L, R, z) {
53
- var B = arguments.length, V = B < 3 ? L : z === null ? z = Object.getOwnPropertyDescriptor(L, R) : z, H;
54
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") V = Reflect.decorate(c, L, R, z);
55
- else for (var U = c.length - 1; U >= 0; U--) (H = c[U]) && (V = (B < 3 ? H(V) : B > 3 ? H(L, R, V) : H(L, R)) || V);
56
- return B > 3 && V && Object.defineProperty(L, R, V), V;
57
- }
58
- function __param(c, L) {
59
- return function(R, z) {
60
- L(R, z, c);
61
- };
62
- }
63
- function __metadata(c, L) {
64
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(c, L);
65
- }
66
- function __awaiter(c, L, R, z) {
67
- function B(c) {
68
- return c instanceof R ? c : new R(function(L) {
69
- L(c);
70
- });
71
- }
72
- return new (R ||= Promise)(function(R, V) {
73
- function H(c) {
74
- try {
75
- W(z.next(c));
76
- } catch (c) {
77
- V(c);
78
- }
79
- }
80
- function U(c) {
81
- try {
82
- W(z.throw(c));
83
- } catch (c) {
84
- V(c);
85
- }
86
- }
87
- function W(c) {
88
- c.done ? R(c.value) : B(c.value).then(H, U);
89
- }
90
- W((z = z.apply(c, L || [])).next());
91
- });
92
- }
93
- function __generator(c, L) {
94
- var R = {
95
- label: 0,
96
- sent: function() {
97
- if (V[0] & 1) throw V[1];
98
- return V[1];
99
- },
100
- trys: [],
101
- ops: []
102
- }, z, B, V, H;
103
- return H = {
104
- next: U(0),
105
- throw: U(1),
106
- return: U(2)
107
- }, typeof Symbol == "function" && (H[Symbol.iterator] = function() {
108
- return this;
109
- }), H;
110
- function U(c) {
111
- return function(L) {
112
- return W([c, L]);
113
- };
114
- }
115
- function W(H) {
116
- if (z) throw TypeError("Generator is already executing.");
117
- for (; R;) try {
118
- if (z = 1, B && (V = H[0] & 2 ? B.return : H[0] ? B.throw || ((V = B.return) && V.call(B), 0) : B.next) && !(V = V.call(B, H[1])).done) return V;
119
- switch (B = 0, V && (H = [H[0] & 2, V.value]), H[0]) {
120
- case 0:
121
- case 1:
122
- V = H;
123
- break;
124
- case 4: return R.label++, {
125
- value: H[1],
126
- done: !1
127
- };
128
- case 5:
129
- R.label++, B = H[1], H = [0];
130
- continue;
131
- case 7:
132
- H = R.ops.pop(), R.trys.pop();
133
- continue;
134
- default:
135
- if ((V = R.trys, !(V = V.length > 0 && V[V.length - 1])) && (H[0] === 6 || H[0] === 2)) {
136
- R = 0;
137
- continue;
138
- }
139
- if (H[0] === 3 && (!V || H[1] > V[0] && H[1] < V[3])) {
140
- R.label = H[1];
141
- break;
142
- }
143
- if (H[0] === 6 && R.label < V[1]) {
144
- R.label = V[1], V = H;
145
- break;
146
- }
147
- if (V && R.label < V[2]) {
148
- R.label = V[2], R.ops.push(H);
149
- break;
150
- }
151
- V[2] && R.ops.pop(), R.trys.pop();
152
- continue;
153
- }
154
- H = L.call(c, R);
155
- } catch (c) {
156
- H = [6, c], B = 0;
157
- } finally {
158
- z = V = 0;
159
- }
160
- if (H[0] & 5) throw H[1];
161
- return {
162
- value: H[0] ? H[1] : void 0,
163
- done: !0
164
- };
165
- }
166
- }
167
- function __createBinding(c, L, R, z) {
168
- z === void 0 && (z = R), c[z] = L[R];
169
- }
170
- function __exportStar(c, L) {
171
- for (var R in c) R !== "default" && !L.hasOwnProperty(R) && (L[R] = c[R]);
172
- }
173
- function __values(c) {
174
- var L = typeof Symbol == "function" && Symbol.iterator, R = L && c[L], z = 0;
175
- if (R) return R.call(c);
176
- if (c && typeof c.length == "number") return { next: function() {
177
- return c && z >= c.length && (c = void 0), {
178
- value: c && c[z++],
179
- done: !c
180
- };
181
- } };
182
- throw TypeError(L ? "Object is not iterable." : "Symbol.iterator is not defined.");
183
- }
184
- function __read(c, L) {
185
- var R = typeof Symbol == "function" && c[Symbol.iterator];
186
- if (!R) return c;
187
- var z = R.call(c), B, V = [], H;
188
- try {
189
- for (; (L === void 0 || L-- > 0) && !(B = z.next()).done;) V.push(B.value);
190
- } catch (c) {
191
- H = { error: c };
192
- } finally {
193
- try {
194
- B && !B.done && (R = z.return) && R.call(z);
195
- } finally {
196
- if (H) throw H.error;
197
- }
198
- }
199
- return V;
200
- }
201
- function __spread() {
202
- for (var c = [], L = 0; L < arguments.length; L++) c = c.concat(__read(arguments[L]));
203
- return c;
204
- }
205
- function __spreadArrays() {
206
- for (var c = 0, L = 0, R = arguments.length; L < R; L++) c += arguments[L].length;
207
- for (var z = Array(c), B = 0, L = 0; L < R; L++) for (var V = arguments[L], H = 0, U = V.length; H < U; H++, B++) z[B] = V[H];
208
- return z;
209
- }
210
- function __await(c) {
211
- return this instanceof __await ? (this.v = c, this) : new __await(c);
212
- }
213
- function __asyncGenerator(c, L, R) {
214
- if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
215
- var z = R.apply(c, L || []), B, V = [];
216
- return B = {}, H("next"), H("throw"), H("return"), B[Symbol.asyncIterator] = function() {
217
- return this;
218
- }, B;
219
- function H(c) {
220
- z[c] && (B[c] = function(L) {
221
- return new Promise(function(R, z) {
222
- V.push([
223
- c,
224
- L,
225
- R,
226
- z
227
- ]) > 1 || U(c, L);
228
- });
229
- });
230
- }
231
- function U(c, L) {
232
- try {
233
- W(z[c](L));
234
- } catch (c) {
235
- q(V[0][3], c);
236
- }
237
- }
238
- function W(c) {
239
- c.value instanceof __await ? Promise.resolve(c.value.v).then(G, K) : q(V[0][2], c);
240
- }
241
- function G(c) {
242
- U("next", c);
243
- }
244
- function K(c) {
245
- U("throw", c);
246
- }
247
- function q(c, L) {
248
- c(L), V.shift(), V.length && U(V[0][0], V[0][1]);
249
- }
250
- }
251
- function __asyncDelegator(c) {
252
- var L, R;
253
- return L = {}, z("next"), z("throw", function(c) {
254
- throw c;
255
- }), z("return"), L[Symbol.iterator] = function() {
256
- return this;
257
- }, L;
258
- function z(z, B) {
259
- L[z] = c[z] ? function(L) {
260
- return (R = !R) ? {
261
- value: __await(c[z](L)),
262
- done: z === "return"
263
- } : B ? B(L) : L;
264
- } : B;
265
- }
266
- }
267
- function __asyncValues(c) {
268
- if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
269
- var L = c[Symbol.asyncIterator], R;
270
- return L ? L.call(c) : (c = typeof __values == "function" ? __values(c) : c[Symbol.iterator](), R = {}, z("next"), z("throw"), z("return"), R[Symbol.asyncIterator] = function() {
271
- return this;
272
- }, R);
273
- function z(L) {
274
- R[L] = c[L] && function(R) {
275
- return new Promise(function(z, V) {
276
- R = c[L](R), B(z, V, R.done, R.value);
277
- });
278
- };
279
- }
280
- function B(c, L, R, z) {
281
- Promise.resolve(z).then(function(L) {
282
- c({
283
- value: L,
284
- done: R
285
- });
286
- }, L);
287
- }
288
- }
289
- function __makeTemplateObject(c, L) {
290
- return Object.defineProperty ? Object.defineProperty(c, "raw", { value: L }) : c.raw = L, c;
291
- }
292
- function __importStar(c) {
293
- if (c && c.__esModule) return c;
294
- var L = {};
295
- if (c != null) for (var R in c) Object.hasOwnProperty.call(c, R) && (L[R] = c[R]);
296
- return L.default = c, L;
297
- }
298
- function __importDefault(c) {
299
- return c && c.__esModule ? c : { default: c };
300
- }
301
- function __classPrivateFieldGet(c, L) {
302
- if (!L.has(c)) throw TypeError("attempted to get private field on non-instance");
303
- return L.get(c);
304
- }
305
- function __classPrivateFieldSet(c, L, R) {
306
- if (!L.has(c)) throw TypeError("attempted to set private field on non-instance");
307
- return L.set(c, R), R;
308
- }
309
- var extendStatics, __assign, init_tslib_es6 = __esmMin((() => {
310
- extendStatics = function(c, L) {
311
- return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, L) {
312
- c.__proto__ = L;
313
- } || function(c, L) {
314
- for (var R in L) L.hasOwnProperty(R) && (c[R] = L[R]);
315
- }, extendStatics(c, L);
316
- }, __assign = function() {
317
- return __assign = Object.assign || function(c) {
318
- for (var L, R = 1, z = arguments.length; R < z; R++) for (var B in L = arguments[R], L) Object.prototype.hasOwnProperty.call(L, B) && (c[B] = L[B]);
319
- return c;
320
- }, __assign.apply(this, arguments);
321
- };
322
- })), require_constants = /* @__PURE__ */ __commonJSMin(((c) => {
323
- Object.defineProperty(c, "__esModule", { value: !0 }), c.MAX_HASHABLE_LENGTH = c.INIT = c.KEY = c.DIGEST_LENGTH = c.BLOCK_SIZE = void 0, c.BLOCK_SIZE = 64, c.DIGEST_LENGTH = 32, c.KEY = new Uint32Array([
324
- 1116352408,
325
- 1899447441,
326
- 3049323471,
327
- 3921009573,
328
- 961987163,
329
- 1508970993,
330
- 2453635748,
331
- 2870763221,
332
- 3624381080,
333
- 310598401,
334
- 607225278,
335
- 1426881987,
336
- 1925078388,
337
- 2162078206,
338
- 2614888103,
339
- 3248222580,
340
- 3835390401,
341
- 4022224774,
342
- 264347078,
343
- 604807628,
344
- 770255983,
345
- 1249150122,
346
- 1555081692,
347
- 1996064986,
348
- 2554220882,
349
- 2821834349,
350
- 2952996808,
351
- 3210313671,
352
- 3336571891,
353
- 3584528711,
354
- 113926993,
355
- 338241895,
356
- 666307205,
357
- 773529912,
358
- 1294757372,
359
- 1396182291,
360
- 1695183700,
361
- 1986661051,
362
- 2177026350,
363
- 2456956037,
364
- 2730485921,
365
- 2820302411,
366
- 3259730800,
367
- 3345764771,
368
- 3516065817,
369
- 3600352804,
370
- 4094571909,
371
- 275423344,
372
- 430227734,
373
- 506948616,
374
- 659060556,
375
- 883997877,
376
- 958139571,
377
- 1322822218,
378
- 1537002063,
379
- 1747873779,
380
- 1955562222,
381
- 2024104815,
382
- 2227730452,
383
- 2361852424,
384
- 2428436474,
385
- 2756734187,
386
- 3204031479,
387
- 3329325298
388
- ]), c.INIT = [
389
- 1779033703,
390
- 3144134277,
391
- 1013904242,
392
- 2773480762,
393
- 1359893119,
394
- 2600822924,
395
- 528734635,
396
- 1541459225
397
- ], c.MAX_HASHABLE_LENGTH = 2 ** 53 - 1;
398
- })), require_RawSha256 = /* @__PURE__ */ __commonJSMin(((c) => {
399
- Object.defineProperty(c, "__esModule", { value: !0 }), c.RawSha256 = void 0;
400
- var L = require_constants();
401
- c.RawSha256 = function() {
402
- function c() {
403
- this.state = Int32Array.from(L.INIT), this.temp = new Int32Array(64), this.buffer = new Uint8Array(64), this.bufferLength = 0, this.bytesHashed = 0, this.finished = !1;
404
- }
405
- return c.prototype.update = function(c) {
406
- if (this.finished) throw Error("Attempted to update an already finished hash.");
407
- var R = 0, z = c.byteLength;
408
- if (this.bytesHashed += z, this.bytesHashed * 8 > L.MAX_HASHABLE_LENGTH) throw Error("Cannot hash more than 2^53 - 1 bits");
409
- for (; z > 0;) this.buffer[this.bufferLength++] = c[R++], z--, this.bufferLength === L.BLOCK_SIZE && (this.hashBuffer(), this.bufferLength = 0);
410
- }, c.prototype.digest = function() {
411
- if (!this.finished) {
412
- var c = this.bytesHashed * 8, R = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength), z = this.bufferLength;
413
- if (R.setUint8(this.bufferLength++, 128), z % L.BLOCK_SIZE >= L.BLOCK_SIZE - 8) {
414
- for (var B = this.bufferLength; B < L.BLOCK_SIZE; B++) R.setUint8(B, 0);
415
- this.hashBuffer(), this.bufferLength = 0;
416
- }
417
- for (var B = this.bufferLength; B < L.BLOCK_SIZE - 8; B++) R.setUint8(B, 0);
418
- R.setUint32(L.BLOCK_SIZE - 8, Math.floor(c / 4294967296), !0), R.setUint32(L.BLOCK_SIZE - 4, c), this.hashBuffer(), this.finished = !0;
419
- }
420
- for (var V = new Uint8Array(L.DIGEST_LENGTH), B = 0; B < 8; B++) V[B * 4] = this.state[B] >>> 24 & 255, V[B * 4 + 1] = this.state[B] >>> 16 & 255, V[B * 4 + 2] = this.state[B] >>> 8 & 255, V[B * 4 + 3] = this.state[B] >>> 0 & 255;
421
- return V;
422
- }, c.prototype.hashBuffer = function() {
423
- for (var c = this, R = c.buffer, z = c.state, B = z[0], V = z[1], H = z[2], U = z[3], W = z[4], G = z[5], K = z[6], q = z[7], J = 0; J < L.BLOCK_SIZE; J++) {
424
- if (J < 16) this.temp[J] = (R[J * 4] & 255) << 24 | (R[J * 4 + 1] & 255) << 16 | (R[J * 4 + 2] & 255) << 8 | R[J * 4 + 3] & 255;
425
- else {
426
- var Y = this.temp[J - 2], X = (Y >>> 17 | Y << 15) ^ (Y >>> 19 | Y << 13) ^ Y >>> 10;
427
- Y = this.temp[J - 15];
428
- var Z = (Y >>> 7 | Y << 25) ^ (Y >>> 18 | Y << 14) ^ Y >>> 3;
429
- this.temp[J] = (X + this.temp[J - 7] | 0) + (Z + this.temp[J - 16] | 0);
430
- }
431
- var Q = (((W >>> 6 | W << 26) ^ (W >>> 11 | W << 21) ^ (W >>> 25 | W << 7)) + (W & G ^ ~W & K) | 0) + (q + (L.KEY[J] + this.temp[J] | 0) | 0) | 0, $ = ((B >>> 2 | B << 30) ^ (B >>> 13 | B << 19) ^ (B >>> 22 | B << 10)) + (B & V ^ B & H ^ V & H) | 0;
432
- q = K, K = G, G = W, W = U + Q | 0, U = H, H = V, V = B, B = Q + $ | 0;
433
- }
434
- z[0] += B, z[1] += V, z[2] += H, z[3] += U, z[4] += W, z[5] += G, z[6] += K, z[7] += q;
435
- }, c;
436
- }();
437
- })), fromUtf8$1, toUtf8, init_pureJs = __esmMin((() => {
438
- fromUtf8$1 = (c) => {
439
- let L = [];
440
- for (let R = 0, z = c.length; R < z; R++) {
441
- let z = c.charCodeAt(R);
442
- if (z < 128) L.push(z);
443
- else if (z < 2048) L.push(z >> 6 | 192, z & 63 | 128);
444
- else if (R + 1 < c.length && (z & 64512) == 55296 && (c.charCodeAt(R + 1) & 64512) == 56320) {
445
- let B = 65536 + ((z & 1023) << 10) + (c.charCodeAt(++R) & 1023);
446
- L.push(B >> 18 | 240, B >> 12 & 63 | 128, B >> 6 & 63 | 128, B & 63 | 128);
447
- } else L.push(z >> 12 | 224, z >> 6 & 63 | 128, z & 63 | 128);
448
- }
449
- return Uint8Array.from(L);
450
- }, toUtf8 = (c) => {
451
- let L = "";
452
- for (let R = 0, z = c.length; R < z; R++) {
453
- let z = c[R];
454
- if (z < 128) L += String.fromCharCode(z);
455
- else if (192 <= z && z < 224) {
456
- let B = c[++R];
457
- L += String.fromCharCode((z & 31) << 6 | B & 63);
458
- } else if (240 <= z && z < 365) {
459
- let B = "%" + [
460
- z,
461
- c[++R],
462
- c[++R],
463
- c[++R]
464
- ].map((c) => c.toString(16)).join("%");
465
- L += decodeURIComponent(B);
466
- } else L += String.fromCharCode((z & 15) << 12 | (c[++R] & 63) << 6 | c[++R] & 63);
467
- }
468
- return L;
469
- };
470
- }));
471
- function fromUtf8$2(c) {
472
- return new TextEncoder().encode(c);
473
- }
474
- function toUtf8$1(c) {
475
- return new TextDecoder("utf-8").decode(c);
476
- }
477
- var init_whatwgEncodingApi = __esmMin((() => {})), dist_es_exports = /* @__PURE__ */ __export({
478
- fromUtf8: () => fromUtf8$3,
479
- toUtf8: () => toUtf8$2
480
- }, 1), fromUtf8$3, toUtf8$2, init_dist_es = __esmMin((() => {
481
- init_pureJs(), init_whatwgEncodingApi(), fromUtf8$3 = (c) => typeof TextEncoder == "function" ? fromUtf8$2(c) : fromUtf8$1(c), toUtf8$2 = (c) => typeof TextDecoder == "function" ? toUtf8$1(c) : toUtf8(c);
482
- })), require_convertToBuffer = /* @__PURE__ */ __commonJSMin(((c) => {
483
- Object.defineProperty(c, "__esModule", { value: !0 }), c.convertToBuffer = void 0;
484
- var L = (init_dist_es(), __toCommonJS(dist_es_exports)), R = typeof Buffer < "u" && Buffer.from ? function(c) {
485
- return Buffer.from(c, "utf8");
486
- } : L.fromUtf8;
487
- function z(c) {
488
- return c instanceof Uint8Array ? c : typeof c == "string" ? R(c) : ArrayBuffer.isView(c) ? new Uint8Array(c.buffer, c.byteOffset, c.byteLength / Uint8Array.BYTES_PER_ELEMENT) : new Uint8Array(c);
489
- }
490
- c.convertToBuffer = z;
491
- })), require_isEmptyData = /* @__PURE__ */ __commonJSMin(((c) => {
492
- Object.defineProperty(c, "__esModule", { value: !0 }), c.isEmptyData = void 0;
493
- function L(c) {
494
- return typeof c == "string" ? c.length === 0 : c.byteLength === 0;
495
- }
496
- c.isEmptyData = L;
497
- })), require_numToUint8 = /* @__PURE__ */ __commonJSMin(((c) => {
498
- Object.defineProperty(c, "__esModule", { value: !0 }), c.numToUint8 = void 0;
499
- function L(c) {
500
- return new Uint8Array([
501
- (c & 4278190080) >> 24,
502
- (c & 16711680) >> 16,
503
- (c & 65280) >> 8,
504
- c & 255
505
- ]);
506
- }
507
- c.numToUint8 = L;
508
- })), require_uint32ArrayFrom = /* @__PURE__ */ __commonJSMin(((c) => {
509
- Object.defineProperty(c, "__esModule", { value: !0 }), c.uint32ArrayFrom = void 0;
510
- function L(c) {
511
- if (!Uint32Array.from) {
512
- for (var L = new Uint32Array(c.length), R = 0; R < c.length;) L[R] = c[R], R += 1;
513
- return L;
514
- }
515
- return Uint32Array.from(c);
516
- }
517
- c.uint32ArrayFrom = L;
518
- })), require_build$1 = /* @__PURE__ */ __commonJSMin(((c) => {
519
- Object.defineProperty(c, "__esModule", { value: !0 }), c.uint32ArrayFrom = c.numToUint8 = c.isEmptyData = c.convertToBuffer = void 0;
520
- var L = require_convertToBuffer();
521
- Object.defineProperty(c, "convertToBuffer", {
522
- enumerable: !0,
523
- get: function() {
524
- return L.convertToBuffer;
525
- }
526
- });
527
- var R = require_isEmptyData();
528
- Object.defineProperty(c, "isEmptyData", {
529
- enumerable: !0,
530
- get: function() {
531
- return R.isEmptyData;
532
- }
533
- });
534
- var z = require_numToUint8();
535
- Object.defineProperty(c, "numToUint8", {
536
- enumerable: !0,
537
- get: function() {
538
- return z.numToUint8;
539
- }
540
- });
541
- var B = require_uint32ArrayFrom();
542
- Object.defineProperty(c, "uint32ArrayFrom", {
543
- enumerable: !0,
544
- get: function() {
545
- return B.uint32ArrayFrom;
546
- }
547
- });
548
- })), require_jsSha256 = /* @__PURE__ */ __commonJSMin(((c) => {
549
- Object.defineProperty(c, "__esModule", { value: !0 }), c.Sha256 = void 0;
550
- var L = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)), R = require_constants(), z = require_RawSha256(), B = require_build$1();
551
- c.Sha256 = function() {
552
- function c(c) {
553
- this.secret = c, this.hash = new z.RawSha256(), this.reset();
554
- }
555
- return c.prototype.update = function(c) {
556
- if (!((0, B.isEmptyData)(c) || this.error)) try {
557
- this.hash.update((0, B.convertToBuffer)(c));
558
- } catch (c) {
559
- this.error = c;
560
- }
561
- }, c.prototype.digestSync = function() {
562
- if (this.error) throw this.error;
563
- return this.outer ? (this.outer.finished || this.outer.update(this.hash.digest()), this.outer.digest()) : this.hash.digest();
564
- }, c.prototype.digest = function() {
565
- return L.__awaiter(this, void 0, void 0, function() {
566
- return L.__generator(this, function(c) {
567
- return [2, this.digestSync()];
568
- });
569
- });
570
- }, c.prototype.reset = function() {
571
- if (this.hash = new z.RawSha256(), this.secret) {
572
- this.outer = new z.RawSha256();
573
- var c = V(this.secret), L = new Uint8Array(R.BLOCK_SIZE);
574
- L.set(c);
575
- for (var B = 0; B < R.BLOCK_SIZE; B++) c[B] ^= 54, L[B] ^= 92;
576
- this.hash.update(c), this.outer.update(L);
577
- for (var B = 0; B < c.byteLength; B++) c[B] = 0;
578
- }
579
- }, c;
580
- }();
581
- function V(c) {
582
- var L = (0, B.convertToBuffer)(c);
583
- if (L.byteLength > R.BLOCK_SIZE) {
584
- var V = new z.RawSha256();
585
- V.update(L), L = V.digest();
586
- }
587
- var H = new Uint8Array(R.BLOCK_SIZE);
588
- return H.set(L), H;
589
- }
590
- })), require_build = /* @__PURE__ */ __commonJSMin(((c) => {
591
- Object.defineProperty(c, "__esModule", { value: !0 }), (init_tslib_es6(), __toCommonJS(tslib_es6_exports)).__exportStar(require_jsSha256(), c);
592
- })), import_build$1 = require_build();
593
- function wrapDucklakeQuery(c, L) {
594
- let R = `ATTACH 'ducklake://${L}' AS dl;USE dl;\n`;
595
- return c.replace(/^(--.*\n)*/, (c) => c + R);
596
- }
597
- function getIntrospectionQuery(c) {
598
- let L = {
599
- descriptions: !0,
600
- specifiedByUrl: !1,
601
- directiveIsRepeatable: !1,
602
- schemaDescription: !1,
603
- inputValueDeprecation: !1,
604
- oneOf: !1,
605
- ...c
606
- }, R = L.descriptions ? "description" : "", z = L.specifiedByUrl ? "specifiedByURL" : "", B = L.directiveIsRepeatable ? "isRepeatable" : "", V = L.schemaDescription ? R : "";
607
- function H(c) {
608
- return L.inputValueDeprecation ? c : "";
609
- }
610
- let U = L.oneOf ? "isOneOf" : "";
611
- return `
612
- query IntrospectionQuery {
613
- __schema {
614
- ${V}
615
- queryType { name kind }
616
- mutationType { name kind }
617
- subscriptionType { name kind }
618
- types {
619
- ...FullType
620
- }
621
- directives {
622
- name
623
- ${R}
624
- ${B}
625
- locations
626
- args${H("(includeDeprecated: true)")} {
627
- ...InputValue
628
- }
629
- }
630
- }
631
- }
632
-
633
- fragment FullType on __Type {
634
- kind
635
- name
636
- ${R}
637
- ${z}
638
- ${U}
639
- fields(includeDeprecated: true) {
640
- name
641
- ${R}
642
- args${H("(includeDeprecated: true)")} {
643
- ...InputValue
644
- }
645
- type {
646
- ...TypeRef
647
- }
648
- isDeprecated
649
- deprecationReason
650
- }
651
- inputFields${H("(includeDeprecated: true)")} {
652
- ...InputValue
653
- }
654
- interfaces {
655
- ...TypeRef
656
- }
657
- enumValues(includeDeprecated: true) {
658
- name
659
- ${R}
660
- isDeprecated
661
- deprecationReason
662
- }
663
- possibleTypes {
664
- ...TypeRef
665
- }
666
- }
667
-
668
- fragment InputValue on __InputValue {
669
- name
670
- ${R}
671
- type { ...TypeRef }
672
- defaultValue
673
- ${H("isDeprecated")}
674
- ${H("deprecationReason")}
675
- }
676
-
677
- fragment TypeRef on __Type {
678
- kind
679
- name
680
- ofType {
681
- kind
682
- name
683
- ofType {
684
- kind
685
- name
686
- ofType {
687
- kind
688
- name
689
- ofType {
690
- kind
691
- name
692
- ofType {
693
- kind
694
- name
695
- ofType {
696
- kind
697
- name
698
- ofType {
699
- kind
700
- name
701
- ofType {
702
- kind
703
- name
704
- ofType {
705
- kind
706
- name
707
- }
708
- }
709
- }
710
- }
711
- }
712
- }
713
- }
714
- }
715
- }
716
- }
717
- `;
718
- }
719
- let ColumnIdentity = /* @__PURE__ */ function(c) {
720
- return c.ByDefault = "By Default", c.Always = "Always", c.No = "No", c;
721
- }({});
722
- var legacyScripts = {
723
- postgresql: {
724
- code: "SELECT table_name, column_name, udt_name, column_default, is_nullable, table_schema FROM information_schema.columns WHERE table_schema != 'pg_catalog' AND table_schema != 'information_schema'",
725
- processingFn: (c) => {
726
- let L = c.reduce((c, L) => {
727
- let R = L.table_schema;
728
- return delete L.table_schema, c[R] = c[R] || [], (L.table_name || L.column_name) && c[R].push(L), c;
729
- }, {}), R = {};
730
- for (let c in L) R[c] = L[c].reduce((c, L) => {
731
- let R = L.table_name;
732
- delete L.table_name, c[R] = c[R] || {};
733
- let z = {
734
- type: L.udt_name,
735
- required: L.is_nullable === "NO"
736
- };
737
- return L.column_default && (z.default = L.column_default), c[R][L.column_name] = z, c;
738
- }, {});
739
- return R;
740
- },
741
- lang: "postgresql",
742
- argName: "database"
743
- },
744
- mysql: {
745
- code: "SELECT DATABASE() AS default_db_name, TABLE_SCHEMA, TABLE_NAME, DATA_TYPE, COLUMN_NAME, COLUMN_DEFAULT FROM information_schema.columns WHERE table_schema = DATABASE() OR table_schema NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys', '_vt');",
746
- processingFn: (c) => {
747
- let L = c.reduce((c, L) => {
748
- let R = L.TABLE_SCHEMA;
749
- return delete L.TABLE_SCHEMA, c[R] = c[R] || [], c[R].push(L), c;
750
- }, {}), R = {};
751
- for (let c in L) R[c] = L[c].reduce((c, L) => {
752
- let R = L.TABLE_NAME;
753
- delete L.TABLE_NAME, c[R] = c[R] || {};
754
- let z = {
755
- type: L.DATA_TYPE,
756
- required: L.is_nullable === "NO"
757
- };
758
- return L.column_default && (z.default = L.COLUMN_DEFAULT), c[R][L.COLUMN_NAME] = z, c;
759
- }, {});
760
- return R;
761
- },
762
- lang: "mysql",
763
- argName: "database"
764
- },
765
- graphql: {
766
- code: getIntrospectionQuery(),
767
- lang: "graphql",
768
- argName: "api"
769
- },
770
- bigquery: {
771
- code: "import { BigQuery } from '@google-cloud/bigquery@7.5.0';\nexport async function main(args: bigquery) {\nconst bq = new BigQuery({\n credentials: args\n})\nconst [datasets] = await bq.getDatasets();\nconst schema = {}\nfor (const dataset of datasets) {\n schema[dataset.id] = {}\n const query = \"SELECT table_name, ARRAY_AGG(STRUCT(if(is_nullable = 'YES', true, false) AS required, column_name AS name, data_type AS type, if(column_default = 'NULL', null, column_default) AS `default`) ORDER BY ordinal_position) AS schema FROM `{dataset.id}`.INFORMATION_SCHEMA.COLUMNS GROUP BY table_name\".replace('{dataset.id}', dataset.id)\n const [rows] = await bq.query(query)\n for (const row of rows) {\n schema[dataset.id][row.table_name] = {}\n for (const col of row.schema) {\n const colName = col.name\n delete col.name\n if (col.default === null) {\n delete col.default\n }\n schema[dataset.id][row.table_name][colName] = col\n }\n }\n}\nreturn schema\n}",
772
- lang: "bun",
773
- argName: "args"
774
- },
775
- snowflake: {
776
- code: "select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE, COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE from information_schema.columns where table_schema != 'INFORMATION_SCHEMA'",
777
- lang: "snowflake",
778
- processingFn: (c) => {
779
- let L = {};
780
- for (let R of c) R.TABLE_SCHEMA in L || (L[R.TABLE_SCHEMA] = {}), R.TABLE_NAME in L[R.TABLE_SCHEMA] || (L[R.TABLE_SCHEMA][R.TABLE_NAME] = {}), L[R.TABLE_SCHEMA][R.TABLE_NAME][R.COLUMN_NAME] = {
781
- type: R.DATA_TYPE,
782
- required: R.IS_NULLABLE === "YES"
783
- }, R.COLUMN_DEFAULT !== null && (L[R.TABLE_SCHEMA][R.TABLE_NAME][R.COLUMN_NAME].default = R.COLUMN_DEFAULT);
784
- return L;
785
- },
786
- argName: "database"
787
- },
788
- snowflake_oauth: {
789
- code: "select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE, COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE from information_schema.columns where table_schema != 'INFORMATION_SCHEMA'",
790
- lang: "snowflake",
791
- processingFn: (c) => {
792
- let L = {};
793
- for (let R of c) R.TABLE_SCHEMA in L || (L[R.TABLE_SCHEMA] = {}), R.TABLE_NAME in L[R.TABLE_SCHEMA] || (L[R.TABLE_SCHEMA][R.TABLE_NAME] = {}), L[R.TABLE_SCHEMA][R.TABLE_NAME][R.COLUMN_NAME] = {
794
- type: R.DATA_TYPE,
795
- required: R.IS_NULLABLE === "YES"
796
- }, R.COLUMN_DEFAULT !== null && (L[R.TABLE_SCHEMA][R.TABLE_NAME][R.COLUMN_NAME].default = R.COLUMN_DEFAULT);
797
- return L;
798
- },
799
- argName: "database"
800
- },
801
- mssql: {
802
- argName: "database",
803
- code: "select TABLE_SCHEMA, TABLE_NAME, DATA_TYPE, COLUMN_NAME, COLUMN_DEFAULT from information_schema.columns where table_schema != 'sys'",
804
- lang: "mssql",
805
- processingFn: (c) => {
806
- if (!c || c.length === 0) return {};
807
- let L = c.reduce((c, L) => {
808
- let R = L.TABLE_SCHEMA;
809
- return delete L.TABLE_SCHEMA, c[R] = c[R] || [], c[R].push(L), c;
810
- }, {}), R = {};
811
- for (let c in L) R[c] = L[c].reduce((c, L) => {
812
- let R = L.TABLE_NAME;
813
- delete L.TABLE_NAME, c[R] = c[R] || {};
814
- let z = {
815
- type: L.DATA_TYPE,
816
- required: L.is_nullable === "NO"
817
- };
818
- return L.column_default && (z.default = L.COLUMN_DEFAULT), c[R][L.COLUMN_NAME] = z, c;
819
- }, {});
820
- return R;
821
- }
822
- }
823
- };
824
- ({ ...legacyScripts }), { ...legacyScripts.postgresql };
825
- function buildVisibleFieldList(c, L) {
826
- return c.filter((c) => c && c.ignored !== !0).map((c) => renderDbQuotedIdentifier(c?.field, L));
827
- }
828
- function renderDbQuotedIdentifier(c, L) {
829
- switch (L) {
830
- case "postgresql": return `"${c}"`;
831
- case "ms_sql_server": return `[${c}]`;
832
- case "mysql": return `\`${c}\``;
833
- case "snowflake": return `"${c}"`;
834
- case "bigquery": return `\`${c}\``;
835
- case "duckdb": return `"${c}"`;
836
- default: throw Error("Unsupported database type: " + L);
837
- }
838
- }
839
- function getLanguageByResourceType(c) {
840
- return {
841
- postgresql: "postgresql",
842
- mysql: "mysql",
843
- ms_sql_server: "mssql",
844
- mssql: "mssql",
845
- snowflake: "snowflake",
846
- snowflake_oauth: "snowflake",
847
- bigquery: "bigquery",
848
- duckdb: "duckdb"
849
- }[c];
850
- }
851
- function buildParameters(c, L) {
852
- return c.map((c, R) => {
853
- switch (L) {
854
- case "postgresql": return `-- $${R + 1} ${c.field}`;
855
- case "mysql": return `-- :${c.field} (${c.datatype.split("(")[0]})`;
856
- case "ms_sql_server": return `-- @p${R + 1} ${c.field} (${c.datatype.split("(")[0]})`;
857
- case "snowflake": return `-- ? ${c.field} (${c.datatype.split("(")[0]})`;
858
- case "bigquery": return `-- @${c.field} (${c.datatype.split("(")[0]})`;
859
- case "duckdb": return `-- $${c.field} (${c.datatype.split("(")[0]})`;
860
- }
861
- }).join("\n");
862
- }
863
- function getPrimaryKeys(c) {
864
- let L = c?.filter((c) => c.isprimarykey)?.map((c) => c.field) ?? [];
865
- return L?.length === 0 && (L = c?.map((c) => c.field) ?? []), L ?? [];
866
- }
867
- function makeCountQuery(c, L, R = void 0, z) {
868
- let B = " WHERE ", V = " AND ", H = "", U = buildParameters([{
869
- field: "quicksearch",
870
- datatype: c === "bigquery" ? "string" : "text"
871
- }], c);
872
- U += "\n", R && (H = ` ${R} AND `);
873
- let W = buildVisibleFieldList(z, c);
874
- switch (c) {
875
- case "mysql":
876
- W.length > 0 ? H += ` (:quicksearch = '' OR CONCAT_WS(' ', ${W.join(", ")}) LIKE CONCAT('%', :quicksearch, '%'))` : H += " (:quicksearch = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM ${L}`;
877
- break;
878
- case "postgresql":
879
- W.length > 0 ? H += `($1 = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || $1 || '%')` : H += "($1 = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM ${L}`;
880
- break;
881
- case "ms_sql_server":
882
- W.length > 0 ? H += `(@p1 = '' OR CONCAT(${W.join(", +")}) LIKE '%' + @p1 + '%')` : H += "(@p1 = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM [${L}]`;
883
- break;
884
- case "snowflake":
885
- U = "", W.length > 0 ? (U += buildParameters([{
886
- field: "quicksearch",
887
- datatype: "text"
888
- }, {
889
- field: "quicksearch",
890
- datatype: "text"
891
- }], c), U += "\n", H += `(? = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || ? || '%')`) : (U += buildParameters([{
892
- field: "quicksearch",
893
- datatype: "text"
894
- }], c), U += "\n", H += "(? = '' OR 1 = 1)"), U += `SELECT COUNT(*) as count FROM ${L}`;
895
- break;
896
- case "bigquery":
897
- if (W.length > 0) {
898
- let c = W.map((c) => {
899
- let L = z.find((L) => L.field === c.slice(1, -1));
900
- return L?.datatype === "JSON" || L?.datatype.startsWith("STRUCT") || L?.datatype.startsWith("ARRAY") ? `TO_JSON_STRING(${c})` : `${c}`;
901
- }).join(",");
902
- H += `(@quicksearch = '' OR REGEXP_CONTAINS(CONCAT(${c}), '(?i)' || @quicksearch))`;
903
- } else H += "(@quicksearch = '' OR 1 = 1)";
904
- U += `SELECT COUNT(*) as count FROM \`${L}\``;
905
- break;
906
- case "duckdb":
907
- W.length > 0 ? H += ` ($quicksearch = '' OR CONCAT(' ', ${W.join(", ")}) LIKE CONCAT('%', $quicksearch, '%'))` : H += " ($quicksearch = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM ${L}`;
908
- break;
909
- default: throw Error("Unsupported database type:" + c);
910
- }
911
- return R ? U += `${B}${H}` : (U += c === "ms_sql_server" && !R ? B : V, U += H), !R && (c === "mysql" || c === "postgresql" || c === "snowflake" || c === "bigquery" || c === "duckdb") && (U = U.replace(`${V}`, B)), U;
912
- }
913
- function getCountInput(c, L, R, z) {
914
- if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L || !R?.length) return;
915
- let B = c.type === "ducklake" ? "duckdb" : c.resourceType, V = makeCountQuery(B, L, z, R);
916
- return c.type === "ducklake" && (V = wrapDucklakeQuery(V, c.ducklake)), {
917
- runnable: {
918
- name: "AppDbExplorer",
919
- type: "inline",
920
- inlineScript: {
921
- content: V,
922
- language: getLanguageByResourceType(B),
923
- schema: {
924
- $schema: "https://json-schema.org/draft/2020-12/schema",
925
- properties: c.type === "database" ? { database: {
926
- description: "Database name",
927
- type: "object",
928
- format: `resource-${B}`
929
- } } : {},
930
- required: ["database"],
931
- type: "object"
932
- }
933
- }
934
- },
935
- fields: c.type === "database" ? { database: {
936
- type: "static",
937
- value: `$res:${c.resourcePath}`,
938
- fieldType: "object",
939
- format: `resource-${B}`
940
- } } : {},
941
- type: "runnable",
942
- fieldType: "object"
943
- };
944
- }
945
- function makeDeleteQuery(c, L, R) {
946
- let z = buildParameters(R === "snowflake" ? L.flatMap((c) => [c, c]) : L, R);
947
- switch (R) {
948
- case "postgresql": {
949
- let R = L.map((c, L) => `($${L + 1}::text::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${L + 1}::text::${c.datatype})`).join("\n AND ");
950
- return z += `\nDELETE FROM ${c} \nWHERE ${R} RETURNING 1;`, z;
951
- }
952
- case "mysql": {
953
- let R = L.map((c) => `(:${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = :${c.field})`).join("\n AND ");
954
- return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
955
- }
956
- case "ms_sql_server": {
957
- let R = L.map((c, L) => `(@p${L + 1} IS NULL AND ${c.field} IS NULL OR ${c.field} = @p${L + 1})`).join("\n AND ");
958
- return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
959
- }
960
- case "snowflake": {
961
- let R = L.map((c, L) => `(? = 'null' AND ${c.field} IS NULL OR ${c.field} = ?)`).join("\n AND ");
962
- return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
963
- }
964
- case "bigquery": {
965
- let R = L.map((c, L) => `(CAST(@${c.field} AS STRING) = 'null' AND ${c.field} IS NULL OR ${c.field} = @${c.field})`).join("\n AND ");
966
- return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
967
- }
968
- case "duckdb": {
969
- let R = L.map((c) => `($${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${c.field})`).join("\n AND ");
970
- return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
971
- }
972
- default: throw Error("Unsupported database type");
973
- }
974
- }
975
- function getDeleteInput(c, L, R) {
976
- if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L) return;
977
- let z = c.type === "ducklake" ? "duckdb" : c.resourceType, B = makeDeleteQuery(L, R, z);
978
- return c.type === "ducklake" && (B = wrapDucklakeQuery(B, c.ducklake)), {
979
- runnable: {
980
- name: "AppDbExplorer",
981
- type: "inline",
982
- inlineScript: {
983
- content: B,
984
- language: getLanguageByResourceType(z),
985
- schema: {
986
- $schema: "https://json-schema.org/draft/2020-12/schema",
987
- properties: {},
988
- required: ["database"],
989
- type: "object"
990
- }
991
- }
992
- },
993
- fields: c.type == "database" ? { database: {
994
- type: "static",
995
- value: `$res:${c.resourcePath}`,
996
- fieldType: "object",
997
- format: `resource-${z}`
998
- } } : {},
999
- type: "runnable",
1000
- fieldType: "object"
1001
- };
1002
- }
1003
- function formatInsertValues(c, L, R = 1) {
1004
- switch (L) {
1005
- case "mysql": return c.map((c) => `:${c.field}`).join(", ");
1006
- case "postgresql": return c.map((c, L) => `$${R + L}::${c.datatype}`).join(", ");
1007
- case "ms_sql_server": return c.map((c, L) => `@p${R + L}`).join(", ");
1008
- case "snowflake": return c.map(() => "?").join(", ");
1009
- case "bigquery": return c.map((c) => `@${c.field}`).join(", ");
1010
- case "duckdb": return c.map((c) => `$${c.field}`).join(", ");
1011
- default: throw Error("Unsupported database type");
1012
- }
1013
- }
1014
- function formatColumnNames(c) {
1015
- return c.map((c) => c.field).join(", ");
1016
- }
1017
- function getUserDefaultValue(c) {
1018
- if (c.defaultValueNull) return "NULL";
1019
- if (c.defaultUserValue) return typeof c.defaultUserValue == "string" ? `'${c.defaultUserValue}'` : c.defaultUserValue;
1020
- }
1021
- function formatDefaultValues(c) {
1022
- return c.map((c) => {
1023
- let L = getUserDefaultValue(c);
1024
- return c.overrideDefaultValue === !0 ? L : L ?? c.defaultvalue;
1025
- }).join(", ");
1026
- }
1027
- function shouldOmitColumnInInsert(c) {
1028
- if (!c.hideInsert || c.isidentity === ColumnIdentity.Always) return !0;
1029
- let L = c.defaultUserValue !== void 0 && c.defaultUserValue !== "" || c.defaultValueNull === !0, R = !!c.defaultvalue;
1030
- if (c.isnullable === "NO") {
1031
- if (!L && !R && c.isidentity === ColumnIdentity.No) throw Error(`Column ${c.field} is not nullable and has no default value`);
1032
- return !L && !R ? c.isidentity !== ColumnIdentity.No : !L && R;
1033
- } else if (c.isnullable === "YES") return !L;
1034
- return !1;
1035
- }
1036
- function makeInsertQuery(c, L, R) {
1037
- if (!c) throw Error("Table name is required");
1038
- let z = L.filter((c) => !c.hideInsert && !(R == "postgresql" && c.defaultvalue?.startsWith("nextval("))), B = L.filter((c) => !shouldOmitColumnInInsert(c)), V = z.concat(B), H = buildParameters(z, R);
1039
- H += "\n";
1040
- let U = B.length > 0, W = formatColumnNames(V), G = formatInsertValues(z, R), K = formatDefaultValues(B), q = `${G}${U ? ", " : ""}${K}`;
1041
- return q.trim() ? (H += `INSERT INTO ${c} (${W}) VALUES (${q})`, H) : `INSERT INTO ${c} DEFAULT VALUES`;
1042
- }
1043
- function getInsertInput(c, L, R) {
1044
- let z = c.type === "ducklake" ? "duckdb" : c.resourceType, B = makeInsertQuery(L, R, z);
1045
- return c.type === "ducklake" && (B = wrapDucklakeQuery(B, c.ducklake)), {
1046
- runnable: {
1047
- name: "AppDbExplorer",
1048
- type: "inline",
1049
- inlineScript: {
1050
- content: B,
1051
- language: getLanguageByResourceType(z),
1052
- schema: {
1053
- $schema: "https://json-schema.org/draft/2020-12/schema",
1054
- properties: {},
1055
- required: ["database"],
1056
- type: "object"
1057
- }
1058
- }
1059
- },
1060
- fields: c.type === "database" ? { database: {
1061
- type: "static",
1062
- value: `$res:${c.resourcePath}`,
1063
- fieldType: "object",
1064
- format: `resource-${z}`
1065
- } } : {},
1066
- type: "runnable",
1067
- fieldType: "object"
1068
- };
1069
- }
1070
- function makeSnowflakeSelectQuery(c, L, R, z) {
1071
- let B = coerceToNumber(z?.limit) || 100, V = coerceToNumber(z?.offset) || 0, H = [{
1072
- field: "quicksearch",
1073
- datatype: "text"
1074
- }], U = "";
1075
- U += "\n";
1076
- let W = buildVisibleFieldList(L, "snowflake"), G = W.join(", ");
1077
- U += `SELECT ${G} FROM ${c}`;
1078
- let K = ["LENGTH(?) = 0", ...W.map((c) => (H.push({
1079
- field: "quicksearch",
1080
- datatype: "text"
1081
- }), `CONCAT(${c}) ILIKE CONCAT('%', ?, '%')`))].join(" OR ");
1082
- R ? U += ` WHERE ${R} AND (${K})` : U += ` WHERE ${K}`;
1083
- let q = L.map((c) => (H.push({
1084
- field: "order_by",
1085
- datatype: "text"
1086
- }, {
1087
- field: "is_desc",
1088
- datatype: "boolean"
1089
- }, {
1090
- field: "order_by",
1091
- datatype: "text"
1092
- }, {
1093
- field: "is_desc",
1094
- datatype: "boolean"
1095
- }), `CASE WHEN ? = '${c.field}' AND ? = FALSE THEN "${c.field}" END ASC,
1096
- CASE WHEN ? = '${c.field}' AND ? = TRUE THEN "${c.field}" END DESC`));
1097
- return U += ` ORDER BY ${q.join(",\n")}`, U += ` LIMIT ${B} OFFSET ${V}`, U = buildParameters(H, "snowflake") + "\n" + U, U;
1098
- }
1099
- function makeSelectQuery(c, L, R, z, B, V) {
1100
- if (!c) throw Error("Table name is required");
1101
- let H = "", U = buildParameters([
1102
- {
1103
- field: "limit",
1104
- datatype: z === "bigquery" ? "integer" : "int"
1105
- },
1106
- {
1107
- field: "offset",
1108
- datatype: z === "bigquery" ? "integer" : "int"
1109
- },
1110
- {
1111
- field: "quicksearch",
1112
- datatype: z === "bigquery" ? "string" : "text"
1113
- },
1114
- {
1115
- field: "order_by",
1116
- datatype: z === "bigquery" ? "string" : "text"
1117
- },
1118
- {
1119
- field: "is_desc",
1120
- datatype: z === "bigquery" ? "bool" : "boolean"
1121
- }
1122
- ], z);
1123
- U += "\n";
1124
- let W = buildVisibleFieldList(L, z), G = W.join(", ");
1125
- switch (z) {
1126
- case "mysql": {
1127
- let z = L.map((c) => `
1128
- CASE WHEN :order_by = '${c.field}' AND :is_desc IS false THEN \`${c.field}\` END,
1129
- CASE WHEN :order_by = '${c.field}' AND :is_desc IS true THEN \`${c.field}\` END DESC`).join(",\n");
1130
- H = ` (:quicksearch = '' OR CONCAT_WS(' ', ${W.join(", ")}) LIKE CONCAT('%', :quicksearch, '%'))`, U += `SELECT ${G} FROM ${c}`, U += ` WHERE ${R ? `${R} AND` : ""} ${H}`, U += ` ORDER BY ${z}`, U += " LIMIT :limit OFFSET :offset";
1131
- break;
1132
- }
1133
- case "postgresql": {
1134
- function z({ field: c, is_desc: L = !1, text_cast: R = !1, check_is_number: z }) {
1135
- return `(CASE WHEN${z === !0 ? ` pg_typeof("${c}")::text IN ('integer', 'bigint', 'smallint', 'numeric', 'real', 'double precision') AND` : z === !1 ? ` pg_typeof("${c}")::text NOT IN ('integer', 'bigint', 'smallint', 'numeric', 'real', 'double precision') AND` : ""} $4 = '${c}' AND $5 IS ${L} THEN "${c}"${R ? "::text" : ""} END)${L ? " DESC" : ""}`;
1136
- }
1137
- let B = `
1138
- ${L.map((c) => V?.fixPgIntTypes ? `
1139
- ${z({
1140
- field: c.field,
1141
- is_desc: !1,
1142
- text_cast: !0,
1143
- check_is_number: !1
1144
- })},
1145
- ${z({
1146
- field: c.field,
1147
- is_desc: !1,
1148
- text_cast: !1,
1149
- check_is_number: !0
1150
- })},
1151
- ${z({
1152
- field: c.field,
1153
- is_desc: !0,
1154
- text_cast: !0,
1155
- check_is_number: !1
1156
- })},
1157
- ${z({
1158
- field: c.field,
1159
- is_desc: !0,
1160
- text_cast: !1,
1161
- check_is_number: !0
1162
- })}` : `
1163
- ${z({
1164
- field: c.field,
1165
- is_desc: !1,
1166
- text_cast: !0
1167
- })},
1168
- ${z({
1169
- field: c.field,
1170
- is_desc: !0,
1171
- text_cast: !0
1172
- })}`).join(",\n")}`;
1173
- H = `($3 = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || $3 || '%')`, U += `SELECT ${W.map((c) => `${c}::text`).join(", ")} FROM ${c}\n`, U += ` WHERE ${R ? `${R} AND` : ""} ${H}\n`, U += ` ORDER BY ${B}\n`, U += " LIMIT $1::INT OFFSET $2::INT";
1174
- break;
1175
- }
1176
- case "ms_sql_server": {
1177
- let z = [
1178
- "text",
1179
- "ntext",
1180
- "image"
1181
- ], B = L.filter((c) => !z.includes(c.datatype.toLowerCase())).map((c) => `
1182
- (CASE WHEN @p4 = '${c.field}' AND @p5 = 0 THEN ${c.field} END) ASC,
1183
- (CASE WHEN @p4 = '${c.field}' AND @p5 = 1 THEN ${c.field} END) DESC`).join(",\n"), V = W.filter((c) => {
1184
- let R = c.slice(1, -1), B = L.find((c) => c.field === R);
1185
- return !z.includes(B?.datatype.toLowerCase() ?? "");
1186
- }).join(", ");
1187
- H = V ? ` (@p3 = '' OR CONCAT(${V}) LIKE '%' + @p3 + '%')` : " (@p3 = '')", U += `SELECT ${G} FROM ${c}`, U += ` WHERE ${R ? `${R} AND` : ""} ${H}`, U += ` ORDER BY ${B}`, U += " OFFSET @p2 ROWS FETCH NEXT @p1 ROWS ONLY";
1188
- break;
1189
- }
1190
- case "snowflake": return makeSnowflakeSelectQuery(c, L, R, B);
1191
- case "bigquery": {
1192
- let z = L.map((c) => c.datatype === "JSON" || c.datatype.startsWith("STRUCT") || c.datatype.startsWith("ARRAY") || c.datatype === "GEOGRAPHY" ? `
1193
- (CASE WHEN @order_by = '${c.field}' AND @is_desc = false THEN TO_JSON_STRING(${c.field}) END) ASC,
1194
- (CASE WHEN @order_by = '${c.field}' AND @is_desc = true THEN TO_JSON_STRING(${c.field}) END) DESC` : `
1195
- (CASE WHEN @order_by = '${c.field}' AND @is_desc = false THEN ${c.field} END) ASC,
1196
- (CASE WHEN @order_by = '${c.field}' AND @is_desc = true THEN ${c.field} END) DESC`).join(",\n");
1197
- H = ` (@quicksearch = '' OR REGEXP_CONTAINS(CONCAT(${W.map((c) => {
1198
- let R = L.find((L) => L.field === c.slice(1, -1));
1199
- return R?.datatype === "JSON" || R?.datatype.startsWith("STRUCT") || R?.datatype.startsWith("ARRAY") || R?.datatype === "GEOGRAPHY" ? `TO_JSON_STRING(${c})` : `CAST(${c} AS STRING)`;
1200
- }).join(",")}), '(?i)' || @quicksearch))`, U += `SELECT ${G} FROM ${c}`, U += ` WHERE ${R ? `${R} AND` : ""} ${H}`, U += ` ORDER BY ${z}`, U += " LIMIT @limit OFFSET @offset";
1201
- break;
1202
- }
1203
- case "duckdb": {
1204
- let z = `
1205
- ${L.map((c) => `
1206
- (CASE WHEN $order_by = '${c.field}' AND $is_desc IS false THEN "${c.field}"::text END),
1207
- (CASE WHEN $order_by = '${c.field}' AND $is_desc IS true THEN "${c.field}"::text END) DESC`).join(",\n")}`;
1208
- H = `($quicksearch = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || $quicksearch || '%')`, U += `SELECT ${W.join(", ")} FROM ${c}\n`, U += ` WHERE ${R ? `${R} AND` : ""} ${H}\n`, U += ` ORDER BY ${z}\n`, U += " LIMIT $limit::INT OFFSET $offset::INT";
1209
- break;
1210
- }
1211
- default: throw Error("Unsupported database type");
1212
- }
1213
- return U;
1214
- }
1215
- function coerceToNumber(c) {
1216
- return typeof c == "number" ? c : typeof c == "string" ? parseInt(c, 10) : 0;
1217
- }
1218
- function getSelectInput(c, L, R, z, B) {
1219
- if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L || !R?.length) return;
1220
- let V = c.type === "ducklake" ? "duckdb" : c.resourceType, H = makeSelectQuery(L, R, z, V, B);
1221
- return c.type === "ducklake" && (H = wrapDucklakeQuery(H, c.ducklake)), {
1222
- runnable: {
1223
- name: "AppDbExplorer",
1224
- type: "inline",
1225
- inlineScript: {
1226
- content: H,
1227
- language: getLanguageByResourceType(V)
1228
- }
1229
- },
1230
- fields: c.type === "database" ? { database: {
1231
- type: "static",
1232
- value: `$res:${c.resourcePath}`,
1233
- fieldType: "object",
1234
- format: `resource-${V}`
1235
- } } : {},
1236
- type: "runnable",
1237
- fieldType: "object",
1238
- hideRefreshButton: !0
1239
- };
1240
- }
1241
- function makeUpdateQuery(c, L, R, z) {
1242
- let B = buildParameters([{
1243
- field: "value_to_update",
1244
- datatype: L.datatype
1245
- }, ...z === "snowflake" ? R.flatMap((c) => [c, c]) : R], z);
1246
- switch (B += "\n", z) {
1247
- case "postgresql": {
1248
- let z = R.map((c, L) => `($${L + 2}::text::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${L + 2}::text::${c.datatype})`).join("\n AND ");
1249
- return B += `\nUPDATE ${c} SET ${L.field} = $1::text::${L.datatype} \nWHERE ${z} RETURNING 1`, B;
1250
- }
1251
- case "mysql": {
1252
- let z = R.map((c) => `(:${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = :${c.field})`).join("\n AND ");
1253
- return B += `\nUPDATE ${c} SET ${L.field} = :value_to_update \nWHERE ${z}`, B;
1254
- }
1255
- case "ms_sql_server": {
1256
- let z = R.map((c, L) => `(@p${L + 2} IS NULL AND ${c.field} IS NULL OR ${c.field} = @p${L + 2})`).join("\n AND ");
1257
- return B += `\nUPDATE ${c} SET ${L.field} = @p1 \nWHERE ${z}`, B;
1258
- }
1259
- case "snowflake": {
1260
- let z = R.map((c, L) => `(? = 'null' AND ${c.field} IS NULL OR ${c.field} = ?)`).join("\n AND ");
1261
- return B += `\nUPDATE ${c} SET ${L.field} = ? \nWHERE ${z}`, B;
1262
- }
1263
- case "bigquery": {
1264
- let z = R.map((c, L) => `(CAST(@${c.field} AS STRING) = 'null' AND ${c.field} IS NULL OR ${c.field} = @${c.field})`).join("\n AND ");
1265
- return B += `\nUPDATE ${c} SET ${L.field} = @value_to_update \nWHERE ${z}`, B;
1266
- }
1267
- case "duckdb": {
1268
- let z = R.map((c) => `($${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${c.field})`).join("\n AND ");
1269
- return B += `\nUPDATE ${c} SET ${L.field} = $value_to_update \nWHERE ${z}`, B;
1270
- }
1271
- default: throw Error("Unsupported database type");
1272
- }
1273
- }
1274
- function getUpdateInput(c, L, R, z) {
1275
- if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L) return;
1276
- let B = c.type === "ducklake" ? "duckdb" : c.resourceType, V = makeUpdateQuery(L, R, z, B);
1277
- return c.type === "ducklake" && (V = wrapDucklakeQuery(V, c.ducklake)), {
1278
- runnable: {
1279
- name: "AppDbExplorer",
1280
- type: "inline",
1281
- inlineScript: {
1282
- content: V,
1283
- language: getLanguageByResourceType(B),
1284
- schema: {
1285
- $schema: "https://json-schema.org/draft/2020-12/schema",
1286
- properties: {},
1287
- required: ["database"],
1288
- type: "object"
1289
- }
1290
- }
1291
- },
1292
- fields: c.type === "database" ? { database: {
1293
- type: "static",
1294
- value: `$res:${c.resourcePath}`,
1295
- fieldType: "object",
1296
- format: `resource-${B}`
1297
- } } : {},
1298
- type: "runnable",
1299
- fieldType: "object"
1300
- };
1301
- }
1302
- function isRunnableByPath(c) {
1303
- return c?.type == "runnableByPath" || c?.type == "path";
1304
- }
1305
- function isRunnableByName(c) {
1306
- return c?.type == "runnableByName" || c?.type == "inline";
1307
- }
1308
- function findGridItemById(c, L, R) {
1309
- for (let z of allItems(c, L)) if (z.id === R) return z;
1310
- }
1311
- function allItems(c, L) {
1312
- return L == null ? c ?? [] : [...c ?? [], ...Object.values(L).flat()];
1313
- }
1314
- function findGridItem(c, L) {
1315
- return findGridItemById(c.grid, c.subgrids, L);
1316
- }
1317
- function collectOneOfFields(c, L) {
1318
- return Object.fromEntries(Object.entries(c ?? {}).filter(([c, L]) => L.type == "evalv2").map(([c, R]) => {
1319
- let z = R;
1320
- if (!z.connections || z.connections.length !== 1) return [c, void 0];
1321
- let B = z.connections[0], V = findGridItem(L, B.componentId);
1322
- if (z.expr !== B.componentId + "." + B.id) return [c, void 0];
1323
- if (V) {
1324
- let L = V.data;
1325
- if (L && (L.type === "resourceselectcomponent" || L.type === "selectcomponent" || L.type === "multiselectcomponent" || L.type === "multiselectcomponentv2")) {
1326
- if ((L.type === "selectcomponent" || L.type === "multiselectcomponent" || L.type === "multiselectcomponentv2") && L.configuration?.create?.type === "static" && L.configuration?.create?.value === !0) return [c, void 0];
1327
- if (L.configuration?.items?.type === "static") {
1328
- let R = L.configuration.items.value;
1329
- if (R && Array.isArray(R)) return L.type === "multiselectcomponent" || L.type === "multiselectcomponentv2" ? [c, R] : [c, R.filter((c) => c && typeof c == "object" && "value" in c && c.value).map((c) => c.value)];
1330
- }
1331
- }
1332
- }
1333
- return [c, void 0];
1334
- }).filter(([c, L]) => L !== void 0));
1335
- }
1336
- function filenameExprToRegex(c) {
1337
- return `^${c.replaceAll("${file.name}", "<file_name>").slice(1, -1).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replaceAll("<file_name>", "[^/]+")}$`;
1338
- }
1339
- function staticToRegex(c) {
1340
- return `^${c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`;
1341
- }
1342
- function checkIfExprIsString(c) {
1343
- return /^(['"`])[^'"`]*\1$/g.test(c);
1344
- }
1345
- function checkIfEvalIsStringWithFilename(c) {
1346
- return c.connections.length > 0 ? !1 : checkIfExprIsString(c.expr.replaceAll("${file.name}", ""));
1347
- }
1348
- function removeResourcePrefix(c) {
1349
- return c.replace(/^\$res:/, "");
1350
- }
1351
- function computeWorkspaceS3FileInputPolicy() {
1352
- return {
1353
- allow_workspace_resource: !0,
1354
- allowed_resources: [],
1355
- allow_user_resources: !1,
1356
- file_key_regex: ""
1357
- };
1358
- }
1359
- function computeS3FileInputPolicy(c, L) {
1360
- let R = c?.resource, z = c?.pathTemplate, B = !R || R.type === "static" && !R.value, V = R ? R.type === "static" ? R.value ? [removeResourcePrefix(R.value)] : [] : collectOneOfFields({ s3_resource: R }, L).s3_resource?.map((c) => removeResourcePrefix(c)) ?? [] : [], H = (R?.type === "evalv2" && R?.allowUserResources) ?? !1, U = "^.*$";
1361
- return z && (z.type === "static" ? U = staticToRegex(z.value) : z.type === "evalv2" && checkIfEvalIsStringWithFilename(z) && (U = filenameExprToRegex(z.expr))), {
1362
- allow_workspace_resource: B,
1363
- allowed_resources: V,
1364
- allow_user_resources: H,
1365
- file_key_regex: U
1366
- };
1367
- }
1368
- function isPartialS3Object(c) {
1369
- return typeof c == "object" && !!c && typeof c.s3 == "string";
1370
- }
1371
- function computeS3FileViewerPolicy(c) {
1372
- if (c.source.type === "uploadS3" && isPartialS3Object(c.source.value)) return {
1373
- s3_path: c.source.value.s3,
1374
- storage: c.source.value.storage
1375
- };
1376
- if (c.source.type === "static" && typeof c.source.value == "string" && (c.sourceKind.type === "static" && c.sourceKind.value === "s3 (workspace storage)" || c.source.value.startsWith("s3://"))) return {
1377
- s3_path: c.source.value.replace("s3://", ""),
1378
- storage: void 0
1379
- };
1380
- }
1381
- function collectStaticFields(c) {
1382
- return Object.fromEntries(Object.entries(c ?? {}).filter(([c, L]) => L.type == "static").map(([c, L]) => [c, L.value]));
1383
- }
1384
- async function hash(c) {
1385
- try {
1386
- let L = new TextEncoder().encode(c), R = await crypto.subtle.digest("SHA-256", L);
1387
- return Array.from(new Uint8Array(R)).map((c) => c.toString(16).padStart(2, "0")).join("");
1388
- } catch {
1389
- let L = new import_build$1.Sha256();
1390
- return L.update(c ?? ""), Array.from(await L.digest()).map((c) => c.toString(16).padStart(2, "0")).join("");
1391
- }
1392
- }
1393
- var import_build = require_build();
1394
- async function updatePolicy(c, L) {
1395
- let R = allItems(c.grid, c.subgrids), z = await Promise.all(R.flatMap((L) => {
1396
- let R = L.data, z = [{
1397
- input: R.componentInput,
1398
- id: L.id
1399
- }];
1400
- if (R.type === "tablecomponent" && z.push(...R.actionButtons.map((c) => ({
1401
- input: c.componentInput,
1402
- id: c.id
1403
- }))), (R.type === "aggridcomponent" || R.type === "aggridcomponentee" || R.type === "dbexplorercomponent" || R.type === "aggridinfinitecomponent" || R.type === "aggridinfinitecomponentee") && Array.isArray(R.actions) && z.push(...R.actions.map((c) => ({
1404
- input: c.componentInput,
1405
- id: c.id
1406
- }))), R.type === "menucomponent" && z.push(...R.menuItems.map((c) => ({
1407
- input: c.componentInput,
1408
- id: c.id
1409
- }))), R.type === "dbexplorercomponent") {
1410
- let c = [], B = R.configuration, V = B?.type?.selected, H = B?.type?.configuration?.[V];
1411
- if (H && V) {
1412
- let { table: c, resource: U, ducklake: W } = H, G = c.value, K = U?.value.split("$res:")[1] ?? (W?.value)?.split("ducklake://")[1], q = R.configuration.columnDefs.value, J = R.configuration.whereClause.value;
1413
- if (G && K && q) {
1414
- let c = W ? {
1415
- type: "ducklake",
1416
- ducklake: K
1417
- } : {
1418
- type: "database",
1419
- resourcePath: K,
1420
- resourceType: V
1421
- };
1422
- z.push({
1423
- input: getSelectInput(c, G, q, J),
1424
- id: L.id
1425
- }), z.push({
1426
- input: getCountInput(c, G, q, J),
1427
- id: L.id + "_count"
1428
- }), z.push({
1429
- input: getInsertInput(c, G, q),
1430
- id: L.id + "_insert"
1431
- });
1432
- let R = getPrimaryKeys(q), H = q?.filter((c) => R.includes(c.field));
1433
- z.push({
1434
- input: getDeleteInput(c, G, H),
1435
- id: L.id + "_delete"
1436
- }), q.filter((c) => c.editable || B.allEditable.value).forEach((R) => {
1437
- z.push({
1438
- input: getUpdateInput(c, G, R, H),
1439
- id: L.id + "_update"
1440
- });
1441
- });
1442
- }
1443
- }
1444
- z.push(...c);
1445
- }
1446
- return z.filter((c) => c.input).map(async (L) => {
1447
- if (L.input?.type == "runnable") return await processRunnable$1(L.id, L.input.runnable, L.input.fields, c);
1448
- });
1449
- }).concat(Object.values(c.hiddenInlineScripts ?? {}).map(async (L, R) => await processRunnable$1("bg_" + R, L, L.fields, c)))), B = Object.fromEntries(z.filter(Boolean)), V = R.filter((c) => c.data.type === "s3fileinputcomponent").map((L) => {
1450
- let R = L.data.configuration;
1451
- return computeS3FileInputPolicy(R?.type?.configuration?.s3, c);
1452
- }).filter(Boolean);
1453
- R.findIndex((c) => {
1454
- let L = c.data;
1455
- if (L.type === "schemaformcomponent" || L.type === "formbuttoncomponent" || L.type === "formcomponent") {
1456
- let c = L.type === "schemaformcomponent" ? L.componentInput?.value?.properties : isRunnableByName(L.componentInput?.runnable) ? L.componentInput?.runnable?.inlineScript?.schema?.properties : L.componentInput?.runnable?.schema?.properties;
1457
- return Object.values(c ?? {}).findIndex((c) => c?.type === "object" && c?.format === "resource-s3_object" || c?.type === "array" && (c?.items?.resourceType === "s3object" || c?.items?.resourceType === "s3_object")) !== -1;
1458
- } else return !1;
1459
- }) !== -1 && V.push(computeWorkspaceS3FileInputPolicy());
1460
- let H = R.filter((c) => c.data.type === "imagecomponent" || c.data.type === "pdfcomponent" || c.data.type === "downloadcomponent").map((c) => {
1461
- let L = c.data.configuration;
1462
- return computeS3FileViewerPolicy(L);
1463
- }).filter(Boolean);
1464
- return {
1465
- ...L ?? {},
1466
- allowed_s3_keys: H,
1467
- s3_inputs: V,
1468
- triggerables_v2: B
1469
- };
1470
- }
1471
- async function processRunnable$1(c, L, R, z) {
1472
- let B = collectStaticFields(R), V = collectOneOfFields(R, z), H = Object.entries(R).map(([c, L]) => L.allowUserResources ? c : void 0).filter(Boolean);
1473
- if (isRunnableByName(L)) {
1474
- let R = await hash$1(L.inlineScript?.content);
1475
- return console.debug("hex", R, c), [`${c}:rawscript/${R}`, {
1476
- static_inputs: B,
1477
- one_of_inputs: V,
1478
- allow_user_resources: H
1479
- }];
1480
- } else if (isRunnableByPath(L)) return [`${c}:${L.runType === "hubscript" ? "script" : L.runType}/${L.path}`, {
1481
- static_inputs: B,
1482
- one_of_inputs: V,
1483
- allow_user_resources: H
1484
- }];
1485
- }
1486
- async function hash$1(c) {
1487
- try {
1488
- let L = new TextEncoder().encode(c), R = await crypto.subtle.digest("SHA-256", L);
1489
- return Array.from(new Uint8Array(R)).map((c) => c.toString(16).padStart(2, "0")).join("");
1490
- } catch {
1491
- let L = new import_build.Sha256();
1492
- return L.update(c ?? ""), Array.from(await L.digest()).map((c) => c.toString(16).padStart(2, "0")).join("");
1493
- }
1494
- }
1495
- function schemaToTsType(c) {
1496
- let L = c.properties, R = c.required;
1497
- return !c || !L ? "any" : `{ ${Object.keys(L).map((c) => {
1498
- let z = L[c], B = `${c}${R?.includes(c) ? "" : "?"}`, V = "any";
1499
- return z.type === "string" ? V = "string" : z.type === "number" || z.type === "integer" ? V = "number" : z.type === "boolean" ? V = "boolean" : z.type === "array" ? (V = z.items?.type ?? "any", V === "integer" && (V = "number"), V = `${V}[]`) : z.type === "object" && z.properties && (V = schemaToTsType(z)), `${B}: ${V}`;
1500
- }).join("; ")} }`;
1501
- }
1502
- function removeStaticFields(c, L) {
1503
- let R = Object.keys(L).filter((c) => L[c].type == "static");
1504
- return {
1505
- ...c,
1506
- properties: { ...Object.fromEntries(Object.entries(c.properties ?? {}).filter(([c]) => !R.includes(c))) }
1507
- };
1508
- }
1509
- function hiddenRunnableToTsType(c) {
1510
- return isRunnableByName(c) ? c?.inlineScript?.schema ? schemaToTsType(removeStaticFields(c?.inlineScript?.schema, c?.fields ?? {})) : "{}" : isRunnableByPath(c) ? schemaToTsType(removeStaticFields(c?.schema, c?.fields ?? {})) : "{}";
1511
- }
1512
- function genWmillTs(c) {
1513
- return `// THIS FILE IS READ-ONLY
1514
- // AND GENERATED AUTOMATICALLY FROM YOUR RUNNABLES
1515
-
1516
- export declare const backend: {
1517
- ${Object.entries(c).map(([c, L]) => ` ${c}: (args: ${hiddenRunnableToTsType(L)}) => Promise<any>;`).join("\n")}
1518
- };
1519
-
1520
- export declare const backendAsync: {
1521
- ${Object.entries(c).map(([c, L]) => ` ${c}: (args: ${hiddenRunnableToTsType(L)}) => Promise<string>;`).join("\n")}
1522
- };
1523
-
1524
- export type Job = {
1525
- type: "QueuedJob" | "CompletedJob";
1526
- id: string;
1527
- created_at: number;
1528
- started_at: number | undefined;
1529
- duration_ms: number;
1530
- success: boolean;
1531
- args: any;
1532
- result: any;
1533
- };
1534
-
1535
- /**
1536
- * Execute a job and wait for it to complete and return the completed job
1537
- * @param id
1538
- */
1539
- export declare function waitJob(id: string): Promise<Job>;
1540
-
1541
- /**
1542
- * Get a job by id and return immediately with the current state of the job
1543
- * @param id
1544
- */
1545
- export declare function getJob(id: string): Promise<Job>;
1546
-
1547
- export type StreamUpdate = {
1548
- new_result_stream?: string;
1549
- stream_offset?: number;
1550
- };
1551
-
1552
- /**
1553
- * Stream job results using SSE. Calls onUpdate for each stream update,
1554
- * and resolves with the final result when the job completes.
1555
- * @param id - The job ID to stream
1556
- * @param onUpdate - Optional callback for stream updates with new_result_stream data
1557
- * @returns Promise that resolves with the final job result
1558
- */
1559
- export declare function streamJob(id: string, onUpdate?: (data: StreamUpdate) => void): Promise<any>;
1560
- `;
1561
- }
1562
- async function updateRawAppPolicy(c, L) {
1563
- let R = Object.fromEntries(await Promise.all(Object.entries(c).map(async ([c, L]) => await processRunnable(c, L, L?.fields ?? {}))));
1564
- return {
1565
- ...L,
1566
- triggerables_v2: R
1567
- };
1568
- }
1569
- async function processRunnable(c, L, R) {
1570
- let z = collectStaticFields(R), B = Object.entries(R).map(([c, L]) => L.allowUserResources ? c : void 0).filter(Boolean);
1571
- if (isRunnableByName(L)) {
1572
- let R = await hash(L.inlineScript?.content);
1573
- return console.log("hex", R, c), [`${c}:rawscript/${R}`, {
1574
- static_inputs: z,
1575
- one_of_inputs: {},
1576
- allow_user_resources: B
1577
- }];
1578
- } else if (isRunnableByPath(L)) return [`${c}:${L.runType === "hubscript" ? "script" : L.runType}/${L.path}`, {
1579
- static_inputs: z,
1580
- one_of_inputs: {},
1581
- allow_user_resources: B
1582
- }];
1583
- }
1584
- var rawAppWmillTs_exports = /* @__PURE__ */ __export({ default: () => rawAppWmillTs_default }, 1), rawAppWmillTs_default = "let reqs: Record<string, any> = {}\n\nfunction doRequest(type: string, o: object) {\n return new Promise((resolve, reject) => {\n const reqId = Math.random().toString(36)\n reqs[reqId] = { resolve, reject }\n parent.postMessage({ ...o, type, reqId }, '*')\n })\n}\n\nexport const backend = new Proxy(\n {},\n {\n get(_, runnable_id: string) {\n return (v: any) => {\n return doRequest('backend', { runnable_id, v })\n }\n }\n }\n)\n\nexport const backendAsync = new Proxy(\n {},\n {\n get(_, runnable_id: string) {\n return (v: any) => {\n return doRequest('backendAsync', { runnable_id, v })\n }\n }\n }\n)\n\nexport function waitJob(jobId: string) {\n return doRequest('waitJob', { jobId })\n}\n\nexport function getJob(jobId: string) {\n return doRequest('getJob', { jobId })\n}\n\n/**\n * Stream job results using SSE. Calls onUpdate for each stream update,\n * and resolves with the final result when the job completes.\n * @param jobId - The job ID to stream\n * @param onUpdate - Callback for stream updates with new_result_stream data\n * @returns Promise that resolves with the final job result\n */\nexport function streamJob(\n jobId: string,\n onUpdate?: (data: { new_result_stream?: string; stream_offset?: number }) => void\n): Promise<any> {\n return new Promise((resolve, reject) => {\n const reqId = Math.random().toString(36)\n reqs[reqId] = { resolve, reject, onUpdate }\n parent.postMessage({ jobId, type: 'streamJob', reqId }, '*')\n })\n}\n\nwindow.addEventListener('message', (e) => {\n if (e.data.type == 'streamJobUpdate') {\n // Handle streaming update\n let job = reqs[e.data.reqId]\n if (job && job.onUpdate) {\n job.onUpdate({\n new_result_stream: e.data.new_result_stream,\n stream_offset: e.data.stream_offset\n })\n }\n } else if (e.data.type == 'streamJobRes') {\n // Handle stream completion\n let job = reqs[e.data.reqId]\n if (job) {\n if (e.data.error) {\n job.reject(new Error(e.data.result?.stack ?? e.data.result?.message ?? 'Stream error'))\n } else {\n job.resolve(e.data.result)\n }\n delete reqs[e.data.reqId]\n }\n } else if (e.data.type == 'backendRes' || e.data.type == 'backendAsyncRes') {\n console.log('Message from parent backend', e.data)\n let job = reqs[e.data.reqId]\n if (job) {\n const result = e.data.result\n if (e.data.error) {\n job.reject(new Error(result.stack ?? result.message))\n } else {\n job.resolve(result)\n }\n } else {\n console.error('No job found for', e.data.reqId)\n }\n }\n})\n";
1585
- function capitalize(c) {
1586
- return c ? c.charAt(0).toUpperCase() + c.slice(1) : "";
1587
- }
1588
- export { capitalize, genWmillTs, updatePolicy, updateRawAppPolicy, rawAppWmillTs_exports as wmillTsRaw };