@plitzi/sdk-shared 0.39.0 → 0.39.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 (508) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  3. package/dist/actions/access.mjs +1 -2
  4. package/dist/actions/cron.mjs +1 -2
  5. package/dist/actions/failureHandler.mjs +1 -2
  6. package/dist/actions/flowDelay.d.ts +6 -0
  7. package/dist/actions/flowDelay.mjs +3 -0
  8. package/dist/actions/functions.d.ts +6 -3
  9. package/dist/actions/functions.mjs +12 -8
  10. package/dist/actions/index.d.ts +2 -1
  11. package/dist/actions/index.mjs +10 -9
  12. package/dist/actions/jobs.mjs +1 -2
  13. package/dist/actions/smtp.mjs +1 -2
  14. package/dist/actions/triggerParams.mjs +1 -2
  15. package/dist/actions/triggers.mjs +1 -2
  16. package/dist/actions/validateDocument.mjs +133 -123
  17. package/dist/activity/describe.mjs +1 -2
  18. package/dist/activity/guard.mjs +1 -2
  19. package/dist/activity/types.mjs +1 -2
  20. package/dist/auth/failureChannel.mjs +1 -2
  21. package/dist/auth/visitorRoles.mjs +1 -2
  22. package/dist/authoring/builder.mjs +1 -2
  23. package/dist/authoring/declare.mjs +1 -2
  24. package/dist/authoring/elementCallbacks.mjs +1 -2
  25. package/dist/authoring/index.mjs +3 -3
  26. package/dist/authoring/paramSpec.mjs +1 -2
  27. package/dist/authoring/spaceCallbacks.mjs +1 -2
  28. package/dist/builder/contexts/BuilderContext.mjs +1 -2
  29. package/dist/builder/contexts/index.mjs +1 -2
  30. package/dist/conditions/dates.d.ts +2 -0
  31. package/dist/conditions/dates.mjs +12 -0
  32. package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
  33. package/dist/conditions/evaluateRuleGroup.mjs +4 -0
  34. package/dist/conditions/evaluator.d.ts +39 -0
  35. package/dist/conditions/evaluator.mjs +75 -0
  36. package/dist/conditions/index.d.ts +10 -0
  37. package/dist/conditions/index.mjs +5 -0
  38. package/dist/conditions/rules.d.ts +3 -0
  39. package/dist/conditions/rules.mjs +3 -0
  40. package/dist/conditions/types.d.ts +44 -0
  41. package/dist/connectors/constants.mjs +1 -2
  42. package/dist/connectors/manifestTokens.mjs +1 -2
  43. package/dist/connectors/presets.mjs +1 -2
  44. package/dist/connectors/validateManifest.mjs +56 -57
  45. package/dist/dataSource/computed.mjs +16 -17
  46. package/dist/dataSource/getBindingsDetails.d.ts +5 -6
  47. package/dist/dataSource/getBindingsDetails.mjs +65 -40
  48. package/dist/dataSource/globalSources.d.ts +1 -1
  49. package/dist/dataSource/globalSources.mjs +1 -2
  50. package/dist/dataSource/helpers/getSourceName.mjs +1 -2
  51. package/dist/dataSource/index.mjs +5 -5
  52. package/dist/dataSource/utility/arrayMap.mjs +2 -2
  53. package/dist/dataSource/utility/capitalize.mjs +1 -2
  54. package/dist/dataSource/utility/checkboxParams.mjs +1 -2
  55. package/dist/dataSource/utility/dateConverter.mjs +0 -1
  56. package/dist/dataSource/utility/index.mjs +15 -16
  57. package/dist/dataSource/utility/not.mjs +1 -2
  58. package/dist/dataSource/utility/staticValue.mjs +0 -1
  59. package/dist/dataSource/utility/stringToArray.mjs +0 -1
  60. package/dist/dataSource/utility/styleSelector.mjs +1 -2
  61. package/dist/dataSource/utility/styleVariant.mjs +2 -3
  62. package/dist/dataSource/utility/truthiness.mjs +1 -2
  63. package/dist/dataSource/utility/twigTemplate.mjs +0 -1
  64. package/dist/dataSource/variables/resolveVariables.mjs +2 -3
  65. package/dist/dates/formatDate.mjs +29 -30
  66. package/dist/dates/isDate.mjs +1 -2
  67. package/dist/devTools/chrome.mjs +1 -2
  68. package/dist/devTools/debugCookie.mjs +1 -2
  69. package/dist/devTools/index.mjs +5 -5
  70. package/dist/devTools/interactionLog.mjs +1 -2
  71. package/dist/devTools/react/DevToolsContext.mjs +1 -2
  72. package/dist/devTools/sight/sight.mjs +1 -2
  73. package/dist/devTools/utils/PlitziConsole.mjs +1 -2
  74. package/dist/elements/ComponentContext.mjs +1 -2
  75. package/dist/flags/flagsCookie.mjs +5 -6
  76. package/dist/flags/index.d.ts +1 -0
  77. package/dist/flags/index.mjs +4 -3
  78. package/dist/flags/overrides.d.ts +36 -0
  79. package/dist/flags/overrides.mjs +13 -0
  80. package/dist/flags/react/useFlagResolution.mjs +5 -6
  81. package/dist/flags/resolveFlags.d.ts +1 -1
  82. package/dist/flags/resolveFlags.mjs +2 -3
  83. package/dist/flags/schemaFlag.mjs +1 -2
  84. package/dist/functions/contract.d.ts +326 -0
  85. package/dist/functions/contract.mjs +3 -0
  86. package/dist/functions/index.d.ts +15 -0
  87. package/dist/functions/index.mjs +9 -0
  88. package/dist/functions/kv.d.ts +80 -0
  89. package/dist/functions/kvChange.d.ts +67 -0
  90. package/dist/functions/kvChange.mjs +24 -0
  91. package/dist/functions/later.d.ts +18 -0
  92. package/dist/functions/messages.d.ts +4 -0
  93. package/dist/functions/messages.mjs +205 -0
  94. package/dist/functions/protocol.d.ts +416 -0
  95. package/dist/functions/protocol.mjs +37 -0
  96. package/dist/functions/rateLimit.d.ts +17 -0
  97. package/dist/functions/rateLimit.mjs +0 -0
  98. package/dist/functions/refusal.d.ts +26 -0
  99. package/dist/functions/refusal.mjs +11 -0
  100. package/dist/functions/runtime.d.ts +44 -0
  101. package/dist/functions/runtime.mjs +13 -0
  102. package/dist/functions/sizes.d.ts +27 -0
  103. package/dist/functions/sizes.mjs +7 -0
  104. package/dist/functions/wire.d.ts +11 -0
  105. package/dist/functions/wire.mjs +39 -0
  106. package/dist/helpers/canonicalJson.mjs +1 -2
  107. package/dist/helpers/clipboard.mjs +1 -2
  108. package/dist/helpers/cookies.mjs +1 -2
  109. package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
  110. package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
  111. package/dist/helpers/deepEqual/index.d.ts +1 -0
  112. package/dist/helpers/deepEqual/index.mjs +1 -0
  113. package/dist/helpers/eventTarget.mjs +1 -2
  114. package/dist/helpers/fetchManifest.mjs +1 -2
  115. package/dist/helpers/images.mjs +1 -2
  116. package/dist/helpers/index.d.ts +4 -6
  117. package/dist/helpers/index.mjs +24 -20
  118. package/dist/helpers/interval.mjs +1 -2
  119. package/dist/helpers/isRecord.mjs +1 -2
  120. package/dist/helpers/keys.mjs +1 -2
  121. package/dist/helpers/lodash/camelCase.d.ts +1 -0
  122. package/dist/helpers/lodash/camelCase.mjs +7 -0
  123. package/dist/helpers/lodash/capitalize.d.ts +1 -0
  124. package/dist/helpers/lodash/capitalize.mjs +5 -0
  125. package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
  126. package/dist/helpers/lodash/cloneDeep.mjs +53 -0
  127. package/dist/helpers/lodash/get.d.ts +11 -0
  128. package/dist/helpers/lodash/get.mjs +14 -0
  129. package/dist/helpers/lodash/has.d.ts +2 -0
  130. package/dist/helpers/lodash/has.mjs +12 -0
  131. package/dist/helpers/lodash/index.d.ts +11 -0
  132. package/dist/helpers/lodash/index.mjs +7 -0
  133. package/dist/helpers/lodash/omit.d.ts +4 -0
  134. package/dist/helpers/lodash/omit.mjs +35 -0
  135. package/dist/helpers/lodash/set.d.ts +2 -0
  136. package/dist/helpers/lodash/set.mjs +20 -0
  137. package/dist/helpers/lodash/shared.d.ts +2 -0
  138. package/dist/helpers/lodash/shared.mjs +37 -0
  139. package/dist/helpers/reducerOrigin.mjs +1 -2
  140. package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
  141. package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
  142. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
  143. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
  144. package/dist/helpers/resources.d.ts +21 -0
  145. package/dist/helpers/resources.mjs +40 -0
  146. package/dist/helpers/scroll.mjs +1 -2
  147. package/dist/helpers/security.d.ts +15 -0
  148. package/dist/helpers/security.mjs +8 -4
  149. package/dist/helpers/spaceRoot.mjs +1 -2
  150. package/dist/helpers/syntaxHighlight.mjs +1 -2
  151. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
  152. package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
  153. package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
  154. package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
  155. package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
  156. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
  157. package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
  158. package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
  159. package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
  160. package/dist/helpers/twigWrapper/charClass.mjs +1 -2
  161. package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
  162. package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
  163. package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
  164. package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
  165. package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
  166. package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
  167. package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
  168. package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
  169. package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
  170. package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
  171. package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
  172. package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
  173. package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
  174. package/dist/helpers/twigWrapper/index.mjs +8 -8
  175. package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
  176. package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
  177. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
  178. package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
  179. package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
  180. package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
  181. package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
  182. package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
  183. package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
  184. package/dist/helpers/utils.mjs +2 -3
  185. package/dist/history/describe.mjs +1 -2
  186. package/dist/history/diff.mjs +1 -2
  187. package/dist/hooks/index.mjs +5 -5
  188. package/dist/hooks/useFontHead.mjs +1 -2
  189. package/dist/hooks/useNetwork.mjs +1 -2
  190. package/dist/hooks/usePlitzi.d.ts +7 -6
  191. package/dist/hooks/usePlitzi.mjs +1 -2
  192. package/dist/hooks/useStableValue.mjs +5 -6
  193. package/dist/navigation/index.mjs +3 -3
  194. package/dist/navigation/matchPath.mjs +19 -11
  195. package/dist/navigation/routes.mjs +57 -38
  196. package/dist/navigation/sitemap.mjs +9 -10
  197. package/dist/network/entitlements.d.ts +21 -0
  198. package/dist/network/entitlements.mjs +1 -2
  199. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
  200. package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
  201. package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
  202. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
  203. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
  204. package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
  205. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
  206. package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
  207. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
  208. package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
  209. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
  210. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
  211. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
  212. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
  213. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
  214. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
  215. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
  216. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
  217. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
  218. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
  219. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
  220. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
  221. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
  222. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
  223. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
  224. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
  225. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
  226. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
  227. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
  228. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
  229. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
  230. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
  231. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
  232. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
  233. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
  234. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
  235. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
  236. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
  237. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
  238. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
  239. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
  240. package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
  241. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
  242. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
  243. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
  244. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
  245. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
  246. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
  247. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
  248. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
  249. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
  250. package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
  251. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
  252. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
  253. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
  254. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
  255. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
  256. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
  257. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
  258. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
  259. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
  260. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
  261. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
  262. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
  263. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
  264. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
  265. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
  266. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
  267. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
  268. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
  269. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
  270. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
  271. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
  272. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
  273. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
  274. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
  275. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
  276. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
  277. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
  278. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
  279. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
  280. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
  281. package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
  282. package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
  283. package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
  284. package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
  285. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
  286. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
  287. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
  288. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
  289. package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
  290. package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
  291. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
  292. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
  293. package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
  294. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
  295. package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
  296. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
  297. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
  298. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
  299. package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
  300. package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
  301. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
  302. package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
  303. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
  304. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
  305. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
  306. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
  307. package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
  308. package/dist/network/graphql/builder/Queries/index.mjs +37 -38
  309. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
  310. package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
  311. package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
  312. package/dist/network/graphql/index.d.ts +0 -1
  313. package/dist/network/graphql/index.mjs +1 -3
  314. package/dist/network/index.d.ts +1 -5
  315. package/dist/network/index.mjs +7 -11
  316. package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
  317. package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
  318. package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
  319. package/dist/network/react/NetworkInternalContext.mjs +4 -0
  320. package/dist/network/react/index.d.ts +5 -0
  321. package/dist/network/react/index.mjs +3 -0
  322. package/dist/network/spaceEvents.mjs +16 -17
  323. package/dist/plugins/bundle/bundle.mjs +1 -2
  324. package/dist/plugins/declaration.mjs +1 -2
  325. package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
  326. package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
  327. package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
  328. package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
  329. package/dist/plugins/react/PluginsContext.mjs +6 -3
  330. package/dist/plugins/react/index.d.ts +3 -0
  331. package/dist/plugins/react/index.mjs +4 -1
  332. package/dist/project/index.mjs +7 -7
  333. package/dist/project/layout/check.mjs +26 -27
  334. package/dist/project/layout/codes.mjs +1 -2
  335. package/dist/project/layout/contents.mjs +12 -13
  336. package/dist/project/layout/files.mjs +1 -2
  337. package/dist/project/layout/folders.mjs +43 -44
  338. package/dist/project/layout/index.mjs +3 -3
  339. package/dist/project/layout/plugins.mjs +56 -57
  340. package/dist/project/layout/vendor.mjs +14 -15
  341. package/dist/project/network.mjs +1 -2
  342. package/dist/project/pages/index.mjs +1 -2
  343. package/dist/project/paths/index.d.ts +8 -2
  344. package/dist/project/paths/index.mjs +3 -4
  345. package/dist/project/root.mjs +1 -2
  346. package/dist/queries/index.mjs +1 -2
  347. package/dist/queries/queryCache.mjs +1 -2
  348. package/dist/queries/serverQueries.mjs +1 -2
  349. package/dist/queries/useQuery.mjs +1 -2
  350. package/dist/queries/useServerQuery.mjs +1 -2
  351. package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
  352. package/dist/react/generateFacade.d.ts +1 -0
  353. package/dist/{helpers → react}/generateFacade.mjs +4 -5
  354. package/dist/react/index.d.ts +8 -0
  355. package/dist/react/index.mjs +4 -0
  356. package/dist/{helpers → react}/sharedContext.mjs +0 -1
  357. package/dist/realtime/client.mjs +3 -4
  358. package/dist/realtime/index.mjs +4 -4
  359. package/dist/realtime/presence.mjs +1 -2
  360. package/dist/realtime/topics.mjs +1 -2
  361. package/dist/runs/index.mjs +1 -2
  362. package/dist/runs/report.mjs +1 -2
  363. package/dist/schema/anchor.mjs +1 -2
  364. package/dist/schema/index.mjs +18 -18
  365. package/dist/schema/layoutChain.mjs +1 -2
  366. package/dist/schema/markdownHeadings.mjs +1 -2
  367. package/dist/schema/motion.mjs +1 -2
  368. package/dist/schema/motionReveal.mjs +1 -2
  369. package/dist/schema/pageAccess.d.ts +9 -0
  370. package/dist/schema/pageAccess.mjs +42 -36
  371. package/dist/schema/pageElements.d.ts +3 -1
  372. package/dist/schema/pageElements.mjs +9 -3
  373. package/dist/schema/pageHead.d.ts +5 -2
  374. package/dist/schema/pageHead.mjs +3 -4
  375. package/dist/schema/providerAnswer.mjs +1 -2
  376. package/dist/schema/providerWhen.d.ts +1 -1
  377. package/dist/schema/providerWhen.mjs +6 -7
  378. package/dist/schema/react/SchemaContext.mjs +1 -2
  379. package/dist/schema/schemaConstants.mjs +1 -2
  380. package/dist/schema/schemaSettings.d.ts +1 -1
  381. package/dist/schema/schemaSettings.mjs +2 -3
  382. package/dist/schema/serverElements.d.ts +0 -24
  383. package/dist/schema/serverElements.mjs +60 -39
  384. package/dist/schema/serverInput.mjs +23 -24
  385. package/dist/schema/serverQuery.d.ts +15 -5
  386. package/dist/schema/serverQuery.mjs +47 -35
  387. package/dist/schema/snippet.mjs +1 -2
  388. package/dist/schema/wire.mjs +1 -2
  389. package/dist/security/index.d.ts +49 -0
  390. package/dist/security/index.mjs +44 -0
  391. package/dist/server/actions/useActionsSync.mjs +1 -2
  392. package/dist/server/actions/useImagesSync.mjs +1 -2
  393. package/dist/server/actions/useRealtimeSync.mjs +1 -2
  394. package/dist/server/index.mjs +7 -7
  395. package/dist/server/rsc/refreshRsc.mjs +23 -24
  396. package/dist/server/rsc/useRscRefresh.mjs +1 -2
  397. package/dist/server/rsc/useRscSync.mjs +1 -2
  398. package/dist/server/usePluginRoute.mjs +1 -2
  399. package/dist/source/export.d.ts +1 -1
  400. package/dist/source/export.mjs +1 -2
  401. package/dist/source/import.mjs +1 -2
  402. package/dist/source/index.mjs +4 -4
  403. package/dist/source/snapshot.mjs +1 -2
  404. package/dist/state/index.d.ts +0 -1
  405. package/dist/state/index.mjs +1 -3
  406. package/dist/state/paintedState.d.ts +20 -4
  407. package/dist/state/paintedState.mjs +21 -21
  408. package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
  409. package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
  410. package/dist/store/actionRuns/index.mjs +3 -3
  411. package/dist/store/actionRuns/useActionRuns.mjs +5 -6
  412. package/dist/store/index.d.ts +1 -0
  413. package/dist/store/index.mjs +2 -1
  414. package/dist/store/renderSettings.d.ts +1 -1
  415. package/dist/store/renderSettings.mjs +1 -2
  416. package/dist/store/runtimeStatePersist.mjs +171 -0
  417. package/dist/store/storeHooks.d.ts +45 -45
  418. package/dist/store/storeHooks.mjs +1 -2
  419. package/dist/store/tracing/index.mjs +5 -5
  420. package/dist/store/tracing/preview.mjs +1 -2
  421. package/dist/store/tracing/tracingCollector.d.ts +2 -2
  422. package/dist/store/tracing/tracingCollector.mjs +79 -78
  423. package/dist/store/tracing/tracingMiddleware.mjs +1 -2
  424. package/dist/store/tracing/tracingStore.mjs +1 -2
  425. package/dist/store/tracing/useTracing.mjs +6 -7
  426. package/dist/style/breakpoints.mjs +1 -2
  427. package/dist/style/cssLayers.mjs +1 -2
  428. package/dist/style/displayModes.mjs +1 -2
  429. package/dist/style/fontAssets.mjs +1 -2
  430. package/dist/style/fontValidation.mjs +14 -15
  431. package/dist/style/fonts.d.ts +5 -3
  432. package/dist/style/fonts.mjs +23 -24
  433. package/dist/style/fontsFromCss.mjs +1 -2
  434. package/dist/style/index.mjs +18 -18
  435. package/dist/style/keyframes.mjs +1 -2
  436. package/dist/style/layoutGrid.mjs +1 -2
  437. package/dist/style/notifications.mjs +1 -2
  438. package/dist/style/react/useDisplayMode.mjs +1 -2
  439. package/dist/style/react/useElementSize.mjs +1 -2
  440. package/dist/style/runtimeStyle.d.ts +19 -21
  441. package/dist/style/runtimeStyle.mjs +4 -7
  442. package/dist/style/snippetStyle.mjs +5 -6
  443. package/dist/style/styleConditions.mjs +1 -2
  444. package/dist/style/styleConstants.mjs +1 -2
  445. package/dist/style/stylePseudos.mjs +1 -2
  446. package/dist/style/styleStates.mjs +1 -2
  447. package/dist/style/styleTarget.mjs +24 -25
  448. package/dist/theme/cookie/index.mjs +1 -1
  449. package/dist/theme/cookie/themeCookie.d.ts +21 -1
  450. package/dist/theme/cookie/themeCookie.mjs +19 -4
  451. package/dist/theme/index.d.ts +1 -9
  452. package/dist/theme/index.mjs +1 -6
  453. package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
  454. package/dist/theme/react/ThemeProvider.mjs +78 -0
  455. package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
  456. package/dist/theme/react/ThemeScope.mjs +9 -0
  457. package/dist/theme/react/index.d.ts +9 -0
  458. package/dist/theme/react/index.mjs +5 -0
  459. package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
  460. package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
  461. package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
  462. package/dist/theme/react/useTheme.mjs +19 -0
  463. package/dist/types/ActionTypes.d.ts +33 -0
  464. package/dist/types/AuthTypes.d.ts +6 -0
  465. package/dist/types/CommonTypes.d.ts +14 -3
  466. package/dist/types/DataSourceTypes.d.ts +1 -1
  467. package/dist/types/FunctionTypes.d.ts +16 -6
  468. package/dist/types/InteractionTypes.d.ts +1 -1
  469. package/dist/types/JobTypes.d.ts +56 -182
  470. package/dist/types/PluginTypes.d.ts +8 -1
  471. package/dist/types/SchemaTypes.d.ts +8 -1
  472. package/dist/types/SchemaTypes.mjs +1 -2
  473. package/dist/types/ServerAdapterTypes.d.ts +0 -326
  474. package/dist/types/ServerTypes.d.ts +0 -311
  475. package/dist/types/SpaceTypes.d.ts +5 -2
  476. package/dist/types/StoreTypes.d.ts +9 -3
  477. package/dist/types/StyleTypes.d.ts +6 -0
  478. package/dist/types/StyleTypes.mjs +1 -2
  479. package/dist/types/index.d.ts +0 -3
  480. package/dist/websockets/RTCodec.mjs +1 -2
  481. package/eslint.config.mjs +25 -0
  482. package/package.json +29 -18
  483. package/vite.config.ts +58 -0
  484. package/dist/helpers/generateFacade.d.ts +0 -2
  485. package/dist/helpers/ruleEvaluator.d.ts +0 -16
  486. package/dist/helpers/ruleEvaluator.mjs +0 -5
  487. package/dist/network/NetworkInternalContext.mjs +0 -5
  488. package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
  489. package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
  490. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
  491. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
  492. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
  493. package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
  494. package/dist/network/graphql/sdk/index.d.ts +0 -5
  495. package/dist/network/graphql/sdk/index.mjs +0 -3
  496. package/dist/state/runtimeStatePersist.mjs +0 -119
  497. package/dist/theme/ThemeProvider.mjs +0 -69
  498. package/dist/theme/ThemeScope.mjs +0 -10
  499. package/dist/theme/useTheme.mjs +0 -20
  500. package/dist/types/OAuthTypes.d.ts +0 -246
  501. package/dist/types/ServerConfigTypes.d.ts +0 -527
  502. package/dist/types/ServerLogTypes.d.ts +0 -119
  503. /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
  504. /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
  505. /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
  506. /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
  507. /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
  508. /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @plitzi/sdk-shared
