@bleedingdev/modern-js-plugin-bff 3.8.3-ultramodern.1 → 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 (340) 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 +9 -6
  14. package/dist/cjs/utils/crossProjectApiPlugin.js +5 -1
  15. package/dist/cjs/utils/pluginGenerator.js +4 -4
  16. package/dist/cjs/utils/runtimeGenerator.js +4 -16
  17. package/dist/esm/cli/generator.mjs +45 -53
  18. package/dist/esm/cli/serverGlobalVars.mjs +1 -1
  19. package/dist/esm/cli.mjs +1 -0
  20. package/dist/esm/loader.mjs +5 -16
  21. package/dist/esm/runtime/data-platform/index.mjs +1 -7
  22. package/dist/esm/runtime/effect/edge-dispatcher.mjs +1 -38
  23. package/dist/esm/runtime/effect/edge.mjs +2 -2
  24. package/dist/esm/runtime/effect/index.mjs +16 -8
  25. package/dist/esm/runtime/effect-client/index.mjs +1 -98
  26. package/dist/esm/runtime/effect-client/runtime.mjs +1 -62
  27. package/dist/esm/runtime/hono/adapter.mjs +13 -54
  28. package/dist/esm/server.mjs +2 -2
  29. package/dist/esm/utils/client-generator/generate.mjs +8 -5
  30. package/dist/esm/utils/crossProjectApiPlugin.mjs +3 -2
  31. package/dist/esm/utils/pluginGenerator.mjs +5 -5
  32. package/dist/esm/utils/runtimeGenerator.mjs +4 -16
  33. package/dist/esm-node/cli/generator.mjs +45 -53
  34. package/dist/esm-node/cli/serverGlobalVars.mjs +1 -1
  35. package/dist/esm-node/cli.mjs +1 -0
  36. package/dist/esm-node/loader.mjs +5 -16
  37. package/dist/esm-node/runtime/data-platform/index.mjs +1 -7
  38. package/dist/esm-node/runtime/effect/edge-dispatcher.mjs +1 -38
  39. package/dist/esm-node/runtime/effect/edge.mjs +2 -2
  40. package/dist/esm-node/runtime/effect/index.mjs +16 -8
  41. package/dist/esm-node/runtime/effect-client/index.mjs +1 -98
  42. package/dist/esm-node/runtime/effect-client/runtime.mjs +1 -62
  43. package/dist/esm-node/runtime/hono/adapter.mjs +13 -54
  44. package/dist/esm-node/server.mjs +2 -2
  45. package/dist/esm-node/utils/client-generator/generate.mjs +8 -5
  46. package/dist/esm-node/utils/crossProjectApiPlugin.mjs +3 -2
  47. package/dist/esm-node/utils/pluginGenerator.mjs +5 -5
  48. package/dist/esm-node/utils/runtimeGenerator.mjs +4 -16
  49. package/dist/types/loader.d.ts +1 -0
  50. package/dist/types/runtime/data-platform/index.d.ts +1 -8
  51. package/dist/types/runtime/effect/edge-dispatcher.d.ts +1 -26
  52. package/dist/types/runtime/effect/edge.d.ts +2 -2
  53. package/dist/types/runtime/effect/index.d.ts +15 -7
  54. package/dist/types/runtime/effect-client/index.d.ts +1 -58
  55. package/dist/types/runtime/effect-client/runtime.d.ts +1 -5
  56. package/dist/types/runtime/hono/adapter.d.ts +1 -11
  57. package/dist/types/utils/client-generator/generate.d.ts +2 -1
  58. package/dist/types/utils/crossProjectApiPlugin.d.ts +1 -0
  59. package/dist/types/utils/pluginGenerator.d.ts +2 -1
  60. package/package.json +29 -28
  61. package/dist/cjs/runtime/data-platform/batch/queue.js +0 -284
  62. package/dist/cjs/runtime/data-platform/batch/request.js +0 -98
  63. package/dist/cjs/runtime/data-platform/batch/response.js +0 -64
  64. package/dist/cjs/runtime/data-platform/batch/telemetry.js +0 -67
  65. package/dist/cjs/runtime/data-platform/batch/url.js +0 -69
  66. package/dist/cjs/runtime/data-platform/batch-transport.js +0 -59
  67. package/dist/cjs/runtime/data-platform/codec.js +0 -155
  68. package/dist/cjs/runtime/data-platform/invalidation.js +0 -61
  69. package/dist/cjs/runtime/data-platform/trace.js +0 -73
  70. package/dist/cjs/runtime/data-platform/types.js +0 -48
  71. package/dist/cjs/runtime/data-platform/validation.js +0 -178
  72. package/dist/cjs/runtime/effect/adapter/constants.js +0 -44
  73. package/dist/cjs/runtime/effect/adapter/cross-project-policy.js +0 -66
  74. package/dist/cjs/runtime/effect/adapter/entry.js +0 -100
  75. package/dist/cjs/runtime/effect/adapter/error-response.js +0 -81
  76. package/dist/cjs/runtime/effect/adapter/handler.js +0 -53
  77. package/dist/cjs/runtime/effect/adapter.js +0 -155
  78. package/dist/cjs/runtime/effect/backend-federation/entry.js +0 -99
  79. package/dist/cjs/runtime/effect/backend-federation/identity.js +0 -82
  80. package/dist/cjs/runtime/effect/backend-federation/load.js +0 -75
  81. package/dist/cjs/runtime/effect/backend-federation/plugin.js +0 -63
  82. package/dist/cjs/runtime/effect/backend-federation/remotes.js +0 -51
  83. package/dist/cjs/runtime/effect/backend-federation/runtime.js +0 -128
  84. package/dist/cjs/runtime/effect/backend-federation/types.js +0 -18
  85. package/dist/cjs/runtime/effect/backend-federation/utils.js +0 -48
  86. package/dist/cjs/runtime/effect/backend-federation-manifest/errors.js +0 -83
  87. package/dist/cjs/runtime/effect/backend-federation-manifest/index.js +0 -55
  88. package/dist/cjs/runtime/effect/backend-federation-manifest/load.js +0 -94
  89. package/dist/cjs/runtime/effect/backend-federation-manifest/metadata.js +0 -101
  90. package/dist/cjs/runtime/effect/backend-federation-manifest/reference.js +0 -120
  91. package/dist/cjs/runtime/effect/backend-federation-manifest/remote.js +0 -68
  92. package/dist/cjs/runtime/effect/backend-federation-manifest/types.js +0 -18
  93. package/dist/cjs/runtime/effect/backend-federation-manifest/validation.js +0 -109
  94. package/dist/cjs/runtime/effect/backend-federation-manifest.js +0 -62
  95. package/dist/cjs/runtime/effect/backend-federation.js +0 -65
  96. package/dist/cjs/runtime/effect/context.js +0 -60
  97. package/dist/cjs/runtime/effect/dispatch.js +0 -101
  98. package/dist/cjs/runtime/effect/edge-context.js +0 -81
  99. package/dist/cjs/runtime/effect/endpoint-contracts.js +0 -121
  100. package/dist/cjs/runtime/effect/entry-shape.js +0 -84
  101. package/dist/cjs/runtime/effect/handler/batch-handler.js +0 -161
  102. package/dist/cjs/runtime/effect/handler/batch.js +0 -159
  103. package/dist/cjs/runtime/effect/handler/definition.js +0 -102
  104. package/dist/cjs/runtime/effect/handler/envelope.js +0 -104
  105. package/dist/cjs/runtime/effect/handler/http.js +0 -107
  106. package/dist/cjs/runtime/effect/handler/openapi.js +0 -57
  107. package/dist/cjs/runtime/effect/handler/routing.js +0 -100
  108. package/dist/cjs/runtime/effect/handler/rpc.js +0 -63
  109. package/dist/cjs/runtime/effect/handler/types.js +0 -43
  110. package/dist/cjs/runtime/effect/handler.js +0 -189
  111. package/dist/cjs/runtime/effect/module.js +0 -113
  112. package/dist/cjs/runtime/effect/operation-context.js +0 -103
  113. package/dist/cjs/runtime/effect/rpcSerialization.js +0 -54
  114. package/dist/cjs/runtime/effect-client/batch.js +0 -73
  115. package/dist/cjs/runtime/effect-client/envelope.js +0 -145
  116. package/dist/cjs/runtime/effect-client/guards.js +0 -44
  117. package/dist/cjs/runtime/effect-client/request-context.js +0 -64
  118. package/dist/cjs/runtime/effect-client/request.js +0 -66
  119. package/dist/cjs/runtime/effect-client/types.js +0 -18
  120. package/dist/cjs/runtime/safe-failure.js +0 -84
  121. package/dist/cjs/utils/crossProjectServerPolicy.js +0 -98
  122. package/dist/cjs/utils/effect-client-generator/generator.js +0 -69
  123. package/dist/cjs/utils/effect-client-generator/index.js +0 -51
  124. package/dist/cjs/utils/effect-client-generator/paths.js +0 -62
  125. package/dist/cjs/utils/effect-client-generator/rendering.js +0 -220
  126. package/dist/cjs/utils/effect-client-generator/runtime.js +0 -68
  127. package/dist/cjs/utils/effect-client-generator/types.js +0 -18
  128. package/dist/cjs/utils/effectClientGenerator.js +0 -49
  129. package/dist/cjs/utils/effectSourceLoader.js +0 -312
  130. package/dist/cjs/utils/headers.js +0 -46
  131. package/dist/esm/runtime/data-platform/batch/queue.mjs +0 -246
  132. package/dist/esm/runtime/data-platform/batch/request.mjs +0 -45
  133. package/dist/esm/runtime/data-platform/batch/response.mjs +0 -23
  134. package/dist/esm/runtime/data-platform/batch/telemetry.mjs +0 -23
  135. package/dist/esm/runtime/data-platform/batch/url.mjs +0 -25
  136. package/dist/esm/runtime/data-platform/batch-transport.mjs +0 -12
  137. package/dist/esm/runtime/data-platform/codec.mjs +0 -90
  138. package/dist/esm/runtime/data-platform/invalidation.mjs +0 -20
  139. package/dist/esm/runtime/data-platform/trace.mjs +0 -29
  140. package/dist/esm/runtime/data-platform/types.mjs +0 -4
  141. package/dist/esm/runtime/data-platform/validation.mjs +0 -128
  142. package/dist/esm/runtime/effect/adapter/constants.mjs +0 -6
  143. package/dist/esm/runtime/effect/adapter/cross-project-policy.mjs +0 -28
  144. package/dist/esm/runtime/effect/adapter/entry.mjs +0 -52
  145. package/dist/esm/runtime/effect/adapter/error-response.mjs +0 -43
  146. package/dist/esm/runtime/effect/adapter/handler.mjs +0 -15
  147. package/dist/esm/runtime/effect/adapter.mjs +0 -107
  148. package/dist/esm/runtime/effect/backend-federation/entry.mjs +0 -61
  149. package/dist/esm/runtime/effect/backend-federation/identity.mjs +0 -41
  150. package/dist/esm/runtime/effect/backend-federation/load.mjs +0 -37
  151. package/dist/esm/runtime/effect/backend-federation/plugin.mjs +0 -25
  152. package/dist/esm/runtime/effect/backend-federation/remotes.mjs +0 -13
  153. package/dist/esm/runtime/effect/backend-federation/runtime.mjs +0 -90
  154. package/dist/esm/runtime/effect/backend-federation/types.mjs +0 -0
  155. package/dist/esm/runtime/effect/backend-federation/utils.mjs +0 -7
  156. package/dist/esm/runtime/effect/backend-federation-manifest/errors.mjs +0 -32
  157. package/dist/esm/runtime/effect/backend-federation-manifest/index.mjs +0 -4
  158. package/dist/esm/runtime/effect/backend-federation-manifest/load.mjs +0 -56
  159. package/dist/esm/runtime/effect/backend-federation-manifest/metadata.mjs +0 -42
  160. package/dist/esm/runtime/effect/backend-federation-manifest/reference.mjs +0 -76
  161. package/dist/esm/runtime/effect/backend-federation-manifest/remote.mjs +0 -30
  162. package/dist/esm/runtime/effect/backend-federation-manifest/types.mjs +0 -0
  163. package/dist/esm/runtime/effect/backend-federation-manifest/validation.mjs +0 -65
  164. package/dist/esm/runtime/effect/backend-federation-manifest.mjs +0 -1
  165. package/dist/esm/runtime/effect/backend-federation.mjs +0 -5
  166. package/dist/esm/runtime/effect/context.mjs +0 -13
  167. package/dist/esm/runtime/effect/dispatch.mjs +0 -63
  168. package/dist/esm/runtime/effect/edge-context.mjs +0 -34
  169. package/dist/esm/runtime/effect/endpoint-contracts.mjs +0 -68
  170. package/dist/esm/runtime/effect/entry-shape.mjs +0 -36
  171. package/dist/esm/runtime/effect/handler/batch-handler.mjs +0 -123
  172. package/dist/esm/runtime/effect/handler/batch.mjs +0 -97
  173. package/dist/esm/runtime/effect/handler/definition.mjs +0 -61
  174. package/dist/esm/runtime/effect/handler/envelope.mjs +0 -63
  175. package/dist/esm/runtime/effect/handler/http.mjs +0 -69
  176. package/dist/esm/runtime/effect/handler/openapi.mjs +0 -19
  177. package/dist/esm/runtime/effect/handler/routing.mjs +0 -50
  178. package/dist/esm/runtime/effect/handler/rpc.mjs +0 -22
  179. package/dist/esm/runtime/effect/handler/types.mjs +0 -5
  180. package/dist/esm/runtime/effect/handler.mjs +0 -14
  181. package/dist/esm/runtime/effect/module.mjs +0 -75
  182. package/dist/esm/runtime/effect/operation-context.mjs +0 -65
  183. package/dist/esm/runtime/effect/rpcSerialization.mjs +0 -16
  184. package/dist/esm/runtime/effect-client/batch.mjs +0 -35
  185. package/dist/esm/runtime/effect-client/envelope.mjs +0 -104
  186. package/dist/esm/runtime/effect-client/guards.mjs +0 -3
  187. package/dist/esm/runtime/effect-client/request-context.mjs +0 -23
  188. package/dist/esm/runtime/effect-client/request.mjs +0 -28
  189. package/dist/esm/runtime/effect-client/types.mjs +0 -0
  190. package/dist/esm/runtime/safe-failure.mjs +0 -46
  191. package/dist/esm/utils/crossProjectServerPolicy.mjs +0 -44
  192. package/dist/esm/utils/effect-client-generator/generator.mjs +0 -28
  193. package/dist/esm/utils/effect-client-generator/index.mjs +0 -3
  194. package/dist/esm/utils/effect-client-generator/paths.mjs +0 -24
  195. package/dist/esm/utils/effect-client-generator/rendering.mjs +0 -179
  196. package/dist/esm/utils/effect-client-generator/runtime.mjs +0 -27
  197. package/dist/esm/utils/effect-client-generator/types.mjs +0 -0
  198. package/dist/esm/utils/effectClientGenerator.mjs +0 -1
  199. package/dist/esm/utils/effectSourceLoader.mjs +0 -256
  200. package/dist/esm/utils/headers.mjs +0 -8
  201. package/dist/esm-node/runtime/data-platform/batch/queue.mjs +0 -247
  202. package/dist/esm-node/runtime/data-platform/batch/request.mjs +0 -46
  203. package/dist/esm-node/runtime/data-platform/batch/response.mjs +0 -24
  204. package/dist/esm-node/runtime/data-platform/batch/telemetry.mjs +0 -24
  205. package/dist/esm-node/runtime/data-platform/batch/url.mjs +0 -26
  206. package/dist/esm-node/runtime/data-platform/batch-transport.mjs +0 -13
  207. package/dist/esm-node/runtime/data-platform/codec.mjs +0 -91
  208. package/dist/esm-node/runtime/data-platform/invalidation.mjs +0 -21
  209. package/dist/esm-node/runtime/data-platform/trace.mjs +0 -30
  210. package/dist/esm-node/runtime/data-platform/types.mjs +0 -5
  211. package/dist/esm-node/runtime/data-platform/validation.mjs +0 -129
  212. package/dist/esm-node/runtime/effect/adapter/constants.mjs +0 -7
  213. package/dist/esm-node/runtime/effect/adapter/cross-project-policy.mjs +0 -29
  214. package/dist/esm-node/runtime/effect/adapter/entry.mjs +0 -53
  215. package/dist/esm-node/runtime/effect/adapter/error-response.mjs +0 -44
  216. package/dist/esm-node/runtime/effect/adapter/handler.mjs +0 -16
  217. package/dist/esm-node/runtime/effect/adapter.mjs +0 -108
  218. package/dist/esm-node/runtime/effect/backend-federation/entry.mjs +0 -62
  219. package/dist/esm-node/runtime/effect/backend-federation/identity.mjs +0 -42
  220. package/dist/esm-node/runtime/effect/backend-federation/load.mjs +0 -38
  221. package/dist/esm-node/runtime/effect/backend-federation/plugin.mjs +0 -26
  222. package/dist/esm-node/runtime/effect/backend-federation/remotes.mjs +0 -14
  223. package/dist/esm-node/runtime/effect/backend-federation/runtime.mjs +0 -91
  224. package/dist/esm-node/runtime/effect/backend-federation/types.mjs +0 -1
  225. package/dist/esm-node/runtime/effect/backend-federation/utils.mjs +0 -8
  226. package/dist/esm-node/runtime/effect/backend-federation-manifest/errors.mjs +0 -33
  227. package/dist/esm-node/runtime/effect/backend-federation-manifest/index.mjs +0 -5
  228. package/dist/esm-node/runtime/effect/backend-federation-manifest/load.mjs +0 -57
  229. package/dist/esm-node/runtime/effect/backend-federation-manifest/metadata.mjs +0 -43
  230. package/dist/esm-node/runtime/effect/backend-federation-manifest/reference.mjs +0 -77
  231. package/dist/esm-node/runtime/effect/backend-federation-manifest/remote.mjs +0 -31
  232. package/dist/esm-node/runtime/effect/backend-federation-manifest/types.mjs +0 -1
  233. package/dist/esm-node/runtime/effect/backend-federation-manifest/validation.mjs +0 -66
  234. package/dist/esm-node/runtime/effect/backend-federation-manifest.mjs +0 -2
  235. package/dist/esm-node/runtime/effect/backend-federation.mjs +0 -6
  236. package/dist/esm-node/runtime/effect/context.mjs +0 -14
  237. package/dist/esm-node/runtime/effect/dispatch.mjs +0 -64
  238. package/dist/esm-node/runtime/effect/edge-context.mjs +0 -35
  239. package/dist/esm-node/runtime/effect/endpoint-contracts.mjs +0 -69
  240. package/dist/esm-node/runtime/effect/entry-shape.mjs +0 -37
  241. package/dist/esm-node/runtime/effect/handler/batch-handler.mjs +0 -124
  242. package/dist/esm-node/runtime/effect/handler/batch.mjs +0 -98
  243. package/dist/esm-node/runtime/effect/handler/definition.mjs +0 -62
  244. package/dist/esm-node/runtime/effect/handler/envelope.mjs +0 -64
  245. package/dist/esm-node/runtime/effect/handler/http.mjs +0 -70
  246. package/dist/esm-node/runtime/effect/handler/openapi.mjs +0 -20
  247. package/dist/esm-node/runtime/effect/handler/routing.mjs +0 -51
  248. package/dist/esm-node/runtime/effect/handler/rpc.mjs +0 -23
  249. package/dist/esm-node/runtime/effect/handler/types.mjs +0 -6
  250. package/dist/esm-node/runtime/effect/handler.mjs +0 -15
  251. package/dist/esm-node/runtime/effect/module.mjs +0 -76
  252. package/dist/esm-node/runtime/effect/operation-context.mjs +0 -66
  253. package/dist/esm-node/runtime/effect/rpcSerialization.mjs +0 -17
  254. package/dist/esm-node/runtime/effect-client/batch.mjs +0 -36
  255. package/dist/esm-node/runtime/effect-client/envelope.mjs +0 -105
  256. package/dist/esm-node/runtime/effect-client/guards.mjs +0 -4
  257. package/dist/esm-node/runtime/effect-client/request-context.mjs +0 -24
  258. package/dist/esm-node/runtime/effect-client/request.mjs +0 -29
  259. package/dist/esm-node/runtime/effect-client/types.mjs +0 -1
  260. package/dist/esm-node/runtime/safe-failure.mjs +0 -47
  261. package/dist/esm-node/utils/crossProjectServerPolicy.mjs +0 -46
  262. package/dist/esm-node/utils/effect-client-generator/generator.mjs +0 -29
  263. package/dist/esm-node/utils/effect-client-generator/index.mjs +0 -4
  264. package/dist/esm-node/utils/effect-client-generator/paths.mjs +0 -25
  265. package/dist/esm-node/utils/effect-client-generator/rendering.mjs +0 -180
  266. package/dist/esm-node/utils/effect-client-generator/runtime.mjs +0 -29
  267. package/dist/esm-node/utils/effect-client-generator/types.mjs +0 -1
  268. package/dist/esm-node/utils/effectClientGenerator.mjs +0 -2
  269. package/dist/esm-node/utils/effectSourceLoader.mjs +0 -257
  270. package/dist/esm-node/utils/headers.mjs +0 -9
  271. package/dist/types/runtime/data-platform/batch/queue.d.ts +0 -8
  272. package/dist/types/runtime/data-platform/batch/request.d.ts +0 -13
  273. package/dist/types/runtime/data-platform/batch/response.d.ts +0 -3
  274. package/dist/types/runtime/data-platform/batch/telemetry.d.ts +0 -4
  275. package/dist/types/runtime/data-platform/batch/url.d.ts +0 -4
  276. package/dist/types/runtime/data-platform/batch-transport.d.ts +0 -3
  277. package/dist/types/runtime/data-platform/codec.d.ts +0 -17
  278. package/dist/types/runtime/data-platform/invalidation.d.ts +0 -8
  279. package/dist/types/runtime/data-platform/trace.d.ts +0 -4
  280. package/dist/types/runtime/data-platform/types.d.ts +0 -146
  281. package/dist/types/runtime/data-platform/validation.d.ts +0 -29
  282. package/dist/types/runtime/effect/adapter/constants.d.ts +0 -1
  283. package/dist/types/runtime/effect/adapter/cross-project-policy.d.ts +0 -4
  284. package/dist/types/runtime/effect/adapter/entry.d.ts +0 -2
  285. package/dist/types/runtime/effect/adapter/error-response.d.ts +0 -2
  286. package/dist/types/runtime/effect/adapter/handler.d.ts +0 -7
  287. package/dist/types/runtime/effect/adapter.d.ts +0 -22
  288. package/dist/types/runtime/effect/backend-federation/entry.d.ts +0 -2
  289. package/dist/types/runtime/effect/backend-federation/identity.d.ts +0 -30
  290. package/dist/types/runtime/effect/backend-federation/load.d.ts +0 -13
  291. package/dist/types/runtime/effect/backend-federation/plugin.d.ts +0 -3
  292. package/dist/types/runtime/effect/backend-federation/remotes.d.ts +0 -2
  293. package/dist/types/runtime/effect/backend-federation/runtime.d.ts +0 -3
  294. package/dist/types/runtime/effect/backend-federation/types.d.ts +0 -73
  295. package/dist/types/runtime/effect/backend-federation/utils.d.ts +0 -2
  296. package/dist/types/runtime/effect/backend-federation-manifest/errors.d.ts +0 -11
  297. package/dist/types/runtime/effect/backend-federation-manifest/index.d.ts +0 -6
  298. package/dist/types/runtime/effect/backend-federation-manifest/load.d.ts +0 -3
  299. package/dist/types/runtime/effect/backend-federation-manifest/metadata.d.ts +0 -18
  300. package/dist/types/runtime/effect/backend-federation-manifest/reference.d.ts +0 -4
  301. package/dist/types/runtime/effect/backend-federation-manifest/remote.d.ts +0 -3
  302. package/dist/types/runtime/effect/backend-federation-manifest/types.d.ts +0 -51
  303. package/dist/types/runtime/effect/backend-federation-manifest/validation.d.ts +0 -5
  304. package/dist/types/runtime/effect/backend-federation-manifest.d.ts +0 -1
  305. package/dist/types/runtime/effect/backend-federation.d.ts +0 -7
  306. package/dist/types/runtime/effect/context.d.ts +0 -5
  307. package/dist/types/runtime/effect/dispatch.d.ts +0 -13
  308. package/dist/types/runtime/effect/edge-context.d.ts +0 -5
  309. package/dist/types/runtime/effect/endpoint-contracts.d.ts +0 -66
  310. package/dist/types/runtime/effect/entry-shape.d.ts +0 -31
  311. package/dist/types/runtime/effect/handler/batch-handler.d.ts +0 -11
  312. package/dist/types/runtime/effect/handler/batch.d.ts +0 -13
  313. package/dist/types/runtime/effect/handler/definition.d.ts +0 -7
  314. package/dist/types/runtime/effect/handler/envelope.d.ts +0 -13
  315. package/dist/types/runtime/effect/handler/http.d.ts +0 -15
  316. package/dist/types/runtime/effect/handler/openapi.d.ts +0 -4
  317. package/dist/types/runtime/effect/handler/routing.d.ts +0 -5
  318. package/dist/types/runtime/effect/handler/rpc.d.ts +0 -7
  319. package/dist/types/runtime/effect/handler/types.d.ts +0 -153
  320. package/dist/types/runtime/effect/handler.d.ts +0 -14
  321. package/dist/types/runtime/effect/module.d.ts +0 -36
  322. package/dist/types/runtime/effect/operation-context.d.ts +0 -10
  323. package/dist/types/runtime/effect/rpcSerialization.d.ts +0 -3
  324. package/dist/types/runtime/effect-client/batch.d.ts +0 -2
  325. package/dist/types/runtime/effect-client/envelope.d.ts +0 -15
  326. package/dist/types/runtime/effect-client/guards.d.ts +0 -2
  327. package/dist/types/runtime/effect-client/request-context.d.ts +0 -3
  328. package/dist/types/runtime/effect-client/request.d.ts +0 -1
  329. package/dist/types/runtime/effect-client/types.d.ts +0 -68
  330. package/dist/types/runtime/safe-failure.d.ts +0 -1
  331. package/dist/types/utils/crossProjectServerPolicy.d.ts +0 -36
  332. package/dist/types/utils/effect-client-generator/generator.d.ts +0 -10
  333. package/dist/types/utils/effect-client-generator/index.d.ts +0 -4
  334. package/dist/types/utils/effect-client-generator/paths.d.ts +0 -5
  335. package/dist/types/utils/effect-client-generator/rendering.d.ts +0 -4
  336. package/dist/types/utils/effect-client-generator/runtime.d.ts +0 -12
  337. package/dist/types/utils/effect-client-generator/types.d.ts +0 -27
  338. package/dist/types/utils/effectClientGenerator.d.ts +0 -2
  339. package/dist/types/utils/effectSourceLoader.d.ts +0 -25
  340. package/dist/types/utils/headers.d.ts +0 -1
