@aws-blocks/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/LICENSE +174 -0
  2. package/dist/api.d.ts +147 -0
  3. package/dist/api.d.ts.map +1 -0
  4. package/dist/api.js +10 -0
  5. package/dist/api.test.d.ts +2 -0
  6. package/dist/api.test.d.ts.map +1 -0
  7. package/dist/api.test.js +19 -0
  8. package/dist/bb-utils.d.ts +11 -0
  9. package/dist/bb-utils.d.ts.map +1 -0
  10. package/dist/bb-utils.js +12 -0
  11. package/dist/builtin-routes.d.ts +6 -0
  12. package/dist/builtin-routes.d.ts.map +1 -0
  13. package/dist/builtin-routes.js +57 -0
  14. package/dist/cdk/__fixtures__/factory-backend.d.ts +3 -0
  15. package/dist/cdk/__fixtures__/factory-backend.d.ts.map +1 -0
  16. package/dist/cdk/__fixtures__/factory-backend.js +6 -0
  17. package/dist/cdk/__fixtures__/fullid-construct-backend.d.ts +2 -0
  18. package/dist/cdk/__fixtures__/fullid-construct-backend.d.ts.map +1 -0
  19. package/dist/cdk/__fixtures__/fullid-construct-backend.js +37 -0
  20. package/dist/cdk/__fixtures__/handler.d.ts +5 -0
  21. package/dist/cdk/__fixtures__/handler.d.ts.map +1 -0
  22. package/dist/cdk/__fixtures__/handler.js +3 -0
  23. package/dist/cdk/__fixtures__/side-effect-backend.d.ts +2 -0
  24. package/dist/cdk/__fixtures__/side-effect-backend.d.ts.map +1 -0
  25. package/dist/cdk/__fixtures__/side-effect-backend.js +5 -0
  26. package/dist/cdk/blocks-backend.d.ts +68 -0
  27. package/dist/cdk/blocks-backend.d.ts.map +1 -0
  28. package/dist/cdk/blocks-backend.js +214 -0
  29. package/dist/cdk/blocks-backend.test.d.ts +2 -0
  30. package/dist/cdk/blocks-backend.test.d.ts.map +1 -0
  31. package/dist/cdk/blocks-backend.test.js +151 -0
  32. package/dist/cdk/blocks-stack.test.d.ts +2 -0
  33. package/dist/cdk/blocks-stack.test.d.ts.map +1 -0
  34. package/dist/cdk/blocks-stack.test.js +78 -0
  35. package/dist/cdk/config-registry.d.ts +26 -0
  36. package/dist/cdk/config-registry.d.ts.map +1 -0
  37. package/dist/cdk/config-registry.js +80 -0
  38. package/dist/cdk/index.d.ts +35 -0
  39. package/dist/cdk/index.d.ts.map +1 -0
  40. package/dist/cdk/index.js +90 -0
  41. package/dist/cdk/mixins.d.ts +28 -0
  42. package/dist/cdk/mixins.d.ts.map +1 -0
  43. package/dist/cdk/mixins.js +37 -0
  44. package/dist/cdk/mixins.test.d.ts +2 -0
  45. package/dist/cdk/mixins.test.d.ts.map +1 -0
  46. package/dist/cdk/mixins.test.js +108 -0
  47. package/dist/cdk/node-version.d.ts +14 -0
  48. package/dist/cdk/node-version.d.ts.map +1 -0
  49. package/dist/cdk/node-version.js +15 -0
  50. package/dist/cdk/stack-metadata.d.ts +12 -0
  51. package/dist/cdk/stack-metadata.d.ts.map +1 -0
  52. package/dist/cdk/stack-metadata.js +22 -0
  53. package/dist/cdk/stack-metadata.test.d.ts +2 -0
  54. package/dist/cdk/stack-metadata.test.d.ts.map +1 -0
  55. package/dist/cdk/stack-metadata.test.js +56 -0
  56. package/dist/cdk/synth-guard.d.ts +14 -0
  57. package/dist/cdk/synth-guard.d.ts.map +1 -0
  58. package/dist/cdk/synth-guard.js +20 -0
  59. package/dist/cdk/synth-guard.test.d.ts +2 -0
  60. package/dist/cdk/synth-guard.test.d.ts.map +1 -0
  61. package/dist/cdk/synth-guard.test.js +15 -0
  62. package/dist/client/index.d.ts +97 -0
  63. package/dist/client/index.d.ts.map +1 -0
  64. package/dist/client/index.js +238 -0
  65. package/dist/client/index.test.d.ts +2 -0
  66. package/dist/client/index.test.d.ts.map +1 -0
  67. package/dist/client/index.test.js +113 -0
  68. package/dist/common/config.d.ts +45 -0
  69. package/dist/common/config.d.ts.map +1 -0
  70. package/dist/common/config.js +154 -0
  71. package/dist/common/config.test.d.ts +2 -0
  72. package/dist/common/config.test.d.ts.map +1 -0
  73. package/dist/common/config.test.js +173 -0
  74. package/dist/common/constants.d.ts +11 -0
  75. package/dist/common/constants.d.ts.map +1 -0
  76. package/dist/common/constants.js +12 -0
  77. package/dist/common/crypto.d.ts +6 -0
  78. package/dist/common/crypto.d.ts.map +1 -0
  79. package/dist/common/crypto.js +14 -0
  80. package/dist/common/index.d.ts +220 -0
  81. package/dist/common/index.d.ts.map +1 -0
  82. package/dist/common/index.js +180 -0
  83. package/dist/common/index.test.d.ts +2 -0
  84. package/dist/common/index.test.d.ts.map +1 -0
  85. package/dist/common/index.test.js +195 -0
  86. package/dist/common/mock-data.d.ts +40 -0
  87. package/dist/common/mock-data.d.ts.map +1 -0
  88. package/dist/common/mock-data.js +39 -0
  89. package/dist/common/official-bb-names.generated.d.ts +7 -0
  90. package/dist/common/official-bb-names.generated.d.ts.map +1 -0
  91. package/dist/common/official-bb-names.generated.js +28 -0
  92. package/dist/common/sdk-registry.d.ts +136 -0
  93. package/dist/common/sdk-registry.d.ts.map +1 -0
  94. package/dist/common/sdk-registry.js +125 -0
  95. package/dist/constants.d.ts +27 -0
  96. package/dist/constants.d.ts.map +1 -0
  97. package/dist/constants.js +28 -0
  98. package/dist/cors.d.ts +39 -0
  99. package/dist/cors.d.ts.map +1 -0
  100. package/dist/cors.js +85 -0
  101. package/dist/cors.test.d.ts +2 -0
  102. package/dist/cors.test.d.ts.map +1 -0
  103. package/dist/cors.test.js +241 -0
  104. package/dist/db-naming.d.ts +21 -0
  105. package/dist/db-naming.d.ts.map +1 -0
  106. package/dist/db-naming.js +38 -0
  107. package/dist/db-naming.test.d.ts +2 -0
  108. package/dist/db-naming.test.d.ts.map +1 -0
  109. package/dist/db-naming.test.js +29 -0
  110. package/dist/errors.d.ts +67 -0
  111. package/dist/errors.d.ts.map +1 -0
  112. package/dist/errors.js +69 -0
  113. package/dist/hosting.d.ts +258 -0
  114. package/dist/hosting.d.ts.map +1 -0
  115. package/dist/hosting.js +340 -0
  116. package/dist/hosting.test.d.ts +2 -0
  117. package/dist/hosting.test.d.ts.map +1 -0
  118. package/dist/hosting.test.js +1077 -0
  119. package/dist/index.cdk.d.ts +13 -0
  120. package/dist/index.cdk.d.ts.map +1 -0
  121. package/dist/index.cdk.js +13 -0
  122. package/dist/index.d.ts +9 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +10 -0
  125. package/dist/lambda-handler.d.ts +131 -0
  126. package/dist/lambda-handler.d.ts.map +1 -0
  127. package/dist/lambda-handler.js +610 -0
  128. package/dist/lambda-handler.test.d.ts +2 -0
  129. package/dist/lambda-handler.test.d.ts.map +1 -0
  130. package/dist/lambda-handler.test.js +835 -0
  131. package/dist/pipeline/index.d.ts +4 -0
  132. package/dist/pipeline/index.d.ts.map +1 -0
  133. package/dist/pipeline/index.js +3 -0
  134. package/dist/pipeline/pipeline-construct.d.ts +130 -0
  135. package/dist/pipeline/pipeline-construct.d.ts.map +1 -0
  136. package/dist/pipeline/pipeline-construct.js +484 -0
  137. package/dist/pipeline/pipeline.test.d.ts +2 -0
  138. package/dist/pipeline/pipeline.test.d.ts.map +1 -0
  139. package/dist/pipeline/pipeline.test.js +1231 -0
  140. package/dist/pipeline/types.d.ts +351 -0
  141. package/dist/pipeline/types.d.ts.map +1 -0
  142. package/dist/pipeline/types.js +3 -0
  143. package/dist/raw-route.cdk.d.ts +47 -0
  144. package/dist/raw-route.cdk.d.ts.map +1 -0
  145. package/dist/raw-route.cdk.js +51 -0
  146. package/dist/raw-route.d.ts +119 -0
  147. package/dist/raw-route.d.ts.map +1 -0
  148. package/dist/raw-route.js +239 -0
  149. package/dist/raw-route.mock.d.ts +47 -0
  150. package/dist/raw-route.mock.d.ts.map +1 -0
  151. package/dist/raw-route.mock.js +51 -0
  152. package/dist/raw-route.test.d.ts +2 -0
  153. package/dist/raw-route.test.d.ts.map +1 -0
  154. package/dist/raw-route.test.js +597 -0
  155. package/dist/redact.d.ts +51 -0
  156. package/dist/redact.d.ts.map +1 -0
  157. package/dist/redact.js +134 -0
  158. package/dist/redact.test.d.ts +2 -0
  159. package/dist/redact.test.d.ts.map +1 -0
  160. package/dist/redact.test.js +199 -0
  161. package/dist/rpc.d.ts +54 -0
  162. package/dist/rpc.d.ts.map +1 -0
  163. package/dist/rpc.js +127 -0
  164. package/dist/rpc.test.d.ts +2 -0
  165. package/dist/rpc.test.d.ts.map +1 -0
  166. package/dist/rpc.test.js +60 -0
  167. package/dist/scripts/cdk-telemetry-env.d.ts +13 -0
  168. package/dist/scripts/cdk-telemetry-env.d.ts.map +1 -0
  169. package/dist/scripts/cdk-telemetry-env.js +21 -0
  170. package/dist/scripts/cdk-telemetry-env.test.d.ts +2 -0
  171. package/dist/scripts/cdk-telemetry-env.test.d.ts.map +1 -0
  172. package/dist/scripts/cdk-telemetry-env.test.js +56 -0
  173. package/dist/scripts/cleanup.d.ts +3 -0
  174. package/dist/scripts/cleanup.d.ts.map +1 -0
  175. package/dist/scripts/cleanup.js +35 -0
  176. package/dist/scripts/console.d.ts +6 -0
  177. package/dist/scripts/console.d.ts.map +1 -0
  178. package/dist/scripts/console.js +25 -0
  179. package/dist/scripts/deploy.d.ts +6 -0
  180. package/dist/scripts/deploy.d.ts.map +1 -0
  181. package/dist/scripts/deploy.js +82 -0
  182. package/dist/scripts/destroy.d.ts +6 -0
  183. package/dist/scripts/destroy.d.ts.map +1 -0
  184. package/dist/scripts/destroy.js +30 -0
  185. package/dist/scripts/dev-server-cors.test.d.ts +2 -0
  186. package/dist/scripts/dev-server-cors.test.d.ts.map +1 -0
  187. package/dist/scripts/dev-server-cors.test.js +23 -0
  188. package/dist/scripts/dev-server-telemetry.test.d.ts +2 -0
  189. package/dist/scripts/dev-server-telemetry.test.d.ts.map +1 -0
  190. package/dist/scripts/dev-server-telemetry.test.js +113 -0
  191. package/dist/scripts/dev-server.d.ts +21 -0
  192. package/dist/scripts/dev-server.d.ts.map +1 -0
  193. package/dist/scripts/dev-server.js +456 -0
  194. package/dist/scripts/ensure-secrets.d.ts +31 -0
  195. package/dist/scripts/ensure-secrets.d.ts.map +1 -0
  196. package/dist/scripts/ensure-secrets.js +100 -0
  197. package/dist/scripts/ensure-secrets.test.d.ts +2 -0
  198. package/dist/scripts/ensure-secrets.test.d.ts.map +1 -0
  199. package/dist/scripts/ensure-secrets.test.js +44 -0
  200. package/dist/scripts/external-migrations-step.d.ts +62 -0
  201. package/dist/scripts/external-migrations-step.d.ts.map +1 -0
  202. package/dist/scripts/external-migrations-step.js +243 -0
  203. package/dist/scripts/external-migrations-step.test.d.ts +2 -0
  204. package/dist/scripts/external-migrations-step.test.d.ts.map +1 -0
  205. package/dist/scripts/external-migrations-step.test.js +47 -0
  206. package/dist/scripts/extract-ts-types.d.ts +65 -0
  207. package/dist/scripts/extract-ts-types.d.ts.map +1 -0
  208. package/dist/scripts/extract-ts-types.js +664 -0
  209. package/dist/scripts/extract-ts-types.test.d.ts +2 -0
  210. package/dist/scripts/extract-ts-types.test.d.ts.map +1 -0
  211. package/dist/scripts/extract-ts-types.test.js +497 -0
  212. package/dist/scripts/generate-client-worker.d.ts +2 -0
  213. package/dist/scripts/generate-client-worker.d.ts.map +1 -0
  214. package/dist/scripts/generate-client-worker.js +13 -0
  215. package/dist/scripts/generate-client.d.ts +14 -0
  216. package/dist/scripts/generate-client.d.ts.map +1 -0
  217. package/dist/scripts/generate-client.js +73 -0
  218. package/dist/scripts/generate-client.test.d.ts +2 -0
  219. package/dist/scripts/generate-client.test.d.ts.map +1 -0
  220. package/dist/scripts/generate-client.test.js +48 -0
  221. package/dist/scripts/generate-spec-cli.d.ts +3 -0
  222. package/dist/scripts/generate-spec-cli.d.ts.map +1 -0
  223. package/dist/scripts/generate-spec-cli.js +77 -0
  224. package/dist/scripts/generate-spec-cli.test.d.ts +14 -0
  225. package/dist/scripts/generate-spec-cli.test.d.ts.map +1 -0
  226. package/dist/scripts/generate-spec-cli.test.js +90 -0
  227. package/dist/scripts/generate-spec.d.ts +61 -0
  228. package/dist/scripts/generate-spec.d.ts.map +1 -0
  229. package/dist/scripts/generate-spec.js +746 -0
  230. package/dist/scripts/generate-spec.test.d.ts +12 -0
  231. package/dist/scripts/generate-spec.test.d.ts.map +1 -0
  232. package/dist/scripts/generate-spec.test.js +88 -0
  233. package/dist/scripts/index.d.ts +12 -0
  234. package/dist/scripts/index.d.ts.map +1 -0
  235. package/dist/scripts/index.js +13 -0
  236. package/dist/scripts/sandbox.d.ts +11 -0
  237. package/dist/scripts/sandbox.d.ts.map +1 -0
  238. package/dist/scripts/sandbox.js +200 -0
  239. package/dist/scripts/telemetry-cli.d.ts +3 -0
  240. package/dist/scripts/telemetry-cli.d.ts.map +1 -0
  241. package/dist/scripts/telemetry-cli.js +8 -0
  242. package/dist/scripts/telemetry.d.ts +17 -0
  243. package/dist/scripts/telemetry.d.ts.map +1 -0
  244. package/dist/scripts/telemetry.js +150 -0
  245. package/dist/scripts/telemetry.test.d.ts +2 -0
  246. package/dist/scripts/telemetry.test.d.ts.map +1 -0
  247. package/dist/scripts/telemetry.test.js +203 -0
  248. package/dist/scripts/validate-spec.d.ts +22 -0
  249. package/dist/scripts/validate-spec.d.ts.map +1 -0
  250. package/dist/scripts/validate-spec.js +159 -0
  251. package/dist/server/index.d.ts +3 -0
  252. package/dist/server/index.d.ts.map +1 -0
  253. package/dist/server/index.js +3 -0
  254. package/dist/server/withAuth.d.ts +142 -0
  255. package/dist/server/withAuth.d.ts.map +1 -0
  256. package/dist/server/withAuth.js +261 -0
  257. package/dist/server/withAuth.test.d.ts +2 -0
  258. package/dist/server/withAuth.test.d.ts.map +1 -0
  259. package/dist/server/withAuth.test.js +278 -0
  260. package/dist/telemetry/client.d.ts +59 -0
  261. package/dist/telemetry/client.d.ts.map +1 -0
  262. package/dist/telemetry/client.js +215 -0
  263. package/dist/telemetry/config-writer.d.ts +16 -0
  264. package/dist/telemetry/config-writer.d.ts.map +1 -0
  265. package/dist/telemetry/config-writer.js +36 -0
  266. package/dist/telemetry/consent-commands.test.d.ts +2 -0
  267. package/dist/telemetry/consent-commands.test.d.ts.map +1 -0
  268. package/dist/telemetry/consent-commands.test.js +161 -0
  269. package/dist/telemetry/consent.d.ts +60 -0
  270. package/dist/telemetry/consent.d.ts.map +1 -0
  271. package/dist/telemetry/consent.js +122 -0
  272. package/dist/telemetry/environment.d.ts +33 -0
  273. package/dist/telemetry/environment.d.ts.map +1 -0
  274. package/dist/telemetry/environment.js +87 -0
  275. package/dist/telemetry/identifiers.d.ts +20 -0
  276. package/dist/telemetry/identifiers.d.ts.map +1 -0
  277. package/dist/telemetry/identifiers.js +86 -0
  278. package/dist/telemetry/index.d.ts +6 -0
  279. package/dist/telemetry/index.d.ts.map +1 -0
  280. package/dist/telemetry/index.js +4 -0
  281. package/dist/telemetry/telemetry.test.d.ts +2 -0
  282. package/dist/telemetry/telemetry.test.d.ts.map +1 -0
  283. package/dist/telemetry/telemetry.test.js +1131 -0
  284. package/dist/telemetry/trackCommand.d.ts +32 -0
  285. package/dist/telemetry/trackCommand.d.ts.map +1 -0
  286. package/dist/telemetry/trackCommand.js +102 -0
  287. package/dist/telemetry/types.d.ts +92 -0
  288. package/dist/telemetry/types.d.ts.map +1 -0
  289. package/dist/telemetry/types.js +1 -0
  290. package/dist/types.d.ts +24 -0
  291. package/dist/types.d.ts.map +1 -0
  292. package/dist/types.js +3 -0
  293. package/dist/version.d.ts +2 -0
  294. package/dist/version.d.ts.map +1 -0
  295. package/dist/version.js +2 -0
  296. package/package.json +83 -0
  297. package/src/api.test.ts +25 -0
  298. package/src/api.ts +163 -0
  299. package/src/bb-utils.ts +13 -0
  300. package/src/builtin-routes.ts +62 -0
  301. package/src/cdk/__fixtures__/factory-backend.ts +8 -0
  302. package/src/cdk/__fixtures__/fullid-construct-backend.ts +42 -0
  303. package/src/cdk/__fixtures__/handler.ts +4 -0
  304. package/src/cdk/__fixtures__/side-effect-backend.ts +7 -0
  305. package/src/cdk/blocks-backend.test.ts +207 -0
  306. package/src/cdk/blocks-backend.ts +249 -0
  307. package/src/cdk/blocks-stack.test.ts +106 -0
  308. package/src/cdk/config-registry.ts +106 -0
  309. package/src/cdk/index.ts +115 -0
  310. package/src/cdk/mixins.test.ts +129 -0
  311. package/src/cdk/mixins.ts +41 -0
  312. package/src/cdk/node-version.ts +17 -0
  313. package/src/cdk/stack-metadata.test.ts +71 -0
  314. package/src/cdk/stack-metadata.ts +29 -0
  315. package/src/cdk/synth-guard.test.ts +21 -0
  316. package/src/cdk/synth-guard.ts +23 -0
  317. package/src/client/index.test.ts +118 -0
  318. package/src/client/index.ts +320 -0
  319. package/src/common/config.test.ts +236 -0
  320. package/src/common/config.ts +169 -0
  321. package/src/common/constants.ts +15 -0
  322. package/src/common/crypto.ts +15 -0
  323. package/src/common/index.test.ts +242 -0
  324. package/src/common/index.ts +335 -0
  325. package/src/common/mock-data.ts +52 -0
  326. package/src/common/official-bb-names.generated.ts +29 -0
  327. package/src/common/sdk-registry.ts +150 -0
  328. package/src/constants.ts +31 -0
  329. package/src/cors.test.ts +279 -0
  330. package/src/cors.ts +91 -0
  331. package/src/db-naming.test.ts +48 -0
  332. package/src/db-naming.ts +41 -0
  333. package/src/errors.ts +72 -0
  334. package/src/hosting.test.ts +1431 -0
  335. package/src/hosting.ts +626 -0
  336. package/src/index.cdk.ts +45 -0
  337. package/src/index.ts +22 -0
  338. package/src/lambda-handler.test.ts +1005 -0
  339. package/src/lambda-handler.ts +706 -0
  340. package/src/pipeline/index.ts +12 -0
  341. package/src/pipeline/pipeline-construct.ts +662 -0
  342. package/src/pipeline/pipeline.test.ts +1565 -0
  343. package/src/pipeline/types.ts +384 -0
  344. package/src/raw-route.cdk.ts +56 -0
  345. package/src/raw-route.mock.ts +56 -0
  346. package/src/raw-route.test.ts +819 -0
  347. package/src/raw-route.ts +316 -0
  348. package/src/redact.test.ts +222 -0
  349. package/src/redact.ts +143 -0
  350. package/src/rpc.test.ts +73 -0
  351. package/src/rpc.ts +174 -0
  352. package/src/scripts/cdk-telemetry-env.test.ts +75 -0
  353. package/src/scripts/cdk-telemetry-env.ts +23 -0
  354. package/src/scripts/cleanup.ts +39 -0
  355. package/src/scripts/console.ts +34 -0
  356. package/src/scripts/deploy.ts +106 -0
  357. package/src/scripts/destroy.ts +42 -0
  358. package/src/scripts/dev-server-cors.test.ts +28 -0
  359. package/src/scripts/dev-server-telemetry.test.ts +127 -0
  360. package/src/scripts/dev-server.ts +515 -0
  361. package/src/scripts/ensure-secrets.test.ts +50 -0
  362. package/src/scripts/ensure-secrets.ts +113 -0
  363. package/src/scripts/external-migrations-step.test.ts +64 -0
  364. package/src/scripts/external-migrations-step.ts +269 -0
  365. package/src/scripts/extract-ts-types.test.ts +516 -0
  366. package/src/scripts/extract-ts-types.ts +773 -0
  367. package/src/scripts/generate-client-worker.ts +15 -0
  368. package/src/scripts/generate-client.test.ts +69 -0
  369. package/src/scripts/generate-client.ts +86 -0
  370. package/src/scripts/generate-spec-cli.test.ts +106 -0
  371. package/src/scripts/generate-spec-cli.ts +92 -0
  372. package/src/scripts/generate-spec.test.ts +99 -0
  373. package/src/scripts/generate-spec.ts +833 -0
  374. package/src/scripts/index.ts +21 -0
  375. package/src/scripts/sandbox.ts +230 -0
  376. package/src/scripts/telemetry-cli.ts +10 -0
  377. package/src/scripts/telemetry.test.ts +239 -0
  378. package/src/scripts/telemetry.ts +173 -0
  379. package/src/scripts/validate-spec.ts +199 -0
  380. package/src/server/index.ts +5 -0
  381. package/src/server/withAuth.test.ts +348 -0
  382. package/src/server/withAuth.ts +323 -0
  383. package/src/telemetry/client.ts +226 -0
  384. package/src/telemetry/config-writer.ts +52 -0
  385. package/src/telemetry/consent-commands.test.ts +196 -0
  386. package/src/telemetry/consent.ts +154 -0
  387. package/src/telemetry/environment.ts +100 -0
  388. package/src/telemetry/identifiers.ts +94 -0
  389. package/src/telemetry/index.ts +11 -0
  390. package/src/telemetry/telemetry.test.ts +1343 -0
  391. package/src/telemetry/trackCommand.ts +110 -0
  392. package/src/telemetry/types.ts +92 -0
  393. package/src/types.ts +33 -0
  394. package/src/version.ts +2 -0
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Invoke `bb-data migrate` for a stage. The connection string is passed via the
3
+ * BLOCKS_MIGRATE_URL env var rather than argv, so the credential is not visible
4
+ * in the process list. Arg-array exec (no shell). `--no-install` keeps npx from
5
+ * reaching the public registry for the private bin (already an app dependency).
6
+ */
7
+ /**
8
+ * Build the argv for the `bb-data migrate` subprocess. Extracted as a pure
9
+ * function so the dev-vs-deploy difference is unit-testable. When
10
+ * `regenerateTypesDir` is set (dev loop only), append `--regenerate-types=<dir>`
11
+ * so a successful apply also refreshes generated types. Sandbox/production
12
+ * deploys omit it — they apply the committed schema and must never rewrite
13
+ * source files on a CI/deploy host.
14
+ */
15
+ export declare function buildMigrateArgs(stage: string, migrationsDir: string, regenerateTypesDir?: string): string[];
16
+ export interface ApplyExternalMigrationsOptions {
17
+ stage: 'sandbox' | 'production';
18
+ /** Override the migrations directory (default ./migrations). */
19
+ migrationsDir?: string;
20
+ }
21
+ /**
22
+ * Which apply stages get the production guard. **Security-relevant:** `sandbox`
23
+ * resolves its connection from the same `.env.local` as the dev loop, so it must
24
+ * be guarded against accidentally pointing at production. `production` deploys
25
+ * intentionally target the production database and must NOT be guarded. Keep this
26
+ * as the single source of truth for the decision.
27
+ */
28
+ export declare function shouldGuardAgainstProduction(stage: 'sandbox' | 'production'): boolean;
29
+ /**
30
+ * Apply pending external-DB migrations for the given stage. Returns true if a
31
+ * migration step ran, false if it was skipped (no external DB / no migrations).
32
+ *
33
+ * For `stage: 'sandbox'` it refuses if the resolved connection (`.env.local`)
34
+ * points at a production database — the same guard as the dev loop. `stage:
35
+ * 'production'` is intentionally unguarded (deploy is meant to target prod).
36
+ */
37
+ export declare function applyExternalMigrations(opts: ApplyExternalMigrationsOptions): Promise<boolean>;
38
+ /** Extract production DB identity refs from `.env`-style content (pure/testable). */
39
+ export declare function parseProductionRefsFromEnvContent(content: string): string[];
40
+ /** True when the dev database is one of the known production databases. */
41
+ export declare function isProductionTarget(devRef: string | null, prodRefs: Set<string>): boolean;
42
+ /**
43
+ * Apply pending external-database migrations during `npm run dev`, against the
44
+ * dev database, so the schema change is live locally without a sandbox round-trip.
45
+ * (A successful apply also refreshes the generated TypeScript types from the new
46
+ * schema — `database.types.ts` + `database.meta.ts` — so code type-checks against
47
+ * it locally before deploy. To refresh by hand at any time, run `npx bb-data pull`.)
48
+ *
49
+ * Only acts for external (`fromExisting`) apps — the managed/Aurora path uses a
50
+ * local PGlite mock in dev and is unaffected. Guards against accidentally
51
+ * migrating a production database: if `.env.local` resolves to the same database
52
+ * as production (`.env.production` and/or the production SSM parameter), it
53
+ * refuses. Reachability/apply failures warn and let dev continue; only the
54
+ * production-target refusal is fatal. Set `BLOCKS_SKIP_DEV_MIGRATIONS=1` to skip.
55
+ *
56
+ * Returns true if a migration step ran, false if skipped.
57
+ */
58
+ export declare function applyDevMigrations(opts?: {
59
+ migrationsDir?: string;
60
+ generatedDir?: string;
61
+ }): Promise<boolean>;
62
+ //# sourceMappingURL=external-migrations-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-migrations-step.d.ts","sourceRoot":"","sources":["../../src/scripts/external-migrations-step.ts"],"names":[],"mappings":"AAmCA;;;;;GAKG;AACH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAI5G;AAcD,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;IAChC,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAErF;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBpG;AAoBD,qFAAqF;AACrF,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAe3E;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAExF;AAuED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA8BnH"}
@@ -0,0 +1,243 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ /**
4
+ * Apply external-database migrations during the app lifecycle:
5
+ * `npm run dev` (to the dev database), and `npm run sandbox` / `npm run deploy`
6
+ * (to the sandbox / production database, before `cdk deploy`).
7
+ *
8
+ * `core` must not depend on `bb-data` (the dependency runs the other way), so
9
+ * this invokes the `bb-data` CLI as a subprocess — the same pattern the deploy
10
+ * script already uses for client generation. The CLI's migrate path rewrites to
11
+ * the 5432 session port, takes an advisory lock, and applies pending migrations
12
+ * idempotently. The connection string is passed to the child via an environment
13
+ * variable (not argv) so it isn't exposed in the process list.
14
+ *
15
+ * Applying a migration makes the schema change live in the database. In the dev
16
+ * loop (`npm run dev`) the same `bb-data migrate` subprocess also refreshes the
17
+ * generated types (`--regenerate-types`); sandbox/production deploys apply the
18
+ * committed schema only and never rewrite source.
19
+ *
20
+ * No-op unless BOTH a connection string is resolvable from the environment
21
+ * (i.e. the app uses an external/fromExisting DB) AND a `./migrations` directory
22
+ * exists. Aurora-managed databases run migrations via their in-VPC Lambda, not
23
+ * here.
24
+ */
25
+ import { execFileSync } from 'node:child_process';
26
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
27
+ import { findConnectionString } from './ensure-secrets.js';
28
+ import { extractDbRef, dbConnectionParameterName } from '../db-naming.js';
29
+ const DEFAULT_MIGRATIONS_DIR = './migrations';
30
+ /** Default output dir for db-pull generated files (database.types.ts / database.meta.ts). */
31
+ const DEFAULT_GENERATED_DIR = './aws-blocks';
32
+ /**
33
+ * Invoke `bb-data migrate` for a stage. The connection string is passed via the
34
+ * BLOCKS_MIGRATE_URL env var rather than argv, so the credential is not visible
35
+ * in the process list. Arg-array exec (no shell). `--no-install` keeps npx from
36
+ * reaching the public registry for the private bin (already an app dependency).
37
+ */
38
+ /**
39
+ * Build the argv for the `bb-data migrate` subprocess. Extracted as a pure
40
+ * function so the dev-vs-deploy difference is unit-testable. When
41
+ * `regenerateTypesDir` is set (dev loop only), append `--regenerate-types=<dir>`
42
+ * so a successful apply also refreshes generated types. Sandbox/production
43
+ * deploys omit it — they apply the committed schema and must never rewrite
44
+ * source files on a CI/deploy host.
45
+ */
46
+ export function buildMigrateArgs(stage, migrationsDir, regenerateTypesDir) {
47
+ const args = ['--no-install', 'bb-data', 'migrate', '--stage', stage, migrationsDir];
48
+ if (regenerateTypesDir)
49
+ args.push(`--regenerate-types=${regenerateTypesDir}`);
50
+ return args;
51
+ }
52
+ function runMigrateSubprocess(connValue, stage, migrationsDir, regenerateTypesDir) {
53
+ execFileSync('npx', buildMigrateArgs(stage, migrationsDir, regenerateTypesDir), {
54
+ stdio: 'inherit',
55
+ env: { ...process.env, BLOCKS_MIGRATE_URL: connValue },
56
+ });
57
+ }
58
+ /**
59
+ * Which apply stages get the production guard. **Security-relevant:** `sandbox`
60
+ * resolves its connection from the same `.env.local` as the dev loop, so it must
61
+ * be guarded against accidentally pointing at production. `production` deploys
62
+ * intentionally target the production database and must NOT be guarded. Keep this
63
+ * as the single source of truth for the decision.
64
+ */
65
+ export function shouldGuardAgainstProduction(stage) {
66
+ return stage === 'sandbox';
67
+ }
68
+ /**
69
+ * Apply pending external-DB migrations for the given stage. Returns true if a
70
+ * migration step ran, false if it was skipped (no external DB / no migrations).
71
+ *
72
+ * For `stage: 'sandbox'` it refuses if the resolved connection (`.env.local`)
73
+ * points at a production database — the same guard as the dev loop. `stage:
74
+ * 'production'` is intentionally unguarded (deploy is meant to target prod).
75
+ */
76
+ export async function applyExternalMigrations(opts) {
77
+ const migrationsDir = opts.migrationsDir ?? DEFAULT_MIGRATIONS_DIR;
78
+ const conn = findConnectionString();
79
+ if (!conn)
80
+ return false; // not an external-DB app
81
+ if (!existsSync(migrationsDir))
82
+ return false; // nothing to apply
83
+ if (readdirSync(migrationsDir).filter(f => f.endsWith('.sql')).length === 0)
84
+ return false;
85
+ // Sandbox uses the same `.env.local` as dev, so guard it the same way: never
86
+ // apply schema changes to a production database. Production deploys are
87
+ // intentionally NOT guarded — `npm run deploy` is meant to target production.
88
+ if (shouldGuardAgainstProduction(opts.stage)) {
89
+ await assertNotProductionTarget(conn.value, { command: 'npm run sandbox', announceFailOpen: true });
90
+ }
91
+ console.log(`🧬 Applying external database migrations (${opts.stage})...`);
92
+ runMigrateSubprocess(conn.value, opts.stage, migrationsDir);
93
+ return true;
94
+ }
95
+ /** Best-effort DB host for transparency logging. */
96
+ function hostOf(connectionString) {
97
+ try {
98
+ return new URL(connectionString).host;
99
+ }
100
+ catch {
101
+ return '(unparseable connection string)';
102
+ }
103
+ }
104
+ /** Best-effort DB identity ref; null if it can't be derived. */
105
+ function safeRef(connectionString) {
106
+ try {
107
+ return extractDbRef(connectionString);
108
+ }
109
+ catch {
110
+ return null;
111
+ }
112
+ }
113
+ /** Extract production DB identity refs from `.env`-style content (pure/testable). */
114
+ export function parseProductionRefsFromEnvContent(content) {
115
+ const refs = [];
116
+ for (const line of content.split('\n')) {
117
+ const t = line.trim();
118
+ if (!t || t.startsWith('#'))
119
+ continue;
120
+ const eq = t.indexOf('=');
121
+ if (eq === -1)
122
+ continue;
123
+ const key = t.slice(0, eq).trim();
124
+ const val = t.slice(eq + 1).trim();
125
+ if (/_(DB_URL|CONNECTION_STRING)$/.test(key) && val) {
126
+ const r = safeRef(val);
127
+ if (r)
128
+ refs.push(r);
129
+ }
130
+ }
131
+ return refs;
132
+ }
133
+ /** True when the dev database is one of the known production databases. */
134
+ export function isProductionTarget(devRef, prodRefs) {
135
+ return devRef != null && prodRefs.has(devRef);
136
+ }
137
+ /**
138
+ * Collect database identities known to be **production**, to guard the dev loop
139
+ * from accidentally migrating production:
140
+ * - local `.env.production` (read directly, NOT loaded into the environment), and
141
+ * - the production SSM parameter for this ref (best-effort; skipped silently when
142
+ * offline or unauthenticated).
143
+ */
144
+ async function productionRefs(devRef) {
145
+ const refs = new Set();
146
+ if (existsSync('.env.production')) {
147
+ for (const r of parseProductionRefsFromEnvContent(readFileSync('.env.production', 'utf-8'))) {
148
+ refs.add(r);
149
+ }
150
+ }
151
+ try {
152
+ const { SSMClient, GetParameterCommand } = await import('@aws-sdk/client-ssm');
153
+ const res = await new SSMClient().send(new GetParameterCommand({ Name: dbConnectionParameterName('production'), WithDecryption: true }));
154
+ const v = res.Parameter?.Value;
155
+ const r = v ? safeRef(v) : null;
156
+ if (r)
157
+ refs.add(r);
158
+ }
159
+ catch {
160
+ /* best-effort: no creds / offline / parameter absent — skip */
161
+ }
162
+ return refs;
163
+ }
164
+ /**
165
+ * Refuse to run schema changes against a known production database. Compares the
166
+ * resolved connection's DB identity against the production refs (`.env.production`
167
+ * + the production SSM parameter). Throws with actionable guidance if they match;
168
+ * no-op when the ref can't be derived or no production ref is known. Shared by the
169
+ * dev loop and the sandbox apply (both resolve their connection from `.env.local`).
170
+ */
171
+ async function assertNotProductionTarget(connValue, opts) {
172
+ const ref = safeRef(connValue);
173
+ if (!ref)
174
+ return;
175
+ const prodRefs = await productionRefs(ref);
176
+ if (prodRefs.size === 0) {
177
+ // Best-effort guard, failing OPEN: with no `.env.production` and no resolvable
178
+ // production SSM parameter, we cannot prove the target isn't production, so proceed.
179
+ // The dev loop stays quiet — "no production set up yet" is the normal local case and
180
+ // a note on every `npm run dev` would be false-alarm noise. The consequential,
181
+ // deploy-adjacent sandbox apply announces the blind spot instead (see DESIGN.md).
182
+ if (opts.announceFailOpen) {
183
+ console.log(`ℹ️ Could not verify the target database isn't production (.env.production absent ` +
184
+ `and the production SSM parameter was unavailable) — proceeding with \`${opts.command}\`.`);
185
+ }
186
+ return;
187
+ }
188
+ if (!isProductionTarget(ref, prodRefs))
189
+ return;
190
+ const optOut = opts.optOutHint ? `, or ${opts.optOutHint}` : '';
191
+ throw new Error(`Refusing to apply migrations: .env.local points at your PRODUCTION database (${hostOf(connValue)}).\n` +
192
+ `\`${opts.command}\` must not run schema changes against production. Point .env.local at a ` +
193
+ `dev/branch database${optOut}.`);
194
+ }
195
+ /**
196
+ * Apply pending external-database migrations during `npm run dev`, against the
197
+ * dev database, so the schema change is live locally without a sandbox round-trip.
198
+ * (A successful apply also refreshes the generated TypeScript types from the new
199
+ * schema — `database.types.ts` + `database.meta.ts` — so code type-checks against
200
+ * it locally before deploy. To refresh by hand at any time, run `npx bb-data pull`.)
201
+ *
202
+ * Only acts for external (`fromExisting`) apps — the managed/Aurora path uses a
203
+ * local PGlite mock in dev and is unaffected. Guards against accidentally
204
+ * migrating a production database: if `.env.local` resolves to the same database
205
+ * as production (`.env.production` and/or the production SSM parameter), it
206
+ * refuses. Reachability/apply failures warn and let dev continue; only the
207
+ * production-target refusal is fatal. Set `BLOCKS_SKIP_DEV_MIGRATIONS=1` to skip.
208
+ *
209
+ * Returns true if a migration step ran, false if skipped.
210
+ */
211
+ export async function applyDevMigrations(opts) {
212
+ if (process.env.BLOCKS_SKIP_DEV_MIGRATIONS)
213
+ return false;
214
+ const migrationsDir = opts?.migrationsDir ?? DEFAULT_MIGRATIONS_DIR;
215
+ const generatedDir = opts?.generatedDir ?? DEFAULT_GENERATED_DIR;
216
+ const conn = findConnectionString();
217
+ if (!conn)
218
+ return false; // not an external-DB app (e.g. managed Aurora → local PGlite mock)
219
+ if (!existsSync(migrationsDir))
220
+ return false;
221
+ if (readdirSync(migrationsDir).filter(f => f.endsWith('.sql')).length === 0)
222
+ return false;
223
+ // Guardrail: never auto-apply to a production database from the dev loop.
224
+ await assertNotProductionTarget(conn.value, {
225
+ command: 'npm run dev',
226
+ optOutHint: 'set BLOCKS_SKIP_DEV_MIGRATIONS=1 to opt out',
227
+ });
228
+ console.log(`🧬 Applying migrations to your dev database (${hostOf(conn.value)})...`);
229
+ try {
230
+ // Dev loop: apply, then refresh generated types from the migrated schema in
231
+ // the SAME subprocess (one developer-visible step). Deploy/sandbox omit the
232
+ // regenerate-types arg — they apply the committed schema, never rewrite source.
233
+ runMigrateSubprocess(conn.value, 'dev', migrationsDir, generatedDir);
234
+ return true;
235
+ }
236
+ catch (e) {
237
+ // Don't block local dev on a migration apply failure (e.g. port 5432 blocked
238
+ // on a corp network). Warn and continue — the app may still run.
239
+ console.warn(`⚠️ Could not apply migrations in dev: ${e?.message ?? e}`);
240
+ console.warn(` Continuing without applying. Run migrations before deploy.`);
241
+ return false;
242
+ }
243
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=external-migrations-step.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-migrations-step.test.d.ts","sourceRoot":"","sources":["../../src/scripts/external-migrations-step.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { test } from 'node:test';
4
+ import assert from 'node:assert';
5
+ import { parseProductionRefsFromEnvContent, isProductionTarget, buildMigrateArgs, shouldGuardAgainstProduction, } from './external-migrations-step.js';
6
+ const SUPA = (ref) => `postgresql://postgres.${ref}:pw@aws-0-us-east-1.pooler.supabase.com:6543/postgres`;
7
+ test('parseProductionRefsFromEnvContent extracts DB identity from connection-string vars', () => {
8
+ const content = [
9
+ '# production config',
10
+ `SUPABASE_DB_URL=${SUPA('prodref1')}`,
11
+ 'OTHER=not-a-db',
12
+ `MY_CONNECTION_STRING=${SUPA('prodref2')}`,
13
+ ].join('\n');
14
+ assert.deepStrictEqual(parseProductionRefsFromEnvContent(content).sort(), ['prodref1', 'prodref2']);
15
+ });
16
+ test('parseProductionRefsFromEnvContent ignores comments, blanks, and non-DB keys', () => {
17
+ assert.deepStrictEqual(parseProductionRefsFromEnvContent('\n# c\nFOO=bar\n'), []);
18
+ });
19
+ test('isProductionTarget refuses when the dev ref matches a production ref', () => {
20
+ const prod = new Set(['prodref1', 'prodref2']);
21
+ assert.strictEqual(isProductionTarget('prodref1', prod), true);
22
+ });
23
+ test('isProductionTarget allows a distinct dev database', () => {
24
+ const prod = new Set(['prodref1']);
25
+ assert.strictEqual(isProductionTarget('devref', prod), false);
26
+ });
27
+ test('isProductionTarget is safe when the dev ref is unknown (null)', () => {
28
+ assert.strictEqual(isProductionTarget(null, new Set(['prodref1'])), false);
29
+ });
30
+ test('buildMigrateArgs (deploy/sandbox) is schema-only — no --regenerate-types', () => {
31
+ const args = buildMigrateArgs('production', './migrations');
32
+ assert.deepStrictEqual(args, ['--no-install', 'bb-data', 'migrate', '--stage', 'production', './migrations']);
33
+ assert.ok(!args.some(a => a.startsWith('--regenerate-types')), 'deploy must never rewrite source');
34
+ });
35
+ test('buildMigrateArgs (dev) appends --regenerate-types=<dir> so apply also refreshes types', () => {
36
+ const args = buildMigrateArgs('sandbox', './migrations', './aws-blocks');
37
+ assert.deepStrictEqual(args, [
38
+ '--no-install', 'bb-data', 'migrate', '--stage', 'sandbox', './migrations',
39
+ '--regenerate-types=./aws-blocks',
40
+ ]);
41
+ });
42
+ test('shouldGuardAgainstProduction: sandbox is guarded (shares .env.local with dev)', () => {
43
+ assert.strictEqual(shouldGuardAgainstProduction('sandbox'), true);
44
+ });
45
+ test('shouldGuardAgainstProduction: production deploy is intentionally NOT guarded', () => {
46
+ assert.strictEqual(shouldGuardAgainstProduction('production'), false);
47
+ });
@@ -0,0 +1,65 @@
1
+ export interface TransferableInfo {
2
+ /** The __blocks literal value, e.g. "realtime/channel" */
3
+ blocksTag: string;
4
+ /** JSON Schemas of the generic type arguments (e.g., [T] in RealtimeChannel<T>), empty array if non-generic */
5
+ typeArgs: JsonSchema[];
6
+ }
7
+ export interface MethodTypeInfo {
8
+ params: ParamTypeInfo[];
9
+ returnType: JsonSchema;
10
+ /** Present when the return type is a transferable type */
11
+ transferable?: TransferableInfo;
12
+ /**
13
+ * True when the method's JSDoc carries a `@blocksSkipCodegen` tag. Methods so
14
+ * marked are still callable through the TS client (the runtime Proxy in
15
+ * `generate-client.ts` doesn't enumerate methods), but the OpenRPC spec
16
+ * emitter drops them, so native generators (Swift / Kotlin) never see
17
+ * them. Use for mock-only / dev-only helpers like `api.getLastCode()`.
18
+ */
19
+ skipCodegen?: boolean;
20
+ }
21
+ /**
22
+ * Public so `generate-spec.ts` and any future emitter can share the same
23
+ * vocabulary. Spelt as a single token to avoid hyphenation surprises in
24
+ * JSDoc parsers.
25
+ */
26
+ export declare const BLOCKS_SKIP_CODEGEN_TAG = "blocksSkipCodegen";
27
+ /**
28
+ * Pure-AST scan for method names tagged with `@blocksSkipCodegen` inside the
29
+ * `ApiNamespace(...)` calls of a TS source file. Returns a Set of method
30
+ * names (the OpenRPC emitter qualifies them by namespace later).
31
+ *
32
+ * Distinct from {@link extractMethodTypes} because that function builds a
33
+ * full `ts.Program` + type checker, and any failure inside type
34
+ * resolution (an imported module that doesn't typecheck, a third-party
35
+ * `.d.ts` mismatch) silently empties the returned Map. The skip set must
36
+ * survive those crashes, so this function uses only the parser.
37
+ */
38
+ export declare function extractSkipCodegenMethods(sourcePath: string): Set<string>;
39
+ export interface ParamTypeInfo {
40
+ name: string;
41
+ required: boolean;
42
+ schema: JsonSchema;
43
+ }
44
+ export interface JsonSchema {
45
+ type?: string;
46
+ properties?: Record<string, JsonSchema>;
47
+ items?: JsonSchema | JsonSchema[];
48
+ required?: string[];
49
+ $ref?: string;
50
+ nullable?: boolean;
51
+ enum?: (string | number | boolean | null)[];
52
+ oneOf?: JsonSchema[];
53
+ additionalProperties?: JsonSchema | boolean;
54
+ title?: string;
55
+ [key: string]: unknown;
56
+ }
57
+ /**
58
+ * Parse a TypeScript source file with full type checking and extract type
59
+ * info for all methods inside `ApiNamespace(...)` calls.
60
+ *
61
+ * Uses `ts.createProgram` to resolve imports and infer return types.
62
+ * Falls back to AST-only parsing if program creation fails.
63
+ */
64
+ export declare function extractMethodTypes(sourcePath: string): Map<string, MethodTypeInfo>;
65
+ //# sourceMappingURL=extract-ts-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-ts-types.d.ts","sourceRoot":"","sources":["../../src/scripts/extract-ts-types.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,gBAAgB;IAChC,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,+GAA+G;IAC/G,QAAQ,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAS3D;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CA4DzE;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAqElF"}