2
2
 
3
+ ## 0.39.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fad1264: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
8
+ `@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
9
+
10
+ ## 0.39.1
11
+
12
+ ### Patch Changes
13
+
14
+ - f174a61: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
15
+ `@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
16
+
3
17
  ## 0.39.0
4
18
 
5
19
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var e = Object.defineProperty, t = (t, n) => {
3
3
  let r = {};
4
4
  for (var i in t) e(r, i, {
@@ -7,5 +7,4 @@ var e = Object.defineProperty, t = (t, n) => {
7
7
  });
8
8
  return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
9
  };
10
- //#endregion
11
10
  export { t as __exportAll };
@@ -1,5 +1,5 @@
1
1
  import { isRecord as e } from "../helpers/isRecord.mjs";
2
- //#region src/actions/access.ts
2
+ // src/actions/access.ts
3
3
  var t = (e, t) => {
4
4
  if (!e) return "forbidden";
5
5
  if (e.mode !== "public") {
@@ -18,5 +18,4 @@ var t = (e, t) => {
18
18
  permissions: n.filter((e) => typeof e == "string")
19
19
  };
20
20
  };
21
- //#endregion
22
21
  export { t as accessRefusal, n as actionAccessOf };
@@ -1,4 +1,4 @@
1
- //#region src/actions/cron.ts
1
+ // src/actions/cron.ts
2
2
  var e = [
3
3
  [0, 59],
4
4
  [0, 23],
@@ -95,5 +95,4 @@ var e = [
95
95
  }
96
96
  return a;
97
97
  }, h = (e) => o(/* @__PURE__ */ new Date(), e) !== void 0;
98
- //#endregion
99
98
  export { m as cronFiresBetween, u as cronMatches, p as cronNextFire, h as isKnownTimeZone, n as parseCron, o as zonedClock };
@@ -1,4 +1,3 @@
1
- //#region src/actions/failureHandler.ts
1
+ // src/actions/failureHandler.ts
2
2
  var e = "flow.onFailure";
3
- //#endregion
4
3
  export { e as FAILURE_HANDLER_TASK };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The longest a `flow.delay` step waits, in ms. A run holds a connection and a concurrency slot its whole life, so a
3
+ * longer wait spends both on nothing: anything longer is a schedule, not a step. Read by the step that caps what it is
4
+ * asked to it, saying so on its log, and by the validator that warns of a longer one written as it is.
5
+ */
6
+ export declare const FLOW_DELAY_MAX_MS = 5000;
@@ -0,0 +1,3 @@
1
+ // src/actions/flowDelay.ts
2
+ var e = 5e3;
3
+ export { e as FLOW_DELAY_MAX_MS };
@@ -15,13 +15,16 @@ export declare const PLUGIN_FUNCTIONS_SOURCE = "functions.source.json";
15
15
  /** Where a plugin's route answers: `pluginRoutePath('board', '/layout')` is `/fn/plugins/board/layout`. */
16
16
  export declare const pluginRoutePath: (plugin: string, path?: string) => string;
17
17
  /**
18
- * The CPU and time an invocation gets when its task asks for none: what the server runs it with, and what the builder
19
- * shows as "default". A task asks for more in its `limits`, up to what its deployment allows.
18
+ * The CPU, time and size an invocation gets when its task asks for none: what the server runs it with, and what the
19
+ * builder shows as "default". A task asks for more in its `limits`, up to what its plan and its deployment allow.
20
20
  */
21
- export declare const DEFAULT_FUNCTION_TIME_LIMITS: {
21
+ export declare const DEFAULT_FUNCTION_ASKED_LIMITS: {
22
22
  readonly cpuMs: 100;
23
23
  readonly wallMs: 10000;
24
+ readonly size: "small";
24
25
  };
26
+ /** Every limit a task may ask for, in the order they are written: what the manifest reads and the builder writes. */
27
+ export declare const FUNCTION_ASKED_KEYS: readonly ["cpuMs", "wallMs", "size"];
25
28
  /** Whether a page at `path` would sit where the space's functions answer. */
26
29
  export declare const isFunctionRoutePath: (path: string) => boolean;
27
30
  /**
@@ -1,8 +1,13 @@
1
- //#region src/actions/functions.ts
1
+ // src/actions/functions.ts
2
2
  var e = "/fn", t = "plugins", n = "functions.source.json", r = (e, n = "/") => `/fn/${t}/${encodeURIComponent(e)}${n.startsWith("/") ? n : `/${n}`}`, i = {
3
3
  cpuMs: 100,
4
- wallMs: 1e4
5
- }, a = (e) => e === "/fn" || e.startsWith("/fn/"), o = (e) => /^[A-Za-z0-9_][A-Za-z0-9_./-]*\.(ts|js|mjs|json)$/.test(e) && !e.split("/").some((e) => e === ".." || e === "." || e === ""), s = (e) => !e.includes("/") && /\.(ts|js|mjs)$/.test(e) && !/\.(test|spec)\.(ts|js|mjs)$/.test(e) && !e.endsWith(".d.ts"), c = (e) => /^\s*export\s+default\b|\bas\s+default\s*[,}]/m.test(e), l = (e) => /\.(test|spec|fixture)\.[A-Za-z0-9]+$/.test(e), u = async (e, t) => {
4
+ wallMs: 1e4,
5
+ size: "small"
6
+ }, a = [
7
+ "cpuMs",
8
+ "wallMs",
9
+ "size"
10
+ ], o = (e) => e === "/fn" || e.startsWith("/fn/"), s = (e) => /^[A-Za-z0-9_][A-Za-z0-9_./-]*\.(ts|js|mjs|json)$/.test(e) && !e.split("/").some((e) => e === ".." || e === "." || e === ""), c = (e) => !e.includes("/") && /\.(ts|js|mjs)$/.test(e) && !/\.(test|spec)\.(ts|js|mjs)$/.test(e) && !e.endsWith(".d.ts"), l = (e) => /^\s*export\s+default\b|\bas\s+default\s*[,}]/m.test(e), u = (e) => /\.(test|spec|fixture)\.[A-Za-z0-9]+$/.test(e), d = async (e, t) => {
6
11
  let n = {}, r = async (i) => {
7
12
  let a;
8
13
  try {
@@ -10,12 +15,11 @@ var e = "/fn", t = "plugins", n = "functions.source.json", r = (e, n = "/") => `
10
15
  } catch {
11
16
  return;
12
17
  }
13
- for (let s of a) {
14
- let a = i ? `${i}/${s.name}` : s.name;
15
- s.directory ? s.name !== "node_modules" && !s.name.startsWith(".") && await r(a) : o(a) && !l(a) && (n[a] = await t.read(`${e}/${a}`));
18
+ for (let o of a) {
19
+ let a = i ? `${i}/${o.name}` : o.name;
20
+ o.directory ? o.name !== "node_modules" && !o.name.startsWith(".") && await r(a) : s(a) && !u(a) && (n[a] = await t.read(`${e}/${a}`));
16
21
  }
17
22
  };
18
23
  return await r(""), n;
19
24
  };
20
- //#endregion
21
- export { i as DEFAULT_FUNCTION_TIME_LIMITS, e as FUNCTION_ROUTES_PREFIX, n as PLUGIN_FUNCTIONS_SOURCE, t as PLUGIN_ROUTES_SEGMENT, c as exportsByDefault, a as isFunctionRoutePath, s as isFunctionsDefinitionFile, o as isFunctionsSourcePath, l as isFunctionsTestPath, r as pluginRoutePath, u as readFunctionsSource };
25
+ export { i as DEFAULT_FUNCTION_ASKED_LIMITS, a as FUNCTION_ASKED_KEYS, e as FUNCTION_ROUTES_PREFIX, n as PLUGIN_FUNCTIONS_SOURCE, t as PLUGIN_ROUTES_SEGMENT, l as exportsByDefault, o as isFunctionRoutePath, c as isFunctionsDefinitionFile, s as isFunctionsSourcePath, u as isFunctionsTestPath, r as pluginRoutePath, d as readFunctionsSource };
@@ -2,7 +2,8 @@ export { accessRefusal, actionAccessOf } from './access';
2
2
  export { JOB_KINDS, JOB_STATUSES, TERMINAL_JOB_STATUSES, isJobKind, isJobStatus, isTerminalJobStatus } from './jobs';
3
3
  export { cronFiresBetween, cronMatches, cronNextFire, isKnownTimeZone, parseCron, zonedClock } from './cron';
4
4
  export { FAILURE_HANDLER_TASK } from './failureHandler';
5
- export { DEFAULT_FUNCTION_TIME_LIMITS, FUNCTION_ROUTES_PREFIX, isFunctionRoutePath, exportsByDefault, isFunctionsDefinitionFile, isFunctionsSourcePath, isFunctionsTestPath, PLUGIN_FUNCTIONS_SOURCE, PLUGIN_ROUTES_SEGMENT, pluginRoutePath, readFunctionsSource } from './functions';
5
+ export { FLOW_DELAY_MAX_MS } from './flowDelay';
6
+ export { DEFAULT_FUNCTION_ASKED_LIMITS, FUNCTION_ASKED_KEYS, FUNCTION_ROUTES_PREFIX, isFunctionRoutePath, exportsByDefault, isFunctionsDefinitionFile, isFunctionsSourcePath, isFunctionsTestPath, PLUGIN_FUNCTIONS_SOURCE, PLUGIN_ROUTES_SEGMENT, pluginRoutePath, readFunctionsSource } from './functions';
6
7
  export { triggerAccess, triggerCacheMs, triggerHasStaleVerify, triggerInput, triggerVerify } from './triggerParams';
7
8
  export { actionName, actionTriggers, isActionEnabled } from './triggers';
8
9
  export { isActionDocument, validateActionDocument } from './validateDocument';
@@ -1,10 +1,11 @@
1
1
  import { accessRefusal as e, actionAccessOf as t } from "./access.mjs";
2
- import { cronFiresBetween as n, cronMatches as r, cronNextFire as i, isKnownTimeZone as a, parseCron as o, zonedClock as s } from "./cron.mjs";
3
- import { FAILURE_HANDLER_TASK as c } from "./failureHandler.mjs";
4
- import { DEFAULT_FUNCTION_TIME_LIMITS as l, FUNCTION_ROUTES_PREFIX as u, PLUGIN_FUNCTIONS_SOURCE as d, PLUGIN_ROUTES_SEGMENT as f, exportsByDefault as p, isFunctionRoutePath as m, isFunctionsDefinitionFile as h, isFunctionsSourcePath as g, isFunctionsTestPath as _, pluginRoutePath as v, readFunctionsSource as y } from "./functions.mjs";
5
- import { JOB_KINDS as b, JOB_STATUSES as x, TERMINAL_JOB_STATUSES as S, isJobKind as C, isJobStatus as w, isTerminalJobStatus as T } from "./jobs.mjs";
6
- import { triggerAccess as E, triggerCacheMs as D, triggerHasStaleVerify as O, triggerInput as k, triggerVerify as A } from "./triggerParams.mjs";
7
- import { actionName as j, actionTriggers as M, isActionEnabled as N } from "./triggers.mjs";
8
- import { isActionDocument as P, validateActionDocument as F } from "./validateDocument.mjs";
9
- import { SMTP_CREDENTIAL_KEYS as I, isSingleEmailAddress as L, readSmtpCredential as R } from "./smtp.mjs";
10
- export { l as DEFAULT_FUNCTION_TIME_LIMITS, c as FAILURE_HANDLER_TASK, u as FUNCTION_ROUTES_PREFIX, b as JOB_KINDS, x as JOB_STATUSES, d as PLUGIN_FUNCTIONS_SOURCE, f as PLUGIN_ROUTES_SEGMENT, I as SMTP_CREDENTIAL_KEYS, S as TERMINAL_JOB_STATUSES, e as accessRefusal, t as actionAccessOf, j as actionName, M as actionTriggers, n as cronFiresBetween, r as cronMatches, i as cronNextFire, p as exportsByDefault, P as isActionDocument, N as isActionEnabled, m as isFunctionRoutePath, h as isFunctionsDefinitionFile, g as isFunctionsSourcePath, _ as isFunctionsTestPath, C as isJobKind, w as isJobStatus, a as isKnownTimeZone, L as isSingleEmailAddress, T as isTerminalJobStatus, o as parseCron, v as pluginRoutePath, y as readFunctionsSource, R as readSmtpCredential, E as triggerAccess, D as triggerCacheMs, O as triggerHasStaleVerify, k as triggerInput, A as triggerVerify, F as validateActionDocument, s as zonedClock };
2
+ import { JOB_KINDS as n, JOB_STATUSES as r, TERMINAL_JOB_STATUSES as i, isJobKind as a, isJobStatus as o, isTerminalJobStatus as s } from "./jobs.mjs";
3
+ import { cronFiresBetween as c, cronMatches as l, cronNextFire as u, isKnownTimeZone as d, parseCron as f, zonedClock as p } from "./cron.mjs";
4
+ import { FAILURE_HANDLER_TASK as m } from "./failureHandler.mjs";
5
+ import { FLOW_DELAY_MAX_MS as h } from "./flowDelay.mjs";
6
+ import { DEFAULT_FUNCTION_ASKED_LIMITS as g, FUNCTION_ASKED_KEYS as _, FUNCTION_ROUTES_PREFIX as v, PLUGIN_FUNCTIONS_SOURCE as y, PLUGIN_ROUTES_SEGMENT as b, exportsByDefault as x, isFunctionRoutePath as S, isFunctionsDefinitionFile as C, isFunctionsSourcePath as w, isFunctionsTestPath as T, pluginRoutePath as E, readFunctionsSource as D } from "./functions.mjs";
7
+ import { triggerAccess as O, triggerCacheMs as k, triggerHasStaleVerify as A, triggerInput as j, triggerVerify as M } from "./triggerParams.mjs";
8
+ import { actionName as N, actionTriggers as P, isActionEnabled as F } from "./triggers.mjs";
9
+ import { isActionDocument as I, validateActionDocument as L } from "./validateDocument.mjs";
10
+ import { SMTP_CREDENTIAL_KEYS as R, isSingleEmailAddress as z, readSmtpCredential as B } from "./smtp.mjs";
11
+ export { g as DEFAULT_FUNCTION_ASKED_LIMITS, m as FAILURE_HANDLER_TASK, h as FLOW_DELAY_MAX_MS, _ as FUNCTION_ASKED_KEYS, v as FUNCTION_ROUTES_PREFIX, n as JOB_KINDS, r as JOB_STATUSES, y as PLUGIN_FUNCTIONS_SOURCE, b as PLUGIN_ROUTES_SEGMENT, R as SMTP_CREDENTIAL_KEYS, i as TERMINAL_JOB_STATUSES, e as accessRefusal, t as actionAccessOf, N as actionName, P as actionTriggers, c as cronFiresBetween, l as cronMatches, u as cronNextFire, x as exportsByDefault, I as isActionDocument, F as isActionEnabled, S as isFunctionRoutePath, C as isFunctionsDefinitionFile, w as isFunctionsSourcePath, T as isFunctionsTestPath, a as isJobKind, o as isJobStatus, d as isKnownTimeZone, z as isSingleEmailAddress, s as isTerminalJobStatus, f as parseCron, E as pluginRoutePath, D as readFunctionsSource, B as readSmtpCredential, O as triggerAccess, k as triggerCacheMs, A as triggerHasStaleVerify, j as triggerInput, M as triggerVerify, L as validateActionDocument, p as zonedClock };
@@ -1,4 +1,4 @@
1
- //#region src/actions/jobs.ts
1
+ // src/actions/jobs.ts
2
2
  var e = [
3
3
  "pending",
4
4
  "running",
@@ -13,5 +13,4 @@ var e = [
13
13
  "dead",
14
14
  "cancelled"
15
15
  ], n = (t) => e.some((e) => e === t), r = (e) => t.some((t) => t === e), i = ["action", "function"], a = (e) => i.some((t) => t === e);
16
- //#endregion
17
16
  export { i as JOB_KINDS, e as JOB_STATUSES, t as TERMINAL_JOB_STATUSES, a as isJobKind, n as isJobStatus, r as isTerminalJobStatus };
@@ -1,4 +1,4 @@
1
- //#region src/actions/smtp.ts
1
+ // src/actions/smtp.ts
2
2
  var e = [
3
3
  "host",
4
4
  "port",
@@ -47,5 +47,4 @@ var e = [
47
47
  problems: []
48
48
  };
49
49
  };
50
- //#endregion
51
50
  export { e as SMTP_CREDENTIAL_KEYS, i as isSingleEmailAddress, s as readSmtpCredential };
@@ -1,5 +1,5 @@
1
1
  import { isRecord as e } from "../helpers/isRecord.mjs";
2
- //#region src/actions/triggerParams.ts
2
+ // src/actions/triggerParams.ts
3
3
  var t = (e) => {
4
4
  if (typeof e == "string" && e.trim() !== "") try {
5
5
  return JSON.parse(e);
@@ -37,5 +37,4 @@ var t = (e) => {
37
37
  let t = Number.parseFloat(e.cacheSeconds ?? "");
38
38
  return Number.isFinite(t) && t > 0 ? Math.round(t * 1e3) : 0;
39
39
  };
40
- //#endregion
41
40
  export { n as triggerAccess, o as triggerCacheMs, a as triggerHasStaleVerify, r as triggerInput, i as triggerVerify };
@@ -1,7 +1,6 @@
1
- //#region src/actions/triggers.ts
1
+ // src/actions/triggers.ts
2
2
  var e = (e) => Object.values(e.nodes).filter((e) => e.type === "trigger"), t = (t) => e(t).some((e) => e.enabled), n = (t) => e(t).find((e) => {
3
3
  let t = e.title.trim();
4
4
  return t !== "" && t !== e.action;
5
5
  })?.title.trim() ?? t.name;
6
- //#endregion
7
6
  export { n as actionName, e as actionTriggers, t as isActionEnabled };
@@ -1,27 +1,28 @@
1
- import { isRecord as e } from "../helpers/isRecord.mjs";
2
- import { isKnownTimeZone as t, parseCron as n } from "./cron.mjs";
3
- import { FAILURE_HANDLER_TASK as r } from "./failureHandler.mjs";
1
+ import { isKnownTimeZone as e, parseCron as t } from "./cron.mjs";
2
+ import { FAILURE_HANDLER_TASK as n } from "./failureHandler.mjs";
3
+ import { FLOW_DELAY_MAX_MS as r } from "./flowDelay.mjs";
4
4
  import { triggerAccess as i, triggerHasStaleVerify as a, triggerVerify as o } from "./triggerParams.mjs";
5
- //#region src/actions/validateDocument.ts
6
- var s = [
5
+ import { isRecord as s } from "../helpers/isRecord.mjs";
6
+ // src/actions/validateDocument.ts
7
+ var c = [
7
8
  "text",
8
9
  "number",
9
10
  "boolean",
10
11
  "date",
11
12
  "json",
12
13
  "file"
13
- ], c = [
14
+ ], l = [
14
15
  "public",
15
16
  "session",
16
17
  "role"
17
- ], l = [
18
+ ], u = [
18
19
  "call",
19
20
  "webhook",
20
21
  "schedule",
21
22
  "later",
22
23
  "render",
23
24
  "custom"
24
- ], u = ["sha256", "sha1"], d = /* @__PURE__ */ new Set([
25
+ ], d = ["sha256", "sha1"], f = /* @__PURE__ */ new Set([
25
26
  "input",
26
27
  "user",
27
28
  "spaceId",
@@ -30,183 +31,183 @@ var s = [
30
31
  "runId",
31
32
  "now",
32
33
  "failure"
33
- ]), f = /^[a-z][a-zA-Z0-9]*\.[a-z][a-zA-Z0-9]*$/, p = (e) => typeof e == "string" && e.trim() !== "", m = (t) => {
34
+ ]), p = /^[a-z][a-zA-Z0-9]*\.[a-z][a-zA-Z0-9]*$/, m = (e) => typeof e == "string" && e.trim() !== "", h = (e) => {
34
35
  try {
35
- let n = JSON.parse(t);
36
- return e(n) ? n : void 0;
36
+ let t = JSON.parse(e);
37
+ return s(t) ? t : void 0;
37
38
  } catch {
38
39
  return;
39
40
  }
40
- }, h = (t, n, r) => {
41
- t !== void 0 && (e(t) ? Object.entries(t).forEach(([t, i]) => {
42
- !e(i) || !p(i.type) ? r.push({
43
- path: `${n}.${t}`,
41
+ }, g = (e, t, n) => {
42
+ e !== void 0 && (s(e) ? Object.entries(e).forEach(([e, r]) => {
43
+ !s(r) || !m(r.type) ? n.push({
44
+ path: `${t}.${e}`,
44
45
  message: "must declare a type"
45
- }) : s.includes(i.type) || r.push({
46
- path: `${n}.${t}.type`,
47
- message: `unknown field type "${i.type}"`,
48
- hint: `one of ${s.join(", ")}`
46
+ }) : c.includes(r.type) || n.push({
47
+ path: `${t}.${e}.type`,
48
+ message: `unknown field type "${r.type}"`,
49
+ hint: `one of ${c.join(", ")}`
49
50
  });
50
- }) : r.push({
51
- path: n,
51
+ }) : n.push({
52
+ path: t,
52
53
  message: "must be an object of field definitions"
53
54
  }));
54
- }, g = (r, s, d, f) => {
55
- let g = `nodes.${r}`, _ = s.action;
56
- if (!p(_) || !l.includes(_)) {
57
- d.push({
58
- path: `${g}.action`,
55
+ }, _ = (n, r, c, f) => {
56
+ let p = `nodes.${n}`, _ = r.action;
57
+ if (!m(_) || !u.includes(_)) {
58
+ c.push({
59
+ path: `${p}.action`,
59
60
  message: `"${String(_)}" is not a way an action can be started`,
60
- hint: `one of ${l.join(", ")}`
61
+ hint: `one of ${u.join(", ")}`
61
62
  });
62
63
  return;
63
64
  }
64
- let v = e(s.params) ? s.params : {};
65
- if (p(v.input)) {
66
- let e = m(v.input);
67
- e === void 0 ? d.push({
68
- path: `${g}.params.input`,
65
+ let v = s(r.params) ? r.params : {};
66
+ if (m(v.input)) {
67
+ let e = h(v.input);
68
+ e === void 0 ? c.push({
69
+ path: `${p}.params.input`,
69
70
  message: "is not valid JSON"
70
- }) : h(e, `${g}.params.input`, d);
71
+ }) : g(e, `${p}.params.input`, c);
71
72
  }
72
73
  if (_ !== "schedule" && _ !== "later") {
73
- if (!p(v.access) || !c.includes(v.access)) d.push({
74
- path: `${g}.params.access`,
74
+ if (!m(v.access) || !l.includes(v.access)) c.push({
75
+ path: `${p}.params.access`,
75
76
  message: "must say who may start a run this way",
76
- hint: `one of ${c.join(", ")}`
77
+ hint: `one of ${l.join(", ")}`
77
78
  });
78
79
  else if (v.access === "role") {
79
80
  let e = i(v);
80
- e?.mode === "role" && e.permissions.length === 0 && d.push({
81
- path: `${g}.params.permissions`,
81
+ e?.mode === "role" && e.permissions.length === 0 && c.push({
82
+ path: `${p}.params.permissions`,
82
83
  message: "role access must name at least one permission"
83
84
  });
84
85
  }
85
86
  }
86
- if (_ === "schedule" && (p(v.cron) ? n(v.cron) || d.push({
87
- path: `${g}.params.cron`,
87
+ if (_ === "schedule" && (m(v.cron) ? t(v.cron) || c.push({
88
+ path: `${p}.params.cron`,
88
89
  message: `"${v.cron}" is not an expression this server can read, so it would never fire`,
89
90
  hint: "five fields — minute hour day-of-month month day-of-week — with *, lists, ranges and steps"
90
- }) : d.push({
91
- path: `${g}.params.cron`,
91
+ }) : c.push({
92
+ path: `${p}.params.cron`,
92
93
  message: "a scheduled trigger needs a cron expression"
93
- }), p(v.timezone) && !t(v.timezone) && d.push({
94
- path: `${g}.params.timezone`,
94
+ }), m(v.timezone) && !e(v.timezone) && c.push({
95
+ path: `${p}.params.timezone`,
95
96
  message: `"${v.timezone}" is not a time zone this server knows, so the schedule would never fire`,
96
97
  hint: "an IANA name like America/Santiago or Europe/Madrid — leave it empty for UTC"
97
- })), p(v.cacheSeconds)) {
98
+ })), m(v.cacheSeconds)) {
98
99
  let e = Number.parseFloat(v.cacheSeconds);
99
- !Number.isFinite(e) || e < 0 ? d.push({
100
- path: `${g}.params.cacheSeconds`,
100
+ !Number.isFinite(e) || e < 0 ? c.push({
101
+ path: `${p}.params.cacheSeconds`,
101
102
  message: "must be a number of seconds, or left empty"
102
103
  }) : _ !== "render" && f.push({
103
- path: `${g}.params.cacheSeconds`,
104
+ path: `${p}.params.cacheSeconds`,
104
105
  message: `a "${_}" trigger is never answered from a cache`,
105
106
  hint: "reuse only applies to a render, where the same page is built for one visitor after another"
106
107
  });
107
108
  }
108
- _ === "custom" && !p(v.name) && d.push({
109
- path: `${g}.params.name`,
109
+ _ === "custom" && !m(v.name) && c.push({
110
+ path: `${p}.params.name`,
110
111
  message: "a custom trigger needs a name to be mounted under"
111
- }), _ === "webhook" && (a(v) && d.push({
112
- path: `${g}.params.signatureCredential`,
112
+ }), _ === "webhook" && (a(v) && c.push({
113
+ path: `${p}.params.signatureCredential`,
113
114
  message: "this signature check is in a format nothing reads any more, so the webhook is unverified",
114
115
  hint: "name the credential holding the signing secret in \"Signing secret\", and its header beside it"
115
116
  }), o(v) || f.push({
116
- path: `${g}.params.signatureCredential`,
117
+ path: `${p}.params.signatureCredential`,
117
118
  message: "this webhook accepts unsigned requests",
118
119
  hint: "name the credential holding the signing secret, and only the sender you expect can start a run"
119
- }), p(v.signatureAlgorithm) && !u.includes(v.signatureAlgorithm) && f.push({
120
- path: `${g}.params.signatureAlgorithm`,
120
+ }), m(v.signatureAlgorithm) && !d.includes(v.signatureAlgorithm) && f.push({
121
+ path: `${p}.params.signatureAlgorithm`,
121
122
  message: `"${v.signatureAlgorithm}" is not an algorithm this server signs with, so sha256 is used`,
122
- hint: `one of ${u.join(", ")}`
123
- }), p(v.signatureToleranceSeconds) && !p(v.signatureTimestampHeader) && f.push({
124
- path: `${g}.params.signatureToleranceSeconds`,
123
+ hint: `one of ${d.join(", ")}`
124
+ }), m(v.signatureToleranceSeconds) && !m(v.signatureTimestampHeader) && f.push({
125
+ path: `${p}.params.signatureToleranceSeconds`,
125
126
  message: "a tolerance with no timestamp header expires nothing",
126
127
  hint: "name the header the sender puts the signing time in, or drop the tolerance"
127
128
  })), _ === "call" && v.access === "public" && f.push({
128
- path: `${g}.params.access`,
129
+ path: `${p}.params.access`,
129
130
  message: "anyone can run this action, including signed-out visitors",
130
131
  hint: "use session access unless the page needs it before anyone signs in"
131
132
  });
132
- }, _ = (t, n, i, a) => {
133
- if (!e(t)) {
134
- i.push({
133
+ }, v = (e, t, r, i) => {
134
+ if (!s(e)) {
135
+ r.push({
135
136
  path: "nodes",
136
137
  message: "must be an object of steps"
137
138
  });
138
139
  return;
139
140
  }
140
- let o = Object.entries(t), s = o.filter(([, t]) => e(t) && t.type === "trigger");
141
- s.length === 0 && i.push({
141
+ let a = Object.entries(e), o = a.filter(([, e]) => s(e) && e.type === "trigger");
142
+ o.length === 0 && r.push({
142
143
  path: "nodes",
143
144
  message: "this action has no way in",
144
145
  hint: "add a trigger step — call, webhook, schedule, render or custom"
145
146
  });
146
147
  let c = /* @__PURE__ */ new Map();
147
- s.forEach(([e, t]) => {
148
- p(t.action) && c.set(t.action, [...c.get(t.action) ?? [], e]);
148
+ o.forEach(([e, t]) => {
149
+ m(t.action) && c.set(t.action, [...c.get(t.action) ?? [], e]);
149
150
  }), c.forEach((e, t) => {
150
- e.length > 1 && i.push({
151
+ e.length > 1 && r.push({
151
152
  path: `nodes.${e[1]}`,
152
153
  message: `this action has ${e.length} "${t}" triggers`,
153
154
  hint: "one step per way in — a second flow starts from a different kind of trigger"
154
155
  });
155
- }), o.forEach(([n, r]) => {
156
- let o = `nodes.${n}`;
157
- e(r) ? r.type === "trigger" ? g(n, r, i, a) : r.type === "task" ? !p(r.action) || !f.test(r.action) ? i.push({
158
- path: `${o}.action`,
156
+ }), a.forEach(([t, n]) => {
157
+ let a = `nodes.${t}`;
158
+ s(n) ? n.type === "trigger" ? _(t, n, r, i) : n.type === "task" ? !m(n.action) || !p.test(n.action) ? r.push({
159
+ path: `${a}.action`,
159
160
  message: "must name a task as <namespace>.<action>",
160
161
  hint: "for example flow.output or http.request"
161
- }) : p(r.afterNode) && !Object.hasOwn(t, r.afterNode) && i.push({
162
- path: `${o}.afterNode`,
163
- message: `points at "${r.afterNode}", which is not a step here`
164
- }) : i.push({
165
- path: `${o}.type`,
166
- message: `"${String(r.type)}" steps run in the browser and cannot run on the server`,
162
+ }) : m(n.afterNode) && !Object.hasOwn(e, n.afterNode) && r.push({
163
+ path: `${a}.afterNode`,
164
+ message: `points at "${n.afterNode}", which is not a step here`
165
+ }) : r.push({
166
+ path: `${a}.type`,
167
+ message: `"${String(n.type)}" steps run in the browser and cannot run on the server`,
167
168
  hint: "a server action is made of task steps"
168
- }) : i.push({
169
- path: o,
169
+ }) : r.push({
170
+ path: a,
170
171
  message: "must be an object"
171
172
  });
172
- }), o.forEach(([e]) => {
173
- d.has(e) && i.push({
173
+ }), a.forEach(([e]) => {
174
+ f.has(e) && r.push({
174
175
  path: `nodes.${e}`,
175
176
  message: `"${e}" is what the run itself publishes in the flow scope, so a step may not take the name`,
176
177
  hint: `rename the step — every later step reads {{ ${e} }} expecting the run's own value`
177
178
  });
178
179
  });
179
- let l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), m = [];
180
- s.forEach(([e]) => {
181
- let n = /* @__PURE__ */ new Set(), r = [], i = e;
180
+ let l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = [];
181
+ o.forEach(([t]) => {
182
+ let n = /* @__PURE__ */ new Set(), r = [], i = t;
182
183
  for (; i;) {
183
184
  if (n.has(i)) {
184
185
  u.add(i);
185
186
  break;
186
187
  }
187
188
  n.add(i), r.push(i), l.add(i);
188
- let e = t[i];
189
- i = p(e?.afterNode) ? e.afterNode : "";
189
+ let t = e[i];
190
+ i = m(t?.afterNode) ? t.afterNode : "";
190
191
  }
191
- m.push(r);
192
+ d.push(r);
192
193
  }), u.forEach((e) => {
193
- i.push({
194
+ r.push({
194
195
  path: `nodes.${e}`,
195
196
  message: "this step is reached again by its own chain, so the flow never ends",
196
197
  hint: "break the `afterNode` chain that comes back to it"
197
198
  });
198
- }), o.forEach(([e]) => {
199
- l.has(e) || a.push({
199
+ }), a.forEach(([e]) => {
200
+ l.has(e) || i.push({
200
201
  path: `nodes.${e}`,
201
202
  message: "no trigger reaches this step, so it never runs",
202
203
  hint: "chain it with `afterNode` from a trigger, or delete it"
203
204
  });
204
205
  });
205
- let h = (e) => t[e]?.action, _ = o.filter(([, t]) => e(t) && t.action === "flow.output");
206
- for (let [e, n] of _) {
207
- let r = p(n.afterNode) && h(n.afterNode) === "flow.onFailure";
208
- p(n.afterNode) && Object.hasOwn(t, n.afterNode) && !r && a.push({
209
- path: `nodes.${e}.afterNode`,
206
+ let h = (t) => e[t]?.action, g = a.filter(([, e]) => s(e) && e.action === "flow.output");
207
+ for (let [t, n] of g) {
208
+ let r = m(n.afterNode) && h(n.afterNode) === "flow.onFailure";
209
+ m(n.afterNode) && Object.hasOwn(e, n.afterNode) && !r && i.push({
210
+ path: `nodes.${t}.afterNode`,
210
211
  message: "the output step is not the last one, so the steps after it run for nothing",
211
212
  hint: "move flow.output to the end of the flow"
212
213
  });
@@ -214,63 +215,72 @@ var s = [
214
215
  let v = /* @__PURE__ */ new Set(), y = (e, t) => {
215
216
  v.has(`${t.path}|${t.message}`) || (v.add(`${t.path}|${t.message}`), e.push(t));
216
217
  };
217
- m.forEach((e) => {
218
- let t = e.findIndex((e) => h(e) === r);
218
+ d.forEach((e) => {
219
+ let t = e.findIndex((e) => h(e) === n);
219
220
  if (t === -1) return;
220
- let n = e[t];
221
- t === 1 && y(a, {
222
- path: `nodes.${n}`,
221
+ let a = e[t];
222
+ t === 1 && y(i, {
223
+ path: `nodes.${a}`,
223
224
  message: "nothing runs before this step, so nothing can fail and the steps after it never run",
224
225
  hint: "put On Failure after the steps whose work it undoes"
225
- }), t === e.length - 1 && y(a, {
226
- path: `nodes.${n}`,
226
+ }), t === e.length - 1 && y(i, {
227
+ path: `nodes.${a}`,
227
228
  message: "nothing follows this step, so a failed run undoes nothing",
228
229
  hint: "add the steps that give back what the flow already did"
229
230
  }), e.slice(t + 1).forEach((e) => {
230
- h(e) === "flow.onFailure" && y(i, {
231
+ h(e) === "flow.onFailure" && y(r, {
231
232
  path: `nodes.${e}`,
232
233
  message: "a flow has one place its undo begins, and this is a second one",
233
234
  hint: "keep one On Failure step and put every undo step after it"
234
- }), h(e) === "flow.output" && y(i, {
235
+ }), h(e) === "flow.output" && y(r, {
235
236
  path: `nodes.${e}`,
236
237
  message: "an output step after On Failure answers a run that has already failed",
237
238
  hint: "move flow.output before On Failure"
238
239
  });
239
240
  });
240
- }), _.length === 0 && e(n) && Object.keys(n).length > 0 && a.push({
241
+ }), g.length === 0 && s(t) && Object.keys(t).length > 0 && i.push({
241
242
  path: "nodes",
242
243
  message: "this action is expected to answer values but no step names any",
243
244
  hint: "add a flow.output step at the end naming what the caller should get"
244
245
  });
245
- }, v = /\{\{\s*credential\./, y = (t, n) => {
246
- Object.entries(t).forEach(([t, r]) => {
247
- if (!e(r) || !e(r.params)) return;
248
- let i = p(r.params.credential) ? r.params.credential : "";
249
- Object.entries(r.params).forEach(([e, r]) => {
250
- typeof r == "string" && v.test(r) && i === "" && n.push({
251
- path: `nodes.${t}.params.${e}`,
246
+ }, y = /\{\{\s*credential\./, b = (e, t) => {
247
+ Object.entries(e).forEach(([e, n]) => {
248
+ if (!s(n) || !s(n.params)) return;
249
+ let r = m(n.params.credential) ? n.params.credential : "";
250
+ Object.entries(n.params).forEach(([n, i]) => {
251
+ typeof i == "string" && y.test(i) && r === "" && t.push({
252
+ path: `nodes.${e}.params.${n}`,
252
253
  message: "this step reads a credential it did not ask for, so the token resolves to nothing",
253
254
  hint: "set the step’s `credential` to the identifier it should use"
254
255
  });
255
256
  });
256
257
  });
257
- }, b = (t) => {
258
- let n = [], r = [];
259
- return e(t) ? (p(t.name) || n.push({
258
+ }, x = (e, t) => {
259
+ Object.entries(e).forEach(([e, n]) => {
260
+ if (!s(n) || n.action !== "flow.delay" || !s(n.params)) return;
261
+ let i = n.params.milliseconds, a = typeof i == "number" ? i : typeof i == "string" ? Number(i.trim()) : NaN;
262
+ Number.isFinite(a) && a > 5e3 && t.push({
263
+ path: `nodes.${e}.params.milliseconds`,
264
+ message: `this step waits ${String(a)} ms, and a step waits at most ${String(r)} ms`,
265
+ hint: "a longer wait is a schedule: enqueue the rest of the work for later instead of holding the run"
266
+ });
267
+ });
268
+ }, S = (e) => {
269
+ let t = [], n = [];
270
+ return s(e) ? (m(e.name) || t.push({
260
271
  path: "name",
261
272
  message: "must have a name"
262
- }), h(t.output, "output", n), _(t.nodes, t.output, n, r), y(e(t.nodes) ? t.nodes : {}, r), {
263
- valid: n.length === 0,
264
- errors: n,
265
- warnings: r
273
+ }), g(e.output, "output", t), v(e.nodes, e.output, t, n), b(s(e.nodes) ? e.nodes : {}, n), x(s(e.nodes) ? e.nodes : {}, n), {
274
+ valid: t.length === 0,
275
+ errors: t,
276
+ warnings: n
266
277
  }) : {
267
278
  valid: !1,
268
279
  errors: [{
269
280
  path: "",
270
281
  message: "the document must be an object"
271
282
  }],
272
- warnings: r
283
+ warnings: n
273
284
  };
274
- }, x = (e) => b(e).valid;
275
- //#endregion
276
- export { x as isActionDocument, b as validateActionDocument };
285
+ }, C = (e) => S(e).valid;
286
+ export { C as isActionDocument, S as validateActionDocument };