@bleedingdev/modern-js-plugin-bff 3.8.2-ultramodern.9 → 3.8.3-ultramodern.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/dist/cjs/cli/generator.js +45 -53
  2. package/dist/cjs/cli/serverGlobalVars.js +1 -1
  3. package/dist/cjs/cli.js +1 -0
  4. package/dist/cjs/loader.js +7 -18
  5. package/dist/cjs/runtime/data-platform/index.js +32 -94
  6. package/dist/cjs/runtime/effect/edge-dispatcher.js +5 -91
  7. package/dist/cjs/runtime/effect/edge.js +11 -45
  8. package/dist/cjs/runtime/effect/index.js +173 -55
  9. package/dist/cjs/runtime/effect-client/index.js +32 -166
  10. package/dist/cjs/runtime/effect-client/runtime.js +32 -70
  11. package/dist/cjs/runtime/hono/adapter.js +13 -54
  12. package/dist/cjs/server.js +2 -2
  13. package/dist/cjs/utils/client-generator/generate.js +11 -8
  14. package/dist/cjs/utils/client-generator/index.js +0 -3
  15. package/dist/cjs/utils/client-generator/type-facade.js +16 -10
  16. package/dist/cjs/utils/crossProjectApiPlugin.js +5 -1
  17. package/dist/cjs/utils/pluginGenerator.js +4 -4
  18. package/dist/cjs/utils/runtimeGenerator.js +4 -16
  19. package/dist/esm/cli/generator.mjs +45 -53
  20. package/dist/esm/cli/serverGlobalVars.mjs +1 -1
  21. package/dist/esm/cli.mjs +1 -0
  22. package/dist/esm/loader.mjs +5 -16
  23. package/dist/esm/runtime/data-platform/index.mjs +1 -7
  24. package/dist/esm/runtime/effect/edge-dispatcher.mjs +1 -38
  25. package/dist/esm/runtime/effect/edge.mjs +2 -2
  26. package/dist/esm/runtime/effect/index.mjs +16 -8
  27. package/dist/esm/runtime/effect-client/index.mjs +1 -98
  28. package/dist/esm/runtime/effect-client/runtime.mjs +1 -62
  29. package/dist/esm/runtime/hono/adapter.mjs +13 -54
  30. package/dist/esm/server.mjs +2 -2
  31. package/dist/esm/utils/client-generator/generate.mjs +11 -8
  32. package/dist/esm/utils/client-generator/index.mjs +1 -1
  33. package/dist/esm/utils/client-generator/type-facade.mjs +9 -6
  34. package/dist/esm/utils/crossProjectApiPlugin.mjs +3 -2
  35. package/dist/esm/utils/pluginGenerator.mjs +5 -5
  36. package/dist/esm/utils/runtimeGenerator.mjs +4 -16
  37. package/dist/esm-node/cli/generator.mjs +45 -53
  38. package/dist/esm-node/cli/serverGlobalVars.mjs +1 -1
  39. package/dist/esm-node/cli.mjs +1 -0
  40. package/dist/esm-node/loader.mjs +5 -16
  41. package/dist/esm-node/runtime/data-platform/index.mjs +1 -7
  42. package/dist/esm-node/runtime/effect/edge-dispatcher.mjs +1 -38
  43. package/dist/esm-node/runtime/effect/edge.mjs +2 -2
  44. package/dist/esm-node/runtime/effect/index.mjs +16 -8
  45. package/dist/esm-node/runtime/effect-client/index.mjs +1 -98
  46. package/dist/esm-node/runtime/effect-client/runtime.mjs +1 -62
  47. package/dist/esm-node/runtime/hono/adapter.mjs +13 -54
  48. package/dist/esm-node/server.mjs +2 -2
  49. package/dist/esm-node/utils/client-generator/generate.mjs +11 -8
  50. package/dist/esm-node/utils/client-generator/index.mjs +1 -1
  51. package/dist/esm-node/utils/client-generator/type-facade.mjs +9 -6
  52. package/dist/esm-node/utils/crossProjectApiPlugin.mjs +3 -2
  53. package/dist/esm-node/utils/pluginGenerator.mjs +5 -5
  54. package/dist/esm-node/utils/runtimeGenerator.mjs +4 -16
  55. package/dist/types/loader.d.ts +1 -0
  56. package/dist/types/runtime/data-platform/index.d.ts +1 -8
  57. package/dist/types/runtime/effect/edge-dispatcher.d.ts +1 -26
  58. package/dist/types/runtime/effect/edge.d.ts +2 -2
  59. package/dist/types/runtime/effect/index.d.ts +15 -7
  60. package/dist/types/runtime/effect-client/index.d.ts +1 -58
  61. package/dist/types/runtime/effect-client/runtime.d.ts +1 -5
  62. package/dist/types/runtime/hono/adapter.d.ts +1 -11
  63. package/dist/types/utils/client-generator/generate.d.ts +2 -1
  64. package/dist/types/utils/client-generator/index.d.ts +1 -1
  65. package/dist/types/utils/client-generator/type-facade.d.ts +2 -12
  66. package/dist/types/utils/crossProjectApiPlugin.d.ts +1 -0
  67. package/dist/types/utils/pluginGenerator.d.ts +2 -1
  68. package/package.json +34 -33
  69. package/dist/cjs/runtime/data-platform/batch/queue.js +0 -284
  70. package/dist/cjs/runtime/data-platform/batch/request.js +0 -98
  71. package/dist/cjs/runtime/data-platform/batch/response.js +0 -64
  72. package/dist/cjs/runtime/data-platform/batch/telemetry.js +0 -67
  73. package/dist/cjs/runtime/data-platform/batch/url.js +0 -69
  74. package/dist/cjs/runtime/data-platform/batch-transport.js +0 -59
  75. package/dist/cjs/runtime/data-platform/codec.js +0 -155
  76. package/dist/cjs/runtime/data-platform/invalidation.js +0 -61
  77. package/dist/cjs/runtime/data-platform/trace.js +0 -73
  78. package/dist/cjs/runtime/data-platform/types.js +0 -48
  79. package/dist/cjs/runtime/data-platform/validation.js +0 -178
  80. package/dist/cjs/runtime/effect/adapter/constants.js +0 -44
  81. package/dist/cjs/runtime/effect/adapter/cross-project-policy.js +0 -66
  82. package/dist/cjs/runtime/effect/adapter/entry.js +0 -100
  83. package/dist/cjs/runtime/effect/adapter/error-response.js +0 -81
  84. package/dist/cjs/runtime/effect/adapter/handler.js +0 -53
  85. package/dist/cjs/runtime/effect/adapter.js +0 -155
  86. package/dist/cjs/runtime/effect/backend-federation/entry.js +0 -99
  87. package/dist/cjs/runtime/effect/backend-federation/identity.js +0 -82
  88. package/dist/cjs/runtime/effect/backend-federation/load.js +0 -75
  89. package/dist/cjs/runtime/effect/backend-federation/plugin.js +0 -63
  90. package/dist/cjs/runtime/effect/backend-federation/remotes.js +0 -51
  91. package/dist/cjs/runtime/effect/backend-federation/runtime.js +0 -128
  92. package/dist/cjs/runtime/effect/backend-federation/types.js +0 -18
  93. package/dist/cjs/runtime/effect/backend-federation/utils.js +0 -48
  94. package/dist/cjs/runtime/effect/backend-federation-manifest/errors.js +0 -83
  95. package/dist/cjs/runtime/effect/backend-federation-manifest/index.js +0 -55
  96. package/dist/cjs/runtime/effect/backend-federation-manifest/load.js +0 -94
  97. package/dist/cjs/runtime/effect/backend-federation-manifest/metadata.js +0 -101
  98. package/dist/cjs/runtime/effect/backend-federation-manifest/reference.js +0 -120
  99. package/dist/cjs/runtime/effect/backend-federation-manifest/remote.js +0 -68
  100. package/dist/cjs/runtime/effect/backend-federation-manifest/types.js +0 -18
  101. package/dist/cjs/runtime/effect/backend-federation-manifest/validation.js +0 -109
  102. package/dist/cjs/runtime/effect/backend-federation-manifest.js +0 -62
  103. package/dist/cjs/runtime/effect/backend-federation.js +0 -65
  104. package/dist/cjs/runtime/effect/context.js +0 -60
  105. package/dist/cjs/runtime/effect/dispatch.js +0 -101
  106. package/dist/cjs/runtime/effect/edge-context.js +0 -81
  107. package/dist/cjs/runtime/effect/endpoint-contracts.js +0 -121
  108. package/dist/cjs/runtime/effect/entry-shape.js +0 -84
  109. package/dist/cjs/runtime/effect/handler/batch-handler.js +0 -161
  110. package/dist/cjs/runtime/effect/handler/batch.js +0 -159
  111. package/dist/cjs/runtime/effect/handler/definition.js +0 -102
  112. package/dist/cjs/runtime/effect/handler/envelope.js +0 -104
  113. package/dist/cjs/runtime/effect/handler/http.js +0 -107
  114. package/dist/cjs/runtime/effect/handler/openapi.js +0 -57
  115. package/dist/cjs/runtime/effect/handler/routing.js +0 -100
  116. package/dist/cjs/runtime/effect/handler/rpc.js +0 -63
  117. package/dist/cjs/runtime/effect/handler/types.js +0 -43
  118. package/dist/cjs/runtime/effect/handler.js +0 -189
  119. package/dist/cjs/runtime/effect/module.js +0 -113
  120. package/dist/cjs/runtime/effect/operation-context.js +0 -103
  121. package/dist/cjs/runtime/effect/rpcSerialization.js +0 -54
  122. package/dist/cjs/runtime/effect-client/batch.js +0 -73
  123. package/dist/cjs/runtime/effect-client/envelope.js +0 -145
  124. package/dist/cjs/runtime/effect-client/guards.js +0 -44
  125. package/dist/cjs/runtime/effect-client/request-context.js +0 -64
  126. package/dist/cjs/runtime/effect-client/request.js +0 -66
  127. package/dist/cjs/runtime/effect-client/types.js +0 -18
  128. package/dist/cjs/runtime/safe-failure.js +0 -84
  129. package/dist/cjs/utils/crossProjectServerPolicy.js +0 -98
  130. package/dist/cjs/utils/effect-client-generator/generator.js +0 -69
  131. package/dist/cjs/utils/effect-client-generator/index.js +0 -51
  132. package/dist/cjs/utils/effect-client-generator/paths.js +0 -62
  133. package/dist/cjs/utils/effect-client-generator/rendering.js +0 -220
  134. package/dist/cjs/utils/effect-client-generator/runtime.js +0 -68
  135. package/dist/cjs/utils/effect-client-generator/types.js +0 -18
  136. package/dist/cjs/utils/effectClientGenerator.js +0 -49
  137. package/dist/cjs/utils/effectSourceLoader.js +0 -312
  138. package/dist/cjs/utils/headers.js +0 -46
  139. package/dist/esm/runtime/data-platform/batch/queue.mjs +0 -246
  140. package/dist/esm/runtime/data-platform/batch/request.mjs +0 -45
  141. package/dist/esm/runtime/data-platform/batch/response.mjs +0 -23
  142. package/dist/esm/runtime/data-platform/batch/telemetry.mjs +0 -23
  143. package/dist/esm/runtime/data-platform/batch/url.mjs +0 -25
  144. package/dist/esm/runtime/data-platform/batch-transport.mjs +0 -12
  145. package/dist/esm/runtime/data-platform/codec.mjs +0 -90
  146. package/dist/esm/runtime/data-platform/invalidation.mjs +0 -20
  147. package/dist/esm/runtime/data-platform/trace.mjs +0 -29
  148. package/dist/esm/runtime/data-platform/types.mjs +0 -4
  149. package/dist/esm/runtime/data-platform/validation.mjs +0 -128
  150. package/dist/esm/runtime/effect/adapter/constants.mjs +0 -6
  151. package/dist/esm/runtime/effect/adapter/cross-project-policy.mjs +0 -28
  152. package/dist/esm/runtime/effect/adapter/entry.mjs +0 -52
  153. package/dist/esm/runtime/effect/adapter/error-response.mjs +0 -43
  154. package/dist/esm/runtime/effect/adapter/handler.mjs +0 -15
  155. package/dist/esm/runtime/effect/adapter.mjs +0 -107
  156. package/dist/esm/runtime/effect/backend-federation/entry.mjs +0 -61
  157. package/dist/esm/runtime/effect/backend-federation/identity.mjs +0 -41
  158. package/dist/esm/runtime/effect/backend-federation/load.mjs +0 -37
  159. package/dist/esm/runtime/effect/backend-federation/plugin.mjs +0 -25
  160. package/dist/esm/runtime/effect/backend-federation/remotes.mjs +0 -13
  161. package/dist/esm/runtime/effect/backend-federation/runtime.mjs +0 -90
  162. package/dist/esm/runtime/effect/backend-federation/types.mjs +0 -0
  163. package/dist/esm/runtime/effect/backend-federation/utils.mjs +0 -7
  164. package/dist/esm/runtime/effect/backend-federation-manifest/errors.mjs +0 -32
  165. package/dist/esm/runtime/effect/backend-federation-manifest/index.mjs +0 -4
  166. package/dist/esm/runtime/effect/backend-federation-manifest/load.mjs +0 -56
  167. package/dist/esm/runtime/effect/backend-federation-manifest/metadata.mjs +0 -42
  168. package/dist/esm/runtime/effect/backend-federation-manifest/reference.mjs +0 -76
  169. package/dist/esm/runtime/effect/backend-federation-manifest/remote.mjs +0 -30
  170. package/dist/esm/runtime/effect/backend-federation-manifest/types.mjs +0 -0
  171. package/dist/esm/runtime/effect/backend-federation-manifest/validation.mjs +0 -65
  172. package/dist/esm/runtime/effect/backend-federation-manifest.mjs +0 -1
  173. package/dist/esm/runtime/effect/backend-federation.mjs +0 -5
  174. package/dist/esm/runtime/effect/context.mjs +0 -13
  175. package/dist/esm/runtime/effect/dispatch.mjs +0 -63
  176. package/dist/esm/runtime/effect/edge-context.mjs +0 -34
  177. package/dist/esm/runtime/effect/endpoint-contracts.mjs +0 -68
  178. package/dist/esm/runtime/effect/entry-shape.mjs +0 -36
  179. package/dist/esm/runtime/effect/handler/batch-handler.mjs +0 -123
  180. package/dist/esm/runtime/effect/handler/batch.mjs +0 -97
  181. package/dist/esm/runtime/effect/handler/definition.mjs +0 -61
  182. package/dist/esm/runtime/effect/handler/envelope.mjs +0 -63
  183. package/dist/esm/runtime/effect/handler/http.mjs +0 -69
  184. package/dist/esm/runtime/effect/handler/openapi.mjs +0 -19
  185. package/dist/esm/runtime/effect/handler/routing.mjs +0 -50
  186. package/dist/esm/runtime/effect/handler/rpc.mjs +0 -22
  187. package/dist/esm/runtime/effect/handler/types.mjs +0 -5
  188. package/dist/esm/runtime/effect/handler.mjs +0 -14
  189. package/dist/esm/runtime/effect/module.mjs +0 -75
  190. package/dist/esm/runtime/effect/operation-context.mjs +0 -65
  191. package/dist/esm/runtime/effect/rpcSerialization.mjs +0 -16
  192. package/dist/esm/runtime/effect-client/batch.mjs +0 -35
  193. package/dist/esm/runtime/effect-client/envelope.mjs +0 -104
  194. package/dist/esm/runtime/effect-client/guards.mjs +0 -3
  195. package/dist/esm/runtime/effect-client/request-context.mjs +0 -23
  196. package/dist/esm/runtime/effect-client/request.mjs +0 -28
  197. package/dist/esm/runtime/effect-client/types.mjs +0 -0
  198. package/dist/esm/runtime/safe-failure.mjs +0 -46
  199. package/dist/esm/utils/crossProjectServerPolicy.mjs +0 -44
  200. package/dist/esm/utils/effect-client-generator/generator.mjs +0 -28
  201. package/dist/esm/utils/effect-client-generator/index.mjs +0 -3
  202. package/dist/esm/utils/effect-client-generator/paths.mjs +0 -24
  203. package/dist/esm/utils/effect-client-generator/rendering.mjs +0 -179
  204. package/dist/esm/utils/effect-client-generator/runtime.mjs +0 -27
  205. package/dist/esm/utils/effect-client-generator/types.mjs +0 -0
  206. package/dist/esm/utils/effectClientGenerator.mjs +0 -1
  207. package/dist/esm/utils/effectSourceLoader.mjs +0 -256
  208. package/dist/esm/utils/headers.mjs +0 -8
  209. package/dist/esm-node/runtime/data-platform/batch/queue.mjs +0 -247
  210. package/dist/esm-node/runtime/data-platform/batch/request.mjs +0 -46
  211. package/dist/esm-node/runtime/data-platform/batch/response.mjs +0 -24
  212. package/dist/esm-node/runtime/data-platform/batch/telemetry.mjs +0 -24
  213. package/dist/esm-node/runtime/data-platform/batch/url.mjs +0 -26
  214. package/dist/esm-node/runtime/data-platform/batch-transport.mjs +0 -13
  215. package/dist/esm-node/runtime/data-platform/codec.mjs +0 -91
  216. package/dist/esm-node/runtime/data-platform/invalidation.mjs +0 -21
  217. package/dist/esm-node/runtime/data-platform/trace.mjs +0 -30
  218. package/dist/esm-node/runtime/data-platform/types.mjs +0 -5
  219. package/dist/esm-node/runtime/data-platform/validation.mjs +0 -129
  220. package/dist/esm-node/runtime/effect/adapter/constants.mjs +0 -7
  221. package/dist/esm-node/runtime/effect/adapter/cross-project-policy.mjs +0 -29
  222. package/dist/esm-node/runtime/effect/adapter/entry.mjs +0 -53
  223. package/dist/esm-node/runtime/effect/adapter/error-response.mjs +0 -44
  224. package/dist/esm-node/runtime/effect/adapter/handler.mjs +0 -16
  225. package/dist/esm-node/runtime/effect/adapter.mjs +0 -108
  226. package/dist/esm-node/runtime/effect/backend-federation/entry.mjs +0 -62
  227. package/dist/esm-node/runtime/effect/backend-federation/identity.mjs +0 -42
  228. package/dist/esm-node/runtime/effect/backend-federation/load.mjs +0 -38
  229. package/dist/esm-node/runtime/effect/backend-federation/plugin.mjs +0 -26
  230. package/dist/esm-node/runtime/effect/backend-federation/remotes.mjs +0 -14
  231. package/dist/esm-node/runtime/effect/backend-federation/runtime.mjs +0 -91
  232. package/dist/esm-node/runtime/effect/backend-federation/types.mjs +0 -1
  233. package/dist/esm-node/runtime/effect/backend-federation/utils.mjs +0 -8
  234. package/dist/esm-node/runtime/effect/backend-federation-manifest/errors.mjs +0 -33
  235. package/dist/esm-node/runtime/effect/backend-federation-manifest/index.mjs +0 -5
  236. package/dist/esm-node/runtime/effect/backend-federation-manifest/load.mjs +0 -57
  237. package/dist/esm-node/runtime/effect/backend-federation-manifest/metadata.mjs +0 -43
  238. package/dist/esm-node/runtime/effect/backend-federation-manifest/reference.mjs +0 -77
  239. package/dist/esm-node/runtime/effect/backend-federation-manifest/remote.mjs +0 -31
  240. package/dist/esm-node/runtime/effect/backend-federation-manifest/types.mjs +0 -1
  241. package/dist/esm-node/runtime/effect/backend-federation-manifest/validation.mjs +0 -66
  242. package/dist/esm-node/runtime/effect/backend-federation-manifest.mjs +0 -2
  243. package/dist/esm-node/runtime/effect/backend-federation.mjs +0 -6
  244. package/dist/esm-node/runtime/effect/context.mjs +0 -14
  245. package/dist/esm-node/runtime/effect/dispatch.mjs +0 -64
  246. package/dist/esm-node/runtime/effect/edge-context.mjs +0 -35
  247. package/dist/esm-node/runtime/effect/endpoint-contracts.mjs +0 -69
  248. package/dist/esm-node/runtime/effect/entry-shape.mjs +0 -37
  249. package/dist/esm-node/runtime/effect/handler/batch-handler.mjs +0 -124
  250. package/dist/esm-node/runtime/effect/handler/batch.mjs +0 -98
  251. package/dist/esm-node/runtime/effect/handler/definition.mjs +0 -62
  252. package/dist/esm-node/runtime/effect/handler/envelope.mjs +0 -64
  253. package/dist/esm-node/runtime/effect/handler/http.mjs +0 -70
  254. package/dist/esm-node/runtime/effect/handler/openapi.mjs +0 -20
  255. package/dist/esm-node/runtime/effect/handler/routing.mjs +0 -51
  256. package/dist/esm-node/runtime/effect/handler/rpc.mjs +0 -23
  257. package/dist/esm-node/runtime/effect/handler/types.mjs +0 -6
  258. package/dist/esm-node/runtime/effect/handler.mjs +0 -15
  259. package/dist/esm-node/runtime/effect/module.mjs +0 -76
  260. package/dist/esm-node/runtime/effect/operation-context.mjs +0 -66
  261. package/dist/esm-node/runtime/effect/rpcSerialization.mjs +0 -17
  262. package/dist/esm-node/runtime/effect-client/batch.mjs +0 -36
  263. package/dist/esm-node/runtime/effect-client/envelope.mjs +0 -105
  264. package/dist/esm-node/runtime/effect-client/guards.mjs +0 -4
  265. package/dist/esm-node/runtime/effect-client/request-context.mjs +0 -24
  266. package/dist/esm-node/runtime/effect-client/request.mjs +0 -29
  267. package/dist/esm-node/runtime/effect-client/types.mjs +0 -1
  268. package/dist/esm-node/runtime/safe-failure.mjs +0 -47
  269. package/dist/esm-node/utils/crossProjectServerPolicy.mjs +0 -46
  270. package/dist/esm-node/utils/effect-client-generator/generator.mjs +0 -29
  271. package/dist/esm-node/utils/effect-client-generator/index.mjs +0 -4
  272. package/dist/esm-node/utils/effect-client-generator/paths.mjs +0 -25
  273. package/dist/esm-node/utils/effect-client-generator/rendering.mjs +0 -180
  274. package/dist/esm-node/utils/effect-client-generator/runtime.mjs +0 -29
  275. package/dist/esm-node/utils/effect-client-generator/types.mjs +0 -1
  276. package/dist/esm-node/utils/effectClientGenerator.mjs +0 -2
  277. package/dist/esm-node/utils/effectSourceLoader.mjs +0 -257
  278. package/dist/esm-node/utils/headers.mjs +0 -9
  279. package/dist/types/runtime/data-platform/batch/queue.d.ts +0 -8
  280. package/dist/types/runtime/data-platform/batch/request.d.ts +0 -13
  281. package/dist/types/runtime/data-platform/batch/response.d.ts +0 -3
  282. package/dist/types/runtime/data-platform/batch/telemetry.d.ts +0 -4
  283. package/dist/types/runtime/data-platform/batch/url.d.ts +0 -4
  284. package/dist/types/runtime/data-platform/batch-transport.d.ts +0 -3
  285. package/dist/types/runtime/data-platform/codec.d.ts +0 -17
  286. package/dist/types/runtime/data-platform/invalidation.d.ts +0 -8
  287. package/dist/types/runtime/data-platform/trace.d.ts +0 -4
  288. package/dist/types/runtime/data-platform/types.d.ts +0 -146
  289. package/dist/types/runtime/data-platform/validation.d.ts +0 -29
  290. package/dist/types/runtime/effect/adapter/constants.d.ts +0 -1
  291. package/dist/types/runtime/effect/adapter/cross-project-policy.d.ts +0 -4
  292. package/dist/types/runtime/effect/adapter/entry.d.ts +0 -2
  293. package/dist/types/runtime/effect/adapter/error-response.d.ts +0 -2
  294. package/dist/types/runtime/effect/adapter/handler.d.ts +0 -7
  295. package/dist/types/runtime/effect/adapter.d.ts +0 -22
  296. package/dist/types/runtime/effect/backend-federation/entry.d.ts +0 -2
  297. package/dist/types/runtime/effect/backend-federation/identity.d.ts +0 -30
  298. package/dist/types/runtime/effect/backend-federation/load.d.ts +0 -13
  299. package/dist/types/runtime/effect/backend-federation/plugin.d.ts +0 -3
  300. package/dist/types/runtime/effect/backend-federation/remotes.d.ts +0 -2
  301. package/dist/types/runtime/effect/backend-federation/runtime.d.ts +0 -3
  302. package/dist/types/runtime/effect/backend-federation/types.d.ts +0 -73
  303. package/dist/types/runtime/effect/backend-federation/utils.d.ts +0 -2
  304. package/dist/types/runtime/effect/backend-federation-manifest/errors.d.ts +0 -11
  305. package/dist/types/runtime/effect/backend-federation-manifest/index.d.ts +0 -6
  306. package/dist/types/runtime/effect/backend-federation-manifest/load.d.ts +0 -3
  307. package/dist/types/runtime/effect/backend-federation-manifest/metadata.d.ts +0 -18
  308. package/dist/types/runtime/effect/backend-federation-manifest/reference.d.ts +0 -4
  309. package/dist/types/runtime/effect/backend-federation-manifest/remote.d.ts +0 -3
  310. package/dist/types/runtime/effect/backend-federation-manifest/types.d.ts +0 -51
  311. package/dist/types/runtime/effect/backend-federation-manifest/validation.d.ts +0 -5
  312. package/dist/types/runtime/effect/backend-federation-manifest.d.ts +0 -1
  313. package/dist/types/runtime/effect/backend-federation.d.ts +0 -7
  314. package/dist/types/runtime/effect/context.d.ts +0 -5
  315. package/dist/types/runtime/effect/dispatch.d.ts +0 -13
  316. package/dist/types/runtime/effect/edge-context.d.ts +0 -5
  317. package/dist/types/runtime/effect/endpoint-contracts.d.ts +0 -66
  318. package/dist/types/runtime/effect/entry-shape.d.ts +0 -31
  319. package/dist/types/runtime/effect/handler/batch-handler.d.ts +0 -11
  320. package/dist/types/runtime/effect/handler/batch.d.ts +0 -13
  321. package/dist/types/runtime/effect/handler/definition.d.ts +0 -7
  322. package/dist/types/runtime/effect/handler/envelope.d.ts +0 -13
  323. package/dist/types/runtime/effect/handler/http.d.ts +0 -15
  324. package/dist/types/runtime/effect/handler/openapi.d.ts +0 -4
  325. package/dist/types/runtime/effect/handler/routing.d.ts +0 -5
  326. package/dist/types/runtime/effect/handler/rpc.d.ts +0 -7
  327. package/dist/types/runtime/effect/handler/types.d.ts +0 -153
  328. package/dist/types/runtime/effect/handler.d.ts +0 -14
  329. package/dist/types/runtime/effect/module.d.ts +0 -36
  330. package/dist/types/runtime/effect/operation-context.d.ts +0 -10
  331. package/dist/types/runtime/effect/rpcSerialization.d.ts +0 -3
  332. package/dist/types/runtime/effect-client/batch.d.ts +0 -2
  333. package/dist/types/runtime/effect-client/envelope.d.ts +0 -15
  334. package/dist/types/runtime/effect-client/guards.d.ts +0 -2
  335. package/dist/types/runtime/effect-client/request-context.d.ts +0 -3
  336. package/dist/types/runtime/effect-client/request.d.ts +0 -1
  337. package/dist/types/runtime/effect-client/types.d.ts +0 -68
  338. package/dist/types/runtime/safe-failure.d.ts +0 -1
  339. package/dist/types/utils/crossProjectServerPolicy.d.ts +0 -36
  340. package/dist/types/utils/effect-client-generator/generator.d.ts +0 -10
  341. package/dist/types/utils/effect-client-generator/index.d.ts +0 -4
  342. package/dist/types/utils/effect-client-generator/paths.d.ts +0 -5
  343. package/dist/types/utils/effect-client-generator/rendering.d.ts +0 -4
  344. package/dist/types/utils/effect-client-generator/runtime.d.ts +0 -12
  345. package/dist/types/utils/effect-client-generator/types.d.ts +0 -27
  346. package/dist/types/utils/effectClientGenerator.d.ts +0 -2
  347. package/dist/types/utils/effectSourceLoader.d.ts +0 -25
  348. package/dist/types/utils/headers.d.ts +0 -1
