@monorise/sst 1.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.sst/platform/src/components/aws/analog.d.ts +423 -0
- package/dist/.sst/platform/src/components/aws/analog.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/analog.js +118 -0
- package/dist/.sst/platform/src/components/aws/analog.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts +74 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js +110 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.d.ts +542 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js +409 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts +48 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js +55 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts +55 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js +110 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts +36 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js +34 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts +39 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js +49 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts +53 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js +85 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts +53 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js +66 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1.d.ts +1002 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js +749 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts +54 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js +98 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts +28 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js +28 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts +59 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js +84 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts +54 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js +55 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts +44 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js +53 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts +933 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js +648 -0
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.d.ts +52 -0
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js +208 -0
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-function.d.ts +33 -0
- package/dist/.sst/platform/src/components/aws/app-sync-function.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-function.js +52 -0
- package/dist/.sst/platform/src/components/aws/app-sync-function.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.d.ts +41 -0
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js +70 -0
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync.d.ts +638 -0
- package/dist/.sst/platform/src/components/aws/app-sync.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/app-sync.js +330 -0
- package/dist/.sst/platform/src/components/aws/app-sync.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/astro.d.ts +421 -0
- package/dist/.sst/platform/src/components/aws/astro.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/astro.js +156 -0
- package/dist/.sst/platform/src/components/aws/astro.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/aurora.d.ts +702 -0
- package/dist/.sst/platform/src/components/aws/aurora.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/aurora.js +678 -0
- package/dist/.sst/platform/src/components/aws/aurora.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/auth-v1.d.ts +26 -0
- package/dist/.sst/platform/src/components/aws/auth-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/auth-v1.js +36 -0
- package/dist/.sst/platform/src/components/aws/auth-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/auth.d.ts +260 -0
- package/dist/.sst/platform/src/components/aws/auth.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/auth.js +209 -0
- package/dist/.sst/platform/src/components/aws/auth.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts +61 -0
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js +99 -0
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-notification.d.ts +47 -0
- package/dist/.sst/platform/src/components/aws/bucket-notification.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-notification.js +170 -0
- package/dist/.sst/platform/src/components/aws/bucket-notification.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts +55 -0
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js +77 -0
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts +55 -0
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js +99 -0
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket.d.ts +1115 -0
- package/dist/.sst/platform/src/components/aws/bucket.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bucket.js +754 -0
- package/dist/.sst/platform/src/components/aws/bucket.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.d.ts +20 -0
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js +19 -0
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts +49 -0
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js +81 -0
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts +44 -0
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js +63 -0
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus.d.ts +403 -0
- package/dist/.sst/platform/src/components/aws/bus.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/bus.js +350 -0
- package/dist/.sst/platform/src/components/aws/bus.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cdn.d.ts +299 -0
- package/dist/.sst/platform/src/components/aws/cdn.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cdn.js +234 -0
- package/dist/.sst/platform/src/components/aws/cdn.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cluster-v1.d.ts +882 -0
- package/dist/.sst/platform/src/components/aws/cluster-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cluster-v1.js +245 -0
- package/dist/.sst/platform/src/components/aws/cluster-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cluster.d.ts +308 -0
- package/dist/.sst/platform/src/components/aws/cluster.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cluster.js +321 -0
- package/dist/.sst/platform/src/components/aws/cluster.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.d.ts +194 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js +263 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.d.ts +38 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js +67 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts +50 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js +81 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts +599 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js +368 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/cron.d.ts +250 -0
- package/dist/.sst/platform/src/components/aws/cron.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cron.js +200 -0
- package/dist/.sst/platform/src/components/aws/cron.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.d.ts +27 -0
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js +55 -0
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/dns.d.ts +94 -0
- package/dist/.sst/platform/src/components/aws/dns.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/dns.js +121 -0
- package/dist/.sst/platform/src/components/aws/dns.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts +55 -0
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js +79 -0
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts +569 -0
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/dynamo.js +291 -0
- package/dist/.sst/platform/src/components/aws/dynamo.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/efs.d.ts +217 -0
- package/dist/.sst/platform/src/components/aws/efs.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/efs.js +241 -0
- package/dist/.sst/platform/src/components/aws/efs.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/email.d.ts +291 -0
- package/dist/.sst/platform/src/components/aws/email.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/email.js +276 -0
- package/dist/.sst/platform/src/components/aws/email.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/fargate.d.ts +769 -0
- package/dist/.sst/platform/src/components/aws/fargate.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/fargate.js +434 -0
- package/dist/.sst/platform/src/components/aws/fargate.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/function.d.ts +1631 -0
- package/dist/.sst/platform/src/components/aws/function.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/function.js +1041 -0
- package/dist/.sst/platform/src/components/aws/function.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts +3 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js +31 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts +144 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js +2 -0
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts +35 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.js +86 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.d.ts +13 -0
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js +7 -0
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.d.ts +4 -0
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js +27 -0
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.d.ts +10 -0
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js +51 -0
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/provider.d.ts +3 -0
- package/dist/.sst/platform/src/components/aws/helpers/provider.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/provider.js +34 -0
- package/dist/.sst/platform/src/components/aws/helpers/provider.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/quota.d.ts +7 -0
- package/dist/.sst/platform/src/components/aws/helpers/quota.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/quota.js +20 -0
- package/dist/.sst/platform/src/components/aws/helpers/quota.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.d.ts +4 -0
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js +36 -0
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.d.ts +6 -0
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js +13 -0
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/https-redirect.d.ts +38 -0
- package/dist/.sst/platform/src/components/aws/https-redirect.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/https-redirect.js +124 -0
- package/dist/.sst/platform/src/components/aws/https-redirect.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/iam-edit.d.ts +39 -0
- package/dist/.sst/platform/src/components/aws/iam-edit.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/iam-edit.js +40 -0
- package/dist/.sst/platform/src/components/aws/iam-edit.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/index.d.ts +48 -0
- package/dist/.sst/platform/src/components/aws/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/index.js +49 -0
- package/dist/.sst/platform/src/components/aws/index.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts +48 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js +82 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream.d.ts +249 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js +134 -0
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/linkable.d.ts +17 -0
- package/dist/.sst/platform/src/components/aws/linkable.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/linkable.js +25 -0
- package/dist/.sst/platform/src/components/aws/linkable.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/logging.d.ts +26 -0
- package/dist/.sst/platform/src/components/aws/logging.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/logging.js +26 -0
- package/dist/.sst/platform/src/components/aws/logging.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/mysql.d.ts +496 -0
- package/dist/.sst/platform/src/components/aws/mysql.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/mysql.js +514 -0
- package/dist/.sst/platform/src/components/aws/mysql.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/nextjs.d.ts +517 -0
- package/dist/.sst/platform/src/components/aws/nextjs.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/nextjs.js +444 -0
- package/dist/.sst/platform/src/components/aws/nextjs.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/nuxt.d.ts +495 -0
- package/dist/.sst/platform/src/components/aws/nuxt.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/nuxt.js +113 -0
- package/dist/.sst/platform/src/components/aws/nuxt.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/open-search.d.ts +295 -0
- package/dist/.sst/platform/src/components/aws/open-search.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/open-search.js +365 -0
- package/dist/.sst/platform/src/components/aws/open-search.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/opencontrol.d.ts +165 -0
- package/dist/.sst/platform/src/components/aws/opencontrol.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/opencontrol.js +164 -0
- package/dist/.sst/platform/src/components/aws/opencontrol.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/permission.d.ts +27 -0
- package/dist/.sst/platform/src/components/aws/permission.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/permission.js +19 -0
- package/dist/.sst/platform/src/components/aws/permission.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/postgres-v1.d.ts +317 -0
- package/dist/.sst/platform/src/components/aws/postgres-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/postgres-v1.js +304 -0
- package/dist/.sst/platform/src/components/aws/postgres-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/postgres.d.ts +500 -0
- package/dist/.sst/platform/src/components/aws/postgres.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/postgres.js +532 -0
- package/dist/.sst/platform/src/components/aws/postgres.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.d.ts +18 -0
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts +13 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts +11 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.d.ts +29 -0
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js +18 -0
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts +11 -0
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.d.ts +11 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts +11 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.d.ts +8 -0
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts +8 -0
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/vector-table.d.ts +12 -0
- package/dist/.sst/platform/src/components/aws/providers/vector-table.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js +8 -0
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts +48 -0
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js +81 -0
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/queue.d.ts +485 -0
- package/dist/.sst/platform/src/components/aws/queue.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/queue.js +322 -0
- package/dist/.sst/platform/src/components/aws/queue.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/react.d.ts +416 -0
- package/dist/.sst/platform/src/components/aws/react.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/react.js +157 -0
- package/dist/.sst/platform/src/components/aws/react.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts +53 -0
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js +78 -0
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/realtime.d.ts +226 -0
- package/dist/.sst/platform/src/components/aws/realtime.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/realtime.js +221 -0
- package/dist/.sst/platform/src/components/aws/realtime.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/redis-v1.d.ts +338 -0
- package/dist/.sst/platform/src/components/aws/redis-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/redis-v1.js +335 -0
- package/dist/.sst/platform/src/components/aws/redis-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/redis.d.ts +364 -0
- package/dist/.sst/platform/src/components/aws/redis.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/redis.js +382 -0
- package/dist/.sst/platform/src/components/aws/redis.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/remix.d.ts +423 -0
- package/dist/.sst/platform/src/components/aws/remix.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/remix.js +212 -0
- package/dist/.sst/platform/src/components/aws/remix.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-base-route.d.ts +28 -0
- package/dist/.sst/platform/src/components/aws/router-base-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-base-route.js +40 -0
- package/dist/.sst/platform/src/components/aws/router-base-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-bucket-route.d.ts +29 -0
- package/dist/.sst/platform/src/components/aws/router-bucket-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js +40 -0
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-url-route.d.ts +28 -0
- package/dist/.sst/platform/src/components/aws/router-url-route.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/router-url-route.js +51 -0
- package/dist/.sst/platform/src/components/aws/router-url-route.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/router.d.ts +1266 -0
- package/dist/.sst/platform/src/components/aws/router.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/router.js +1156 -0
- package/dist/.sst/platform/src/components/aws/router.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/service-v1.d.ts +78 -0
- package/dist/.sst/platform/src/components/aws/service-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/service-v1.js +606 -0
- package/dist/.sst/platform/src/components/aws/service-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/service.d.ts +1599 -0
- package/dist/.sst/platform/src/components/aws/service.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/service.js +924 -0
- package/dist/.sst/platform/src/components/aws/service.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts +53 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js +75 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts +55 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js +59 -0
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic.d.ts +389 -0
- package/dist/.sst/platform/src/components/aws/sns-topic.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/sns-topic.js +233 -0
- package/dist/.sst/platform/src/components/aws/sns-topic.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/solid-start.d.ts +414 -0
- package/dist/.sst/platform/src/components/aws/solid-start.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/solid-start.js +120 -0
- package/dist/.sst/platform/src/components/aws/solid-start.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts +494 -0
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/ssr-site.js +792 -0
- package/dist/.sst/platform/src/components/aws/ssr-site.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/static-site.d.ts +736 -0
- package/dist/.sst/platform/src/components/aws/static-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/static-site.js +583 -0
- package/dist/.sst/platform/src/components/aws/static-site.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/choice.d.ts +73 -0
- package/dist/.sst/platform/src/components/aws/step-functions/choice.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js +98 -0
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/fail.d.ts +63 -0
- package/dist/.sst/platform/src/components/aws/step-functions/fail.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js +25 -0
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/map.d.ts +236 -0
- package/dist/.sst/platform/src/components/aws/step-functions/map.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/map.js +108 -0
- package/dist/.sst/platform/src/components/aws/step-functions/map.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.d.ts +127 -0
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js +129 -0
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/pass.d.ts +39 -0
- package/dist/.sst/platform/src/components/aws/step-functions/pass.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js +41 -0
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts +197 -0
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/state.js +134 -0
- package/dist/.sst/platform/src/components/aws/step-functions/state.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.d.ts +26 -0
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js +25 -0
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/task.d.ts +477 -0
- package/dist/.sst/platform/src/components/aws/step-functions/task.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/task.js +116 -0
- package/dist/.sst/platform/src/components/aws/step-functions/task.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/wait.d.ts +91 -0
- package/dist/.sst/platform/src/components/aws/step-functions/wait.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js +46 -0
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions.d.ts +473 -0
- package/dist/.sst/platform/src/components/aws/step-functions.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/step-functions.js +576 -0
- package/dist/.sst/platform/src/components/aws/step-functions.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/svelte-kit.d.ts +417 -0
- package/dist/.sst/platform/src/components/aws/svelte-kit.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/svelte-kit.js +144 -0
- package/dist/.sst/platform/src/components/aws/svelte-kit.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/tan-stack-start.d.ts +354 -0
- package/dist/.sst/platform/src/components/aws/tan-stack-start.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js +143 -0
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/task.d.ts +322 -0
- package/dist/.sst/platform/src/components/aws/task.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/task.js +311 -0
- package/dist/.sst/platform/src/components/aws/task.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/vector.d.ts +150 -0
- package/dist/.sst/platform/src/components/aws/vector.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/vector.js +224 -0
- package/dist/.sst/platform/src/components/aws/vector.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/vpc-v1.d.ts +208 -0
- package/dist/.sst/platform/src/components/aws/vpc-v1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/vpc-v1.js +355 -0
- package/dist/.sst/platform/src/components/aws/vpc-v1.js.map +1 -0
- package/dist/.sst/platform/src/components/aws/vpc.d.ts +444 -0
- package/dist/.sst/platform/src/components/aws/vpc.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/vpc.js +834 -0
- package/dist/.sst/platform/src/components/aws/vpc.js.map +1 -0
- package/dist/.sst/platform/src/components/base/base-site.d.ts +53 -0
- package/dist/.sst/platform/src/components/base/base-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/base/base-site.js +47 -0
- package/dist/.sst/platform/src/components/base/base-site.js.map +1 -0
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts +111 -0
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/base/base-ssr-site.js +72 -0
- package/dist/.sst/platform/src/components/base/base-ssr-site.js.map +1 -0
- package/dist/.sst/platform/src/components/base/base-static-site.d.ts +199 -0
- package/dist/.sst/platform/src/components/base/base-static-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/base/base-static-site.js +87 -0
- package/dist/.sst/platform/src/components/base/base-static-site.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/account-id.d.ts +2 -0
- package/dist/.sst/platform/src/components/cloudflare/account-id.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/account-id.js +2 -0
- package/dist/.sst/platform/src/components/cloudflare/account-id.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/auth.d.ts +22 -0
- package/dist/.sst/platform/src/components/cloudflare/auth.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/auth.js +37 -0
- package/dist/.sst/platform/src/components/cloudflare/auth.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts +69 -0
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/binding.js +25 -0
- package/dist/.sst/platform/src/components/cloudflare/binding.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts +101 -0
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/bucket.js +98 -0
- package/dist/.sst/platform/src/components/cloudflare/bucket.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/cron.d.ts +121 -0
- package/dist/.sst/platform/src/components/cloudflare/cron.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/cron.js +86 -0
- package/dist/.sst/platform/src/components/cloudflare/cron.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/d1.d.ts +107 -0
- package/dist/.sst/platform/src/components/cloudflare/d1.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/d1.js +104 -0
- package/dist/.sst/platform/src/components/cloudflare/d1.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/dns.d.ts +94 -0
- package/dist/.sst/platform/src/components/cloudflare/dns.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/dns.js +138 -0
- package/dist/.sst/platform/src/components/cloudflare/dns.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts +19 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js +39 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts +10 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js +25 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts +13 -0
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/index.js +13 -0
- package/dist/.sst/platform/src/components/cloudflare/index.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts +101 -0
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/kv.js +98 -0
- package/dist/.sst/platform/src/components/cloudflare/kv.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts +20 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js +11 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts +23 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js +63 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts +22 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js +83 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts +22 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js +54 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.d.ts +60 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.js +57 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts +223 -0
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/remix.js +291 -0
- package/dist/.sst/platform/src/components/cloudflare/remix.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts +59 -0
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js +177 -0
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/static-site.d.ts +262 -0
- package/dist/.sst/platform/src/components/cloudflare/static-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/static-site.js +315 -0
- package/dist/.sst/platform/src/components/cloudflare/static-site.js.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts +273 -0
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/worker.js +326 -0
- package/dist/.sst/platform/src/components/cloudflare/worker.js.map +1 -0
- package/dist/.sst/platform/src/components/component.d.ts +37 -0
- package/dist/.sst/platform/src/components/component.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/component.js +395 -0
- package/dist/.sst/platform/src/components/component.js.map +1 -0
- package/dist/.sst/platform/src/components/cpu.d.ts +3 -0
- package/dist/.sst/platform/src/components/cpu.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cpu.js +9 -0
- package/dist/.sst/platform/src/components/cpu.js.map +1 -0
- package/dist/.sst/platform/src/components/dns.d.ts +59 -0
- package/dist/.sst/platform/src/components/dns.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/dns.js +7 -0
- package/dist/.sst/platform/src/components/dns.js.map +1 -0
- package/dist/.sst/platform/src/components/duration.d.ts +6 -0
- package/dist/.sst/platform/src/components/duration.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/duration.js +19 -0
- package/dist/.sst/platform/src/components/duration.js.map +1 -0
- package/dist/.sst/platform/src/components/error.d.ts +4 -0
- package/dist/.sst/platform/src/components/error.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/error.js +6 -0
- package/dist/.sst/platform/src/components/error.js.map +1 -0
- package/dist/.sst/platform/src/components/experimental/dev-command.d.ts +99 -0
- package/dist/.sst/platform/src/components/experimental/dev-command.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/experimental/dev-command.js +59 -0
- package/dist/.sst/platform/src/components/experimental/dev-command.js.map +1 -0
- package/dist/.sst/platform/src/components/experimental/index.d.ts +2 -0
- package/dist/.sst/platform/src/components/experimental/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/experimental/index.js +2 -0
- package/dist/.sst/platform/src/components/experimental/index.js.map +1 -0
- package/dist/.sst/platform/src/components/hint.d.ts +7 -0
- package/dist/.sst/platform/src/components/hint.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/hint.js +20 -0
- package/dist/.sst/platform/src/components/hint.js.map +1 -0
- package/dist/.sst/platform/src/components/index.d.ts +16 -0
- package/dist/.sst/platform/src/components/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/index.js +16 -0
- package/dist/.sst/platform/src/components/index.js.map +1 -0
- package/dist/.sst/platform/src/components/input.d.ts +3 -0
- package/dist/.sst/platform/src/components/input.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/input.js +2 -0
- package/dist/.sst/platform/src/components/input.js.map +1 -0
- package/dist/.sst/platform/src/components/link.d.ts +41 -0
- package/dist/.sst/platform/src/components/link.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/link.js +138 -0
- package/dist/.sst/platform/src/components/link.js.map +1 -0
- package/dist/.sst/platform/src/components/linkable.d.ts +271 -0
- package/dist/.sst/platform/src/components/linkable.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/linkable.js +244 -0
- package/dist/.sst/platform/src/components/linkable.js.map +1 -0
- package/dist/.sst/platform/src/components/naming.d.ts +7 -0
- package/dist/.sst/platform/src/components/naming.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/naming.js +58 -0
- package/dist/.sst/platform/src/components/naming.js.map +1 -0
- package/dist/.sst/platform/src/components/path.d.ts +2 -0
- package/dist/.sst/platform/src/components/path.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/path.js +5 -0
- package/dist/.sst/platform/src/components/path.js.map +1 -0
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts +18 -0
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/rpc/rpc.js +120 -0
- package/dist/.sst/platform/src/components/rpc/rpc.js.map +1 -0
- package/dist/.sst/platform/src/components/secret.d.ts +125 -0
- package/dist/.sst/platform/src/components/secret.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/secret.js +143 -0
- package/dist/.sst/platform/src/components/secret.js.map +1 -0
- package/dist/.sst/platform/src/components/size.d.ts +5 -0
- package/dist/.sst/platform/src/components/size.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/size.js +29 -0
- package/dist/.sst/platform/src/components/size.js.map +1 -0
- package/dist/.sst/platform/src/components/vercel/account-id.d.ts +2 -0
- package/dist/.sst/platform/src/components/vercel/account-id.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/vercel/account-id.js +2 -0
- package/dist/.sst/platform/src/components/vercel/account-id.js.map +1 -0
- package/dist/.sst/platform/src/components/vercel/dns.d.ts +73 -0
- package/dist/.sst/platform/src/components/vercel/dns.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/vercel/dns.js +104 -0
- package/dist/.sst/platform/src/components/vercel/dns.js.map +1 -0
- package/dist/.sst/platform/src/components/vercel/index.d.ts +3 -0
- package/dist/.sst/platform/src/components/vercel/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/vercel/index.js +3 -0
- package/dist/.sst/platform/src/components/vercel/index.js.map +1 -0
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.d.ts +14 -0
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js +8 -0
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js.map +1 -0
- package/dist/.sst/platform/src/config.d.ts +1243 -0
- package/dist/.sst/platform/src/config.d.ts.map +1 -0
- package/dist/.sst/platform/src/config.js +5 -0
- package/dist/.sst/platform/src/config.js.map +1 -0
- package/dist/.sst/platform/src/util/compare-semver.d.ts +4 -0
- package/dist/.sst/platform/src/util/compare-semver.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/compare-semver.js +24 -0
- package/dist/.sst/platform/src/util/compare-semver.js.map +1 -0
- package/dist/.sst/platform/src/util/lazy.d.ts +2 -0
- package/dist/.sst/platform/src/util/lazy.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/lazy.js +12 -0
- package/dist/.sst/platform/src/util/lazy.js.map +1 -0
- package/dist/.sst/platform/src/util/path-to-regex.d.ts +128 -0
- package/dist/.sst/platform/src/util/path-to-regex.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/path-to-regex.js +392 -0
- package/dist/.sst/platform/src/util/path-to-regex.js.map +1 -0
- package/dist/.sst/platform/src/util/semaphore.d.ts +9 -0
- package/dist/.sst/platform/src/util/semaphore.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/semaphore.js +36 -0
- package/dist/.sst/platform/src/util/semaphore.js.map +1 -0
- package/dist/.sst/platform/src/util/warn.d.ts +2 -0
- package/dist/.sst/platform/src/util/warn.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/warn.js +8 -0
- package/dist/.sst/platform/src/util/warn.js.map +1 -0
- package/dist/components/monorise-core.d.ts +17 -0
- package/dist/components/monorise-core.d.ts.map +1 -0
- package/dist/components/monorise-core.js +134 -0
- package/dist/components/monorise-core.js.map +1 -0
- package/dist/components/q-function.d.ts +17 -0
- package/dist/components/q-function.d.ts.map +1 -0
- package/dist/components/q-function.js +53 -0
- package/dist/components/q-function.js.map +1 -0
- package/dist/components/single-table.d.ts +12 -0
- package/dist/components/single-table.d.ts.map +1 -0
- package/dist/components/single-table.js +71 -0
- package/dist/components/single-table.js.map +1 -0
- package/dist/constants/event.d.ts +73 -0
- package/dist/constants/event.d.ts.map +1 -0
- package/dist/constants/event.js +74 -0
- package/dist/constants/event.js.map +1 -0
- package/dist/constants/table.d.ts +3 -0
- package/dist/constants/table.d.ts.map +1 -0
- package/dist/constants/table.js +3 -0
- package/dist/constants/table.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/sst.config.d.ts +3 -0
- package/dist/sst.config.d.ts.map +1 -0
- package/dist/sst.config.js +24 -0
- package/dist/sst.config.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +25 -0
|
@@ -0,0 +1,1156 @@
|
|
|
1
|
+
import { all, interpolate, output, } from "@pulumi/pulumi";
|
|
2
|
+
import crypto from "crypto";
|
|
3
|
+
import { Component, transform } from "../component";
|
|
4
|
+
import { Cdn } from "./cdn";
|
|
5
|
+
import { cloudfront } from "@pulumi/aws";
|
|
6
|
+
import { hashStringToPrettyString, physicalName } from "../naming";
|
|
7
|
+
import { Bucket } from "./bucket";
|
|
8
|
+
import { OriginAccessControl } from "./providers/origin-access-control";
|
|
9
|
+
import { VisibleError } from "../error";
|
|
10
|
+
import { RouterUrlRoute } from "./router-url-route";
|
|
11
|
+
import { RouterBucketRoute } from "./router-bucket-route";
|
|
12
|
+
/**
|
|
13
|
+
* The `Router` component lets you use a CloudFront distribution to direct
|
|
14
|
+
* requests to various parts of your application like:
|
|
15
|
+
*
|
|
16
|
+
* - A URL
|
|
17
|
+
* - A function
|
|
18
|
+
* - A frontend
|
|
19
|
+
* - An S3 bucket
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* #### Minimal example
|
|
24
|
+
*
|
|
25
|
+
* ```ts title="sst.config.ts"
|
|
26
|
+
* new sst.aws.Router("MyRouter");
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* #### Add a custom domain
|
|
30
|
+
*
|
|
31
|
+
* ```ts {2} title="sst.config.ts"
|
|
32
|
+
* new sst.aws.Router("MyRouter", {
|
|
33
|
+
* domain: "myapp.com"
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* #### Sharing the router across stages
|
|
38
|
+
*
|
|
39
|
+
* ```ts title="sst.config.ts"
|
|
40
|
+
* const router = $app.stage === "production"
|
|
41
|
+
* ? new sst.aws.Router("MyRouter", {
|
|
42
|
+
* domain: {
|
|
43
|
+
* name: "example.com",
|
|
44
|
+
* aliases: ["*.example.com"]
|
|
45
|
+
* }
|
|
46
|
+
* })
|
|
47
|
+
* : sst.aws.Router.get("MyRouter", "E1XWRGCYGTFB7Z");
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* #### Route to a URL
|
|
51
|
+
*
|
|
52
|
+
* ```ts title="sst.config.ts" {3}
|
|
53
|
+
* const router = new sst.aws.Router("MyRouter");
|
|
54
|
+
*
|
|
55
|
+
* router.route("/", "https://some-external-service.com");
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* #### Route to an S3 bucket
|
|
59
|
+
*
|
|
60
|
+
* ```ts title="sst.config.ts" {2,6}
|
|
61
|
+
* const myBucket = new sst.aws.Bucket("MyBucket", {
|
|
62
|
+
* access: "cloudfront"
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* const router = new sst.aws.Router("MyRouter");
|
|
66
|
+
* router.routeBucket("/files", myBucket);
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* You need to allow CloudFront to access the bucket by setting the `access` prop
|
|
70
|
+
* on the bucket.
|
|
71
|
+
*
|
|
72
|
+
* #### Route to a function
|
|
73
|
+
*
|
|
74
|
+
* ```ts title="sst.config.ts" {8-11}
|
|
75
|
+
* const router = new sst.aws.Router("MyRouter", {
|
|
76
|
+
* domain: "example.com"
|
|
77
|
+
* });
|
|
78
|
+
*
|
|
79
|
+
* const myFunction = new sst.aws.Function("MyFunction", {
|
|
80
|
+
* handler: "src/api.handler",
|
|
81
|
+
* url: {
|
|
82
|
+
* router: {
|
|
83
|
+
* instance: router,
|
|
84
|
+
* path: "/api"
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* Setting the route through the function, instead of `router.route()` makes
|
|
91
|
+
* it so that `myFunction.url` gives you the URL based on the Router domain.
|
|
92
|
+
*
|
|
93
|
+
* #### Route to a frontend
|
|
94
|
+
*
|
|
95
|
+
* ```ts title="sst.config.ts" {4-6}
|
|
96
|
+
* const router = new sst.aws.Router("MyRouter");
|
|
97
|
+
*
|
|
98
|
+
* const mySite = new sst.aws.Nextjs("MyWeb", {
|
|
99
|
+
* router: {
|
|
100
|
+
* instance: router
|
|
101
|
+
* }
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* Setting the route through the site, instead of `router.route()` makes
|
|
106
|
+
* it so that `mySite.url` gives you the URL based on the Router domain.
|
|
107
|
+
*
|
|
108
|
+
* #### Route to a frontend on a path
|
|
109
|
+
*
|
|
110
|
+
* ```ts title="sst.config.ts" {4-7}
|
|
111
|
+
* const router = new sst.aws.Router("MyRouter");
|
|
112
|
+
*
|
|
113
|
+
* new sst.aws.Nextjs("MyWeb", {
|
|
114
|
+
* router: {
|
|
115
|
+
* instance: router,
|
|
116
|
+
* path: "/docs"
|
|
117
|
+
* }
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* If you are routing to a path, you'll need to configure the base path in your
|
|
122
|
+
* frontend app as well. [Learn more](/docs/component/aws/nextjs/#router).
|
|
123
|
+
*
|
|
124
|
+
* #### Route to a frontend on a subdomain
|
|
125
|
+
*
|
|
126
|
+
* ```ts title="sst.config.ts" {4,9-12}
|
|
127
|
+
* const router = new sst.aws.Router("MyRouter", {
|
|
128
|
+
* domain: {
|
|
129
|
+
* name: "example.com",
|
|
130
|
+
* aliases: ["*.example.com"]
|
|
131
|
+
* }
|
|
132
|
+
* });
|
|
133
|
+
*
|
|
134
|
+
* new sst.aws.Nextjs("MyWeb", {
|
|
135
|
+
* router: {
|
|
136
|
+
* instance: router,
|
|
137
|
+
* domain: "docs.example.com"
|
|
138
|
+
* }
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* We configure `*.example.com` as an alias so that we can route to a subdomain.
|
|
143
|
+
*
|
|
144
|
+
* #### How it works
|
|
145
|
+
*
|
|
146
|
+
* This uses a CloudFront KeyValueStore to store the routing data and a CloudFront
|
|
147
|
+
* function to route the request. As routes are added, the store is updated.
|
|
148
|
+
*
|
|
149
|
+
* So when a request comes in, it does a lookup in the store and dynamically sets
|
|
150
|
+
* the origin based on the routing data. For frontends, that have their server
|
|
151
|
+
* functions deployed to multiple `regions`, it routes to the closest region based
|
|
152
|
+
* on the user's location.
|
|
153
|
+
*
|
|
154
|
+
* You might notice a _placeholder.sst.dev_ behavior in CloudFront. This is not
|
|
155
|
+
* used and is only there because CloudFront requires a default behavior.
|
|
156
|
+
*
|
|
157
|
+
* #### Limits
|
|
158
|
+
*
|
|
159
|
+
* There are some limits on this setup but it's managed by SST.
|
|
160
|
+
*
|
|
161
|
+
* - The CloudFront function can be a maximum of 10KB in size. But because all
|
|
162
|
+
* the route data is stored in the KeyValueStore, the function can be kept small.
|
|
163
|
+
* - Each value in the KeyValueStore needs to be less than 1KB. This component
|
|
164
|
+
* splits the routes into multiple values to keep it under the limit.
|
|
165
|
+
* - The KeyValueStore can be a maximum of 5MB. This is fairly large. But to
|
|
166
|
+
* handle sites that have a lot of files, only top-level assets get individual
|
|
167
|
+
* entries.
|
|
168
|
+
*/
|
|
169
|
+
export class Router extends Component {
|
|
170
|
+
constructor(name, args = {}, opts = {}) {
|
|
171
|
+
super(__pulumiType, name, args, opts);
|
|
172
|
+
const _refVersion = 2;
|
|
173
|
+
const self = this;
|
|
174
|
+
this.constructorName = name;
|
|
175
|
+
this.constructorOpts = opts;
|
|
176
|
+
if (args && "ref" in args) {
|
|
177
|
+
const ref = reference();
|
|
178
|
+
this.cdn = output(ref.cdn);
|
|
179
|
+
this.kvStoreArn = ref.kvStoreArn;
|
|
180
|
+
this.kvNamespace = ref.kvNamespace;
|
|
181
|
+
this.hasInlineRoutes = ref.hasInlineRoutes;
|
|
182
|
+
registerOutputs();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const hasInlineRoutes = args.routes !== undefined;
|
|
186
|
+
let cdn, kvStoreArn, kvNamespace;
|
|
187
|
+
if (hasInlineRoutes) {
|
|
188
|
+
cdn = handleInlineRoutes();
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
const r = handleLazyRoutes();
|
|
192
|
+
cdn = output(r.distribution);
|
|
193
|
+
kvStoreArn = r.kvStoreArn;
|
|
194
|
+
kvNamespace = output(r.kvNamespace);
|
|
195
|
+
}
|
|
196
|
+
this.cdn = cdn;
|
|
197
|
+
this.kvStoreArn = kvStoreArn;
|
|
198
|
+
this.kvNamespace = kvNamespace;
|
|
199
|
+
this.hasInlineRoutes = output(hasInlineRoutes);
|
|
200
|
+
registerOutputs();
|
|
201
|
+
function reference() {
|
|
202
|
+
const ref = args;
|
|
203
|
+
const cdn = Cdn.get(`${name}Cdn`, ref.distributionID, { parent: self });
|
|
204
|
+
const tags = cdn.nodes.distribution.tags.apply((tags) => {
|
|
205
|
+
if ((tags === null || tags === void 0 ? void 0 : tags["sst:ref:version"]) !== _refVersion.toString()) {
|
|
206
|
+
throw new VisibleError([
|
|
207
|
+
`There have been some minor changes to the "Router" component that's being referenced by "${name}".\n`,
|
|
208
|
+
`To update, you'll need to redeploy the stage where the Router was created. And then redeploy this stage.`,
|
|
209
|
+
].join("\n"));
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
kvStoreArn: tags === null || tags === void 0 ? void 0 : tags["sst:ref:kv"],
|
|
213
|
+
kvNamespace: tags === null || tags === void 0 ? void 0 : tags["sst:ref:kv-namespace"],
|
|
214
|
+
hasInlineRoutes: (tags === null || tags === void 0 ? void 0 : tags["sst:ref:kv"]) === undefined,
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
cdn,
|
|
219
|
+
kvStoreArn: tags.kvStoreArn,
|
|
220
|
+
kvNamespace: tags.kvNamespace,
|
|
221
|
+
hasInlineRoutes: tags.hasInlineRoutes,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function registerOutputs() {
|
|
225
|
+
self.registerOutputs({
|
|
226
|
+
_hint: args._skipHint ? undefined : self.url,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function handleInlineRoutes() {
|
|
230
|
+
let defaultCachePolicy;
|
|
231
|
+
let defaultCfFunction;
|
|
232
|
+
let defaultOac;
|
|
233
|
+
const routes = normalizeRoutes();
|
|
234
|
+
const cdn = createCdn();
|
|
235
|
+
return cdn;
|
|
236
|
+
function normalizeRoutes() {
|
|
237
|
+
return output(args.routes).apply((routes) => {
|
|
238
|
+
var _a;
|
|
239
|
+
const normalizedRoutes = Object.fromEntries(Object.entries(routes).map(([path, route]) => {
|
|
240
|
+
// Route path must start with "/"
|
|
241
|
+
if (!path.startsWith("/"))
|
|
242
|
+
throw new Error(`In "${name}" Router, the route path "${path}" must start with a "/"`);
|
|
243
|
+
route = typeof route === "string" ? { url: route } : route;
|
|
244
|
+
const hasUrl = "url" in route ? 1 : 0;
|
|
245
|
+
const hasBucket = "bucket" in route ? 1 : 0;
|
|
246
|
+
if (hasUrl + hasBucket !== 1)
|
|
247
|
+
throw new Error(`In "${name}" Router, the route path "${path}" can only have one of url or bucket`);
|
|
248
|
+
return [path, route];
|
|
249
|
+
}));
|
|
250
|
+
normalizedRoutes["/*"] = (_a = normalizedRoutes["/*"]) !== null && _a !== void 0 ? _a : {
|
|
251
|
+
url: "https://do-not-exist.sst.dev",
|
|
252
|
+
};
|
|
253
|
+
return normalizedRoutes;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function createCfRequestDefaultFunction() {
|
|
257
|
+
defaultCfFunction =
|
|
258
|
+
defaultCfFunction !== null && defaultCfFunction !== void 0 ? defaultCfFunction : new cloudfront.Function(`${name}CloudfrontFunction`, {
|
|
259
|
+
runtime: "cloudfront-js-2.0",
|
|
260
|
+
code: [
|
|
261
|
+
`async function handler(event) {`,
|
|
262
|
+
` event.request.headers["x-forwarded-host"] = event.request.headers.host;`,
|
|
263
|
+
` return event.request;`,
|
|
264
|
+
`}`,
|
|
265
|
+
].join("\n"),
|
|
266
|
+
}, { parent: self });
|
|
267
|
+
return defaultCfFunction;
|
|
268
|
+
}
|
|
269
|
+
function createCfRequestFunction(path, config, rewrite, injectHostHeader) {
|
|
270
|
+
var _a, _b;
|
|
271
|
+
return new cloudfront.Function(`${name}CloudfrontFunction${hashStringToPrettyString(path, 8)}`, {
|
|
272
|
+
runtime: "cloudfront-js-2.0",
|
|
273
|
+
keyValueStoreAssociations: (config === null || config === void 0 ? void 0 : config.kvStore)
|
|
274
|
+
? [config.kvStore]
|
|
275
|
+
: (_a = config === null || config === void 0 ? void 0 : config.kvStores) !== null && _a !== void 0 ? _a : [],
|
|
276
|
+
code: `
|
|
277
|
+
async function handler(event) {
|
|
278
|
+
${injectHostHeader
|
|
279
|
+
? `event.request.headers["x-forwarded-host"] = event.request.headers.host;`
|
|
280
|
+
: ""}
|
|
281
|
+
${rewrite
|
|
282
|
+
? `
|
|
283
|
+
const re = new RegExp("${rewrite.regex}");
|
|
284
|
+
event.request.uri = event.request.uri.replace(re, "${rewrite.to}");`
|
|
285
|
+
: ""}
|
|
286
|
+
${(_b = config === null || config === void 0 ? void 0 : config.injection) !== null && _b !== void 0 ? _b : ""}
|
|
287
|
+
return event.request;
|
|
288
|
+
}`,
|
|
289
|
+
}, { parent: self });
|
|
290
|
+
}
|
|
291
|
+
function createCfResponseFunction(path, config) {
|
|
292
|
+
var _a, _b;
|
|
293
|
+
return new cloudfront.Function(`${name}CloudfrontFunctionResponse${hashStringToPrettyString(path, 8)}`, {
|
|
294
|
+
runtime: "cloudfront-js-2.0",
|
|
295
|
+
keyValueStoreAssociations: config.kvStore
|
|
296
|
+
? [config.kvStore]
|
|
297
|
+
: (_a = config.kvStores) !== null && _a !== void 0 ? _a : [],
|
|
298
|
+
code: `
|
|
299
|
+
async function handler(event) {
|
|
300
|
+
${(_b = config.injection) !== null && _b !== void 0 ? _b : ""}
|
|
301
|
+
return event.response;
|
|
302
|
+
}`,
|
|
303
|
+
}, { parent: self });
|
|
304
|
+
}
|
|
305
|
+
function createOriginAccessControl() {
|
|
306
|
+
defaultOac =
|
|
307
|
+
defaultOac !== null && defaultOac !== void 0 ? defaultOac : new OriginAccessControl(`${name}S3AccessControl`, { name: physicalName(64, name) }, { parent: self, ignoreChanges: ["name"] });
|
|
308
|
+
return defaultOac;
|
|
309
|
+
}
|
|
310
|
+
function createCachePolicy() {
|
|
311
|
+
var _a;
|
|
312
|
+
defaultCachePolicy =
|
|
313
|
+
defaultCachePolicy !== null && defaultCachePolicy !== void 0 ? defaultCachePolicy : new cloudfront.CachePolicy(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.cachePolicy, `${name}CachePolicy`, {
|
|
314
|
+
comment: `${name} router cache policy`,
|
|
315
|
+
defaultTtl: 0,
|
|
316
|
+
maxTtl: 31536000, // 1 year
|
|
317
|
+
minTtl: 0,
|
|
318
|
+
parametersInCacheKeyAndForwardedToOrigin: {
|
|
319
|
+
cookiesConfig: {
|
|
320
|
+
cookieBehavior: "none",
|
|
321
|
+
},
|
|
322
|
+
headersConfig: {
|
|
323
|
+
headerBehavior: "none",
|
|
324
|
+
},
|
|
325
|
+
queryStringsConfig: {
|
|
326
|
+
queryStringBehavior: "all",
|
|
327
|
+
},
|
|
328
|
+
enableAcceptEncodingBrotli: true,
|
|
329
|
+
enableAcceptEncodingGzip: true,
|
|
330
|
+
},
|
|
331
|
+
}, { parent: self }));
|
|
332
|
+
return defaultCachePolicy;
|
|
333
|
+
}
|
|
334
|
+
function createCdn() {
|
|
335
|
+
return routes.apply((routes) => {
|
|
336
|
+
var _a;
|
|
337
|
+
const distributionData = Object.entries(routes).map(([path, route]) => {
|
|
338
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
339
|
+
if ("url" in route) {
|
|
340
|
+
return {
|
|
341
|
+
origin: {
|
|
342
|
+
originId: path,
|
|
343
|
+
domainName: new URL(route.url).host,
|
|
344
|
+
customOriginConfig: {
|
|
345
|
+
httpPort: 80,
|
|
346
|
+
httpsPort: 443,
|
|
347
|
+
originProtocolPolicy: "https-only",
|
|
348
|
+
originReadTimeout: 20,
|
|
349
|
+
originSslProtocols: ["TLSv1.2"],
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
behavior: {
|
|
353
|
+
pathPattern: path,
|
|
354
|
+
targetOriginId: path,
|
|
355
|
+
functionAssociations: [
|
|
356
|
+
{
|
|
357
|
+
eventType: "viewer-request",
|
|
358
|
+
functionArn: ((_a = route.edge) === null || _a === void 0 ? void 0 : _a.viewerRequest) || route.rewrite
|
|
359
|
+
? createCfRequestFunction(path, (_b = route.edge) === null || _b === void 0 ? void 0 : _b.viewerRequest, route.rewrite, true).arn
|
|
360
|
+
: createCfRequestDefaultFunction().arn,
|
|
361
|
+
},
|
|
362
|
+
...(((_c = route.edge) === null || _c === void 0 ? void 0 : _c.viewerResponse)
|
|
363
|
+
? [
|
|
364
|
+
{
|
|
365
|
+
eventType: "viewer-response",
|
|
366
|
+
functionArn: createCfResponseFunction(path, route.edge.viewerResponse).arn,
|
|
367
|
+
},
|
|
368
|
+
]
|
|
369
|
+
: []),
|
|
370
|
+
],
|
|
371
|
+
viewerProtocolPolicy: "redirect-to-https",
|
|
372
|
+
allowedMethods: [
|
|
373
|
+
"DELETE",
|
|
374
|
+
"GET",
|
|
375
|
+
"HEAD",
|
|
376
|
+
"OPTIONS",
|
|
377
|
+
"PATCH",
|
|
378
|
+
"POST",
|
|
379
|
+
"PUT",
|
|
380
|
+
],
|
|
381
|
+
cachedMethods: ["GET", "HEAD"],
|
|
382
|
+
defaultTtl: 0,
|
|
383
|
+
compress: true,
|
|
384
|
+
cachePolicyId: (_d = route.cachePolicy) !== null && _d !== void 0 ? _d : createCachePolicy().id,
|
|
385
|
+
// CloudFront's Managed-AllViewerExceptHostHeader policy
|
|
386
|
+
originRequestPolicyId: "b689b0a8-53d0-40ab-baf2-68738e2966ac",
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
else if ("bucket" in route) {
|
|
391
|
+
return {
|
|
392
|
+
origin: {
|
|
393
|
+
originId: path,
|
|
394
|
+
domainName: route.bucket instanceof Bucket
|
|
395
|
+
? route.bucket.nodes.bucket.bucketRegionalDomainName
|
|
396
|
+
: route.bucket,
|
|
397
|
+
originPath: "",
|
|
398
|
+
originAccessControlId: createOriginAccessControl().id,
|
|
399
|
+
},
|
|
400
|
+
behavior: {
|
|
401
|
+
pathPattern: path,
|
|
402
|
+
targetOriginId: path,
|
|
403
|
+
functionAssociations: [
|
|
404
|
+
...(((_e = route.edge) === null || _e === void 0 ? void 0 : _e.viewerRequest) || route.rewrite
|
|
405
|
+
? [
|
|
406
|
+
{
|
|
407
|
+
eventType: "viewer-request",
|
|
408
|
+
functionArn: ((_f = route.edge) === null || _f === void 0 ? void 0 : _f.viewerRequest) || route.rewrite
|
|
409
|
+
? createCfRequestFunction(path, (_g = route.edge) === null || _g === void 0 ? void 0 : _g.viewerRequest, route.rewrite, false).arn
|
|
410
|
+
: createCfRequestDefaultFunction().arn,
|
|
411
|
+
},
|
|
412
|
+
]
|
|
413
|
+
: []),
|
|
414
|
+
...(((_h = route.edge) === null || _h === void 0 ? void 0 : _h.viewerResponse)
|
|
415
|
+
? [
|
|
416
|
+
{
|
|
417
|
+
eventType: "viewer-response",
|
|
418
|
+
functionArn: createCfResponseFunction(path, route.edge.viewerResponse).arn,
|
|
419
|
+
},
|
|
420
|
+
]
|
|
421
|
+
: []),
|
|
422
|
+
],
|
|
423
|
+
viewerProtocolPolicy: "redirect-to-https",
|
|
424
|
+
allowedMethods: ["GET", "HEAD", "OPTIONS"],
|
|
425
|
+
cachedMethods: ["GET", "HEAD"],
|
|
426
|
+
compress: true,
|
|
427
|
+
// CloudFront's managed CachingOptimized policy
|
|
428
|
+
cachePolicyId: (_j = route.cachePolicy) !== null && _j !== void 0 ? _j : "658327ea-f89d-4fab-a63d-7e88639e58f6",
|
|
429
|
+
},
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
throw new Error("Invalid route type");
|
|
433
|
+
});
|
|
434
|
+
return new Cdn(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.cdn, `${name}Cdn`, {
|
|
435
|
+
comment: `${name} router`,
|
|
436
|
+
origins: distributionData.map((d) => d.origin),
|
|
437
|
+
defaultCacheBehavior: Object.assign(Object.assign({}, distributionData.find((d) => d.behavior.pathPattern === "/*").behavior), {
|
|
438
|
+
// @ts-expect-error
|
|
439
|
+
pathPattern: undefined }),
|
|
440
|
+
orderedCacheBehaviors: distributionData
|
|
441
|
+
.filter((d) => d.behavior.pathPattern !== "/*")
|
|
442
|
+
.map((d) => d.behavior),
|
|
443
|
+
domain: args.domain,
|
|
444
|
+
wait: true,
|
|
445
|
+
}, { parent: self }));
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function handleLazyRoutes() {
|
|
450
|
+
const kvNamespace = buildRequestKvNamespace();
|
|
451
|
+
const kvStoreArn = createRequestKvStore();
|
|
452
|
+
const requestFunction = createRequestFunction();
|
|
453
|
+
const responseFunction = createResponseFunction();
|
|
454
|
+
const cachePolicyId = createCachePolicy().id;
|
|
455
|
+
const distribution = createDistribution();
|
|
456
|
+
return { kvNamespace, kvStoreArn, distribution };
|
|
457
|
+
function buildRequestKvNamespace() {
|
|
458
|
+
// In the case multiple routers use the same kv store, we need to namespace the keys
|
|
459
|
+
return crypto
|
|
460
|
+
.createHash("md5")
|
|
461
|
+
.update(`${$app.name}-${$app.stage}-${name}`)
|
|
462
|
+
.digest("hex")
|
|
463
|
+
.substring(0, 4);
|
|
464
|
+
}
|
|
465
|
+
function createRequestKvStore() {
|
|
466
|
+
return output(args.edge).apply((edge) => {
|
|
467
|
+
const viewerRequest = edge === null || edge === void 0 ? void 0 : edge.viewerRequest;
|
|
468
|
+
const userKvStore = viewerRequest === null || viewerRequest === void 0 ? void 0 : viewerRequest.kvStore;
|
|
469
|
+
if (userKvStore)
|
|
470
|
+
return output(userKvStore);
|
|
471
|
+
return new cloudfront.KeyValueStore(`${name}KvStore`, {}, { parent: self }).arn;
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
function createCachePolicy() {
|
|
475
|
+
var _a;
|
|
476
|
+
return new cloudfront.CachePolicy(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.cachePolicy, `${name}ServerCachePolicy`, {
|
|
477
|
+
comment: "SST server response cache policy",
|
|
478
|
+
defaultTtl: 0,
|
|
479
|
+
maxTtl: 31536000, // 1 year
|
|
480
|
+
minTtl: 0,
|
|
481
|
+
parametersInCacheKeyAndForwardedToOrigin: {
|
|
482
|
+
cookiesConfig: {
|
|
483
|
+
cookieBehavior: "none",
|
|
484
|
+
},
|
|
485
|
+
headersConfig: {
|
|
486
|
+
headerBehavior: "whitelist",
|
|
487
|
+
headers: {
|
|
488
|
+
items: ["x-open-next-cache-key"],
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
queryStringsConfig: {
|
|
492
|
+
queryStringBehavior: "all",
|
|
493
|
+
},
|
|
494
|
+
enableAcceptEncodingBrotli: true,
|
|
495
|
+
enableAcceptEncodingGzip: true,
|
|
496
|
+
},
|
|
497
|
+
}, { parent: self }));
|
|
498
|
+
}
|
|
499
|
+
function createRequestFunction() {
|
|
500
|
+
return output(args.edge).apply((edge) => {
|
|
501
|
+
var _a, _b;
|
|
502
|
+
const userInjection = (_b = (_a = edge === null || edge === void 0 ? void 0 : edge.viewerRequest) === null || _a === void 0 ? void 0 : _a.injection) !== null && _b !== void 0 ? _b : "";
|
|
503
|
+
const blockCloudfrontUrlInjection = args.domain
|
|
504
|
+
? CF_BLOCK_CLOUDFRONT_URL_INJECTION
|
|
505
|
+
: "";
|
|
506
|
+
return new cloudfront.Function(`${name}CloudfrontFunctionRequest`, {
|
|
507
|
+
runtime: "cloudfront-js-2.0",
|
|
508
|
+
keyValueStoreAssociations: kvStoreArn ? [kvStoreArn] : [],
|
|
509
|
+
code: interpolate `
|
|
510
|
+
import cf from "cloudfront";
|
|
511
|
+
async function handler(event) {
|
|
512
|
+
${userInjection}
|
|
513
|
+
${blockCloudfrontUrlInjection}
|
|
514
|
+
${CF_ROUTER_INJECTION}
|
|
515
|
+
|
|
516
|
+
const routerNS = "${kvNamespace}";
|
|
517
|
+
|
|
518
|
+
async function getRoutes() {
|
|
519
|
+
let routes = [];
|
|
520
|
+
try {
|
|
521
|
+
const v = await cf.kvs().get(routerNS + ":routes");
|
|
522
|
+
routes = JSON.parse(v);
|
|
523
|
+
|
|
524
|
+
// handle chunked routes
|
|
525
|
+
if (routes.parts) {
|
|
526
|
+
const chunkPromises = [];
|
|
527
|
+
for (let i = 0; i < routes.parts; i++) {
|
|
528
|
+
chunkPromises.push(cf.kvs().get(routerNS + ":routes:" + i));
|
|
529
|
+
}
|
|
530
|
+
const chunks = await Promise.all(chunkPromises);
|
|
531
|
+
routes = JSON.parse(chunks.join(""));
|
|
532
|
+
}
|
|
533
|
+
} catch (e) {}
|
|
534
|
+
return routes;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
async function matchRoute(routes) {
|
|
538
|
+
const requestHost = event.request.headers.host.value;
|
|
539
|
+
const match = routes
|
|
540
|
+
${
|
|
541
|
+
/*
|
|
542
|
+
Route format: [type, routeNamespace, hostRegex, pathPrefix]
|
|
543
|
+
- First sort by host pattern (longest first)
|
|
544
|
+
- Then sort by path prefix (longest first)
|
|
545
|
+
*/ ""}
|
|
546
|
+
.map(r => {
|
|
547
|
+
var parts = r.split(",");
|
|
548
|
+
return {
|
|
549
|
+
type: parts[0],
|
|
550
|
+
routeNs: parts[1],
|
|
551
|
+
host: parts[2],
|
|
552
|
+
path: parts[3]
|
|
553
|
+
};
|
|
554
|
+
})
|
|
555
|
+
.sort((a, b) => {
|
|
556
|
+
return (a.host.length !== b.host.length)
|
|
557
|
+
? b.host.length - a.host.length
|
|
558
|
+
: b.path.length - a.path.length;
|
|
559
|
+
})
|
|
560
|
+
.find(r => {
|
|
561
|
+
return (
|
|
562
|
+
// matching hosts
|
|
563
|
+
(
|
|
564
|
+
r.host === "" || (
|
|
565
|
+
r.host.includes("*")
|
|
566
|
+
? new RegExp(r.host).test("^" + requestHost + "$")
|
|
567
|
+
: r.host.replaceAll("\\\\.", ".") === requestHost
|
|
568
|
+
)
|
|
569
|
+
)
|
|
570
|
+
&&
|
|
571
|
+
// matching paths
|
|
572
|
+
event.request.uri.startsWith(r.path)
|
|
573
|
+
);
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// Load metadata
|
|
577
|
+
if (match) {
|
|
578
|
+
try {
|
|
579
|
+
const v = await cf.kvs().get(match.routeNs + ":metadata");
|
|
580
|
+
return { type: match.type, routeNs: match.routeNs, metadata: JSON.parse(v) };
|
|
581
|
+
} catch (e) {}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// Look up the route
|
|
586
|
+
const routes = await getRoutes();
|
|
587
|
+
const route = await matchRoute(routes);
|
|
588
|
+
if (!route) return event.request;
|
|
589
|
+
if (route.metadata.rewrite) {
|
|
590
|
+
const rw = route.metadata.rewrite;
|
|
591
|
+
event.request.uri = event.request.uri.replace(new RegExp(rw.regex), rw.to);
|
|
592
|
+
}
|
|
593
|
+
if (route.type === "url") setUrlOrigin(route.metadata.host, route.metadata.origin);
|
|
594
|
+
if (route.type === "bucket") setS3Origin(route.metadata.domain, route.metadata.origin);
|
|
595
|
+
if (route.type === "site") await routeSite(route.routeNs, route.metadata);
|
|
596
|
+
return event.request;
|
|
597
|
+
}`,
|
|
598
|
+
}, { parent: self });
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
function createResponseFunction() {
|
|
602
|
+
return output(args.edge).apply((edge) => {
|
|
603
|
+
const userConfig = edge === null || edge === void 0 ? void 0 : edge.viewerResponse;
|
|
604
|
+
const userInjection = userConfig === null || userConfig === void 0 ? void 0 : userConfig.injection;
|
|
605
|
+
const kvStoreArn = userConfig === null || userConfig === void 0 ? void 0 : userConfig.kvStore;
|
|
606
|
+
if (!userInjection)
|
|
607
|
+
return;
|
|
608
|
+
return new cloudfront.Function(`${name}CloudfrontFunctionResponse`, {
|
|
609
|
+
runtime: "cloudfront-js-2.0",
|
|
610
|
+
keyValueStoreAssociations: kvStoreArn ? [kvStoreArn] : [],
|
|
611
|
+
code: `
|
|
612
|
+
import cf from "cloudfront";
|
|
613
|
+
async function handler(event) {
|
|
614
|
+
${userInjection}
|
|
615
|
+
return event.response;
|
|
616
|
+
}`,
|
|
617
|
+
}, { parent: self });
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function createDistribution() {
|
|
621
|
+
var _a;
|
|
622
|
+
return new Cdn(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.cdn, `${name}Cdn`, {
|
|
623
|
+
comment: `${name} app`,
|
|
624
|
+
domain: args.domain,
|
|
625
|
+
origins: [
|
|
626
|
+
{
|
|
627
|
+
originId: "default",
|
|
628
|
+
domainName: "placeholder.sst.dev",
|
|
629
|
+
customOriginConfig: {
|
|
630
|
+
httpPort: 80,
|
|
631
|
+
httpsPort: 443,
|
|
632
|
+
originProtocolPolicy: "http-only",
|
|
633
|
+
originReadTimeout: 20,
|
|
634
|
+
originSslProtocols: ["TLSv1.2"],
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
],
|
|
638
|
+
defaultCacheBehavior: {
|
|
639
|
+
targetOriginId: "default",
|
|
640
|
+
viewerProtocolPolicy: "redirect-to-https",
|
|
641
|
+
allowedMethods: [
|
|
642
|
+
"DELETE",
|
|
643
|
+
"GET",
|
|
644
|
+
"HEAD",
|
|
645
|
+
"OPTIONS",
|
|
646
|
+
"PATCH",
|
|
647
|
+
"POST",
|
|
648
|
+
"PUT",
|
|
649
|
+
],
|
|
650
|
+
cachedMethods: ["GET", "HEAD"],
|
|
651
|
+
compress: true,
|
|
652
|
+
cachePolicyId,
|
|
653
|
+
// CloudFront's Managed-AllViewerExceptHostHeader policy
|
|
654
|
+
originRequestPolicyId: "b689b0a8-53d0-40ab-baf2-68738e2966ac",
|
|
655
|
+
functionAssociations: all([
|
|
656
|
+
requestFunction,
|
|
657
|
+
responseFunction,
|
|
658
|
+
]).apply(([reqFn, resFn]) => [
|
|
659
|
+
{ eventType: "viewer-request", functionArn: reqFn.arn },
|
|
660
|
+
...(resFn
|
|
661
|
+
? [{ eventType: "viewer-response", functionArn: resFn.arn }]
|
|
662
|
+
: []),
|
|
663
|
+
]),
|
|
664
|
+
},
|
|
665
|
+
tags: {
|
|
666
|
+
"sst:ref:kv": kvStoreArn,
|
|
667
|
+
"sst:ref:kv-namespace": kvNamespace,
|
|
668
|
+
"sst:ref:version": _refVersion.toString(),
|
|
669
|
+
},
|
|
670
|
+
}, { parent: self }));
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* The ID of the Router distribution.
|
|
676
|
+
*/
|
|
677
|
+
get distributionID() {
|
|
678
|
+
return this.cdn.nodes.distribution.id;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* The URL of the Router.
|
|
682
|
+
*
|
|
683
|
+
* If the `domain` is set, this is the URL with the custom domain.
|
|
684
|
+
* Otherwise, it's the auto-generated CloudFront URL.
|
|
685
|
+
*/
|
|
686
|
+
get url() {
|
|
687
|
+
return all([this.cdn.domainUrl, this.cdn.url]).apply(([domainUrl, url]) => domainUrl !== null && domainUrl !== void 0 ? domainUrl : url);
|
|
688
|
+
}
|
|
689
|
+
/** @internal */
|
|
690
|
+
get _kvStoreArn() {
|
|
691
|
+
return this.kvStoreArn;
|
|
692
|
+
}
|
|
693
|
+
/** @internal */
|
|
694
|
+
get _kvNamespace() {
|
|
695
|
+
return this.kvNamespace;
|
|
696
|
+
}
|
|
697
|
+
/** @internal */
|
|
698
|
+
get _hasInlineRoutes() {
|
|
699
|
+
return this.hasInlineRoutes;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* The underlying [resources](/docs/components/#nodes) this component creates.
|
|
703
|
+
*/
|
|
704
|
+
get nodes() {
|
|
705
|
+
return {
|
|
706
|
+
/**
|
|
707
|
+
* The Amazon CloudFront CDN resource.
|
|
708
|
+
*/
|
|
709
|
+
cdn: this.cdn,
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Add a route to a destination URL.
|
|
714
|
+
*
|
|
715
|
+
* @param pattern The path pattern to match for this route.
|
|
716
|
+
* @param url The destination URL to route matching requests to.
|
|
717
|
+
* @param args Configure the route.
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
*
|
|
721
|
+
* You can match a route based on:
|
|
722
|
+
*
|
|
723
|
+
* - A path like `/api`
|
|
724
|
+
* - A domain pattern like `api.example.com`
|
|
725
|
+
* - A combined pattern like `dev.example.com/api`
|
|
726
|
+
*
|
|
727
|
+
* For example, to match a path.
|
|
728
|
+
*
|
|
729
|
+
* ```ts title="sst.config.ts"
|
|
730
|
+
* router.route("/api", "https://api.example.com");
|
|
731
|
+
* ```
|
|
732
|
+
*
|
|
733
|
+
* Or match a domain.
|
|
734
|
+
*
|
|
735
|
+
* ```ts title="sst.config.ts"
|
|
736
|
+
* router.route("api.myapp.com/", "https://api.example.com");
|
|
737
|
+
* ```
|
|
738
|
+
*
|
|
739
|
+
* Or a combined pattern.
|
|
740
|
+
*
|
|
741
|
+
* ```ts title="sst.config.ts"
|
|
742
|
+
* router.route("dev.myapp.com/api", "https://api.example.com");
|
|
743
|
+
* ```
|
|
744
|
+
*
|
|
745
|
+
* You can also rewrite the request path.
|
|
746
|
+
*
|
|
747
|
+
* ```ts title="sst.config.ts"
|
|
748
|
+
* router.route("/api", "https://api.example.com", {
|
|
749
|
+
* rewrite: {
|
|
750
|
+
* regex: "^/api/(.*)$",
|
|
751
|
+
* to: "/$1"
|
|
752
|
+
* }
|
|
753
|
+
* });
|
|
754
|
+
* ```
|
|
755
|
+
*
|
|
756
|
+
* Here something like `/api/users/profile` will be routed to
|
|
757
|
+
* `https://api.example.com/users/profile`.
|
|
758
|
+
*/
|
|
759
|
+
route(pattern, url, args) {
|
|
760
|
+
all([pattern, args, this.hasInlineRoutes]).apply(([pattern, args, hasInlineRoutes]) => {
|
|
761
|
+
if (hasInlineRoutes)
|
|
762
|
+
throw new VisibleError("Cannot use both `routes` and `.route()` function to add routes.");
|
|
763
|
+
new RouterUrlRoute(`${this.constructorName}Route${pattern}`, {
|
|
764
|
+
store: this.kvStoreArn,
|
|
765
|
+
routerNamespace: this.kvNamespace,
|
|
766
|
+
pattern,
|
|
767
|
+
url,
|
|
768
|
+
routeArgs: args,
|
|
769
|
+
}, { provider: this.constructorOpts.provider });
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Add a route to an S3 bucket.
|
|
774
|
+
*
|
|
775
|
+
* @param pattern The path pattern to match for this route.
|
|
776
|
+
* @param bucket The S3 bucket to route matching requests to.
|
|
777
|
+
* @param args Configure the route.
|
|
778
|
+
*
|
|
779
|
+
* @example
|
|
780
|
+
*
|
|
781
|
+
* Let's say you have an S3 bucket that gives CloudFront `access`.
|
|
782
|
+
*
|
|
783
|
+
* ```ts title="sst.config.ts" {2}
|
|
784
|
+
* const bucket = new sst.aws.Bucket("MyBucket", {
|
|
785
|
+
* access: "cloudfront"
|
|
786
|
+
* });
|
|
787
|
+
* ```
|
|
788
|
+
*
|
|
789
|
+
* You can match a pattern and route to it based on:
|
|
790
|
+
*
|
|
791
|
+
* - A path like `/api`
|
|
792
|
+
* - A domain pattern like `api.example.com`
|
|
793
|
+
* - A combined pattern like `dev.example.com/api`
|
|
794
|
+
*
|
|
795
|
+
* For example, to match a path.
|
|
796
|
+
*
|
|
797
|
+
* ```ts title="sst.config.ts"
|
|
798
|
+
* router.routeBucket("/files", bucket);
|
|
799
|
+
* ```
|
|
800
|
+
*
|
|
801
|
+
* Or match a domain.
|
|
802
|
+
*
|
|
803
|
+
* ```ts title="sst.config.ts"
|
|
804
|
+
* router.routeBucket("files.example.com", bucket);
|
|
805
|
+
* ```
|
|
806
|
+
*
|
|
807
|
+
* Or a combined pattern.
|
|
808
|
+
*
|
|
809
|
+
* ```ts title="sst.config.ts"
|
|
810
|
+
* router.routeBucket("dev.example.com/files", bucket);
|
|
811
|
+
* ```
|
|
812
|
+
*
|
|
813
|
+
* You can also rewrite the request path.
|
|
814
|
+
*
|
|
815
|
+
* ```ts title="sst.config.ts"
|
|
816
|
+
* router.routeBucket("/files", bucket, {
|
|
817
|
+
* rewrite: {
|
|
818
|
+
* regex: "^/files/(.*)$",
|
|
819
|
+
* to: "/$1"
|
|
820
|
+
* }
|
|
821
|
+
* });
|
|
822
|
+
* ```
|
|
823
|
+
*
|
|
824
|
+
* Here something like `/files/logo.png` will be routed to
|
|
825
|
+
* `/logo.png`.
|
|
826
|
+
*/
|
|
827
|
+
routeBucket(pattern, bucket, args) {
|
|
828
|
+
all([pattern, args, this.hasInlineRoutes]).apply(([pattern, args, hasInlineRoutes]) => {
|
|
829
|
+
if (hasInlineRoutes)
|
|
830
|
+
throw new VisibleError("Cannot use both `routes` and `.routeBucket()` function to add routes.");
|
|
831
|
+
new RouterBucketRoute(`${this.constructorName}Route${pattern}`, {
|
|
832
|
+
store: this.kvStoreArn,
|
|
833
|
+
routerNamespace: this.kvNamespace,
|
|
834
|
+
pattern,
|
|
835
|
+
bucket,
|
|
836
|
+
routeArgs: args,
|
|
837
|
+
}, { provider: this.constructorOpts.provider });
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Add a route to a frontend or static site.
|
|
842
|
+
*
|
|
843
|
+
* @param pattern The path pattern to match for this route.
|
|
844
|
+
* @param site The frontend or static site to route matching requests to.
|
|
845
|
+
*
|
|
846
|
+
* @deprecated The `routeSite` function has been deprecated. Set the `route` on the
|
|
847
|
+
* site components to route the site through this Router.
|
|
848
|
+
*/
|
|
849
|
+
routeSite(pattern, site) {
|
|
850
|
+
throw new VisibleError(`The "routeSite" function has been deprecated. Configure the new "route" prop on the site component to route the site through this Router.`);
|
|
851
|
+
}
|
|
852
|
+
/** @internal */
|
|
853
|
+
getSSTLink() {
|
|
854
|
+
return {
|
|
855
|
+
properties: {
|
|
856
|
+
url: this.url,
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Reference an existing Router with the given Router distribution ID.
|
|
862
|
+
*
|
|
863
|
+
* @param name The name of the component.
|
|
864
|
+
* @param distributionID The ID of the existing Router distribution.
|
|
865
|
+
* @param opts? Resource options.
|
|
866
|
+
*
|
|
867
|
+
* This is useful when you create a Router in one stage and want to share it in
|
|
868
|
+
* another. It avoids having to create a new Router in the other stage.
|
|
869
|
+
*
|
|
870
|
+
* :::tip
|
|
871
|
+
* You can use the `static get` method to share a Router across stages.
|
|
872
|
+
* :::
|
|
873
|
+
*
|
|
874
|
+
* @example
|
|
875
|
+
* Let's say you create a Router in the `dev` stage. And in your personal stage
|
|
876
|
+
* `frank`, you want to share the same Router.
|
|
877
|
+
*
|
|
878
|
+
* ```ts title="sst.config.ts"
|
|
879
|
+
* const router = $app.stage === "frank"
|
|
880
|
+
* ? sst.aws.Router.get("MyRouter", "E2IDLMESRN6V62")
|
|
881
|
+
* : new sst.aws.Router("MyRouter");
|
|
882
|
+
* ```
|
|
883
|
+
*
|
|
884
|
+
* Here `E2IDLMESRN6V62` is the ID of the Router distribution created in the
|
|
885
|
+
* `dev` stage. You can find this by outputting the distribution ID in the `dev`
|
|
886
|
+
* stage.
|
|
887
|
+
*
|
|
888
|
+
* ```ts title="sst.config.ts"
|
|
889
|
+
* return {
|
|
890
|
+
* router: router.distributionID
|
|
891
|
+
* };
|
|
892
|
+
* ```
|
|
893
|
+
*
|
|
894
|
+
* Learn more about [how to configure a router for your app](/docs/configure-a-router).
|
|
895
|
+
*/
|
|
896
|
+
static get(name, distributionID, opts) {
|
|
897
|
+
return new Router(name, {
|
|
898
|
+
ref: true,
|
|
899
|
+
distributionID: distributionID,
|
|
900
|
+
}, opts);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
const __pulumiType = "sst:aws:Router";
|
|
904
|
+
// @ts-expect-error
|
|
905
|
+
Router.__pulumiType = __pulumiType;
|
|
906
|
+
export const CF_BLOCK_CLOUDFRONT_URL_INJECTION = `
|
|
907
|
+
if (event.request.headers.host.value.includes('cloudfront.net')) {
|
|
908
|
+
return {
|
|
909
|
+
statusCode: 403,
|
|
910
|
+
statusDescription: 'Forbidden',
|
|
911
|
+
body: {
|
|
912
|
+
encoding: "text",
|
|
913
|
+
data: '<html><head><title>403 Forbidden</title></head><body><center><h1>403 Forbidden</h1></center></body></html>'
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
}`;
|
|
917
|
+
export const CF_ROUTER_INJECTION = `
|
|
918
|
+
async function routeSite(kvNamespace, metadata) {
|
|
919
|
+
const baselessUri = metadata.base
|
|
920
|
+
? event.request.uri.replace(metadata.base, "")
|
|
921
|
+
: event.request.uri;
|
|
922
|
+
|
|
923
|
+
// Route to S3 files
|
|
924
|
+
try {
|
|
925
|
+
// check using baselessUri b/c files are stored in the root
|
|
926
|
+
const u = decodeURIComponent(baselessUri);
|
|
927
|
+
const postfixes = u.endsWith("/")
|
|
928
|
+
? ["index.html"]
|
|
929
|
+
: ["", ".html", "/index.html"];
|
|
930
|
+
const v = await Promise.any(postfixes.map(p => cf.kvs().get(kvNamespace + ":" + u + p).then(v => p)));
|
|
931
|
+
// files are stored in a subdirectory, add it to the request uri
|
|
932
|
+
event.request.uri = metadata.s3.dir + event.request.uri + v;
|
|
933
|
+
setS3Origin(metadata.s3.domain);
|
|
934
|
+
return;
|
|
935
|
+
} catch (e) {}
|
|
936
|
+
|
|
937
|
+
// Route to S3 routes
|
|
938
|
+
if (metadata.s3 && metadata.s3.routes) {
|
|
939
|
+
for (var i=0, l=metadata.s3.routes.length; i<l; i++) {
|
|
940
|
+
const route = metadata.s3.routes[i];
|
|
941
|
+
if (baselessUri.startsWith(route)) {
|
|
942
|
+
event.request.uri = metadata.s3.dir + event.request.uri;
|
|
943
|
+
// uri ends with /, ie. /usage/ -> /usage/index.html
|
|
944
|
+
if (event.request.uri.endsWith("/")) {
|
|
945
|
+
event.request.uri += "index.html";
|
|
946
|
+
}
|
|
947
|
+
// uri ends with non-file, ie. /usage -> /usage/index.html
|
|
948
|
+
else if (!event.request.uri.split("/").pop().includes(".")) {
|
|
949
|
+
event.request.uri += "/index.html";
|
|
950
|
+
}
|
|
951
|
+
setS3Origin(metadata.s3.domain);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// Route to S3 custom 404 (no servers)
|
|
958
|
+
if (metadata.custom404) {
|
|
959
|
+
event.request.uri = metadata.s3.dir + (metadata.base ? metadata.base : "") + metadata.custom404;
|
|
960
|
+
setS3Origin(metadata.s3.domain);
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// Route to image optimizer
|
|
965
|
+
if (metadata.image && baselessUri.startsWith(metadata.image.route)) {
|
|
966
|
+
setUrlOrigin(metadata.image.host);
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// Route to servers
|
|
971
|
+
if (metadata.servers){
|
|
972
|
+
event.request.headers["x-forwarded-host"] = event.request.headers.host;
|
|
973
|
+
${
|
|
974
|
+
// Note: In SvelteKit, form action requests contain "/" in request query string
|
|
975
|
+
// ie. POST request with query string "?/action"
|
|
976
|
+
// CloudFront does not allow query string with "/". It needs to be encoded.
|
|
977
|
+
""}
|
|
978
|
+
for (var key in event.request.querystring) {
|
|
979
|
+
if (key.includes("/")) {
|
|
980
|
+
event.request.querystring[encodeURIComponent(key)] = event.request.querystring[key];
|
|
981
|
+
delete event.request.querystring[key];
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
setNextjsGeoHeaders();
|
|
985
|
+
setNextjsCacheKey();
|
|
986
|
+
setUrlOrigin(findNearestServer(metadata.servers), metadata.origin);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
function setNextjsGeoHeaders() {
|
|
990
|
+
${
|
|
991
|
+
// Inject the CloudFront viewer country, region, latitude, and longitude headers into
|
|
992
|
+
// the request headers for OpenNext to use them for OpenNext to use them
|
|
993
|
+
""}
|
|
994
|
+
if(event.request.headers["cloudfront-viewer-city"]) {
|
|
995
|
+
event.request.headers["x-open-next-city"] = event.request.headers["cloudfront-viewer-city"];
|
|
996
|
+
}
|
|
997
|
+
if(event.request.headers["cloudfront-viewer-country"]) {
|
|
998
|
+
event.request.headers["x-open-next-country"] = event.request.headers["cloudfront-viewer-country"];
|
|
999
|
+
}
|
|
1000
|
+
if(event.request.headers["cloudfront-viewer-region"]) {
|
|
1001
|
+
event.request.headers["x-open-next-region"] = event.request.headers["cloudfront-viewer-region"];
|
|
1002
|
+
}
|
|
1003
|
+
if(event.request.headers["cloudfront-viewer-latitude"]) {
|
|
1004
|
+
event.request.headers["x-open-next-latitude"] = event.request.headers["cloudfront-viewer-latitude"];
|
|
1005
|
+
}
|
|
1006
|
+
if(event.request.headers["cloudfront-viewer-longitude"]) {
|
|
1007
|
+
event.request.headers["x-open-next-longitude"] = event.request.headers["cloudfront-viewer-longitude"];
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
function setNextjsCacheKey() {
|
|
1012
|
+
${
|
|
1013
|
+
// This function is used to improve cache hit ratio by setting the cache key
|
|
1014
|
+
// based on the request headers and the path. `next/image` only needs the
|
|
1015
|
+
// accept header, and this header is not useful for the rest of the query
|
|
1016
|
+
""}
|
|
1017
|
+
var cacheKey = "";
|
|
1018
|
+
if (event.request.uri.startsWith("/_next/image")) {
|
|
1019
|
+
cacheKey = getHeader("accept");
|
|
1020
|
+
} else {
|
|
1021
|
+
cacheKey =
|
|
1022
|
+
getHeader("rsc") +
|
|
1023
|
+
getHeader("next-router-prefetch") +
|
|
1024
|
+
getHeader("next-router-state-tree") +
|
|
1025
|
+
getHeader("next-url") +
|
|
1026
|
+
getHeader("x-prerender-revalidate");
|
|
1027
|
+
}
|
|
1028
|
+
if (event.request.cookies["__prerender_bypass"]) {
|
|
1029
|
+
cacheKey += event.request.cookies["__prerender_bypass"]
|
|
1030
|
+
? event.request.cookies["__prerender_bypass"].value
|
|
1031
|
+
: "";
|
|
1032
|
+
}
|
|
1033
|
+
var crypto = require("crypto");
|
|
1034
|
+
var hashedKey = crypto.createHash("md5").update(cacheKey).digest("hex");
|
|
1035
|
+
event.request.headers["x-open-next-cache-key"] = { value: hashedKey };
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
function getHeader(key) {
|
|
1039
|
+
var header = event.request.headers[key];
|
|
1040
|
+
if (header) {
|
|
1041
|
+
if (header.multiValue) {
|
|
1042
|
+
return header.multiValue.map((header) => header.value).join(",");
|
|
1043
|
+
}
|
|
1044
|
+
if (header.value) {
|
|
1045
|
+
return header.value;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
return "";
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
function findNearestServer(servers) {
|
|
1052
|
+
if (servers.length === 1) return servers[0][0];
|
|
1053
|
+
|
|
1054
|
+
const h = event.request.headers;
|
|
1055
|
+
const lat = h["cloudfront-viewer-latitude"] && h["cloudfront-viewer-latitude"].value;
|
|
1056
|
+
const lon = h["cloudfront-viewer-longitude"] && h["cloudfront-viewer-longitude"].value;
|
|
1057
|
+
if (!lat || !lon) return servers[0][0];
|
|
1058
|
+
|
|
1059
|
+
return servers
|
|
1060
|
+
.map((s) => ({
|
|
1061
|
+
distance: haversineDistance(lat, lon, s[1], s[2]),
|
|
1062
|
+
host: s[0],
|
|
1063
|
+
}))
|
|
1064
|
+
.sort((a, b) => a.distance - b.distance)[0]
|
|
1065
|
+
.host;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
function haversineDistance(lat1, lon1, lat2, lon2) {
|
|
1069
|
+
const toRad = angle => angle * Math.PI / 180;
|
|
1070
|
+
const radLat1 = toRad(lat1);
|
|
1071
|
+
const radLat2 = toRad(lat2);
|
|
1072
|
+
const dLat = toRad(lat2 - lat1);
|
|
1073
|
+
const dLon = toRad(lon2 - lon1);
|
|
1074
|
+
const a = Math.sin(dLat / 2) ** 2 + Math.cos(radLat1) * Math.cos(radLat2) * Math.sin(dLon / 2) ** 2;
|
|
1075
|
+
return 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
function setUrlOrigin(urlHost, override) {
|
|
1080
|
+
event.request.headers["x-forwarded-host"] = event.request.headers.host;
|
|
1081
|
+
const origin = {
|
|
1082
|
+
domainName: urlHost,
|
|
1083
|
+
customOriginConfig: {
|
|
1084
|
+
port: 443,
|
|
1085
|
+
protocol: "https",
|
|
1086
|
+
sslProtocols: ["TLSv1.2"],
|
|
1087
|
+
},
|
|
1088
|
+
originAccessControlConfig: {
|
|
1089
|
+
enabled: false,
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
override = override ?? {};
|
|
1093
|
+
if (override.protocol === "http") {
|
|
1094
|
+
delete origin.customOriginConfig;
|
|
1095
|
+
}
|
|
1096
|
+
if (override.connectionAttempts) {
|
|
1097
|
+
origin.connectionAttempts = override.connectionAttempts;
|
|
1098
|
+
}
|
|
1099
|
+
if (override.timeouts) {
|
|
1100
|
+
origin.timeouts = override.timeouts;
|
|
1101
|
+
}
|
|
1102
|
+
cf.updateRequestOrigin(origin);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function setS3Origin(s3Domain, override) {
|
|
1106
|
+
delete event.request.headers["Cookies"];
|
|
1107
|
+
delete event.request.headers["cookies"];
|
|
1108
|
+
delete event.request.cookies;
|
|
1109
|
+
|
|
1110
|
+
const origin = {
|
|
1111
|
+
domainName: s3Domain,
|
|
1112
|
+
originAccessControlConfig: {
|
|
1113
|
+
enabled: true,
|
|
1114
|
+
signingBehavior: "always",
|
|
1115
|
+
signingProtocol: "sigv4",
|
|
1116
|
+
originType: "s3",
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
override = override ?? {};
|
|
1120
|
+
if (override.connectionAttempts) {
|
|
1121
|
+
origin.connectionAttempts = override.connectionAttempts;
|
|
1122
|
+
}
|
|
1123
|
+
if (override.timeouts) {
|
|
1124
|
+
origin.timeouts = override.timeouts;
|
|
1125
|
+
}
|
|
1126
|
+
cf.updateRequestOrigin(origin);
|
|
1127
|
+
}`;
|
|
1128
|
+
export function normalizeRouteArgs(route, routeDeprecated) {
|
|
1129
|
+
if (!route && !routeDeprecated)
|
|
1130
|
+
return undefined;
|
|
1131
|
+
return all([route, routeDeprecated]).apply(([route, routeDeprecated]) => {
|
|
1132
|
+
const v = route
|
|
1133
|
+
? route
|
|
1134
|
+
: Object.assign(Object.assign({}, routeDeprecated), { instance: routeDeprecated.router });
|
|
1135
|
+
return v.instance._hasInlineRoutes.apply((hasInlineRoutes) => {
|
|
1136
|
+
if (hasInlineRoutes)
|
|
1137
|
+
throw new VisibleError("Cannot route the site using the provided router. The Router component uses inline routes which has been deprecated.");
|
|
1138
|
+
const pathPrefix = v.path
|
|
1139
|
+
? "/" + v.path.replace(/^\//, "").replace(/\/$/, "")
|
|
1140
|
+
: undefined;
|
|
1141
|
+
return {
|
|
1142
|
+
hostPattern: v.domain
|
|
1143
|
+
? v.domain
|
|
1144
|
+
.replace(/[.+?^${}()|[\]\\]/g, "\\$&") // Escape special regex chars
|
|
1145
|
+
.replace(/\*/g, ".*") // Replace * with .*
|
|
1146
|
+
: undefined,
|
|
1147
|
+
pathPrefix,
|
|
1148
|
+
routerDistributionId: v.instance.nodes.cdn.nodes.distribution.id,
|
|
1149
|
+
routerUrl: v.instance.url.apply((url) => (v.domain ? `https://${v.domain}` : url) + (pathPrefix !== null && pathPrefix !== void 0 ? pathPrefix : "")),
|
|
1150
|
+
routerKvNamespace: v.instance._kvNamespace,
|
|
1151
|
+
routerKvStoreArn: v.instance._kvStoreArn,
|
|
1152
|
+
};
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
//# sourceMappingURL=router.js.map
|