@wildo-ai/platform-config-lib 1.0.1 → 1.1.1

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 (414) hide show
  1. package/LICENSE +34 -0
  2. package/dist/esm/.builder.pid +9 -0
  3. package/dist/esm/_unimplemented/index.d.ts +3 -0
  4. package/dist/esm/_unimplemented/index.d.ts.map +1 -0
  5. package/dist/esm/_unimplemented/index.js +3 -0
  6. package/dist/esm/_unimplemented/index.js.map +1 -0
  7. package/dist/esm/_unimplemented/soft-warn.d.ts +124 -0
  8. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -0
  9. package/dist/esm/_unimplemented/soft-warn.js +170 -0
  10. package/dist/esm/_unimplemented/soft-warn.js.map +1 -0
  11. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +137 -0
  12. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -0
  13. package/dist/esm/_unimplemented/unimplemented-field-warning.js +153 -0
  14. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -0
  15. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/application-backend-env.contracts.js +1 -1
  17. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts +13 -0
  19. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -0
  20. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js +14 -0
  21. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -0
  22. package/dist/esm/bootstrap/bootstrap-planner.d.ts +1 -1
  23. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/bootstrap-planner.js +1 -1
  25. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  26. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +141 -37
  27. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/bootstrap.contracts.js +104 -18
  29. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  30. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +430 -421
  31. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/bootstrap.schemas.js +383 -21
  33. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  34. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +213 -8
  35. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +230 -5
  37. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +79 -0
  39. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -0
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js +83 -0
  41. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -0
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts +63 -0
  43. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -0
  44. package/dist/esm/bootstrap/runtime-network-policy.js +104 -0
  45. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -0
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts +78 -0
  47. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -0
  48. package/dist/esm/bootstrap/runtime-network-topology.js +134 -0
  49. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -0
  50. package/dist/esm/bootstrap/runtime-platform-access.d.ts +67 -0
  51. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -0
  52. package/dist/esm/bootstrap/runtime-platform-access.js +57 -0
  53. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -0
  54. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +173 -0
  55. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-principal.contracts.js +218 -0
  57. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +112 -1
  59. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/runtime-topology.contracts.js +141 -8
  61. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  62. package/dist/esm/config-authoring.entry.d.ts +3 -0
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -0
  64. package/dist/esm/config-authoring.entry.js +5 -0
  65. package/dist/esm/config-authoring.entry.js.map +1 -0
  66. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  67. package/dist/esm/credentials/credential-generator.service.js +1 -1
  68. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  69. package/dist/esm/index.d.ts +30 -15
  70. package/dist/esm/index.d.ts.map +1 -1
  71. package/dist/esm/index.js +16 -1
  72. package/dist/esm/index.js.map +1 -1
  73. package/dist/esm/lockfile/canonical-json.d.ts +41 -0
  74. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -0
  75. package/dist/esm/lockfile/canonical-json.js +56 -0
  76. package/dist/esm/lockfile/canonical-json.js.map +1 -0
  77. package/dist/esm/lockfile/lockfile-io.d.ts +231 -0
  78. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -0
  79. package/dist/esm/lockfile/lockfile-io.js +303 -0
  80. package/dist/esm/lockfile/lockfile-io.js.map +1 -0
  81. package/dist/esm/lockfile/materialize-infra-section.d.ts +99 -0
  82. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -0
  83. package/dist/esm/lockfile/materialize-infra-section.js +153 -0
  84. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -0
  85. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +522 -0
  86. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -0
  87. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +116 -0
  88. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -0
  89. package/dist/esm/project-config/define-framework-config.d.ts +36 -10
  90. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  91. package/dist/esm/project-config/define-framework-config.js +67 -3
  92. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  93. package/dist/esm/project-config/define-infra-env-config.d.ts +570 -0
  94. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -0
  95. package/dist/esm/project-config/define-infra-env-config.js +726 -0
  96. package/dist/esm/project-config/define-infra-env-config.js.map +1 -0
  97. package/dist/esm/project-config/define-minion-config.d.ts +221 -23
  98. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  99. package/dist/esm/project-config/define-minion-config.js +228 -11
  100. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  101. package/dist/esm/project-config/define-saas-config.d.ts +427 -218
  102. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  103. package/dist/esm/project-config/define-saas-config.js +704 -75
  104. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  105. package/dist/esm/project-config/define-worker-config.d.ts +106 -10
  106. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  107. package/dist/esm/project-config/define-worker-config.js +99 -9
  108. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  109. package/dist/esm/project-config/index.d.ts +28 -21
  110. package/dist/esm/project-config/index.d.ts.map +1 -1
  111. package/dist/esm/project-config/index.js +14 -7
  112. package/dist/esm/project-config/index.js.map +1 -1
  113. package/dist/esm/project-config/loader.d.ts +120 -10
  114. package/dist/esm/project-config/loader.d.ts.map +1 -1
  115. package/dist/esm/project-config/loader.js +290 -38
  116. package/dist/esm/project-config/loader.js.map +1 -1
  117. package/dist/esm/project-config/minion-local-provider-registration.d.ts +69 -0
  118. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -0
  119. package/dist/esm/project-config/minion-local-provider-registration.js +72 -0
  120. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -0
  121. package/dist/esm/project-config/provider-catalog-types.d.ts +12 -0
  122. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -0
  123. package/dist/esm/project-config/provider-catalog-types.js +49 -0
  124. package/dist/esm/project-config/provider-catalog-types.js.map +1 -0
  125. package/dist/esm/project-config/provider-companion-discovery.d.ts +24 -0
  126. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -0
  127. package/dist/esm/project-config/provider-companion-discovery.js +244 -0
  128. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -0
  129. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +297 -0
  130. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -0
  131. package/dist/esm/project-config/provider-runtime-artifacts.js +860 -0
  132. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -0
  133. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +18 -0
  134. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -0
  135. package/dist/esm/project-config/shared/application-creation-verification.schemas.js +25 -0
  136. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -0
  137. package/dist/esm/project-config/shared/application-modules.schemas.d.ts +10 -2
  138. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  139. package/dist/esm/project-config/shared/application-modules.schemas.js +12 -1
  140. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/application-modules.utils.d.ts +2 -1
  142. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/application-modules.utils.js +6 -1
  144. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  145. package/dist/esm/project-config/shared/auth.schemas.d.ts +102 -0
  146. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -0
  147. package/dist/esm/project-config/shared/auth.schemas.js +100 -0
  148. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -0
  149. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +316 -39
  150. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  151. package/dist/esm/project-config/shared/backing-services.schemas.js +359 -24
  152. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  153. package/dist/esm/project-config/shared/cdn.example.d.ts +14 -0
  154. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -0
  155. package/dist/esm/project-config/shared/cdn.example.js +38 -0
  156. package/dist/esm/project-config/shared/cdn.example.js.map +1 -0
  157. package/dist/esm/project-config/shared/cdn.schemas.d.ts +182 -0
  158. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -0
  159. package/dist/esm/project-config/shared/cdn.schemas.js +151 -0
  160. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -0
  161. package/dist/esm/project-config/shared/csp-defaults.d.ts +92 -0
  162. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -0
  163. package/dist/esm/project-config/shared/csp-defaults.js +195 -0
  164. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -0
  165. package/dist/esm/project-config/shared/csp-emit.d.ts +106 -0
  166. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -0
  167. package/dist/esm/project-config/shared/csp-emit.js +305 -0
  168. package/dist/esm/project-config/shared/csp-emit.js.map +1 -0
  169. package/dist/esm/project-config/shared/csp.schemas.d.ts +266 -0
  170. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -0
  171. package/dist/esm/project-config/shared/csp.schemas.js +281 -0
  172. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -0
  173. package/dist/esm/project-config/shared/data-services.schemas.d.ts +45 -9
  174. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  175. package/dist/esm/project-config/shared/data-services.schemas.js +45 -9
  176. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  177. package/dist/esm/project-config/shared/env-example-defaults.d.ts +0 -1
  178. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  179. package/dist/esm/project-config/shared/env-example-defaults.js +1 -2
  180. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  181. package/dist/esm/project-config/shared/environment.schemas.d.ts +134 -8
  182. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  183. package/dist/esm/project-config/shared/environment.schemas.js +185 -2
  184. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  185. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +779 -0
  186. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -0
  187. package/dist/esm/project-config/shared/infra-providers.schemas.js +210 -0
  188. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -0
  189. package/dist/esm/project-config/shared/infra-service.schemas.d.ts +18 -0
  190. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -0
  191. package/dist/esm/project-config/shared/infra-service.schemas.js +16 -0
  192. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -0
  193. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +83 -1
  194. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  195. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +99 -2
  196. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  197. package/dist/esm/project-config/shared/k8s-utils.d.ts +51 -7
  198. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  199. package/dist/esm/project-config/shared/k8s-utils.js +59 -12
  200. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  201. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +31 -0
  202. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -0
  203. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +32 -0
  204. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -0
  205. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +142 -0
  206. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -0
  207. package/dist/esm/project-config/shared/minion-resource-access.validation.js +159 -0
  208. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -0
  209. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts +100 -0
  210. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -0
  211. package/dist/esm/project-config/shared/object-storage-session-policy.js +130 -0
  212. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -0
  213. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +9 -14
  214. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  215. package/dist/esm/project-config/shared/platform-services.schemas.js +13 -9
  216. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  217. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +15 -0
  218. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -0
  219. package/dist/esm/project-config/shared/schema-version.schemas.js +40 -0
  220. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -0
  221. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +283 -8
  222. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  223. package/dist/esm/project-config/shared/service-definitions.schemas.js +325 -8
  224. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  225. package/dist/esm/registry/artifact-domain.schemas.d.ts +54 -0
  226. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -0
  227. package/dist/esm/registry/artifact-domain.schemas.js +40 -0
  228. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -0
  229. package/dist/esm/registry/companion-api.schemas.d.ts +176 -0
  230. package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -0
  231. package/dist/esm/registry/companion-api.schemas.js +165 -0
  232. package/dist/esm/registry/companion-api.schemas.js.map +1 -0
  233. package/dist/esm/registry/digest.schemas.d.ts +20 -0
  234. package/dist/esm/registry/digest.schemas.d.ts.map +1 -0
  235. package/dist/esm/registry/digest.schemas.js +21 -0
  236. package/dist/esm/registry/digest.schemas.js.map +1 -0
  237. package/dist/esm/registry/index.d.ts +33 -0
  238. package/dist/esm/registry/index.d.ts.map +1 -0
  239. package/dist/esm/registry/index.js +33 -0
  240. package/dist/esm/registry/index.js.map +1 -0
  241. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +107 -0
  242. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -0
  243. package/dist/esm/registry/lockfile-modules-section.schemas.js +67 -0
  244. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -0
  245. package/dist/esm/registry/module-artifact.schemas.d.ts +94 -0
  246. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -0
  247. package/dist/esm/registry/module-artifact.schemas.js +69 -0
  248. package/dist/esm/registry/module-artifact.schemas.js.map +1 -0
  249. package/dist/esm/registry/module-manifest.schemas.d.ts +134 -0
  250. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -0
  251. package/dist/esm/registry/module-manifest.schemas.js +155 -0
  252. package/dist/esm/registry/module-manifest.schemas.js.map +1 -0
  253. package/dist/esm/registry/registry-config.schemas.d.ts +31 -0
  254. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -0
  255. package/dist/esm/registry/registry-config.schemas.js +24 -0
  256. package/dist/esm/registry/registry-config.schemas.js.map +1 -0
  257. package/dist/esm/registry/registry-defaults.constants.d.ts +37 -0
  258. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -0
  259. package/dist/esm/registry/registry-defaults.constants.js +37 -0
  260. package/dist/esm/registry/registry-defaults.constants.js.map +1 -0
  261. package/dist/esm/registry/registry-errors.d.ts +109 -0
  262. package/dist/esm/registry/registry-errors.d.ts.map +1 -0
  263. package/dist/esm/registry/registry-errors.js +185 -0
  264. package/dist/esm/registry/registry-errors.js.map +1 -0
  265. package/dist/esm/registry/registry-section-schemas.constants.d.ts +39 -0
  266. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -0
  267. package/dist/esm/registry/registry-section-schemas.constants.js +22 -0
  268. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -0
  269. package/dist/esm/release/framework-release.constants.d.ts +26 -1
  270. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  271. package/dist/esm/release/framework-release.constants.js +27 -2
  272. package/dist/esm/release/framework-release.constants.js.map +1 -1
  273. package/dist/esm/schemas/framework-info.schemas.d.ts +1 -1
  274. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  275. package/dist/esm/schemas/framework-info.schemas.js +1 -1
  276. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  277. package/dist/esm/schemas/framework-secrets.schemas.d.ts +5 -5
  278. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  279. package/dist/esm/schemas/framework-secrets.schemas.js +1 -1
  280. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  281. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  282. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  283. package/dist/esm/schemas/platform-application-config.schemas.js +11 -2
  284. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  285. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +7 -7
  286. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  287. package/dist/esm/schemas/platform-application-secrets.schemas.js +17 -2
  288. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  289. package/dist/esm/schemas/platform-config.schemas.d.ts +12 -13
  290. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  291. package/dist/esm/schemas/platform-config.schemas.js +15 -3
  292. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  293. package/dist/esm/workspace-scope/application-subject-manifest.d.ts +26 -0
  294. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -0
  295. package/dist/esm/workspace-scope/application-subject-manifest.js +43 -0
  296. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -0
  297. package/dist/esm/workspace-scope/index.d.ts +5 -2
  298. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  299. package/dist/esm/workspace-scope/index.js +4 -1
  300. package/dist/esm/workspace-scope/index.js.map +1 -1
  301. package/dist/esm/workspace-scope/resolve-homes.d.ts +20 -0
  302. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -0
  303. package/dist/esm/workspace-scope/resolve-homes.js +62 -0
  304. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -0
  305. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +211 -0
  306. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -0
  307. package/dist/esm/workspace-scope/workspace-homes.schemas.js +113 -0
  308. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -0
  309. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts +10 -5
  310. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  311. package/dist/esm/workspace-scope/workspace-scope-detector.js +22 -36
  312. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  313. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +147 -58
  314. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  315. package/dist/esm/workspace-scope/workspace-scope.schemas.js +174 -78
  316. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  317. package/dist/tsconfig.build.tsbuildinfo +1 -1
  318. package/package.json +31 -17
  319. package/dist/esm/credentials/credentials-provisioner.service.d.ts +0 -190
  320. package/dist/esm/credentials/credentials-provisioner.service.d.ts.map +0 -1
  321. package/dist/esm/credentials/credentials-provisioner.service.js +0 -278
  322. package/dist/esm/credentials/credentials-provisioner.service.js.map +0 -1
  323. package/dist/esm/infra-managers/infra-manager.models.d.ts +0 -146
  324. package/dist/esm/infra-managers/infra-manager.models.d.ts.map +0 -1
  325. package/dist/esm/infra-managers/infra-manager.models.js +0 -2
  326. package/dist/esm/infra-managers/infra-manager.models.js.map +0 -1
  327. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts +0 -64
  328. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts.map +0 -1
  329. package/dist/esm/infra-managers/mongo-atlas-manager.service.js +0 -307
  330. package/dist/esm/infra-managers/mongo-atlas-manager.service.js.map +0 -1
  331. package/dist/esm/infra-managers/postgresql-manager.service.d.ts +0 -115
  332. package/dist/esm/infra-managers/postgresql-manager.service.d.ts.map +0 -1
  333. package/dist/esm/infra-managers/postgresql-manager.service.js +0 -403
  334. package/dist/esm/infra-managers/postgresql-manager.service.js.map +0 -1
  335. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts +0 -64
  336. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts.map +0 -1
  337. package/dist/esm/infra-managers/rabbitmq-manager.service.js +0 -288
  338. package/dist/esm/infra-managers/rabbitmq-manager.service.js.map +0 -1
  339. package/dist/esm/infra-managers/redis-manager.service.d.ts +0 -78
  340. package/dist/esm/infra-managers/redis-manager.service.d.ts.map +0 -1
  341. package/dist/esm/infra-managers/redis-manager.service.js +0 -326
  342. package/dist/esm/infra-managers/redis-manager.service.js.map +0 -1
  343. package/dist/esm/project-config/define-infra-config.d.ts +0 -128
  344. package/dist/esm/project-config/define-infra-config.d.ts.map +0 -1
  345. package/dist/esm/project-config/define-infra-config.js +0 -87
  346. package/dist/esm/project-config/define-infra-config.js.map +0 -1
  347. package/dist/esm/project-config/define-platform-config.d.ts +0 -65
  348. package/dist/esm/project-config/define-platform-config.d.ts.map +0 -1
  349. package/dist/esm/project-config/define-platform-config.js +0 -22
  350. package/dist/esm/project-config/define-platform-config.js.map +0 -1
  351. package/dist/esm/project-config/define-platform-env-config.d.ts +0 -41
  352. package/dist/esm/project-config/define-platform-env-config.d.ts.map +0 -1
  353. package/dist/esm/project-config/define-platform-env-config.js +0 -45
  354. package/dist/esm/project-config/define-platform-env-config.js.map +0 -1
  355. package/dist/esm/project-config/define-project-config.d.ts +0 -38
  356. package/dist/esm/project-config/define-project-config.d.ts.map +0 -1
  357. package/dist/esm/project-config/define-project-config.js +0 -57
  358. package/dist/esm/project-config/define-project-config.js.map +0 -1
  359. package/dist/esm/project-config/define-sharing-policy.d.ts +0 -35
  360. package/dist/esm/project-config/define-sharing-policy.d.ts.map +0 -1
  361. package/dist/esm/project-config/define-sharing-policy.js +0 -30
  362. package/dist/esm/project-config/define-sharing-policy.js.map +0 -1
  363. package/dist/esm/project-config/sharing-policy-validation.d.ts +0 -40
  364. package/dist/esm/project-config/sharing-policy-validation.d.ts.map +0 -1
  365. package/dist/esm/project-config/sharing-policy-validation.js +0 -143
  366. package/dist/esm/project-config/sharing-policy-validation.js.map +0 -1
  367. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts +0 -23
  368. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts.map +0 -1
  369. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js +0 -13
  370. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js.map +0 -1
  371. package/src/bootstrap/application-backend-env.contracts.ts +0 -17
  372. package/src/bootstrap/bootstrap-planner.ts +0 -46
  373. package/src/bootstrap/bootstrap.contracts.ts +0 -251
  374. package/src/bootstrap/bootstrap.schemas.ts +0 -164
  375. package/src/bootstrap/platform-runtime-env.contracts.ts +0 -99
  376. package/src/bootstrap/runtime-topology.contracts.ts +0 -102
  377. package/src/credentials/credential-generator.service.ts +0 -39
  378. package/src/index.ts +0 -16
  379. package/src/project-config/__tests__/application-modules.utils.test.ts +0 -53
  380. package/src/project-config/__tests__/define-framework-config.test.ts +0 -43
  381. package/src/project-config/__tests__/define-saas-config.test.ts +0 -210
  382. package/src/project-config/__tests__/loader.test.ts +0 -100
  383. package/src/project-config/define-framework-config.ts +0 -44
  384. package/src/project-config/define-infra-config.ts +0 -168
  385. package/src/project-config/define-minion-config.ts +0 -27
  386. package/src/project-config/define-platform-config.ts +0 -28
  387. package/src/project-config/define-platform-env-config.ts +0 -59
  388. package/src/project-config/define-project-config.ts +0 -63
  389. package/src/project-config/define-saas-config.ts +0 -171
  390. package/src/project-config/define-sharing-policy.ts +0 -36
  391. package/src/project-config/define-worker-config.ts +0 -27
  392. package/src/project-config/index.ts +0 -23
  393. package/src/project-config/loader.ts +0 -220
  394. package/src/project-config/shared/application-modules.schemas.ts +0 -12
  395. package/src/project-config/shared/application-modules.utils.ts +0 -65
  396. package/src/project-config/shared/backing-services.schemas.ts +0 -59
  397. package/src/project-config/shared/data-services.schemas.ts +0 -58
  398. package/src/project-config/shared/env-example-defaults.ts +0 -50
  399. package/src/project-config/shared/environment.schemas.ts +0 -136
  400. package/src/project-config/shared/infrastructure-defaults.schemas.ts +0 -47
  401. package/src/project-config/shared/k8s-utils.ts +0 -56
  402. package/src/project-config/shared/platform-services.schemas.ts +0 -33
  403. package/src/project-config/shared/service-definitions.schemas.ts +0 -38
  404. package/src/project-config/sharing-policy-validation.ts +0 -159
  405. package/src/release/framework-release.constants.ts +0 -2
  406. package/src/schemas/__tests__/platform-config.schemas.test.ts +0 -90
  407. package/src/schemas/framework-info.schemas.ts +0 -13
  408. package/src/schemas/framework-secrets.schemas.ts +0 -19
  409. package/src/schemas/platform-application-config.schemas.ts +0 -25
  410. package/src/schemas/platform-application-secrets.schemas.ts +0 -78
  411. package/src/schemas/platform-config.schemas.ts +0 -45
  412. package/src/workspace-scope/index.ts +0 -2
  413. package/src/workspace-scope/workspace-scope-detector.ts +0 -98
  414. package/src/workspace-scope/workspace-scope.schemas.ts +0 -224