@@ -1,13 +0,0 @@
1
- import { type DataBatchRequestPayload, type DataBatchResponseItem } from '../../data-platform';
2
- export { toHeaderRecord } from '../../../utils/headers';
3
- export declare function normalizeBatchPath(pathname: string | undefined): `/${string}`;
4
- export declare function normalizeBatchAllowedMethods(allowedMethods: string[] | undefined): Set<string>;
5
- type ParsedBatchRequestPayload = Omit<DataBatchRequestPayload, 'items'> & {
6
- items: unknown[];
7
- };
8
- export declare function isBatchRequestPayload(value: unknown): value is ParsedBatchRequestPayload;
9
- export declare function createBatchValidationResponse(message: string, status?: number): Response;
10
- export declare function prepareJsonRequestBody(request: Request): Promise<Request | Response>;
11
- export declare function toBatchItemError(id: string, status: number, message: string): DataBatchResponseItem;
12
- export declare function promiseWithTimeout<T>(effect: Promise<T>, timeoutMs: number): Promise<T>;
13
- export declare function mapWithConcurrency<TItem, TResult>(items: readonly TItem[], concurrency: number, mapper: (item: TItem, index: number) => Promise<TResult>): Promise<TResult[]>;
@@ -1,7 +0,0 @@
1
- import type { HttpApi } from 'effect/unstable/httpapi';
2
- import type { Rpc } from 'effect/unstable/rpc';
3
- import type { EffectBffDefinition, EffectBffRuntime, EffectRpcBffDefinition, EffectRpcBffHandlerFactory, EffectRpcRuntimeLayer, EffectRuntimeLayer } from './types';
4
- export declare function defineEffectBff<TApi extends HttpApi.Constraint, TLayer extends EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any>(definition: EffectBffDefinition<TApi, TLayer, TRpcs>): EffectBffDefinition<TApi, TLayer, TRpcs> & EffectBffRuntime<TApi, TLayer>;
5
- export declare function defineEffectRpcBff<TRpcs extends Rpc.Any = Rpc.Any, TLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>>(definition: EffectRpcBffDefinition<TRpcs, TLayer>): EffectRpcBffDefinition<TRpcs, TLayer> & {
6
- createHandler: EffectRpcBffHandlerFactory<TRpcs>;
7
- };
@@ -1,13 +0,0 @@
1
- import type { EffectDataPlatformValidationOptions } from './types';
2
- /**
3
- * Validates the `x-modernjs-data-envelope` header (the data-platform
4
- * transport/cache contract: protocol version, scope, selection plan).
5
- *
6
- * This is NOT a security boundary: the envelope is client-constructed cache
7
- * metadata used for batching, scope keys and hydration. Cross-project
8
- * authorization runs through the bff-core policy evaluator wired in via
9
- * `validateRequest` (see `EffectRequestValidator`), which both the direct
10
- * and batched request paths hit before this check.
11
- */
12
- export declare function validateDataPlatformRequestEnvelope(request: Request, options: EffectDataPlatformValidationOptions | undefined): Response | null;
13
- export declare function mergeDataPlatformOptions(base: EffectDataPlatformValidationOptions | undefined, override: Partial<EffectDataPlatformValidationOptions> | undefined): EffectDataPlatformValidationOptions | undefined;
@@ -1,15 +0,0 @@
1
- import type { HttpApi } from 'effect/unstable/httpapi';
2
- import type { Rpc } from 'effect/unstable/rpc';
3
- import type { EffectBffOpenApiConfig, EffectDataPlatformValidationOptions, EffectRequestInterceptor, EffectRequestValidator, EffectRpcBffDefinition, EffectRuntimeLayer } from './types';
4
- export declare function createHttpApiHandler<TApi extends HttpApi.Constraint = HttpApi.Top, TRpcs extends Rpc.Any = Rpc.Any>(options: {
5
- api: TApi;
6
- layer: EffectRuntimeLayer;
7
- openapi?: EffectBffOpenApiConfig;
8
- rpc?: EffectRpcBffDefinition<TRpcs>;
9
- dataPlatform?: EffectDataPlatformValidationOptions;
10
- interceptRequest?: EffectRequestInterceptor;
11
- validateRequest?: EffectRequestValidator;
12
- }): {
13
- handler: (request: Request, context?: Parameters<(request: globalThis.Request, context: import("effect/Context").Context<unknown>) => Promise<Response>>[1]) => Promise<Response>;
14
- dispose: () => Promise<void>;
15
- };
@@ -1,4 +0,0 @@
1
- import { HttpRouter } from 'effect/unstable/http';
2
- import { type HttpApi } from 'effect/unstable/httpapi';
3
- import type { EffectBffOpenApiConfig } from './types';
4
- export declare function createOpenApiLayer(api: HttpApi.Constraint, openapi: EffectBffOpenApiConfig | undefined): import("effect/Layer").Layer<never, never, HttpRouter.HttpRouter> | null;
@@ -1,5 +0,0 @@
1
- export declare function getRequestPathname(request: Request): string;
2
- export declare function getMountedPrefixFromContext(request: Request, context: unknown): string;
3
- export declare function removeMountedPrefixFromBatchPath(pathWithQuery: string, prefix: string): string;
4
- export declare function getExpectedEnvelopeOrigin(request: Request): string;
5
- export declare function isRpcRequest(request: Request, rpcPath: `/${string}`): boolean;
@@ -1,7 +0,0 @@
1
- import { type Rpc } from 'effect/unstable/rpc';
2
- import type { EffectRpcBffDefinition } from './types';
3
- export declare function normalizeRpcPath(pathname: string | undefined): `/${string}`;
4
- export declare function createRpcApiHandler<TRpcs extends Rpc.Any = Rpc.Any>(options: EffectRpcBffDefinition<TRpcs>): {
5
- readonly handler: (request: globalThis.Request, context?: import("effect/Context").Context<never> | undefined) => Promise<Response>;
6
- readonly dispose: () => Promise<void>;
7
- };
@@ -1,153 +0,0 @@
1
- import type { FileSystem, Path } from 'effect';
2
- import * as Context from 'effect/Context';
3
- import type * as EffectType from 'effect/Effect';
4
- import type * as Layer from 'effect/Layer';
5
- import type { Etag, HttpPlatform, HttpRouter } from 'effect/unstable/http';
6
- import type { HttpApi, HttpApiClient, HttpApiGroup } from 'effect/unstable/httpapi';
7
- import type { Rpc, RpcGroup } from 'effect/unstable/rpc';
8
- import type { createHttpApiHandler } from './http';
9
- import type { createRpcApiHandler } from './rpc';
10
- export type EffectRuntimeRequirements = Etag.Generator | FileSystem.FileSystem | HttpPlatform.HttpPlatform | HttpRouter.HttpRouter | HttpRouter.Request<'Error', unknown> | HttpRouter.Request<'GlobalError', unknown> | HttpRouter.Request<'GlobalRequires', unknown> | HttpRouter.Request<'Requires', unknown> | Path.Path;
11
- export type EffectRuntimeLayer = Layer.Layer<never, never, EffectRuntimeRequirements>;
12
- export declare const toEffectServiceContext: (context: unknown) => Context.Context<any>;
13
- export type EffectRpcSerialization = 'json' | 'ndjson' | 'jsonRpc' | 'ndJsonRpc' | 'msgPack';
14
- export type EffectRpcRuntimeLayer<TRpcs extends Rpc.Any = Rpc.Any> = Layer.Layer<Rpc.ToHandler<TRpcs> | Rpc.Middleware<TRpcs> | Rpc.ServicesServer<TRpcs>, unknown, never>;
15
- export type EffectRpcBffDefinition<TRpcs extends Rpc.Any = Rpc.Any, TRpcLayer extends EffectRpcRuntimeLayer<TRpcs> = EffectRpcRuntimeLayer<TRpcs>> = {
16
- group: RpcGroup.RpcGroup<TRpcs>;
17
- layer: TRpcLayer;
18
- path?: `/${string}`;
19
- serialization?: EffectRpcSerialization;
20
- disableTracing?: boolean;
21
- spanPrefix?: string;
22
- spanAttributes?: Record<string, unknown>;
23
- disableFatalDefects?: boolean;
24
- };
25
- export type EffectRpcBffHandlerOptions = Pick<EffectRpcBffDefinition, 'path' | 'serialization' | 'disableTracing' | 'spanPrefix' | 'spanAttributes' | 'disableFatalDefects'>;
26
- type EffectApiPromiseClient<TClient> = {
27
- [GroupName in keyof TClient]: {
28
- [EndpointName in keyof TClient[GroupName]]: TClient[GroupName][EndpointName] extends (...args: infer TArgs) => infer TResult ? TResult extends EffectType.Effect<unknown, unknown, unknown> ? (...args: TArgs) => Promise<Exclude<EffectType.Success<TResult>, readonly [unknown, unknown]>> : never : never;
29
- };
30
- };
31
- export type EffectApiClientFromApi<TApi extends HttpApi.Constraint = HttpApi.Top> = TApi extends HttpApi.HttpApi<infer _ApiId, infer Groups> ? HttpApiClient.Client<Extract<Groups, HttpApiGroup.Constraint>, never, never> : never;
32
- export type EffectApiPromiseClientFromApi<TApi extends HttpApi.Constraint = HttpApi.Top> = EffectApiPromiseClient<EffectApiClientFromApi<TApi>>;
33
- export type EffectBffDefinition<TApi extends HttpApi.Constraint = HttpApi.Top, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer, TRpcs extends Rpc.Any = Rpc.Any> = {
34
- api: TApi;
35
- layer: TLayer;
36
- rpc?: EffectRpcBffDefinition<TRpcs>;
37
- dataPlatform?: EffectDataPlatformValidationOptions;
38
- interceptRequest?: EffectRequestInterceptor;
39
- };
40
- export type EffectDataPlatformSelectionValidationOptions = {
41
- maxDepth?: number;
42
- maxFields?: number;
43
- allowedLeafPaths?: string[];
44
- };
45
- export type EffectDataPlatformBatchOptions = {
46
- /**
47
- * Enable network batching endpoint for Effect HttpApi requests.
48
- * Defaults to `true`.
49
- */
50
- enabled?: boolean;
51
- /**
52
- * Batch endpoint path mounted under BFF prefix.
53
- * Defaults to `/_data/batch`.
54
- */
55
- endpoint?: `/${string}`;
56
- /**
57
- * Maximum request items accepted per batch call.
58
- * Defaults to `16`.
59
- */
60
- maxBatchSize?: number;
61
- /**
62
- * Maximum serialized request payload size in bytes.
63
- * Defaults to `65536` (64KiB).
64
- */
65
- maxBatchBytes?: number;
66
- /**
67
- * Client-side micro-batch flush window in milliseconds.
68
- * Server runtime ignores this value and passes it through for codegen.
69
- * Defaults to `8`.
70
- */
71
- flushIntervalMs?: number;
72
- /**
73
- * Maximum per-batch internal request concurrency.
74
- * Defaults to `4`.
75
- */
76
- maxConcurrency?: number;
77
- /**
78
- * Optional timeout per internal request in milliseconds.
79
- * Defaults to `10000`.
80
- */
81
- requestTimeoutMs?: number;
82
- /**
83
- * Allowed HTTP methods for internal batched dispatch.
84
- * Defaults to `['GET']`.
85
- */
86
- allowedMethods?: string[];
87
- };
88
- export type EffectDataPlatformValidationOptions = {
89
- /**
90
- * Enable envelope validation for HttpApi requests.
91
- * Defaults to `true`.
92
- */
93
- enabled?: boolean;
94
- /**
95
- * Require every HttpApi request to include an envelope header.
96
- * Defaults to `false`.
97
- */
98
- requireEnvelope?: boolean;
99
- /**
100
- * Header name used by client/server for the serialized request envelope.
101
- * Defaults to `x-modernjs-data-envelope`.
102
- */
103
- envelopeHeader?: string;
104
- /**
105
- * Optional namespace assertion for envelope validation.
106
- */
107
- expectedNamespace?: string;
108
- /**
109
- * Validate envelope origin against incoming request origin.
110
- * Defaults to `true`.
111
- */
112
- validateOrigin?: boolean;
113
- /**
114
- * Require trace context inside request envelope.
115
- * Defaults to `false`.
116
- */
117
- requireTraceContext?: boolean;
118
- /**
119
- * Selection plan guardrails for server-side validation.
120
- */
121
- selection?: EffectDataPlatformSelectionValidationOptions;
122
- /**
123
- * Network batching gateway configuration.
124
- */
125
- batch?: EffectDataPlatformBatchOptions;
126
- };
127
- /**
128
- * Server-seam request validator applied to every HttpApi request — direct,
129
- * batched (per item) and rpc. Returning a Response short-circuits the
130
- * request; returning `null`/`undefined` lets it through. Used by the effect
131
- * adapter to enforce the cross-project policy at one seam so batched items
132
- * cannot bypass it.
133
- */
134
- export type EffectRequestValidator = (request: Request) => Response | null | undefined;
135
- export type EffectRequestInterceptor = (options: {
136
- request: Request;
137
- next: () => Promise<Response>;
138
- }) => Response | Promise<Response>;
139
- export type EffectBffHandlerFactory<TApi extends HttpApi.Constraint = HttpApi.Top, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = (options?: {
140
- openapi?: EffectBffOpenApiConfig;
141
- rpc?: Partial<EffectRpcBffHandlerOptions>;
142
- dataPlatform?: Partial<EffectDataPlatformValidationOptions>;
143
- validateRequest?: EffectRequestValidator;
144
- }) => ReturnType<typeof createHttpApiHandler>;
145
- export type EffectBffRuntime<TApi extends HttpApi.Constraint = HttpApi.Top, TLayer extends EffectRuntimeLayer = EffectRuntimeLayer> = {
146
- createHandler: EffectBffHandlerFactory<TApi, TLayer>;
147
- client: EffectApiPromiseClientFromApi<TApi>;
148
- };
149
- export type EffectBffOpenApiConfig = boolean | {
150
- path?: string;
151
- };
152
- export type EffectRpcBffHandlerFactory<TRpcs extends Rpc.Any = Rpc.Any> = (options?: Partial<EffectRpcBffHandlerOptions>) => ReturnType<typeof createRpcApiHandler<TRpcs>>;
153
- export {};
@@ -1,14 +0,0 @@
1
- export * as Config from 'effect/Config';
2
- export * as Effect from 'effect/Effect';
3
- export * as Layer from 'effect/Layer';
4
- export * as Option from 'effect/Option';
5
- export * as Schema from 'effect/Schema';
6
- export * from 'effect/unstable/http';
7
- export { HttpTraceContext } from 'effect/unstable/http';
8
- export * from 'effect/unstable/httpapi';
9
- export { HttpApiBuilder } from 'effect/unstable/httpapi';
10
- export * from 'effect/unstable/rpc';
11
- export { EFFECT_VALIDATOR_AWARE_FACTORY, isValidatorAwareHandlerFactory, } from './entry-shape';
12
- export { defineEffectBff, defineEffectRpcBff } from './handler/definition';
13
- export { createHttpApiHandler } from './handler/http';
14
- export type { EffectApiClientFromApi, EffectApiPromiseClientFromApi, EffectBffDefinition, EffectBffHandlerFactory, EffectBffOpenApiConfig, EffectBffRuntime, EffectDataPlatformBatchOptions, EffectDataPlatformSelectionValidationOptions, EffectDataPlatformValidationOptions, EffectRequestValidator, EffectRpcBffDefinition, EffectRpcBffHandlerFactory, EffectRpcBffHandlerOptions, EffectRpcRuntimeLayer, EffectRpcSerialization, EffectRuntimeLayer, EffectRuntimeRequirements, } from './handler/types';
@@ -1,36 +0,0 @@
1
- import type * as EffectServiceContext from 'effect/Context';
2
- import { type EffectBffOpenApiConfig, type EffectDataPlatformValidationOptions, type EffectRequestValidator } from './handler';
3
- import type { EffectContext } from './operation-context';
4
- export type EffectBffRequestHandler = (request: Request, context?: EffectServiceContext.Context<any> | EffectContext) => Promise<Response> | Response;
5
- export type EffectBffHandlerFactory = (options?: {
6
- openapi?: EffectBffOpenApiConfig;
7
- dataPlatform?: EffectDataPlatformValidationOptions;
8
- validateRequest?: EffectRequestValidator;
9
- }) => {
10
- handler: EffectBffRequestHandler;
11
- dispose: () => Promise<void>;
12
- };
13
- export type EffectApiModule = {
14
- api?: unknown;
15
- layer?: unknown;
16
- handler?: EffectBffRequestHandler;
17
- createHandler?: EffectBffHandlerFactory;
18
- default?: unknown;
19
- };
20
- type LoadedEffectBffHandler = {
21
- handler: EffectBffRequestHandler;
22
- dispose?: () => Promise<void>;
23
- };
24
- type ResolveEffectBffModuleHandlerOptions = {
25
- openapi?: EffectBffOpenApiConfig;
26
- dataPlatform?: EffectDataPlatformValidationOptions;
27
- /**
28
- * Server-seam request validator (cross-project policy). Strict Effect
29
- * entries forward it into `createHttpApiHandler`, where it applies to
30
- * direct, batched and rpc requests.
31
- */
32
- validateRequest?: EffectRequestValidator;
33
- onWarning?: (message: string) => void;
34
- };
35
- export declare function resolveEffectBffModuleHandler(mod: EffectApiModule, options?: ResolveEffectBffModuleHandlerOptions): Promise<LoadedEffectBffHandler | null>;
36
- export {};
@@ -1,10 +0,0 @@
1
- import { type OperationContext } from '@modern-js/create-request';
2
- export type EffectContext = {
3
- request: Request;
4
- env: Record<string, unknown>;
5
- path: string;
6
- method: string;
7
- operationContext: OperationContext;
8
- };
9
- export type CreateEffectOperationContextOptions = Omit<EffectContext, 'operationContext'>;
10
- export declare const createEffectOperationContext: ({ request, path, method, }: CreateEffectOperationContextOptions) => OperationContext;
@@ -1,3 +0,0 @@
1
- import { RpcSerialization } from 'effect/unstable/rpc';
2
- import type { EffectRpcSerialization } from './handler/types';
3
- export declare function getRpcSerializationLayer(serialization: EffectRpcSerialization | undefined): import("effect/Layer").Layer<RpcSerialization.RpcSerialization, never, never>;
@@ -1,2 +0,0 @@
1
- import type { EffectRequestRuntime, GeneratedEffectClientConfig } from './types';
2
- export declare const configureGeneratedEffectClientRuntime: (config: GeneratedEffectClientConfig, configureRequest: EffectRequestRuntime['configure'] | undefined) => void;
@@ -1,15 +0,0 @@
1
- import type { EffectOperationDescriptor, EffectRequestContext, EffectRequestContextInput, GeneratedEffectClientConfig, GeneratedEffectEndpoint } from './types';
2
- /**
3
- * Resolves the current page origin with a configurable fallback. Single
4
- * implementation shared by the configure() bootstrap and the data envelope
5
- * (the generated template previously duplicated data-platform's
6
- * `resolveRuntimeOrigin` with a different fallback).
7
- */
8
- export declare const resolveOrigin: (defaultOrigin: string) => string;
9
- export declare const prepareEffectRequest: (options: {
10
- endpoint: GeneratedEffectEndpoint;
11
- operation: EffectOperationDescriptor;
12
- request: unknown;
13
- config: GeneratedEffectClientConfig;
14
- createEffectRequestContext: (requestContext: EffectRequestContextInput) => EffectRequestContext;
15
- }) => Record<string, unknown>;
@@ -1,2 +0,0 @@
1
- export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
2
- export declare const stringOrUndefined: (value: unknown) => string | undefined;
@@ -1,3 +0,0 @@
1
- import type { EffectRequestContext, EffectRequestContextInput, EffectRequestRuntime } from './types';
2
- export declare const createEffectRequestContext: (createRequestContextHeaders: EffectRequestRuntime['createRequestContextHeaders'], requestContext: EffectRequestContextInput) => EffectRequestContext;
3
- export declare const applyRequestContext: (normalizedRequest: Record<string, unknown>, request: unknown, createRequestContext: (requestContext: EffectRequestContextInput) => EffectRequestContext) => Record<string, unknown>;
@@ -1 +0,0 @@
1
- export declare const normalizeRequest: (method: string, request: unknown) => Record<string, unknown>;
@@ -1,68 +0,0 @@
1
- export type GeneratedEffectEndpoint = {
2
- apiId: string;
3
- group: string;
4
- endpoint: string;
5
- method: string;
6
- routePath: string;
7
- /** Per-endpoint operation contract hash (bff-core hash). */
8
- schemaHash: string;
9
- operationVersion: number;
10
- };
11
- export type GeneratedEffectBatchConfig = {
12
- enabled: boolean;
13
- endpoint: string;
14
- flushIntervalMs: number;
15
- maxBatchSize: number;
16
- maxBatchBytes: number;
17
- requestTimeoutMs: number;
18
- allowedMethods: string[];
19
- };
20
- export type GeneratedEffectClientConfig = {
21
- appNamespace: string;
22
- /** Cross-project producer id; absent for same-project clients. */
23
- requestId?: string;
24
- port: number;
25
- /** Resolve the port from process.env.PORT first (server bundles). */
26
- useEnvPort?: boolean;
27
- defaultOrigin: string;
28
- httpMethodDecider?: string;
29
- batch: GeneratedEffectBatchConfig;
30
- };
31
- export type EffectOperationDescriptor = {
32
- appNamespace: string;
33
- apiId: string;
34
- group: string;
35
- endpoint: string;
36
- operationId: string;
37
- routePath: string;
38
- method: string;
39
- operationVersion: number;
40
- schemaHash: string;
41
- version: number;
42
- };
43
- export type EffectClientOperation = (request?: unknown) => Promise<unknown>;
44
- export type EffectClientGroup = Record<string, EffectClientOperation>;
45
- export type EffectClient = Record<string, EffectClientGroup>;
46
- export type EffectOperationManifest = Record<string, Record<string, EffectOperationDescriptor>>;
47
- export type EffectRequestContextInput = Record<string, unknown>;
48
- export type EffectRequestContext = {
49
- headers: Record<string, string>;
50
- } & Record<string, unknown>;
51
- /** Structural slice of `@modern-js/create-request` the runtime relies on. */
52
- export type EffectRequestRuntime = {
53
- createRequest: (options: {
54
- path: string;
55
- method: string;
56
- port: number | string;
57
- operationContext: Record<string, unknown>;
58
- httpMethodDecider: string;
59
- requestId?: string;
60
- }) => (...args: unknown[]) => Promise<unknown>;
61
- configure?: (options: Record<string, unknown>) => void;
62
- createRequestContextHeaders?: (input: EffectRequestContextInput) => Record<string, string>;
63
- };
64
- export type GeneratedEffectClientModule = {
65
- client: EffectClient;
66
- operationManifest: EffectOperationManifest;
67
- createEffectRequestContext: (requestContext: EffectRequestContextInput) => EffectRequestContext;
68
- };
@@ -1 +0,0 @@
1
- export declare const createSafeFailureResponse: (error: unknown) => Response;
@@ -1,36 +0,0 @@
1
- /**
2
- * Server-side cross-project policy wiring shared by the hono and effect BFF
3
- * runtime adapters.
4
- *
5
- * The generated cross-project SDK force-enables `bff.crossProjectPolicy`
6
- * (see `crossProjectApiPlugin`), so producer servers MUST actually evaluate
7
- * it: this module resolves the policy once per adapter (deriving the
8
- * operation-contract map and the producer operation version from the app's
9
- * package.json major) and exposes a request check both adapters call before
10
- * dispatching API handlers.
11
- *
12
- * The envelope/operation-context headers are client-asserted; see the threat
13
- * model in `@modern-js/bff-core` `security/crossProjectPolicy.ts`. Operators
14
- * Production namespace allowlists require `verifyProducerIdentity` to bind
15
- * the namespace to a verified channel; without it, only non-production keeps
16
- * the advisory client-asserted allowlist path.
17
- */
18
- import { type OperationContractSource, type ResolvedCrossProjectPolicy } from '@modern-js/bff-core';
19
- import type { ServerPluginAPI } from '@modern-js/server-core';
20
- export type { ResolvedCrossProjectPolicy };
21
- /**
22
- * Resolves the effective cross-project policy for a BFF runtime adapter.
23
- * Returns `undefined` when no policy is configured and the server is not a
24
- * generated cross-project producer (no middleware should be installed).
25
- */
26
- export declare const resolveAdapterCrossProjectPolicy: (api: ServerPluginAPI, handlers: OperationContractSource[]) => ResolvedCrossProjectPolicy | undefined;
27
- /**
28
- * Evaluates the policy against a header record and returns the denial
29
- * Response every adapter must send, or `null` when the request passes.
30
- */
31
- export declare const checkCrossProjectPolicyResponse: (headers: Record<string, unknown>, policy: ResolvedCrossProjectPolicy | undefined) => Response | null;
32
- /**
33
- * Adapts the policy check to a WHATWG `Request` (effect lane seam): returns
34
- * the denial Response or `null`.
35
- */
36
- export declare const checkCrossProjectPolicyForRequest: (request: Request, policy: ResolvedCrossProjectPolicy | undefined) => Response | null;
@@ -1,10 +0,0 @@
1
- import type { EffectClientCodegenOptions, GeneratedEffectClientArtifacts } from './types';
2
- /**
3
- * Generates the Effect client module plus its type declaration. The module
4
- * body is a thin manifest + one call into
5
- * `@modern-js/plugin-bff/effect-client-runtime`; the declaration preserves
6
- * the group/endpoint structure of the HttpApi instead of erasing it to
7
- * `Record<string, ...>`.
8
- */
9
- export declare function generateEffectClient(options: EffectClientCodegenOptions): Promise<GeneratedEffectClientArtifacts | null>;
10
- export declare function generateEffectClientCode(options: EffectClientCodegenOptions): Promise<string | null>;
@@ -1,4 +0,0 @@
1
- export { generateEffectClient, generateEffectClientCode } from './generator';
2
- export { resolveEffectEntryFile } from './paths';
3
- export { renderEffectClientDeclaration } from './rendering';
4
- export type { EffectClientCodegenOptions, GeneratedEffectClientArtifacts, } from './types';
@@ -1,5 +0,0 @@
1
- export declare function resolveEffectEntryFile(options: {
2
- appDir: string;
3
- apiDir: string;
4
- effectEntry?: string;
5
- }): string | false | undefined;
@@ -1,4 +0,0 @@
1
- import { type EffectEndpointMeta } from '../../runtime/effect/endpoint-contracts';
2
- import type { EffectClientCodegenOptions } from './types';
3
- export declare function renderEffectClientCode(endpoints: EffectEndpointMeta[], options: EffectClientCodegenOptions): string;
4
- export declare function renderEffectClientDeclaration(endpoints?: EffectEndpointMeta[]): string;
@@ -1,12 +0,0 @@
1
- import { type HttpApiLike, type HttpApiReflect } from '../../runtime/effect/endpoint-contracts';
2
- type HttpApiRuntime = {
3
- isHttpApi: (value: unknown) => boolean;
4
- reflect: HttpApiReflect;
5
- };
6
- export declare function getHttpApiRuntime(): Promise<HttpApiRuntime>;
7
- export declare function loadEffectApi(options: {
8
- appDir: string;
9
- resourcePath: string;
10
- onDependency?: (dependency: string) => void;
11
- }): Promise<HttpApiLike | null>;
12
- export {};
@@ -1,27 +0,0 @@
1
- import type { HttpMethodDecider } from '@modern-js/types';
2
- import type { EffectEndpointMeta } from '../../runtime/effect/endpoint-contracts';
3
- export type EffectClientCodegenOptions = {
4
- appDir: string;
5
- apiDir: string;
6
- resourcePath: string;
7
- prefix: string;
8
- port: number;
9
- target?: string;
10
- requestCreator?: string;
11
- httpMethodDecider?: HttpMethodDecider;
12
- onDependency?: (dependency: string) => void;
13
- dataPlatformBatch?: {
14
- enabled?: boolean;
15
- endpoint?: string;
16
- flushIntervalMs?: number;
17
- maxBatchSize?: number;
18
- maxBatchBytes?: number;
19
- requestTimeoutMs?: number;
20
- allowedMethods?: string[];
21
- };
22
- };
23
- export type GeneratedEffectClientArtifacts = {
24
- code: string;
25
- declaration: string;
26
- endpoints: EffectEndpointMeta[];
27
- };
@@ -1,2 +0,0 @@
1
- export type { EffectClientCodegenOptions, GeneratedEffectClientArtifacts, } from './effect-client-generator';
2
- export { generateEffectClient, generateEffectClientCode, renderEffectClientDeclaration, resolveEffectEntryFile, } from './effect-client-generator';
@@ -1,25 +0,0 @@
1
- export type EffectSourceLoaderOptions = {
2
- resourcePath: string;
3
- appDir?: string;
4
- onDependency?: (dependency: string) => void;
5
- };
6
- export declare function bundleEffectEntryForNode(options: {
7
- appDir: string;
8
- entryPath: string;
9
- format: 'cjs' | 'esm';
10
- }): Promise<void>;
11
- /**
12
- * Loads the relocatable artifact emitted by the production BFF build.
13
- *
14
- * Production entries have already been compiled and bundled by
15
- * `bundleEffectEntryForNode`. Loading that artifact through the development
16
- * source-graph bundler a second time changes its module format and can strip
17
- * CommonJS runtime globals from bundled dependencies. Keep the built module's
18
- * native Node boundary intact instead.
19
- */
20
- export declare function loadEffectBuiltModule(resourcePath: string): Promise<unknown>;
21
- /**
22
- * Loads an Effect source entry as native ESM while keeping its complete local
23
- * source graph observable by the framework watcher.
24
- */
25
- export declare function loadEffectSourceModule(options: EffectSourceLoaderOptions): Promise<unknown>;
@@ -1 +0,0 @@
1
- export declare function toHeaderRecord(headers: Headers): Record<string, string>;