@iota-uz/sdk 0.46.0 → 0.47.0

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 (535) hide show
  1. package/README.md +5 -0
  2. package/dist/client-host/identity.d.ts +4 -4
  3. package/dist/client-host/identity.js +2 -2
  4. package/dist/lens/{CascadePanel-Bha4qY7J.js → CascadePanel-BlYJd18G.js} +1 -1
  5. package/dist/lens/{ChartDataEquivalent-Bwgn4yYB.js → ChartDataEquivalent-B6xSOdzC.js} +1 -1
  6. package/dist/lens/{ChartPanel-BZpzBuwl.js → ChartPanel-BIJjrs5D.js} +159 -159
  7. package/dist/lens/{CoveragePanel-D40AuKkD.js → CoveragePanel-CHtXDMtt.js} +1 -1
  8. package/dist/lens/{GaugePanel-C9k2TuJH.js → GaugePanel-By0TOJPa.js} +1 -1
  9. package/dist/lens/LensDashboard.d.ts +13 -0
  10. package/dist/lens/LensDashboard.d.ts.map +1 -1
  11. package/dist/lens/{MapPanel-ZYxfDsPM.js → MapPanel-Cw4ELCiM.js} +3 -3
  12. package/dist/lens/{MetricFlowPanel-CmESLoLK.js → MetricFlowPanel-Gr5wi3nI.js} +2 -2
  13. package/dist/lens/{MetricHierarchyPanel-UZVuJ5P2.js → MetricHierarchyPanel-VLA_5LXX.js} +2 -2
  14. package/dist/lens/{MetricRelationshipPanel-CXLdScAy.js → MetricRelationshipPanel-DFP566_c.js} +2 -2
  15. package/dist/lens/{PrintReport-lrfdCTZO.js → PrintReport-C0OV1iHP.js} +5 -5
  16. package/dist/lens/{QualityChip-BYz-DHfs.js → QualityChip-DTi-0jdh.js} +1 -1
  17. package/dist/lens/SaveInvestigation-CX1Abyl8.js +309 -0
  18. package/dist/lens/TablePanel-BusKU7cU.js +994 -0
  19. package/dist/lens/{adapter-CeAqYWqm.js → adapter-CQg4-M7p.js} +7 -7
  20. package/dist/lens/contract/schemas.d.ts +2 -0
  21. package/dist/lens/contract/schemas.d.ts.map +1 -1
  22. package/dist/lens/contract/types.d.ts +12 -0
  23. package/dist/lens/contract/types.d.ts.map +1 -1
  24. package/dist/lens/{dashboardEdit-DKVE_6J_.js → dashboardEdit-CJgCVfi_.js} +1 -1
  25. package/dist/lens/explore/DrillOverlay.d.ts +38 -0
  26. package/dist/lens/explore/DrillOverlay.d.ts.map +1 -1
  27. package/dist/lens/explore/ExplorePanel.d.ts.map +1 -1
  28. package/dist/lens/explore/SaveInvestigation.d.ts +21 -0
  29. package/dist/lens/explore/SaveInvestigation.d.ts.map +1 -0
  30. package/dist/lens/explore/drillHost.d.ts +25 -0
  31. package/dist/lens/explore/drillHost.d.ts.map +1 -0
  32. package/dist/lens/explore/investigation.d.ts +174 -0
  33. package/dist/lens/explore/investigation.d.ts.map +1 -0
  34. package/dist/lens/explore/provenanceLabels.d.ts +10 -0
  35. package/dist/lens/explore/provenanceLabels.d.ts.map +1 -0
  36. package/dist/lens/index-DR7Hf8Km.js +19805 -0
  37. package/dist/lens/{index-DkVTXC8W.js → index-DZFw4cqF.js} +1 -1
  38. package/dist/lens/index.d.ts +7 -1
  39. package/dist/lens/index.d.ts.map +1 -1
  40. package/dist/lens/index.js +67 -53
  41. package/dist/lens/{install-CQ_iMuAE.js → install-B2lTK6uo.js} +1 -1
  42. package/dist/lens/{install-Ch0_qifK.js → install-BXr4Mnc0.js} +1 -1
  43. package/dist/lens/{install-CKmxqMe1.js → install-CicNQ_ks.js} +1 -1
  44. package/dist/lens/{install-BwD_xNlp.js → install-d8A0WPiw.js} +1 -1
  45. package/dist/lens/{keys-BBmWdfaH.js → keys-C-Akc9lZ.js} +2 -2
  46. package/dist/lens/panels/ChartPanel.d.ts.map +1 -1
  47. package/dist/lens/panels/TablePanel.d.ts.map +1 -1
  48. package/dist/lens/panels/actions.d.ts.map +1 -1
  49. package/dist/lens/panels/panelFailure.d.ts.map +1 -1
  50. package/dist/lens/{prefetch-BXoUIIgq.js → prefetch-C9kxuIs8.js} +2 -2
  51. package/dist/lens/{prefetchPanels-a-zs_bDm.js → prefetchPanels-gbY9RIqL.js} +1 -1
  52. package/dist/lens/{print-CpgWJxDG.js → print-CllsAP3d.js} +1 -1
  53. package/dist/lens/reports/ReportCompositionEditor.d.ts +8 -2
  54. package/dist/lens/reports/ReportCompositionEditor.d.ts.map +1 -1
  55. package/dist/lens/reports/ReportDefinitionEditor.d.ts +54 -0
  56. package/dist/lens/reports/ReportDefinitionEditor.d.ts.map +1 -0
  57. package/dist/lens/reports/ReportPicker.d.ts +6 -0
  58. package/dist/lens/reports/ReportPicker.d.ts.map +1 -1
  59. package/dist/lens/reports/dashboardEdit.d.ts +3 -0
  60. package/dist/lens/reports/dashboardEdit.d.ts.map +1 -1
  61. package/dist/lens/reports/editing.d.ts +35 -0
  62. package/dist/lens/reports/editing.d.ts.map +1 -1
  63. package/dist/lens/reports/picker.d.ts +4 -1
  64. package/dist/lens/reports/picker.d.ts.map +1 -1
  65. package/dist/lens/runtime/index.d.ts +0 -1
  66. package/dist/lens/runtime/index.d.ts.map +1 -1
  67. package/dist/lens/runtime/messages.d.ts +2 -2
  68. package/dist/lens/runtime/messages.d.ts.map +1 -1
  69. package/dist/lens/runtime/provider.d.ts +5 -1
  70. package/dist/lens/runtime/provider.d.ts.map +1 -1
  71. package/dist/lens/runtime/returnContext.d.ts +62 -0
  72. package/dist/lens/runtime/returnContext.d.ts.map +1 -0
  73. package/dist/lens/runtime/tableSummary.d.ts +9 -0
  74. package/dist/lens/runtime/tableSummary.d.ts.map +1 -0
  75. package/dist/lens/{scales-BLf9OweG.js → scales-CO6Q9RtG.js} +1 -1
  76. package/dist/lens/style.css +1 -1
  77. package/dist/runtime/README.md +24 -0
  78. package/dist/runtime/assert.d.ts +51 -0
  79. package/dist/runtime/assert.js +172 -0
  80. package/dist/runtime/build/README.txt +1 -0
  81. package/dist/runtime/build/extract.mjs +342 -0
  82. package/dist/runtime/build/shared-exports.json +388 -0
  83. package/dist/runtime/build/test-child.mjs +136 -0
  84. package/dist/runtime/build/theme/tailwind.config.js +121 -0
  85. package/dist/runtime/build/theme/theme.css +462 -0
  86. package/dist/runtime/build/theme/utilities.css +1 -0
  87. package/dist/runtime/build/vendor/lib/lib.d.ts +22 -0
  88. package/dist/runtime/build/vendor/lib/lib.decorators.d.ts +384 -0
  89. package/dist/runtime/build/vendor/lib/lib.decorators.legacy.d.ts +22 -0
  90. package/dist/runtime/build/vendor/lib/lib.dom.asynciterable.d.ts +41 -0
  91. package/dist/runtime/build/vendor/lib/lib.dom.d.ts +28983 -0
  92. package/dist/runtime/build/vendor/lib/lib.dom.iterable.d.ts +491 -0
  93. package/dist/runtime/build/vendor/lib/lib.es2015.collection.d.ts +147 -0
  94. package/dist/runtime/build/vendor/lib/lib.es2015.core.d.ts +597 -0
  95. package/dist/runtime/build/vendor/lib/lib.es2015.d.ts +28 -0
  96. package/dist/runtime/build/vendor/lib/lib.es2015.generator.d.ts +77 -0
  97. package/dist/runtime/build/vendor/lib/lib.es2015.iterable.d.ts +590 -0
  98. package/dist/runtime/build/vendor/lib/lib.es2015.promise.d.ts +81 -0
  99. package/dist/runtime/build/vendor/lib/lib.es2015.proxy.d.ts +128 -0
  100. package/dist/runtime/build/vendor/lib/lib.es2015.reflect.d.ts +144 -0
  101. package/dist/runtime/build/vendor/lib/lib.es2015.symbol.d.ts +46 -0
  102. package/dist/runtime/build/vendor/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  103. package/dist/runtime/build/vendor/lib/lib.es2016.array.include.d.ts +116 -0
  104. package/dist/runtime/build/vendor/lib/lib.es2016.d.ts +21 -0
  105. package/dist/runtime/build/vendor/lib/lib.es2016.full.d.ts +23 -0
  106. package/dist/runtime/build/vendor/lib/lib.es2016.intl.d.ts +31 -0
  107. package/dist/runtime/build/vendor/lib/lib.es2017.arraybuffer.d.ts +21 -0
  108. package/dist/runtime/build/vendor/lib/lib.es2017.d.ts +26 -0
  109. package/dist/runtime/build/vendor/lib/lib.es2017.date.d.ts +31 -0
  110. package/dist/runtime/build/vendor/lib/lib.es2017.full.d.ts +23 -0
  111. package/dist/runtime/build/vendor/lib/lib.es2017.intl.d.ts +44 -0
  112. package/dist/runtime/build/vendor/lib/lib.es2017.object.d.ts +49 -0
  113. package/dist/runtime/build/vendor/lib/lib.es2017.sharedmemory.d.ts +135 -0
  114. package/dist/runtime/build/vendor/lib/lib.es2017.string.d.ts +45 -0
  115. package/dist/runtime/build/vendor/lib/lib.es2017.typedarrays.d.ts +53 -0
  116. package/dist/runtime/build/vendor/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  117. package/dist/runtime/build/vendor/lib/lib.es2018.asynciterable.d.ts +53 -0
  118. package/dist/runtime/build/vendor/lib/lib.es2018.d.ts +24 -0
  119. package/dist/runtime/build/vendor/lib/lib.es2018.full.d.ts +24 -0
  120. package/dist/runtime/build/vendor/lib/lib.es2018.intl.d.ts +83 -0
  121. package/dist/runtime/build/vendor/lib/lib.es2018.promise.d.ts +30 -0
  122. package/dist/runtime/build/vendor/lib/lib.es2018.regexp.d.ts +37 -0
  123. package/dist/runtime/build/vendor/lib/lib.es2019.array.d.ts +79 -0
  124. package/dist/runtime/build/vendor/lib/lib.es2019.d.ts +24 -0
  125. package/dist/runtime/build/vendor/lib/lib.es2019.full.d.ts +24 -0
  126. package/dist/runtime/build/vendor/lib/lib.es2019.intl.d.ts +23 -0
  127. package/dist/runtime/build/vendor/lib/lib.es2019.object.d.ts +33 -0
  128. package/dist/runtime/build/vendor/lib/lib.es2019.string.d.ts +37 -0
  129. package/dist/runtime/build/vendor/lib/lib.es2019.symbol.d.ts +24 -0
  130. package/dist/runtime/build/vendor/lib/lib.es2020.bigint.d.ts +731 -0
  131. package/dist/runtime/build/vendor/lib/lib.es2020.d.ts +27 -0
  132. package/dist/runtime/build/vendor/lib/lib.es2020.date.d.ts +42 -0
  133. package/dist/runtime/build/vendor/lib/lib.es2020.full.d.ts +24 -0
  134. package/dist/runtime/build/vendor/lib/lib.es2020.intl.d.ts +474 -0
  135. package/dist/runtime/build/vendor/lib/lib.es2020.number.d.ts +28 -0
  136. package/dist/runtime/build/vendor/lib/lib.es2020.promise.d.ts +47 -0
  137. package/dist/runtime/build/vendor/lib/lib.es2020.sharedmemory.d.ts +99 -0
  138. package/dist/runtime/build/vendor/lib/lib.es2020.string.d.ts +44 -0
  139. package/dist/runtime/build/vendor/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  140. package/dist/runtime/build/vendor/lib/lib.es2021.d.ts +23 -0
  141. package/dist/runtime/build/vendor/lib/lib.es2021.full.d.ts +24 -0
  142. package/dist/runtime/build/vendor/lib/lib.es2021.intl.d.ts +166 -0
  143. package/dist/runtime/build/vendor/lib/lib.es2021.promise.d.ts +48 -0
  144. package/dist/runtime/build/vendor/lib/lib.es2021.string.d.ts +33 -0
  145. package/dist/runtime/build/vendor/lib/lib.es2021.weakref.d.ts +78 -0
  146. package/dist/runtime/build/vendor/lib/lib.es2022.array.d.ts +121 -0
  147. package/dist/runtime/build/vendor/lib/lib.es2022.d.ts +25 -0
  148. package/dist/runtime/build/vendor/lib/lib.es2022.error.d.ts +75 -0
  149. package/dist/runtime/build/vendor/lib/lib.es2022.full.d.ts +24 -0
  150. package/dist/runtime/build/vendor/lib/lib.es2022.intl.d.ts +121 -0
  151. package/dist/runtime/build/vendor/lib/lib.es2022.object.d.ts +26 -0
  152. package/dist/runtime/build/vendor/lib/lib.es2022.regexp.d.ts +39 -0
  153. package/dist/runtime/build/vendor/lib/lib.es2022.string.d.ts +25 -0
  154. package/dist/runtime/build/vendor/lib/lib.es2023.array.d.ts +924 -0
  155. package/dist/runtime/build/vendor/lib/lib.es2023.collection.d.ts +21 -0
  156. package/dist/runtime/build/vendor/lib/lib.es2023.d.ts +22 -0
  157. package/dist/runtime/build/vendor/lib/lib.es2023.full.d.ts +24 -0
  158. package/dist/runtime/build/vendor/lib/lib.es2023.intl.d.ts +56 -0
  159. package/dist/runtime/build/vendor/lib/lib.es2024.arraybuffer.d.ts +65 -0
  160. package/dist/runtime/build/vendor/lib/lib.es2024.collection.d.ts +29 -0
  161. package/dist/runtime/build/vendor/lib/lib.es2024.d.ts +26 -0
  162. package/dist/runtime/build/vendor/lib/lib.es2024.full.d.ts +24 -0
  163. package/dist/runtime/build/vendor/lib/lib.es2024.object.d.ts +29 -0
  164. package/dist/runtime/build/vendor/lib/lib.es2024.promise.d.ts +35 -0
  165. package/dist/runtime/build/vendor/lib/lib.es2024.regexp.d.ts +25 -0
  166. package/dist/runtime/build/vendor/lib/lib.es2024.sharedmemory.d.ts +68 -0
  167. package/dist/runtime/build/vendor/lib/lib.es2024.string.d.ts +29 -0
  168. package/dist/runtime/build/vendor/lib/lib.es5.d.ts +4585 -0
  169. package/dist/runtime/build/vendor/lib/lib.es6.d.ts +23 -0
  170. package/dist/runtime/build/vendor/lib/lib.esnext.array.d.ts +35 -0
  171. package/dist/runtime/build/vendor/lib/lib.esnext.collection.d.ts +96 -0
  172. package/dist/runtime/build/vendor/lib/lib.esnext.d.ts +25 -0
  173. package/dist/runtime/build/vendor/lib/lib.esnext.decorators.d.ts +28 -0
  174. package/dist/runtime/build/vendor/lib/lib.esnext.disposable.d.ts +193 -0
  175. package/dist/runtime/build/vendor/lib/lib.esnext.full.d.ts +24 -0
  176. package/dist/runtime/build/vendor/lib/lib.esnext.intl.d.ts +21 -0
  177. package/dist/runtime/build/vendor/lib/lib.esnext.iterator.d.ts +148 -0
  178. package/dist/runtime/build/vendor/node-types/assert/strict.d.ts +111 -0
  179. package/dist/runtime/build/vendor/node-types/assert.d.ts +1115 -0
  180. package/dist/runtime/build/vendor/node-types/async_hooks.d.ts +619 -0
  181. package/dist/runtime/build/vendor/node-types/buffer.buffer.d.ts +477 -0
  182. package/dist/runtime/build/vendor/node-types/buffer.d.ts +1941 -0
  183. package/dist/runtime/build/vendor/node-types/child_process.d.ts +1480 -0
  184. package/dist/runtime/build/vendor/node-types/cluster.d.ts +578 -0
  185. package/dist/runtime/build/vendor/node-types/compatibility/iterators.d.ts +21 -0
  186. package/dist/runtime/build/vendor/node-types/console.d.ts +453 -0
  187. package/dist/runtime/build/vendor/node-types/constants.d.ts +21 -0
  188. package/dist/runtime/build/vendor/node-types/crypto.d.ts +5484 -0
  189. package/dist/runtime/build/vendor/node-types/dgram.d.ts +715 -0
  190. package/dist/runtime/build/vendor/node-types/diagnostics_channel.d.ts +576 -0
  191. package/dist/runtime/build/vendor/node-types/dns/promises.d.ts +503 -0
  192. package/dist/runtime/build/vendor/node-types/dns.d.ts +923 -0
  193. package/dist/runtime/build/vendor/node-types/domain.d.ts +166 -0
  194. package/dist/runtime/build/vendor/node-types/events.d.ts +967 -0
  195. package/dist/runtime/build/vendor/node-types/fs/promises.d.ts +1354 -0
  196. package/dist/runtime/build/vendor/node-types/fs.d.ts +4777 -0
  197. package/dist/runtime/build/vendor/node-types/globals.d.ts +170 -0
  198. package/dist/runtime/build/vendor/node-types/globals.typedarray.d.ts +41 -0
  199. package/dist/runtime/build/vendor/node-types/http.d.ts +2246 -0
  200. package/dist/runtime/build/vendor/node-types/http2.d.ts +2882 -0
  201. package/dist/runtime/build/vendor/node-types/https.d.ts +585 -0
  202. package/dist/runtime/build/vendor/node-types/index.d.ts +101 -0
  203. package/dist/runtime/build/vendor/node-types/inspector.d.ts +323 -0
  204. package/dist/runtime/build/vendor/node-types/inspector.generated.d.ts +4406 -0
  205. package/dist/runtime/build/vendor/node-types/module.d.ts +844 -0
  206. package/dist/runtime/build/vendor/node-types/net.d.ts +1197 -0
  207. package/dist/runtime/build/vendor/node-types/os.d.ts +507 -0
  208. package/dist/runtime/build/vendor/node-types/package.json +140 -0
  209. package/dist/runtime/build/vendor/node-types/path.d.ts +200 -0
  210. package/dist/runtime/build/vendor/node-types/perf_hooks.d.ts +1054 -0
  211. package/dist/runtime/build/vendor/node-types/process.d.ts +2101 -0
  212. package/dist/runtime/build/vendor/node-types/punycode.d.ts +117 -0
  213. package/dist/runtime/build/vendor/node-types/querystring.d.ts +152 -0
  214. package/dist/runtime/build/vendor/node-types/readline/promises.d.ts +161 -0
  215. package/dist/runtime/build/vendor/node-types/readline.d.ts +600 -0
  216. package/dist/runtime/build/vendor/node-types/repl.d.ts +438 -0
  217. package/dist/runtime/build/vendor/node-types/sea.d.ts +162 -0
  218. package/dist/runtime/build/vendor/node-types/sqlite.d.ts +1182 -0
  219. package/dist/runtime/build/vendor/node-types/stream/consumers.d.ts +45 -0
  220. package/dist/runtime/build/vendor/node-types/stream/promises.d.ts +90 -0
  221. package/dist/runtime/build/vendor/node-types/stream/web.d.ts +596 -0
  222. package/dist/runtime/build/vendor/node-types/stream.d.ts +1707 -0
  223. package/dist/runtime/build/vendor/node-types/string_decoder.d.ts +67 -0
  224. package/dist/runtime/build/vendor/node-types/test.d.ts +2656 -0
  225. package/dist/runtime/build/vendor/node-types/timers/promises.d.ts +108 -0
  226. package/dist/runtime/build/vendor/node-types/timers.d.ts +285 -0
  227. package/dist/runtime/build/vendor/node-types/tls.d.ts +1314 -0
  228. package/dist/runtime/build/vendor/node-types/trace_events.d.ts +197 -0
  229. package/dist/runtime/build/vendor/node-types/ts5.6/buffer.buffer.d.ts +473 -0
  230. package/dist/runtime/build/vendor/node-types/ts5.6/compatibility/float16array.d.ts +71 -0
  231. package/dist/runtime/build/vendor/node-types/ts5.6/globals.typedarray.d.ts +36 -0
  232. package/dist/runtime/build/vendor/node-types/ts5.6/index.d.ts +103 -0
  233. package/dist/runtime/build/vendor/node-types/ts5.7/compatibility/float16array.d.ts +72 -0
  234. package/dist/runtime/build/vendor/node-types/ts5.7/index.d.ts +103 -0
  235. package/dist/runtime/build/vendor/node-types/tty.d.ts +209 -0
  236. package/dist/runtime/build/vendor/node-types/url.d.ts +1103 -0
  237. package/dist/runtime/build/vendor/node-types/util.d.ts +2379 -0
  238. package/dist/runtime/build/vendor/node-types/v8.d.ts +1010 -0
  239. package/dist/runtime/build/vendor/node-types/vm.d.ts +1160 -0
  240. package/dist/runtime/build/vendor/node-types/wasi.d.ts +202 -0
  241. package/dist/runtime/build/vendor/node-types/web-globals/abortcontroller.d.ts +34 -0
  242. package/dist/runtime/build/vendor/node-types/web-globals/crypto.d.ts +32 -0
  243. package/dist/runtime/build/vendor/node-types/web-globals/domexception.d.ts +68 -0
  244. package/dist/runtime/build/vendor/node-types/web-globals/events.d.ts +97 -0
  245. package/dist/runtime/build/vendor/node-types/web-globals/fetch.d.ts +62 -0
  246. package/dist/runtime/build/vendor/node-types/web-globals/navigator.d.ts +25 -0
  247. package/dist/runtime/build/vendor/node-types/web-globals/storage.d.ts +24 -0
  248. package/dist/runtime/build/vendor/node-types/web-globals/streams.d.ts +22 -0
  249. package/dist/runtime/build/vendor/node-types/worker_threads.d.ts +894 -0
  250. package/dist/runtime/build/vendor/node-types/zlib.d.ts +768 -0
  251. package/dist/runtime/build/vendor/node_modules/csstype/LICENSE +19 -0
  252. package/dist/runtime/build/vendor/node_modules/csstype/index.d.ts +22569 -0
  253. package/dist/runtime/build/vendor/node_modules/csstype/index.js.flow +6863 -0
  254. package/dist/runtime/build/vendor/node_modules/csstype/package.json +70 -0
  255. package/dist/runtime/build/vendor/node_modules/seroval/LICENSE +7 -0
  256. package/dist/runtime/build/vendor/node_modules/seroval/dist/cjs/development/index.cjs +4232 -0
  257. package/dist/runtime/build/vendor/node_modules/seroval/dist/cjs/production/index.cjs +3 -0
  258. package/dist/runtime/build/vendor/node_modules/seroval/dist/esm/development/index.mjs +4209 -0
  259. package/dist/runtime/build/vendor/node_modules/seroval/dist/esm/production/index.mjs +3 -0
  260. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/Serializer.d.ts +28 -0
  261. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/base-primitives.d.ts +28 -0
  262. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/compat.d.ts +15 -0
  263. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/constants.d.ts +105 -0
  264. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/constructors.d.ts +50 -0
  265. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/async-parser.d.ts +20 -0
  266. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/deserializer.d.ts +52 -0
  267. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/parser.d.ts +62 -0
  268. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/serializer.d.ts +103 -0
  269. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/sync-parser.d.ts +61 -0
  270. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/cross/index.d.ts +24 -0
  271. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/errors.d.ts +47 -0
  272. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/function-string.d.ts +3 -0
  273. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/keys.d.ts +4 -0
  274. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/literals.d.ts +10 -0
  275. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/node.d.ts +8 -0
  276. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/opaque-reference.d.ts +9 -0
  277. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/plugin.d.ts +52 -0
  278. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/reference.d.ts +6 -0
  279. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/sequence.d.ts +11 -0
  280. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/special-reference.d.ts +16 -0
  281. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/stream.d.ts +17 -0
  282. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/string.d.ts +4 -0
  283. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/symbols.d.ts +14 -0
  284. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/tree/index.d.ts +21 -0
  285. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/types.d.ts +233 -0
  286. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/error.d.ts +6 -0
  287. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/get-identifier.d.ts +2 -0
  288. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/get-object-flag.d.ts +3 -0
  289. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/is-valid-identifier.d.ts +2 -0
  290. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/promise-to-result.d.ts +2 -0
  291. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/typed-array.d.ts +6 -0
  292. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/valid-properties.d.ts +3 -0
  293. package/dist/runtime/build/vendor/node_modules/seroval/dist/types/index.d.ts +18 -0
  294. package/dist/runtime/build/vendor/node_modules/seroval/package.json +67 -0
  295. package/dist/runtime/build/vendor/node_modules/seroval/src/core/Serializer.ts +119 -0
  296. package/dist/runtime/build/vendor/node_modules/seroval/src/core/base-primitives.ts +537 -0
  297. package/dist/runtime/build/vendor/node_modules/seroval/src/core/compat.ts +23 -0
  298. package/dist/runtime/build/vendor/node_modules/seroval/src/core/constants.ts +202 -0
  299. package/dist/runtime/build/vendor/node_modules/seroval/src/core/constructors.ts +265 -0
  300. package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/async-parser.ts +666 -0
  301. package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/deserializer.ts +832 -0
  302. package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/parser.ts +335 -0
  303. package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/serializer.ts +1524 -0
  304. package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/sync-parser.ts +943 -0
  305. package/dist/runtime/build/vendor/node_modules/seroval/src/core/cross/index.ts +190 -0
  306. package/dist/runtime/build/vendor/node_modules/seroval/src/core/errors.ts +196 -0
  307. package/dist/runtime/build/vendor/node_modules/seroval/src/core/function-string.ts +31 -0
  308. package/dist/runtime/build/vendor/node_modules/seroval/src/core/keys.ts +17 -0
  309. package/dist/runtime/build/vendor/node_modules/seroval/src/core/literals.ts +43 -0
  310. package/dist/runtime/build/vendor/node_modules/seroval/src/core/node.ts +40 -0
  311. package/dist/runtime/build/vendor/node_modules/seroval/src/core/opaque-reference.ts +9 -0
  312. package/dist/runtime/build/vendor/node_modules/seroval/src/core/plugin.ts +105 -0
  313. package/dist/runtime/build/vendor/node_modules/seroval/src/core/reference.ts +66 -0
  314. package/dist/runtime/build/vendor/node_modules/seroval/src/core/sequence.ts +59 -0
  315. package/dist/runtime/build/vendor/node_modules/seroval/src/core/special-reference.ts +42 -0
  316. package/dist/runtime/build/vendor/node_modules/seroval/src/core/stream.ts +71 -0
  317. package/dist/runtime/build/vendor/node_modules/seroval/src/core/string.ts +86 -0
  318. package/dist/runtime/build/vendor/node_modules/seroval/src/core/symbols.ts +20 -0
  319. package/dist/runtime/build/vendor/node_modules/seroval/src/core/tree/index.ts +134 -0
  320. package/dist/runtime/build/vendor/node_modules/seroval/src/core/types.ts +377 -0
  321. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/error.ts +73 -0
  322. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/get-identifier.ts +18 -0
  323. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/get-object-flag.ts +14 -0
  324. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/is-valid-identifier.ts +12 -0
  325. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/promise-to-result.ts +9 -0
  326. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/typed-array.ts +56 -0
  327. package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/valid-properties.ts +34 -0
  328. package/dist/runtime/build/vendor/node_modules/seroval/src/index.ts +36 -0
  329. package/dist/runtime/build/vendor/node_modules/seroval-plugins/LICENSE +7 -0
  330. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/cjs/development/web.cjs +826 -0
  331. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/cjs/production/web.cjs +1 -0
  332. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/esm/development/web.mjs +803 -0
  333. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/esm/production/web.mjs +1 -0
  334. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/abort-signal.d.ts +3 -0
  335. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/blob.d.ts +3 -0
  336. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/custom-event.d.ts +3 -0
  337. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/dom-exception.d.ts +3 -0
  338. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/event.d.ts +3 -0
  339. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/file.d.ts +3 -0
  340. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/form-data.d.ts +3 -0
  341. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/headers.d.ts +3 -0
  342. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/image-data.d.ts +3 -0
  343. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/index.d.ts +15 -0
  344. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/readable-stream.d.ts +3 -0
  345. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/request.d.ts +3 -0
  346. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/response.d.ts +3 -0
  347. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/url-search-params.d.ts +3 -0
  348. package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/url.d.ts +3 -0
  349. package/dist/runtime/build/vendor/node_modules/seroval-plugins/package.json +70 -0
  350. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/abort-signal.ts +131 -0
  351. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/blob.ts +41 -0
  352. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/custom-event.ts +66 -0
  353. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/dom-exception.ts +57 -0
  354. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/event.ts +62 -0
  355. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/file.ts +50 -0
  356. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/form-data.ts +105 -0
  357. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/headers.ts +49 -0
  358. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/image-data.ts +74 -0
  359. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/index.ts +14 -0
  360. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/readable-stream.ts +148 -0
  361. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/request.ts +82 -0
  362. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/response.ts +65 -0
  363. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/url-search-params.ts +40 -0
  364. package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/url.ts +37 -0
  365. package/dist/runtime/build/vendor/node_modules/solid-js/dist/server.cjs +824 -0
  366. package/dist/runtime/build/vendor/node_modules/solid-js/dist/server.js +770 -0
  367. package/dist/runtime/build/vendor/node_modules/solid-js/dist/solid.cjs +1808 -0
  368. package/dist/runtime/build/vendor/node_modules/solid-js/dist/solid.js +1753 -0
  369. package/dist/runtime/build/vendor/node_modules/solid-js/jsx-runtime.d.ts +1 -0
  370. package/dist/runtime/build/vendor/node_modules/solid-js/package.json +243 -0
  371. package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/server.cjs +133 -0
  372. package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/server.js +121 -0
  373. package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/store.cjs +463 -0
  374. package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/store.js +454 -0
  375. package/dist/runtime/build/vendor/node_modules/solid-js/store/package.json +46 -0
  376. package/dist/runtime/build/vendor/node_modules/solid-js/store/types/index.d.ts +12 -0
  377. package/dist/runtime/build/vendor/node_modules/solid-js/store/types/modifiers.d.ts +6 -0
  378. package/dist/runtime/build/vendor/node_modules/solid-js/store/types/mutable.d.ts +5 -0
  379. package/dist/runtime/build/vendor/node_modules/solid-js/store/types/server.d.ts +17 -0
  380. package/dist/runtime/build/vendor/node_modules/solid-js/store/types/store.d.ts +108 -0
  381. package/dist/runtime/build/vendor/node_modules/solid-js/types/index.d.ts +23 -0
  382. package/dist/runtime/build/vendor/node_modules/solid-js/types/jsx.d.ts +4253 -0
  383. package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/array.d.ts +44 -0
  384. package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/observable.d.ts +36 -0
  385. package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/scheduler.d.ts +10 -0
  386. package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/signal.d.ts +581 -0
  387. package/dist/runtime/build/vendor/node_modules/solid-js/types/render/Suspense.d.ts +26 -0
  388. package/dist/runtime/build/vendor/node_modules/solid-js/types/render/component.d.ts +111 -0
  389. package/dist/runtime/build/vendor/node_modules/solid-js/types/render/flow.d.ts +118 -0
  390. package/dist/runtime/build/vendor/node_modules/solid-js/types/render/hydration.d.ts +24 -0
  391. package/dist/runtime/build/vendor/node_modules/solid-js/types/render/index.d.ts +4 -0
  392. package/dist/runtime/build/vendor/node_modules/solid-js/types/server/index.d.ts +3 -0
  393. package/dist/runtime/build/vendor/node_modules/solid-js/types/server/reactive.d.ts +98 -0
  394. package/dist/runtime/build/vendor/node_modules/solid-js/types/server/rendering.d.ts +160 -0
  395. package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/server.cjs +900 -0
  396. package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/server.js +786 -0
  397. package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/web.cjs +884 -0
  398. package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/web.js +772 -0
  399. package/dist/runtime/build/vendor/node_modules/solid-js/web/package.json +46 -0
  400. package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/dist/storage.cjs +12 -0
  401. package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/dist/storage.js +10 -0
  402. package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/package.json +15 -0
  403. package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/types/index.d.ts +2 -0
  404. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/client.d.ts +93 -0
  405. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/core.d.ts +2 -0
  406. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/index.d.ts +50 -0
  407. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/jsx.d.ts +1 -0
  408. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/server-mock.d.ts +65 -0
  409. package/dist/runtime/build/vendor/node_modules/solid-js/web/types/server.d.ts +187 -0
  410. package/dist/runtime/build/worker.mjs +293415 -0
  411. package/dist/runtime/catalog/sdk-natives.json +655 -0
  412. package/dist/runtime/cli/iota-ext.mjs +1028 -0
  413. package/dist/runtime/client-host/entry.d.ts +10 -0
  414. package/dist/runtime/client-host/entry.js +124 -0
  415. package/dist/runtime/client-host/hooks.d.ts +43 -0
  416. package/dist/runtime/client-host/hooks.js +94 -0
  417. package/dist/runtime/client-host/index.d.ts +9 -0
  418. package/dist/runtime/client-host/index.js +9 -0
  419. package/dist/runtime/client-host/islands.d.ts +44 -0
  420. package/dist/runtime/client-host/islands.js +165 -0
  421. package/dist/runtime/client-host/kit.d.ts +10 -0
  422. package/dist/runtime/client-host/kit.js +37 -0
  423. package/dist/runtime/client-host/page.d.ts +53 -0
  424. package/dist/runtime/client-host/page.js +217 -0
  425. package/dist/runtime/client-host/params.d.ts +8 -0
  426. package/dist/runtime/client-host/params.js +36 -0
  427. package/dist/runtime/client-host/protocol.d.ts +78 -0
  428. package/dist/runtime/client-host/protocol.js +26 -0
  429. package/dist/runtime/client-host/shared.d.ts +12 -0
  430. package/dist/runtime/client-host/shared.js +49 -0
  431. package/dist/runtime/client-host/shell.d.ts +88 -0
  432. package/dist/runtime/client-host/shell.js +195 -0
  433. package/dist/runtime/client-host/slots.d.ts +54 -0
  434. package/dist/runtime/client-host/slots.js +90 -0
  435. package/dist/runtime/client-host/styles.d.ts +7 -0
  436. package/dist/runtime/client-host/styles.js +61 -0
  437. package/dist/runtime/client-host/transport.d.ts +45 -0
  438. package/dist/runtime/client-host/transport.js +115 -0
  439. package/dist/runtime/client.d.ts +226 -0
  440. package/dist/runtime/client.js +121 -0
  441. package/dist/runtime/contracts.d.ts +204 -0
  442. package/dist/runtime/contracts.js +195 -0
  443. package/dist/runtime/docs/authoring.md +1609 -0
  444. package/dist/runtime/docs/example/docs/en/admin/limits.md +10 -0
  445. package/dist/runtime/docs/example/docs/en/getting-started.md +13 -0
  446. package/dist/runtime/docs/example/docs/en/points.md +9 -0
  447. package/dist/runtime/docs/example/docs/ru/getting-started.md +12 -0
  448. package/dist/runtime/docs/example/package.json +27 -0
  449. package/dist/runtime/docs/example/src/ClientScreen.tsx +10 -0
  450. package/dist/runtime/docs/example/src/RedemptionScreen.tsx +7 -0
  451. package/dist/runtime/docs/example/src/RewardsScreen.module.css +13 -0
  452. package/dist/runtime/docs/example/src/RewardsScreen.tsx +51 -0
  453. package/dist/runtime/docs/example/src/client.tsx +40 -0
  454. package/dist/runtime/docs/example/src/contracts.ts +132 -0
  455. package/dist/runtime/docs/example/src/css-modules.d.ts +5 -0
  456. package/dist/runtime/docs/example/src/server.test.ts +156 -0
  457. package/dist/runtime/docs/example/src/server.ts +188 -0
  458. package/dist/runtime/docs/example/tsconfig.json +16 -0
  459. package/dist/runtime/entity.d.ts +237 -0
  460. package/dist/runtime/entity.js +201 -0
  461. package/dist/runtime/fakes.d.ts +80 -0
  462. package/dist/runtime/fakes.js +88 -0
  463. package/dist/runtime/fixtures.d.ts +34 -0
  464. package/dist/runtime/fixtures.js +60 -0
  465. package/dist/runtime/help.d.ts +22 -0
  466. package/dist/runtime/help.js +51 -0
  467. package/dist/runtime/host/context.mjs +392 -0
  468. package/dist/runtime/host/errors.mjs +64 -0
  469. package/dist/runtime/host/loader.mjs +28 -0
  470. package/dist/runtime/host/protocol.mjs +4 -0
  471. package/dist/runtime/host/register.mjs +8 -0
  472. package/dist/runtime/host/sdk/assert.mjs +153 -0
  473. package/dist/runtime/host/sdk/client-host/hooks.mjs +86 -0
  474. package/dist/runtime/host/sdk/client-host/protocol.mjs +30 -0
  475. package/dist/runtime/host/sdk/client-host/slots.mjs +82 -0
  476. package/dist/runtime/host/sdk/client-host/styles.mjs +45 -0
  477. package/dist/runtime/host/sdk/client-host/transport.mjs +102 -0
  478. package/dist/runtime/host/sdk/client.mjs +115 -0
  479. package/dist/runtime/host/sdk/contracts.mjs +185 -0
  480. package/dist/runtime/host/sdk/entity.mjs +183 -0
  481. package/dist/runtime/host/sdk/fakes.mjs +88 -0
  482. package/dist/runtime/host/sdk/fixtures.mjs +56 -0
  483. package/dist/runtime/host/sdk/help.mjs +37 -0
  484. package/dist/runtime/host/sdk/index.mjs +83 -0
  485. package/dist/runtime/host/sdk/kit.mjs +11 -0
  486. package/dist/runtime/host/sdk/manifest.mjs +276 -0
  487. package/dist/runtime/host/sdk/model.mjs +4 -0
  488. package/dist/runtime/host/sdk/resource.mjs +34 -0
  489. package/dist/runtime/host/sdk/schema.mjs +75 -0
  490. package/dist/runtime/host/sdk/server.mjs +43 -0
  491. package/dist/runtime/host/sdk/testhost.mjs +992 -0
  492. package/dist/runtime/host/sdk/testing.mjs +21 -0
  493. package/dist/runtime/host/sdk/wire.mjs +207 -0
  494. package/dist/runtime/host/worker.mjs +252 -0
  495. package/dist/runtime/index.d.ts +10 -0
  496. package/dist/runtime/index.js +5 -0
  497. package/dist/runtime/kit.d.ts +5 -0
  498. package/dist/runtime/kit.js +14 -0
  499. package/dist/runtime/manifest.d.ts +17 -0
  500. package/dist/runtime/manifest.js +323 -0
  501. package/dist/runtime/model.d.ts +224 -0
  502. package/dist/runtime/model.js +3 -0
  503. package/dist/runtime/resource.d.ts +31 -0
  504. package/dist/runtime/resource.js +35 -0
  505. package/dist/runtime/schema.d.ts +97 -0
  506. package/dist/runtime/schema.js +73 -0
  507. package/dist/runtime/server.d.ts +445 -0
  508. package/dist/runtime/server.js +41 -0
  509. package/dist/runtime/testhost.d.ts +216 -0
  510. package/dist/runtime/testhost.js +1146 -0
  511. package/dist/runtime/testing.d.ts +10 -0
  512. package/dist/runtime/testing.js +7 -0
  513. package/dist/runtime/wire.d.ts +26 -0
  514. package/dist/runtime/wire.js +236 -0
  515. package/dist/sdk-identity.cjs +3 -3
  516. package/dist/sdk-identity.js +3 -3
  517. package/dist/sdk-identity.json +2 -2
  518. package/dist/solid-ui/embedded-css.d.ts +2 -0
  519. package/dist/solid-ui/embedded-css.js +1 -0
  520. package/dist/solid-ui/embedded.css +2 -0
  521. package/dist/testing/components.d.ts +73 -0
  522. package/dist/testing/components.js +96 -0
  523. package/dist/testing/htmx.d.ts +44 -0
  524. package/dist/testing/htmx.js +284 -0
  525. package/dist/testing/index.d.ts +4 -41
  526. package/dist/testing/index.js +3 -206
  527. package/dist/testing/scenarios.d.ts +83 -0
  528. package/dist/testing/scenarios.js +74 -0
  529. package/dist/testing/wait.d.ts +7 -0
  530. package/dist/testing/wait.js +19 -0
  531. package/package.json +33 -2
  532. package/dist/lens/TablePanel-C09tzJOL.js +0 -980
  533. package/dist/lens/index-DcVtZneD.js +0 -18473
  534. package/dist/lens/runtime/recovery.d.ts +0 -26
  535. package/dist/lens/runtime/recovery.d.ts.map +0 -1