@@ -1,179 +0,0 @@
1
- import { deriveOperationVersion } from "@modern-js/bff-core";
2
- import { fs, upath } from "@modern-js/utils";
3
- import { createEffectEndpointContractHash, ensureLeadingSlash, normalizeEffectPrefix } from "../../runtime/effect/endpoint-contracts.mjs";
4
- const DEFAULT_REQUEST_CREATOR = '@modern-js/plugin-bff/client';
5
- const EFFECT_CLIENT_RUNTIME_IMPORT = '@modern-js/plugin-bff/effect-client-runtime';
6
- function isAbsoluteUrl(value) {
7
- try {
8
- new URL(value);
9
- return true;
10
- } catch {
11
- return false;
12
- }
13
- }
14
- function resolveBatchEndpoint(prefix, endpoint) {
15
- const value = void 0 === endpoint || '' === endpoint ? '/_data/batch' : endpoint;
16
- if (isAbsoluteUrl(value)) return value;
17
- const normalizedPrefix = normalizeEffectPrefix(prefix);
18
- const normalizedEndpoint = ensureLeadingSlash(value);
19
- if ('' === normalizedPrefix) return normalizedEndpoint;
20
- if (normalizedEndpoint === normalizedPrefix || normalizedEndpoint.startsWith(`${normalizedPrefix}/`)) return normalizedEndpoint;
21
- return `${normalizedPrefix}${'/' === normalizedEndpoint ? '' : normalizedEndpoint}`;
22
- }
23
- function getPackageInfo(appDir) {
24
- try {
25
- const packageJsonPath = upath.resolve(appDir, './package.json');
26
- const packageJson = fs.readJSONSync(packageJsonPath);
27
- return {
28
- name: packageJson.name,
29
- version: packageJson.version
30
- };
31
- } catch {
32
- return {};
33
- }
34
- }
35
- function renderEffectClientCode(endpoints, options) {
36
- const requestCreator = options.requestCreator || DEFAULT_REQUEST_CREATOR;
37
- const httpMethodDecider = options.httpMethodDecider || 'functionName';
38
- const packageInfo = getPackageInfo(options.appDir);
39
- const packageName = packageInfo.name;
40
- const dataPlatformAppNamespace = void 0 === packageName || '' === packageName ? 'unknown-app' : packageName;
41
- const requestId = 'bundle' === options.target ? void 0 !== packageName && '' !== packageName ? packageName : void 0 : void 0;
42
- const normalizedRequestId = void 0 === requestId || '' === requestId ? 'default' : requestId;
43
- const operationVersion = deriveOperationVersion(packageInfo.version);
44
- const batchConfig = options.dataPlatformBatch;
45
- const batchEndpoint = resolveBatchEndpoint(options.prefix, batchConfig?.endpoint);
46
- const manifest = {
47
- endpoints: endpoints.map((endpoint)=>({
48
- apiId: endpoint.apiId,
49
- group: endpoint.groupName,
50
- endpoint: endpoint.endpointName,
51
- method: endpoint.method,
52
- routePath: endpoint.routePath,
53
- schemaHash: createEffectEndpointContractHash(endpoint, normalizedRequestId),
54
- operationVersion
55
- }))
56
- };
57
- const config = {
58
- appNamespace: dataPlatformAppNamespace,
59
- ...void 0 !== requestId && '' !== requestId ? {
60
- requestId
61
- } : {},
62
- port: options.port,
63
- useEnvPort: 'server' === options.target,
64
- defaultOrigin: `http://localhost:${String(options.port)}`,
65
- httpMethodDecider,
66
- batch: {
67
- enabled: batchConfig?.enabled ?? true,
68
- endpoint: batchEndpoint,
69
- flushIntervalMs: batchConfig?.flushIntervalMs ?? 8,
70
- maxBatchSize: batchConfig?.maxBatchSize ?? 16,
71
- maxBatchBytes: batchConfig?.maxBatchBytes ?? 65536,
72
- requestTimeoutMs: batchConfig?.requestTimeoutMs ?? 10000,
73
- allowedMethods: batchConfig?.allowedMethods !== void 0 && batchConfig.allowedMethods.length > 0 ? batchConfig.allowedMethods : [
74
- 'GET'
75
- ]
76
- }
77
- };
78
- return `import * as __requestRuntime from ${JSON.stringify(requestCreator)};
79
- import { createGeneratedEffectClient } from ${JSON.stringify(EFFECT_CLIENT_RUNTIME_IMPORT)};
80
-
81
- const __manifest = ${JSON.stringify(manifest, null, 2)};
82
-
83
- const __config = ${JSON.stringify(config, null, 2)};
84
-
85
- const __generated = createGeneratedEffectClient(__manifest, __config, __requestRuntime);
86
-
87
- const client = __generated.client;
88
- const operationManifest = __generated.operationManifest;
89
- const createEffectRequestContext = __generated.createEffectRequestContext;
90
- const apiModule = {
91
- client,
92
- operationManifest,
93
- createEffectRequestContext,
94
- };
95
-
96
- export { client, createEffectRequestContext, operationManifest };
97
- export default apiModule;
98
- `;
99
- }
100
- function renderClientShape(endpoints, valueType) {
101
- if (0 === endpoints.length) return `Record<string, Record<string, ${valueType}>>`;
102
- const groups = new Map();
103
- for (const endpoint of endpoints){
104
- const group = groups.get(endpoint.groupName) || [];
105
- group.push(endpoint.endpointName);
106
- groups.set(endpoint.groupName, group);
107
- }
108
- const groupEntries = [
109
- ...groups.entries()
110
- ].map(([groupName, names])=>{
111
- const endpointEntries = names.map((name)=>` ${JSON.stringify(name)}: ${valueType};`).join('\n');
112
- return ` ${JSON.stringify(groupName)}: {\n${endpointEntries}\n };`;
113
- });
114
- return `{\n${groupEntries.join('\n')}\n}`;
115
- }
116
- function renderEffectClientDeclaration(endpoints = []) {
117
- return `export type EffectClientOperation = (
118
- request?: unknown,
119
- ) => Promise<unknown>;
120
- export type EffectClientGroup = Record<string, EffectClientOperation>;
121
- export type EffectClient = Record<string, EffectClientGroup>;
122
- export type EffectOperationDescriptor = {
123
- appNamespace: string;
124
- apiId: string;
125
- group: string;
126
- endpoint: string;
127
- operationId: string;
128
- routePath: string;
129
- method: string;
130
- operationVersion: number;
131
- schemaHash: string;
132
- version: number;
133
- };
134
- export type EffectOperationManifest = Record<
135
- string,
136
- Record<string, EffectOperationDescriptor>
137
- >;
138
- export type EffectOperationContext = {
139
- requestId?: string;
140
- operationId?: string;
141
- routePath?: string;
142
- method?: string;
143
- schemaHash?: string;
144
- operationVersion?: number;
145
- locale?: string;
146
- traceparent?: string;
147
- traceId?: string;
148
- spanId?: string;
149
- source?: string;
150
- scope?: Record<string, unknown>;
151
- sessionClaims?: Record<string, unknown>;
152
- attributes?: Record<string, unknown>;
153
- };
154
- export type EffectRequestContext = {
155
- headers?: Record<string, string>;
156
- locale?: string;
157
- operationContext?: EffectOperationContext;
158
- traceparent?: string;
159
- traceId?: string;
160
- spanId?: string;
161
- };
162
- export type GeneratedEffectClient = ${renderClientShape(endpoints, 'EffectClientOperation')};
163
- export type GeneratedEffectOperationManifest = ${renderClientShape(endpoints, "EffectOperationDescriptor")};
164
-
165
- export declare const client: GeneratedEffectClient;
166
- export declare const createEffectRequestContext: (
167
- requestContext: Record<string, unknown>,
168
- ) => EffectRequestContext;
169
- export declare const operationManifest: GeneratedEffectOperationManifest;
170
- declare const apiModule: {
171
- client: GeneratedEffectClient;
172
- createEffectRequestContext: typeof createEffectRequestContext;
173
- operationManifest: GeneratedEffectOperationManifest;
174
- };
175
-
176
- export default apiModule;
177
- `;
178
- }
179
- export { renderEffectClientCode, renderEffectClientDeclaration };
@@ -1,27 +0,0 @@
1
- import { compatibleRequire, upath } from "@modern-js/utils";
2
- import { extractHttpApiFromModule } from "../../runtime/effect/endpoint-contracts.mjs";
3
- import { loadEffectSourceModule } from "../effectSourceLoader.mjs";
4
- let httpApiRuntimePromise;
5
- function isRecord(value) {
6
- return 'object' == typeof value && null !== value;
7
- }
8
- function isHttpApiRuntime(value) {
9
- return isRecord(value) && 'function' == typeof value.isHttpApi && 'function' == typeof value.reflect;
10
- }
11
- function getHttpApiRuntime() {
12
- if (void 0 === httpApiRuntimePromise) httpApiRuntimePromise = compatibleRequire('effect/unstable/httpapi', false).catch((error)=>{
13
- const message = error instanceof Error ? error.message : String(error);
14
- if (!message.includes("Cannot find module 'effect/unstable/httpapi'")) throw error;
15
- const effectPackageJson = require.resolve('effect/package.json');
16
- const effectHttpApiRuntimePath = upath.join(upath.dirname(effectPackageJson), 'dist', 'unstable', 'httpapi', 'index.js');
17
- return compatibleRequire(effectHttpApiRuntimePath, false);
18
- }).then((mod)=>{
19
- if (isRecord(mod) && isHttpApiRuntime(mod.HttpApi)) return mod.HttpApi;
20
- throw new Error('[BFF][Effect] Unable to resolve HttpApi runtime from effect/unstable/httpapi.');
21
- });
22
- return httpApiRuntimePromise;
23
- }
24
- function loadEffectApi(options) {
25
- return getHttpApiRuntime().then((httpApiRuntime)=>loadEffectSourceModule(options).then((mod)=>extractHttpApiFromModule(mod, httpApiRuntime.isHttpApi)));
26
- }
27
- export { getHttpApiRuntime, loadEffectApi };
File without changes
@@ -1 +0,0 @@
1
- export { generateEffectClient, generateEffectClientCode, renderEffectClientDeclaration, resolveEffectEntryFile } from "./effect-client-generator/index.mjs";
@@ -1,256 +0,0 @@
1
- import node_crypto from "node:crypto";
2
- import node_fs from "node:fs";
3
- import { builtinModules, createRequire } from "node:module";
4
- import node_path from "node:path";
5
- import { pathToFileURL } from "node:url";
6
- import { build, transform } from "esbuild";
7
- const dynamicImport = new Function('specifier', 'return import(specifier)');
8
- const SOURCE_LOADERS = new Map([
9
- [
10
- '.js',
11
- 'js'
12
- ],
13
- [
14
- '.jsx',
15
- 'jsx'
16
- ],
17
- [
18
- '.mjs',
19
- 'js'
20
- ],
21
- [
22
- '.cjs',
23
- 'js'
24
- ],
25
- [
26
- '.ts',
27
- 'ts'
28
- ],
29
- [
30
- '.tsx',
31
- 'tsx'
32
- ],
33
- [
34
- '.mts',
35
- 'ts'
36
- ],
37
- [
38
- '.cts',
39
- 'ts'
40
- ]
41
- ]);
42
- function sourceLoader(args) {
43
- return SOURCE_LOADERS.get(node_path.extname(args.path).toLowerCase());
44
- }
45
- function preserveSourceModuleSemantics() {
46
- return {
47
- name: 'modern-js-effect-source-semantics',
48
- setup (buildApi) {
49
- buildApi.onLoad({
50
- filter: /\.[cm]?[jt]sx?$/
51
- }, async (args)=>{
52
- const loader = sourceLoader(args);
53
- if (!loader) return;
54
- const source = await node_fs.promises.readFile(args.path, 'utf8');
55
- const compiled = await transform(source, {
56
- define: {
57
- 'import.meta.url': JSON.stringify(pathToFileURL(args.path).href)
58
- },
59
- jsx: 'automatic',
60
- loader,
61
- sourcefile: args.path,
62
- target: 'node20'
63
- });
64
- return {
65
- contents: compiled.code,
66
- loader: 'js',
67
- resolveDir: node_path.dirname(args.path)
68
- };
69
- });
70
- }
71
- };
72
- }
73
- const nodeBuiltins = new Set([
74
- ...builtinModules,
75
- ...builtinModules.map((name)=>`node:${name}`)
76
- ]);
77
- const dependencyResolutionMarker = 'modern-js-effect-dependency-resolution';
78
- async function isEsmOnlyFile(filename) {
79
- const extension = node_path.extname(filename).toLowerCase();
80
- if ('.mjs' === extension || '.mts' === extension) return true;
81
- if ('.cjs' === extension || '.cts' === extension) return false;
82
- let directory = node_path.dirname(filename);
83
- while(true){
84
- const packagePath = node_path.join(directory, 'package.json');
85
- try {
86
- const packageJson = JSON.parse(await node_fs.promises.readFile(packagePath, 'utf8'));
87
- return 'module' === packageJson.type;
88
- } catch (error) {
89
- if (!error || 'object' != typeof error || !('code' in error) || 'ENOENT' !== error.code) throw error;
90
- }
91
- const parent = node_path.dirname(directory);
92
- if (parent === directory) return false;
93
- directory = parent;
94
- }
95
- }
96
- function isBareSpecifier(specifier) {
97
- return !specifier.startsWith('.') && !specifier.startsWith('/') && !node_path.isAbsolute(specifier);
98
- }
99
- function externalizeInstalledDependencies(options) {
100
- const runtimeRequire = createRequire(node_path.join(options.runtimeResolveDir, '__modern_effect_entry.cjs'));
101
- return {
102
- name: 'modern-js-effect-installed-dependencies',
103
- setup (buildApi) {
104
- buildApi.onResolve({
105
- filter: /.*/
106
- }, async (args)=>{
107
- if (!isBareSpecifier(args.path) || nodeBuiltins.has(args.path) || args.pluginData?.[dependencyResolutionMarker] === true) return nodeBuiltins.has(args.path) ? {
108
- external: true,
109
- path: args.path
110
- } : void 0;
111
- const resolution = await buildApi.resolve(args.path, {
112
- importer: args.importer,
113
- kind: args.kind,
114
- namespace: args.namespace,
115
- pluginData: {
116
- ...args.pluginData,
117
- [dependencyResolutionMarker]: true
118
- },
119
- resolveDir: args.resolveDir
120
- });
121
- if (resolution.errors.length > 0) return {
122
- external: true,
123
- path: args.path
124
- };
125
- if (resolution.external || !resolution.path) return {
126
- external: true,
127
- path: args.path
128
- };
129
- const realPath = await node_fs.promises.realpath(resolution.path).catch(()=>resolution.path);
130
- if (realPath.includes(`${node_path.sep}node_modules${node_path.sep}`)) {
131
- const runtimeResolution = await buildApi.resolve(args.path, {
132
- importer: '',
133
- kind: args.kind,
134
- namespace: 'file',
135
- pluginData: {
136
- [dependencyResolutionMarker]: true
137
- },
138
- resolveDir: options.runtimeResolveDir
139
- });
140
- if (0 === runtimeResolution.errors.length && runtimeResolution.path) {
141
- if ('cjs' === options.format) {
142
- let requiredPath;
143
- try {
144
- requiredPath = runtimeRequire.resolve(args.path);
145
- } catch {
146
- requiredPath = runtimeResolution.path;
147
- }
148
- if (await isEsmOnlyFile(requiredPath)) return {
149
- namespace: resolution.namespace,
150
- path: resolution.path,
151
- pluginData: resolution.pluginData,
152
- sideEffects: resolution.sideEffects,
153
- suffix: resolution.suffix,
154
- warnings: resolution.warnings
155
- };
156
- }
157
- return {
158
- external: true,
159
- path: args.path
160
- };
161
- }
162
- }
163
- return {
164
- namespace: resolution.namespace,
165
- path: resolution.path,
166
- pluginData: resolution.pluginData,
167
- sideEffects: resolution.sideEffects,
168
- suffix: resolution.suffix,
169
- warnings: resolution.warnings
170
- };
171
- });
172
- }
173
- };
174
- }
175
- async function bundleEffectEntryForNode(options) {
176
- await build({
177
- absWorkingDir: options.appDir,
178
- allowOverwrite: true,
179
- bundle: true,
180
- entryPoints: [
181
- options.entryPath
182
- ],
183
- format: options.format,
184
- logLevel: 'silent',
185
- outfile: options.entryPath,
186
- platform: 'node',
187
- plugins: [
188
- externalizeInstalledDependencies({
189
- format: options.format,
190
- runtimeResolveDir: options.appDir
191
- }),
192
- preserveSourceModuleSemantics()
193
- ],
194
- target: 'node20'
195
- });
196
- }
197
- function isWatchableInput(filename) {
198
- return !filename.includes(`${node_path.sep}node_modules${node_path.sep}`) && (SOURCE_LOADERS.has(node_path.extname(filename).toLowerCase()) || '.json' === node_path.extname(filename).toLowerCase());
199
- }
200
- function normalizeImportedModule(module) {
201
- if (!module || 'object' != typeof module) return module;
202
- const namespace = module;
203
- const commonJsModule = namespace.default;
204
- if (1 === Object.keys(namespace).length && null !== commonJsModule && 'object' == typeof commonJsModule && true === commonJsModule.__esModule) return commonJsModule;
205
- return module;
206
- }
207
- async function loadEffectBuiltModule(resourcePath) {
208
- const canonicalPath = await node_fs.promises.realpath(node_path.resolve(resourcePath));
209
- if (!await isEsmOnlyFile(canonicalPath)) return createRequire(canonicalPath)(canonicalPath);
210
- return normalizeImportedModule(await dynamicImport(pathToFileURL(canonicalPath).href));
211
- }
212
- async function loadEffectSourceModule(options) {
213
- const resourcePath = node_path.resolve(options.resourcePath);
214
- const appDir = node_path.resolve(options.appDir ?? node_path.dirname(resourcePath));
215
- const tsconfigPath = node_path.join(appDir, 'tsconfig.json');
216
- const cacheDirectory = node_path.join(appDir, 'node_modules', '.cache', 'modern-js', 'effect-source-loader');
217
- const outputName = node_crypto.createHash('sha256').update(resourcePath).digest('hex').slice(0, 24);
218
- const outputPath = node_path.join(cacheDirectory, `${outputName}.mjs`);
219
- await node_fs.promises.mkdir(cacheDirectory, {
220
- recursive: true
221
- });
222
- const result = await build({
223
- absWorkingDir: appDir,
224
- banner: {
225
- js: `import { createRequire as __modernCreateEffectRequire } from 'node:module'; const require = __modernCreateEffectRequire(${JSON.stringify(pathToFileURL(resourcePath).href)});`
226
- },
227
- bundle: true,
228
- entryPoints: [
229
- resourcePath
230
- ],
231
- format: 'esm',
232
- jsx: 'automatic',
233
- logLevel: 'silent',
234
- metafile: true,
235
- outfile: outputPath,
236
- platform: 'node',
237
- plugins: [
238
- externalizeInstalledDependencies({
239
- format: 'esm',
240
- runtimeResolveDir: appDir
241
- }),
242
- preserveSourceModuleSemantics()
243
- ],
244
- sourcemap: 'inline',
245
- target: 'node20',
246
- tsconfig: node_fs.existsSync(tsconfigPath) ? tsconfigPath : void 0
247
- });
248
- for (const input of Object.keys(result.metafile.inputs)){
249
- const dependency = node_path.isAbsolute(input) ? node_path.normalize(input) : node_path.resolve(appDir, input);
250
- if (isWatchableInput(dependency)) options.onDependency?.(dependency);
251
- }
252
- const output = await node_fs.promises.readFile(outputPath);
253
- const revision = node_crypto.createHash('sha256').update(output).digest('hex');
254
- return normalizeImportedModule(await dynamicImport(`${pathToFileURL(outputPath).href}?v=${revision}`));
255
- }
256
- export { bundleEffectEntryForNode, loadEffectBuiltModule, loadEffectSourceModule };
@@ -1,8 +0,0 @@
1
- function toHeaderRecord(headers) {
2
- const record = {};
3
- headers.forEach((value, key)=>{
4
- record[key] = value;
5
- });
6
- return record;
7
- }
8
- export { toHeaderRecord };