@@ -0,0 +1,182 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * @wildo_source:part:start platform.config.cdn facet:layer:platform facet:family:infra
4
+ *
5
+ * Per-service CDN publish configuration, authored per-environment under
6
+ * `wildo.infra.<env>.config.ts > cdn?[serviceKey]` (import the schemas + the
7
+ * `CdnVendor` enum from `@wildo-ai/platform-config-lib`). Opting a frontend
8
+ * into CDN serving (REMOTE envs only — the schema rejects `cdn` in local)
9
+ * makes the deploy render skip its nginx Deployment/Service + ingress route
10
+ * (served off-cluster by the CDN) while keeping its `runtime.endPoints.publicUrl`
11
+ * unchanged; `wildo frontend publish` then uploads the built `dist/` to the S3
12
+ * bucket + re-homes CSP to the edge.
13
+ */
14
+ /**
15
+ * CDN vendor brands the framework can drive a live edge-publish against.
16
+ *
17
+ * Imported from `@wildo-ai/platform-config-lib`. Authored per-service-key
18
+ * under `wildo.infra.<env>.config.ts > cdn?[serviceKey].vendor.kind`.
19
+ *
20
+ * The catalog is intentionally small and grows one brand at a time (mirrors
21
+ * the `InfraProvider` brand convention). Each brand that supports LIVE
22
+ * provisioning gets its own arm in {@link CdnVendorConfigSchema} carrying its
23
+ * addressing (`zoneId`, …). `GENERIC` is the provider-agnostic escape hatch:
24
+ * the publish path still uploads the `dist/` + writes a portable `_headers`
25
+ * CSP file, but performs NO live vendor API call — the operator points their
26
+ * own CDN (any `_headers`-consuming host: Cloudflare Pages, Netlify, Vercel,
27
+ * or a bucket fronted by a proxy) at the published bucket.
28
+ */
29
+ export declare enum CdnVendor {
30
+ /**
31
+ * No live vendor call. `wildo frontend publish` uploads the built `dist/`
32
+ * to the configured S3 bucket and writes a portable `_headers` CSP file
33
+ * alongside it; the operator wires their own CDN to the bucket. This is the
34
+ * lowest-fabrication path and the correct choice when the CDN is fronted by
35
+ * a host that reads `_headers`, or when the edge policy is managed out-of-band.
36
+ */
37
+ GENERIC = "generic",
38
+ /**
39
+ * Cloudflare. `wildo frontend publish` additionally ensures a
40
+ * `http_response_headers_transform` ruleset on the authored zone that SETs
41
+ * the resolved CSP response header at the edge (the header nginx would emit
42
+ * on a pod-served frontend). The live call fires only when the API token
43
+ * (resolved from {@link CloudflareCdnVendorConfigSchema.apiTokenEnvVar}) is
44
+ * present at publish time; otherwise the publish emits artifacts and skips
45
+ * the live call with a warning.
46
+ */
47
+ CLOUDFLARE = "cloudflare"
48
+ }
49
+ /**
50
+ * `GENERIC` vendor — no live provisioning, no addressing. Presence of this
51
+ * arm still opts the service into the CDN publish path (upload + `_headers`).
52
+ */
53
+ export declare const GenericCdnVendorConfigSchema: z.ZodObject<{
54
+ kind: z.ZodLiteral<CdnVendor.GENERIC>;
55
+ }, z.core.$strict>;
56
+ export type GenericCdnVendorConfig = z.infer<typeof GenericCdnVendorConfigSchema>;
57
+ /**
58
+ * `CLOUDFLARE` vendor — live edge CSP provisioning against a Cloudflare zone.
59
+ *
60
+ * Only the token's ENV-VAR NAME is authored here, never the token value:
61
+ * secrets never live in a checked-in `wildo.infra.<env>.config.ts`. The
62
+ * publish path reads `process.env[apiTokenEnvVar]` at runtime; a missing var
63
+ * degrades to artifacts-only (no throw).
64
+ */
65
+ export declare const CloudflareCdnVendorConfigSchema: z.ZodObject<{
66
+ kind: z.ZodLiteral<CdnVendor.CLOUDFLARE>;
67
+ /**
68
+ * Cloudflare zone id that fronts this frontend's public host. The publish
69
+ * path PUTs the response-header-transform ruleset entrypoint on this zone.
70
+ */
71
+ zoneId: z.ZodString;
72
+ /**
73
+ * NAME of the environment variable holding the Cloudflare API token (a
74
+ * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.
75
+ * Default `CLOUDFLARE_API_TOKEN`.
76
+ */
77
+ apiTokenEnvVar: z.ZodDefault<z.ZodString>;
78
+ }, z.core.$strict>;
79
+ export type CloudflareCdnVendorConfig = z.infer<typeof CloudflareCdnVendorConfigSchema>;
80
+ /**
81
+ * Discriminated union over {@link CdnVendor}. Adding a brand = adding an arm
82
+ * here (+ a live adapter in the publish path). The discriminant `kind` gives
83
+ * exhaustive narrowing at every consumer.
84
+ */
85
+ export declare const CdnVendorConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
+ kind: z.ZodLiteral<CdnVendor.GENERIC>;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ kind: z.ZodLiteral<CdnVendor.CLOUDFLARE>;
89
+ /**
90
+ * Cloudflare zone id that fronts this frontend's public host. The publish
91
+ * path PUTs the response-header-transform ruleset entrypoint on this zone.
92
+ */
93
+ zoneId: z.ZodString;
94
+ /**
95
+ * NAME of the environment variable holding the Cloudflare API token (a
96
+ * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.
97
+ * Default `CLOUDFLARE_API_TOKEN`.
98
+ */
99
+ apiTokenEnvVar: z.ZodDefault<z.ZodString>;
100
+ }, z.core.$strict>], "kind">;
101
+ export type CdnVendorConfig = z.infer<typeof CdnVendorConfigSchema>;
102
+ /**
103
+ * Per-service CDN publish config — authored under
104
+ * `wildo.infra.<env>.config.ts > cdn?[serviceKey]`, keyed by the SaaS-config
105
+ * service key (same keyspace as `serviceHosts`).
106
+ *
107
+ * # Semantics
108
+ *
109
+ * Opting a frontend service into CDN serving means, FOR THAT ENVIRONMENT:
110
+ * - the deploy render emits NEITHER an nginx Deployment/Service NOR an ingress
111
+ * / compose route for the service — its public host is served off-cluster by
112
+ * the CDN (DNS points the `<serviceHost>.<publicDomain>` at the CDN edge);
113
+ * - `runtime.endPoints.publicUrl` is UNCHANGED (still
114
+ * `<serviceHost>.<publicDomain>`) — the browser gets the same URL, it just
115
+ * resolves to the CDN. This preserves the CORS / cross-frontend-handoff
116
+ * coherence the ingress model relied on.
117
+ *
118
+ * CDN-served-ness is a PER-ENV deployment decision (a service can be
119
+ * nginx-served in staging and CDN-served in production), which is why this
120
+ * lives in the infra env config alongside `serviceHosts` — NOT on the app
121
+ * service definition. The CSP *content* stays app-owned via the existing
122
+ * `csp` resolution; the publish path REUSES that resolved policy to emit the
123
+ * edge CSP, so this surface carries only the deployment targeting.
124
+ *
125
+ * # Object-storage target
126
+ *
127
+ * The S3 endpoint + credentials come from `backingServices.s3` (the app's
128
+ * existing object-storage authoring surface — reused, not re-declared). Only
129
+ * the bucket (+ optional key prefix) is CDN-specific: static public assets
130
+ * SHOULD live in a bucket separate from the app's private file-storage bucket
131
+ * (different access policy), so `bucket` is authored here; when omitted it
132
+ * falls back to `backingServices.s3.bucket`.
133
+ */
134
+ export declare const WildoCdnConfigSchema: z.ZodObject<{
135
+ /**
136
+ * Opt-out switch WITHOUT deleting the block. `true` (default) => this
137
+ * service is CDN-served in this env (nginx pod + ingress route skipped,
138
+ * publish path active). `false` => authored-but-inactive: the service falls
139
+ * back to normal nginx-pod serving and the publish path ignores it. The
140
+ * emit-skip / publish set keys on `enabled === true`, never on mere
141
+ * presence, so a disabled entry never silently drops the ingress route.
142
+ */
143
+ enabled: z.ZodDefault<z.ZodBoolean>;
144
+ /**
145
+ * S3 bucket holding this frontend's PUBLIC static assets. Defaults to
146
+ * `backingServices.s3.bucket` when omitted, but a SEPARATE public-read
147
+ * bucket is recommended (do not mix public static assets with the app's
148
+ * private user-uploaded files). The S3 endpoint + credentials always come
149
+ * from `backingServices.s3`.
150
+ */
151
+ bucket: z.ZodOptional<z.ZodString>;
152
+ /**
153
+ * Optional object-key prefix within the bucket (e.g. when one bucket serves
154
+ * several frontends). Defaults to the service key. No leading/trailing
155
+ * slash — the uploader joins segments.
156
+ */
157
+ bucketPrefix: z.ZodOptional<z.ZodString>;
158
+ /**
159
+ * CDN vendor + its live-provisioning addressing. `GENERIC` = upload +
160
+ * `_headers` only; branded vendors additionally push the edge CSP policy.
161
+ */
162
+ vendor: z.ZodDiscriminatedUnion<[z.ZodObject<{
163
+ kind: z.ZodLiteral<CdnVendor.GENERIC>;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ kind: z.ZodLiteral<CdnVendor.CLOUDFLARE>;
166
+ /**
167
+ * Cloudflare zone id that fronts this frontend's public host. The publish
168
+ * path PUTs the response-header-transform ruleset entrypoint on this zone.
169
+ */
170
+ zoneId: z.ZodString;
171
+ /**
172
+ * NAME of the environment variable holding the Cloudflare API token (a
173
+ * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.
174
+ * Default `CLOUDFLARE_API_TOKEN`.
175
+ */
176
+ apiTokenEnvVar: z.ZodDefault<z.ZodString>;
177
+ }, z.core.$strict>], "kind">;
178
+ }, z.core.$strict>;
179
+ export type WildoCdnConfig = z.infer<typeof WildoCdnConfigSchema>;
180
+ export type WildoCdnConfigInput = z.input<typeof WildoCdnConfigSchema>;
181
+ /** @wildo_source:part:end platform.config.cdn */
182
+ //# sourceMappingURL=cdn.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdn.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/cdn.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;GAcG;AACH,oBAAY,SAAS;IACnB;;;;;;OAMG;IACH,OAAO,YAAY;IACnB;;;;;;;;OAQG;IACH,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;kBAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B;;IAE1C;;;OAGG;;IAEH;;;;OAIG;;kBAEH,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;IAnBhC;;;OAGG;;IAEH;;;;OAIG;;4BAaH,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;;;;OAOG;;IAEH;;;;;;OAMG;;IAEH;;;;OAIG;;IAEH;;;OAGG;;;;;QApFH;;;WAGG;;QAEH;;;;WAIG;;;kBA6EH,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,iDAAiD"}
@@ -0,0 +1,151 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * @wildo_source:part:start platform.config.cdn facet:layer:platform facet:family:infra
4
+ *
5
+ * Per-service CDN publish configuration, authored per-environment under
6
+ * `wildo.infra.<env>.config.ts > cdn?[serviceKey]` (import the schemas + the
7
+ * `CdnVendor` enum from `@wildo-ai/platform-config-lib`). Opting a frontend
8
+ * into CDN serving (REMOTE envs only — the schema rejects `cdn` in local)
9
+ * makes the deploy render skip its nginx Deployment/Service + ingress route
10
+ * (served off-cluster by the CDN) while keeping its `runtime.endPoints.publicUrl`
11
+ * unchanged; `wildo frontend publish` then uploads the built `dist/` to the S3
12
+ * bucket + re-homes CSP to the edge.
13
+ */
14
+ /**
15
+ * CDN vendor brands the framework can drive a live edge-publish against.
16
+ *
17
+ * Imported from `@wildo-ai/platform-config-lib`. Authored per-service-key
18
+ * under `wildo.infra.<env>.config.ts > cdn?[serviceKey].vendor.kind`.
19
+ *
20
+ * The catalog is intentionally small and grows one brand at a time (mirrors
21
+ * the `InfraProvider` brand convention). Each brand that supports LIVE
22
+ * provisioning gets its own arm in {@link CdnVendorConfigSchema} carrying its
23
+ * addressing (`zoneId`, …). `GENERIC` is the provider-agnostic escape hatch:
24
+ * the publish path still uploads the `dist/` + writes a portable `_headers`
25
+ * CSP file, but performs NO live vendor API call — the operator points their
26
+ * own CDN (any `_headers`-consuming host: Cloudflare Pages, Netlify, Vercel,
27
+ * or a bucket fronted by a proxy) at the published bucket.
28
+ */
29
+ export var CdnVendor;
30
+ (function (CdnVendor) {
31
+ /**
32
+ * No live vendor call. `wildo frontend publish` uploads the built `dist/`
33
+ * to the configured S3 bucket and writes a portable `_headers` CSP file
34
+ * alongside it; the operator wires their own CDN to the bucket. This is the
35
+ * lowest-fabrication path and the correct choice when the CDN is fronted by
36
+ * a host that reads `_headers`, or when the edge policy is managed out-of-band.
37
+ */
38
+ CdnVendor["GENERIC"] = "generic";
39
+ /**
40
+ * Cloudflare. `wildo frontend publish` additionally ensures a
41
+ * `http_response_headers_transform` ruleset on the authored zone that SETs
42
+ * the resolved CSP response header at the edge (the header nginx would emit
43
+ * on a pod-served frontend). The live call fires only when the API token
44
+ * (resolved from {@link CloudflareCdnVendorConfigSchema.apiTokenEnvVar}) is
45
+ * present at publish time; otherwise the publish emits artifacts and skips
46
+ * the live call with a warning.
47
+ */
48
+ CdnVendor["CLOUDFLARE"] = "cloudflare";
49
+ })(CdnVendor || (CdnVendor = {}));
50
+ /**
51
+ * `GENERIC` vendor — no live provisioning, no addressing. Presence of this
52
+ * arm still opts the service into the CDN publish path (upload + `_headers`).
53
+ */
54
+ export const GenericCdnVendorConfigSchema = z.strictObject({
55
+ kind: z.literal(CdnVendor.GENERIC),
56
+ });
57
+ /**
58
+ * `CLOUDFLARE` vendor — live edge CSP provisioning against a Cloudflare zone.
59
+ *
60
+ * Only the token's ENV-VAR NAME is authored here, never the token value:
61
+ * secrets never live in a checked-in `wildo.infra.<env>.config.ts`. The
62
+ * publish path reads `process.env[apiTokenEnvVar]` at runtime; a missing var
63
+ * degrades to artifacts-only (no throw).
64
+ */
65
+ export const CloudflareCdnVendorConfigSchema = z.strictObject({
66
+ kind: z.literal(CdnVendor.CLOUDFLARE),
67
+ /**
68
+ * Cloudflare zone id that fronts this frontend's public host. The publish
69
+ * path PUTs the response-header-transform ruleset entrypoint on this zone.
70
+ */
71
+ zoneId: z.string().min(1),
72
+ /**
73
+ * NAME of the environment variable holding the Cloudflare API token (a
74
+ * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.
75
+ * Default `CLOUDFLARE_API_TOKEN`.
76
+ */
77
+ apiTokenEnvVar: z.string().min(1).default('CLOUDFLARE_API_TOKEN'),
78
+ });
79
+ /**
80
+ * Discriminated union over {@link CdnVendor}. Adding a brand = adding an arm
81
+ * here (+ a live adapter in the publish path). The discriminant `kind` gives
82
+ * exhaustive narrowing at every consumer.
83
+ */
84
+ export const CdnVendorConfigSchema = z.discriminatedUnion('kind', [
85
+ GenericCdnVendorConfigSchema,
86
+ CloudflareCdnVendorConfigSchema,
87
+ ]);
88
+ /**
89
+ * Per-service CDN publish config — authored under
90
+ * `wildo.infra.<env>.config.ts > cdn?[serviceKey]`, keyed by the SaaS-config
91
+ * service key (same keyspace as `serviceHosts`).
92
+ *
93
+ * # Semantics
94
+ *
95
+ * Opting a frontend service into CDN serving means, FOR THAT ENVIRONMENT:
96
+ * - the deploy render emits NEITHER an nginx Deployment/Service NOR an ingress
97
+ * / compose route for the service — its public host is served off-cluster by
98
+ * the CDN (DNS points the `<serviceHost>.<publicDomain>` at the CDN edge);
99
+ * - `runtime.endPoints.publicUrl` is UNCHANGED (still
100
+ * `<serviceHost>.<publicDomain>`) — the browser gets the same URL, it just
101
+ * resolves to the CDN. This preserves the CORS / cross-frontend-handoff
102
+ * coherence the ingress model relied on.
103
+ *
104
+ * CDN-served-ness is a PER-ENV deployment decision (a service can be
105
+ * nginx-served in staging and CDN-served in production), which is why this
106
+ * lives in the infra env config alongside `serviceHosts` — NOT on the app
107
+ * service definition. The CSP *content* stays app-owned via the existing
108
+ * `csp` resolution; the publish path REUSES that resolved policy to emit the
109
+ * edge CSP, so this surface carries only the deployment targeting.
110
+ *
111
+ * # Object-storage target
112
+ *
113
+ * The S3 endpoint + credentials come from `backingServices.s3` (the app's
114
+ * existing object-storage authoring surface — reused, not re-declared). Only
115
+ * the bucket (+ optional key prefix) is CDN-specific: static public assets
116
+ * SHOULD live in a bucket separate from the app's private file-storage bucket
117
+ * (different access policy), so `bucket` is authored here; when omitted it
118
+ * falls back to `backingServices.s3.bucket`.
119
+ */
120
+ export const WildoCdnConfigSchema = z.strictObject({
121
+ /**
122
+ * Opt-out switch WITHOUT deleting the block. `true` (default) => this
123
+ * service is CDN-served in this env (nginx pod + ingress route skipped,
124
+ * publish path active). `false` => authored-but-inactive: the service falls
125
+ * back to normal nginx-pod serving and the publish path ignores it. The
126
+ * emit-skip / publish set keys on `enabled === true`, never on mere
127
+ * presence, so a disabled entry never silently drops the ingress route.
128
+ */
129
+ enabled: z.boolean().default(true),
130
+ /**
131
+ * S3 bucket holding this frontend's PUBLIC static assets. Defaults to
132
+ * `backingServices.s3.bucket` when omitted, but a SEPARATE public-read
133
+ * bucket is recommended (do not mix public static assets with the app's
134
+ * private user-uploaded files). The S3 endpoint + credentials always come
135
+ * from `backingServices.s3`.
136
+ */
137
+ bucket: z.string().min(1).optional(),
138
+ /**
139
+ * Optional object-key prefix within the bucket (e.g. when one bucket serves
140
+ * several frontends). Defaults to the service key. No leading/trailing
141
+ * slash — the uploader joins segments.
142
+ */
143
+ bucketPrefix: z.string().optional(),
144
+ /**
145
+ * CDN vendor + its live-provisioning addressing. `GENERIC` = upload +
146
+ * `_headers` only; branded vendors additionally push the edge CSP policy.
147
+ */
148
+ vendor: CdnVendorConfigSchema,
149
+ });
150
+ /** @wildo_source:part:end platform.config.cdn */
151
+ //# sourceMappingURL=cdn.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdn.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/cdn.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,SAmBX;AAnBD,WAAY,SAAS;IACnB;;;;;;OAMG;IACH,gCAAmB,CAAA;IACnB;;;;;;;;OAQG;IACH,sCAAyB,CAAA;AAC3B,CAAC,EAnBW,SAAS,KAAT,SAAS,QAmBpB;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,YAAY,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;CACnC,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC;IACrC;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB;;;;OAIG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAClE,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,4BAA4B;IAC5B,+BAA+B;CAChC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC;;;OAGG;IACH,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAGH,iDAAiD","sourcesContent":["import { z } from 'zod';\n\n/**\n * @wildo_source:part:start platform.config.cdn facet:layer:platform facet:family:infra\n *\n * Per-service CDN publish configuration, authored per-environment under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]` (import the schemas + the\n * `CdnVendor` enum from `@wildo-ai/platform-config-lib`). Opting a frontend\n * into CDN serving (REMOTE envs only — the schema rejects `cdn` in local)\n * makes the deploy render skip its nginx Deployment/Service + ingress route\n * (served off-cluster by the CDN) while keeping its `runtime.endPoints.publicUrl`\n * unchanged; `wildo frontend publish` then uploads the built `dist/` to the S3\n * bucket + re-homes CSP to the edge.\n */\n\n/**\n * CDN vendor brands the framework can drive a live edge-publish against.\n *\n * Imported from `@wildo-ai/platform-config-lib`. Authored per-service-key\n * under `wildo.infra.<env>.config.ts > cdn?[serviceKey].vendor.kind`.\n *\n * The catalog is intentionally small and grows one brand at a time (mirrors\n * the `InfraProvider` brand convention). Each brand that supports LIVE\n * provisioning gets its own arm in {@link CdnVendorConfigSchema} carrying its\n * addressing (`zoneId`, …). `GENERIC` is the provider-agnostic escape hatch:\n * the publish path still uploads the `dist/` + writes a portable `_headers`\n * CSP file, but performs NO live vendor API call — the operator points their\n * own CDN (any `_headers`-consuming host: Cloudflare Pages, Netlify, Vercel,\n * or a bucket fronted by a proxy) at the published bucket.\n */\nexport enum CdnVendor {\n /**\n * No live vendor call. `wildo frontend publish` uploads the built `dist/`\n * to the configured S3 bucket and writes a portable `_headers` CSP file\n * alongside it; the operator wires their own CDN to the bucket. This is the\n * lowest-fabrication path and the correct choice when the CDN is fronted by\n * a host that reads `_headers`, or when the edge policy is managed out-of-band.\n */\n GENERIC = 'generic',\n /**\n * Cloudflare. `wildo frontend publish` additionally ensures a\n * `http_response_headers_transform` ruleset on the authored zone that SETs\n * the resolved CSP response header at the edge (the header nginx would emit\n * on a pod-served frontend). The live call fires only when the API token\n * (resolved from {@link CloudflareCdnVendorConfigSchema.apiTokenEnvVar}) is\n * present at publish time; otherwise the publish emits artifacts and skips\n * the live call with a warning.\n */\n CLOUDFLARE = 'cloudflare',\n}\n\n/**\n * `GENERIC` vendor — no live provisioning, no addressing. Presence of this\n * arm still opts the service into the CDN publish path (upload + `_headers`).\n */\nexport const GenericCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.GENERIC),\n});\nexport type GenericCdnVendorConfig = z.infer<typeof GenericCdnVendorConfigSchema>;\n\n/**\n * `CLOUDFLARE` vendor — live edge CSP provisioning against a Cloudflare zone.\n *\n * Only the token's ENV-VAR NAME is authored here, never the token value:\n * secrets never live in a checked-in `wildo.infra.<env>.config.ts`. The\n * publish path reads `process.env[apiTokenEnvVar]` at runtime; a missing var\n * degrades to artifacts-only (no throw).\n */\nexport const CloudflareCdnVendorConfigSchema = z.strictObject({\n kind: z.literal(CdnVendor.CLOUDFLARE),\n /**\n * Cloudflare zone id that fronts this frontend's public host. The publish\n * path PUTs the response-header-transform ruleset entrypoint on this zone.\n */\n zoneId: z.string().min(1),\n /**\n * NAME of the environment variable holding the Cloudflare API token (a\n * scoped token with `Zone.Ruleset` edit on the zone). NOT the token itself.\n * Default `CLOUDFLARE_API_TOKEN`.\n */\n apiTokenEnvVar: z.string().min(1).default('CLOUDFLARE_API_TOKEN'),\n});\nexport type CloudflareCdnVendorConfig = z.infer<typeof CloudflareCdnVendorConfigSchema>;\n\n/**\n * Discriminated union over {@link CdnVendor}. Adding a brand = adding an arm\n * here (+ a live adapter in the publish path). The discriminant `kind` gives\n * exhaustive narrowing at every consumer.\n */\nexport const CdnVendorConfigSchema = z.discriminatedUnion('kind', [\n GenericCdnVendorConfigSchema,\n CloudflareCdnVendorConfigSchema,\n]);\nexport type CdnVendorConfig = z.infer<typeof CdnVendorConfigSchema>;\n\n/**\n * Per-service CDN publish config — authored under\n * `wildo.infra.<env>.config.ts > cdn?[serviceKey]`, keyed by the SaaS-config\n * service key (same keyspace as `serviceHosts`).\n *\n * # Semantics\n *\n * Opting a frontend service into CDN serving means, FOR THAT ENVIRONMENT:\n * - the deploy render emits NEITHER an nginx Deployment/Service NOR an ingress\n * / compose route for the service — its public host is served off-cluster by\n * the CDN (DNS points the `<serviceHost>.<publicDomain>` at the CDN edge);\n * - `runtime.endPoints.publicUrl` is UNCHANGED (still\n * `<serviceHost>.<publicDomain>`) — the browser gets the same URL, it just\n * resolves to the CDN. This preserves the CORS / cross-frontend-handoff\n * coherence the ingress model relied on.\n *\n * CDN-served-ness is a PER-ENV deployment decision (a service can be\n * nginx-served in staging and CDN-served in production), which is why this\n * lives in the infra env config alongside `serviceHosts` — NOT on the app\n * service definition. The CSP *content* stays app-owned via the existing\n * `csp` resolution; the publish path REUSES that resolved policy to emit the\n * edge CSP, so this surface carries only the deployment targeting.\n *\n * # Object-storage target\n *\n * The S3 endpoint + credentials come from `backingServices.s3` (the app's\n * existing object-storage authoring surface — reused, not re-declared). Only\n * the bucket (+ optional key prefix) is CDN-specific: static public assets\n * SHOULD live in a bucket separate from the app's private file-storage bucket\n * (different access policy), so `bucket` is authored here; when omitted it\n * falls back to `backingServices.s3.bucket`.\n */\nexport const WildoCdnConfigSchema = z.strictObject({\n /**\n * Opt-out switch WITHOUT deleting the block. `true` (default) => this\n * service is CDN-served in this env (nginx pod + ingress route skipped,\n * publish path active). `false` => authored-but-inactive: the service falls\n * back to normal nginx-pod serving and the publish path ignores it. The\n * emit-skip / publish set keys on `enabled === true`, never on mere\n * presence, so a disabled entry never silently drops the ingress route.\n */\n enabled: z.boolean().default(true),\n /**\n * S3 bucket holding this frontend's PUBLIC static assets. Defaults to\n * `backingServices.s3.bucket` when omitted, but a SEPARATE public-read\n * bucket is recommended (do not mix public static assets with the app's\n * private user-uploaded files). The S3 endpoint + credentials always come\n * from `backingServices.s3`.\n */\n bucket: z.string().min(1).optional(),\n /**\n * Optional object-key prefix within the bucket (e.g. when one bucket serves\n * several frontends). Defaults to the service key. No leading/trailing\n * slash — the uploader joins segments.\n */\n bucketPrefix: z.string().optional(),\n /**\n * CDN vendor + its live-provisioning addressing. `GENERIC` = upload +\n * `_headers` only; branded vendors additionally push the edge CSP policy.\n */\n vendor: CdnVendorConfigSchema,\n});\nexport type WildoCdnConfig = z.infer<typeof WildoCdnConfigSchema>;\nexport type WildoCdnConfigInput = z.input<typeof WildoCdnConfigSchema>;\n/** @wildo_source:part:end platform.config.cdn */\n"]}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Per-`AppFrontendType` Content-Security-Policy baselines (Slice B B-Step 1
3
+ * — `auth-hardening.md`).
4
+ *
5
+ * # Why one baseline per frontend kind (vs a single platform-wide one)
6
+ *
7
+ * The three `AppFrontendType` kinds (`SAAS_APP` / `STATIC_WEBSITE` /
8
+ * `TECH_DOC`) genuinely have different inline-script / inline-style
9
+ * pressure:
10
+ *
11
+ * - `SAAS_APP` — React SPA built with Vite. Vite's production output
12
+ * uses ESM `<script type="module">` with no inline scripts, AND
13
+ * the runtime emits no inline styles. So the `SAAS_APP` baseline
14
+ * is the tightest of the three: NO `'unsafe-inline'` for scripts,
15
+ * `'unsafe-inline'` for styles ONLY because Tailwind's runtime
16
+ * style-injection (e.g., `@apply` with arbitrary values) emits
17
+ * short-lived inline `<style>` tags.
18
+ * - `TECH_DOC` — Docusaurus 3.x SSG. Its hydration shim and classic-theme
19
+ * bootstrap inject inline `<script>` (theme detection, color-mode
20
+ * restoration and route-state seed), while generated/theme markup uses
21
+ * inline styles. So the `TECH_DOC` baseline MUST allow `'unsafe-inline'`
22
+ * for both scripts AND styles. Tightening
23
+ * to nonce-based `'self'` only is a post-Slice-B follow-up that
24
+ * would require an upstream Docusaurus runtime change OR a
25
+ * nonce-injecting build plugin.
26
+ * - `STATIC_WEBSITE` — Astro SSG marketing site. The marketing
27
+ * surface typically embeds analytics / advertising / chat-widget
28
+ * pixels (each a third-party origin), so the baseline ships an
29
+ * intentionally-empty `script-src` / `connect-src` extension list
30
+ * (just `'self'`) and forces the per-app config to opt into every
31
+ * third-party origin explicitly. Per-app `directives['script-src']`
32
+ * overrides MUST list the third-party hostnames the marketing team
33
+ * has actually whitelisted (no implicit `'unsafe-inline'`).
34
+ *
35
+ * A single platform-wide baseline would force the lowest common
36
+ * denominator (`TECH_DOC`'s `'unsafe-inline'` for everyone) and lose
37
+ * the SAAS_APP tightness for no gain.
38
+ *
39
+ * # Shared posture across all three baselines
40
+ *
41
+ * - `default-src 'self'` — block by default; everything else opts
42
+ * in explicitly via specific directives.
43
+ * - `frame-ancestors 'none'` — refuse iframe embedding. Header-only
44
+ * directive (meta channel ignores it; the `csp-emit.ts` serializer
45
+ * strips it from the meta tag automatically).
46
+ * - `object-src 'none'` — block `<object>` / `<embed>` plugin loading
47
+ * entirely. None of the three frontend kinds have a use case for
48
+ * legacy plugins.
49
+ * - `form-action 'self'` — block `<form action="…">` from POSTing
50
+ * to a third-party origin. Closes the cross-origin form-injection
51
+ * surface even when the rest of the policy is permissive.
52
+ * - `base-uri 'self'` — block `<base href="…">` injection from
53
+ * redirecting relative URLs to an attacker-controlled origin.
54
+ *
55
+ * # Connect-src
56
+ *
57
+ * Every baseline ships `connect-src 'self'` — the resolver merges in
58
+ * additional origins via the app-static `directives['connect-src']`
59
+ * override (e.g., the SaaS backend API hostname), and via Slice B
60
+ * Step 2's env-layer override for per-env additions (Sentry, analytics
61
+ * collectors). The baseline does NOT include any backend hostname
62
+ * because the resolver does NOT know the deployment env at the engine
63
+ * layer; per-env hostnames are an env-config concern.
64
+ *
65
+ * # `report-uri` is intentionally NOT in any baseline
66
+ *
67
+ * The platform doesn't ship a CSP-violation collector yet
68
+ * (`auth-hardening.md` "Cheap Bonuses — CSP violation monitoring
69
+ * endpoint" tracks that as an independent follow-up). Authoring a
70
+ * baseline `report-uri` value would be a config lie; per-app authoring
71
+ * via the `WildoCspConfigSchema.reportUri` field is the right seam
72
+ * once a real collector exists.
73
+ */
74
+ import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
75
+ import type { CspDirectiveName } from './csp.schemas';
76
+ /**
77
+ * Baseline directive map for one `AppFrontendType`. Internal shape — the
78
+ * resolver in `platform-config-lib/src/project-config/shared/csp-emit.ts` produces
79
+ * the same shape as its post-merge output. Distinct from the AUTHOR-side
80
+ * `WildoCspConfig.directives` (which is partial; this is total).
81
+ */
82
+ export type CspBaselineDirectiveMap = Readonly<Partial<Record<CspDirectiveName, readonly string[]>>>;
83
+ /**
84
+ * Per-`AppFrontendType` baseline registry. Total over the enum — adding
85
+ * a new `AppFrontendType` value forces a baseline edit here at compile
86
+ * time (TS error on the missing key). That coupling is the whole point
87
+ * of the registry shape: a new frontend kind that ships without a CSP
88
+ * baseline would silently get NO policy on any deployment until someone
89
+ * notices.
90
+ */
91
+ export declare const CSP_BASELINES: Readonly<Record<AppFrontendType, CspBaselineDirectiveMap>>;
92
+ //# sourceMappingURL=csp-defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csp-defaults.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/csp-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CACrD,CAAC;AAgHF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAClC,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAKjD,CAAC"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Per-`AppFrontendType` Content-Security-Policy baselines (Slice B B-Step 1
3
+ * — `auth-hardening.md`).
4
+ *
5
+ * # Why one baseline per frontend kind (vs a single platform-wide one)
6
+ *
7
+ * The three `AppFrontendType` kinds (`SAAS_APP` / `STATIC_WEBSITE` /
8
+ * `TECH_DOC`) genuinely have different inline-script / inline-style
9
+ * pressure:
10
+ *
11
+ * - `SAAS_APP` — React SPA built with Vite. Vite's production output
12
+ * uses ESM `<script type="module">` with no inline scripts, AND
13
+ * the runtime emits no inline styles. So the `SAAS_APP` baseline
14
+ * is the tightest of the three: NO `'unsafe-inline'` for scripts,
15
+ * `'unsafe-inline'` for styles ONLY because Tailwind's runtime
16
+ * style-injection (e.g., `@apply` with arbitrary values) emits
17
+ * short-lived inline `<style>` tags.
18
+ * - `TECH_DOC` — Docusaurus 3.x SSG. Its hydration shim and classic-theme
19
+ * bootstrap inject inline `<script>` (theme detection, color-mode
20
+ * restoration and route-state seed), while generated/theme markup uses
21
+ * inline styles. So the `TECH_DOC` baseline MUST allow `'unsafe-inline'`
22
+ * for both scripts AND styles. Tightening
23
+ * to nonce-based `'self'` only is a post-Slice-B follow-up that
24
+ * would require an upstream Docusaurus runtime change OR a
25
+ * nonce-injecting build plugin.
26
+ * - `STATIC_WEBSITE` — Astro SSG marketing site. The marketing
27
+ * surface typically embeds analytics / advertising / chat-widget
28
+ * pixels (each a third-party origin), so the baseline ships an
29
+ * intentionally-empty `script-src` / `connect-src` extension list
30
+ * (just `'self'`) and forces the per-app config to opt into every
31
+ * third-party origin explicitly. Per-app `directives['script-src']`
32
+ * overrides MUST list the third-party hostnames the marketing team
33
+ * has actually whitelisted (no implicit `'unsafe-inline'`).
34
+ *
35
+ * A single platform-wide baseline would force the lowest common
36
+ * denominator (`TECH_DOC`'s `'unsafe-inline'` for everyone) and lose
37
+ * the SAAS_APP tightness for no gain.
38
+ *
39
+ * # Shared posture across all three baselines
40
+ *
41
+ * - `default-src 'self'` — block by default; everything else opts
42
+ * in explicitly via specific directives.
43
+ * - `frame-ancestors 'none'` — refuse iframe embedding. Header-only
44
+ * directive (meta channel ignores it; the `csp-emit.ts` serializer
45
+ * strips it from the meta tag automatically).
46
+ * - `object-src 'none'` — block `<object>` / `<embed>` plugin loading
47
+ * entirely. None of the three frontend kinds have a use case for
48
+ * legacy plugins.
49
+ * - `form-action 'self'` — block `<form action="…">` from POSTing
50
+ * to a third-party origin. Closes the cross-origin form-injection
51
+ * surface even when the rest of the policy is permissive.
52
+ * - `base-uri 'self'` — block `<base href="…">` injection from
53
+ * redirecting relative URLs to an attacker-controlled origin.
54
+ *
55
+ * # Connect-src
56
+ *
57
+ * Every baseline ships `connect-src 'self'` — the resolver merges in
58
+ * additional origins via the app-static `directives['connect-src']`
59
+ * override (e.g., the SaaS backend API hostname), and via Slice B
60
+ * Step 2's env-layer override for per-env additions (Sentry, analytics
61
+ * collectors). The baseline does NOT include any backend hostname
62
+ * because the resolver does NOT know the deployment env at the engine
63
+ * layer; per-env hostnames are an env-config concern.
64
+ *
65
+ * # `report-uri` is intentionally NOT in any baseline
66
+ *
67
+ * The platform doesn't ship a CSP-violation collector yet
68
+ * (`auth-hardening.md` "Cheap Bonuses — CSP violation monitoring
69
+ * endpoint" tracks that as an independent follow-up). Authoring a
70
+ * baseline `report-uri` value would be a config lie; per-app authoring
71
+ * via the `WildoCspConfigSchema.reportUri` field is the right seam
72
+ * once a real collector exists.
73
+ */
74
+ import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
75
+ /**
76
+ * `SAAS_APP` baseline — tightest of the three. Vite-bundled React SPA
77
+ * with no inline scripts (production builds emit `<script type="module">`).
78
+ * `style-src 'unsafe-inline'` covers Tailwind runtime style injection.
79
+ *
80
+ * # Google Fonts origins in `style-src` and `font-src`
81
+ *
82
+ * The design-token system (`saas-frontend-lib/src/core/ui/design-token.utils.ts`)
83
+ * ships `applyGoogleFontPreset()` as the canonical web-font loader for
84
+ * `SAAS_APP` shells. It builds a `https://fonts.googleapis.com/css2?...`
85
+ * `<link rel="stylesheet">` at runtime, which in turn pulls woff2 files
86
+ * from `https://fonts.gstatic.com/...`. Both origins MUST be in the
87
+ * baseline because:
88
+ *
89
+ * 1. The font loader is framework-shipped, not app-authored. An app
90
+ * developer that simply uses an `OKLCH` design-token preset with a
91
+ * Google Font family inherits the loader without writing any code,
92
+ * and would hit CSP blocks on every shell render in production
93
+ * (today they're masked because `reportOnly: true` is the typical
94
+ * dev posture).
95
+ * 2. Widening to two specific origins is dramatically safer than the
96
+ * alternatives — `'unsafe-inline'` (which we already accept for
97
+ * Tailwind) is orders of magnitude broader; nonces are not
98
+ * compatible with a runtime-injected `<link>` that doesn't carry
99
+ * our nonce attribute.
100
+ * 3. Apps that prefer fully-local fonts (e.g., self-hosted woff2 in
101
+ * `public/fonts/`) and never call `applyGoogleFontPreset()` can
102
+ * tighten back via the per-app `directives['style-src']` /
103
+ * `directives['font-src']` override — the resolver merges as a
104
+ * union, so the per-app config can restate `["'self'", "'unsafe-inline'"]`
105
+ * without `fonts.googleapis.com` and CSP will warn (or block) any
106
+ * stray Google-Fonts call.
107
+ *
108
+ * `preconnect` to both origins happens at the same site
109
+ * (`design-token.utils.ts` lines 982–996). Preconnect is governed by
110
+ * `connect-src`, not `style-src` / `font-src`, BUT modern browsers
111
+ * treat `<link rel="preconnect">` as a hint that doesn't require CSP
112
+ * fetch directives — the actual fetch later in the pipeline carries
113
+ * the resource type and is what CSP grades. No `connect-src` widening
114
+ * is needed.
115
+ */
116
+ const SAAS_APP_BASELINE = {
117
+ 'default-src': ["'self'"],
118
+ 'script-src': ["'self'"],
119
+ 'style-src': ["'self'", "'unsafe-inline'", 'https://fonts.googleapis.com'],
120
+ 'img-src': ["'self'", 'data:', 'blob:'],
121
+ 'connect-src': ["'self'"],
122
+ 'font-src': ["'self'", 'data:', 'https://fonts.gstatic.com'],
123
+ 'frame-ancestors': ["'none'"],
124
+ 'object-src': ["'none'"],
125
+ 'form-action': ["'self'"],
126
+ 'base-uri': ["'self'"],
127
+ };
128
+ /**
129
+ * `TECH_DOC` baseline — Docusaurus 3.x SSG. `'unsafe-inline'` on both
130
+ * `script-src` AND `style-src` is required by the Docusaurus runtime
131
+ * (classic-theme bootstrap and hydration shim). `img-src` retains `data:` and
132
+ * `blob:` because the documentation product supports generated/MDX images
133
+ * expressed with those browser-native URL schemes. Fonts are self-hosted; the
134
+ * removed OpenAPI theme's inline icon-font allowance is deliberately gone.
135
+ *
136
+ * Tightening to nonce-based `'self'` only is a post-Slice-B follow-up
137
+ * (would require an upstream Docusaurus runtime change OR a
138
+ * nonce-injecting build plugin — out of scope today).
139
+ */
140
+ const TECH_DOC_BASELINE = {
141
+ 'default-src': ["'self'"],
142
+ 'script-src': ["'self'", "'unsafe-inline'"],
143
+ 'style-src': ["'self'", "'unsafe-inline'"],
144
+ 'img-src': ["'self'", 'data:', 'blob:'],
145
+ 'connect-src': ["'self'"],
146
+ 'font-src': ["'self'"],
147
+ 'frame-ancestors': ["'none'"],
148
+ 'object-src': ["'none'"],
149
+ 'form-action': ["'self'"],
150
+ 'base-uri': ["'self'"],
151
+ };
152
+ /**
153
+ * `STATIC_WEBSITE` baseline — Astro SSG marketing site. Intentionally
154
+ * narrow `script-src` / `connect-src` to force the per-app config to
155
+ * opt into every third-party hostname (analytics, advertising, chat
156
+ * widget) explicitly. NO implicit `'unsafe-inline'` — the marketing
157
+ * team must opt in per origin (or use nonces / hashes once those are
158
+ * wired by the marketing build plugin).
159
+ *
160
+ * `style-src 'unsafe-inline'` is included because Astro's view
161
+ * transitions and inline scoped styles emit short-lived inline
162
+ * `<style>` tags; stripping that would break the marketing animations
163
+ * the website team relies on.
164
+ *
165
+ * `img-src` includes `https:` because marketing pages routinely embed
166
+ * third-party imagery (case-study screenshots, partner logos hosted on
167
+ * a CDN). Tightening to a closed allow-list per app is the per-app
168
+ * `directives['img-src']` override's job.
169
+ */
170
+ const STATIC_WEBSITE_BASELINE = {
171
+ 'default-src': ["'self'"],
172
+ 'script-src': ["'self'"],
173
+ 'style-src': ["'self'", "'unsafe-inline'"],
174
+ 'img-src': ["'self'", 'data:', 'blob:', 'https:'],
175
+ 'connect-src': ["'self'"],
176
+ 'font-src': ["'self'", 'data:'],
177
+ 'frame-ancestors': ["'none'"],
178
+ 'object-src': ["'none'"],
179
+ 'form-action': ["'self'"],
180
+ 'base-uri': ["'self'"],
181
+ };
182
+ /**
183
+ * Per-`AppFrontendType` baseline registry. Total over the enum — adding
184
+ * a new `AppFrontendType` value forces a baseline edit here at compile
185
+ * time (TS error on the missing key). That coupling is the whole point
186
+ * of the registry shape: a new frontend kind that ships without a CSP
187
+ * baseline would silently get NO policy on any deployment until someone
188
+ * notices.
189
+ */
190
+ export const CSP_BASELINES = {
191
+ [AppFrontendType.SAAS_APP]: SAAS_APP_BASELINE,
192
+ [AppFrontendType.STATIC_WEBSITE]: STATIC_WEBSITE_BASELINE,
193
+ [AppFrontendType.TECH_DOC]: TECH_DOC_BASELINE,
194
+ };
195
+ //# sourceMappingURL=csp-defaults.js.map