windmill-components 1.596.1 → 1.612.2

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 (414) hide show
  1. package/dist/appPolicy/myFunction.es.js +1337 -0
  2. package/dist/sharedUtils/assets/tokens/colorTokensConfig.d.ts +2 -0
  3. package/dist/sharedUtils/base.d.ts +1 -0
  4. package/dist/sharedUtils/cloud.d.ts +1 -0
  5. package/dist/sharedUtils/common.d.ts +108 -0
  6. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +5 -0
  7. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +5 -0
  8. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +5 -0
  9. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +11 -0
  10. package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +11 -0
  11. package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +84 -0
  12. package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +6 -0
  13. package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +7 -0
  14. package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +22 -0
  15. package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +10 -0
  16. package/dist/sharedUtils/components/apps/editor/component/components.d.ts +5305 -0
  17. package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +3 -0
  18. package/dist/sharedUtils/components/apps/editor/component/index.d.ts +3 -0
  19. package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +7 -0
  20. package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
  21. package/dist/sharedUtils/components/apps/gridUtils.d.ts +14 -0
  22. package/dist/sharedUtils/components/apps/inputType.d.ts +176 -0
  23. package/dist/sharedUtils/components/apps/rx.d.ts +29 -0
  24. package/dist/sharedUtils/components/apps/sharedTypes.d.ts +19 -0
  25. package/dist/sharedUtils/components/apps/types.d.ts +274 -0
  26. package/dist/sharedUtils/components/common/alert/model.d.ts +2 -0
  27. package/dist/sharedUtils/components/common/badge/model.d.ts +8 -0
  28. package/dist/sharedUtils/components/common/button/model.d.ts +45 -0
  29. package/dist/sharedUtils/components/common/fileInput/model.d.ts +1 -0
  30. package/dist/sharedUtils/components/common/index.d.ts +24 -0
  31. package/dist/sharedUtils/components/common/skeleton/model.d.ts +21 -0
  32. package/dist/sharedUtils/components/dbTypes.d.ts +11 -0
  33. package/dist/sharedUtils/components/diff_drawer.d.ts +26 -0
  34. package/dist/sharedUtils/components/ducklake.d.ts +1 -0
  35. package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +7 -0
  36. package/dist/sharedUtils/components/random_positive_adjetive.d.ts +1 -0
  37. package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +10 -0
  38. package/dist/sharedUtils/components/raw_apps/utils.d.ts +15 -0
  39. package/dist/sharedUtils/components/triggers/email/utils.d.ts +4 -0
  40. package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +2 -0
  41. package/dist/sharedUtils/components/triggers/http/utils.d.ts +11 -0
  42. package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +2 -0
  43. package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +2 -0
  44. package/dist/sharedUtils/components/triggers/nats/utils.d.ts +2 -0
  45. package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +8 -0
  46. package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +2 -0
  47. package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +32 -0
  48. package/dist/sharedUtils/components/triggers/utils.d.ts +81 -0
  49. package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +2 -0
  50. package/dist/sharedUtils/components/triggers.d.ts +20 -0
  51. package/dist/sharedUtils/gen/core/ApiError.d.ts +10 -0
  52. package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +13 -0
  53. package/dist/sharedUtils/gen/core/ApiResult.d.ts +7 -0
  54. package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +26 -0
  55. package/dist/sharedUtils/gen/core/OpenAPI.d.ts +27 -0
  56. package/dist/sharedUtils/gen/core/request.d.ts +29 -0
  57. package/dist/sharedUtils/gen/index.d.ts +6 -0
  58. package/dist/sharedUtils/gen/schemas.gen.d.ts +6192 -0
  59. package/dist/sharedUtils/gen/services.gen.d.ts +5741 -0
  60. package/dist/sharedUtils/gen/types.gen.d.ts +20152 -0
  61. package/dist/sharedUtils/history.svelte.d.ts +9 -0
  62. package/dist/sharedUtils/hub.d.ts +48 -0
  63. package/dist/sharedUtils/jsr.json +6 -0
  64. package/dist/sharedUtils/lib.d.ts +5 -0
  65. package/dist/sharedUtils/lib.es.js +1426 -0
  66. package/dist/sharedUtils/package.json +12 -0
  67. package/dist/sharedUtils/schema.d.ts +3 -0
  68. package/dist/sharedUtils/stores.d.ts +96 -0
  69. package/dist/sharedUtils/svelte5Utils.svelte.d.ts +49 -0
  70. package/dist/sharedUtils/toast.d.ts +8 -0
  71. package/dist/sharedUtils/utils.d.ts +250 -0
  72. package/package/assets/tokens/tokens.json +11 -1
  73. package/package/ata/apis.js +78 -5
  74. package/package/components/AddUser.svelte +1 -1
  75. package/package/components/CenteredModal.svelte +32 -24
  76. package/package/components/CenteredModal.svelte.d.ts +7 -27
  77. package/package/components/CenteredPage.svelte +5 -2
  78. package/package/components/CenteredPage.svelte.d.ts +2 -0
  79. package/package/components/ConcurrentJobsChart.svelte +3 -2
  80. package/package/components/ConcurrentJobsChart.svelte.d.ts +2 -2
  81. package/package/components/CustomPopover.svelte +20 -23
  82. package/package/components/CustomPopover.svelte.d.ts +14 -39
  83. package/package/components/DBManager.svelte +105 -17
  84. package/package/components/DBManager.svelte.d.ts +2 -1
  85. package/package/components/DBManagerContent.svelte +4 -3
  86. package/package/components/DBManagerContent.svelte.d.ts +1 -1
  87. package/package/components/DBTableEditor.svelte +210 -171
  88. package/package/components/DBTableEditor.svelte.d.ts +22 -3
  89. package/package/components/Description.svelte +3 -2
  90. package/package/components/Dev.svelte +36 -2
  91. package/package/components/DiffDrawer.svelte +8 -29
  92. package/package/components/DiffEditor.svelte +32 -2
  93. package/package/components/DisplayResult.svelte +32 -24
  94. package/package/components/Editor.svelte +70 -16
  95. package/package/components/Editor.svelte.d.ts +3 -0
  96. package/package/components/EditorBar.svelte +1 -1
  97. package/package/components/FakeMonacoPlaceHolder.svelte +1 -1
  98. package/package/components/FlowBuilder.svelte +17 -11
  99. package/package/components/FlowDiffViewer.svelte +37 -0
  100. package/package/components/FlowDiffViewer.svelte.d.ts +7 -0
  101. package/package/components/FlowPreviewContent.svelte +3 -2
  102. package/package/components/FlowPreviewResult.svelte +0 -4
  103. package/package/components/FlowStatusViewerInner.svelte +50 -33
  104. package/package/components/FlowStatusViewerInner.svelte.d.ts +1 -1
  105. package/package/components/FlowStatusWaitingForEvents.svelte +27 -23
  106. package/package/components/FlowStatusWaitingForEvents.svelte.d.ts +4 -18
  107. package/package/components/FlowViewer.svelte +103 -2
  108. package/package/components/FlowViewer.svelte.d.ts +9 -3
  109. package/package/components/ForkWorkspaceBanner.svelte +16 -13
  110. package/package/components/GraphqlSchemaViewer.svelte +8 -1
  111. package/package/components/HistoricInputs.svelte +25 -27
  112. package/package/components/HistoricInputs.svelte.d.ts +2 -2
  113. package/package/components/InstanceSetting.svelte +38 -0
  114. package/package/components/InviteUser.svelte +16 -42
  115. package/package/components/InviteUser.svelte.d.ts +4 -18
  116. package/package/components/JobOtelTraces.svelte +287 -0
  117. package/package/components/JobOtelTraces.svelte.d.ts +6 -0
  118. package/package/components/JsonInputs.svelte +6 -8
  119. package/package/components/JsonInputs.svelte.d.ts +7 -8
  120. package/package/components/LogViewer.svelte +91 -33
  121. package/package/components/Login.svelte +21 -0
  122. package/package/components/ManualPopover.svelte +5 -6
  123. package/package/components/ManualPopover.svelte.d.ts +9 -35
  124. package/package/components/MemoryFootprintViewer.svelte +2 -6
  125. package/package/components/ModulePreview.svelte +23 -21
  126. package/package/components/ModulePreview.svelte.d.ts +1 -0
  127. package/package/components/Path.svelte +2 -2
  128. package/package/components/Path.svelte.d.ts +1 -1
  129. package/package/components/ResourcePicker.svelte +3 -0
  130. package/package/components/ResourcePicker.svelte.d.ts +1 -0
  131. package/package/components/RunButton.svelte +5 -15
  132. package/package/components/RunButton.svelte.d.ts +7 -19
  133. package/package/components/RunChart.svelte +8 -4
  134. package/package/components/RunChart.svelte.d.ts +2 -2
  135. package/package/components/RunFormAdvancedPopup.svelte +1 -1
  136. package/package/components/RunsPage.svelte +169 -539
  137. package/package/components/RunsPage.svelte.d.ts +5 -5
  138. package/package/components/S3FilePicker.svelte +7 -11
  139. package/package/components/S3FilePickerInner.svelte +2 -3
  140. package/package/components/S3FilePickerInner.svelte.d.ts +2 -2
  141. package/package/components/SchemaForm.svelte +26 -19
  142. package/package/components/SchemaFormWithArgPicker.svelte +4 -3
  143. package/package/components/ScriptBuilder.svelte +1 -1
  144. package/package/components/ScriptEditor.svelte +575 -101
  145. package/package/components/Section.svelte +3 -1
  146. package/package/components/ServiceLogsInner.svelte +4 -4
  147. package/package/components/SimpleEditor.svelte +46 -2
  148. package/package/components/SuperadminSettingsInner.svelte +1 -1
  149. package/package/components/TemplateEditor.svelte +54 -29
  150. package/package/components/TemplateEditor.svelte.d.ts +13 -102
  151. package/package/components/UserSettings.svelte +1 -1
  152. package/package/components/WorkerTagPicker.svelte +1 -1
  153. package/package/components/WorkerTagSelect.svelte +5 -2
  154. package/package/components/WorkspaceTutorials.svelte +5 -0
  155. package/package/components/apps/components/buttons/AppButton.svelte +21 -6
  156. package/package/components/apps/components/buttons/AppForm.svelte +2 -1
  157. package/package/components/apps/components/buttons/AppFormButton.svelte +2 -1
  158. package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +0 -4
  159. package/package/components/apps/components/display/dbtable/metadata.js +69 -30
  160. package/package/components/apps/components/display/dbtable/queries/alterTable.d.ts +46 -0
  161. package/package/components/apps/components/display/dbtable/queries/alterTable.js +314 -0
  162. package/package/components/apps/components/display/dbtable/queries/alterTable.test.d.ts +1 -0
  163. package/package/components/apps/components/display/dbtable/queries/alterTable.test.js +867 -0
  164. package/package/components/apps/components/display/dbtable/queries/createTable.d.ts +2 -24
  165. package/package/components/apps/components/display/dbtable/queries/createTable.js +11 -25
  166. package/package/components/apps/components/display/dbtable/queries/dbQueriesUtils.d.ts +9 -0
  167. package/package/components/apps/components/display/dbtable/queries/dbQueriesUtils.js +45 -0
  168. package/package/components/apps/components/display/dbtable/queries/relationalKeys.d.ts +47 -0
  169. package/package/components/apps/components/display/dbtable/queries/relationalKeys.js +402 -0
  170. package/package/components/apps/components/display/dbtable/queries/select.d.ts +2 -0
  171. package/package/components/apps/components/display/dbtable/queries/select.js +37 -6
  172. package/package/components/apps/components/display/dbtable/tableEditor.d.ts +35 -0
  173. package/package/components/apps/components/display/dbtable/tableEditor.js +49 -0
  174. package/package/components/apps/components/display/dbtable/utils.d.ts +10 -1
  175. package/package/components/apps/components/display/dbtable/utils.js +52 -20
  176. package/package/components/apps/components/helpers/HiddenComponent.svelte +1 -1
  177. package/package/components/apps/components/helpers/InputValue.svelte +1 -1
  178. package/package/components/apps/components/helpers/ResolveConfig.svelte +1 -1
  179. package/package/components/apps/components/helpers/RunnableComponent.svelte +3 -2
  180. package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -1
  181. package/package/components/apps/components/helpers/RunnableWrapper.svelte +2 -2
  182. package/package/components/apps/editor/AppEditorHeader.svelte +8 -1
  183. package/package/components/apps/editor/AppEditorHeaderDeploy.svelte +32 -29
  184. package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +2 -2
  185. package/package/components/apps/editor/AppEditorHeaderDeployInitialDraft.svelte +4 -4
  186. package/package/components/apps/editor/AppEditorHeaderDeployInitialDraft.svelte.d.ts +3 -3
  187. package/package/components/apps/editor/PublicApp.svelte +49 -30
  188. package/package/components/apps/editor/PublicApp.svelte.d.ts +1 -0
  189. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte +77 -7
  190. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte.d.ts +2 -2
  191. package/package/components/apps/editor/inlineScriptsPanel/utils.d.ts +2 -2
  192. package/package/components/apps/editor/inlineScriptsPanel/utils.js +10 -1
  193. package/package/components/apps/inputType.d.ts +6 -1
  194. package/package/components/auditLogs/AuditLogsFilters.svelte +9 -17
  195. package/package/components/auditLogs/AuditLogsFilters.svelte.d.ts +1 -1
  196. package/package/components/common/button/model.js +1 -1
  197. package/package/components/common/calendarPicker/CalendarPicker.svelte.d.ts +1 -1
  198. package/package/components/common/languageIcons/TypeScript.svelte +5 -3
  199. package/package/components/common/languageIcons/TypeScript.svelte.d.ts +1 -0
  200. package/package/components/common/modal/Modal.svelte +3 -3
  201. package/package/components/copilot/autocomplete/Autocompletor.js +3 -2
  202. package/package/components/copilot/chat/AIButtonStyle.d.ts +1 -1
  203. package/package/components/copilot/chat/AIButtonStyle.js +2 -1
  204. package/package/components/copilot/chat/AIChat.svelte +3 -1
  205. package/package/components/copilot/chat/AIChatDisplay.svelte +89 -4
  206. package/package/components/copilot/chat/AIChatInput.svelte +275 -0
  207. package/package/components/copilot/chat/AIChatManager.svelte.js +107 -1
  208. package/package/components/copilot/chat/AiChatLayout.svelte +15 -30
  209. package/package/components/copilot/chat/AppAvailableContextList.svelte +263 -0
  210. package/package/components/copilot/chat/AppAvailableContextList.svelte.d.ts +13 -0
  211. package/package/components/copilot/chat/ContextElementBadge.svelte +44 -0
  212. package/package/components/copilot/chat/DatatableCreationPolicy.svelte +32 -33
  213. package/package/components/copilot/chat/ProviderModelSelector.svelte +1 -1
  214. package/package/components/copilot/chat/__tests__/app/appEvalHelpers.js +3 -0
  215. package/package/components/copilot/chat/__tests__/flow/flowEvalHelpers.js +4 -0
  216. package/package/components/copilot/chat/app/core.d.ts +56 -15
  217. package/package/components/copilot/chat/app/core.js +141 -22
  218. package/package/components/copilot/chat/context.d.ts +59 -2
  219. package/package/components/copilot/chat/context.js +6 -2
  220. package/package/components/copilot/chat/flow/FlowAIChat.svelte +22 -0
  221. package/package/components/copilot/chat/flow/core.d.ts +3 -1
  222. package/package/components/copilot/chat/flow/core.js +29 -2
  223. package/package/components/copilot/chat/flow/openFlow.json +1 -1
  224. package/package/components/copilot/chat/flow/openFlowZod.d.ts +1 -0
  225. package/package/components/copilot/chat/flow/openFlowZod.js +14 -2
  226. package/package/components/copilot/chat/script/core.d.ts +4 -1
  227. package/package/components/copilot/chat/script/core.js +38 -2
  228. package/package/components/copilot/chat/shared.d.ts +10 -0
  229. package/package/components/copilot/chat/shared.js +24 -0
  230. package/package/components/copilot/lib.d.ts +1 -1
  231. package/package/components/custom_ui.d.ts +1 -0
  232. package/package/components/dbOps.d.ts +18 -4
  233. package/package/components/dbOps.js +25 -3
  234. package/package/components/debug/DebugConsole.svelte +277 -0
  235. package/package/components/debug/DebugConsole.svelte.d.ts +13 -0
  236. package/package/components/debug/DebugPanel.svelte +97 -0
  237. package/package/components/debug/DebugPanel.svelte.d.ts +11 -0
  238. package/package/components/debug/DebugToolbar.svelte +148 -0
  239. package/package/components/debug/DebugToolbar.svelte.d.ts +17 -0
  240. package/package/components/debug/DebugVariableViewer.svelte +115 -0
  241. package/package/components/debug/DebugVariableViewer.svelte.d.ts +11 -0
  242. package/package/components/debug/MonacoDebugger.svelte +384 -0
  243. package/package/components/debug/MonacoDebugger.svelte.d.ts +15 -0
  244. package/package/components/debug/dapClient.d.ts +192 -0
  245. package/package/components/debug/dapClient.js +426 -0
  246. package/package/components/debug/debugUtils.d.ts +30 -0
  247. package/package/components/debug/debugUtils.js +131 -0
  248. package/package/components/debug/index.d.ts +75 -0
  249. package/package/components/debug/index.js +82 -0
  250. package/package/components/flows/CreateActionsApp.svelte +6 -4
  251. package/package/components/flows/DebounceLimit.svelte.d.ts +1 -1
  252. package/package/components/flows/FlowHistoryInner.svelte +15 -4
  253. package/package/components/flows/content/AgentToolWrapper.svelte +1 -1
  254. package/package/components/flows/content/FlowEditorDrawer.svelte +124 -0
  255. package/package/components/flows/content/FlowEditorDrawer.svelte.d.ts +22 -0
  256. package/package/components/flows/content/FlowInput.svelte +211 -37
  257. package/package/components/flows/content/FlowModuleComponent.svelte +553 -67
  258. package/package/components/flows/content/FlowModuleEarlyStop.svelte +8 -10
  259. package/package/components/flows/content/FlowModuleHeader.svelte +7 -4
  260. package/package/components/flows/content/FlowModuleWorkerTagSelect.svelte +1 -1
  261. package/package/components/flows/content/McpOAuthConnect.svelte +217 -0
  262. package/package/components/flows/content/McpOAuthConnect.svelte.d.ts +7 -0
  263. package/package/components/flows/content/McpToolEditor.svelte +50 -37
  264. package/package/components/flows/content/McpToolEditor.svelte.d.ts +0 -1
  265. package/package/components/flows/conversations/FlowChat.svelte +16 -2
  266. package/package/components/flows/conversations/FlowChat.svelte.d.ts +2 -1
  267. package/package/components/flows/conversations/FlowChatInterface.svelte +103 -6
  268. package/package/components/flows/conversations/FlowChatInterface.svelte.d.ts +2 -0
  269. package/package/components/flows/conversations/FlowChatManager.svelte.js +53 -21
  270. package/package/components/flows/header/FlowImportExportMenu.svelte +1 -1
  271. package/package/components/flows/propPicker/PropPickerWrapper.svelte +3 -1
  272. package/package/components/flows/types.d.ts +2 -0
  273. package/package/components/git_sync/GitSyncRepositoryCard.svelte +16 -8
  274. package/package/components/home/ItemsList.svelte +5 -5
  275. package/package/components/home/TutorialBanner.svelte +34 -18
  276. package/package/components/icons/CssIcon.svelte +20 -0
  277. package/package/components/icons/CssIcon.svelte.d.ts +7 -25
  278. package/package/components/icons/HtmlIcon.svelte +20 -0
  279. package/package/components/icons/HtmlIcon.svelte.d.ts +8 -0
  280. package/package/components/icons/JavaScriptIcon.svelte +10 -2
  281. package/package/components/icons/JavaScriptIcon.svelte.d.ts +1 -0
  282. package/package/components/icons/JsonIcon.svelte +8 -2
  283. package/package/components/icons/JsonIcon.svelte.d.ts +1 -0
  284. package/package/components/icons/LessIcon.svelte +16 -0
  285. package/package/components/icons/LessIcon.svelte.d.ts +8 -0
  286. package/package/components/icons/MarkdownIcon.svelte +20 -0
  287. package/package/components/icons/MarkdownIcon.svelte.d.ts +8 -0
  288. package/package/components/icons/ReactIcon.svelte +10 -2
  289. package/package/components/icons/ReactIcon.svelte.d.ts +1 -0
  290. package/package/components/icons/SassIcon.svelte +28 -0
  291. package/package/components/icons/SassIcon.svelte.d.ts +8 -0
  292. package/package/components/icons/SvelteIcon.svelte +10 -2
  293. package/package/components/icons/SvelteIcon.svelte.d.ts +1 -0
  294. package/package/components/icons/VueIcon.svelte +10 -2
  295. package/package/components/icons/VueIcon.svelte.d.ts +1 -0
  296. package/package/components/icons/YamlIcon.svelte +20 -0
  297. package/package/components/icons/YamlIcon.svelte.d.ts +8 -0
  298. package/package/components/instanceSettings/SecretBackendConfig.svelte +514 -0
  299. package/package/components/instanceSettings/SecretBackendConfig.svelte.d.ts +8 -0
  300. package/package/components/instanceSettings.d.ts +2 -1
  301. package/package/components/instanceSettings.js +32 -1
  302. package/package/components/jobs/JobPreview.svelte +46 -39
  303. package/package/components/jobs/JobPreview.svelte.d.ts +1 -0
  304. package/package/components/monacoLanguagesOptions.js +16 -15
  305. package/package/components/propertyPicker/PropPicker.svelte +16 -2
  306. package/package/components/propertyPicker/PropPicker.svelte.d.ts +2 -0
  307. package/package/components/raw_apps/DefaultDatabaseSelector.svelte +9 -5
  308. package/package/components/raw_apps/FileEditorIcon.svelte +12 -7
  309. package/package/components/raw_apps/FileEditorIcon.svelte.d.ts +2 -0
  310. package/package/components/raw_apps/FileTreeNode.svelte +119 -83
  311. package/package/components/raw_apps/RawAppBackgroundRunner.svelte +88 -8
  312. package/package/components/raw_apps/RawAppDataTableList.svelte +12 -9
  313. package/package/components/raw_apps/RawAppEditor.svelte +218 -68
  314. package/package/components/raw_apps/RawAppEditorHeader.svelte +33 -16
  315. package/package/components/raw_apps/RawAppHistoryList.svelte +264 -80
  316. package/package/components/raw_apps/RawAppHistoryList.svelte.d.ts +1 -0
  317. package/package/components/raw_apps/RawAppHistoryManager.svelte.d.ts +15 -1
  318. package/package/components/raw_apps/RawAppHistoryManager.svelte.js +46 -12
  319. package/package/components/raw_apps/RawAppInlineScriptEditor.svelte +549 -47
  320. package/package/components/raw_apps/RawAppInlineScriptEditor.svelte.d.ts +31 -5
  321. package/package/components/raw_apps/RawAppInlineScriptPanelList.svelte +25 -18
  322. package/package/components/raw_apps/RawAppInlineScriptPanelList.svelte.d.ts +1 -0
  323. package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte +141 -10
  324. package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte.d.ts +8 -0
  325. package/package/components/raw_apps/RawAppInlineScriptsPanel.svelte +2 -1
  326. package/package/components/raw_apps/RawAppInlineScriptsPanel.svelte.d.ts +9 -1
  327. package/package/components/raw_apps/RawAppInputsSpecEditor.svelte +47 -3
  328. package/package/components/raw_apps/RawAppInputsSpecEditor.svelte.d.ts +2 -2
  329. package/package/components/raw_apps/RawAppModules.svelte +13 -7
  330. package/package/components/raw_apps/RawAppPreview.svelte +48 -6
  331. package/package/components/raw_apps/RawAppSidebar.svelte +194 -125
  332. package/package/components/raw_apps/RawAppSidebar.svelte.d.ts +1 -0
  333. package/package/components/raw_apps/RunnableRow.svelte +41 -0
  334. package/package/components/raw_apps/RunnableRow.svelte.d.ts +11 -0
  335. package/package/components/raw_apps/utils.d.ts +1 -1
  336. package/package/components/raw_apps/utils.js +76 -18
  337. package/package/components/runs/ManuelDatePicker.svelte +3 -3
  338. package/package/components/runs/ManuelDatePicker.svelte.d.ts +3 -3
  339. package/package/components/runs/NoWorkerWithTagWarning.svelte +5 -1
  340. package/package/components/runs/RunsFilter.svelte +75 -63
  341. package/package/components/runs/RunsFilter.svelte.d.ts +35 -4
  342. package/package/components/runs/RunsQueue.svelte.d.ts +1 -1
  343. package/package/components/runs/RunsTable.svelte +1 -1
  344. package/package/components/runs/RunsTable.svelte.d.ts +1 -1
  345. package/package/components/runs/useJobsLoader.svelte.d.ts +34 -0
  346. package/package/components/runs/useJobsLoader.svelte.js +507 -0
  347. package/package/components/scriptEditor/LogPanel.svelte +17 -2
  348. package/package/components/scriptEditor/LogPanel.svelte.d.ts +2 -0
  349. package/package/components/select/SelectDropdown.svelte +2 -2
  350. package/package/components/settings/AIPromptsModal.svelte +88 -0
  351. package/package/components/settings/AIPromptsModal.svelte.d.ts +11 -0
  352. package/package/components/settings/ChangeWorkspaceColor.svelte +4 -3
  353. package/package/components/settings/ChangeWorkspaceId.svelte +14 -10
  354. package/package/components/settings/ChangeWorkspaceName.svelte +7 -6
  355. package/package/components/settings/UserAIPromptsSettings.svelte +56 -15
  356. package/package/components/settings/WorkspaceOperatorSettings.svelte +68 -85
  357. package/package/components/settings/WorkspaceUserSettings.svelte +531 -406
  358. package/package/components/sidebar/MenuButton.svelte +46 -24
  359. package/package/components/sidebar/MenuButton.svelte.d.ts +2 -0
  360. package/package/components/sidebar/MultiplayerMenu.svelte +3 -3
  361. package/package/components/sidebar/OperatorMenu.svelte +62 -87
  362. package/package/components/sidebar/SidebarContent.svelte +7 -2
  363. package/package/components/sidebar/WorkspaceMenu.svelte +35 -85
  364. package/package/components/sqlTypeService.js +4 -3
  365. package/package/components/table/DataTable.svelte +3 -2
  366. package/package/components/table/DataTable.svelte.d.ts +1 -0
  367. package/package/components/text_input/TextInput.svelte +3 -0
  368. package/package/components/text_input/TextInput.svelte.d.ts +2 -0
  369. package/package/components/tutorials/FlowBuilderLiveTutorial.svelte +6 -35
  370. package/package/components/tutorials/RunsTutorial.svelte +399 -0
  371. package/package/components/{schema/SchemaPicker.svelte.d.ts → tutorials/RunsTutorial.svelte.d.ts} +11 -12
  372. package/package/components/tutorials/TroubleshootFlowTutorial.svelte +5 -20
  373. package/package/components/tutorials/utils.d.ts +16 -0
  374. package/package/components/tutorials/utils.js +96 -0
  375. package/package/components/tutorials/workspace/WorkspaceOnboardingOperatorTutorial.svelte +133 -0
  376. package/package/components/{SavedInputs.svelte.d.ts → tutorials/workspace/WorkspaceOnboardingOperatorTutorial.svelte.d.ts} +8 -11
  377. package/package/components/vscode.js +6 -6
  378. package/package/components/workspace/WorkspaceCard.svelte +184 -0
  379. package/package/components/workspace/WorkspaceCard.svelte.d.ts +24 -0
  380. package/package/components/workspace/WorkspaceIcon.svelte +21 -0
  381. package/package/components/workspace/WorkspaceIcon.svelte.d.ts +9 -0
  382. package/package/components/workspace/WorkspaceTreeView.svelte +331 -0
  383. package/package/components/workspace/WorkspaceTreeView.svelte.d.ts +15 -0
  384. package/package/components/workspaceSettings/AISettings.svelte +146 -108
  385. package/package/components/workspaceSettings/CreateWorkspace.svelte +25 -11
  386. package/package/components/workspaceSettings/DucklakeSettings.svelte +46 -23
  387. package/package/components/workspaceSettings/DucklakeSettings.svelte.d.ts +2 -1
  388. package/package/components/workspaceSettings/ModelTokenLimits.svelte +14 -18
  389. package/package/components/workspaceSettings/StorageSettings.svelte +280 -241
  390. package/package/components/workspaceSettings/StorageSettings.svelte.d.ts +1 -0
  391. package/package/consts.js +4 -1
  392. package/package/gen/core/OpenAPI.js +1 -1
  393. package/package/gen/schemas.gen.d.ts +126 -0
  394. package/package/gen/schemas.gen.js +126 -0
  395. package/package/gen/services.gen.d.ts +160 -2
  396. package/package/gen/services.gen.js +319 -4
  397. package/package/gen/types.gen.d.ts +607 -2
  398. package/package/hubPaths.json +3 -2
  399. package/package/infer.js +2 -0
  400. package/package/monaco_workers/graphql.worker.bundle.js +121 -121
  401. package/package/rawAppWmillTs.d.ts +11 -0
  402. package/package/rawAppWmillTs.js +38 -1
  403. package/package/svelte5Utils.svelte.d.ts +9 -0
  404. package/package/svelte5Utils.svelte.js +51 -1
  405. package/package/tutorialUtils.js +0 -4
  406. package/package/tutorials/config.js +31 -3
  407. package/package/tutorials/roleUtils.d.ts +1 -1
  408. package/package/tutorials/roleUtils.js +6 -2
  409. package/package/utils.js +159 -1
  410. package/package.json +16 -17
  411. package/package/components/SavedInputs.svelte +0 -416
  412. package/package/components/runs/JobsLoader.svelte +0 -468
  413. package/package/components/runs/JobsLoader.svelte.d.ts +0 -49
  414. package/package/components/schema/SchemaPicker.svelte +0 -92
