@plitzi/sdk-shared 0.39.1 → 0.39.3

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 (505) hide show
  1. package/CHANGELOG.md +11 -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.mjs +1 -2
  381. package/dist/schema/serverElements.d.ts +0 -24
  382. package/dist/schema/serverElements.mjs +60 -39
  383. package/dist/schema/serverInput.mjs +23 -24
  384. package/dist/schema/serverQuery.d.ts +15 -5
  385. package/dist/schema/serverQuery.mjs +47 -35
  386. package/dist/schema/snippet.mjs +1 -2
  387. package/dist/schema/wire.mjs +1 -2
  388. package/dist/security/index.d.ts +49 -0
  389. package/dist/security/index.mjs +44 -0
  390. package/dist/server/actions/useActionsSync.mjs +1 -2
  391. package/dist/server/actions/useImagesSync.mjs +1 -2
  392. package/dist/server/actions/useRealtimeSync.mjs +1 -2
  393. package/dist/server/index.mjs +7 -7
  394. package/dist/server/rsc/refreshRsc.mjs +23 -24
  395. package/dist/server/rsc/useRscRefresh.mjs +1 -2
  396. package/dist/server/rsc/useRscSync.mjs +1 -2
  397. package/dist/server/usePluginRoute.mjs +1 -2
  398. package/dist/source/export.d.ts +1 -1
  399. package/dist/source/export.mjs +1 -2
  400. package/dist/source/import.mjs +1 -2
  401. package/dist/source/index.mjs +4 -4
  402. package/dist/source/snapshot.mjs +1 -2
  403. package/dist/state/index.d.ts +0 -1
  404. package/dist/state/index.mjs +1 -3
  405. package/dist/state/paintedState.mjs +10 -11
  406. package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
  407. package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
  408. package/dist/store/actionRuns/index.mjs +3 -3
  409. package/dist/store/actionRuns/useActionRuns.mjs +5 -6
  410. package/dist/store/index.d.ts +1 -0
  411. package/dist/store/index.mjs +2 -1
  412. package/dist/store/renderSettings.d.ts +1 -1
  413. package/dist/store/renderSettings.mjs +1 -2
  414. package/dist/{state → store}/runtimeStatePersist.mjs +29 -30
  415. package/dist/store/storeHooks.d.ts +45 -45
  416. package/dist/store/storeHooks.mjs +1 -2
  417. package/dist/store/tracing/index.mjs +5 -5
  418. package/dist/store/tracing/preview.mjs +1 -2
  419. package/dist/store/tracing/tracingCollector.d.ts +2 -2
  420. package/dist/store/tracing/tracingCollector.mjs +79 -78
  421. package/dist/store/tracing/tracingMiddleware.mjs +1 -2
  422. package/dist/store/tracing/tracingStore.mjs +1 -2
  423. package/dist/store/tracing/useTracing.mjs +6 -7
  424. package/dist/style/breakpoints.mjs +1 -2
  425. package/dist/style/cssLayers.mjs +1 -2
  426. package/dist/style/displayModes.mjs +1 -2
  427. package/dist/style/fontAssets.mjs +1 -2
  428. package/dist/style/fontValidation.mjs +14 -15
  429. package/dist/style/fonts.d.ts +5 -3
  430. package/dist/style/fonts.mjs +23 -24
  431. package/dist/style/fontsFromCss.mjs +1 -2
  432. package/dist/style/index.mjs +18 -18
  433. package/dist/style/keyframes.mjs +1 -2
  434. package/dist/style/layoutGrid.mjs +1 -2
  435. package/dist/style/notifications.mjs +1 -2
  436. package/dist/style/react/useDisplayMode.mjs +1 -2
  437. package/dist/style/react/useElementSize.mjs +1 -2
  438. package/dist/style/runtimeStyle.d.ts +19 -21
  439. package/dist/style/runtimeStyle.mjs +4 -7
  440. package/dist/style/snippetStyle.mjs +5 -6
  441. package/dist/style/styleConditions.mjs +1 -2
  442. package/dist/style/styleConstants.mjs +1 -2
  443. package/dist/style/stylePseudos.mjs +1 -2
  444. package/dist/style/styleStates.mjs +1 -2
  445. package/dist/style/styleTarget.mjs +24 -25
  446. package/dist/theme/cookie/index.mjs +1 -1
  447. package/dist/theme/cookie/themeCookie.d.ts +21 -1
  448. package/dist/theme/cookie/themeCookie.mjs +19 -4
  449. package/dist/theme/index.d.ts +1 -9
  450. package/dist/theme/index.mjs +1 -6
  451. package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
  452. package/dist/theme/react/ThemeProvider.mjs +78 -0
  453. package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
  454. package/dist/theme/react/ThemeScope.mjs +9 -0
  455. package/dist/theme/react/index.d.ts +9 -0
  456. package/dist/theme/react/index.mjs +5 -0
  457. package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
  458. package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
  459. package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
  460. package/dist/theme/react/useTheme.mjs +19 -0
  461. package/dist/types/ActionTypes.d.ts +33 -0
  462. package/dist/types/AuthTypes.d.ts +6 -0
  463. package/dist/types/CommonTypes.d.ts +14 -3
  464. package/dist/types/DataSourceTypes.d.ts +1 -1
  465. package/dist/types/FunctionTypes.d.ts +16 -6
  466. package/dist/types/InteractionTypes.d.ts +1 -1
  467. package/dist/types/JobTypes.d.ts +56 -182
  468. package/dist/types/PluginTypes.d.ts +8 -1
  469. package/dist/types/SchemaTypes.d.ts +1 -1
  470. package/dist/types/SchemaTypes.mjs +1 -2
  471. package/dist/types/ServerAdapterTypes.d.ts +0 -326
  472. package/dist/types/ServerTypes.d.ts +0 -311
  473. package/dist/types/SpaceTypes.d.ts +5 -2
  474. package/dist/types/StoreTypes.d.ts +9 -3
  475. package/dist/types/StyleTypes.d.ts +6 -0
  476. package/dist/types/StyleTypes.mjs +1 -2
  477. package/dist/types/index.d.ts +0 -3
  478. package/dist/websockets/RTCodec.mjs +1 -2
  479. package/eslint.config.mjs +25 -0
  480. package/package.json +29 -18
  481. package/vite.config.ts +58 -0
  482. package/dist/helpers/generateFacade.d.ts +0 -2
  483. package/dist/helpers/ruleEvaluator.d.ts +0 -16
  484. package/dist/helpers/ruleEvaluator.mjs +0 -5
  485. package/dist/network/NetworkInternalContext.mjs +0 -5
  486. package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
  487. package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
  488. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
  489. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
  490. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
  491. package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
  492. package/dist/network/graphql/sdk/index.d.ts +0 -5
  493. package/dist/network/graphql/sdk/index.mjs +0 -3
  494. package/dist/theme/ThemeProvider.mjs +0 -69
  495. package/dist/theme/ThemeScope.mjs +0 -10
  496. package/dist/theme/useTheme.mjs +0 -20
  497. package/dist/types/OAuthTypes.d.ts +0 -246
  498. package/dist/types/ServerConfigTypes.d.ts +0 -527
  499. package/dist/types/ServerLogTypes.d.ts +0 -119
  500. /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
  501. /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
  502. /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
  503. /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
  504. /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
  505. /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
