monorise 0.0.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 (416) hide show
  1. package/dist/base/index.d.ts +254 -0
  2. package/dist/base/index.js +44 -0
  3. package/dist/base/index.js.map +1 -0
  4. package/dist/cli/cli.d.ts +1 -0
  5. package/dist/cli/cli.js +461 -0
  6. package/dist/cli/cli.js.map +1 -0
  7. package/dist/core/index.d.ts +4767 -0
  8. package/dist/core/index.js +7941 -0
  9. package/dist/core/index.js.map +1 -0
  10. package/dist/index.d.ts +11 -0
  11. package/dist/index.js +11 -0
  12. package/dist/react/actions/app.action.d.ts +46 -0
  13. package/dist/react/actions/app.action.d.ts.map +1 -0
  14. package/dist/react/actions/auth.action.d.ts +24 -0
  15. package/dist/react/actions/auth.action.d.ts.map +1 -0
  16. package/dist/react/actions/config.action.d.ts +10 -0
  17. package/dist/react/actions/config.action.d.ts.map +1 -0
  18. package/dist/react/actions/core.action.d.ts +219 -0
  19. package/dist/react/actions/core.action.d.ts.map +1 -0
  20. package/dist/react/index.d.ts +1093 -0
  21. package/dist/react/index.d.ts.map +1 -0
  22. package/dist/react/index.js +2344 -0
  23. package/dist/react/index.js.map +1 -0
  24. package/dist/react/lib/api.d.ts +38 -0
  25. package/dist/react/lib/api.d.ts.map +1 -0
  26. package/dist/react/lib/constant.d.ts +2 -0
  27. package/dist/react/lib/constant.d.ts.map +1 -0
  28. package/dist/react/lib/entity.d.ts +10 -0
  29. package/dist/react/lib/entity.d.ts.map +1 -0
  30. package/dist/react/lib/utils.d.ts +10 -0
  31. package/dist/react/lib/utils.d.ts.map +1 -0
  32. package/dist/react/services/auth.service.d.ts +21 -0
  33. package/dist/react/services/auth.service.d.ts.map +1 -0
  34. package/dist/react/services/core.service.d.ts +76 -0
  35. package/dist/react/services/core.service.d.ts.map +1 -0
  36. package/dist/react/services/filestore.service.d.ts +22 -0
  37. package/dist/react/services/filestore.service.d.ts.map +1 -0
  38. package/dist/react/store/monorise.store.d.ts +169 -0
  39. package/dist/react/store/monorise.store.d.ts.map +1 -0
  40. package/dist/react/tsup.config.d.ts +3 -0
  41. package/dist/react/tsup.config.d.ts.map +1 -0
  42. package/dist/react/types/api.type.d.ts +30 -0
  43. package/dist/react/types/api.type.d.ts.map +1 -0
  44. package/dist/react/types/axios.type.d.ts +13 -0
  45. package/dist/react/types/axios.type.d.ts.map +1 -0
  46. package/dist/react/types/monorise.type.d.ts +8 -0
  47. package/dist/react/types/monorise.type.d.ts.map +1 -0
  48. package/dist/react/types/mutual.type.d.ts +21 -0
  49. package/dist/react/types/mutual.type.d.ts.map +1 -0
  50. package/dist/sst/.sst/platform/src/components/aws/analog.d.ts +423 -0
  51. package/dist/sst/.sst/platform/src/components/aws/analog.d.ts.map +1 -0
  52. package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts +74 -0
  53. package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts.map +1 -0
  54. package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket.d.ts +542 -0
  55. package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket.d.ts.map +1 -0
  56. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts +48 -0
  57. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts.map +1 -0
  58. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts +55 -0
  59. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts.map +1 -0
  60. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts +36 -0
  61. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts.map +1 -0
  62. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts +39 -0
  63. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts.map +1 -0
  64. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts +53 -0
  65. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -0
  66. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts +53 -0
  67. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts.map +1 -0
  68. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1.d.ts +1002 -0
  69. package/dist/sst/.sst/platform/src/components/aws/apigatewayv1.d.ts.map +1 -0
  70. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts +54 -0
  71. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts.map +1 -0
  72. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts +28 -0
  73. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts.map +1 -0
  74. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts +59 -0
  75. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -0
  76. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts +54 -0
  77. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts.map +1 -0
  78. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts +44 -0
  79. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts.map +1 -0
  80. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2.d.ts +931 -0
  81. package/dist/sst/.sst/platform/src/components/aws/apigatewayv2.d.ts.map +1 -0
  82. package/dist/sst/.sst/platform/src/components/aws/app-sync-data-source.d.ts +52 -0
  83. package/dist/sst/.sst/platform/src/components/aws/app-sync-data-source.d.ts.map +1 -0
  84. package/dist/sst/.sst/platform/src/components/aws/app-sync-function.d.ts +33 -0
  85. package/dist/sst/.sst/platform/src/components/aws/app-sync-function.d.ts.map +1 -0
  86. package/dist/sst/.sst/platform/src/components/aws/app-sync-resolver.d.ts +41 -0
  87. package/dist/sst/.sst/platform/src/components/aws/app-sync-resolver.d.ts.map +1 -0
  88. package/dist/sst/.sst/platform/src/components/aws/app-sync.d.ts +638 -0
  89. package/dist/sst/.sst/platform/src/components/aws/app-sync.d.ts.map +1 -0
  90. package/dist/sst/.sst/platform/src/components/aws/astro.d.ts +421 -0
  91. package/dist/sst/.sst/platform/src/components/aws/astro.d.ts.map +1 -0
  92. package/dist/sst/.sst/platform/src/components/aws/aurora.d.ts +702 -0
  93. package/dist/sst/.sst/platform/src/components/aws/aurora.d.ts.map +1 -0
  94. package/dist/sst/.sst/platform/src/components/aws/auth-v1.d.ts +26 -0
  95. package/dist/sst/.sst/platform/src/components/aws/auth-v1.d.ts.map +1 -0
  96. package/dist/sst/.sst/platform/src/components/aws/auth.d.ts +295 -0
  97. package/dist/sst/.sst/platform/src/components/aws/auth.d.ts.map +1 -0
  98. package/dist/sst/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts +61 -0
  99. package/dist/sst/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts.map +1 -0
  100. package/dist/sst/.sst/platform/src/components/aws/bucket-notification.d.ts +47 -0
  101. package/dist/sst/.sst/platform/src/components/aws/bucket-notification.d.ts.map +1 -0
  102. package/dist/sst/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts +55 -0
  103. package/dist/sst/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts.map +1 -0
  104. package/dist/sst/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts +55 -0
  105. package/dist/sst/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts.map +1 -0
  106. package/dist/sst/.sst/platform/src/components/aws/bucket.d.ts +1216 -0
  107. package/dist/sst/.sst/platform/src/components/aws/bucket.d.ts.map +1 -0
  108. package/dist/sst/.sst/platform/src/components/aws/bus-base-subscriber.d.ts +20 -0
  109. package/dist/sst/.sst/platform/src/components/aws/bus-base-subscriber.d.ts.map +1 -0
  110. package/dist/sst/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts +49 -0
  111. package/dist/sst/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts.map +1 -0
  112. package/dist/sst/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts +44 -0
  113. package/dist/sst/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts.map +1 -0
  114. package/dist/sst/.sst/platform/src/components/aws/bus.d.ts +403 -0
  115. package/dist/sst/.sst/platform/src/components/aws/bus.d.ts.map +1 -0
  116. package/dist/sst/.sst/platform/src/components/aws/cdn.d.ts +299 -0
  117. package/dist/sst/.sst/platform/src/components/aws/cdn.d.ts.map +1 -0
  118. package/dist/sst/.sst/platform/src/components/aws/cluster-v1.d.ts +882 -0
  119. package/dist/sst/.sst/platform/src/components/aws/cluster-v1.d.ts.map +1 -0
  120. package/dist/sst/.sst/platform/src/components/aws/cluster.d.ts +306 -0
  121. package/dist/sst/.sst/platform/src/components/aws/cluster.d.ts.map +1 -0
  122. package/dist/sst/.sst/platform/src/components/aws/cognito-identity-pool.d.ts +194 -0
  123. package/dist/sst/.sst/platform/src/components/aws/cognito-identity-pool.d.ts.map +1 -0
  124. package/dist/sst/.sst/platform/src/components/aws/cognito-identity-provider.d.ts +38 -0
  125. package/dist/sst/.sst/platform/src/components/aws/cognito-identity-provider.d.ts.map +1 -0
  126. package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts +50 -0
  127. package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts.map +1 -0
  128. package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool.d.ts +603 -0
  129. package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool.d.ts.map +1 -0
  130. package/dist/sst/.sst/platform/src/components/aws/cron.d.ts +250 -0
  131. package/dist/sst/.sst/platform/src/components/aws/cron.d.ts.map +1 -0
  132. package/dist/sst/.sst/platform/src/components/aws/dns-validated-certificate.d.ts +27 -0
  133. package/dist/sst/.sst/platform/src/components/aws/dns-validated-certificate.d.ts.map +1 -0
  134. package/dist/sst/.sst/platform/src/components/aws/dns.d.ts +94 -0
  135. package/dist/sst/.sst/platform/src/components/aws/dns.d.ts.map +1 -0
  136. package/dist/sst/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts +55 -0
  137. package/dist/sst/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -0
  138. package/dist/sst/.sst/platform/src/components/aws/dynamo.d.ts +568 -0
  139. package/dist/sst/.sst/platform/src/components/aws/dynamo.d.ts.map +1 -0
  140. package/dist/sst/.sst/platform/src/components/aws/efs.d.ts +217 -0
  141. package/dist/sst/.sst/platform/src/components/aws/efs.d.ts.map +1 -0
  142. package/dist/sst/.sst/platform/src/components/aws/email.d.ts +291 -0
  143. package/dist/sst/.sst/platform/src/components/aws/email.d.ts.map +1 -0
  144. package/dist/sst/.sst/platform/src/components/aws/fargate.d.ts +803 -0
  145. package/dist/sst/.sst/platform/src/components/aws/fargate.d.ts.map +1 -0
  146. package/dist/sst/.sst/platform/src/components/aws/function.d.ts +1629 -0
  147. package/dist/sst/.sst/platform/src/components/aws/function.d.ts.map +1 -0
  148. package/dist/sst/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts +3 -0
  149. package/dist/sst/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts.map +1 -0
  150. package/dist/sst/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts +144 -0
  151. package/dist/sst/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts.map +1 -0
  152. package/dist/sst/.sst/platform/src/components/aws/helpers/arn.d.ts +40 -0
  153. package/dist/sst/.sst/platform/src/components/aws/helpers/arn.d.ts.map +1 -0
  154. package/dist/sst/.sst/platform/src/components/aws/helpers/bootstrap.d.ts +13 -0
  155. package/dist/sst/.sst/platform/src/components/aws/helpers/bootstrap.d.ts.map +1 -0
  156. package/dist/sst/.sst/platform/src/components/aws/helpers/container-builder.d.ts +4 -0
  157. package/dist/sst/.sst/platform/src/components/aws/helpers/container-builder.d.ts.map +1 -0
  158. package/dist/sst/.sst/platform/src/components/aws/helpers/function-builder.d.ts +10 -0
  159. package/dist/sst/.sst/platform/src/components/aws/helpers/function-builder.d.ts.map +1 -0
  160. package/dist/sst/.sst/platform/src/components/aws/helpers/provider.d.ts +3 -0
  161. package/dist/sst/.sst/platform/src/components/aws/helpers/provider.d.ts.map +1 -0
  162. package/dist/sst/.sst/platform/src/components/aws/helpers/quota.d.ts +7 -0
  163. package/dist/sst/.sst/platform/src/components/aws/helpers/quota.d.ts.map +1 -0
  164. package/dist/sst/.sst/platform/src/components/aws/helpers/site-builder.d.ts +4 -0
  165. package/dist/sst/.sst/platform/src/components/aws/helpers/site-builder.d.ts.map +1 -0
  166. package/dist/sst/.sst/platform/src/components/aws/helpers/subscriber.d.ts +6 -0
  167. package/dist/sst/.sst/platform/src/components/aws/helpers/subscriber.d.ts.map +1 -0
  168. package/dist/sst/.sst/platform/src/components/aws/https-redirect.d.ts +38 -0
  169. package/dist/sst/.sst/platform/src/components/aws/https-redirect.d.ts.map +1 -0
  170. package/dist/sst/.sst/platform/src/components/aws/iam-edit.d.ts +39 -0
  171. package/dist/sst/.sst/platform/src/components/aws/iam-edit.d.ts.map +1 -0
  172. package/dist/sst/.sst/platform/src/components/aws/index.d.ts +48 -0
  173. package/dist/sst/.sst/platform/src/components/aws/index.d.ts.map +1 -0
  174. package/dist/sst/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts +48 -0
  175. package/dist/sst/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -0
  176. package/dist/sst/.sst/platform/src/components/aws/kinesis-stream.d.ts +249 -0
  177. package/dist/sst/.sst/platform/src/components/aws/kinesis-stream.d.ts.map +1 -0
  178. package/dist/sst/.sst/platform/src/components/aws/linkable.d.ts +17 -0
  179. package/dist/sst/.sst/platform/src/components/aws/linkable.d.ts.map +1 -0
  180. package/dist/sst/.sst/platform/src/components/aws/logging.d.ts +26 -0
  181. package/dist/sst/.sst/platform/src/components/aws/logging.d.ts.map +1 -0
  182. package/dist/sst/.sst/platform/src/components/aws/mysql.d.ts +496 -0
  183. package/dist/sst/.sst/platform/src/components/aws/mysql.d.ts.map +1 -0
  184. package/dist/sst/.sst/platform/src/components/aws/nextjs.d.ts +517 -0
  185. package/dist/sst/.sst/platform/src/components/aws/nextjs.d.ts.map +1 -0
  186. package/dist/sst/.sst/platform/src/components/aws/nuxt.d.ts +495 -0
  187. package/dist/sst/.sst/platform/src/components/aws/nuxt.d.ts.map +1 -0
  188. package/dist/sst/.sst/platform/src/components/aws/open-search.d.ts +295 -0
  189. package/dist/sst/.sst/platform/src/components/aws/open-search.d.ts.map +1 -0
  190. package/dist/sst/.sst/platform/src/components/aws/opencontrol.d.ts +165 -0
  191. package/dist/sst/.sst/platform/src/components/aws/opencontrol.d.ts.map +1 -0
  192. package/dist/sst/.sst/platform/src/components/aws/permission.d.ts +40 -0
  193. package/dist/sst/.sst/platform/src/components/aws/permission.d.ts.map +1 -0
  194. package/dist/sst/.sst/platform/src/components/aws/postgres-v1.d.ts +317 -0
  195. package/dist/sst/.sst/platform/src/components/aws/postgres-v1.d.ts.map +1 -0
  196. package/dist/sst/.sst/platform/src/components/aws/postgres.d.ts +500 -0
  197. package/dist/sst/.sst/platform/src/components/aws/postgres.d.ts.map +1 -0
  198. package/dist/sst/.sst/platform/src/components/aws/providers/bucket-files.d.ts +18 -0
  199. package/dist/sst/.sst/platform/src/components/aws/providers/bucket-files.d.ts.map +1 -0
  200. package/dist/sst/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts +13 -0
  201. package/dist/sst/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts.map +1 -0
  202. package/dist/sst/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts +11 -0
  203. package/dist/sst/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts.map +1 -0
  204. package/dist/sst/.sst/platform/src/components/aws/providers/function-environment-update.d.ts +29 -0
  205. package/dist/sst/.sst/platform/src/components/aws/providers/function-environment-update.d.ts.map +1 -0
  206. package/dist/sst/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts +11 -0
  207. package/dist/sst/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts.map +1 -0
  208. package/dist/sst/.sst/platform/src/components/aws/providers/kv-keys.d.ts +11 -0
  209. package/dist/sst/.sst/platform/src/components/aws/providers/kv-keys.d.ts.map +1 -0
  210. package/dist/sst/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts +11 -0
  211. package/dist/sst/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts.map +1 -0
  212. package/dist/sst/.sst/platform/src/components/aws/providers/origin-access-control.d.ts +8 -0
  213. package/dist/sst/.sst/platform/src/components/aws/providers/origin-access-control.d.ts.map +1 -0
  214. package/dist/sst/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts +8 -0
  215. package/dist/sst/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts.map +1 -0
  216. package/dist/sst/.sst/platform/src/components/aws/providers/vector-table.d.ts +12 -0
  217. package/dist/sst/.sst/platform/src/components/aws/providers/vector-table.d.ts.map +1 -0
  218. package/dist/sst/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts +48 -0
  219. package/dist/sst/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts.map +1 -0
  220. package/dist/sst/.sst/platform/src/components/aws/queue.d.ts +485 -0
  221. package/dist/sst/.sst/platform/src/components/aws/queue.d.ts.map +1 -0
  222. package/dist/sst/.sst/platform/src/components/aws/react.d.ts +416 -0
  223. package/dist/sst/.sst/platform/src/components/aws/react.d.ts.map +1 -0
  224. package/dist/sst/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts +53 -0
  225. package/dist/sst/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts.map +1 -0
  226. package/dist/sst/.sst/platform/src/components/aws/realtime.d.ts +232 -0
  227. package/dist/sst/.sst/platform/src/components/aws/realtime.d.ts.map +1 -0
  228. package/dist/sst/.sst/platform/src/components/aws/redis-v1.d.ts +338 -0
  229. package/dist/sst/.sst/platform/src/components/aws/redis-v1.d.ts.map +1 -0
  230. package/dist/sst/.sst/platform/src/components/aws/redis.d.ts +364 -0
  231. package/dist/sst/.sst/platform/src/components/aws/redis.d.ts.map +1 -0
  232. package/dist/sst/.sst/platform/src/components/aws/remix.d.ts +423 -0
  233. package/dist/sst/.sst/platform/src/components/aws/remix.d.ts.map +1 -0
  234. package/dist/sst/.sst/platform/src/components/aws/router-base-route.d.ts +28 -0
  235. package/dist/sst/.sst/platform/src/components/aws/router-base-route.d.ts.map +1 -0
  236. package/dist/sst/.sst/platform/src/components/aws/router-bucket-route.d.ts +29 -0
  237. package/dist/sst/.sst/platform/src/components/aws/router-bucket-route.d.ts.map +1 -0
  238. package/dist/sst/.sst/platform/src/components/aws/router-url-route.d.ts +28 -0
  239. package/dist/sst/.sst/platform/src/components/aws/router-url-route.d.ts.map +1 -0
  240. package/dist/sst/.sst/platform/src/components/aws/router.d.ts +1272 -0
  241. package/dist/sst/.sst/platform/src/components/aws/router.d.ts.map +1 -0
  242. package/dist/sst/.sst/platform/src/components/aws/service-v1.d.ts +78 -0
  243. package/dist/sst/.sst/platform/src/components/aws/service-v1.d.ts.map +1 -0
  244. package/dist/sst/.sst/platform/src/components/aws/service.d.ts +1625 -0
  245. package/dist/sst/.sst/platform/src/components/aws/service.d.ts.map +1 -0
  246. package/dist/sst/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts +53 -0
  247. package/dist/sst/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -0
  248. package/dist/sst/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts +55 -0
  249. package/dist/sst/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts.map +1 -0
  250. package/dist/sst/.sst/platform/src/components/aws/sns-topic.d.ts +389 -0
  251. package/dist/sst/.sst/platform/src/components/aws/sns-topic.d.ts.map +1 -0
  252. package/dist/sst/.sst/platform/src/components/aws/solid-start.d.ts +414 -0
  253. package/dist/sst/.sst/platform/src/components/aws/solid-start.d.ts.map +1 -0
  254. package/dist/sst/.sst/platform/src/components/aws/ssr-site.d.ts +685 -0
  255. package/dist/sst/.sst/platform/src/components/aws/ssr-site.d.ts.map +1 -0
  256. package/dist/sst/.sst/platform/src/components/aws/static-site.d.ts +736 -0
  257. package/dist/sst/.sst/platform/src/components/aws/static-site.d.ts.map +1 -0
  258. package/dist/sst/.sst/platform/src/components/aws/step-functions/choice.d.ts +73 -0
  259. package/dist/sst/.sst/platform/src/components/aws/step-functions/choice.d.ts.map +1 -0
  260. package/dist/sst/.sst/platform/src/components/aws/step-functions/fail.d.ts +63 -0
  261. package/dist/sst/.sst/platform/src/components/aws/step-functions/fail.d.ts.map +1 -0
  262. package/dist/sst/.sst/platform/src/components/aws/step-functions/map.d.ts +236 -0
  263. package/dist/sst/.sst/platform/src/components/aws/step-functions/map.d.ts.map +1 -0
  264. package/dist/sst/.sst/platform/src/components/aws/step-functions/parallel.d.ts +127 -0
  265. package/dist/sst/.sst/platform/src/components/aws/step-functions/parallel.d.ts.map +1 -0
  266. package/dist/sst/.sst/platform/src/components/aws/step-functions/pass.d.ts +39 -0
  267. package/dist/sst/.sst/platform/src/components/aws/step-functions/pass.d.ts.map +1 -0
  268. package/dist/sst/.sst/platform/src/components/aws/step-functions/state.d.ts +231 -0
  269. package/dist/sst/.sst/platform/src/components/aws/step-functions/state.d.ts.map +1 -0
  270. package/dist/sst/.sst/platform/src/components/aws/step-functions/succeed.d.ts +26 -0
  271. package/dist/sst/.sst/platform/src/components/aws/step-functions/succeed.d.ts.map +1 -0
  272. package/dist/sst/.sst/platform/src/components/aws/step-functions/task.d.ts +477 -0
  273. package/dist/sst/.sst/platform/src/components/aws/step-functions/task.d.ts.map +1 -0
  274. package/dist/sst/.sst/platform/src/components/aws/step-functions/wait.d.ts +91 -0
  275. package/dist/sst/.sst/platform/src/components/aws/step-functions/wait.d.ts.map +1 -0
  276. package/dist/sst/.sst/platform/src/components/aws/step-functions.d.ts +473 -0
  277. package/dist/sst/.sst/platform/src/components/aws/step-functions.d.ts.map +1 -0
  278. package/dist/sst/.sst/platform/src/components/aws/svelte-kit.d.ts +417 -0
  279. package/dist/sst/.sst/platform/src/components/aws/svelte-kit.d.ts.map +1 -0
  280. package/dist/sst/.sst/platform/src/components/aws/tan-stack-start.d.ts +354 -0
  281. package/dist/sst/.sst/platform/src/components/aws/tan-stack-start.d.ts.map +1 -0
  282. package/dist/sst/.sst/platform/src/components/aws/task.d.ts +322 -0
  283. package/dist/sst/.sst/platform/src/components/aws/task.d.ts.map +1 -0
  284. package/dist/sst/.sst/platform/src/components/aws/vector.d.ts +150 -0
  285. package/dist/sst/.sst/platform/src/components/aws/vector.d.ts.map +1 -0
  286. package/dist/sst/.sst/platform/src/components/aws/vpc-v1.d.ts +208 -0
  287. package/dist/sst/.sst/platform/src/components/aws/vpc-v1.d.ts.map +1 -0
  288. package/dist/sst/.sst/platform/src/components/aws/vpc.d.ts +444 -0
  289. package/dist/sst/.sst/platform/src/components/aws/vpc.d.ts.map +1 -0
  290. package/dist/sst/.sst/platform/src/components/base/base-site.d.ts +53 -0
  291. package/dist/sst/.sst/platform/src/components/base/base-site.d.ts.map +1 -0
  292. package/dist/sst/.sst/platform/src/components/base/base-ssr-site.d.ts +13 -0
  293. package/dist/sst/.sst/platform/src/components/base/base-ssr-site.d.ts.map +1 -0
  294. package/dist/sst/.sst/platform/src/components/base/base-static-site.d.ts +199 -0
  295. package/dist/sst/.sst/platform/src/components/base/base-static-site.d.ts.map +1 -0
  296. package/dist/sst/.sst/platform/src/components/cloudflare/account-id.d.ts +2 -0
  297. package/dist/sst/.sst/platform/src/components/cloudflare/account-id.d.ts.map +1 -0
  298. package/dist/sst/.sst/platform/src/components/cloudflare/auth.d.ts +22 -0
  299. package/dist/sst/.sst/platform/src/components/cloudflare/auth.d.ts.map +1 -0
  300. package/dist/sst/.sst/platform/src/components/cloudflare/binding.d.ts +69 -0
  301. package/dist/sst/.sst/platform/src/components/cloudflare/binding.d.ts.map +1 -0
  302. package/dist/sst/.sst/platform/src/components/cloudflare/bucket.d.ts +103 -0
  303. package/dist/sst/.sst/platform/src/components/cloudflare/bucket.d.ts.map +1 -0
  304. package/dist/sst/.sst/platform/src/components/cloudflare/cron.d.ts +121 -0
  305. package/dist/sst/.sst/platform/src/components/cloudflare/cron.d.ts.map +1 -0
  306. package/dist/sst/.sst/platform/src/components/cloudflare/d1.d.ts +107 -0
  307. package/dist/sst/.sst/platform/src/components/cloudflare/d1.d.ts.map +1 -0
  308. package/dist/sst/.sst/platform/src/components/cloudflare/dns.d.ts +94 -0
  309. package/dist/sst/.sst/platform/src/components/cloudflare/dns.d.ts.map +1 -0
  310. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/astro.d.ts +186 -0
  311. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/astro.d.ts.map +1 -0
  312. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/index.d.ts +4 -0
  313. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/index.d.ts.map +1 -0
  314. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts +171 -0
  315. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
  316. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts +222 -0
  317. package/dist/sst/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts.map +1 -0
  318. package/dist/sst/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts +19 -0
  319. package/dist/sst/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts.map +1 -0
  320. package/dist/sst/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts +10 -0
  321. package/dist/sst/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts.map +1 -0
  322. package/dist/sst/.sst/platform/src/components/cloudflare/index.d.ts +16 -0
  323. package/dist/sst/.sst/platform/src/components/cloudflare/index.d.ts.map +1 -0
  324. package/dist/sst/.sst/platform/src/components/cloudflare/kv.d.ts +107 -0
  325. package/dist/sst/.sst/platform/src/components/cloudflare/kv.d.ts.map +1 -0
  326. package/dist/sst/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts +20 -0
  327. package/dist/sst/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts.map +1 -0
  328. package/dist/sst/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts +23 -0
  329. package/dist/sst/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts.map +1 -0
  330. package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts +18 -0
  331. package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
  332. package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts +22 -0
  333. package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts.map +1 -0
  334. package/dist/sst/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts +22 -0
  335. package/dist/sst/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts.map +1 -0
  336. package/dist/sst/.sst/platform/src/components/cloudflare/queue.d.ts +60 -0
  337. package/dist/sst/.sst/platform/src/components/cloudflare/queue.d.ts.map +1 -0
  338. package/dist/sst/.sst/platform/src/components/cloudflare/ssr-site.d.ts +51 -0
  339. package/dist/sst/.sst/platform/src/components/cloudflare/ssr-site.d.ts.map +1 -0
  340. package/dist/sst/.sst/platform/src/components/cloudflare/static-site.d.ts +262 -0
  341. package/dist/sst/.sst/platform/src/components/cloudflare/static-site.d.ts.map +1 -0
  342. package/dist/sst/.sst/platform/src/components/cloudflare/worker.d.ts +295 -0
  343. package/dist/sst/.sst/platform/src/components/cloudflare/worker.d.ts.map +1 -0
  344. package/dist/sst/.sst/platform/src/components/component.d.ts +37 -0
  345. package/dist/sst/.sst/platform/src/components/component.d.ts.map +1 -0
  346. package/dist/sst/.sst/platform/src/components/cpu.d.ts +3 -0
  347. package/dist/sst/.sst/platform/src/components/cpu.d.ts.map +1 -0
  348. package/dist/sst/.sst/platform/src/components/dns.d.ts +59 -0
  349. package/dist/sst/.sst/platform/src/components/dns.d.ts.map +1 -0
  350. package/dist/sst/.sst/platform/src/components/duration.d.ts +7 -0
  351. package/dist/sst/.sst/platform/src/components/duration.d.ts.map +1 -0
  352. package/dist/sst/.sst/platform/src/components/error.d.ts +4 -0
  353. package/dist/sst/.sst/platform/src/components/error.d.ts.map +1 -0
  354. package/dist/sst/.sst/platform/src/components/experimental/dev-command.d.ts +99 -0
  355. package/dist/sst/.sst/platform/src/components/experimental/dev-command.d.ts.map +1 -0
  356. package/dist/sst/.sst/platform/src/components/experimental/index.d.ts +2 -0
  357. package/dist/sst/.sst/platform/src/components/experimental/index.d.ts.map +1 -0
  358. package/dist/sst/.sst/platform/src/components/index.d.ts +16 -0
  359. package/dist/sst/.sst/platform/src/components/index.d.ts.map +1 -0
  360. package/dist/sst/.sst/platform/src/components/input.d.ts +3 -0
  361. package/dist/sst/.sst/platform/src/components/input.d.ts.map +1 -0
  362. package/dist/sst/.sst/platform/src/components/link.d.ts +41 -0
  363. package/dist/sst/.sst/platform/src/components/link.d.ts.map +1 -0
  364. package/dist/sst/.sst/platform/src/components/linkable.d.ts +271 -0
  365. package/dist/sst/.sst/platform/src/components/linkable.d.ts.map +1 -0
  366. package/dist/sst/.sst/platform/src/components/naming.d.ts +7 -0
  367. package/dist/sst/.sst/platform/src/components/naming.d.ts.map +1 -0
  368. package/dist/sst/.sst/platform/src/components/path.d.ts +2 -0
  369. package/dist/sst/.sst/platform/src/components/path.d.ts.map +1 -0
  370. package/dist/sst/.sst/platform/src/components/rpc/rpc.d.ts +19 -0
  371. package/dist/sst/.sst/platform/src/components/rpc/rpc.d.ts.map +1 -0
  372. package/dist/sst/.sst/platform/src/components/secret.d.ts +125 -0
  373. package/dist/sst/.sst/platform/src/components/secret.d.ts.map +1 -0
  374. package/dist/sst/.sst/platform/src/components/size.d.ts +5 -0
  375. package/dist/sst/.sst/platform/src/components/size.d.ts.map +1 -0
  376. package/dist/sst/.sst/platform/src/components/vercel/account-id.d.ts +2 -0
  377. package/dist/sst/.sst/platform/src/components/vercel/account-id.d.ts.map +1 -0
  378. package/dist/sst/.sst/platform/src/components/vercel/dns.d.ts +73 -0
  379. package/dist/sst/.sst/platform/src/components/vercel/dns.d.ts.map +1 -0
  380. package/dist/sst/.sst/platform/src/components/vercel/index.d.ts +3 -0
  381. package/dist/sst/.sst/platform/src/components/vercel/index.d.ts.map +1 -0
  382. package/dist/sst/.sst/platform/src/components/vercel/providers/dns-record.d.ts +14 -0
  383. package/dist/sst/.sst/platform/src/components/vercel/providers/dns-record.d.ts.map +1 -0
  384. package/dist/sst/.sst/platform/src/config.d.ts +1258 -0
  385. package/dist/sst/.sst/platform/src/config.d.ts.map +1 -0
  386. package/dist/sst/.sst/platform/src/util/compare-semver.d.ts +4 -0
  387. package/dist/sst/.sst/platform/src/util/compare-semver.d.ts.map +1 -0
  388. package/dist/sst/.sst/platform/src/util/fs.d.ts +5 -0
  389. package/dist/sst/.sst/platform/src/util/fs.d.ts.map +1 -0
  390. package/dist/sst/.sst/platform/src/util/lazy.d.ts +2 -0
  391. package/dist/sst/.sst/platform/src/util/lazy.d.ts.map +1 -0
  392. package/dist/sst/.sst/platform/src/util/semaphore.d.ts +9 -0
  393. package/dist/sst/.sst/platform/src/util/semaphore.d.ts.map +1 -0
  394. package/dist/sst/.sst/platform/src/util/warn.d.ts +2 -0
  395. package/dist/sst/.sst/platform/src/util/warn.d.ts.map +1 -0
  396. package/dist/sst/components/dashboard.d.ts +2 -0
  397. package/dist/sst/components/dashboard.d.ts.map +1 -0
  398. package/dist/sst/components/monorise-core.d.ts +18 -0
  399. package/dist/sst/components/monorise-core.d.ts.map +1 -0
  400. package/dist/sst/components/q-function.d.ts +17 -0
  401. package/dist/sst/components/q-function.d.ts.map +1 -0
  402. package/dist/sst/components/single-table.d.ts +14 -0
  403. package/dist/sst/components/single-table.d.ts.map +1 -0
  404. package/dist/sst/constants/event.d.ts +73 -0
  405. package/dist/sst/constants/event.d.ts.map +1 -0
  406. package/dist/sst/constants/table.d.ts +3 -0
  407. package/dist/sst/constants/table.d.ts.map +1 -0
  408. package/dist/sst/index.d.ts +11 -0
  409. package/dist/sst/index.d.ts.map +1 -0
  410. package/dist/sst/index.js +609 -0
  411. package/dist/sst/index.js.map +1 -0
  412. package/dist/sst/sst.config.d.ts +3 -0
  413. package/dist/sst/sst.config.d.ts.map +1 -0
  414. package/dist/sst/tsup.config.d.ts +3 -0
  415. package/dist/sst/tsup.config.d.ts.map +1 -0
  416. package/package.json +83 -0