@@ -0,0 +1,1337 @@
1
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __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 = (c) => {
2
+ let R = {};
3
+ for (var z in c) __defProp(R, z, {
4
+ get: c[z],
5
+ enumerable: !0
6
+ });
7
+ return R;
8
+ }, __copyProps = (c, B, H, U) => {
9
+ if (B && typeof B == "object" || typeof B == "function") for (var W = __getOwnPropNames(B), G = 0, K = W.length, q; G < K; G++) q = W[G], !__hasOwnProp.call(c, q) && q !== H && __defProp(c, q, {
10
+ get: ((c) => B[c]).bind(null, q),
11
+ enumerable: !(U = __getOwnPropDesc(B, q)) || U.enumerable
12
+ });
13
+ return c;
14
+ }, __toESM = (R, z, V) => (V = R == null ? {} : __create(__getProtoOf(R)), __copyProps(z || !R || !R.__esModule ? __defProp(V, "default", {
15
+ value: R,
16
+ enumerable: !0
17
+ }) : V, R)), __toCommonJS = (c) => __copyProps(__defProp({}, "__esModule", { value: !0 }), c), tslib_es6_exports = /* @__PURE__ */ __export({
18
+ __assign: () => __assign,
19
+ __asyncDelegator: () => __asyncDelegator,
20
+ __asyncGenerator: () => __asyncGenerator,
21
+ __asyncValues: () => __asyncValues,
22
+ __await: () => __await,
23
+ __awaiter: () => __awaiter,
24
+ __classPrivateFieldGet: () => __classPrivateFieldGet,
25
+ __classPrivateFieldSet: () => __classPrivateFieldSet,
26
+ __createBinding: () => __createBinding,
27
+ __decorate: () => __decorate,
28
+ __exportStar: () => __exportStar,
29
+ __extends: () => __extends,
30
+ __generator: () => __generator,
31
+ __importDefault: () => __importDefault,
32
+ __importStar: () => __importStar,
33
+ __makeTemplateObject: () => __makeTemplateObject,
34
+ __metadata: () => __metadata,
35
+ __param: () => __param,
36
+ __read: () => __read,
37
+ __rest: () => __rest,
38
+ __spread: () => __spread,
39
+ __spreadArrays: () => __spreadArrays,
40
+ __values: () => __values
41
+ });
42
+ function __extends(c, L) {
43
+ extendStatics(c, L);
44
+ function R() {
45
+ this.constructor = c;
46
+ }
47
+ c.prototype = L === null ? Object.create(L) : (R.prototype = L.prototype, new R());
48
+ }
49
+ function __rest(c, L) {
50
+ var R = {};
51
+ for (var z in c) Object.prototype.hasOwnProperty.call(c, z) && L.indexOf(z) < 0 && (R[z] = c[z]);
52
+ 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]]);
53
+ return R;
54
+ }
55
+ function __decorate(c, L, R, z) {
56
+ var B = arguments.length, V = B < 3 ? L : z === null ? z = Object.getOwnPropertyDescriptor(L, R) : z, H;
57
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") V = Reflect.decorate(c, L, R, z);
58
+ 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);
59
+ return B > 3 && V && Object.defineProperty(L, R, V), V;
60
+ }
61
+ function __param(c, L) {
62
+ return function(R, z) {
63
+ L(R, z, c);
64
+ };
65
+ }
66
+ function __metadata(c, L) {
67
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(c, L);
68
+ }
69
+ function __awaiter(c, L, R, z) {
70
+ function B(c) {
71
+ return c instanceof R ? c : new R(function(L) {
72
+ L(c);
73
+ });
74
+ }
75
+ return new (R ||= Promise)(function(R, V) {
76
+ function H(c) {
77
+ try {
78
+ W(z.next(c));
79
+ } catch (c) {
80
+ V(c);
81
+ }
82
+ }
83
+ function U(c) {
84
+ try {
85
+ W(z.throw(c));
86
+ } catch (c) {
87
+ V(c);
88
+ }
89
+ }
90
+ function W(c) {
91
+ c.done ? R(c.value) : B(c.value).then(H, U);
92
+ }
93
+ W((z = z.apply(c, L || [])).next());
94
+ });
95
+ }
96
+ function __generator(c, L) {
97
+ var R = {
98
+ label: 0,
99
+ sent: function() {
100
+ if (V[0] & 1) throw V[1];
101
+ return V[1];
102
+ },
103
+ trys: [],
104
+ ops: []
105
+ }, z, B, V, H;
106
+ return H = {
107
+ next: U(0),
108
+ throw: U(1),
109
+ return: U(2)
110
+ }, typeof Symbol == "function" && (H[Symbol.iterator] = function() {
111
+ return this;
112
+ }), H;
113
+ function U(c) {
114
+ return function(L) {
115
+ return W([c, L]);
116
+ };
117
+ }
118
+ function W(H) {
119
+ if (z) throw TypeError("Generator is already executing.");
120
+ for (; R;) try {
121
+ 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;
122
+ switch (B = 0, V && (H = [H[0] & 2, V.value]), H[0]) {
123
+ case 0:
124
+ case 1:
125
+ V = H;
126
+ break;
127
+ case 4: return R.label++, {
128
+ value: H[1],
129
+ done: !1
130
+ };
131
+ case 5:
132
+ R.label++, B = H[1], H = [0];
133
+ continue;
134
+ case 7:
135
+ H = R.ops.pop(), R.trys.pop();
136
+ continue;
137
+ default:
138
+ if ((V = R.trys, !(V = V.length > 0 && V[V.length - 1])) && (H[0] === 6 || H[0] === 2)) {
139
+ R = 0;
140
+ continue;
141
+ }
142
+ if (H[0] === 3 && (!V || H[1] > V[0] && H[1] < V[3])) {
143
+ R.label = H[1];
144
+ break;
145
+ }
146
+ if (H[0] === 6 && R.label < V[1]) {
147
+ R.label = V[1], V = H;
148
+ break;
149
+ }
150
+ if (V && R.label < V[2]) {
151
+ R.label = V[2], R.ops.push(H);
152
+ break;
153
+ }
154
+ V[2] && R.ops.pop(), R.trys.pop();
155
+ continue;
156
+ }
157
+ H = L.call(c, R);
158
+ } catch (c) {
159
+ H = [6, c], B = 0;
160
+ } finally {
161
+ z = V = 0;
162
+ }
163
+ if (H[0] & 5) throw H[1];
164
+ return {
165
+ value: H[0] ? H[1] : void 0,
166
+ done: !0
167
+ };
168
+ }
169
+ }
170
+ function __createBinding(c, L, R, z) {
171
+ z === void 0 && (z = R), c[z] = L[R];
172
+ }
173
+ function __exportStar(c, L) {
174
+ for (var R in c) R !== "default" && !L.hasOwnProperty(R) && (L[R] = c[R]);
175
+ }
176
+ function __values(c) {
177
+ var L = typeof Symbol == "function" && Symbol.iterator, R = L && c[L], z = 0;
178
+ if (R) return R.call(c);
179
+ if (c && typeof c.length == "number") return { next: function() {
180
+ return c && z >= c.length && (c = void 0), {
181
+ value: c && c[z++],
182
+ done: !c
183
+ };
184
+ } };
185
+ throw TypeError(L ? "Object is not iterable." : "Symbol.iterator is not defined.");
186
+ }
187
+ function __read(c, L) {
188
+ var R = typeof Symbol == "function" && c[Symbol.iterator];
189
+ if (!R) return c;
190
+ var z = R.call(c), B, V = [], H;
191
+ try {
192
+ for (; (L === void 0 || L-- > 0) && !(B = z.next()).done;) V.push(B.value);
193
+ } catch (c) {
194
+ H = { error: c };
195
+ } finally {
196
+ try {
197
+ B && !B.done && (R = z.return) && R.call(z);
198
+ } finally {
199
+ if (H) throw H.error;
200
+ }
201
+ }
202
+ return V;
203
+ }
204
+ function __spread() {
205
+ for (var c = [], L = 0; L < arguments.length; L++) c = c.concat(__read(arguments[L]));
206
+ return c;
207
+ }
208
+ function __spreadArrays() {
209
+ for (var c = 0, L = 0, R = arguments.length; L < R; L++) c += arguments[L].length;
210
+ 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];
211
+ return z;
212
+ }
213
+ function __await(c) {
214
+ return this instanceof __await ? (this.v = c, this) : new __await(c);
215
+ }
216
+ function __asyncGenerator(c, L, R) {
217
+ if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
218
+ var z = R.apply(c, L || []), B, V = [];
219
+ return B = {}, H("next"), H("throw"), H("return"), B[Symbol.asyncIterator] = function() {
220
+ return this;
221
+ }, B;
222
+ function H(c) {
223
+ z[c] && (B[c] = function(L) {
224
+ return new Promise(function(R, z) {
225
+ V.push([
226
+ c,
227
+ L,
228
+ R,
229
+ z
230
+ ]) > 1 || U(c, L);
231
+ });
232
+ });
233
+ }
234
+ function U(c, L) {
235
+ try {
236
+ W(z[c](L));
237
+ } catch (c) {
238
+ q(V[0][3], c);
239
+ }
240
+ }
241
+ function W(c) {
242
+ c.value instanceof __await ? Promise.resolve(c.value.v).then(G, K) : q(V[0][2], c);
243
+ }
244
+ function G(c) {
245
+ U("next", c);
246
+ }
247
+ function K(c) {
248
+ U("throw", c);
249
+ }
250
+ function q(c, L) {
251
+ c(L), V.shift(), V.length && U(V[0][0], V[0][1]);
252
+ }
253
+ }
254
+ function __asyncDelegator(c) {
255
+ var L, R;
256
+ return L = {}, z("next"), z("throw", function(c) {
257
+ throw c;
258
+ }), z("return"), L[Symbol.iterator] = function() {
259
+ return this;
260
+ }, L;
261
+ function z(z, B) {
262
+ L[z] = c[z] ? function(L) {
263
+ return (R = !R) ? {
264
+ value: __await(c[z](L)),
265
+ done: z === "return"
266
+ } : B ? B(L) : L;
267
+ } : B;
268
+ }
269
+ }
270
+ function __asyncValues(c) {
271
+ if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
272
+ var L = c[Symbol.asyncIterator], R;
273
+ 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() {
274
+ return this;
275
+ }, R);
276
+ function z(L) {
277
+ R[L] = c[L] && function(R) {
278
+ return new Promise(function(z, V) {
279
+ R = c[L](R), B(z, V, R.done, R.value);
280
+ });
281
+ };
282
+ }
283
+ function B(c, L, R, z) {
284
+ Promise.resolve(z).then(function(L) {
285
+ c({
286
+ value: L,
287
+ done: R
288
+ });
289
+ }, L);
290
+ }
291
+ }
292
+ function __makeTemplateObject(c, L) {
293
+ return Object.defineProperty ? Object.defineProperty(c, "raw", { value: L }) : c.raw = L, c;
294
+ }
295
+ function __importStar(c) {
296
+ if (c && c.__esModule) return c;
297
+ var L = {};
298
+ if (c != null) for (var R in c) Object.hasOwnProperty.call(c, R) && (L[R] = c[R]);
299
+ return L.default = c, L;
300
+ }
301
+ function __importDefault(c) {
302
+ return c && c.__esModule ? c : { default: c };
303
+ }
304
+ function __classPrivateFieldGet(c, L) {
305
+ if (!L.has(c)) throw TypeError("attempted to get private field on non-instance");
306
+ return L.get(c);
307
+ }
308
+ function __classPrivateFieldSet(c, L, R) {
309
+ if (!L.has(c)) throw TypeError("attempted to set private field on non-instance");
310
+ return L.set(c, R), R;
311
+ }
312
+ var extendStatics, __assign, init_tslib_es6 = __esmMin((() => {
313
+ extendStatics = function(c, L) {
314
+ return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(c, L) {
315
+ c.__proto__ = L;
316
+ } || function(c, L) {
317
+ for (var R in L) L.hasOwnProperty(R) && (c[R] = L[R]);
318
+ }, extendStatics(c, L);
319
+ }, __assign = function() {
320
+ return __assign = Object.assign || function(c) {
321
+ 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]);
322
+ return c;
323
+ }, __assign.apply(this, arguments);
324
+ };
325
+ })), require_constants = /* @__PURE__ */ __commonJSMin(((c) => {
326
+ Object.defineProperty(c, "__esModule", { value: !0 }), c.BLOCK_SIZE = 64, c.DIGEST_LENGTH = 32, c.KEY = new Uint32Array([
327
+ 1116352408,
328
+ 1899447441,
329
+ 3049323471,
330
+ 3921009573,
331
+ 961987163,
332
+ 1508970993,
333
+ 2453635748,
334
+ 2870763221,
335
+ 3624381080,
336
+ 310598401,
337
+ 607225278,
338
+ 1426881987,
339
+ 1925078388,
340
+ 2162078206,
341
+ 2614888103,
342
+ 3248222580,
343
+ 3835390401,
344
+ 4022224774,
345
+ 264347078,
346
+ 604807628,
347
+ 770255983,
348
+ 1249150122,
349
+ 1555081692,
350
+ 1996064986,
351
+ 2554220882,
352
+ 2821834349,
353
+ 2952996808,
354
+ 3210313671,
355
+ 3336571891,
356
+ 3584528711,
357
+ 113926993,
358
+ 338241895,
359
+ 666307205,
360
+ 773529912,
361
+ 1294757372,
362
+ 1396182291,
363
+ 1695183700,
364
+ 1986661051,
365
+ 2177026350,
366
+ 2456956037,
367
+ 2730485921,
368
+ 2820302411,
369
+ 3259730800,
370
+ 3345764771,
371
+ 3516065817,
372
+ 3600352804,
373
+ 4094571909,
374
+ 275423344,
375
+ 430227734,
376
+ 506948616,
377
+ 659060556,
378
+ 883997877,
379
+ 958139571,
380
+ 1322822218,
381
+ 1537002063,
382
+ 1747873779,
383
+ 1955562222,
384
+ 2024104815,
385
+ 2227730452,
386
+ 2361852424,
387
+ 2428436474,
388
+ 2756734187,
389
+ 3204031479,
390
+ 3329325298
391
+ ]), c.INIT = [
392
+ 1779033703,
393
+ 3144134277,
394
+ 1013904242,
395
+ 2773480762,
396
+ 1359893119,
397
+ 2600822924,
398
+ 528734635,
399
+ 1541459225
400
+ ], c.MAX_HASHABLE_LENGTH = 2 ** 53 - 1;
401
+ })), require_RawSha256 = /* @__PURE__ */ __commonJSMin(((c) => {
402
+ Object.defineProperty(c, "__esModule", { value: !0 });
403
+ var L = require_constants();
404
+ c.RawSha256 = function() {
405
+ function c() {
406
+ 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;
407
+ }
408
+ return c.prototype.update = function(c) {
409
+ if (this.finished) throw Error("Attempted to update an already finished hash.");
410
+ var R = 0, z = c.byteLength;
411
+ if (this.bytesHashed += z, this.bytesHashed * 8 > L.MAX_HASHABLE_LENGTH) throw Error("Cannot hash more than 2^53 - 1 bits");
412
+ for (; z > 0;) this.buffer[this.bufferLength++] = c[R++], z--, this.bufferLength === L.BLOCK_SIZE && (this.hashBuffer(), this.bufferLength = 0);
413
+ }, c.prototype.digest = function() {
414
+ if (!this.finished) {
415
+ var c = this.bytesHashed * 8, R = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength), z = this.bufferLength;
416
+ if (R.setUint8(this.bufferLength++, 128), z % L.BLOCK_SIZE >= L.BLOCK_SIZE - 8) {
417
+ for (var B = this.bufferLength; B < L.BLOCK_SIZE; B++) R.setUint8(B, 0);
418
+ this.hashBuffer(), this.bufferLength = 0;
419
+ }
420
+ for (var B = this.bufferLength; B < L.BLOCK_SIZE - 8; B++) R.setUint8(B, 0);
421
+ R.setUint32(L.BLOCK_SIZE - 8, Math.floor(c / 4294967296), !0), R.setUint32(L.BLOCK_SIZE - 4, c), this.hashBuffer(), this.finished = !0;
422
+ }
423
+ 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;
424
+ return V;
425
+ }, c.prototype.hashBuffer = function() {
426
+ 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++) {
427
+ 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;
428
+ else {
429
+ var Y = this.temp[J - 2], X = (Y >>> 17 | Y << 15) ^ (Y >>> 19 | Y << 13) ^ Y >>> 10;
430
+ Y = this.temp[J - 15];
431
+ var Z = (Y >>> 7 | Y << 25) ^ (Y >>> 18 | Y << 14) ^ Y >>> 3;
432
+ this.temp[J] = (X + this.temp[J - 7] | 0) + (Z + this.temp[J - 16] | 0);
433
+ }
434
+ 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;
435
+ q = K, K = G, G = W, W = U + Q | 0, U = H, H = V, V = B, B = Q + $ | 0;
436
+ }
437
+ z[0] += B, z[1] += V, z[2] += H, z[3] += U, z[4] += W, z[5] += G, z[6] += K, z[7] += q;
438
+ }, c;
439
+ }();
440
+ })), fromUtf8$1, toUtf8, init_pureJs = __esmMin((() => {
441
+ fromUtf8$1 = (c) => {
442
+ let L = [];
443
+ for (let R = 0, z = c.length; R < z; R++) {
444
+ let z = c.charCodeAt(R);
445
+ if (z < 128) L.push(z);
446
+ else if (z < 2048) L.push(z >> 6 | 192, z & 63 | 128);
447
+ else if (R + 1 < c.length && (z & 64512) == 55296 && (c.charCodeAt(R + 1) & 64512) == 56320) {
448
+ let B = 65536 + ((z & 1023) << 10) + (c.charCodeAt(++R) & 1023);
449
+ L.push(B >> 18 | 240, B >> 12 & 63 | 128, B >> 6 & 63 | 128, B & 63 | 128);
450
+ } else L.push(z >> 12 | 224, z >> 6 & 63 | 128, z & 63 | 128);
451
+ }
452
+ return Uint8Array.from(L);
453
+ }, toUtf8 = (c) => {
454
+ let L = "";
455
+ for (let R = 0, z = c.length; R < z; R++) {
456
+ let z = c[R];
457
+ if (z < 128) L += String.fromCharCode(z);
458
+ else if (192 <= z && z < 224) {
459
+ let B = c[++R];
460
+ L += String.fromCharCode((z & 31) << 6 | B & 63);
461
+ } else if (240 <= z && z < 365) {
462
+ let B = "%" + [
463
+ z,
464
+ c[++R],
465
+ c[++R],
466
+ c[++R]
467
+ ].map((c) => c.toString(16)).join("%");
468
+ L += decodeURIComponent(B);
469
+ } else L += String.fromCharCode((z & 15) << 12 | (c[++R] & 63) << 6 | c[++R] & 63);
470
+ }
471
+ return L;
472
+ };
473
+ }));
474
+ function fromUtf8$2(c) {
475
+ return new TextEncoder().encode(c);
476
+ }
477
+ function toUtf8$1(c) {
478
+ return new TextDecoder("utf-8").decode(c);
479
+ }
480
+ var init_whatwgEncodingApi = __esmMin((() => {})), dist_es_exports = /* @__PURE__ */ __export({
481
+ fromUtf8: () => fromUtf8$3,
482
+ toUtf8: () => toUtf8$2
483
+ }), fromUtf8$3, toUtf8$2, init_dist_es = __esmMin((() => {
484
+ 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);
485
+ })), require_convertToBuffer = /* @__PURE__ */ __commonJSMin(((c) => {
486
+ Object.defineProperty(c, "__esModule", { value: !0 });
487
+ var L = (init_dist_es(), __toCommonJS(dist_es_exports)), R = typeof Buffer < "u" && Buffer.from ? function(c) {
488
+ return Buffer.from(c, "utf8");
489
+ } : L.fromUtf8;
490
+ function z(c) {
491
+ 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);
492
+ }
493
+ c.convertToBuffer = z;
494
+ })), require_isEmptyData = /* @__PURE__ */ __commonJSMin(((c) => {
495
+ Object.defineProperty(c, "__esModule", { value: !0 });
496
+ function L(c) {
497
+ return typeof c == "string" ? c.length === 0 : c.byteLength === 0;
498
+ }
499
+ c.isEmptyData = L;
500
+ })), require_numToUint8 = /* @__PURE__ */ __commonJSMin(((c) => {
501
+ Object.defineProperty(c, "__esModule", { value: !0 });
502
+ function L(c) {
503
+ return new Uint8Array([
504
+ (c & 4278190080) >> 24,
505
+ (c & 16711680) >> 16,
506
+ (c & 65280) >> 8,
507
+ c & 255
508
+ ]);
509
+ }
510
+ c.numToUint8 = L;
511
+ })), require_uint32ArrayFrom = /* @__PURE__ */ __commonJSMin(((c) => {
512
+ Object.defineProperty(c, "__esModule", { value: !0 });
513
+ function L(c) {
514
+ if (!Uint32Array.from) {
515
+ for (var L = new Uint32Array(c.length), R = 0; R < c.length;) L[R] = c[R], R += 1;
516
+ return L;
517
+ }
518
+ return Uint32Array.from(c);
519
+ }
520
+ c.uint32ArrayFrom = L;
521
+ })), require_build$1 = /* @__PURE__ */ __commonJSMin(((c) => {
522
+ Object.defineProperty(c, "__esModule", { value: !0 }), c.uint32ArrayFrom = c.numToUint8 = c.isEmptyData = c.convertToBuffer = void 0;
523
+ var L = require_convertToBuffer();
524
+ Object.defineProperty(c, "convertToBuffer", {
525
+ enumerable: !0,
526
+ get: function() {
527
+ return L.convertToBuffer;
528
+ }
529
+ });
530
+ var R = require_isEmptyData();
531
+ Object.defineProperty(c, "isEmptyData", {
532
+ enumerable: !0,
533
+ get: function() {
534
+ return R.isEmptyData;
535
+ }
536
+ });
537
+ var z = require_numToUint8();
538
+ Object.defineProperty(c, "numToUint8", {
539
+ enumerable: !0,
540
+ get: function() {
541
+ return z.numToUint8;
542
+ }
543
+ });
544
+ var B = require_uint32ArrayFrom();
545
+ Object.defineProperty(c, "uint32ArrayFrom", {
546
+ enumerable: !0,
547
+ get: function() {
548
+ return B.uint32ArrayFrom;
549
+ }
550
+ });
551
+ })), require_jsSha256 = /* @__PURE__ */ __commonJSMin(((c) => {
552
+ Object.defineProperty(c, "__esModule", { value: !0 });
553
+ var L = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)), R = require_constants(), z = require_RawSha256(), B = require_build$1();
554
+ c.Sha256 = function() {
555
+ function c(c) {
556
+ this.secret = c, this.hash = new z.RawSha256(), this.reset();
557
+ }
558
+ return c.prototype.update = function(c) {
559
+ if (!((0, B.isEmptyData)(c) || this.error)) try {
560
+ this.hash.update((0, B.convertToBuffer)(c));
561
+ } catch (c) {
562
+ this.error = c;
563
+ }
564
+ }, c.prototype.digestSync = function() {
565
+ if (this.error) throw this.error;
566
+ return this.outer ? (this.outer.finished || this.outer.update(this.hash.digest()), this.outer.digest()) : this.hash.digest();
567
+ }, c.prototype.digest = function() {
568
+ return L.__awaiter(this, void 0, void 0, function() {
569
+ return L.__generator(this, function(c) {
570
+ return [2, this.digestSync()];
571
+ });
572
+ });
573
+ }, c.prototype.reset = function() {
574
+ if (this.hash = new z.RawSha256(), this.secret) {
575
+ this.outer = new z.RawSha256();
576
+ var c = V(this.secret), L = new Uint8Array(R.BLOCK_SIZE);
577
+ L.set(c);
578
+ for (var B = 0; B < R.BLOCK_SIZE; B++) c[B] ^= 54, L[B] ^= 92;
579
+ this.hash.update(c), this.outer.update(L);
580
+ for (var B = 0; B < c.byteLength; B++) c[B] = 0;
581
+ }
582
+ }, c;
583
+ }();
584
+ function V(c) {
585
+ var L = (0, B.convertToBuffer)(c);
586
+ if (L.byteLength > R.BLOCK_SIZE) {
587
+ var V = new z.RawSha256();
588
+ V.update(L), L = V.digest();
589
+ }
590
+ var H = new Uint8Array(R.BLOCK_SIZE);
591
+ return H.set(L), H;
592
+ }
593
+ })), require_build = /* @__PURE__ */ __commonJSMin(((c) => {
594
+ Object.defineProperty(c, "__esModule", { value: !0 }), (init_tslib_es6(), __toCommonJS(tslib_es6_exports)).__exportStar(require_jsSha256(), c);
595
+ }));
596
+ require_build();
597
+ function wrapDucklakeQuery(c, L) {
598
+ let R = `ATTACH 'ducklake://${L}' AS dl;USE dl;\n`;
599
+ return c.replace(/^(--.*\n)*/, (c) => c + R);
600
+ }
601
+ function getIntrospectionQuery(c) {
602
+ let L = {
603
+ descriptions: !0,
604
+ specifiedByUrl: !1,
605
+ directiveIsRepeatable: !1,
606
+ schemaDescription: !1,
607
+ inputValueDeprecation: !1,
608
+ oneOf: !1,
609
+ ...c
610
+ }, R = L.descriptions ? "description" : "", z = L.specifiedByUrl ? "specifiedByURL" : "", B = L.directiveIsRepeatable ? "isRepeatable" : "", V = L.schemaDescription ? R : "";
611
+ function H(c) {
612
+ return L.inputValueDeprecation ? c : "";
613
+ }
614
+ let U = L.oneOf ? "isOneOf" : "";
615
+ return `
616
+ query IntrospectionQuery {
617
+ __schema {
618
+ ${V}
619
+ queryType { name kind }
620
+ mutationType { name kind }
621
+ subscriptionType { name kind }
622
+ types {
623
+ ...FullType
624
+ }
625
+ directives {
626
+ name
627
+ ${R}
628
+ ${B}
629
+ locations
630
+ args${H("(includeDeprecated: true)")} {
631
+ ...InputValue
632
+ }
633
+ }
634
+ }
635
+ }
636
+
637
+ fragment FullType on __Type {
638
+ kind
639
+ name
640
+ ${R}
641
+ ${z}
642
+ ${U}
643
+ fields(includeDeprecated: true) {
644
+ name
645
+ ${R}
646
+ args${H("(includeDeprecated: true)")} {
647
+ ...InputValue
648
+ }
649
+ type {
650
+ ...TypeRef
651
+ }
652
+ isDeprecated
653
+ deprecationReason
654
+ }
655
+ inputFields${H("(includeDeprecated: true)")} {
656
+ ...InputValue
657
+ }
658
+ interfaces {
659
+ ...TypeRef
660
+ }
661
+ enumValues(includeDeprecated: true) {
662
+ name
663
+ ${R}
664
+ isDeprecated
665
+ deprecationReason
666
+ }
667
+ possibleTypes {
668
+ ...TypeRef
669
+ }
670
+ }
671
+
672
+ fragment InputValue on __InputValue {
673
+ name
674
+ ${R}
675
+ type { ...TypeRef }
676
+ defaultValue
677
+ ${H("isDeprecated")}
678
+ ${H("deprecationReason")}
679
+ }
680
+
681
+ fragment TypeRef on __Type {
682
+ kind
683
+ name
684
+ ofType {
685
+ kind
686
+ name
687
+ ofType {
688
+ kind
689
+ name
690
+ ofType {
691
+ kind
692
+ name
693
+ ofType {
694
+ kind
695
+ name
696
+ ofType {
697
+ kind
698
+ name
699
+ ofType {
700
+ kind
701
+ name
702
+ ofType {
703
+ kind
704
+ name
705
+ ofType {
706
+ kind
707
+ name
708
+ ofType {
709
+ kind
710
+ name
711
+ }
712
+ }
713
+ }
714
+ }
715
+ }
716
+ }
717
+ }
718
+ }
719
+ }
720
+ }
721
+ `;
722
+ }
723
+ let ColumnIdentity = /* @__PURE__ */ function(c) {
724
+ return c.ByDefault = "By Default", c.Always = "Always", c.No = "No", c;
725
+ }({});
726
+ getIntrospectionQuery();
727
+ function buildVisibleFieldList(c, L) {
728
+ return c.filter((c) => c && c.ignored !== !0).map((c) => {
729
+ switch (L) {
730
+ case "postgresql": return `"${c?.field}"`;
731
+ case "ms_sql_server": return `[${c?.field}]`;
732
+ case "mysql": return `\`${c?.field}\``;
733
+ case "snowflake": return `"${c?.field}"`;
734
+ case "bigquery": return `\`${c?.field}\``;
735
+ case "duckdb": return `"${c?.field}"`;
736
+ default: throw Error("Unsupported database type: " + L);
737
+ }
738
+ });
739
+ }
740
+ function getLanguageByResourceType(c) {
741
+ return {
742
+ postgresql: "postgresql",
743
+ mysql: "mysql",
744
+ ms_sql_server: "mssql",
745
+ snowflake: "snowflake",
746
+ snowflake_oauth: "snowflake",
747
+ bigquery: "bigquery",
748
+ duckdb: "duckdb"
749
+ }[c];
750
+ }
751
+ function buildParameters(c, L) {
752
+ return c.map((c, R) => {
753
+ switch (L) {
754
+ case "postgresql": return `-- $${R + 1} ${c.field}`;
755
+ case "mysql": return `-- :${c.field} (${c.datatype.split("(")[0]})`;
756
+ case "ms_sql_server": return `-- @p${R + 1} ${c.field} (${c.datatype.split("(")[0]})`;
757
+ case "snowflake": return `-- ? ${c.field} (${c.datatype.split("(")[0]})`;
758
+ case "bigquery": return `-- @${c.field} (${c.datatype.split("(")[0]})`;
759
+ case "duckdb": return `-- $${c.field} (${c.datatype.split("(")[0]})`;
760
+ }
761
+ }).join("\n");
762
+ }
763
+ function getPrimaryKeys(c) {
764
+ let L = c?.filter((c) => c.isprimarykey)?.map((c) => c.field) ?? [];
765
+ return L?.length === 0 && (L = c?.map((c) => c.field) ?? []), L ?? [];
766
+ }
767
+ function makeCountQuery(c, L, R = void 0, z) {
768
+ let B = " WHERE ", V = " AND ", H = "", U = buildParameters([{
769
+ field: "quicksearch",
770
+ datatype: c === "bigquery" ? "string" : "text"
771
+ }], c);
772
+ U += "\n", R && (H = ` ${R} AND `);
773
+ let W = buildVisibleFieldList(z, c);
774
+ switch (c) {
775
+ case "mysql":
776
+ 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}`;
777
+ break;
778
+ case "postgresql":
779
+ W.length > 0 ? H += `($1 = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || $1 || '%')` : H += "($1 = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM ${L}`;
780
+ break;
781
+ case "ms_sql_server":
782
+ W.length > 0 ? H += `(@p1 = '' OR CONCAT(${W.join(", +")}) LIKE '%' + @p1 + '%')` : H += "(@p1 = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM [${L}]`;
783
+ break;
784
+ case "snowflake":
785
+ U = "", W.length > 0 ? (U += buildParameters([{
786
+ field: "quicksearch",
787
+ datatype: "text"
788
+ }, {
789
+ field: "quicksearch",
790
+ datatype: "text"
791
+ }], c), U += "\n", H += `(? = '' OR CONCAT(${W.join(", ")}) ILIKE '%' || ? || '%')`) : (U += buildParameters([{
792
+ field: "quicksearch",
793
+ datatype: "text"
794
+ }], c), U += "\n", H += "(? = '' OR 1 = 1)"), U += `SELECT COUNT(*) as count FROM ${L}`;
795
+ break;
796
+ case "bigquery":
797
+ if (W.length > 0) {
798
+ let c = W.map((c) => {
799
+ let L = z.find((L) => L.field === c.slice(1, -1));
800
+ return L?.datatype === "JSON" || L?.datatype.startsWith("STRUCT") || L?.datatype.startsWith("ARRAY") ? `TO_JSON_STRING(${c})` : `${c}`;
801
+ }).join(",");
802
+ H += `(@quicksearch = '' OR REGEXP_CONTAINS(CONCAT(${c}), '(?i)' || @quicksearch))`;
803
+ } else H += "(@quicksearch = '' OR 1 = 1)";
804
+ U += `SELECT COUNT(*) as count FROM \`${L}\``;
805
+ break;
806
+ case "duckdb":
807
+ W.length > 0 ? H += ` ($quicksearch = '' OR CONCAT(' ', ${W.join(", ")}) LIKE CONCAT('%', $quicksearch, '%'))` : H += " ($quicksearch = '' OR 1 = 1)", U += `SELECT COUNT(*) as count FROM ${L}`;
808
+ break;
809
+ default: throw Error("Unsupported database type:" + c);
810
+ }
811
+ 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;
812
+ }
813
+ function getCountInput(c, L, R, z) {
814
+ if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L || !R?.length) return;
815
+ let B = c.type === "ducklake" ? "duckdb" : c.resourceType, V = makeCountQuery(B, L, z, R);
816
+ return c.type === "ducklake" && (V = wrapDucklakeQuery(V, c.ducklake)), {
817
+ runnable: {
818
+ name: "AppDbExplorer",
819
+ type: "runnableByName",
820
+ inlineScript: {
821
+ content: V,
822
+ language: getLanguageByResourceType(B),
823
+ schema: {
824
+ $schema: "https://json-schema.org/draft/2020-12/schema",
825
+ properties: c.type === "database" ? { database: {
826
+ description: "Database name",
827
+ type: "object",
828
+ format: `resource-${B}`
829
+ } } : {},
830
+ required: ["database"],
831
+ type: "object"
832
+ }
833
+ }
834
+ },
835
+ fields: c.type === "database" ? { database: {
836
+ type: "static",
837
+ value: `$res:${c.resourcePath}`,
838
+ fieldType: "object",
839
+ format: `resource-${B}`
840
+ } } : {},
841
+ type: "runnable",
842
+ fieldType: "object"
843
+ };
844
+ }
845
+ function makeDeleteQuery(c, L, R) {
846
+ let z = buildParameters(R === "snowflake" ? L.flatMap((c) => [c, c]) : L, R);
847
+ switch (R) {
848
+ case "postgresql": {
849
+ 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 ");
850
+ return z += `\nDELETE FROM ${c} \nWHERE ${R} RETURNING 1;`, z;
851
+ }
852
+ case "mysql": {
853
+ let R = L.map((c) => `(:${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = :${c.field})`).join("\n AND ");
854
+ return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
855
+ }
856
+ case "ms_sql_server": {
857
+ 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 ");
858
+ return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
859
+ }
860
+ case "snowflake": {
861
+ let R = L.map((c, L) => `(? = 'null' AND ${c.field} IS NULL OR ${c.field} = ?)`).join("\n AND ");
862
+ return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
863
+ }
864
+ case "bigquery": {
865
+ 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 ");
866
+ return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
867
+ }
868
+ case "duckdb": {
869
+ let R = L.map((c) => `($${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${c.field})`).join("\n AND ");
870
+ return z += `\nDELETE FROM ${c} \nWHERE ${R}`, z;
871
+ }
872
+ default: throw Error("Unsupported database type");
873
+ }
874
+ }
875
+ function getDeleteInput(c, L, R) {
876
+ if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L) return;
877
+ let z = c.type === "ducklake" ? "duckdb" : c.resourceType, B = makeDeleteQuery(L, R, z);
878
+ return c.type === "ducklake" && (B = wrapDucklakeQuery(B, c.ducklake)), {
879
+ runnable: {
880
+ name: "AppDbExplorer",
881
+ type: "runnableByName",
882
+ inlineScript: {
883
+ content: B,
884
+ language: getLanguageByResourceType(z),
885
+ schema: {
886
+ $schema: "https://json-schema.org/draft/2020-12/schema",
887
+ properties: {},
888
+ required: ["database"],
889
+ type: "object"
890
+ }
891
+ }
892
+ },
893
+ fields: c.type == "database" ? { database: {
894
+ type: "static",
895
+ value: `$res:${c.resourcePath}`,
896
+ fieldType: "object",
897
+ format: `resource-${z}`
898
+ } } : {},
899
+ type: "runnable",
900
+ fieldType: "object"
901
+ };
902
+ }
903
+ function formatInsertValues(c, L, R = 1) {
904
+ switch (L) {
905
+ case "mysql": return c.map((c) => `:${c.field}`).join(", ");
906
+ case "postgresql": return c.map((c, L) => `$${R + L}::${c.datatype}`).join(", ");
907
+ case "ms_sql_server": return c.map((c, L) => `@p${R + L}`).join(", ");
908
+ case "snowflake": return c.map(() => "?").join(", ");
909
+ case "bigquery": return c.map((c) => `@${c.field}`).join(", ");
910
+ case "duckdb": return c.map((c) => `$${c.field}`).join(", ");
911
+ default: throw Error("Unsupported database type");
912
+ }
913
+ }
914
+ function formatColumnNames(c) {
915
+ return c.map((c) => c.field).join(", ");
916
+ }
917
+ function getUserDefaultValue(c) {
918
+ if (c.defaultValueNull) return "NULL";
919
+ if (c.defaultUserValue) return typeof c.defaultUserValue == "string" ? `'${c.defaultUserValue}'` : c.defaultUserValue;
920
+ }
921
+ function formatDefaultValues(c) {
922
+ return c.map((c) => {
923
+ let L = getUserDefaultValue(c);
924
+ return c.overrideDefaultValue === !0 ? L : L ?? c.defaultvalue;
925
+ }).join(", ");
926
+ }
927
+ function shouldOmitColumnInInsert(c) {
928
+ if (!c.hideInsert || c.isidentity === ColumnIdentity.Always) return !0;
929
+ let L = c.defaultUserValue !== void 0 && c.defaultUserValue !== "" || c.defaultValueNull === !0, R = !!c.defaultvalue;
930
+ if (c.isnullable === "NO") {
931
+ if (!L && !R && c.isidentity === ColumnIdentity.No) throw Error(`Column ${c.field} is not nullable and has no default value`);
932
+ return !L && !R ? c.isidentity !== ColumnIdentity.No : !L && R;
933
+ } else if (c.isnullable === "YES") return !L;
934
+ return !1;
935
+ }
936
+ function makeInsertQuery(c, L, R) {
937
+ if (!c) throw Error("Table name is required");
938
+ 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);
939
+ H += "\n";
940
+ let U = B.length > 0, W = formatColumnNames(V), G = formatInsertValues(z, R), K = formatDefaultValues(B);
941
+ return H += `INSERT INTO ${c} (${W}) VALUES (${G}${U ? ", " : ""}${K})`, H;
942
+ }
943
+ function getInsertInput(c, L, R) {
944
+ let z = c.type === "ducklake" ? "duckdb" : c.resourceType, B = makeInsertQuery(L, R, z);
945
+ return c.type === "ducklake" && (B = wrapDucklakeQuery(B, c.ducklake)), {
946
+ runnable: {
947
+ name: "AppDbExplorer",
948
+ type: "runnableByName",
949
+ inlineScript: {
950
+ content: B,
951
+ language: getLanguageByResourceType(z),
952
+ schema: {
953
+ $schema: "https://json-schema.org/draft/2020-12/schema",
954
+ properties: {},
955
+ required: ["database"],
956
+ type: "object"
957
+ }
958
+ }
959
+ },
960
+ fields: c.type === "database" ? { database: {
961
+ type: "static",
962
+ value: `$res:${c.resourcePath}`,
963
+ fieldType: "object",
964
+ format: `resource-${z}`
965
+ } } : {},
966
+ type: "runnable",
967
+ fieldType: "object"
968
+ };
969
+ }
970
+ function makeSnowflakeSelectQuery(c, L, R, z) {
971
+ let B = coerceToNumber(z?.limit) || 100, V = coerceToNumber(z?.offset) || 0, H = [{
972
+ field: "quicksearch",
973
+ datatype: "text"
974
+ }], U = "";
975
+ U += "\n";
976
+ let W = buildVisibleFieldList(L, "snowflake"), G = W.join(", ");
977
+ U += `SELECT ${G} FROM ${c}`;
978
+ let K = ["LENGTH(?) = 0", ...W.map((c) => (H.push({
979
+ field: "quicksearch",
980
+ datatype: "text"
981
+ }), `CONCAT(${c}) ILIKE CONCAT('%', ?, '%')`))].join(" OR ");
982
+ R ? U += ` WHERE ${R} AND (${K})` : U += ` WHERE ${K}`;
983
+ let q = L.map((c) => (H.push({
984
+ field: "order_by",
985
+ datatype: "text"
986
+ }, {
987
+ field: "is_desc",
988
+ datatype: "boolean"
989
+ }, {
990
+ field: "order_by",
991
+ datatype: "text"
992
+ }, {
993
+ field: "is_desc",
994
+ datatype: "boolean"
995
+ }), `CASE WHEN ? = '${c.field}' AND ? = FALSE THEN "${c.field}" END ASC,
996
+ CASE WHEN ? = '${c.field}' AND ? = TRUE THEN "${c.field}" END DESC`));
997
+ return U += ` ORDER BY ${q.join(",\n")}`, U += ` LIMIT ${B} OFFSET ${V}`, U = buildParameters(H, "snowflake") + "\n" + U, U;
998
+ }
999
+ function makeSelectQuery(c, L, R, z, B) {
1000
+ if (!c) throw Error("Table name is required");
1001
+ let V = "", H = buildParameters([
1002
+ {
1003
+ field: "limit",
1004
+ datatype: z === "bigquery" ? "integer" : "int"
1005
+ },
1006
+ {
1007
+ field: "offset",
1008
+ datatype: z === "bigquery" ? "integer" : "int"
1009
+ },
1010
+ {
1011
+ field: "quicksearch",
1012
+ datatype: z === "bigquery" ? "string" : "text"
1013
+ },
1014
+ {
1015
+ field: "order_by",
1016
+ datatype: z === "bigquery" ? "string" : "text"
1017
+ },
1018
+ {
1019
+ field: "is_desc",
1020
+ datatype: z === "bigquery" ? "bool" : "boolean"
1021
+ }
1022
+ ], z);
1023
+ H += "\n";
1024
+ let U = buildVisibleFieldList(L, z), W = U.join(", ");
1025
+ switch (z) {
1026
+ case "mysql": {
1027
+ let z = L.map((c) => `
1028
+ CASE WHEN :order_by = '${c.field}' AND :is_desc IS false THEN \`${c.field}\` END,
1029
+ CASE WHEN :order_by = '${c.field}' AND :is_desc IS true THEN \`${c.field}\` END DESC`).join(",\n");
1030
+ V = ` (:quicksearch = '' OR CONCAT_WS(' ', ${U.join(", ")}) LIKE CONCAT('%', :quicksearch, '%'))`, H += `SELECT ${W} FROM ${c}`, H += ` WHERE ${R ? `${R} AND` : ""} ${V}`, H += ` ORDER BY ${z}`, H += " LIMIT :limit OFFSET :offset";
1031
+ break;
1032
+ }
1033
+ case "postgresql": {
1034
+ let z = `
1035
+ ${L.map((c) => `
1036
+ (CASE WHEN $4 = '${c.field}' AND $5 IS false THEN "${c.field}"::text END),
1037
+ (CASE WHEN $4 = '${c.field}' AND $5 IS true THEN "${c.field}"::text END) DESC`).join(",\n")}`;
1038
+ V = `($3 = '' OR CONCAT(${U.join(", ")}) ILIKE '%' || $3 || '%')`, H += `SELECT ${U.map((c) => `${c}::text`).join(", ")} FROM ${c}\n`, H += ` WHERE ${R ? `${R} AND` : ""} ${V}\n`, H += ` ORDER BY ${z}\n`, H += " LIMIT $1::INT OFFSET $2::INT";
1039
+ break;
1040
+ }
1041
+ case "ms_sql_server":
1042
+ let z = L.map((c) => `
1043
+ (CASE WHEN @p4 = '${c.field}' AND @p5 = 0 THEN ${c.field} END) ASC,
1044
+ (CASE WHEN @p4 = '${c.field}' AND @p5 = 1 THEN ${c.field} END) DESC`).join(",\n");
1045
+ V = ` (@p3 = '' OR CONCAT(${W}) LIKE '%' + @p3 + '%')`, H += `SELECT ${W} FROM ${c}`, H += ` WHERE ${R ? `${R} AND` : ""} ${V}`, H += ` ORDER BY ${z}`, H += " OFFSET @p2 ROWS FETCH NEXT @p1 ROWS ONLY";
1046
+ break;
1047
+ case "snowflake": return makeSnowflakeSelectQuery(c, L, R, B);
1048
+ case "bigquery": {
1049
+ let z = L.map((c) => c.datatype === "JSON" || c.datatype.startsWith("STRUCT") || c.datatype.startsWith("ARRAY") || c.datatype === "GEOGRAPHY" ? `
1050
+ (CASE WHEN @order_by = '${c.field}' AND @is_desc = false THEN TO_JSON_STRING(${c.field}) END) ASC,
1051
+ (CASE WHEN @order_by = '${c.field}' AND @is_desc = true THEN TO_JSON_STRING(${c.field}) END) DESC` : `
1052
+ (CASE WHEN @order_by = '${c.field}' AND @is_desc = false THEN ${c.field} END) ASC,
1053
+ (CASE WHEN @order_by = '${c.field}' AND @is_desc = true THEN ${c.field} END) DESC`).join(",\n");
1054
+ V = ` (@quicksearch = '' OR REGEXP_CONTAINS(CONCAT(${U.map((c) => {
1055
+ let R = L.find((L) => L.field === c.slice(1, -1));
1056
+ return R?.datatype === "JSON" || R?.datatype.startsWith("STRUCT") || R?.datatype.startsWith("ARRAY") || R?.datatype === "GEOGRAPHY" ? `TO_JSON_STRING(${c})` : `CAST(${c} AS STRING)`;
1057
+ }).join(",")}), '(?i)' || @quicksearch))`, H += `SELECT ${W} FROM ${c}`, H += ` WHERE ${R ? `${R} AND` : ""} ${V}`, H += ` ORDER BY ${z}`, H += " LIMIT @limit OFFSET @offset";
1058
+ break;
1059
+ }
1060
+ case "duckdb": {
1061
+ let z = `
1062
+ ${L.map((c) => `
1063
+ (CASE WHEN $order_by = '${c.field}' AND $is_desc IS false THEN "${c.field}"::text END),
1064
+ (CASE WHEN $order_by = '${c.field}' AND $is_desc IS true THEN "${c.field}"::text END) DESC`).join(",\n")}`;
1065
+ V = `($quicksearch = '' OR CONCAT(${U.join(", ")}) ILIKE '%' || $quicksearch || '%')`, H += `SELECT ${U.join(", ")} FROM ${c}\n`, H += ` WHERE ${R ? `${R} AND` : ""} ${V}\n`, H += ` ORDER BY ${z}\n`, H += " LIMIT $limit::INT OFFSET $offset::INT";
1066
+ break;
1067
+ }
1068
+ default: throw Error("Unsupported database type");
1069
+ }
1070
+ return H;
1071
+ }
1072
+ function coerceToNumber(c) {
1073
+ return typeof c == "number" ? c : typeof c == "string" ? parseInt(c, 10) : 0;
1074
+ }
1075
+ function getSelectInput(c, L, R, z, B) {
1076
+ if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L || !R?.length) return;
1077
+ let V = c.type === "ducklake" ? "duckdb" : c.resourceType, H = makeSelectQuery(L, R, z, V, B);
1078
+ return c.type === "ducklake" && (H = wrapDucklakeQuery(H, c.ducklake)), {
1079
+ runnable: {
1080
+ name: "AppDbExplorer",
1081
+ type: "runnableByName",
1082
+ inlineScript: {
1083
+ content: H,
1084
+ language: getLanguageByResourceType(V)
1085
+ }
1086
+ },
1087
+ fields: c.type === "database" ? { database: {
1088
+ type: "static",
1089
+ value: `$res:${c.resourcePath}`,
1090
+ fieldType: "object",
1091
+ format: `resource-${V}`
1092
+ } } : {},
1093
+ type: "runnable",
1094
+ fieldType: "object",
1095
+ hideRefreshButton: !0
1096
+ };
1097
+ }
1098
+ function makeUpdateQuery(c, L, R, z) {
1099
+ let B = buildParameters([{
1100
+ field: "value_to_update",
1101
+ datatype: L.datatype
1102
+ }, ...z === "snowflake" ? R.flatMap((c) => [c, c]) : R], z);
1103
+ switch (B += "\n", z) {
1104
+ case "postgresql": {
1105
+ 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 ");
1106
+ return B += `\nUPDATE ${c} SET ${L.field} = $1::text::${L.datatype} \nWHERE ${z} RETURNING 1`, B;
1107
+ }
1108
+ case "mysql": {
1109
+ let z = R.map((c) => `(:${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = :${c.field})`).join("\n AND ");
1110
+ return B += `\nUPDATE ${c} SET ${L.field} = :value_to_update \nWHERE ${z}`, B;
1111
+ }
1112
+ case "ms_sql_server": {
1113
+ 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 ");
1114
+ return B += `\nUPDATE ${c} SET ${L.field} = @p1 \nWHERE ${z}`, B;
1115
+ }
1116
+ case "snowflake": {
1117
+ let z = R.map((c, L) => `(? = 'null' AND ${c.field} IS NULL OR ${c.field} = ?)`).join("\n AND ");
1118
+ return B += `\nUPDATE ${c} SET ${L.field} = ? \nWHERE ${z}`, B;
1119
+ }
1120
+ case "bigquery": {
1121
+ 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 ");
1122
+ return B += `\nUPDATE ${c} SET ${L.field} = @value_to_update \nWHERE ${z}`, B;
1123
+ }
1124
+ case "duckdb": {
1125
+ let z = R.map((c) => `($${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${c.field})`).join("\n AND ");
1126
+ return B += `\nUPDATE ${c} SET ${L.field} = $value_to_update \nWHERE ${z}`, B;
1127
+ }
1128
+ default: throw Error("Unsupported database type");
1129
+ }
1130
+ }
1131
+ function getUpdateInput(c, L, R, z) {
1132
+ if (c.type == "ducklake" && !c.ducklake || c.type == "database" && !c.resourcePath || !L) return;
1133
+ let B = c.type === "ducklake" ? "duckdb" : c.resourceType, V = makeUpdateQuery(L, R, z, B);
1134
+ return c.type === "ducklake" && (V = wrapDucklakeQuery(V, c.ducklake)), {
1135
+ runnable: {
1136
+ name: "AppDbExplorer",
1137
+ type: "runnableByName",
1138
+ inlineScript: {
1139
+ content: V,
1140
+ language: getLanguageByResourceType(B),
1141
+ schema: {
1142
+ $schema: "https://json-schema.org/draft/2020-12/schema",
1143
+ properties: {},
1144
+ required: ["database"],
1145
+ type: "object"
1146
+ }
1147
+ }
1148
+ },
1149
+ fields: c.type === "database" ? { database: {
1150
+ type: "static",
1151
+ value: `$res:${c.resourcePath}`,
1152
+ fieldType: "object",
1153
+ format: `resource-${B}`
1154
+ } } : {},
1155
+ type: "runnable",
1156
+ fieldType: "object"
1157
+ };
1158
+ }
1159
+ function findGridItemById(c, L, R) {
1160
+ for (let z of allItems(c, L)) if (z.id === R) return z;
1161
+ }
1162
+ function allItems(c, L) {
1163
+ return L == null ? c ?? [] : [...c ?? [], ...Object.values(L).flat()];
1164
+ }
1165
+ function findGridItem(c, L) {
1166
+ return findGridItemById(c.grid, c.subgrids, L);
1167
+ }
1168
+ function collectOneOfFields(c, L) {
1169
+ return Object.fromEntries(Object.entries(c ?? {}).filter(([c, L]) => L.type == "evalv2").map(([c, R]) => {
1170
+ let z = R;
1171
+ if (!z.connections || z.connections.length !== 1) return [c, void 0];
1172
+ let B = z.connections[0], V = findGridItem(L, B.componentId);
1173
+ if (z.expr !== B.componentId + "." + B.id) return [c, void 0];
1174
+ if (V) {
1175
+ let L = V.data;
1176
+ if (L && (L.type === "resourceselectcomponent" || L.type === "selectcomponent" || L.type === "multiselectcomponent" || L.type === "multiselectcomponentv2")) {
1177
+ if ((L.type === "selectcomponent" || L.type === "multiselectcomponent" || L.type === "multiselectcomponentv2") && L.configuration?.create?.type === "static" && L.configuration?.create?.value === !0) return [c, void 0];
1178
+ if (L.configuration?.items?.type === "static") {
1179
+ let R = L.configuration.items.value;
1180
+ 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)];
1181
+ }
1182
+ }
1183
+ }
1184
+ return [c, void 0];
1185
+ }).filter(([c, L]) => L !== void 0));
1186
+ }
1187
+ function filenameExprToRegex(c) {
1188
+ return `^${c.replaceAll("${file.name}", "<file_name>").slice(1, -1).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replaceAll("<file_name>", "[^/]+")}$`;
1189
+ }
1190
+ function staticToRegex(c) {
1191
+ return `^${c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`;
1192
+ }
1193
+ function checkIfExprIsString(c) {
1194
+ return /^(['"`])[^'"`]*\1$/g.test(c);
1195
+ }
1196
+ function checkIfEvalIsStringWithFilename(c) {
1197
+ return c.connections.length > 0 ? !1 : checkIfExprIsString(c.expr.replaceAll("${file.name}", ""));
1198
+ }
1199
+ function removeResourcePrefix(c) {
1200
+ return c.replace(/^\$res:/, "");
1201
+ }
1202
+ function computeWorkspaceS3FileInputPolicy() {
1203
+ return {
1204
+ allow_workspace_resource: !0,
1205
+ allowed_resources: [],
1206
+ allow_user_resources: !1,
1207
+ file_key_regex: ""
1208
+ };
1209
+ }
1210
+ function computeS3FileInputPolicy(c, L) {
1211
+ 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 = "^.*$";
1212
+ return z && (z.type === "static" ? U = staticToRegex(z.value) : z.type === "evalv2" && checkIfEvalIsStringWithFilename(z) && (U = filenameExprToRegex(z.expr))), {
1213
+ allow_workspace_resource: B,
1214
+ allowed_resources: V,
1215
+ allow_user_resources: H,
1216
+ file_key_regex: U
1217
+ };
1218
+ }
1219
+ function isPartialS3Object(c) {
1220
+ return typeof c == "object" && !!c && typeof c.s3 == "string";
1221
+ }
1222
+ function computeS3ImageViewerPolicy(c) {
1223
+ if (c.source.type === "uploadS3" && isPartialS3Object(c.source.value)) return {
1224
+ s3_path: c.source.value.s3,
1225
+ storage: c.source.value.storage
1226
+ };
1227
+ 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 {
1228
+ s3_path: c.source.value.replace("s3://", ""),
1229
+ storage: void 0
1230
+ };
1231
+ }
1232
+ function collectStaticFields(c) {
1233
+ return Object.fromEntries(Object.entries(c ?? {}).filter(([c, L]) => L.type == "static").map(([c, L]) => [c, L.value]));
1234
+ }
1235
+ var import_build = /* @__PURE__ */ __toESM(require_build());
1236
+ async function updatePolicy(c, L) {
1237
+ let R = allItems(c.grid, c.subgrids), z = await Promise.all(R.flatMap((L) => {
1238
+ let R = L.data, z = [{
1239
+ input: R.componentInput,
1240
+ id: L.id
1241
+ }];
1242
+ if (R.type === "tablecomponent" && z.push(...R.actionButtons.map((c) => ({
1243
+ input: c.componentInput,
1244
+ id: c.id
1245
+ }))), (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) => ({
1246
+ input: c.componentInput,
1247
+ id: c.id
1248
+ }))), R.type === "menucomponent" && z.push(...R.menuItems.map((c) => ({
1249
+ input: c.componentInput,
1250
+ id: c.id
1251
+ }))), R.type === "dbexplorercomponent") {
1252
+ let c = [], B = R.configuration, V = B?.type?.selected, H = B?.type?.configuration?.[V];
1253
+ if (H && V) {
1254
+ 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;
1255
+ if (G && K && q) {
1256
+ let c = W ? {
1257
+ type: "ducklake",
1258
+ ducklake: K
1259
+ } : {
1260
+ type: "database",
1261
+ resourcePath: K,
1262
+ resourceType: V
1263
+ };
1264
+ z.push({
1265
+ input: getSelectInput(c, G, q, J),
1266
+ id: L.id
1267
+ }), z.push({
1268
+ input: getCountInput(c, G, q, J),
1269
+ id: L.id + "_count"
1270
+ }), z.push({
1271
+ input: getInsertInput(c, G, q),
1272
+ id: L.id + "_insert"
1273
+ });
1274
+ let R = getPrimaryKeys(q), H = q?.filter((c) => R.includes(c.field));
1275
+ z.push({
1276
+ input: getDeleteInput(c, G, H),
1277
+ id: L.id + "_delete"
1278
+ }), q.filter((c) => c.editable || B.allEditable.value).forEach((R) => {
1279
+ z.push({
1280
+ input: getUpdateInput(c, G, R, H),
1281
+ id: L.id + "_update"
1282
+ });
1283
+ });
1284
+ }
1285
+ }
1286
+ z.push(...c);
1287
+ }
1288
+ return z.filter((c) => c.input).map(async (L) => {
1289
+ if (L.input?.type == "runnable") return await processRunnable(L.id, L.input.runnable, L.input.fields, c);
1290
+ });
1291
+ }).concat(Object.values(c.hiddenInlineScripts ?? {}).map(async (L, R) => await processRunnable("bg_" + R, L, L.fields, c)))), B = Object.fromEntries(z.filter(Boolean)), V = R.filter((c) => c.data.type === "s3fileinputcomponent").map((L) => {
1292
+ let R = L.data.configuration;
1293
+ return computeS3FileInputPolicy(R?.type?.configuration?.s3, c);
1294
+ }).filter(Boolean);
1295
+ R.findIndex((c) => {
1296
+ let L = c.data;
1297
+ if (L.type === "schemaformcomponent" || L.type === "formbuttoncomponent" || L.type === "formcomponent") {
1298
+ let c = L.type === "schemaformcomponent" ? L.componentInput?.value?.properties : L.componentInput?.runnable?.type === "runnableByName" ? L.componentInput?.runnable?.inlineScript?.schema?.properties : L.componentInput?.runnable?.schema?.properties;
1299
+ 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;
1300
+ } else return !1;
1301
+ }) !== -1 && V.push(computeWorkspaceS3FileInputPolicy());
1302
+ let H = R.filter((c) => c.data.type === "imagecomponent").map((c) => {
1303
+ let L = c.data.configuration;
1304
+ return computeS3ImageViewerPolicy(L);
1305
+ }).filter(Boolean);
1306
+ return {
1307
+ ...L ?? {},
1308
+ allowed_s3_keys: H,
1309
+ s3_inputs: V,
1310
+ triggerables_v2: B
1311
+ };
1312
+ }
1313
+ async function processRunnable(c, L, R, z) {
1314
+ let B = collectStaticFields(R), V = collectOneOfFields(R, z), H = Object.entries(R).map(([c, L]) => L.allowUserResources ? c : void 0).filter(Boolean);
1315
+ if (L?.type == "runnableByName") {
1316
+ let R = await hash(L.inlineScript?.content);
1317
+ return console.log("hex", R, c), [`${c}:rawscript/${R}`, {
1318
+ static_inputs: B,
1319
+ one_of_inputs: V,
1320
+ allow_user_resources: H
1321
+ }];
1322
+ } else if (L?.type == "runnableByPath") return [`${c}:${L.runType === "hubscript" ? "script" : L.runType}/${L.path}`, {
1323
+ static_inputs: B,
1324
+ one_of_inputs: V,
1325
+ allow_user_resources: H
1326
+ }];
1327
+ }
1328
+ async function hash(c) {
1329
+ try {
1330
+ let L = new TextEncoder().encode(c), R = await crypto.subtle.digest("SHA-256", L);
1331
+ return Array.from(new Uint8Array(R)).map((c) => c.toString(16).padStart(2, "0")).join("");
1332
+ } catch {
1333
+ let L = new import_build.Sha256();
1334
+ return L.update(c ?? ""), Array.from(await L.digest()).map((c) => c.toString(16).padStart(2, "0")).join("");
1335
+ }
1336
+ }
1337
+ export { updatePolicy };