@@ -0,0 +1,37 @@
1
+ import { ActionRefusal as e, isActionRefusal as t, refusalCodeOf as n } from "./refusal.mjs";
2
+ // src/functions/protocol.ts
3
+ var r = "1.4", i = /^(\d+)\.(\d+)$/, a = (e, t) => {
4
+ let n = typeof e == "string" ? i.exec(e) : null, r = i.exec(t);
5
+ return !!(n && r && n[1] === r[1] && Number(n[2]) >= Number(r[2]));
6
+ }, o = (e, t = "1.4", { here: n, there: r } = {
7
+ here: "runner",
8
+ there: "platform"
9
+ }) => {
10
+ let a = i.exec(t), o = typeof e == "string" ? i.exec(e) : null;
11
+ if (!a || !o) return `This ${n} speaks protocol ${t}, and was sent ${JSON.stringify(e)}, which is no version of it`;
12
+ if (o[1] !== a[1]) {
13
+ let i = Number(o[1]) < Number(a[1]) ? `the ${r}` : `the ${n}`;
14
+ return `This ${n} speaks protocol ${t} and was sent ${String(e)}: another major. Upgrade ${i}`;
15
+ }
16
+ if (Number(o[2]) > Number(a[2])) return `This ${n} speaks protocol ${t} and was sent ${String(e)}, newer than it knows: upgrade the ${n} (the ${n} is deployed before the ${r} that calls it)`;
17
+ }, s = (e) => typeof e == "object" && !!e && "streamed" in e && e.streamed === !0 && "body" in e && e.body instanceof ReadableStream, c = /* @__PURE__ */ new Set(["schedule", "later"]), l = (e) => e.kind === "job" || c.has(e.context.trigger) ? "background" : "interactive", u = (e) => {
18
+ let r = n(e);
19
+ return {
20
+ ok: !1,
21
+ error: e instanceof Error ? e.message : String(e),
22
+ ...t(e) ? { refused: !0 } : {},
23
+ ...r === void 0 ? {} : { code: r }
24
+ };
25
+ }, d = ({ error: t, refused: n, code: r }) => n ? new e(t, r === void 0 ? {} : { code: r }) : Error(t), f = /* @__PURE__ */ new Set([
26
+ "cpu",
27
+ "wall",
28
+ "memory",
29
+ "output",
30
+ "calls"
31
+ ]), p = (e) => f.has(e), m = class extends Error {
32
+ reason;
33
+ constructor(e, t) {
34
+ super(t), this.name = "FunctionFailure", this.reason = e;
35
+ }
36
+ };
37
+ export { r as FUNCTIONS_PROTOCOL, m as FunctionFailure, d as errorOfAnswer, u as failedAnswerOf, l as invocationUrgency, p as isFunctionLimit, s as isStreamedRouteAnswer, a as protocolKnows, o as protocolRefusal };
@@ -0,0 +1,17 @@
1
+ /** How much of something is allowed: `most` in every `perSeconds`, for each caller or for everyone together. */
2
+ export type RateLimit = {
3
+ most: number;
4
+ perSeconds: number;
5
+ per?: 'caller' | 'everyone';
6
+ /**
7
+ * Over the limit, the call is refused with these words — the step's error, on the page — rather than answered
8
+ * `allowed: false` for the code to check: `ctx.rateLimit('make', { most: 5, perSeconds: 600, refuse: 'Wait ten minutes' })`.
9
+ */
10
+ refuse?: string;
11
+ };
12
+ /** Where a limit stands after counting one more: whether that one was within it, and how many are left. */
13
+ export type RateCount = {
14
+ allowed: boolean;
15
+ count: number;
16
+ remaining: number;
17
+ };
File without changes
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A step refusing to go on, with a reason written for whoever called — a password too easy to guess, a board that is
3
+ * read-only, a quota reached.
4
+ *
5
+ * What any other step throws stays in the run's record and never reaches the caller: an error can carry a query, a
6
+ * URL, a credential's name, and a page is shown to anybody. This one says, by its type, that its message was written
7
+ * to be read. A run that ends on it answers `status: 'failed'` with the message as `error`, which a page's flow reads
8
+ * as `{{ step.error }}` — the same place a refusal before the run began puts its own.
9
+ *
10
+ * `code` names the refusal for code that catches it (`oauth-not-connected`): what to tell apart by, never the message,
11
+ * which is written for a person and may change.
12
+ */
13
+ export declare class ActionRefusal extends Error {
14
+ code?: string;
15
+ constructor(message: string, options?: {
16
+ code?: string;
17
+ });
18
+ }
19
+ /**
20
+ * Whether an error is a refusal — told apart by its NAME, never by `instanceof`: a functions bundle carries its own copy
21
+ * of the class (`functions/build.ts`), so a project's code loaded from one throws a refusal this class never made, and
22
+ * its reason was dropped on the way to the page.
23
+ */
24
+ export declare const isActionRefusal: (error: unknown) => error is Error;
25
+ /** A refusal's code, when it has one that is a string — read off a refusal made by any copy of the class. */
26
+ export declare const refusalCodeOf: (error: unknown) => string | undefined;
@@ -0,0 +1,11 @@
1
+ // src/functions/refusal.ts
2
+ var e = class extends Error {
3
+ code;
4
+ constructor(e, t) {
5
+ super(e), this.name = "ActionRefusal", t?.code !== void 0 && (this.code = t.code);
6
+ }
7
+ }, t = (e) => e instanceof Error && e.name === "ActionRefusal", n = (e) => {
8
+ let n = t(e) && "code" in e ? e.code : void 0;
9
+ return typeof n == "string" ? n : void 0;
10
+ };
11
+ export { e as ActionRefusal, t as isActionRefusal, n as refusalCodeOf };
@@ -0,0 +1,44 @@
1
+ import { FunctionsDefinition } from './contract';
2
+ /**
3
+ * A space's runtime, as both sides of it read it: the contract the runtime is written against (`defineRuntime` in
4
+ * `@plitzi/sdk-runtime`), and the rules for what it may serve, which the host that runs it and the platform that
5
+ * forwards to it apply alike.
6
+ */
7
+ /** Where a started runtime says what it serves — under `/_`, which no endpoint may take. */
8
+ export declare const RUNTIME_DESCRIBE_PATH = "/_describe";
9
+ /** The headers of the platform's, which a runtime's endpoint never sees. */
10
+ export declare const PLATFORM_HEADERS: string[];
11
+ /** What a runtime starts with. */
12
+ export type SpaceRuntimeContext = {
13
+ /** Its variables: those the platform keeps for it (`REDIS_URL`…), or a self-hosted server's own environment. */
14
+ env: Readonly<Record<string, string | undefined>>;
15
+ /** Where people reach the space — what a link written for a person, or an agent, is handed. */
16
+ publicUrl: string;
17
+ };
18
+ /**
19
+ * A path of the space's own answered by the runtime: a web handler, streaming if it likes — an agent's endpoint, a
20
+ * webhook that speaks a protocol of its own. The visitor's cookies and `Authorization` never reach it: the host's are
21
+ * the platform's.
22
+ */
23
+ export type SpaceRuntimeEndpoint = (request: Request) => Response | Promise<Response>;
24
+ /** What a started runtime is made of. */
25
+ export type SpaceRuntimeParts = {
26
+ /** Its tasks and `/fn/` routes, run with a `ctx` that is the platform's — the space's `kv`, its channels, its key. */
27
+ functions?: FunctionsDefinition;
28
+ /** Paths it answers itself, each with everything beneath it (`/mcp` answers `/mcp/…`) — see {@link endpointProblem}. */
29
+ endpoints?: Record<string, SpaceRuntimeEndpoint>;
30
+ /** Called when it is stopped: close what `start` opened. */
31
+ close?: () => Promise<void>;
32
+ };
33
+ /**
34
+ * A space's own server code, run as code of its own — Node, its dependencies, its connections — beside the platform
35
+ * that serves the space: a runtime of the space, where the sandbox's functions are not enough. `start` is handed its
36
+ * variables and answers what it serves.
37
+ */
38
+ export type SpaceRuntime = {
39
+ start: (context: SpaceRuntimeContext) => SpaceRuntimeParts | Promise<SpaceRuntimeParts>;
40
+ };
41
+ /** Why a path cannot be an endpoint — or nothing, for one that can. */
42
+ export declare const endpointProblem: (path: string) => string | undefined;
43
+ /** The endpoint a request's path belongs to: exactly it, or beneath it — the longest that does. */
44
+ export declare const endpointFor: (paths: readonly string[], path: string) => string | undefined;
@@ -0,0 +1,13 @@
1
+ import "../actions/functions.mjs";
2
+ // src/functions/runtime.ts
3
+ var e = "/_describe", t = ["authorization", "cookie"], n = [
4
+ "/fn",
5
+ "/_",
6
+ "/auth",
7
+ "/.well-known"
8
+ ], r = (e) => {
9
+ if (!/^\/[A-Za-z0-9._~-]+(\/[A-Za-z0-9._~-]+)*$/.test(e)) return `"${e}" is not an endpoint path: it starts with "/" and is made of plain segments`;
10
+ let t = n.find((t) => e === t || e.startsWith(t.endsWith("_") ? t : `${t}/`));
11
+ if (t) return `"${e}" is the server's own (${t}): an endpoint takes a path of the space's`;
12
+ }, i = (e, t) => e.filter((e) => t === e || t.startsWith(`${e}/`)).sort((e, t) => t.length - e.length)[0];
13
+ export { t as PLATFORM_HEADERS, e as RUNTIME_DESCRIBE_PATH, i as endpointFor, r as endpointProblem };
@@ -0,0 +1,27 @@
1
+ import { FunctionSize } from '../types/FunctionTypes';
2
+ /**
3
+ * The memory each size of task runs with, smallest first. A runner keeps a task's memory whole while it runs, so small
4
+ * is what most code needs, and a task that parses large answers asks to be larger rather than every invocation keeping
5
+ * room for the one that does. One table: the runner, the plans, the builder and the pools' sizes read it.
6
+ */
7
+ export declare const FUNCTION_SIZES: {
8
+ readonly small: {
9
+ readonly memoryMb: 32;
10
+ };
11
+ readonly medium: {
12
+ readonly memoryMb: 128;
13
+ };
14
+ readonly large: {
15
+ readonly memoryMb: 256;
16
+ };
17
+ };
18
+ /** Every size, smallest first. */
19
+ export declare const FUNCTION_SIZE_NAMES: FunctionSize[];
20
+ /** Whether a value names a size. */
21
+ export declare const isFunctionSize: (value: unknown) => value is FunctionSize;
22
+ /** The sizes whose memory fits within `memoryMb` — what a plan or a server of that much lets a task ask for. */
23
+ export declare const functionSizesWithin: (memoryMb: number) => FunctionSize[];
24
+ /** The size that runs with `memoryMb`, when one does: what a message about an invocation's memory names. */
25
+ export declare const functionSizeOfMemory: (memoryMb: number) => FunctionSize | undefined;
26
+ /** The next size up, or none past the largest. */
27
+ export declare const largerFunctionSize: (size: FunctionSize) => FunctionSize | undefined;
@@ -0,0 +1,7 @@
1
+ // src/functions/sizes.ts
2
+ var e = {
3
+ small: { memoryMb: 32 },
4
+ medium: { memoryMb: 128 },
5
+ large: { memoryMb: 256 }
6
+ }, t = Object.keys(e), n = (t) => typeof t == "string" && Object.hasOwn(e, t), r = (n) => t.filter((t) => e[t].memoryMb <= n), i = (n) => t.find((t) => e[t].memoryMb === n), a = (e) => t[t.indexOf(e) + 1];
7
+ export { e as FUNCTION_SIZES, t as FUNCTION_SIZE_NAMES, i as functionSizeOfMemory, r as functionSizesWithin, n as isFunctionSize, a as largerFunctionSize };
@@ -0,0 +1,11 @@
1
+ import { WireBody, WireRequest, WireResponse } from './protocol';
2
+ /** A body as the wire carries it: as text when its type says it is text, base64 otherwise. */
3
+ export declare const wireBodyOf: (body: Body, contentType: string | null) => Promise<WireBody | null>;
4
+ export declare const bodyOf: (body: WireBody | null) => string | Uint8Array<ArrayBuffer> | null;
5
+ export declare const wireResponseOf: (response: Response) => Promise<WireResponse>;
6
+ export declare const wireRequestOf: (request: Request) => Promise<WireRequest>;
7
+ export declare const responseOf: ({ status, statusText, headers, body }: WireResponse) => Response;
8
+ /** An answer that crossed a boundary as a wire response — from a space's code, or from the platform — read, not trusted. */
9
+ export declare const wireResponseFrom: (value: unknown) => WireResponse;
10
+ /** A request that crossed as a wire request, as a web `Request` again — what a route handler outside the sandbox takes. */
11
+ export declare const requestFromWire: (value: unknown) => Request;
@@ -0,0 +1,39 @@
1
+ import { isRecord as e } from "../helpers/isRecord.mjs";
2
+ // src/functions/wire.ts
3
+ var t = /^(text\/|application\/([\w.+-]*\+)?(json|xml|javascript|x-www-form-urlencoded))/i, n = async (e, n) => {
4
+ let r = Buffer.from(await e.arrayBuffer());
5
+ return r.length ? n && t.test(n) ? { text: r.toString("utf8") } : { base64: r.toString("base64") } : null;
6
+ }, r = (e) => e ? "text" in e ? e.text : new Uint8Array(Buffer.from(e.base64, "base64")) : null, i = async (e) => ({
7
+ status: e.status,
8
+ statusText: e.statusText,
9
+ headers: [...e.headers],
10
+ body: await n(e, e.headers.get("content-type"))
11
+ }), a = async (e) => ({
12
+ method: e.method,
13
+ url: e.url,
14
+ headers: [...e.headers],
15
+ body: await n(e, e.headers.get("content-type"))
16
+ }), o = ({ status: e, statusText: t, headers: n, body: i }) => new Response(r(i), {
17
+ status: e,
18
+ statusText: t,
19
+ headers: n
20
+ }), s = (e) => Array.isArray(e) ? e.flatMap((e) => Array.isArray(e) && typeof e[0] == "string" && typeof e[1] == "string" ? [[e[0], e[1]]] : []) : [], c = (t) => {
21
+ let n = e(t) ? t : void 0;
22
+ return n && typeof n.text == "string" ? { text: n.text } : n && typeof n.base64 == "string" ? { base64: n.base64 } : null;
23
+ }, l = (t) => {
24
+ let n = e(t) ? t : {};
25
+ return {
26
+ status: typeof n.status == "number" && n.status >= 200 && n.status <= 599 ? n.status : 500,
27
+ statusText: typeof n.statusText == "string" ? n.statusText : "",
28
+ headers: s(n.headers),
29
+ body: c(n.body)
30
+ };
31
+ }, u = (t) => {
32
+ let n = e(t) ? t : {}, i = typeof n.method == "string" ? n.method : "GET";
33
+ return new Request(typeof n.url == "string" ? n.url : "http://runtime.invalid/", {
34
+ method: i,
35
+ headers: s(n.headers),
36
+ body: i === "GET" || i === "HEAD" ? null : r(c(n.body))
37
+ });
38
+ };
39
+ export { r as bodyOf, u as requestFromWire, o as responseOf, n as wireBodyOf, a as wireRequestOf, l as wireResponseFrom, i as wireResponseOf };
@@ -1,5 +1,4 @@
1
1
  import { isRecord as e } from "./isRecord.mjs";