@@ -0,0 +1,1272 @@
1
+ import { ComponentResourceOptions, Output } from "@pulumi/pulumi";
2
+ import { Component, Transform } from "../component";
3
+ import { Link } from "../link";
4
+ import type { Input } from "../input";
5
+ import { Cdn, CdnArgs } from "./cdn";
6
+ import { cloudfront } from "@pulumi/aws";
7
+ import { Bucket } from "./bucket";
8
+ import { DurationSeconds } from "../duration";
9
+ interface InlineUrlRouteArgs extends InlineBaseRouteArgs {
10
+ /**
11
+ * The destination URL.
12
+ *
13
+ * @example
14
+ *
15
+ * ```js
16
+ * {
17
+ * routes: {
18
+ * "/api/*": {
19
+ * url: "https://example.com"
20
+ * }
21
+ * }
22
+ * }
23
+ * ```
24
+ */
25
+ url: Input<string>;
26
+ /**
27
+ * Rewrite the request path.
28
+ *
29
+ * @example
30
+ *
31
+ * By default, if the route path is `/api/*` and a request comes in for `/api/users/profile`,
32
+ * the request path the destination sees is `/api/users/profile`.
33
+ *
34
+ * If you want to serve the route from the root, you can rewrite the request path to
35
+ * `/users/profile`.
36
+ *
37
+ * ```js
38
+ * {
39
+ * routes: {
40
+ * "/api/*": {
41
+ * url: "https://api.example.com",
42
+ * rewrite: {
43
+ * regex: "^/api/(.*)$",
44
+ * to: "/$1"
45
+ * }
46
+ * }
47
+ * }
48
+ * }
49
+ * ```
50
+ */
51
+ rewrite?: Input<{
52
+ /**
53
+ * The regex to match the request path.
54
+ */
55
+ regex: Input<string>;
56
+ /**
57
+ * The replacement for the matched path.
58
+ */
59
+ to: Input<string>;
60
+ }>;
61
+ }
62
+ interface InlineRouterBucketRouteArgs extends InlineBaseRouteArgs {
63
+ /**
64
+ * A bucket to route to.
65
+ *
66
+ * :::note
67
+ * You need to let CloudFront `access` the bucket.
68
+ * :::
69
+ *
70
+ * @example
71
+ *
72
+ * For example, let's say you have a bucket that gives CloudFront `access`.
73
+ *
74
+ * ```ts title="sst.config.ts" {2}
75
+ * const myBucket = new sst.aws.Bucket("MyBucket", {
76
+ * access: "cloudfront"
77
+ * });
78
+ * ```
79
+ *
80
+ * You can then this directly as the destination for the route.
81
+ *
82
+ * ```js
83
+ * {
84
+ * routes: {
85
+ * "/files/*": {
86
+ * bucket: myBucket
87
+ * }
88
+ * }
89
+ * }
90
+ * ```
91
+ *
92
+ * Or if you have an existing bucket, you can pass in its regional domain.
93
+ *
94
+ * ```js
95
+ * {
96
+ * routes: {
97
+ * "/files/*": {
98
+ * bucket: "my-bucket.s3.us-east-1.amazonaws.com"
99
+ * }
100
+ * }
101
+ * }
102
+ * ```
103
+ */
104
+ bucket?: Input<Bucket | string>;
105
+ /**
106
+ * Rewrite the request path.
107
+ *
108
+ * @example
109
+ *
110
+ * By default, if the route path is `/files/*` and a request comes in for `/files/logo.png`,
111
+ * the request path the destination sees is `/files/logo.png`. In the case of a bucket route,
112
+ * the file `logo.png` is served from the `files` directory in the bucket.
113
+ *
114
+ * If you want to serve the file from the root of the bucket, you can rewrite
115
+ * the request path to `/logo.png`.
116
+ *
117
+ * ```js
118
+ * {
119
+ * routes: {
120
+ * "/files/*": {
121
+ * bucket: myBucket,
122
+ * rewrite: {
123
+ * regex: "^/files/(.*)$",
124
+ * to: "/$1"
125
+ * }
126
+ * }
127
+ * }
128
+ * }
129
+ * ```
130
+ */
131
+ rewrite?: Input<{
132
+ /**
133
+ * The regex to match the request path.
134
+ */
135
+ regex: Input<string>;
136
+ /**
137
+ * The replacement for the matched path.
138
+ */
139
+ to: Input<string>;
140
+ }>;
141
+ }
142
+ interface InlineBaseRouteArgs {
143
+ /**
144
+ * The cache policy to use for the route.
145
+ *
146
+ * @default CloudFront's managed CachingOptimized policy
147
+ * @example
148
+ * ```js
149
+ * {
150
+ * routes: {
151
+ * "/files/*": {
152
+ * url: "https://example.com"
153
+ * cachePolicy: "658327ea-f89d-4fab-a63d-7e88639e58f6"
154
+ * }
155
+ * }
156
+ * }
157
+ * ```
158
+ */
159
+ cachePolicy?: Input<string>;
160
+ /**
161
+ * Configure CloudFront Functions to customize the behavior of HTTP requests and responses at the edge.
162
+ */
163
+ edge?: {
164
+ /**
165
+ * Configure the viewer request function.
166
+ *
167
+ * The viewer request function can be used to modify incoming requests before they
168
+ * reach your origin server. For example, you can redirect users, rewrite URLs,
169
+ * or add headers.
170
+ */
171
+ viewerRequest?: Input<{
172
+ /**
173
+ * The code to inject into the viewer request function.
174
+ *
175
+ * By default, a viewer request function is created to add the `x-forwarded-host`
176
+ * header. The given code will be injected at the end of this function.
177
+ *
178
+ * ```js
179
+ * async function handler(event) {
180
+ * // Default behavior code
181
+ *
182
+ * // User injected code
183
+ *
184
+ * return event.request;
185
+ * }
186
+ * ```
187
+ *
188
+ * @example
189
+ * To add a custom header to all requests.
190
+ *
191
+ * ```js
192
+ * {
193
+ * routes: {
194
+ * "/api/*": {
195
+ * url: "https://example.com"
196
+ * edge: {
197
+ * viewerRequest: {
198
+ * injection: `event.request.headers["x-foo"] = { value: "bar" };`
199
+ * }
200
+ * }
201
+ * }
202
+ * }
203
+ * }
204
+ * ```
205
+ */
206
+ injection: Input<string>;
207
+ /**
208
+ * The KeyValueStore to associate with the viewer request function.
209
+ *
210
+ * @example
211
+ * ```js
212
+ * {
213
+ * routes: {
214
+ * "/api/*": {
215
+ * url: "https://example.com"
216
+ * edge: {
217
+ * viewerRequest: {
218
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
219
+ * }
220
+ * }
221
+ * }
222
+ * }
223
+ * }
224
+ * ```
225
+ */
226
+ kvStore?: Input<string>;
227
+ /**
228
+ * @deprecated Use `kvStore` instead because CloudFront Functions only support one KeyValueStore.
229
+ */
230
+ kvStores?: Input<Input<string>[]>;
231
+ }>;
232
+ /**
233
+ * Configure the viewer response function.
234
+ *
235
+ * The viewer response function can be used to modify outgoing responses before
236
+ * they are sent to the client. For example, you can add security headers or change
237
+ * the response status code.
238
+ *
239
+ * By default, no viewer response function is set. A new function will be created
240
+ * with the provided code.
241
+ *
242
+ * @example
243
+ * Add a custom header to all responses
244
+ * ```js
245
+ * {
246
+ * routes: {
247
+ * "/api/*": {
248
+ * url: "https://example.com"
249
+ * edge: {
250
+ * viewerResponse: {
251
+ * injection: `event.response.headers["x-foo"] = { value: "bar" };`
252
+ * }
253
+ * }
254
+ * }
255
+ * }
256
+ * }
257
+ * ```
258
+ */
259
+ viewerResponse?: Input<{
260
+ /**
261
+ * The code to inject into the viewer response function.
262
+ *
263
+ * By default, no viewer response function is set. A new function will be created with
264
+ * the provided code.
265
+ *
266
+ * ```js
267
+ * async function handler(event) {
268
+ * // User injected code
269
+ *
270
+ * return event.response;
271
+ * }
272
+ * ```
273
+ *
274
+ * @example
275
+ * To add a custom header to all responses.
276
+ *
277
+ * ```js
278
+ * {
279
+ * routes: {
280
+ * "/api/*": {
281
+ * url: "https://example.com"
282
+ * edge: {
283
+ * viewerResponse: {
284
+ * injection: `event.response.headers["x-foo"] = { value: "bar" };`
285
+ * }
286
+ * }
287
+ * }
288
+ * }
289
+ * }
290
+ * ```
291
+ */
292
+ injection: Input<string>;
293
+ /**
294
+ * The KeyValueStore to associate with the viewer response function.
295
+ *
296
+ * @example
297
+ * ```js
298
+ * {
299
+ * routes: {
300
+ * "/api/*": {
301
+ * url: "https://example.com"
302
+ * edge: {
303
+ * viewerResponse: {
304
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
305
+ * }
306
+ * }
307
+ * }
308
+ * }
309
+ * }
310
+ * ```
311
+ */
312
+ kvStore?: Input<string>;
313
+ /**
314
+ * @deprecated Use `kvStore` instead because CloudFront Functions only support one KeyValueStore.
315
+ */
316
+ kvStores?: Input<Input<string>[]>;
317
+ }>;
318
+ };
319
+ }
320
+ interface RouteArgs {
321
+ /**
322
+ * The number of times that CloudFront attempts to connect to the origin. Must be
323
+ * between 1 and 3.
324
+ * @default 3
325
+ * @example
326
+ * ```js
327
+ * {
328
+ * connectionAttempts: 1
329
+ * }
330
+ * ```
331
+ */
332
+ connectionAttempts?: Input<number>;
333
+ /**
334
+ * The number of seconds that CloudFront waits before timing out and closing the
335
+ * connection to the origin. Must be between 1 and 10 seconds.
336
+ * @default `"10 seconds"`
337
+ * @example
338
+ * ```js
339
+ * {
340
+ * connectionTimeout: "3 seconds"
341
+ * }
342
+ * ```
343
+ */
344
+ connectionTimeout?: Input<DurationSeconds>;
345
+ }
346
+ export interface RouterUrlRouteArgs extends RouteArgs {
347
+ /**
348
+ * Rewrite the request path.
349
+ *
350
+ * @example
351
+ *
352
+ * If the route path is `/api/*` and a request comes in for `/api/users/profile`,
353
+ * the request path the destination sees is `/api/users/profile`.
354
+ *
355
+ * If you want to serve the route from the root, you can rewrite the request
356
+ * path to `/users/profile`.
357
+ *
358
+ * ```js
359
+ * {
360
+ * rewrite: {
361
+ * regex: "^/api/(.*)$",
362
+ * to: "/$1"
363
+ * }
364
+ * }
365
+ * ```
366
+ */
367
+ rewrite?: Input<{
368
+ /**
369
+ * The regex to match the request path.
370
+ */
371
+ regex: Input<string>;
372
+ /**
373
+ * The replacement for the matched path.
374
+ */
375
+ to: Input<string>;
376
+ }>;
377
+ /**
378
+ * The number of seconds that CloudFront waits for a response after routing a
379
+ * request to the destination. Must be between 1 and 60 seconds.
380
+ *
381
+ * When compared to the `connectionTimeout`, this is the total time for the
382
+ * request.
383
+ *
384
+ * @default `"20 seconds"`
385
+ * @example
386
+ * ```js
387
+ * {
388
+ * readTimeout: "60 seconds"
389
+ * }
390
+ * ```
391
+ */
392
+ readTimeout?: Input<DurationSeconds>;
393
+ /**
394
+ * The number of seconds that CloudFront should try to maintain the connection
395
+ * to the destination after receiving the last packet of the response. Must be
396
+ * between 1 and 60 seconds
397
+ * @default `"5 seconds"`
398
+ * @example
399
+ * ```js
400
+ * {
401
+ * keepAliveTimeout: "10 seconds"
402
+ * }
403
+ * ```
404
+ */
405
+ keepAliveTimeout?: Input<DurationSeconds>;
406
+ }
407
+ export interface RouterBucketRouteArgs extends RouteArgs {
408
+ /**
409
+ * Rewrite the request path.
410
+ *
411
+ * @example
412
+ *
413
+ * If the route path is `/files/*` and a request comes in for `/files/logo.png`,
414
+ * the request path the destination sees is `/files/logo.png`.
415
+ *
416
+ * If you want to serve the file from the root of the bucket, you can rewrite
417
+ * the request path to `/logo.png`.
418
+ *
419
+ * ```js
420
+ * {
421
+ * rewrite: {
422
+ * regex: "^/files/(.*)$",
423
+ * to: "/$1"
424
+ * }
425
+ * }
426
+ * ```
427
+ */
428
+ rewrite?: Input<{
429
+ /**
430
+ * The regex to match the request path.
431
+ */
432
+ regex: Input<string>;
433
+ /**
434
+ * The replacement for the matched path.
435
+ */
436
+ to: Input<string>;
437
+ }>;
438
+ }
439
+ export interface RouterArgs {
440
+ /**
441
+ * Set a custom domain for your Router.
442
+ *
443
+ * Automatically manages domains hosted on AWS Route 53, Cloudflare, and Vercel. For other
444
+ * providers, you'll need to pass in a `cert` that validates domain ownership and add the
445
+ * DNS records.
446
+ *
447
+ * :::tip
448
+ * Built-in support for AWS Route 53, Cloudflare, and Vercel. And manual setup for other
449
+ * providers.
450
+ * :::
451
+ *
452
+ * @example
453
+ *
454
+ * By default this assumes the domain is hosted on Route 53.
455
+ *
456
+ * ```js
457
+ * {
458
+ * domain: "example.com"
459
+ * }
460
+ * ```
461
+ *
462
+ * For domains hosted on Cloudflare.
463
+ *
464
+ * ```js
465
+ * {
466
+ * domain: {
467
+ * name: "example.com",
468
+ * dns: sst.cloudflare.dns()
469
+ * }
470
+ * }
471
+ * ```
472
+ *
473
+ * Specify a `www.` version of the custom domain.
474
+ *
475
+ * ```js
476
+ * {
477
+ * domain: {
478
+ * name: "domain.com",
479
+ * redirects: ["www.domain.com"]
480
+ * }
481
+ * }
482
+ * ```
483
+ */
484
+ domain?: CdnArgs["domain"];
485
+ /**
486
+ * A map of routes to their destinations.
487
+ *
488
+ * @deprecated Use the `route` and `routeBucket` functions instead. These
489
+ * functions provide a more flexible API for routing to URLs and buckets. They
490
+ * also allow routing based on both domain and path patterns.
491
+ *
492
+ * The _key_ is the route path and the _value_ can be:
493
+ *
494
+ * - The destination URL as a string
495
+ * - Or, an object with
496
+ * - Args for a URL route
497
+ * - Args for a bucket route
498
+ *
499
+ * :::note
500
+ * All routes need to start with `/`.
501
+ * :::
502
+ *
503
+ * For example, you can set the destination as a URL.
504
+ *
505
+ * ```ts
506
+ * {
507
+ * routes: {
508
+ * "/*": "https://example.com"
509
+ * }
510
+ * }
511
+ * ```
512
+ *
513
+ * Or, you can route to a bucket.
514
+ *
515
+ * ```ts
516
+ * {
517
+ * routes: {
518
+ * "/files/*": {
519
+ * bucket: myBucket
520
+ * }
521
+ * }
522
+ * }
523
+ * ```
524
+ *
525
+ * When router receives a request, the requested path is compared with path patterns
526
+ * in the order they are listed. The first match determines which URL the
527
+ * request is routed to.
528
+ *
529
+ * :::tip[Default Route]
530
+ * The `/*` route is a default or catch-all route.
531
+ * :::
532
+ *
533
+ * The `/*` route is a _default_ route, meaning that if no routes match, the `/*` route will be used. It does not matter where the `/*` route is listed in the routes object.
534
+ *
535
+ * :::note
536
+ * If you don't have a `/*` route, you'll get a 404 error for any requests that don't match a route.
537
+ * :::
538
+ *
539
+ * Suppose you have the following three routes.
540
+ *
541
+ * ```js
542
+ * {
543
+ * routes: {
544
+ * "/api/*.json": "https://example1.com",
545
+ * "/api/*": "https://example2.com",
546
+ * "/*.xml": "https://example3.com",
547
+ * }
548
+ * }
549
+ * ```
550
+ *
551
+ * A request to `/api/sample.xml` will match `/api/*` first and route to it; even though it matches `/*.xml`.
552
+ *
553
+ * However for this case, a request to `/api/users` will route to `/api/*` even though it comes after `/*`. This is because the `/*` route is the default route.
554
+ *
555
+ * ```js
556
+ * {
557
+ * routes: {
558
+ * "/*": "myapp.com",
559
+ * "/api/*": myFunction.url
560
+ * }
561
+ * }
562
+ * ```
563
+ *
564
+ * You can also customize the route behavior with injecting some code into the CloudFront
565
+ * Functions. To do so, pass in an object, with the destination as the `url`.
566
+ *
567
+ * ```ts
568
+ * {
569
+ * routes: {
570
+ * "/*": {
571
+ * url: "https://example.com",
572
+ * edge: {
573
+ * viewerRequest: {
574
+ * injection: `event.request.headers["x-foo"] = { value: "bar" };`
575
+ * }
576
+ * }
577
+ * }
578
+ * }
579
+ * }
580
+ * ```
581
+ *
582
+ * You can also `rewrite` the request path.
583
+ *
584
+ * ```ts
585
+ * {
586
+ * routes: {
587
+ * "/files/*": {
588
+ * bucket: myBucket,
589
+ * rewrite: {
590
+ * regex: "^/files/(.*)$",
591
+ * to: "/$1"
592
+ * }
593
+ * }
594
+ * }
595
+ * }
596
+ * ```
597
+ */
598
+ routes?: Input<Record<string, Input<string | InlineUrlRouteArgs | InlineRouterBucketRouteArgs>>>;
599
+ /**
600
+ * Configure CloudFront Functions to customize the behavior of HTTP requests and responses at the edge.
601
+ */
602
+ edge?: {
603
+ /**
604
+ * Configure the viewer request function.
605
+ *
606
+ * The viewer request function can be used to modify incoming requests before they
607
+ * reach your origin server. For example, you can redirect users, rewrite URLs,
608
+ * or add headers.
609
+ */
610
+ viewerRequest?: Input<{
611
+ /**
612
+ * The code to inject into the viewer request function.
613
+ *
614
+ * By default, a viewer request function is created to:
615
+ * - Disable CloudFront default URL if custom domain is set.
616
+ * - Add the `x-forwarded-host` header.
617
+ * - Route requests to the corresponding target based on the domain and request path.
618
+ *
619
+ * The given code will be injected at the beginning of this function.
620
+ *
621
+ * ```js
622
+ * async function handler(event) {
623
+ * // User injected code
624
+ *
625
+ * // Default behavior code
626
+ *
627
+ * return event.request;
628
+ * }
629
+ * ```
630
+ *
631
+ * @example
632
+ * To add a custom header to all requests.
633
+ *
634
+ * ```js
635
+ * {
636
+ * edge: {
637
+ * viewerRequest: {
638
+ * injection: `event.request.headers["x-foo"] = { value: "bar" };`
639
+ * }
640
+ * }
641
+ * }
642
+ * ```
643
+ */
644
+ injection: Input<string>;
645
+ /**
646
+ * The KeyValueStore to associate with the viewer request function.
647
+ *
648
+ * @example
649
+ * ```js
650
+ * {
651
+ * edge: {
652
+ * viewerRequest: {
653
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
654
+ * }
655
+ * }
656
+ * }
657
+ * ```
658
+ */
659
+ kvStore?: Input<string>;
660
+ }>;
661
+ /**
662
+ * Configure the viewer response function.
663
+ *
664
+ * The viewer response function can be used to modify outgoing responses before
665
+ * they are sent to the client. For example, you can add security headers or change
666
+ * the response status code.
667
+ *
668
+ * By default, no viewer response function is set. A new function will be created
669
+ * with the provided code.
670
+ */
671
+ viewerResponse?: Input<{
672
+ /**
673
+ * The code to inject into the viewer response function.
674
+ *
675
+ * ```js
676
+ * async function handler(event) {
677
+ * // User injected code
678
+ *
679
+ * return event.response;
680
+ * }
681
+ * ```
682
+ *
683
+ * @example
684
+ * To add a custom header to all responses.
685
+ *
686
+ * ```js
687
+ * {
688
+ * edge: {
689
+ * viewerResponse: {
690
+ * injection: `event.response.headers["x-foo"] = { value: "bar" };`
691
+ * }
692
+ * }
693
+ * }
694
+ * ```
695
+ */
696
+ injection: Input<string>;
697
+ /**
698
+ * The KeyValueStore to associate with the viewer response function.
699
+ *
700
+ * @example
701
+ * ```js
702
+ * {
703
+ * edge: {
704
+ * viewerResponse: {
705
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
706
+ * }
707
+ * }
708
+ * }
709
+ * ```
710
+ */
711
+ kvStore?: Input<string>;
712
+ }>;
713
+ };
714
+ /**
715
+ * Configure how the CloudFront cache invalidations are handled.
716
+ * :::tip
717
+ * You get 1000 free invalidations per month. After that you pay $0.005 per invalidation path. [Read more here](https://aws.amazon.com/cloudfront/pricing/).
718
+ * :::
719
+ * @default Invalidation is turned off
720
+ * @example
721
+ * Setting this to `true` will invalidate all paths. It's equivalent
722
+ * to passing in `{ paths: ["/*"] }`.
723
+ *
724
+ * ```js
725
+ * {
726
+ * invalidation: true
727
+ * }
728
+ * ```
729
+ */
730
+ invalidation?: Input<boolean | {
731
+ /**
732
+ * Configure if `sst deploy` should wait for the CloudFront cache invalidation to finish.
733
+ *
734
+ * :::tip
735
+ * For non-prod environments it might make sense to pass in `false`.
736
+ * :::
737
+ *
738
+ * Waiting for this process to finish ensures that new content will be available after the deploy finishes. However, this process can sometimes take more than 5 mins.
739
+ * @default `false`
740
+ * @example
741
+ * ```js
742
+ * {
743
+ * invalidation: {
744
+ * wait: true
745
+ * }
746
+ * }
747
+ * ```
748
+ */
749
+ wait?: Input<boolean>;
750
+ /**
751
+ * A token used to determine if the cache should be invalidated. If the
752
+ * token is the same as the previous deployment, the cache will not be invalidated.
753
+ *
754
+ * You can set this to a hash that's computed on every deploy. So if the hash
755
+ * changes, the cache will be invalidated.
756
+ *
757
+ * @default A unique value is auto-generated on each deploy
758
+ * @example
759
+ * ```js
760
+ * {
761
+ * invalidation: {
762
+ * token: "foo123"
763
+ * }
764
+ * }
765
+ * ```
766
+ */
767
+ token?: Input<string>;
768
+ /**
769
+ * Specify an array of glob pattern of paths to invalidate.
770
+ *
771
+ * :::note
772
+ * Each glob pattern counts as a single invalidation. Whereas, invalidating
773
+ * `/*` counts as a single invalidation.
774
+ * :::
775
+ * @default `["/*"]`
776
+ * @example
777
+ * Invalidate the `index.html` and all files under the `products/` route.
778
+ * ```js
779
+ * {
780
+ * invalidation: {
781
+ * paths: ["/index.html", "/products/*"]
782
+ * }
783
+ * }
784
+ * ```
785
+ * This counts as two invalidations.
786
+ */
787
+ paths?: Input<Input<string>[]>;
788
+ }>;
789
+ /**
790
+ * [Transform](/docs/components#transform) how this component creates its underlying
791
+ * resources.
792
+ */
793
+ transform?: {
794
+ /**
795
+ * Transform the Cache Policy that's attached to each CloudFront behavior.
796
+ */
797
+ cachePolicy?: Transform<cloudfront.CachePolicyArgs>;
798
+ /**
799
+ * Transform the CloudFront CDN resource.
800
+ */
801
+ cdn?: Transform<CdnArgs>;
802
+ };
803
+ /**
804
+ * @internal
805
+ */
806
+ _skipHint?: boolean;
807
+ }
808
+ /**
809
+ * The `Router` component lets you use a CloudFront distribution to direct
810
+ * requests to various parts of your application like:
811
+ *
812
+ * - A URL
813
+ * - A function
814
+ * - A frontend
815
+ * - An S3 bucket
816
+ *
817
+ * @example
818
+ *
819
+ * #### Minimal example
820
+ *
821
+ * ```ts title="sst.config.ts"
822
+ * new sst.aws.Router("MyRouter");
823
+ * ```
824
+ *
825
+ * #### Add a custom domain
826
+ *
827
+ * ```ts {2} title="sst.config.ts"
828
+ * new sst.aws.Router("MyRouter", {
829
+ * domain: "myapp.com"
830
+ * });
831
+ * ```
832
+ *
833
+ * #### Sharing the router across stages
834
+ *
835
+ * ```ts title="sst.config.ts"
836
+ * const router = $app.stage === "production"
837
+ * ? new sst.aws.Router("MyRouter", {
838
+ * domain: {
839
+ * name: "example.com",
840
+ * aliases: ["*.example.com"]
841
+ * }
842
+ * })
843
+ * : sst.aws.Router.get("MyRouter", "E1XWRGCYGTFB7Z");
844
+ * ```
845
+ *
846
+ * #### Route to a URL
847
+ *
848
+ * ```ts title="sst.config.ts" {3}
849
+ * const router = new sst.aws.Router("MyRouter");
850
+ *
851
+ * router.route("/", "https://some-external-service.com");
852
+ * ```
853
+ *
854
+ * #### Route to an S3 bucket
855
+ *
856
+ * ```ts title="sst.config.ts" {2,6}
857
+ * const myBucket = new sst.aws.Bucket("MyBucket", {
858
+ * access: "cloudfront"
859
+ * });
860
+ *
861
+ * const router = new sst.aws.Router("MyRouter");
862
+ * router.routeBucket("/files", myBucket);
863
+ * ```
864
+ *
865
+ * You need to allow CloudFront to access the bucket by setting the `access` prop
866
+ * on the bucket.
867
+ *
868
+ * #### Route to a function
869
+ *
870
+ * ```ts title="sst.config.ts" {8-11}
871
+ * const router = new sst.aws.Router("MyRouter", {
872
+ * domain: "example.com"
873
+ * });
874
+ *
875
+ * const myFunction = new sst.aws.Function("MyFunction", {
876
+ * handler: "src/api.handler",
877
+ * url: {
878
+ * router: {
879
+ * instance: router,
880
+ * path: "/api"
881
+ * }
882
+ * }
883
+ * });
884
+ * ```
885
+ *
886
+ * Setting the route through the function, instead of `router.route()` makes
887
+ * it so that `myFunction.url` gives you the URL based on the Router domain.
888
+ *
889
+ * #### Route to a frontend
890
+ *
891
+ * ```ts title="sst.config.ts" {4-6}
892
+ * const router = new sst.aws.Router("MyRouter");
893
+ *
894
+ * const mySite = new sst.aws.Nextjs("MyWeb", {
895
+ * router: {
896
+ * instance: router
897
+ * }
898
+ * });
899
+ * ```
900
+ *
901
+ * Setting the route through the site, instead of `router.route()` makes
902
+ * it so that `mySite.url` gives you the URL based on the Router domain.
903
+ *
904
+ * #### Route to a frontend on a path
905
+ *
906
+ * ```ts title="sst.config.ts" {4-7}
907
+ * const router = new sst.aws.Router("MyRouter");
908
+ *
909
+ * new sst.aws.Nextjs("MyWeb", {
910
+ * router: {
911
+ * instance: router,
912
+ * path: "/docs"
913
+ * }
914
+ * });
915
+ * ```
916
+ *
917
+ * If you are routing to a path, you'll need to configure the base path in your
918
+ * frontend app as well. [Learn more](/docs/component/aws/nextjs/#router).
919
+ *
920
+ * #### Route to a frontend on a subdomain
921
+ *
922
+ * ```ts title="sst.config.ts" {4,9-12}
923
+ * const router = new sst.aws.Router("MyRouter", {
924
+ * domain: {
925
+ * name: "example.com",
926
+ * aliases: ["*.example.com"]
927
+ * }
928
+ * });
929
+ *
930
+ * new sst.aws.Nextjs("MyWeb", {
931
+ * router: {
932
+ * instance: router,
933
+ * domain: "docs.example.com"
934
+ * }
935
+ * });
936
+ * ```
937
+ *
938
+ * We configure `*.example.com` as an alias so that we can route to a subdomain.
939
+ *
940
+ * #### How it works
941
+ *
942
+ * This uses a CloudFront KeyValueStore to store the routing data and a CloudFront
943
+ * function to route the request. As routes are added, the store is updated.
944
+ *
945
+ * So when a request comes in, it does a lookup in the store and dynamically sets
946
+ * the origin based on the routing data. For frontends, that have their server
947
+ * functions deployed to multiple `regions`, it routes to the closest region based
948
+ * on the user's location.
949
+ *
950
+ * You might notice a _placeholder.sst.dev_ behavior in CloudFront. This is not
951
+ * used and is only there because CloudFront requires a default behavior.
952
+ *
953
+ * #### Limits
954
+ *
955
+ * There are some limits on this setup but it's managed by SST.
956
+ *
957
+ * - The CloudFront function can be a maximum of 10KB in size. But because all
958
+ * the route data is stored in the KeyValueStore, the function can be kept small.
959
+ * - Each value in the KeyValueStore needs to be less than 1KB. This component
960
+ * splits the routes into multiple values to keep it under the limit.
961
+ * - The KeyValueStore can be a maximum of 5MB. This is fairly large. But to
962
+ * handle sites that have a lot of files, only top-level assets get individual
963
+ * entries.
964
+ */
965
+ export declare class Router extends Component implements Link.Linkable {
966
+ private constructorName;
967
+ private constructorOpts;
968
+ private cdn;
969
+ private kvStoreArn?;
970
+ private kvNamespace?;
971
+ private hasInlineRoutes;
972
+ constructor(name: string, args?: RouterArgs, opts?: ComponentResourceOptions);
973
+ /**
974
+ * The ID of the Router distribution.
975
+ */
976
+ get distributionID(): Output<string>;
977
+ /**
978
+ * The URL of the Router.
979
+ *
980
+ * If the `domain` is set, this is the URL with the custom domain.
981
+ * Otherwise, it's the auto-generated CloudFront URL.
982
+ */
983
+ get url(): Output<string>;
984
+ /** @internal */
985
+ get _kvStoreArn(): Output<string> | undefined;
986
+ /** @internal */
987
+ get _kvNamespace(): Output<string> | undefined;
988
+ /** @internal */
989
+ get _hasInlineRoutes(): $util.OutputInstance<boolean>;
990
+ /**
991
+ * The underlying [resources](/docs/components/#nodes) this component creates.
992
+ */
993
+ get nodes(): {
994
+ /**
995
+ * The Amazon CloudFront CDN resource.
996
+ */
997
+ cdn: Output<Cdn>;
998
+ };
999
+ /**
1000
+ * Add a route to a destination URL.
1001
+ *
1002
+ * @param pattern The path prefix to match for this route.
1003
+ * @param url The destination URL to route matching requests to.
1004
+ * @param args Configure the route.
1005
+ *
1006
+ * @example
1007
+ *
1008
+ * You can match a route based on:
1009
+ *
1010
+ * - A path prefix like `/api`
1011
+ * - A domain pattern like `api.example.com`
1012
+ * - A combined pattern like `dev.example.com/api`
1013
+ *
1014
+ * For example, to match a path prefix.
1015
+ *
1016
+ * ```ts title="sst.config.ts"
1017
+ * router.route("/api", "https://api.example.com");
1018
+ * ```
1019
+ *
1020
+ * Or match a domain.
1021
+ *
1022
+ * ```ts title="sst.config.ts"
1023
+ * router.route("api.myapp.com/", "https://api.example.com");
1024
+ * ```
1025
+ *
1026
+ * Or a combined pattern.
1027
+ *
1028
+ * ```ts title="sst.config.ts"
1029
+ * router.route("dev.myapp.com/api", "https://api.example.com");
1030
+ * ```
1031
+ *
1032
+ * You can also rewrite the request path.
1033
+ *
1034
+ * ```ts title="sst.config.ts"
1035
+ * router.route("/api", "https://api.example.com", {
1036
+ * rewrite: {
1037
+ * regex: "^/api/(.*)$",
1038
+ * to: "/$1"
1039
+ * }
1040
+ * });
1041
+ * ```
1042
+ *
1043
+ * Here something like `/api/users/profile` will be routed to
1044
+ * `https://api.example.com/users/profile`.
1045
+ */
1046
+ route(pattern: Input<string>, url: Input<string>, args?: Input<RouterUrlRouteArgs>): void;
1047
+ /**
1048
+ * Add a route to an S3 bucket.
1049
+ *
1050
+ * @param pattern The path prefix to match for this route.
1051
+ * @param bucket The S3 bucket to route matching requests to.
1052
+ * @param args Configure the route.
1053
+ *
1054
+ * @example
1055
+ *
1056
+ * Let's say you have an S3 bucket that gives CloudFront `access`.
1057
+ *
1058
+ * ```ts title="sst.config.ts" {2}
1059
+ * const bucket = new sst.aws.Bucket("MyBucket", {
1060
+ * access: "cloudfront"
1061
+ * });
1062
+ * ```
1063
+ *
1064
+ * You can match a pattern and route to it based on:
1065
+ *
1066
+ * - A path prefix like `/api`
1067
+ * - A domain pattern like `api.example.com`
1068
+ * - A combined pattern like `dev.example.com/api`
1069
+ *
1070
+ * For example, to match a path prefix.
1071
+ *
1072
+ * ```ts title="sst.config.ts"
1073
+ * router.routeBucket("/files", bucket);
1074
+ * ```
1075
+ *
1076
+ * Or match a domain.
1077
+ *
1078
+ * ```ts title="sst.config.ts"
1079
+ * router.routeBucket("files.example.com", bucket);
1080
+ * ```
1081
+ *
1082
+ * Or a combined pattern.
1083
+ *
1084
+ * ```ts title="sst.config.ts"
1085
+ * router.routeBucket("dev.example.com/files", bucket);
1086
+ * ```
1087
+ *
1088
+ * You can also rewrite the request path.
1089
+ *
1090
+ * ```ts title="sst.config.ts"
1091
+ * router.routeBucket("/files", bucket, {
1092
+ * rewrite: {
1093
+ * regex: "^/files/(.*)$",
1094
+ * to: "/$1"
1095
+ * }
1096
+ * });
1097
+ * ```
1098
+ *
1099
+ * Here something like `/files/logo.png` will be routed to
1100
+ * `/logo.png`.
1101
+ */
1102
+ routeBucket(pattern: Input<string>, bucket: Input<Bucket>, args?: Input<RouterBucketRouteArgs>): void;
1103
+ /**
1104
+ * Add a route to a frontend or static site.
1105
+ *
1106
+ * @param pattern The path prefix to match for this route.
1107
+ * @param site The frontend or static site to route matching requests to.
1108
+ *
1109
+ * @deprecated The `routeSite` function has been deprecated. Set the `route` on the
1110
+ * site components to route the site through this Router.
1111
+ */
1112
+ routeSite(pattern: Input<string>, site: any): void;
1113
+ /** @internal */
1114
+ getSSTLink(): {
1115
+ properties: {
1116
+ url: Output<string>;
1117
+ };
1118
+ };
1119
+ /**
1120
+ * Reference an existing Router with the given Router distribution ID.
1121
+ *
1122
+ * @param name The name of the component.
1123
+ * @param distributionID The ID of the existing Router distribution.
1124
+ * @param opts? Resource options.
1125
+ *
1126
+ * This is useful when you create a Router in one stage and want to share it in
1127
+ * another. It avoids having to create a new Router in the other stage.
1128
+ *
1129
+ * :::tip
1130
+ * You can use the `static get` method to share a Router across stages.
1131
+ * :::
1132
+ *
1133
+ * @example
1134
+ * Let's say you create a Router in the `dev` stage. And in your personal stage
1135
+ * `frank`, you want to share the same Router.
1136
+ *
1137
+ * ```ts title="sst.config.ts"
1138
+ * const router = $app.stage === "frank"
1139
+ * ? sst.aws.Router.get("MyRouter", "E2IDLMESRN6V62")
1140
+ * : new sst.aws.Router("MyRouter");
1141
+ * ```
1142
+ *
1143
+ * Here `E2IDLMESRN6V62` is the ID of the Router distribution created in the
1144
+ * `dev` stage. You can find this by outputting the distribution ID in the `dev`
1145
+ * stage.
1146
+ *
1147
+ * ```ts title="sst.config.ts"
1148
+ * return {
1149
+ * router: router.distributionID
1150
+ * };
1151
+ * ```
1152
+ *
1153
+ * Learn more about [how to configure a router for your app](/docs/configure-a-router).
1154
+ */
1155
+ static get(name: string, distributionID: Input<string>, opts?: ComponentResourceOptions): Router;
1156
+ }
1157
+ export declare const CF_BLOCK_CLOUDFRONT_URL_INJECTION = "\nif (event.request.headers.host.value.includes('cloudfront.net')) {\n return {\n statusCode: 403,\n statusDescription: 'Forbidden',\n body: {\n encoding: \"text\",\n data: '<html><head><title>403 Forbidden</title></head><body><center><h1>403 Forbidden</h1></center></body></html>'\n }\n };\n}";
1158
+ export declare const CF_ROUTER_INJECTION = "\nasync function routeSite(kvNamespace, metadata) {\n const baselessUri = metadata.base\n ? event.request.uri.replace(metadata.base, \"\")\n : event.request.uri;\n\n // Route to S3 files\n try {\n // check using baselessUri b/c files are stored in the root\n const u = decodeURIComponent(baselessUri);\n const postfixes = u.endsWith(\"/\")\n ? [\"index.html\"]\n : [\"\", \".html\", \"/index.html\"];\n const v = await Promise.any(postfixes.map(p => cf.kvs().get(kvNamespace + \":\" + u + p).then(v => p)));\n // files are stored in a subdirectory, add it to the request uri\n event.request.uri = metadata.s3.dir + event.request.uri + v;\n setS3Origin(metadata.s3.domain);\n return;\n } catch (e) {}\n\n // Route to S3 routes\n if (metadata.s3 && metadata.s3.routes) {\n for (var i=0, l=metadata.s3.routes.length; i<l; i++) {\n const route = metadata.s3.routes[i];\n if (baselessUri.startsWith(route)) {\n event.request.uri = metadata.s3.dir + event.request.uri;\n // uri ends with /, ie. /usage/ -> /usage/index.html\n if (event.request.uri.endsWith(\"/\")) {\n event.request.uri += \"index.html\";\n }\n // uri ends with non-file, ie. /usage -> /usage/index.html\n else if (!event.request.uri.split(\"/\").pop().includes(\".\")) {\n event.request.uri += \"/index.html\";\n }\n setS3Origin(metadata.s3.domain);\n return;\n }\n }\n }\n\n // Route to S3 custom 404 (no servers)\n if (metadata.custom404) {\n event.request.uri = metadata.s3.dir + (metadata.base ? metadata.base : \"\") + metadata.custom404;\n setS3Origin(metadata.s3.domain);\n return;\n }\n\n // Route to image optimizer\n if (metadata.image && baselessUri.startsWith(metadata.image.route)) {\n setUrlOrigin(metadata.image.host, metadata.image.originAccessControlConfig ? { originAccessControlConfig: metadata.image.originAccessControlConfig } : undefined);\n return;\n }\n\n // Route to servers\n if (metadata.servers){\n event.request.headers[\"x-forwarded-host\"] = event.request.headers.host;\n \n for (var key in event.request.querystring) {\n if (key.includes(\"/\")) {\n event.request.querystring[encodeURIComponent(key)] = event.request.querystring[key];\n delete event.request.querystring[key];\n }\n }\n setNextjsGeoHeaders();\n setNextjsCacheKey();\n setUrlOrigin(findNearestServer(metadata.servers), metadata.origin);\n }\n\n function setNextjsGeoHeaders() {\n \n if(event.request.headers[\"cloudfront-viewer-city\"]) {\n event.request.headers[\"x-open-next-city\"] = event.request.headers[\"cloudfront-viewer-city\"];\n }\n if(event.request.headers[\"cloudfront-viewer-country\"]) {\n event.request.headers[\"x-open-next-country\"] = event.request.headers[\"cloudfront-viewer-country\"];\n }\n if(event.request.headers[\"cloudfront-viewer-region\"]) {\n event.request.headers[\"x-open-next-region\"] = event.request.headers[\"cloudfront-viewer-region\"];\n }\n if(event.request.headers[\"cloudfront-viewer-latitude\"]) {\n event.request.headers[\"x-open-next-latitude\"] = event.request.headers[\"cloudfront-viewer-latitude\"];\n }\n if(event.request.headers[\"cloudfront-viewer-longitude\"]) {\n event.request.headers[\"x-open-next-longitude\"] = event.request.headers[\"cloudfront-viewer-longitude\"];\n }\n }\n\n function setNextjsCacheKey() {\n \n var cacheKey = \"\";\n if (event.request.uri.startsWith(\"/_next/image\")) {\n cacheKey = getHeader(\"accept\");\n } else {\n cacheKey =\n getHeader(\"rsc\") +\n getHeader(\"next-router-prefetch\") +\n getHeader(\"next-router-state-tree\") +\n getHeader(\"next-url\") +\n getHeader(\"x-prerender-revalidate\");\n }\n if (event.request.cookies[\"__prerender_bypass\"]) {\n cacheKey += event.request.cookies[\"__prerender_bypass\"]\n ? event.request.cookies[\"__prerender_bypass\"].value\n : \"\";\n }\n var crypto = require(\"crypto\");\n var hashedKey = crypto.createHash(\"md5\").update(cacheKey).digest(\"hex\");\n event.request.headers[\"x-open-next-cache-key\"] = { value: hashedKey };\n }\n\n function getHeader(key) {\n var header = event.request.headers[key];\n if (header) {\n if (header.multiValue) {\n return header.multiValue.map((header) => header.value).join(\",\");\n }\n if (header.value) {\n return header.value;\n }\n }\n return \"\";\n }\n\n function findNearestServer(servers) {\n if (servers.length === 1) return servers[0][0];\n\n const h = event.request.headers;\n const lat = h[\"cloudfront-viewer-latitude\"] && h[\"cloudfront-viewer-latitude\"].value;\n const lon = h[\"cloudfront-viewer-longitude\"] && h[\"cloudfront-viewer-longitude\"].value;\n if (!lat || !lon) return servers[0][0];\n\n return servers\n .map((s) => ({\n distance: haversineDistance(lat, lon, s[1], s[2]),\n host: s[0],\n }))\n .sort((a, b) => a.distance - b.distance)[0]\n .host;\n }\n\n function haversineDistance(lat1, lon1, lat2, lon2) {\n const toRad = angle => angle * Math.PI / 180;\n const radLat1 = toRad(lat1);\n const radLat2 = toRad(lat2);\n const dLat = toRad(lat2 - lat1);\n const dLon = toRad(lon2 - lon1);\n const a = Math.sin(dLat / 2) ** 2 + Math.cos(radLat1) * Math.cos(radLat2) * Math.sin(dLon / 2) ** 2;\n return 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n }\n}\n\nfunction setUrlOrigin(urlHost, override) {\n event.request.headers[\"x-forwarded-host\"] = event.request.headers.host;\n const origin = {\n domainName: urlHost,\n customOriginConfig: {\n port: 443,\n protocol: \"https\",\n sslProtocols: [\"TLSv1.2\"],\n },\n originAccessControlConfig: {\n enabled: false,\n }\n };\n override = override ?? {};\n if (override.protocol === \"http\") {\n delete origin.customOriginConfig;\n }\n if (override.connectionAttempts) {\n origin.connectionAttempts = override.connectionAttempts;\n }\n if (override.timeouts) {\n origin.timeouts = override.timeouts;\n }\n if (override.originAccessControlConfig) {\n origin.originAccessControlConfig = override.originAccessControlConfig;\n }\n cf.updateRequestOrigin(origin);\n}\n\nfunction setS3Origin(s3Domain, override) {\n delete event.request.headers[\"Cookies\"];\n delete event.request.headers[\"cookies\"];\n delete event.request.cookies;\n\n const origin = {\n domainName: s3Domain,\n originAccessControlConfig: {\n enabled: true,\n signingBehavior: \"always\",\n signingProtocol: \"sigv4\",\n originType: \"s3\",\n }\n };\n override = override ?? {};\n if (override.connectionAttempts) {\n origin.connectionAttempts = override.connectionAttempts;\n }\n if (override.timeouts) {\n origin.timeouts = override.timeouts;\n }\n cf.updateRequestOrigin(origin);\n}";
1159
+ export type KV_SITE_METADATA = {
1160
+ base?: string;
1161
+ custom404?: string;
1162
+ s3: {
1163
+ domain: string;
1164
+ dir: string;
1165
+ routes: string[];
1166
+ };
1167
+ image?: {
1168
+ host: string;
1169
+ route: string;
1170
+ originAccessControlConfig?: {
1171
+ enabled: boolean;
1172
+ signingBehavior: string;
1173
+ signingProtocol: string;
1174
+ originType: string;
1175
+ };
1176
+ };
1177
+ servers?: [string, number, number][];
1178
+ origin?: {
1179
+ timeouts: {
1180
+ readTimeout: number;
1181
+ };
1182
+ };
1183
+ };
1184
+ export type RouterRouteArgs = {
1185
+ /**
1186
+ * The `Router` component to use for routing requests.
1187
+ *
1188
+ * @example
1189
+ *
1190
+ * Let's say you have a Router component.
1191
+ *
1192
+ * ```ts title="sst.config.ts"
1193
+ * const router = new sst.aws.Router("MyRouter", {
1194
+ * domain: "example.com"
1195
+ * });
1196
+ * ```
1197
+ *
1198
+ * You can attach it to the Router, instead of creating a standalone CloudFront
1199
+ * distribution.
1200
+ *
1201
+ * ```ts
1202
+ * router: {
1203
+ * instance: router
1204
+ * }
1205
+ * ```
1206
+ */
1207
+ instance: Input<Router>;
1208
+ /**
1209
+ * Route requests matching a specific domain pattern.
1210
+ *
1211
+ * @example
1212
+ *
1213
+ * You can serve your resource from a subdomain. For example, if you want to make
1214
+ * it available at `https://dev.example.com`, set the `Router` to match the
1215
+ * domain or a wildcard.
1216
+ *
1217
+ * ```ts {2} title="sst.config.ts"
1218
+ * const router = new sst.aws.Router("MyRouter", {
1219
+ * domain: "*.example.com"
1220
+ * });
1221
+ * ```
1222
+ *
1223
+ * Then set the domain pattern.
1224
+ *
1225
+ * ```ts {3}
1226
+ * router: {
1227
+ * instance: router,
1228
+ * domain: "dev.example.com"
1229
+ * }
1230
+ * ```
1231
+ *
1232
+ * While `dev.example.com` matches `*.example.com`. Something like
1233
+ * `docs.dev.example.com` will not match `*.example.com`.
1234
+ *
1235
+ * :::tip
1236
+ * Nested wildcards domain patterns are not supported.
1237
+ * :::
1238
+ *
1239
+ * You'll need to add `*.dev.example.com` as an alias.
1240
+ */
1241
+ domain?: Input<string>;
1242
+ /**
1243
+ * Route requests matching a specific path prefix.
1244
+ *
1245
+ * @default `"/"`
1246
+ *
1247
+ * @example
1248
+ *
1249
+ * ```ts {3}
1250
+ * router: {
1251
+ * instance: router,
1252
+ * path: "/docs"
1253
+ * }
1254
+ * ```
1255
+ */
1256
+ path?: Input<string>;
1257
+ };
1258
+ export type RouterRouteArgsDeprecated = {
1259
+ router: Input<Router>;
1260
+ domain?: Input<string>;
1261
+ path?: Input<string>;
1262
+ };
1263
+ export declare function normalizeRouteArgs(route?: Input<RouterRouteArgs>, routeDeprecated?: Input<RouterRouteArgsDeprecated>): Output<{
1264
+ hostPattern: string | undefined;
1265
+ pathPrefix: string | undefined;
1266
+ routerDistributionId: Output<string>;
1267
+ routerUrl: Output<string>;
1268
+ routerKvNamespace: Output<string>;
1269
+ routerKvStoreArn: Output<string>;
1270
+ }> | undefined;
1271
+ export {};
1272
+ //# sourceMappingURL=router.d.ts.map