@toa.io/extensions.exposition 1.0.0-alpha.282 → 1.0.0-alpha.283

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 (312) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/components/exposition.octets/manifest.toa.yaml +11 -0
  3. package/components/exposition.octets/types/index.d.ts +3 -0
  4. package/components/exposition.octets/types/toa.d.ts +41 -0
  5. package/components/identity.bans/types/index.d.ts +3 -0
  6. package/components/identity.bans/types/toa.d.ts +34 -0
  7. package/components/identity.basic/manifest.toa.yaml +13 -2
  8. package/components/identity.basic/operations/add.d.ts +3 -3
  9. package/components/identity.basic/operations/authenticate.d.ts +2 -2
  10. package/components/identity.basic/operations/check.d.ts +1 -1
  11. package/components/identity.basic/operations/delete.d.ts +2 -2
  12. package/components/identity.basic/operations/incept.d.ts +2 -2
  13. package/components/identity.basic/operations/info.d.ts +1 -1
  14. package/components/identity.basic/operations/transit.d.ts +4 -3
  15. package/components/identity.basic/operations/transit.js +2 -1
  16. package/components/identity.basic/operations/transit.js.map +1 -1
  17. package/components/identity.basic/source/add.ts +3 -3
  18. package/components/identity.basic/source/authenticate.ts +2 -2
  19. package/components/identity.basic/source/check.ts +1 -1
  20. package/components/identity.basic/source/delete.ts +2 -2
  21. package/components/identity.basic/source/incept.ts +2 -2
  22. package/components/identity.basic/source/info.ts +1 -1
  23. package/components/identity.basic/source/transit.ts +6 -4
  24. package/components/identity.basic/tsconfig.tsbuildinfo +1 -1
  25. package/components/identity.basic/types/index.d.ts +21 -0
  26. package/components/identity.basic/types/toa.d.ts +121 -0
  27. package/components/identity.clients/manifest.toa.yaml +243 -0
  28. package/components/identity.clients/operations/describe.d.ts +27 -0
  29. package/components/identity.clients/operations/describe.js +44 -0
  30. package/components/identity.clients/operations/describe.js.map +1 -0
  31. package/components/identity.clients/operations/lib/Context.d.ts +29 -0
  32. package/components/identity.clients/operations/lib/Context.js +2 -0
  33. package/components/identity.clients/operations/lib/Context.js.map +1 -0
  34. package/components/identity.clients/operations/lib/Entity.d.ts +29 -0
  35. package/components/identity.clients/operations/lib/Entity.js +2 -0
  36. package/components/identity.clients/operations/lib/Entity.js.map +1 -0
  37. package/components/identity.clients/operations/lib/canonical.d.ts +11 -0
  38. package/components/identity.clients/operations/lib/canonical.js +24 -0
  39. package/components/identity.clients/operations/lib/canonical.js.map +1 -0
  40. package/components/identity.clients/operations/lib/cimd.d.ts +8 -0
  41. package/components/identity.clients/operations/lib/cimd.js +86 -0
  42. package/components/identity.clients/operations/lib/cimd.js.map +1 -0
  43. package/components/identity.clients/operations/lib/errors.d.ts +7 -0
  44. package/components/identity.clients/operations/lib/errors.js +5 -0
  45. package/components/identity.clients/operations/lib/errors.js.map +1 -0
  46. package/components/identity.clients/operations/lib/index.d.ts +6 -0
  47. package/components/identity.clients/operations/lib/index.js +7 -0
  48. package/components/identity.clients/operations/lib/index.js.map +1 -0
  49. package/components/identity.clients/operations/lib/redirect.d.ts +10 -0
  50. package/components/identity.clients/operations/lib/redirect.js +32 -0
  51. package/components/identity.clients/operations/lib/redirect.js.map +1 -0
  52. package/components/identity.clients/operations/register.d.ts +37 -0
  53. package/components/identity.clients/operations/register.js +84 -0
  54. package/components/identity.clients/operations/register.js.map +1 -0
  55. package/components/identity.clients/source/describe.ts +65 -0
  56. package/components/identity.clients/source/lib/Context.ts +38 -0
  57. package/components/identity.clients/source/lib/Entity.ts +31 -0
  58. package/components/identity.clients/source/lib/canonical.test.ts +43 -0
  59. package/components/identity.clients/source/lib/canonical.ts +27 -0
  60. package/components/identity.clients/source/lib/cimd.test.ts +120 -0
  61. package/components/identity.clients/source/lib/cimd.ts +107 -0
  62. package/components/identity.clients/source/lib/errors.ts +4 -0
  63. package/components/identity.clients/source/lib/index.ts +6 -0
  64. package/components/identity.clients/source/lib/redirect.test.ts +41 -0
  65. package/components/identity.clients/source/lib/redirect.ts +35 -0
  66. package/components/identity.clients/source/register.ts +125 -0
  67. package/components/identity.clients/tsconfig.json +10 -0
  68. package/components/identity.clients/tsconfig.tsbuildinfo +1 -0
  69. package/components/identity.clients/types/index.d.ts +3 -0
  70. package/components/identity.clients/types/toa.d.ts +109 -0
  71. package/components/identity.credentials/operations/list.d.ts +2 -1
  72. package/components/identity.credentials/operations/list.js.map +1 -1
  73. package/components/identity.credentials/source/list.ts +2 -1
  74. package/components/identity.credentials/tsconfig.tsbuildinfo +1 -1
  75. package/components/identity.credentials/types/index.d.ts +3 -0
  76. package/components/identity.credentials/types/toa.d.ts +30 -0
  77. package/components/identity.federation/manifest.toa.yaml +37 -1
  78. package/components/identity.federation/operations/authenticate.d.ts +1 -1
  79. package/components/identity.federation/operations/lib/Ctx.d.ts +2 -2
  80. package/components/identity.federation/operations/lib/decode.js +22 -8
  81. package/components/identity.federation/operations/lib/decode.js.map +1 -1
  82. package/components/identity.federation/operations/lib/errors.d.ts +7 -0
  83. package/components/identity.federation/operations/lib/errors.js +4 -0
  84. package/components/identity.federation/operations/lib/errors.js.map +1 -1
  85. package/components/identity.federation/operations/lib/exchange.js +11 -6
  86. package/components/identity.federation/operations/lib/exchange.js.map +1 -1
  87. package/components/identity.federation/operations/types/configuration.d.ts +1 -1
  88. package/components/identity.federation/operations/types/context.d.ts +3 -2
  89. package/components/identity.federation/source/authenticate.ts +1 -1
  90. package/components/identity.federation/source/lib/Ctx.ts +2 -2
  91. package/components/identity.federation/source/lib/decode.ts +25 -9
  92. package/components/identity.federation/source/lib/errors.ts +5 -0
  93. package/components/identity.federation/source/lib/exchange.ts +11 -7
  94. package/components/identity.federation/source/types/configuration.ts +1 -1
  95. package/components/identity.federation/source/types/context.ts +3 -2
  96. package/components/identity.federation/tsconfig.tsbuildinfo +1 -1
  97. package/components/identity.federation/types/index.d.ts +3 -0
  98. package/components/identity.federation/types/toa.d.ts +127 -0
  99. package/components/identity.grants/manifest.toa.yaml +245 -0
  100. package/components/identity.grants/operations/authorize.d.ts +35 -0
  101. package/components/identity.grants/operations/authorize.js +54 -0
  102. package/components/identity.grants/operations/authorize.js.map +1 -0
  103. package/components/identity.grants/operations/exchange.d.ts +37 -0
  104. package/components/identity.grants/operations/exchange.js +89 -0
  105. package/components/identity.grants/operations/exchange.js.map +1 -0
  106. package/components/identity.grants/operations/lib/code.d.ts +15 -0
  107. package/components/identity.grants/operations/lib/code.js +30 -0
  108. package/components/identity.grants/operations/lib/code.js.map +1 -0
  109. package/components/identity.grants/operations/lib/identify.d.ts +6 -0
  110. package/components/identity.grants/operations/lib/identify.js +15 -0
  111. package/components/identity.grants/operations/lib/identify.js.map +1 -0
  112. package/components/identity.grants/operations/lib/index.d.ts +3 -0
  113. package/components/identity.grants/operations/lib/index.js +3 -0
  114. package/components/identity.grants/operations/lib/index.js.map +1 -0
  115. package/components/identity.grants/operations/list.d.ts +13 -0
  116. package/components/identity.grants/operations/list.js +18 -0
  117. package/components/identity.grants/operations/list.js.map +1 -0
  118. package/components/identity.grants/operations/revoke.d.ts +18 -0
  119. package/components/identity.grants/operations/revoke.js +25 -0
  120. package/components/identity.grants/operations/revoke.js.map +1 -0
  121. package/components/identity.grants/source/authorize.ts +90 -0
  122. package/components/identity.grants/source/exchange.ts +130 -0
  123. package/components/identity.grants/source/lib/code.ts +39 -0
  124. package/components/identity.grants/source/lib/identify.ts +16 -0
  125. package/components/identity.grants/source/lib/index.ts +3 -0
  126. package/components/identity.grants/source/list.ts +28 -0
  127. package/components/identity.grants/source/revoke.ts +38 -0
  128. package/components/identity.grants/tsconfig.json +10 -0
  129. package/components/identity.grants/tsconfig.tsbuildinfo +1 -0
  130. package/components/identity.grants/types/index.d.ts +60 -0
  131. package/components/identity.grants/types/toa.d.ts +108 -0
  132. package/components/identity.keys/manifest.toa.yaml +1 -0
  133. package/components/identity.keys/operations/create.d.ts +1 -1
  134. package/components/identity.keys/operations/revoke.d.ts +1 -1
  135. package/components/identity.keys/source/create.ts +1 -1
  136. package/components/identity.keys/source/revoke.ts +1 -1
  137. package/components/identity.keys/tsconfig.tsbuildinfo +1 -1
  138. package/components/identity.keys/types/index.d.ts +3 -0
  139. package/components/identity.keys/types/toa.d.ts +47 -0
  140. package/components/identity.otp/operations/lib/Context.d.ts +4 -2
  141. package/components/identity.otp/source/lib/Context.ts +4 -2
  142. package/components/identity.otp/tsconfig.tsbuildinfo +1 -1
  143. package/components/identity.otp/types/index.d.ts +3 -0
  144. package/components/identity.otp/types/toa.d.ts +56 -0
  145. package/components/identity.passkeys/manifest.toa.yaml +3 -0
  146. package/components/identity.passkeys/operations/authenticate.d.ts +1 -1
  147. package/components/identity.passkeys/operations/challenge.d.ts +1 -1
  148. package/components/identity.passkeys/operations/create.d.ts +1 -1
  149. package/components/identity.passkeys/operations/types/Context.d.ts +2 -1
  150. package/components/identity.passkeys/operations/use.d.ts +1 -1
  151. package/components/identity.passkeys/source/authenticate.ts +1 -1
  152. package/components/identity.passkeys/source/challenge.ts +1 -1
  153. package/components/identity.passkeys/source/create.ts +1 -1
  154. package/components/identity.passkeys/source/types/Context.ts +2 -1
  155. package/components/identity.passkeys/source/use.ts +1 -1
  156. package/components/identity.passkeys/tsconfig.tsbuildinfo +1 -1
  157. package/components/identity.passkeys/types/index.d.ts +3 -0
  158. package/components/identity.passkeys/types/toa.d.ts +120 -0
  159. package/components/identity.roles/operations/principal.d.ts +1 -1
  160. package/components/identity.roles/source/principal.ts +1 -1
  161. package/components/identity.roles/tsconfig.tsbuildinfo +1 -1
  162. package/components/identity.roles/types/index.d.ts +3 -0
  163. package/components/identity.roles/types/toa.d.ts +43 -0
  164. package/components/identity.tokens/manifest.toa.yaml +34 -3
  165. package/components/identity.tokens/operations/authenticate.d.ts +2 -1
  166. package/components/identity.tokens/operations/authenticate.js +8 -0
  167. package/components/identity.tokens/operations/authenticate.js.map +1 -1
  168. package/components/identity.tokens/operations/decrypt.d.ts +2 -1
  169. package/components/identity.tokens/operations/decrypt.js +2 -2
  170. package/components/identity.tokens/operations/decrypt.js.map +1 -1
  171. package/components/identity.tokens/operations/encrypt.d.ts +2 -1
  172. package/components/identity.tokens/operations/encrypt.js.map +1 -1
  173. package/components/identity.tokens/operations/issue.d.ts +2 -1
  174. package/components/identity.tokens/operations/issue.js +2 -1
  175. package/components/identity.tokens/operations/issue.js.map +1 -1
  176. package/components/identity.tokens/operations/lib/form.d.ts +8 -0
  177. package/components/identity.tokens/operations/lib/form.js +24 -0
  178. package/components/identity.tokens/operations/lib/form.js.map +1 -0
  179. package/components/identity.tokens/operations/lib/index.d.ts +2 -1
  180. package/components/identity.tokens/operations/lib/index.js +1 -1
  181. package/components/identity.tokens/operations/lib/index.js.map +1 -1
  182. package/components/identity.tokens/source/authenticate.test.ts +8 -5
  183. package/components/identity.tokens/source/authenticate.ts +12 -1
  184. package/components/identity.tokens/source/decrypt.test.ts +1 -1
  185. package/components/identity.tokens/source/decrypt.ts +4 -3
  186. package/components/identity.tokens/source/encrypt.test.ts +1 -1
  187. package/components/identity.tokens/source/encrypt.ts +2 -1
  188. package/components/identity.tokens/source/issue.test.ts +71 -0
  189. package/components/identity.tokens/source/issue.ts +4 -2
  190. package/components/identity.tokens/source/lib/form.test.ts +25 -0
  191. package/components/identity.tokens/source/lib/form.ts +31 -0
  192. package/components/identity.tokens/source/lib/index.ts +2 -1
  193. package/components/identity.tokens/tsconfig.tsbuildinfo +1 -1
  194. package/components/identity.tokens/types/index.d.ts +61 -0
  195. package/components/identity.tokens/types/toa.d.ts +113 -0
  196. package/documentation/cache.md +10 -1
  197. package/documentation/consent.md +101 -0
  198. package/documentation/identity.md +3 -1
  199. package/documentation/io.md +36 -2
  200. package/documentation/oauth.md +179 -0
  201. package/documentation/protocol.md +4 -0
  202. package/features/auth.bearer.feature +120 -0
  203. package/features/cache.feature +46 -0
  204. package/features/oauth.clients.feature +195 -0
  205. package/features/oauth.discovery.feature +165 -0
  206. package/features/oauth.grants.feature +286 -0
  207. package/features/steps/Gateway.ts +6 -1
  208. package/features/steps/Parameters.ts +4 -0
  209. package/features/steps/components/echo/manifest.toa.yaml +2 -0
  210. package/features/steps/components/octets.tester/manifest.toa.yaml +2 -0
  211. package/features/steps/components/octets.tester/operations/redirect.js +6 -1
  212. package/features/steps/components/users/manifest.toa.yaml +1 -0
  213. package/package.json +8 -6
  214. package/readme.md +3 -0
  215. package/schemas/annotation.cos.yaml +30 -0
  216. package/source/Annotation.ts +23 -0
  217. package/source/Factory.ts +1 -1
  218. package/source/HTTP/Server.ts +9 -5
  219. package/source/HTTP/formats/form.ts +21 -0
  220. package/source/HTTP/formats/index.ts +17 -2
  221. package/source/HTTP/messages.test.ts +25 -1
  222. package/source/HTTP/messages.ts +10 -3
  223. package/source/Interception.ts +8 -2
  224. package/source/deployment.ts +4 -1
  225. package/source/directives/auth/Authorization.ts +46 -19
  226. package/source/directives/auth/Incept.ts +14 -9
  227. package/source/directives/auth/schemes.test.ts +8 -4
  228. package/source/directives/auth/schemes.ts +22 -9
  229. package/source/directives/auth/types.ts +5 -2
  230. package/source/directives/cache/Cache.ts +13 -4
  231. package/source/directives/cache/Control.ts +0 -3
  232. package/source/directives/flow/Fetch.ts +1 -1
  233. package/source/directives/index.ts +2 -1
  234. package/source/directives/io/IO.ts +2 -0
  235. package/source/directives/io/Output.ts +4 -1
  236. package/source/directives/io/Status.test.ts +84 -0
  237. package/source/directives/io/Status.ts +46 -0
  238. package/source/directives/oauth/Discovery.ts +76 -0
  239. package/source/directives/oauth/documents.ts +113 -0
  240. package/source/directives/oauth/index.ts +3 -0
  241. package/source/directives/octets/Delete.ts +1 -1
  242. package/source/directives/octets/Get.ts +1 -1
  243. package/source/directives/octets/Workflow.ts +1 -1
  244. package/source/directives/octets/workflows/Execution.ts +1 -1
  245. package/source/index.ts +6 -0
  246. package/source/octets.d.ts +17 -0
  247. package/source/userland.ts +47 -0
  248. package/transpiled/Annotation.d.ts +17 -0
  249. package/transpiled/Factory.js +1 -1
  250. package/transpiled/Factory.js.map +1 -1
  251. package/transpiled/HTTP/Server.d.ts +4 -1
  252. package/transpiled/HTTP/Server.js +4 -3
  253. package/transpiled/HTTP/Server.js.map +1 -1
  254. package/transpiled/HTTP/formats/form.d.ts +9 -0
  255. package/transpiled/HTTP/formats/form.js +18 -0
  256. package/transpiled/HTTP/formats/form.js.map +1 -0
  257. package/transpiled/HTTP/formats/index.d.ts +10 -2
  258. package/transpiled/HTTP/formats/index.js +10 -0
  259. package/transpiled/HTTP/formats/index.js.map +1 -1
  260. package/transpiled/HTTP/messages.d.ts +6 -0
  261. package/transpiled/HTTP/messages.js +3 -3
  262. package/transpiled/HTTP/messages.js.map +1 -1
  263. package/transpiled/Interception.d.ts +4 -1
  264. package/transpiled/Interception.js +4 -2
  265. package/transpiled/Interception.js.map +1 -1
  266. package/transpiled/deployment.js +2 -0
  267. package/transpiled/deployment.js.map +1 -1
  268. package/transpiled/directives/auth/Authorization.d.ts +1 -1
  269. package/transpiled/directives/auth/Authorization.js +38 -18
  270. package/transpiled/directives/auth/Authorization.js.map +1 -1
  271. package/transpiled/directives/auth/Incept.d.ts +1 -1
  272. package/transpiled/directives/auth/Incept.js +11 -7
  273. package/transpiled/directives/auth/Incept.js.map +1 -1
  274. package/transpiled/directives/auth/schemes.d.ts +16 -4
  275. package/transpiled/directives/auth/schemes.js +20 -8
  276. package/transpiled/directives/auth/schemes.js.map +1 -1
  277. package/transpiled/directives/auth/types.d.ts +4 -2
  278. package/transpiled/directives/cache/Cache.js +9 -2
  279. package/transpiled/directives/cache/Cache.js.map +1 -1
  280. package/transpiled/directives/cache/Control.js +0 -2
  281. package/transpiled/directives/cache/Control.js.map +1 -1
  282. package/transpiled/directives/index.js +2 -1
  283. package/transpiled/directives/index.js.map +1 -1
  284. package/transpiled/directives/io/IO.js +2 -0
  285. package/transpiled/directives/io/IO.js.map +1 -1
  286. package/transpiled/directives/io/Output.js +4 -1
  287. package/transpiled/directives/io/Output.js.map +1 -1
  288. package/transpiled/directives/io/Status.d.ts +19 -0
  289. package/transpiled/directives/io/Status.js +34 -0
  290. package/transpiled/directives/io/Status.js.map +1 -0
  291. package/transpiled/directives/oauth/Discovery.d.ts +23 -0
  292. package/transpiled/directives/oauth/Discovery.js +58 -0
  293. package/transpiled/directives/oauth/Discovery.js.map +1 -0
  294. package/transpiled/directives/oauth/documents.d.ts +9 -0
  295. package/transpiled/directives/oauth/documents.js +82 -0
  296. package/transpiled/directives/oauth/documents.js.map +1 -0
  297. package/transpiled/directives/oauth/index.d.ts +2 -0
  298. package/transpiled/directives/oauth/index.js +3 -0
  299. package/transpiled/directives/oauth/index.js.map +1 -0
  300. package/transpiled/index.d.ts +2 -0
  301. package/transpiled/userland.d.ts +39 -0
  302. package/transpiled/userland.js +7 -0
  303. package/transpiled/userland.js.map +1 -0
  304. package/tsconfig.tsbuildinfo +1 -1
  305. package/components/identity.basic/operations/types.d.ts +0 -61
  306. package/components/identity.basic/operations/types.js +0 -2
  307. package/components/identity.basic/operations/types.js.map +0 -1
  308. package/components/identity.basic/source/types.ts +0 -69
  309. package/components/identity.tokens/operations/lib/types.d.ts +0 -88
  310. package/components/identity.tokens/operations/lib/types.js +0 -2
  311. package/components/identity.tokens/operations/lib/types.js.map +0 -1
  312. package/components/identity.tokens/source/lib/types.ts +0 -102
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.283](https://github.com/toa-io/toa/compare/v1.0.0-alpha.282...v1.0.0-alpha.283) (2026-09-04)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **cli:** an assignment hands back the new state, not nothing ([91304e9](https://github.com/toa-io/toa/commit/91304e9e9a3bba5933b7421b7a0ffff0c2e47795))
11
+ * **exposition:** declare error codes as the operations return them ([a9007c0](https://github.com/toa-io/toa/commit/a9007c0dd1b199429af50fb57441281bb19ff971))
12
+ * **exposition:** declare the errors the built-in components return ([27200c3](https://github.com/toa-io/toa/commit/27200c348ab09068d58c52c3e83208cb29cd7290))
13
+ * **exposition:** look up an authority by a key an object does not answer ([cea57f5](https://github.com/toa-io/toa/commit/cea57f5010530b13fd20becfc69f2b243da95544))
14
+ * **exposition:** read the configured token lifetime in seconds ([60486c6](https://github.com/toa-io/toa/commit/60486c6c2d2ba97caa9d01ab755351c99a156806))
15
+ * **exposition:** reject a malformed Bearer rather than failing on it ([2b1a46d](https://github.com/toa-io/toa/commit/2b1a46d5b3d2abb64703b10b1543749baeac7596))
16
+ * **storages:** take `Maybe` from core, not from the deprecated package ([bcaeeb3](https://github.com/toa-io/toa/commit/bcaeeb3c76c89af34e94ff569a210d21b7e87f64))
17
+
18
+ ### Features
19
+
20
+ * **cli:** a type module is declarations, so it sits beside a component's source ([ca755d9](https://github.com/toa-io/toa/commit/ca755d93d1a04b7697dd0dd12eb59e5b6e2a71d1))
21
+ * **cli:** generate an application's types from its manifests ([195ac94](https://github.com/toa-io/toa/commit/195ac94de0d8c9de995847599511782c399768a5))
22
+ * **cli:** the built-in components ship types generated from their manifests ([bd7db9e](https://github.com/toa-io/toa/commit/bd7db9e88e46c1060223761898932239127f389a))
23
+ * **exposition:** grant a client what a user allowed it ([95ef0cf](https://github.com/toa-io/toa/commit/95ef0cf6bcbb43580710ff9ce3e1d9e33c0f4963))
24
+ * **exposition:** know what an OAuth client is ([5e101c8](https://github.com/toa-io/toa/commit/5e101c865f4bb75c01e7b5c637bfcd41f84c17e4))
25
+ * **exposition:** let an operation state the status of its reply ([427864d](https://github.com/toa-io/toa/commit/427864d88f1c33a762b4b0f33489ad17eb7fb470))
26
+ * **exposition:** let several providers claim one authentication scheme ([514177b](https://github.com/toa-io/toa/commit/514177b546fbd9fafe35c178cb38774f3e2f862a))
27
+ * **exposition:** read a request sent as a form ([02fac86](https://github.com/toa-io/toa/commit/02fac86af392525fa374f16f51f1b3b07365b042))
28
+ * **exposition:** serve OAuth discovery and challenge with it ([418890c](https://github.com/toa-io/toa/commit/418890cb30eb1dd041073a75f971b5820ae40a95))
29
+ * **exposition:** set an exact cache-control whatever the method ([22f939a](https://github.com/toa-io/toa/commit/22f939a7a855d5ae2cfebb517caec98b8ca95de0))
30
+ * **extensions:** an extension declares what it puts on a component's context ([133bc2a](https://github.com/toa-io/toa/commit/133bc2aad1e45a2d4aa68a08a5e44ca48d3b7414))
31
+
32
+
6
33
  # [1.0.0-alpha.282](https://github.com/toa-io/toa/compare/v1.0.0-alpha.281...v1.0.0-alpha.282) (2026-09-03)
7
34
 
8
35
  ### Bug Fixes
@@ -27,8 +27,19 @@ operations:
27
27
  - LOCATION_LENGTH
28
28
  - LOCATION_UNAVAILABLE
29
29
  - INVALID_ID
30
+ # what the storage refuses with, passed on
31
+ - NOT_FOUND
32
+ - LIMIT_EXCEEDED
33
+ - NOT_ACCEPTABLE
34
+ - TYPE_MISMATCH
30
35
  get: &simple
31
36
  bindings: ~
37
+ # what the storage refuses with, passed on
38
+ errors:
39
+ - NOT_FOUND
40
+ - LIMIT_EXCEEDED
41
+ - NOT_ACCEPTABLE
42
+ - TYPE_MISMATCH
32
43
  input:
33
44
  properties:
34
45
  range:
@@ -0,0 +1,3 @@
1
+ export * from './toa.js'
2
+
3
+ // What a manifest does not state belongs here, and every run keeps it.
@@ -0,0 +1,41 @@
1
+ // Written by `toa types`. Every run rewrites it.
2
+ // What a manifest does not state belongs in a file of your own.
3
+
4
+ import type { RemoteError } from '@toa.io/core'
5
+
6
+ export type PutInput = {
7
+ location?: string
8
+ accept?: string
9
+ limit?: number
10
+ trust?: unknown
11
+ storage: string
12
+ request: unknown
13
+ }
14
+
15
+ export type GetInput = {
16
+ range?: string
17
+ agent?: string
18
+ storage: string
19
+ path: string
20
+ }
21
+
22
+ export type HeadInput = {
23
+ range?: string
24
+ agent?: string
25
+ storage: string
26
+ path: string
27
+ }
28
+
29
+ export type DeleteInput = {
30
+ range?: string
31
+ agent?: string
32
+ storage: string
33
+ path: string
34
+ }
35
+
36
+ export interface Component {
37
+ put: (request: { input: PutInput, task?: boolean }) => Promise<unknown | RemoteError<"LOCATION_UNTRUSTED" | "LOCATION_LENGTH" | "LOCATION_UNAVAILABLE" | "INVALID_ID" | "NOT_FOUND" | "LIMIT_EXCEEDED" | "NOT_ACCEPTABLE" | "TYPE_MISMATCH">>
38
+ get: (request: { input: GetInput, task?: boolean }) => Promise<unknown | RemoteError<"NOT_FOUND" | "LIMIT_EXCEEDED" | "NOT_ACCEPTABLE" | "TYPE_MISMATCH">>
39
+ head: (request: { input: HeadInput, task?: boolean }) => Promise<unknown | RemoteError<"NOT_FOUND" | "LIMIT_EXCEEDED" | "NOT_ACCEPTABLE" | "TYPE_MISMATCH">>
40
+ delete: (request: { input: DeleteInput, task?: boolean }) => Promise<unknown | RemoteError<"NOT_FOUND" | "LIMIT_EXCEEDED" | "NOT_ACCEPTABLE" | "TYPE_MISMATCH">>
41
+ }
@@ -0,0 +1,3 @@
1
+ export * from './toa.js'
2
+
3
+ // What a manifest does not state belongs here, and every run keeps it.
@@ -0,0 +1,34 @@
1
+ // Written by `toa types`. Every run rewrites it.
2
+ // What a manifest does not state belongs in a file of your own.
3
+
4
+ import type { Query } from '@toa.io/core'
5
+ import type { Readable } from 'node:stream'
6
+
7
+ export interface Entity {
8
+ comment?: string
9
+ banned: boolean
10
+ originator: string
11
+ id: string
12
+ _version?: number
13
+ _created?: number
14
+ _updated?: number
15
+ _deleted?: number | null
16
+ }
17
+
18
+ export type TransitInput = {
19
+ comment?: string
20
+ banned: boolean
21
+ originator: {
22
+ id?: string
23
+ }
24
+ }
25
+
26
+ export interface Component {
27
+ transit: (request: { input: TransitInput, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
28
+ assign: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
29
+ ensure: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
30
+ enumerate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity[]>
31
+ observe: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity | null>
32
+ stream: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Readable>
33
+ terminate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
34
+ }
@@ -26,6 +26,11 @@ entity:
26
26
  operations:
27
27
  transit:
28
28
  concurrency: retry
29
+ output: &id
30
+ type: object
31
+ required: [id]
32
+ properties:
33
+ id: { type: string }
29
34
  input:
30
35
  properties:
31
36
  username:
@@ -34,6 +39,9 @@ operations:
34
39
  type: string
35
40
  authority:
36
41
  type: string
42
+ inception:
43
+ description: Whether the credentials are being created rather than changed
44
+ type: boolean
37
45
  type: object
38
46
  errors: &transit.errors
39
47
  - PRINCIPAL_LOCKED
@@ -127,8 +135,7 @@ operations:
127
135
  minLength: 1
128
136
  required:
129
137
  - username
130
- output:
131
- {}
138
+ output: { type: 'null' }
132
139
  info:
133
140
  input:
134
141
  properties:
@@ -168,9 +175,11 @@ configuration:
168
175
  rounds:
169
176
  type: integer
170
177
  default: 10
178
+ minimum: 1
171
179
  pepper:
172
180
  description: Hashing pepper, a secret
173
181
  type: string
182
+ format: secret
174
183
  principal:
175
184
  description: Basic credentials whose Identity is granted the `system` role
176
185
  type: object
@@ -195,6 +204,8 @@ configuration:
195
204
  type: string
196
205
  default:
197
206
  - ^.{8,32}$
207
+ # every one of them has a default, so the component reads them without checking
208
+ required: [rounds, username, password]
198
209
 
199
210
  exposition:
200
211
  isolated: true
@@ -1,3 +1,3 @@
1
- import type { AddInput, Context, IdOutput } from './types.js';
2
- import type { Maybe } from '@toa.io/types';
3
- export declare function effect(input: AddInput, context: Context): Promise<Maybe<IdOutput>>;
1
+ import type { AddInput, Context, TransitOutput } from '../types/index.js';
2
+ import type { Maybe } from '@toa.io/core';
3
+ export declare function effect(input: AddInput, context: Context): Promise<Maybe<TransitOutput>>;
@@ -1,5 +1,5 @@
1
- import { type Maybe } from '@toa.io/types';
2
- import { type Context } from './types.js';
1
+ import { type Maybe } from '@toa.io/core';
2
+ import { type Context } from '../types/index.js';
3
3
  export declare function computation(input: Input, context: Context): Promise<Maybe<Output>>;
4
4
  interface Input {
5
5
  authority: string;
@@ -1,4 +1,4 @@
1
- import type { Context } from './types.js';
1
+ import type { Context } from '../types/index.js';
2
2
  export declare function computation(input: Input, context: Context): Promise<void | null | Error>;
3
3
  interface Input {
4
4
  authority: string;
@@ -1,5 +1,5 @@
1
- import type { Context } from './types.js';
2
- export declare function effect({ authority, identity }: Input, context: Context): Promise<void | null>;
1
+ import type { Context, Entity } from '../types/index.js';
2
+ export declare function effect({ authority, identity }: Input, context: Context): Promise<Entity | null>;
3
3
  interface Input {
4
4
  authority: string;
5
5
  identity: string;
@@ -1,5 +1,5 @@
1
- import type { Context } from './types.js';
2
- import type { Maybe } from '@toa.io/types';
1
+ import type { Context } from '../types/index.js';
2
+ import type { Maybe } from '@toa.io/core';
3
3
  export declare function effect(input: Input, context: Context): Promise<Maybe<Output>>;
4
4
  interface Input {
5
5
  authority: string;
@@ -1,4 +1,4 @@
1
- import type { Context, Entity } from './types.js';
1
+ import type { Context, Entity } from '../types/index.js';
2
2
  export declare function effect({ authority, identity }: Input, context: Context): Promise<Output | null>;
3
3
  interface Input {
4
4
  authority: string;
@@ -1,5 +1,6 @@
1
- import type { Maybe, Operation } from '@toa.io/types';
2
- import type { Context, Entity, TransitInput, IdOutput } from './types.js';
1
+ import type { Maybe } from '@toa.io/core';
2
+ import type { Operation } from '@toa.io/bridges.node';
3
+ import type { Context, Entity, TransitInput, TransitOutput } from '../types/index.js';
3
4
  export declare class Transition implements Operation {
4
5
  private rounds;
5
6
  private pepper;
@@ -10,5 +11,5 @@ export declare class Transition implements Operation {
10
11
  private passwordRx;
11
12
  mount(context: Context): void;
12
13
  private locked;
13
- execute(input: TransitInput, object: Entity): Promise<Maybe<IdOutput>>;
14
+ execute(input: TransitInput, object: Entity): Promise<Maybe<TransitOutput>>;
14
15
  }
@@ -32,7 +32,8 @@ export class Transition {
32
32
  this.keys.revoke({ input: { identity: object.id } })
33
33
  ]);
34
34
  }
35
- else
35
+ else if (input.authority !== undefined)
36
+ // a record that is new and names no authority is refused by the entity contract
36
37
  object.authority = input.authority;
37
38
  if (input.username !== undefined) {
38
39
  if (existent && this.locked(object))
@@ -1 +1 @@
1
- {"version":3,"file":"transit.js","sourceRoot":"","sources":["../source/transit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAIxC,MAAM,OAAO,UAAU;IACb,MAAM,GAAW,EAAE,CAAA;IACnB,MAAM,GAAW,EAAE,CAAA;IACnB,SAAS,CAAY;IACrB,MAAM,GAAW,SAA8B,CAAA;IAC/C,IAAI,GAAS,SAA4B,CAAA;IACzC,UAAU,GAAa,EAAE,CAAA;IACzB,UAAU,GAAa,EAAE,CAAA;IAE1B,KAAK,CAAE,OAAgB;QAC5B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAA;QAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;QAC1D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,SAAS,CAAA;QAChD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA;QAC5C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA;QAExC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QACtD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACxD,CAAC;IAEO,MAAM,CAAE,MAAc;QAC5B,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS;YACjC,MAAM,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS;YAC7C,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CA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import type { AddInput, Context, TransitOutput } from '../types/index.js'
2
+ import type { Maybe } from '@toa.io/core'
3
3
 
4
- export async function effect (input: AddInput, context: Context): Promise<Maybe<IdOutput>> {
4
+ export async function effect (input: AddInput, context: Context): Promise<Maybe<TransitOutput>> {
5
5
  return await context.local.transit({
6
6
  input: {
7
7
  authority: input.authority,
@@ -1,8 +1,8 @@
1
1
  import { compare } from 'bcryptjs'
2
2
  import { quote } from '@toa.io/generic'
3
- import { type Query, type Maybe } from '@toa.io/types'
3
+ import { type Query, type Maybe } from '@toa.io/core'
4
4
  import { split } from './lib/credentials.js'
5
- import { type Context } from './types.js'
5
+ import { type Context } from '../types/index.js'
6
6
 
7
7
  export async function computation (input: Input, context: Context): Promise<Maybe<Output>> {
8
8
  const pair = split(input.credentials)
@@ -1,5 +1,5 @@
1
1
  import { quote } from '@toa.io/generic'
2
- import type { Context } from './types.js'
2
+ import type { Context } from '../types/index.js'
3
3
 
4
4
  export async function computation (input: Input, context: Context): Promise<void | null | Error> {
5
5
  const username = Buffer.from(input.username, 'base64url').toString()
@@ -1,6 +1,6 @@
1
- import type { Context } from './types.js'
1
+ import type { Context, Entity } from '../types/index.js'
2
2
 
3
- export async function effect ({ authority, identity }: Input, context: Context): Promise<void | null> {
3
+ export async function effect ({ authority, identity }: Input, context: Context): Promise<Entity | null> {
4
4
  const object = await context.local.observe({ query: { id: identity } })
5
5
 
6
6
  if (object === null || object instanceof Error || object.authority !== authority)
@@ -1,6 +1,6 @@
1
1
  import { split } from './lib/credentials.js'
2
- import type { Context } from './types.js'
3
- import type { Maybe } from '@toa.io/types'
2
+ import type { Context } from '../types/index.js'
3
+ import type { Maybe } from '@toa.io/core'
4
4
 
5
5
  export async function effect (input: Input, context: Context): Promise<Maybe<Output>> {
6
6
  const pair = split(input.credentials)
@@ -1,4 +1,4 @@
1
- import type { Context, Entity } from './types.js'
1
+ import type { Context, Entity } from '../types/index.js'
2
2
 
3
3
  export async function effect ({ authority, identity }: Input, context: Context): Promise<Output | null> {
4
4
  const object = await context.local.observe({ query: { id: identity } })
@@ -1,6 +1,7 @@
1
1
  import { genSalt, hash } from 'bcryptjs'
2
- import type { Maybe, Operation } from '@toa.io/types'
3
- import type { Context, Entity, Principal, TransitInput, IdOutput } from './types.js'
2
+ import type { Maybe } from '@toa.io/core'
3
+ import type { Operation } from '@toa.io/bridges.node'
4
+ import type { Context, Entity, Principal, TransitInput, TransitOutput } from '../types/index.js'
4
5
 
5
6
  export class Transition implements Operation {
6
7
  private rounds: number = 10
@@ -28,7 +29,7 @@ export class Transition implements Operation {
28
29
  object.username === this.principal.username
29
30
  }
30
31
 
31
- public async execute (input: TransitInput, object: Entity): Promise<Maybe<IdOutput>> {
32
+ public async execute (input: TransitInput, object: Entity): Promise<Maybe<TransitOutput>> {
32
33
  const deleted = object._deleted !== undefined && object._deleted !== null
33
34
  const existent = object._version !== 0 && !deleted
34
35
 
@@ -40,7 +41,8 @@ export class Transition implements Operation {
40
41
  this.tokens.revoke({ query: { id: object.id } }),
41
42
  this.keys.revoke({ input: { identity: object.id } })
42
43
  ])
43
- } else
44
+ } else if (input.authority !== undefined)
45
+ // a record that is new and names no authority is refused by the entity contract
44
46
  object.authority = input.authority
45
47
 
46
48
  if (input.username !== undefined) {