2
- //#region src/helpers/canonicalJson.ts
2
+ // src/helpers/canonicalJson.ts
3
3
  var t = (t) => t === void 0 ? "undefined" : JSON.stringify(t, (t, n) => e(n) ? Object.fromEntries(Object.keys(n).toSorted().map((e) => [e, n[e]])) : n);
4
- //#endregion
5
4
  export { t as canonicalJson };
@@ -1,4 +1,4 @@
1
- //#region src/helpers/clipboard.ts
1
+ // src/helpers/clipboard.ts
2
2
  var e = () => {
3
3
  let e = typeof navigator > "u" ? void 0 : Reflect.get(navigator, "clipboard"), t = typeof e == "object" && e ? Reflect.get(e, "writeText") : void 0;
4
4
  if (typeof t == "function") return async (n) => {
@@ -13,5 +13,4 @@ var e = () => {
13
13
  return !1;
14
14
  }
15
15
  }, n = "This page cannot reach the clipboard: it is not served over https, or the browser refused.";
16
- //#endregion
17
16
  export { n as NOT_COPIED_REASON, e as clipboardWriter, t as copyText };
@@ -1,4 +1,4 @@
1
- //#region src/helpers/cookies.ts
1
+ // src/helpers/cookies.ts
2
2
  var e = (e, t) => {
3
3
  if (e) for (let n of e.split(";")) {
4
4
  let e = n.indexOf("=");
@@ -15,5 +15,4 @@ var e = (e, t) => {
15
15
  return;
16
16
  }
17
17
  };
18
- //#endregion
19
18
  export { e as cookieFromHeader, t as documentCookies };
@@ -0,0 +1,5 @@
1
+ export type DeepEqualMetadata = {
2
+ skip?: string[];
3
+ skipFunctions?: boolean;
4
+ };
5
+ export declare const deepEqual: (a: unknown, b: unknown, mode?: "soft" | "hard", metadata?: DeepEqualMetadata) => boolean;
@@ -0,0 +1,44 @@
1
+ // src/helpers/deepEqual/deepEqual.ts
2
+ var e = (e, t) => Object.getOwnPropertyDescriptor(e, t)?.enumerable, t = (n, r, i = "soft", a = {}) => {
3
+ let { skip: o = [], skipFunctions: s = !1 } = a;
4
+ if (n === r && i === "soft") return !0;
5
+ if (n && r && typeof n == "object" && typeof r == "object") {
6
+ if (n.constructor !== r.constructor) return !1;
7
+ let s, c, l = [];
8
+ if (Array.isArray(n)) {
9
+ if (s = n.length, s != r.length) return !1;
10
+ for (c = s; c-- !== 0;) if (!t(n[c], r[c], i, a)) return !1;
11
+ return !0;
12
+ }
13
+ if (n instanceof Map && r instanceof Map) {
14
+ if (n.size !== r.size) return !1;
15
+ for (c of n.values()) if (!r.has(c)) return !1;
16
+ for (c of n.entries()) if (!t(c[1], r.get(c[0]), i, a)) return !1;
17
+ return !0;
18
+ }
19
+ if (n instanceof Set && r instanceof Set) {
20
+ if (n.size !== r.size) return !1;
21
+ for (c of n.entries()) if (!r.has(c[0])) return !1;
22
+ return !0;
23
+ }
24
+ if (ArrayBuffer.isView(n) && ArrayBuffer.isView(r)) {
25
+ if (s = n.length, s != r.length) return !1;
26
+ for (c = s; c-- !== 0;) if (n[c] !== r[c]) return !1;
27
+ return !0;
28
+ }
29
+ if (n.constructor === RegExp) return n.source === r.source && n.global === r.global && n.ignoreCase === r.ignoreCase && n.multiline === r.multiline && n.unicode === r.unicode && n.lastIndex === r.lastIndex && n.sticky === r.sticky;
30
+ if ((n.valueOf !== Object.prototype.valueOf || r.valueOf !== Object.prototype.valueOf) && typeof n.valueOf == "function" && typeof r.valueOf == "function") return n.valueOf() === r.valueOf();
31
+ if ((n.toString !== Object.prototype.toString || r.toString !== Object.prototype.toString) && typeof n.toString == "function" && typeof r.toString == "function") return n.toString() === r.toString();
32
+ if (l = i === "soft" ? Object.keys(n) : Object.getOwnPropertyNames(n), s = l.length, s !== (i === "soft" ? Object.keys(r).length : Object.getOwnPropertyNames(r).length)) return !1;
33
+ for (c = s; c-- !== 0;) if (!Object.prototype.hasOwnProperty.call(r, l[c])) return !1;
34
+ for (c = s; c-- !== 0;) {
35
+ let s = l[c];
36
+ if (s === "_owner" && n.$$typeof) continue;
37
+ let u = i === "soft" || e(n, s) || !o.includes(s);
38
+ if (!t(n[s], r[s], i, a) && u) return !1;
39
+ }
40
+ return !0;
41
+ }
42
+ return i === "hard" && n === r || s && typeof n == "function" && typeof r == "function" ? !0 : n !== n && r !== r;
43
+ };
44
+ export { t as deepEqual };
@@ -0,0 +1 @@
1
+ export * from './deepEqual';
@@ -0,0 +1 @@
1
+ export { deepEqual } from "./deepEqual.mjs";
@@ -1,4 +1,3 @@
1
- //#region src/helpers/eventTarget.ts
1
+ // src/helpers/eventTarget.ts
2
2
  var e = (e) => e !== null && "nodeType" in e && typeof e.nodeType == "number", t = (t) => e(t) ? t : null, n = (t) => e(t) && t.nodeType === Node.ELEMENT_NODE, r = (e) => n(e) ? e : null;
3
- //#endregion
4
3
  export { r as elementOf, n as isElementTarget, e as isNodeTarget, t as nodeOf };
@@ -1,4 +1,4 @@
1
- //#region src/helpers/fetchManifest.ts
1
+ // src/helpers/fetchManifest.ts
2
2
  var e = async (e) => {
3
3
  try {
4
4
  let t = await fetch(e, { headers: { Accept: "application/json" } });
@@ -7,5 +7,4 @@ var e = async (e) => {
7
7
  return;
8
8
  }
9
9
  };
10
- //#endregion
11
10
  export { e as default };
@@ -1,4 +1,4 @@
1
- //#region src/helpers/images.ts
1
+ // src/helpers/images.ts
2
2
  var e = "/_plitzi/img", t = [
3
3
  320,
4
4
  480,
@@ -9,5 +9,4 @@ var e = "/_plitzi/img", t = [
9
9
  1600,
10
10
  1920
11
11
  ], n = (e) => t.some((t) => t === e), r = (e) => /^https?:\/\//i.test(e), i = (e) => r(e) && !/\.svgz?(?:[?#]|$)/i.test(e), a = (e, t, n) => `${e}?url=${encodeURIComponent(t)}&w=${String(n)}`, o = (e, n) => t.map((t) => `${a(e, n, t)} ${String(t)}w`).join(", ");
12
- //#endregion
13
12
  export { e as IMAGE_PATH, t as IMAGE_WIDTHS, o as imageSrcSet, a as imageUrl, n as isImageWidth, r as isRemoteImage, i as isResizableImage };
@@ -1,24 +1,22 @@
1
1
  import { default as fetchManifest } from './fetchManifest';
2
- import { default as generateFacade } from './generateFacade';
3
2
  import { default as syntaxHighlight } from './syntaxHighlight';
4
3
  export * from './cookies';
5
4
  export * from './eventTarget';
6
5
  export * from './fetchManifest';
7
6
  export * from './interval';
8
7
  export * from './isRecord';
9
- export * from './generateFacade';
10
8
  export * from './reducerOrigin';
11
- export * from './ruleEvaluator';
12
9
  export * from './syntaxHighlight';
13
10
  export * from './twigWrapper';
14
11
  export * from './utils';
12
+ export * from './lodash';
13
+ export * from './deepEqual';
15
14
  export * from './security';
16
- export { fetchManifest, generateFacade, syntaxHighlight };
17
- export * from './enclosingSpace';
15
+ export { fetchManifest, syntaxHighlight };
18
16
  export * from './canonicalJson';
19
17
  export * from './spaceRoot';
20
- export * from './sharedContext';
21
18
  export * from './images';
22
19
  export * from './keys';
23
20
  export * from './scroll';
24
21
  export * from './clipboard';
22
+ export * from './resources';
@@ -1,4 +1,4 @@
1
- import { isRecord as e } from "./isRecord.mjs";
1
+ import e from "./fetchManifest.mjs";
2
2
  import { filters as t } from "./twigWrapper/filters/filters.mjs";
3
3
  import { processTwig as n, processTwigParam as r, processTwigValue as i } from "./twigWrapper/processTwig/processTwig.mjs";
4
4
  import { hasTemplateSyntax as a } from "./twigWrapper/tokens/hasTemplateSyntax.mjs";
@@ -6,22 +6,26 @@ import { hasValidToken as o } from "./twigWrapper/tokens/hasValidToken.mjs";
6
6
  import { MAX_PARAM_PASSES as s, resolveStepParam as c } from "./twigWrapper/processTwig/resolveStepParam.mjs";
7
7
  import { inspectTemplate as l } from "./twigWrapper/inspectTemplate.mjs";
8
8
  import { templatePaths as u, templateRootNames as d } from "./twigWrapper/templateRoots.mjs";
9
- import { SCROLL_BEHAVIORS as f, SCROLL_POSITIONS as p, SCROLL_TRIGGER as m, VIEW_TRIGGER as h, scrollDistance as g, scrollPosition as _, scrollState as v } from "./scroll.mjs";
10
- import { sharedContext as y } from "./sharedContext.mjs";
11
- import b from "./fetchManifest.mjs";
12
- import x from "./generateFacade.mjs";
13
- import S from "./syntaxHighlight.mjs";
14
- import { cookieFromHeader as C, documentCookies as w } from "./cookies.mjs";
15
- import { elementOf as T, isElementTarget as E, isNodeTarget as D, nodeOf as O } from "./eventTarget.mjs";
16
- import { INTERVAL_TRIGGER as k, MIN_INTERVAL_MS as A, intervalOf as j } from "./interval.mjs";
17
- import { isUserEdit as M } from "./reducerOrigin.mjs";
18
- import { evaluateRuleGroup as N, ruleValuesOf as P } from "./ruleEvaluator.mjs";
19
- import { ParamsFromURL as F, delay as I, emptyObject as L, getDisplayName as R, getKeyDecoded as z, getPathsFromObject as B, hexToRGB as V, isInViewport as H, makeId as U } from "./utils.mjs";
20
- import { disableReactDevTools as W } from "./security.mjs";
21
- import { EnclosingSpaceContext as G } from "./enclosingSpace.mjs";
22
- import { canonicalJson as K } from "./canonicalJson.mjs";
23
- import { SPACE_ROOT_CLASS as q, spaceRootOf as J } from "./spaceRoot.mjs";
24
- import { IMAGE_PATH as Y, IMAGE_WIDTHS as X, imageSrcSet as Z, imageUrl as Q, isImageWidth as $, isRemoteImage as ee, isResizableImage as te } from "./images.mjs";
25
- import { KEY_TRIGGER as ne, isFieldEditing as re, keyPressCombo as ie, parseKeys as ae } from "./keys.mjs";
26
- import { NOT_COPIED_REASON as oe, clipboardWriter as se, copyText as ce } from "./clipboard.mjs";
27
- export { G as EnclosingSpaceContext, Y as IMAGE_PATH, X as IMAGE_WIDTHS, k as INTERVAL_TRIGGER, ne as KEY_TRIGGER, s as MAX_PARAM_PASSES, A as MIN_INTERVAL_MS, oe as NOT_COPIED_REASON, F as ParamsFromURL, f as SCROLL_BEHAVIORS, p as SCROLL_POSITIONS, m as SCROLL_TRIGGER, q as SPACE_ROOT_CLASS, h as VIEW_TRIGGER, K as canonicalJson, se as clipboardWriter, C as cookieFromHeader, ce as copyText, I as delay, W as disableReactDevTools, w as documentCookies, T as elementOf, L as emptyObject, N as evaluateRuleGroup, b as fetchManifest, t as filters, x as generateFacade, R as getDisplayName, z as getKeyDecoded, B as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, V as hexToRGB, Z as imageSrcSet, Q as imageUrl, l as inspectTemplate, j as intervalOf, E as isElementTarget, re as isFieldEditing, $ as isImageWidth, H as isInViewport, D as isNodeTarget, e as isRecord, ee as isRemoteImage, te as isResizableImage, M as isUserEdit, ie as keyPressCombo, U as makeId, O as nodeOf, ae as parseKeys, n as processTwig, r as processTwigParam, i as processTwigValue, c as resolveStepParam, P as ruleValuesOf, g as scrollDistance, _ as scrollPosition, v as scrollState, y as sharedContext, J as spaceRootOf, S as syntaxHighlight, u as templatePaths, d as templateRootNames };
9
+ import f from "./syntaxHighlight.mjs";
10
+ import { get as p } from "./lodash/get.mjs";
11
+ import { set as m } from "./lodash/set.mjs";
12
+ import { has as h } from "./lodash/has.mjs";
13
+ import { omit as g } from "./lodash/omit.mjs";
14
+ import { capitalize as _ } from "./lodash/capitalize.mjs";
15
+ import { camelCase as v } from "./lodash/camelCase.mjs";
16
+ import { deepEqual as y } from "./deepEqual/deepEqual.mjs";
17
+ import { cookieFromHeader as b, documentCookies as x } from "./cookies.mjs";
18
+ import { elementOf as S, isElementTarget as C, isNodeTarget as w, nodeOf as T } from "./eventTarget.mjs";
19
+ import { INTERVAL_TRIGGER as E, MIN_INTERVAL_MS as D, intervalOf as O } from "./interval.mjs";
20
+ import { isRecord as k } from "./isRecord.mjs";
21
+ import { isUserEdit as A } from "./reducerOrigin.mjs";
22
+ import { ParamsFromURL as j, delay as M, emptyObject as N, getDisplayName as P, getKeyDecoded as F, getPathsFromObject as I, hexToRGB as L, isInViewport as R, makeId as z } from "./utils.mjs";
23
+ import { TRUSTED_TYPES_POLICIES as B, disableReactDevTools as V } from "./security.mjs";
24
+ import { canonicalJson as H } from "./canonicalJson.mjs";
25
+ import { SPACE_ROOT_CLASS as U, spaceRootOf as W } from "./spaceRoot.mjs";
26
+ import { IMAGE_PATH as G, IMAGE_WIDTHS as K, imageSrcSet as q, imageUrl as J, isImageWidth as Y, isRemoteImage as X, isResizableImage as Z } from "./images.mjs";
27
+ import { KEY_TRIGGER as Q, isFieldEditing as $, keyPressCombo as ee, parseKeys as te } from "./keys.mjs";
28
+ import { SCROLL_BEHAVIORS as ne, SCROLL_POSITIONS as re, SCROLL_TRIGGER as ie, VIEW_TRIGGER as ae, scrollDistance as oe, scrollPosition as se, scrollState as ce } from "./scroll.mjs";
29
+ import { NOT_COPIED_REASON as le, clipboardWriter as ue, copyText as de } from "./clipboard.mjs";
30
+ import { MEMORY_STEPS as fe, VCPU_STEPS as pe, memoryWords as me, mibOf as he, millicoresOf as ge, quantityWords as _e, sizeWords as ve, vcpuWords as ye } from "./resources.mjs";
31
+ export { G as IMAGE_PATH, K as IMAGE_WIDTHS, E as INTERVAL_TRIGGER, Q as KEY_TRIGGER, s as MAX_PARAM_PASSES, fe as MEMORY_STEPS, D as MIN_INTERVAL_MS, le as NOT_COPIED_REASON, j as ParamsFromURL, ne as SCROLL_BEHAVIORS, re as SCROLL_POSITIONS, ie as SCROLL_TRIGGER, U as SPACE_ROOT_CLASS, B as TRUSTED_TYPES_POLICIES, pe as VCPU_STEPS, ae as VIEW_TRIGGER, v as camelCase, H as canonicalJson, _ as capitalize, ue as clipboardWriter, b as cookieFromHeader, de as copyText, y as deepEqual, M as delay, V as disableReactDevTools, x as documentCookies, S as elementOf, N as emptyObject, e as fetchManifest, t as filters, p as get, P as getDisplayName, F as getKeyDecoded, I as getPathsFromObject, h as has, a as hasTemplateSyntax, o as hasValidToken, L as hexToRGB, q as imageSrcSet, J as imageUrl, l as inspectTemplate, O as intervalOf, C as isElementTarget, $ as isFieldEditing, Y as isImageWidth, R as isInViewport, w as isNodeTarget, k as isRecord, X as isRemoteImage, Z as isResizableImage, A as isUserEdit, ee as keyPressCombo, z as makeId, me as memoryWords, he as mibOf, ge as millicoresOf, T as nodeOf, g as omit, te as parseKeys, n as processTwig, r as processTwigParam, i as processTwigValue, _e as quantityWords, c as resolveStepParam, oe as scrollDistance, se as scrollPosition, ce as scrollState, m as set, ve as sizeWords, W as spaceRootOf, f as syntaxHighlight, u as templatePaths, d as templateRootNames, ye as vcpuWords };
@@ -1,7 +1,6 @@
1
- //#region src/helpers/interval.ts
1
+ // src/helpers/interval.ts
2
2
  var e = "onInterval", t = 250, n = (e) => {
3
3
  let t = typeof e == "string" && e.trim() !== "" ? Number(e) : e;
4
4
  return typeof t == "number" && Number.isInteger(t) && t >= 250 ? t : void 0;
5
5
  };
6
- //#endregion
7
6
  export { e as INTERVAL_TRIGGER, t as MIN_INTERVAL_MS, n as intervalOf };
@@ -1,4 +1,3 @@
1
- //#region src/helpers/isRecord.ts
1
+ // src/helpers/isRecord.ts
2
2
  var e = (e) => typeof e == "object" && !!e && !Array.isArray(e);
3
- //#endregion
4
3
  export { e as isRecord };
@@ -1,4 +1,4 @@
1
- //#region src/helpers/keys.ts
1
+ // src/helpers/keys.ts
2
2
  var e = "onKey", t = [
3
3
  "ctrl",
4
4
  "alt",
@@ -83,5 +83,4 @@ var e = "onKey", t = [
83
83
  let t = e.split("+"), n = e.endsWith("++") ? "+" : t[t.length - 1];
84
84
  return u.has(n) || l.has(n) && (e.includes("ctrl+") || e.includes("meta+"));
85
85
  };
86
- //#endregion
87
86
  export { e as KEY_TRIGGER, d as isFieldEditing, c as keyPressCombo, s as parseKeys };
@@ -0,0 +1 @@
1
+ export declare function camelCase(value: string): string;
@@ -0,0 +1,7 @@
1
+ // src/helpers/lodash/camelCase.ts
2
+ function e(e) {
3
+ if (!e) return "";
4
+ let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([0-9])([a-zA-Z])/g, "$1 $2").replace(/([a-zA-Z])([0-9])/g, "$1 $2").replace(/[_\s-]+/g, " ").trim().split(/\s+/);
5
+ return t.length === 0 ? "" : t.map((e, t) => t === 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("");
6
+ }
7
+ export { e as camelCase };
@@ -0,0 +1 @@
1
+ export declare function capitalize(value?: string | null): string;
@@ -0,0 +1,5 @@
1
+ // src/helpers/lodash/capitalize.ts
2
+ function e(e) {
3
+ return e == null || typeof e != "string" || !e.trim() ? "" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
4
+ }
5
+ export { e as capitalize };
@@ -0,0 +1,8 @@
1
+ import { Path } from './shared';
2
+ export declare function cloneDeep<T>(value: T, seen?: WeakMap<object, any>): T;
3
+ export declare const cloneObject: <T>(obj: T) => T;
4
+ /**
5
+ * Clones only the necessary path (structural sharing).
6
+ * Useful for immutable operations like omit without cloning the entire object.
7
+ */
8
+ export declare function cloneAtPath<T extends Record<string, any>>(obj: T, path: Path): T;
@@ -0,0 +1,53 @@
1
+ import { toPath as e } from "./shared.mjs";
2
+ // src/helpers/lodash/cloneDeep.ts
3
+ function t(e, n = /* @__PURE__ */ new WeakMap()) {
4
+ if (typeof e != "object" || !e) return e;
5
+ if (n.has(e)) return n.get(e);
6
+ if (e instanceof Date) return new Date(e.getTime());
7
+ if (e instanceof RegExp) return new RegExp(e.source, e.flags);
8
+ if (e instanceof Map) {
9
+ let r = /* @__PURE__ */ new Map();
10
+ return n.set(e, r), e.forEach((e, i) => r.set(i, t(e, n))), r;
11
+ }
12
+ if (e instanceof Set) {
13
+ let r = /* @__PURE__ */ new Set();
14
+ return n.set(e, r), e.forEach((e) => r.add(t(e, n))), r;
15
+ }
16
+ if (ArrayBuffer.isView(e)) {
17
+ if (e instanceof DataView) {
18
+ let r = new DataView(t(e.buffer, n), e.byteOffset, e.byteLength);
19
+ return n.set(e, r), r;
20
+ }
21
+ let r = e.constructor, i = new r(e.buffer.slice(0), e.byteOffset, e.length);
22
+ return n.set(e, i), i;
23
+ }
24
+ if (e instanceof ArrayBuffer) {
25
+ let t = e.slice(0);
26
+ return n.set(e, t), t;
27
+ }
28
+ if (Array.isArray(e)) {
29
+ let r = [];
30
+ return n.set(e, r), e.forEach((e, i) => r[i] = t(e, n)), r;
31
+ }
32
+ let r = Object.getPrototypeOf(e), i = Object.create(r);
33
+ n.set(e, i);
34
+ for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = t(e[r], n));
35
+ return i;
36
+ }
37
+ var n = (e) => Object.assign(Object.create(Object.getPrototypeOf(e)), e);
38
+ function r(t, r) {
39
+ let i = e(r), a = Array.isArray(t) ? [...t] : n(t);
40
+ if (!i.length) return a;
41
+ let o = t, s = a;
42
+ for (let e = 0; e < i.length; e++) {
43
+ let t = i[e], r = o?.[t];
44
+ if (!r || typeof r != "object") {
45
+ s[t] = r;
46
+ break;
47
+ }
48
+ let a = Array.isArray(r) ? [...r] : n(r);
49
+ s[t] = a, o = r, s = a;
50
+ }
51
+ return a;
52
+ }
53
+ export { r as cloneAtPath, t as cloneDeep, n as cloneObject };
@@ -0,0 +1,11 @@
1
+ import { Path } from './shared';
2
+ type Split<S extends string, Delimiter extends string> = S extends `${infer T}${Delimiter}${infer U}` ? [T, ...Split<U, Delimiter>] : S extends '' ? [] : [S];
3
+ type NormalizeArrayPath<S extends string> = S extends `[${infer B}]${infer C}` ? NormalizeArrayPath<`${B}${C}`> : S extends `${infer A}[${infer B}]${infer C}` ? NormalizeArrayPath<`${A}.${B}${C}`> : S;
4
+ type PathArray<S extends string> = Split<NormalizeArrayPath<S>, '.'>;
5
+ type DeepValue<T, Keys extends readonly string[]> = Keys extends [] ? T : Keys extends [infer K, ...infer Rest] ? K extends string ? T extends readonly (infer U)[] ? K extends `${number}` ? Rest extends readonly string[] ? DeepValue<U, Rest> : U : unknown | undefined : K extends keyof T ? Rest extends readonly string[] ? DeepValue<T[K], Rest> | (undefined extends T[K] ? undefined : never) : T[K] : unknown | undefined : unknown | undefined : unknown | undefined;
6
+ type IsUnknown<T> = unknown extends T ? ([T] extends [unknown] ? true : false) : false;
7
+ type WithDefault<V, D> = IsUnknown<V> extends true ? D : NonNullable<V> | D;
8
+ export declare function get<T, P extends string>(obj: T, path: P): DeepValue<NonNullable<T>, PathArray<P>>;
9
+ export declare function get<T, P extends string, TDefault>(obj: T, path: P, defaultValue: TDefault): WithDefault<DeepValue<NonNullable<T>, PathArray<P>>, TDefault>;
10
+ export declare function get<T, P extends Exclude<Path, string> = Exclude<Path, string>, TDefault = undefined>(obj: T, path: P, defaultValue?: TDefault): Partial<T> | TDefault;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { toPath as e } from "./shared.mjs";
2
+ // src/helpers/lodash/get.ts
3
+ function t(t, n, r) {
4
+ if (t == null || !n) return r;
5
+ let i = e(n);
6
+ if (!i.length) return r;
7
+ let a = t;
8
+ for (let e of i) {
9
+ if (typeof a != "object" || !a) return r;
10
+ a = Array.isArray(a) && /^\d+$/.test(e) ? a[Number(e)] : Reflect.get(a, e);
11
+ }
12
+ return a === void 0 ? r : a;
13
+ }
14
+ export { t as get };
@@ -0,0 +1,2 @@
1
+ import { Path } from './shared';
2
+ export declare function has(obj: Record<string, any> | null | undefined, path: Path): boolean;
@@ -0,0 +1,12 @@
1
+ import { toPath as e } from "./shared.mjs";
2
+ // src/helpers/lodash/has.ts
3
+ function t(t, n) {
4
+ if (t === null) return !1;
5
+ let r = e(n), i = t;
6
+ for (let e of r) {
7
+ if (i == null || !(e in i)) return !1;
8
+ i = i[e];
9
+ }
10
+ return !0;
11
+ }
12
+ export { t as has };