@bleedingdev/modern-js-plugin-bff 3.5.0-ultramodern.1 → 3.5.0-ultramodern.100

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