@@ -0,0 +1,97 @@
1
+ import type { AnyEntity, AnyOverlay, FieldValues, Fields, RecordOf } from './entity.ts';
2
+ import type { Decimal, Int64, ISODate, ISODateTime, Json, JsonNotNull, TypeJSON, TypeKind } from './model.ts';
3
+ declare const phantom: unique symbol;
4
+ declare const refTarget: unique symbol;
5
+ /**
6
+ * What `t.json<T>()` / `field.json<T>()` accept: any JSON value but `null`, or an `interface`/object type whose
7
+ * members are JSON (interfaces have no implicit index signature, so `T extends Json` alone would reject them).
8
+ */
9
+ export type JsonConstraint<T> = JsonNotNull | ({
10
+ readonly [K in keyof T]: Json | undefined;
11
+ } & object);
12
+ export type Presence = 'req' | 'opt' | 'def';
13
+ /** Anything that names an entity (own or native). Commands, overlays and other contracts cannot be referenced by `ref`. */
14
+ export interface EntityLike {
15
+ readonly id: string;
16
+ readonly kind: 'entity';
17
+ }
18
+ /** Typed pointer to a record. Refs of different entities are not assignable to each other. */
19
+ export type Ref<E extends EntityLike = EntityLike> = {
20
+ readonly entity: E['id'];
21
+ readonly key: string;
22
+ readonly [refTarget]?: E;
23
+ };
24
+ /** The platform's user entity: the only valid target of user recipients, task assignees and `$.user`. */
25
+ export interface UserEntity extends EntityLike {
26
+ readonly id: 'core.user';
27
+ }
28
+ /** Ref to a `core.user` record. Obtain one from the kit (`ref(kit.User, id)`) or from a row's `ref`. */
29
+ export type UserRef = Ref<UserEntity>;
30
+ /** What a schema statically carries: the TS value type, whether an object key may be absent, the wire kind. */
31
+ export interface SchemaLike<T = unknown, K extends Presence = 'req', N extends TypeKind = TypeKind> {
32
+ readonly [phantom]?: {
33
+ readonly value: T;
34
+ readonly presence: K;
35
+ readonly kind: N;
36
+ };
37
+ readonly type: TypeJSON;
38
+ }
39
+ /** A wire-exact value schema. `T` is the TS value type, `K` whether an object key may be absent, `N` the wire kind. */
40
+ export interface Schema<T = unknown, K extends Presence = 'req', N extends TypeKind = TypeKind> extends SchemaLike<T, K, N> {
41
+ /** The object key may be absent (the value is not nullable: use `.nullable()` as well to allow `null`). */
42
+ optional(): Schema<T, 'opt', N>;
43
+ /** The value may be JSON null. */
44
+ nullable(): Schema<T | null, K, N>;
45
+ }
46
+ export type AnySchema = Schema<unknown, Presence, TypeKind>;
47
+ export type Infer<S> = S extends SchemaLike<infer T, infer _K, infer _N> ? T : never;
48
+ type Simplify<T> = {
49
+ [K in keyof T]: T[K];
50
+ };
51
+ export type AnySchemaLike = SchemaLike<unknown, Presence, TypeKind>;
52
+ export type Shape = Readonly<Record<string, AnySchemaLike>>;
53
+ type OptionalKeys<S extends Shape> = {
54
+ [K in keyof S]: S[K] extends SchemaLike<unknown, 'opt'> ? K : never;
55
+ }[keyof S];
56
+ export type InferObject<S extends Shape> = Simplify<{
57
+ [K in Exclude<keyof S, OptionalKeys<S>>]: Infer<S[K]>;
58
+ } & {
59
+ [K in OptionalKeys<S>]?: Infer<S[K]>;
60
+ }>;
61
+ /** Object schema; keeps its shape so route params and other structural checks can inspect the properties. */
62
+ export interface ObjectSchema<S extends Shape = Shape> extends Schema<InferObject<S>, 'req', 'object'> {
63
+ readonly shape: S;
64
+ }
65
+ export declare function makeSchema<T, K extends Presence = 'req', N extends TypeKind = TypeKind>(type: TypeJSON): Schema<T, K, N>;
66
+ export interface StringOptions {
67
+ maxLength?: number;
68
+ }
69
+ export interface DecimalOptions {
70
+ precision: number;
71
+ scale: number;
72
+ }
73
+ export declare const t: {
74
+ readonly string: (o?: StringOptions) => Schema<string, "req", "string">;
75
+ readonly int: () => Schema<number, "req", "int">;
76
+ readonly int64: () => Schema<Int64, "req", "int64">;
77
+ readonly decimal: (o: DecimalOptions) => Schema<Decimal, "req", "decimal">;
78
+ readonly bool: () => Schema<boolean, "req", "bool">;
79
+ readonly date: () => Schema<ISODate, "req", "date">;
80
+ readonly datetime: () => Schema<ISODateTime, "req", "datetime">;
81
+ readonly uuid: () => Schema<string, "req", "uuid">;
82
+ readonly enum: <const V extends readonly [string, ...string[]]>(values: V) => Schema<V[number], "req", "enum">;
83
+ /** Any JSON value except `null`; add `.nullable()` for null. `T` must be JSON (interfaces with JSON members are fine). */
84
+ readonly json: <T extends JsonConstraint<T> = JsonNotNull>() => Schema<T, "req", "json">;
85
+ readonly ref: <E extends EntityLike>(entity: E) => Schema<Ref<E>, "req", "ref">;
86
+ readonly object: <S extends Shape>(shape: S) => ObjectSchema<S>;
87
+ readonly array: <S extends AnySchema>(items: S) => Schema<Infer<S>[], "req", "array">;
88
+ /**
89
+ * The record `tx.get` / `tx.find` / `tx.insert` / `tx.update` return for `source`: `key`, `createdAt`, `updatedAt`,
90
+ * `rowVersion`, `ref` and every declared field (optional fields read `null`). Overlays: `baseKey` and the fields.
91
+ * Lets a command output return rows without re-declaring them.
92
+ */
93
+ readonly row: <E extends AnyEntity | AnyOverlay>(source: E) => Schema<RecordOf<E>>;
94
+ /** Declared fields of `source` as they read from a row (no system columns), optionally only `pick`ed keys. */
95
+ readonly fields: <E extends AnyEntity | AnyOverlay, const K extends keyof Fields<E> & string = keyof Fields<E> & string>(source: E, pick?: readonly K[]) => Schema<Simplify<Pick<FieldValues<E>, K>>>;
96
+ };
97
+ export {};
@@ -0,0 +1,73 @@
1
+ export function makeSchema(type) {
2
+ return {
3
+ type,
4
+ optional: () => makeSchema({ ...type, optional: true }),
5
+ nullable: () => makeSchema({ ...type, nullable: true }),
6
+ };
7
+ }
8
+ function scalar(kind, extra = {}) {
9
+ return makeSchema({ kind, ...extra });
10
+ }
11
+ function entityId(e) {
12
+ return e.id;
13
+ }
14
+ /** Row property types as read: every field is present (optional fields read `null`). */
15
+ function rowType(type) {
16
+ const { optional: _optional, ...rest } = type;
17
+ return rest;
18
+ }
19
+ function objectOf(properties) {
20
+ return makeSchema(properties.length > 0 ? { kind: 'object', properties } : { kind: 'object' });
21
+ }
22
+ function fieldProperties(source, pick) {
23
+ const keys = pick ?? Object.keys(source.fields);
24
+ return keys.map((name) => {
25
+ const f = source.fields[name];
26
+ if (f === undefined)
27
+ throw new Error(`${source.id}: no field "${name}"`);
28
+ return { name, type: rowType(f.type) };
29
+ });
30
+ }
31
+ const KEY_KIND = { int64: 'int64', uuid: 'uuid', string: 'string' };
32
+ export const t = {
33
+ string: (o = {}) => scalar('string', o.maxLength ? { maxLength: o.maxLength } : {}),
34
+ int: () => scalar('int'),
35
+ int64: () => scalar('int64'),
36
+ decimal: (o) => scalar('decimal', { precision: o.precision, scale: o.scale }),
37
+ bool: () => scalar('bool'),
38
+ date: () => scalar('date'),
39
+ datetime: () => scalar('datetime'),
40
+ uuid: () => scalar('uuid'),
41
+ enum: (values) => scalar('enum', { values: [...values] }),
42
+ /** Any JSON value except `null`; add `.nullable()` for null. `T` must be JSON (interfaces with JSON members are fine). */
43
+ json: () => scalar('json'),
44
+ ref: (entity) => scalar('ref', { entity: entityId(entity) }),
45
+ object: (shape) => {
46
+ const properties = Object.entries(shape).map(([name, s]) => ({ name, type: s.type }));
47
+ const base = makeSchema(properties.length > 0 ? { kind: 'object', properties } : { kind: 'object' });
48
+ return { ...base, shape };
49
+ },
50
+ array: (items) => scalar('array', { items: items.type }),
51
+ /**
52
+ * The record `tx.get` / `tx.find` / `tx.insert` / `tx.update` return for `source`: `key`, `createdAt`, `updatedAt`,
53
+ * `rowVersion`, `ref` and every declared field (optional fields read `null`). Overlays: `baseKey` and the fields.
54
+ * Lets a command output return rows without re-declaring them.
55
+ */
56
+ row: (source) => {
57
+ if ('base' in source) {
58
+ const keyKind = KEY_KIND[source.base.keyType] ?? 'string';
59
+ return objectOf([{ name: 'baseKey', type: { kind: keyKind } }, ...fieldProperties(source)]);
60
+ }
61
+ const keyKind = source.entityKind === 'native' ? (KEY_KIND[source.keyType] ?? 'string') : 'uuid';
62
+ return objectOf([
63
+ { name: 'key', type: { kind: keyKind } },
64
+ { name: 'createdAt', type: { kind: 'datetime' } },
65
+ { name: 'updatedAt', type: { kind: 'datetime' } },
66
+ { name: 'rowVersion', type: { kind: 'int' } },
67
+ { name: 'ref', type: { kind: 'ref', entity: source.id } },
68
+ ...fieldProperties(source),
69
+ ]);
70
+ },
71
+ /** Declared fields of `source` as they read from a row (no system columns), optionally only `pick`ed keys. */
72
+ fields: (source, pick) => objectOf(fieldProperties(source, pick)),
73
+ };
@@ -0,0 +1,445 @@
1
+ import type { AnyEntity, AnyOverlay, Hint, InsertOf, OrderBy, OwnEntity, PatchOf, RecordOf, RefTo, Row, Where } from './entity.ts';
2
+ import type { AtomicCommand, Callable, Command, ContactResolver, ContactTargets, DeliveryPolicy, Event, InputOf, Notice, Operation, OrdinaryCommand, Permission, Query, Workflow, SignalRef, ResultOf, OutOf } from './contracts.ts';
3
+ import type { Channel, Int64, ISODateTime, Json, JsonOf } from './model.ts';
4
+ import { RESOURCE } from './resource.ts';
5
+ import type { AnySchema, Infer, Ref, UserRef } from './schema.ts';
6
+ export type TriggerKind = 'ui' | 'mcp' | 'endpoint' | 'schedule' | 'subscription' | 'workflow';
7
+ /** A handler may return its result directly; `async` is the norm but never required. */
8
+ export type Awaitable<T> = T | Promise<T>;
9
+ /** The identity an invocation acts as: the initiating user, or the trigger's explicit owner-user. */
10
+ export interface Principal {
11
+ readonly tenantId: string;
12
+ readonly userId: Int64;
13
+ readonly kind: 'initiator' | 'owner';
14
+ readonly locale?: string;
15
+ has(permission: string | {
16
+ readonly id: string;
17
+ }): boolean;
18
+ }
19
+ export interface InvocationInfo {
20
+ readonly id: string;
21
+ readonly trigger: TriggerKind;
22
+ readonly parentId?: string;
23
+ }
24
+ export interface Logger {
25
+ debug(message: string, fields?: Readonly<Record<string, Json>>): void;
26
+ info(message: string, fields?: Readonly<Record<string, Json>>): void;
27
+ warn(message: string, fields?: Readonly<Record<string, Json>>): void;
28
+ error(message: string, fields?: Readonly<Record<string, Json>>): void;
29
+ }
30
+ /** Secrets declared in the package capabilities; resolved by the host on demand. */
31
+ export interface Secrets {
32
+ get(name: string): Promise<string>;
33
+ }
34
+ export interface FindQuery<E> {
35
+ /** Field keys, system columns or dotted ref paths such as "holder.owner". Access rules apply before filter, count and paging. */
36
+ where?: Where<E>;
37
+ /** Orderable fields and `createdAt` / `updatedAt` (also through refs). */
38
+ orderBy?: readonly OrderBy<E>[];
39
+ /** Default 100, maximum 1000. */
40
+ limit?: number;
41
+ offset?: number;
42
+ }
43
+ /** Read-only typed data access. */
44
+ export interface Reader {
45
+ get<E extends AnyEntity>(entity: E, ref: RefTo<E>): Promise<RecordOf<E> | null>;
46
+ /** Absence of an overlay row is explicit: the result is `null`, never a silent default object. */
47
+ get<O extends AnyOverlay>(overlay: O, base: RefTo<O['base']>): Promise<RecordOf<O> | null>;
48
+ find<E extends AnyEntity>(entity: E, query?: FindQuery<E>): Promise<RecordOf<E>[]>;
49
+ count<E extends AnyEntity>(entity: E, where?: Where<E>): Promise<number>;
50
+ }
51
+ /**
52
+ * Everything a read-only handler (query, guard, write rule, precheck) may use: reads, other queries, identity and log.
53
+ * There is no write API; a guard rejects by throwing `validation(Issue.at(...))` or a declared domain error.
54
+ */
55
+ export interface ReadContext extends Reader {
56
+ readonly user: Principal;
57
+ readonly invocation: InvocationInfo;
58
+ readonly log: Logger;
59
+ /** Runs another query in the same snapshot (or transaction) with the caller's rights. */
60
+ query<Q extends Query>(query: Q, input: InputOf<Q>): Promise<Infer<Q['output']>>;
61
+ }
62
+ export type QueryContext = ReadContext;
63
+ /** Context of `precheck`, `guard` and `writeRule` handlers: reads only. */
64
+ export type GuardContext = ReadContext;
65
+ type SubjectArg<S> = S extends AnyEntity ? {
66
+ subject: Ref<S>;
67
+ } : {
68
+ subject?: undefined;
69
+ };
70
+ export type EmitArgs<Ev extends AnyEvent> = {
71
+ payload: Infer<Ev['payload']>;
72
+ } & SubjectArg<Ev['subject']>;
73
+ export type Recipient = {
74
+ readonly kind: 'user';
75
+ readonly user: UserRef;
76
+ } | {
77
+ readonly kind: 'record';
78
+ readonly record: Ref;
79
+ } | {
80
+ readonly kind: 'address';
81
+ readonly address: Readonly<Partial<Record<Channel, string>>>;
82
+ };
83
+ /** Recipient ≠ subject ≠ resolved channel target. */
84
+ export declare const recipient: {
85
+ /** An ERP user: only a ref to the platform's `core.user`. */
86
+ readonly user: (user: UserRef) => Recipient;
87
+ readonly record: (record: Ref) => Recipient;
88
+ readonly address: (address: Readonly<Partial<Record<Channel, string>>>) => Recipient;
89
+ };
90
+ export type NotifyArgs<N extends AnyNotice> = {
91
+ payload: Infer<N['payload']>;
92
+ to: readonly [Recipient, ...Recipient[]];
93
+ channels: readonly [Channel, ...Channel[]];
94
+ } & SubjectArg<N['subject']>;
95
+ declare const instanceOf: unique symbol;
96
+ /** Typed handle to a started workflow instance; `tx.signal` / `ctx.signal` check the signal name and payload against it. */
97
+ export interface WorkflowInstance<W extends AnyWorkflow = AnyWorkflow> {
98
+ readonly workflow: W['id'];
99
+ /** The instance id. */
100
+ readonly instance: string;
101
+ readonly [instanceOf]?: W;
102
+ }
103
+ export interface StartOptions {
104
+ /** Dedupes the start (tenant-scoped). */
105
+ key: string;
106
+ }
107
+ /** Payload type of the signal `N` of workflow `W`. */
108
+ export type SignalPayload<W extends AnyWorkflow, N extends keyof W['signals']> = Infer<W['signals'][N]['schema']>;
109
+ /** `tx.call` accepts operations and atomic commands; anything else resolves to a readable message. */
110
+ type TxCallable<C> = C extends Callable ? C : C extends OrdinaryCommand ? Hint<'ordinary command: use ctx.call outside a transaction'> : C extends Query ? Hint<'query: use tx.query(Q, input)'> : Hint<'only operations and atomic commands can be called in a transaction'>;
111
+ /** `ctx.call` starts a command invocation; operations belong in a transaction, queries use `ctx.query`. */
112
+ type CtxCallable<C> = C extends OrdinaryCommand | AtomicCommand ? C : C extends Operation ? Hint<'operation: call it inside ctx.transaction(tx => tx.call(Op, input))'> : C extends Query ? Hint<'query: use ctx.query(Q, input)'> : Hint<'only commands can be called from a command context'>;
113
+ type WfCallable<C> = C extends OrdinaryCommand | AtomicCommand ? C : C extends Operation ? Hint<'operation: use wf.transaction(name, Op, input)'> : Hint<'only commands can be called with wf.call'>;
114
+ type AnyCallable = Callable | OrdinaryCommand | Query;
115
+ /** Generic writes take the package's own entities; anything else resolves to a readable message. */
116
+ type OwnOnly<E> = E extends OwnEntity ? E : E extends AnyEntity ? Hint<`'${E['id']}' belongs to the platform or another package: its data changes through a published operation (tx.call), not tx.insert/update/delete`> : Hint<'only entities declared by this package can be written'>;
117
+ /**
118
+ * The Go-owned transaction handle. `K` is "plain" where the caller must name a start key
119
+ * and "derived" inside subscriptions and workflows, where the host derives it.
120
+ */
121
+ export interface Tx<K extends 'plain' | 'derived' = 'plain'> extends ReadContext {
122
+ /** Own entities only; native writes go through published operations. */
123
+ insert<E extends AnyEntity>(entity: OwnOnly<E>, values: InsertOf<E>): Promise<RecordOf<E>>;
124
+ /** With `rowVersion`, fails with a version conflict unless the row is still at that version. */
125
+ update<E extends AnyEntity>(entity: OwnOnly<E>, ref: RefTo<E>, patch: PatchOf<E>, options?: {
126
+ rowVersion?: number;
127
+ }): Promise<RecordOf<E>>;
128
+ delete<E extends AnyEntity>(entity: OwnOnly<E>, ref: RefTo<E>): Promise<void>;
129
+ /** Upserts the 1:1 overlay row of `base`; omitted fields keep their value (or default). */
130
+ put<O extends AnyOverlay>(overlay: O, base: RefTo<O['base']>, values: PatchOf<O>): Promise<RecordOf<O>>;
131
+ /** Operations and atomic commands join this transaction. Ordinary commands are rejected. */
132
+ call<C extends AnyCallable>(callable: TxCallable<C>, input: InputOf<C>): Promise<ResultOf<C>>;
133
+ /** Enqueued atomically with the data. */
134
+ emit<Ev extends AnyEvent>(event: Ev, args: EmitArgs<Ev>): Promise<void>;
135
+ notify<N extends AnyNotice>(notice: N, args: NotifyArgs<N>): Promise<void>;
136
+ /**
137
+ * Property-style on purpose: parameters are compared strictly, so a `Tx<'plain'>` (key required) is never
138
+ * assignable to a `Tx<'derived'>` (key derived) and a keyless start cannot be smuggled through assignment.
139
+ */
140
+ readonly start: <W extends AnyWorkflow>(workflow: W, input: InputOf<W>, ...options: K extends 'derived' ? [options?: Partial<StartOptions>] : [options: StartOptions]) => Promise<WorkflowInstance<W>>;
141
+ /** Delivers a signal to a started instance; enqueued atomically with the data. */
142
+ signal<W extends AnyWorkflow, N extends keyof W['signals'] & string>(instance: WorkflowInstance<W>, name: N, payload: SignalPayload<W, N>): Promise<void>;
143
+ }
144
+ /** `ctx.query` is both the read-only snapshot context and the function that runs another query. */
145
+ export interface CommandQuery extends ReadContext {
146
+ <Q extends Query>(query: Q, input: InputOf<Q>): Promise<Infer<Q['output']>>;
147
+ }
148
+ export interface CommandContext {
149
+ readonly user: Principal;
150
+ readonly invocation: InvocationInfo;
151
+ readonly log: Logger;
152
+ readonly secrets: Secrets;
153
+ /** Read-only snapshot access outside any transaction; call it to run a query: `ctx.query(Q, input)`. */
154
+ readonly query: CommandQuery;
155
+ /** Opens one Go transaction. Not available inside a transaction. */
156
+ transaction<T>(callback: (tx: Tx) => Promise<T>): Promise<T>;
157
+ /** Starts a new command invocation, which selects the currently active binding. */
158
+ call<C extends AnyCallable>(command: CtxCallable<C>, input: InputOf<C>): Promise<ResultOf<C>>;
159
+ /** Delivers a signal to a started workflow instance. */
160
+ signal<W extends AnyWorkflow, N extends keyof W['signals'] & string>(instance: WorkflowInstance<W>, name: N, payload: SignalPayload<W, N>): Promise<void>;
161
+ }
162
+ /** An HTTP request as the endpoint sees it. */
163
+ export interface EndpointRequest {
164
+ readonly method: string;
165
+ readonly path: string;
166
+ readonly headers: Readonly<Record<string, string>>;
167
+ readonly query: Readonly<Record<string, string>>;
168
+ /** The JSON body, parsed; `undefined` when the body is empty or not JSON. */
169
+ readonly body: Json | undefined;
170
+ /** The exact request bytes (signature checks, non-JSON payloads). */
171
+ readonly rawBody: Uint8Array;
172
+ /** The request bytes decoded as UTF-8. */
173
+ text(): string;
174
+ }
175
+ export interface EndpointResponse {
176
+ status: number;
177
+ headers?: Readonly<Record<string, string>>;
178
+ body?: Json;
179
+ }
180
+ export interface EndpointContext extends CommandContext {
181
+ readonly request: EndpointRequest;
182
+ }
183
+ export interface ScheduleContext extends CommandContext {
184
+ /** The scheduled slot this run belongs to. */
185
+ readonly slot: ISODateTime;
186
+ }
187
+ export interface SubscriptionEvent<Ev extends AnyEvent = AnyEvent> {
188
+ readonly id: string;
189
+ readonly event: Ev['id'];
190
+ readonly occurredAt: ISODateTime;
191
+ readonly subject: Ev['subject'] extends AnyEntity ? Ref<Ev['subject']> : undefined;
192
+ readonly payload: Infer<Ev['payload']>;
193
+ /** The user who caused the event, when there is one. */
194
+ readonly initiator: Int64 | null;
195
+ }
196
+ export type Duration = `${number}${'ms' | 's' | 'm' | 'h' | 'd'}`;
197
+ export interface StepContext {
198
+ /** Stable provider idempotency key "<instance>:<name>:<n>". */
199
+ readonly idempotencyKey: string;
200
+ }
201
+ export type TaskResult<D> = {
202
+ readonly outcome: 'decided';
203
+ readonly decision: D;
204
+ readonly by: Int64;
205
+ } | {
206
+ readonly outcome: 'timeout';
207
+ };
208
+ export type SignalResult<P> = {
209
+ readonly outcome: 'received';
210
+ readonly payload: P;
211
+ } | {
212
+ readonly outcome: 'timeout';
213
+ };
214
+ /** A task for anyone holding `permission` (a committee): the first holder to decide closes it. */
215
+ export interface PermissionAssignee {
216
+ readonly permission: Permission;
217
+ }
218
+ export interface TaskSpec<S extends AnySchema> {
219
+ subject: Ref;
220
+ /**
221
+ * Who decides: a ref to a `core.user`, the acting principal, or `{ permission }` for anyone holding that permission when
222
+ * they decide. The permission must be declared by an active package (`permission(...)`); an undeclared one fails the call
223
+ * with `workflow.invalidAssignee`.
224
+ */
225
+ assignee: UserRef | Principal | PermissionAssignee;
226
+ decision: S;
227
+ timeout?: Duration;
228
+ }
229
+ /** `unknown` when `T` is JSON (interfaces with JSON members included), otherwise a message in the error text. */
230
+ export type JsonResult<T> = [T] extends [JsonOf<T>] ? unknown : Hint<'result is not JSON: use plain data, string/number/boolean/null, arrays and objects of those'>;
231
+ /** Output schema whose TS value is not JSON is rejected here; step and transaction results are journaled as JSON. */
232
+ type JsonOutput<S extends AnySchema> = Infer<S> extends JsonOf<Infer<S>> ? unknown : Hint<'output schema is not JSON'>;
233
+ /** Durable primitives. Every call takes a stable `name`; completed occurrences replay their recorded result. */
234
+ export interface WorkflowContext {
235
+ readonly user: Principal;
236
+ readonly instance: {
237
+ readonly id: string;
238
+ };
239
+ readonly log: Logger;
240
+ /** Secrets declared in the package capabilities, e.g. for the provider call of a `step`. */
241
+ readonly secrets: Secrets;
242
+ /** DB effects and the occurrence receipt commit in one Go transaction. Results must be JSON (interfaces with JSON members are fine). */
243
+ transaction<T>(name: string, callback: (tx: Tx<'derived'>) => Promise<T & JsonResult<T>>): Promise<T>;
244
+ transaction<S extends AnySchema>(name: string, options: {
245
+ output: S & JsonOutput<S>;
246
+ }, callback: (tx: Tx<'derived'>) => Promise<Infer<S>>): Promise<Infer<S>>;
247
+ transaction<C extends AnyCallable>(name: string, callable: TxCallable<C>, input: InputOf<C>): Promise<ResultOf<C>>;
248
+ /** Re-runnable external effect; at-least-once with a stable idempotency key. Results must be JSON. */
249
+ step<T>(name: string, effect: (step: StepContext) => Promise<T & JsonResult<T>>): Promise<T>;
250
+ step<S extends AnySchema>(name: string, options: {
251
+ output: S & JsonOutput<S>;
252
+ }, effect: (step: StepContext) => Promise<Infer<S>>): Promise<Infer<S>>;
253
+ sleep(name: string, duration: Duration): Promise<void>;
254
+ waitFor<S extends AnySchema>(name: string, signal: SignalRef<S>): Promise<Infer<S>>;
255
+ waitFor<S extends AnySchema>(name: string, signal: SignalRef<S>, options: {
256
+ timeout: Duration;
257
+ }): Promise<SignalResult<Infer<S>>>;
258
+ task<S extends AnySchema>(name: string, spec: TaskSpec<S>): Promise<TaskResult<Infer<S>>>;
259
+ /** New command invocation selecting the currently active binding; replay returns the receipt. */
260
+ call<C extends AnyCallable>(name: string, command: WfCallable<C>, input: InputOf<C>): Promise<ResultOf<C>>;
261
+ start<W extends AnyWorkflow>(name: string, workflow: W, input: InputOf<W>): Promise<WorkflowInstance<W>>;
262
+ /** Journaled clock and id source: deterministic across replays. */
263
+ now(name: string): Promise<ISODateTime>;
264
+ uuid(name: string): Promise<string>;
265
+ }
266
+ export interface WriteChange<E extends AnyEntity> {
267
+ readonly op: 'insert' | 'update' | 'delete';
268
+ readonly existing: Row<E> | null;
269
+ /** The record as it will be written; null on delete. */
270
+ readonly proposed: Row<E> | null;
271
+ readonly changed: readonly (keyof E['fields'] & string)[];
272
+ }
273
+ type AnyEvent = Event<string, AnyEntity | undefined, AnySchema>;
274
+ type AnyNotice = Notice<string, AnyEntity | undefined, AnySchema>;
275
+ type AnyWorkflow = Workflow<string, AnySchema, AnySchema | undefined, Readonly<Record<string, AnySchema>>>;
276
+ export type { OutOf };
277
+ export type Implementable = Query | Command | Operation | AnyWorkflow | ContactResolver | DeliveryPolicy;
278
+ /**
279
+ * What a delivery policy is asked, once per notice, channel and target about to be created for a record recipient of
280
+ * its entity. Fields are only ever added. `recipient.kind` is `'record'` today (`ref` set, `address` null); handle
281
+ * unknown kinds by allowing. `target.deviceId` is set only for a registered push device. `notice.key` is the catalog
282
+ * key of the notice (its ID with each segment in snake_case and a trailing `.vN`, for example
283
+ * `acme.insurance.renewal_reminder.v1`).
284
+ */
285
+ export interface DeliveryRequest<E extends AnyEntity> {
286
+ readonly notice: {
287
+ readonly key: string;
288
+ readonly version: number;
289
+ readonly snapshot: string;
290
+ };
291
+ readonly subject: {
292
+ readonly entity: string;
293
+ readonly key: string;
294
+ } | null;
295
+ readonly recipient: {
296
+ readonly kind: 'record';
297
+ readonly ref: Ref<E>;
298
+ readonly address: null;
299
+ };
300
+ readonly channel: 'sms' | 'email' | 'push';
301
+ readonly target: {
302
+ readonly address: string;
303
+ readonly deviceId: string | null;
304
+ };
305
+ }
306
+ /**
307
+ * The verdict of a delivery policy. A denial is recorded per target as a skipped delivery `policy_denied:<reason>`;
308
+ * `reason` is a short machine code (`[a-z0-9_.-]`, up to 64 characters) and must not contain personal data.
309
+ */
310
+ export type DeliveryDecision = {
311
+ readonly allow: true;
312
+ } | {
313
+ readonly allow: false;
314
+ readonly reason?: string;
315
+ };
316
+ /** Handler shape by contract kind. Atomic commands and operations get `Tx`; ordinary commands `CommandContext`. */
317
+ export type HandlerOf<C> = C extends Operation<string, infer I, infer O> ? (tx: Tx, input: Infer<I>) => Awaitable<OutOf<O>> : C extends Command<string, infer I, infer O, true> ? (tx: Tx, input: Infer<I>) => Awaitable<OutOf<O>> : C extends Command<string, infer I, infer O, false> ? (ctx: CommandContext, input: Infer<I>) => Awaitable<OutOf<O>> : C extends Query<string, infer I, infer O> ? (q: QueryContext, input: Infer<I>) => Awaitable<Infer<O>> : C extends Workflow<string, infer I, infer O, Readonly<Record<string, AnySchema>>> ? (wf: WorkflowContext, input: Infer<I>) => Awaitable<OutOf<O>> : C extends ContactResolver<string, infer E> ? (q: QueryContext, record: Ref<E>) => Awaitable<ContactTargets> : C extends DeliveryPolicy<string, infer E> ? (q: QueryContext, request: DeliveryRequest<E>) => Awaitable<DeliveryDecision> : never;
318
+ export interface Implementation<C extends Implementable = Implementable> {
319
+ readonly [RESOURCE]: true;
320
+ readonly serverKind: 'implementation';
321
+ readonly contract: C;
322
+ readonly handler: HandlerOf<C>;
323
+ }
324
+ /** Binds a server export to a contract by typed reference. The contract may belong to another package (replacement candidate). */
325
+ export declare function implement<C extends Implementable>(contract: C, handler: HandlerOf<C>): Implementation<C>;
326
+ export interface Subscription<Ev extends AnyEvent = AnyEvent> {
327
+ readonly [RESOURCE]: true;
328
+ readonly serverKind: 'subscription';
329
+ readonly id: string;
330
+ readonly event: Ev;
331
+ readonly handler: (tx: Tx<'derived'>, event: SubscriptionEvent<Ev>) => Awaitable<void>;
332
+ }
333
+ export declare function subscribe<Ev extends AnyEvent>(id: string, event: Ev, handler: (tx: Tx<'derived'>, event: SubscriptionEvent<Ev>) => Awaitable<void>): Subscription<Ev>;
334
+ export type GuardTarget = OrdinaryCommand | Callable | AnyEntity;
335
+ export interface PrecheckGuard<C extends OrdinaryCommand = OrdinaryCommand> {
336
+ readonly [RESOURCE]: true;
337
+ readonly serverKind: 'guard';
338
+ readonly phase: 'input';
339
+ readonly id: string;
340
+ readonly target: C;
341
+ readonly handler: (q: GuardContext, input: InputOf<C>) => Awaitable<void>;
342
+ }
343
+ export interface OperationGuard<C extends Callable = Callable> {
344
+ readonly [RESOURCE]: true;
345
+ readonly serverKind: 'guard';
346
+ readonly phase: 'operation';
347
+ readonly id: string;
348
+ readonly target: C;
349
+ readonly handler: (ctx: GuardContext, input: InputOf<C>) => Awaitable<void>;
350
+ }
351
+ export interface WriteRule<E extends AnyEntity = AnyEntity> {
352
+ readonly [RESOURCE]: true;
353
+ readonly serverKind: 'guard';
354
+ readonly phase: 'write';
355
+ readonly id: string;
356
+ readonly target: E;
357
+ readonly handler: (ctx: GuardContext, change: WriteChange<E>) => Awaitable<void>;
358
+ }
359
+ /** Any guard regardless of its target type (handler parameters erased, so `WriteRule<E>` is assignable). */
360
+ type ErasedGuard<G extends {
361
+ readonly handler: unknown;
362
+ }> = Omit<G, 'handler'> & {
363
+ readonly handler: (ctx: GuardContext, arg: never) => Awaitable<void>;
364
+ };
365
+ export type AnyGuard = ErasedGuard<PrecheckGuard> | ErasedGuard<OperationGuard> | ErasedGuard<WriteRule>;
366
+ /** Preliminary input check of an ordinary command on a read snapshot; not a race-free guarantee. Read-only context. */
367
+ export declare function precheck<C extends OrdinaryCommand>(id: string, command: C, handler: (q: GuardContext, input: InputOf<C>) => Awaitable<void>): PrecheckGuard<C>;
368
+ /**
369
+ * Additive check in the transaction of an operation or atomic command, independent of the active implementation.
370
+ * It reads that transaction's state through a read-only context and rejects by throwing; it cannot write.
371
+ */
372
+ export declare function guard<C extends Callable>(id: string, target: C, handler: (ctx: GuardContext, input: InputOf<C>) => Awaitable<void>): OperationGuard<C>;
373
+ /** Entity write rule, run in the writing transaction before the row is written. Read-only context: reject by throwing. */
374
+ export declare function writeRule<E extends AnyEntity>(id: string, entity: E, handler: (ctx: GuardContext, change: WriteChange<E>) => Awaitable<void>): WriteRule<E>;
375
+ export interface TemplateArgs<N extends AnyNotice> {
376
+ readonly payload: Infer<N['payload']>;
377
+ readonly subject: N['subject'] extends AnyEntity ? Ref<N['subject']> : undefined;
378
+ readonly locale: string;
379
+ }
380
+ type MaybePromise<T> = T | Promise<T>;
381
+ export interface EmailContent {
382
+ subject: string;
383
+ html: string;
384
+ text?: string;
385
+ }
386
+ export interface InAppContent {
387
+ title: string;
388
+ body: string;
389
+ url?: string;
390
+ }
391
+ export interface PushContent {
392
+ title: string;
393
+ body: string;
394
+ data?: Readonly<Record<string, string>>;
395
+ }
396
+ export interface TemplateSet<N extends AnyNotice> {
397
+ sms?: (args: TemplateArgs<N>) => MaybePromise<string>;
398
+ email?: (args: TemplateArgs<N>) => MaybePromise<EmailContent>;
399
+ inApp?: (args: TemplateArgs<N>) => MaybePromise<InAppContent>;
400
+ push?: (args: TemplateArgs<N>) => MaybePromise<PushContent>;
401
+ }
402
+ export interface Templates<N extends AnyNotice = AnyNotice> {
403
+ readonly [RESOURCE]: true;
404
+ readonly serverKind: 'templates';
405
+ readonly notice: N;
406
+ readonly renderers: TemplateSet<N>;
407
+ }
408
+ /** Any templates value regardless of its notice (renderer arguments erased, so `Templates<N>` is assignable). */
409
+ export interface AnyTemplates {
410
+ readonly [RESOURCE]: true;
411
+ readonly serverKind: 'templates';
412
+ readonly notice: AnyNotice;
413
+ readonly renderers: {
414
+ readonly [K in keyof TemplateSet<AnyNotice>]?: (args: never) => unknown;
415
+ };
416
+ }
417
+ export declare function templates<N extends AnyNotice>(notice: N, renderers: TemplateSet<N>): Templates<N>;
418
+ export interface Schedule {
419
+ readonly [RESOURCE]: true;
420
+ readonly serverKind: 'schedule';
421
+ readonly id: string;
422
+ readonly cron: string;
423
+ readonly timezone?: string;
424
+ readonly handler: (ctx: ScheduleContext) => Awaitable<void>;
425
+ }
426
+ /** Runs as the trigger's owner-user. `cron` is a 5-field expression, optionally with an IANA timezone. */
427
+ export declare function schedule(id: string, cron: string | {
428
+ cron: string;
429
+ timezone?: string;
430
+ }, handler: (ctx: ScheduleContext) => Awaitable<void>): Schedule;
431
+ export interface EndpointSpec {
432
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
433
+ path: string;
434
+ /** Public endpoints run as the trigger owner; authenticated ones as the calling user. */
435
+ public?: boolean;
436
+ }
437
+ export interface Endpoint {
438
+ readonly [RESOURCE]: true;
439
+ readonly serverKind: 'endpoint';
440
+ readonly id: string;
441
+ readonly spec: EndpointSpec;
442
+ readonly handler: (ctx: EndpointContext) => Awaitable<EndpointResponse>;
443
+ }
444
+ export declare function endpoint(id: string, spec: EndpointSpec, handler: (ctx: EndpointContext) => Awaitable<EndpointResponse>): Endpoint;
445
+ export type ServerValue = Implementation | Subscription | AnyGuard | Templates | Schedule | Endpoint;
@@ -0,0 +1,41 @@
1
+ import { RESOURCE } from "./resource.js";
2
+ /** Recipient ≠ subject ≠ resolved channel target. */
3
+ export const recipient = {
4
+ /** An ERP user: only a ref to the platform's `core.user`. */
5
+ user: (user) => ({ kind: 'user', user }),
6
+ record: (record) => ({ kind: 'record', record }),
7
+ address: (address) => ({ kind: 'address', address }),
8
+ };
9
+ /** Binds a server export to a contract by typed reference. The contract may belong to another package (replacement candidate). */
10
+ export function implement(contract, handler) {
11
+ return { [RESOURCE]: true, serverKind: 'implementation', contract, handler };
12
+ }
13
+ export function subscribe(id, event, handler) {
14
+ return { [RESOURCE]: true, serverKind: 'subscription', id, event, handler };
15
+ }
16
+ /** Preliminary input check of an ordinary command on a read snapshot; not a race-free guarantee. Read-only context. */
17
+ export function precheck(id, command, handler) {
18
+ return { [RESOURCE]: true, serverKind: 'guard', phase: 'input', id, target: command, handler };
19
+ }
20
+ /**
21
+ * Additive check in the transaction of an operation or atomic command, independent of the active implementation.
22
+ * It reads that transaction's state through a read-only context and rejects by throwing; it cannot write.
23
+ */
24
+ export function guard(id, target, handler) {
25
+ return { [RESOURCE]: true, serverKind: 'guard', phase: 'operation', id, target, handler };
26
+ }
27
+ /** Entity write rule, run in the writing transaction before the row is written. Read-only context: reject by throwing. */
28
+ export function writeRule(id, entity, handler) {
29
+ return { [RESOURCE]: true, serverKind: 'guard', phase: 'write', id, target: entity, handler };
30
+ }
31
+ export function templates(notice, renderers) {
32
+ return { [RESOURCE]: true, serverKind: 'templates', notice, renderers };
33
+ }
34
+ /** Runs as the trigger's owner-user. `cron` is a 5-field expression, optionally with an IANA timezone. */
35
+ export function schedule(id, cron, handler) {
36
+ const spec = typeof cron === 'string' ? { cron } : cron;
37
+ return { [RESOURCE]: true, serverKind: 'schedule', id, ...spec, handler };
38
+ }
39
+ export function endpoint(id, spec, handler) {
40
+ return { [RESOURCE]: true, serverKind: 'endpoint', id, spec, handler };
41
+ }