monorise 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/index.d.ts +254 -0
- package/dist/base/index.js +44 -0
- package/dist/base/index.js.map +1 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +461 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/core/index.d.ts +4767 -0
- package/dist/core/index.js +7941 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/react/actions/app.action.d.ts +46 -0
- package/dist/react/actions/app.action.d.ts.map +1 -0
- package/dist/react/actions/auth.action.d.ts +24 -0
- package/dist/react/actions/auth.action.d.ts.map +1 -0
- package/dist/react/actions/config.action.d.ts +10 -0
- package/dist/react/actions/config.action.d.ts.map +1 -0
- package/dist/react/actions/core.action.d.ts +219 -0
- package/dist/react/actions/core.action.d.ts.map +1 -0
- package/dist/react/index.d.ts +1093 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +2344 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/lib/api.d.ts +38 -0
- package/dist/react/lib/api.d.ts.map +1 -0
- package/dist/react/lib/constant.d.ts +2 -0
- package/dist/react/lib/constant.d.ts.map +1 -0
- package/dist/react/lib/entity.d.ts +10 -0
- package/dist/react/lib/entity.d.ts.map +1 -0
- package/dist/react/lib/utils.d.ts +10 -0
- package/dist/react/lib/utils.d.ts.map +1 -0
- package/dist/react/services/auth.service.d.ts +21 -0
- package/dist/react/services/auth.service.d.ts.map +1 -0
- package/dist/react/services/core.service.d.ts +76 -0
- package/dist/react/services/core.service.d.ts.map +1 -0
- package/dist/react/services/filestore.service.d.ts +22 -0
- package/dist/react/services/filestore.service.d.ts.map +1 -0
- package/dist/react/store/monorise.store.d.ts +169 -0
- package/dist/react/store/monorise.store.d.ts.map +1 -0
- package/dist/react/tsup.config.d.ts +3 -0
- package/dist/react/tsup.config.d.ts.map +1 -0
- package/dist/react/types/api.type.d.ts +30 -0
- package/dist/react/types/api.type.d.ts.map +1 -0
- package/dist/react/types/axios.type.d.ts +13 -0
- package/dist/react/types/axios.type.d.ts.map +1 -0
- package/dist/react/types/monorise.type.d.ts +8 -0
- package/dist/react/types/monorise.type.d.ts.map +1 -0
- package/dist/react/types/mutual.type.d.ts +21 -0
- package/dist/react/types/mutual.type.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/analog.d.ts +423 -0
- package/dist/sst/.sst/platform/src/components/aws/analog.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts +74 -0
- package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket.d.ts +542 -0
- package/dist/sst/.sst/platform/src/components/aws/apigateway-websocket.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts +48 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-api-key.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts +55 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts +36 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-base-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts +39 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-integration-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts +53 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts +53 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1-usage-plan.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1.d.ts +1002 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts +54 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts +28 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-base-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts +59 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts +54 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-private-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts +44 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2-url-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2.d.ts +931 -0
- package/dist/sst/.sst/platform/src/components/aws/apigatewayv2.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-data-source.d.ts +52 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-data-source.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-function.d.ts +33 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-function.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-resolver.d.ts +41 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync-resolver.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync.d.ts +638 -0
- package/dist/sst/.sst/platform/src/components/aws/app-sync.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/astro.d.ts +421 -0
- package/dist/sst/.sst/platform/src/components/aws/astro.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/aurora.d.ts +702 -0
- package/dist/sst/.sst/platform/src/components/aws/aurora.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/auth-v1.d.ts +26 -0
- package/dist/sst/.sst/platform/src/components/aws/auth-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/auth.d.ts +295 -0
- package/dist/sst/.sst/platform/src/components/aws/auth.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts +61 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-notification.d.ts +47 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-notification.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts +55 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-queue-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts +55 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket-topic-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket.d.ts +1216 -0
- package/dist/sst/.sst/platform/src/components/aws/bucket.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-base-subscriber.d.ts +20 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-base-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts +49 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts +44 -0
- package/dist/sst/.sst/platform/src/components/aws/bus-queue-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/bus.d.ts +403 -0
- package/dist/sst/.sst/platform/src/components/aws/bus.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cdn.d.ts +299 -0
- package/dist/sst/.sst/platform/src/components/aws/cdn.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cluster-v1.d.ts +882 -0
- package/dist/sst/.sst/platform/src/components/aws/cluster-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cluster.d.ts +306 -0
- package/dist/sst/.sst/platform/src/components/aws/cluster.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-identity-pool.d.ts +194 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-identity-pool.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-identity-provider.d.ts +38 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-identity-provider.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts +50 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool.d.ts +603 -0
- package/dist/sst/.sst/platform/src/components/aws/cognito-user-pool.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/cron.d.ts +250 -0
- package/dist/sst/.sst/platform/src/components/aws/cron.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/dns-validated-certificate.d.ts +27 -0
- package/dist/sst/.sst/platform/src/components/aws/dns-validated-certificate.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/dns.d.ts +94 -0
- package/dist/sst/.sst/platform/src/components/aws/dns.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts +55 -0
- package/dist/sst/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/dynamo.d.ts +568 -0
- package/dist/sst/.sst/platform/src/components/aws/dynamo.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/efs.d.ts +217 -0
- package/dist/sst/.sst/platform/src/components/aws/efs.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/email.d.ts +291 -0
- package/dist/sst/.sst/platform/src/components/aws/email.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/fargate.d.ts +803 -0
- package/dist/sst/.sst/platform/src/components/aws/fargate.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/function.d.ts +1629 -0
- package/dist/sst/.sst/platform/src/components/aws/function.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts +3 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/apigateway-account.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts +144 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/arn.d.ts +40 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/arn.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/bootstrap.d.ts +13 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/bootstrap.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/container-builder.d.ts +4 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/container-builder.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/function-builder.d.ts +10 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/function-builder.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/provider.d.ts +3 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/provider.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/quota.d.ts +7 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/quota.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/site-builder.d.ts +4 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/site-builder.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/subscriber.d.ts +6 -0
- package/dist/sst/.sst/platform/src/components/aws/helpers/subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/https-redirect.d.ts +38 -0
- package/dist/sst/.sst/platform/src/components/aws/https-redirect.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/iam-edit.d.ts +39 -0
- package/dist/sst/.sst/platform/src/components/aws/iam-edit.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/index.d.ts +48 -0
- package/dist/sst/.sst/platform/src/components/aws/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts +48 -0
- package/dist/sst/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/kinesis-stream.d.ts +249 -0
- package/dist/sst/.sst/platform/src/components/aws/kinesis-stream.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/linkable.d.ts +17 -0
- package/dist/sst/.sst/platform/src/components/aws/linkable.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/logging.d.ts +26 -0
- package/dist/sst/.sst/platform/src/components/aws/logging.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/mysql.d.ts +496 -0
- package/dist/sst/.sst/platform/src/components/aws/mysql.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/nextjs.d.ts +517 -0
- package/dist/sst/.sst/platform/src/components/aws/nextjs.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/nuxt.d.ts +495 -0
- package/dist/sst/.sst/platform/src/components/aws/nuxt.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/open-search.d.ts +295 -0
- package/dist/sst/.sst/platform/src/components/aws/open-search.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/opencontrol.d.ts +165 -0
- package/dist/sst/.sst/platform/src/components/aws/opencontrol.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/permission.d.ts +40 -0
- package/dist/sst/.sst/platform/src/components/aws/permission.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/postgres-v1.d.ts +317 -0
- package/dist/sst/.sst/platform/src/components/aws/postgres-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/postgres.d.ts +500 -0
- package/dist/sst/.sst/platform/src/components/aws/postgres.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/bucket-files.d.ts +18 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/bucket-files.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts +13 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts +11 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/distribution-invalidation.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/function-environment-update.d.ts +29 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/function-environment-update.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts +11 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/hosted-zone-lookup.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/kv-keys.d.ts +11 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/kv-keys.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts +11 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/kv-routes-update.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/origin-access-control.d.ts +8 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/origin-access-control.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts +8 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/rds-role-lookup.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/vector-table.d.ts +12 -0
- package/dist/sst/.sst/platform/src/components/aws/providers/vector-table.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts +48 -0
- package/dist/sst/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/queue.d.ts +485 -0
- package/dist/sst/.sst/platform/src/components/aws/queue.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/react.d.ts +416 -0
- package/dist/sst/.sst/platform/src/components/aws/react.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts +53 -0
- package/dist/sst/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/realtime.d.ts +232 -0
- package/dist/sst/.sst/platform/src/components/aws/realtime.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/redis-v1.d.ts +338 -0
- package/dist/sst/.sst/platform/src/components/aws/redis-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/redis.d.ts +364 -0
- package/dist/sst/.sst/platform/src/components/aws/redis.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/remix.d.ts +423 -0
- package/dist/sst/.sst/platform/src/components/aws/remix.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/router-base-route.d.ts +28 -0
- package/dist/sst/.sst/platform/src/components/aws/router-base-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/router-bucket-route.d.ts +29 -0
- package/dist/sst/.sst/platform/src/components/aws/router-bucket-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/router-url-route.d.ts +28 -0
- package/dist/sst/.sst/platform/src/components/aws/router-url-route.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/router.d.ts +1272 -0
- package/dist/sst/.sst/platform/src/components/aws/router.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/service-v1.d.ts +78 -0
- package/dist/sst/.sst/platform/src/components/aws/service-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/service.d.ts +1625 -0
- package/dist/sst/.sst/platform/src/components/aws/service.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts +53 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts +55 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic-queue-subscriber.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic.d.ts +389 -0
- package/dist/sst/.sst/platform/src/components/aws/sns-topic.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/solid-start.d.ts +414 -0
- package/dist/sst/.sst/platform/src/components/aws/solid-start.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/ssr-site.d.ts +685 -0
- package/dist/sst/.sst/platform/src/components/aws/ssr-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/static-site.d.ts +736 -0
- package/dist/sst/.sst/platform/src/components/aws/static-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/choice.d.ts +73 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/choice.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/fail.d.ts +63 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/fail.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/map.d.ts +236 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/map.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/parallel.d.ts +127 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/parallel.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/pass.d.ts +39 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/pass.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/state.d.ts +231 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/state.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/succeed.d.ts +26 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/succeed.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/task.d.ts +477 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/task.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/wait.d.ts +91 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions/wait.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions.d.ts +473 -0
- package/dist/sst/.sst/platform/src/components/aws/step-functions.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/svelte-kit.d.ts +417 -0
- package/dist/sst/.sst/platform/src/components/aws/svelte-kit.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/tan-stack-start.d.ts +354 -0
- package/dist/sst/.sst/platform/src/components/aws/tan-stack-start.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/task.d.ts +322 -0
- package/dist/sst/.sst/platform/src/components/aws/task.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/vector.d.ts +150 -0
- package/dist/sst/.sst/platform/src/components/aws/vector.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/vpc-v1.d.ts +208 -0
- package/dist/sst/.sst/platform/src/components/aws/vpc-v1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/aws/vpc.d.ts +444 -0
- package/dist/sst/.sst/platform/src/components/aws/vpc.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/base/base-site.d.ts +53 -0
- package/dist/sst/.sst/platform/src/components/base/base-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/base/base-ssr-site.d.ts +13 -0
- package/dist/sst/.sst/platform/src/components/base/base-ssr-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/base/base-static-site.d.ts +199 -0
- package/dist/sst/.sst/platform/src/components/base/base-static-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/account-id.d.ts +2 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/account-id.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/auth.d.ts +22 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/auth.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/binding.d.ts +69 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/binding.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/bucket.d.ts +103 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/bucket.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/cron.d.ts +121 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/cron.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/d1.d.ts +107 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/d1.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/dns.d.ts +94 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/dns.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/astro.d.ts +186 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/astro.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/index.d.ts +4 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts +171 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts +222 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts +19 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts +10 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/index.d.ts +16 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/kv.d.ts +107 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/kv.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts +20 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/dns-record.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts +23 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts +18 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts +22 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/worker-url.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts +22 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/queue.d.ts +60 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/queue.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/ssr-site.d.ts +51 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/ssr-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/static-site.d.ts +262 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/static-site.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/worker.d.ts +295 -0
- package/dist/sst/.sst/platform/src/components/cloudflare/worker.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/component.d.ts +37 -0
- package/dist/sst/.sst/platform/src/components/component.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/cpu.d.ts +3 -0
- package/dist/sst/.sst/platform/src/components/cpu.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/dns.d.ts +59 -0
- package/dist/sst/.sst/platform/src/components/dns.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/duration.d.ts +7 -0
- package/dist/sst/.sst/platform/src/components/duration.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/error.d.ts +4 -0
- package/dist/sst/.sst/platform/src/components/error.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/experimental/dev-command.d.ts +99 -0
- package/dist/sst/.sst/platform/src/components/experimental/dev-command.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/experimental/index.d.ts +2 -0
- package/dist/sst/.sst/platform/src/components/experimental/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/index.d.ts +16 -0
- package/dist/sst/.sst/platform/src/components/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/input.d.ts +3 -0
- package/dist/sst/.sst/platform/src/components/input.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/link.d.ts +41 -0
- package/dist/sst/.sst/platform/src/components/link.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/linkable.d.ts +271 -0
- package/dist/sst/.sst/platform/src/components/linkable.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/naming.d.ts +7 -0
- package/dist/sst/.sst/platform/src/components/naming.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/path.d.ts +2 -0
- package/dist/sst/.sst/platform/src/components/path.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/rpc/rpc.d.ts +19 -0
- package/dist/sst/.sst/platform/src/components/rpc/rpc.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/secret.d.ts +125 -0
- package/dist/sst/.sst/platform/src/components/secret.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/size.d.ts +5 -0
- package/dist/sst/.sst/platform/src/components/size.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/vercel/account-id.d.ts +2 -0
- package/dist/sst/.sst/platform/src/components/vercel/account-id.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/vercel/dns.d.ts +73 -0
- package/dist/sst/.sst/platform/src/components/vercel/dns.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/vercel/index.d.ts +3 -0
- package/dist/sst/.sst/platform/src/components/vercel/index.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/components/vercel/providers/dns-record.d.ts +14 -0
- package/dist/sst/.sst/platform/src/components/vercel/providers/dns-record.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/config.d.ts +1258 -0
- package/dist/sst/.sst/platform/src/config.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/util/compare-semver.d.ts +4 -0
- package/dist/sst/.sst/platform/src/util/compare-semver.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/util/fs.d.ts +5 -0
- package/dist/sst/.sst/platform/src/util/fs.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/util/lazy.d.ts +2 -0
- package/dist/sst/.sst/platform/src/util/lazy.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/util/semaphore.d.ts +9 -0
- package/dist/sst/.sst/platform/src/util/semaphore.d.ts.map +1 -0
- package/dist/sst/.sst/platform/src/util/warn.d.ts +2 -0
- package/dist/sst/.sst/platform/src/util/warn.d.ts.map +1 -0
- package/dist/sst/components/dashboard.d.ts +2 -0
- package/dist/sst/components/dashboard.d.ts.map +1 -0
- package/dist/sst/components/monorise-core.d.ts +18 -0
- package/dist/sst/components/monorise-core.d.ts.map +1 -0
- package/dist/sst/components/q-function.d.ts +17 -0
- package/dist/sst/components/q-function.d.ts.map +1 -0
- package/dist/sst/components/single-table.d.ts +14 -0
- package/dist/sst/components/single-table.d.ts.map +1 -0
- package/dist/sst/constants/event.d.ts +73 -0
- package/dist/sst/constants/event.d.ts.map +1 -0
- package/dist/sst/constants/table.d.ts +3 -0
- package/dist/sst/constants/table.d.ts.map +1 -0
- package/dist/sst/index.d.ts +11 -0
- package/dist/sst/index.d.ts.map +1 -0
- package/dist/sst/index.js +609 -0
- package/dist/sst/index.js.map +1 -0
- package/dist/sst/sst.config.d.ts +3 -0
- package/dist/sst/sst.config.d.ts.map +1 -0
- package/dist/sst/tsup.config.d.ts +3 -0
- package/dist/sst/tsup.config.d.ts.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare enum Entity {
|
|
4
|
+
}
|
|
5
|
+
interface EntitySchemaMap {
|
|
6
|
+
[key: string]: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
type DraftEntity<T extends Entity = Entity> = T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;
|
|
9
|
+
type CreatedEntity<T extends Entity = Entity> = {
|
|
10
|
+
entityId: string;
|
|
11
|
+
entityType: string;
|
|
12
|
+
data: T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @description Configuration for a monorise entity, a shared configuration that is used across frontend and backend.
|
|
18
|
+
* This can be served as a single source of truth for the entity configuration.
|
|
19
|
+
* It is used to define the schema, and mutual relationships between this entity and other entities.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const baseSchema = z.object({
|
|
24
|
+
* title: z.string(),
|
|
25
|
+
* }).partial();
|
|
26
|
+
*
|
|
27
|
+
* const createSchema = baseSchema.extend({
|
|
28
|
+
* title: z.string(),
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* const config = createEntityConfig({
|
|
32
|
+
* name: 'learner',
|
|
33
|
+
* displayName: 'Learner',
|
|
34
|
+
* baseSchema,
|
|
35
|
+
* createSchema,
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
interface MonoriseEntityConfig<T extends Entity = Entity, B extends z.ZodRawShape = z.ZodRawShape, C extends z.ZodRawShape = z.ZodRawShape, M extends z.ZodRawShape = z.ZodRawShape, CO extends z.ZodObject<C> | undefined = undefined, MO extends z.ZodObject<M> | undefined = undefined> {
|
|
40
|
+
/**
|
|
41
|
+
* @description Name of the entity. Must be in **lower-kebab-case** and **unique** across all entities
|
|
42
|
+
*
|
|
43
|
+
* @example `learner`, `learning-activity`
|
|
44
|
+
*/
|
|
45
|
+
name: string | T;
|
|
46
|
+
/**
|
|
47
|
+
* @description Display name of the entity. It is not required to be unique
|
|
48
|
+
*/
|
|
49
|
+
displayName: string;
|
|
50
|
+
/**
|
|
51
|
+
* @description (DEPRECATED) Use `uniqueFields` instead, Monorise should not handle auth mechanism
|
|
52
|
+
* @description (Optional) Specify the authentication method to be used for the entity
|
|
53
|
+
*/
|
|
54
|
+
authMethod?: {
|
|
55
|
+
/**
|
|
56
|
+
* @description Authentication method using email
|
|
57
|
+
*
|
|
58
|
+
* Note: The email used for authentication is unique per entity.
|
|
59
|
+
* For example, if `johndoe@mail.com` is used for `learner` entity,
|
|
60
|
+
* it can be reused again on `admin` entity. However, the same email
|
|
61
|
+
* address cannot be repeated for the same entity.
|
|
62
|
+
*/
|
|
63
|
+
email: {
|
|
64
|
+
/**
|
|
65
|
+
* @description Number of milliseconds before the token expires
|
|
66
|
+
*/
|
|
67
|
+
tokenExpiresIn: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @description Base schema for the entity
|
|
72
|
+
*/
|
|
73
|
+
baseSchema: z.ZodObject<B>;
|
|
74
|
+
/**
|
|
75
|
+
* @description Minimal schema required to create an entity
|
|
76
|
+
*/
|
|
77
|
+
createSchema?: CO;
|
|
78
|
+
searchableFields?: (keyof B)[];
|
|
79
|
+
uniqueFields?: (keyof B)[];
|
|
80
|
+
/**
|
|
81
|
+
* @description Define mutual relationship of this entity with other entities
|
|
82
|
+
*/
|
|
83
|
+
mutual?: {
|
|
84
|
+
/**
|
|
85
|
+
* @description Subscribes to update events from specified entities in the array.
|
|
86
|
+
* These events will be used to run prejoin processor.
|
|
87
|
+
*/
|
|
88
|
+
subscribes?: {
|
|
89
|
+
entityType: Entity;
|
|
90
|
+
}[];
|
|
91
|
+
/**
|
|
92
|
+
* @description Virtual schema for mutual relationship. The schema is only used for validation purpose, but these fields are not stored in the database
|
|
93
|
+
*/
|
|
94
|
+
mutualSchema: MO;
|
|
95
|
+
/**
|
|
96
|
+
* @description Keys of `mutualFields` are fields defined in `mutualSchema`.
|
|
97
|
+
* Each field is a mutual relationship between this entity and another entity.
|
|
98
|
+
*/
|
|
99
|
+
mutualFields: {
|
|
100
|
+
[key: string]: {
|
|
101
|
+
entityType: Entity;
|
|
102
|
+
toMutualIds?: (context: any) => string[];
|
|
103
|
+
/**
|
|
104
|
+
* @description (Optional) Custom function to process `mutualData`. If not provided, `mutualData` will be empty.
|
|
105
|
+
*
|
|
106
|
+
* @returns the final state of `mutualData` to be stored in the mutual record. Must be an object.
|
|
107
|
+
*/
|
|
108
|
+
mutualDataProcessor?: (mutualIds: string[], currentMutual: any, customContext?: Record<string, any>) => Record<string, any>;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @description (Optional) Better known as tree processor
|
|
113
|
+
* This is used to prejoin entities that are not directly related as mutual.
|
|
114
|
+
* For example, if `learner` entity is related to `course` entity, and `course` entity is related to `module` entity,
|
|
115
|
+
* prejoins can be used to join `learner` and `module` entities.
|
|
116
|
+
* With this, the `learner` entity can access the `module` entity without having to go through the `course` entity,
|
|
117
|
+
* hence reducing the number of queries.
|
|
118
|
+
*
|
|
119
|
+
* DynamoDB best practices: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-normalization.html
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
prejoins?: {
|
|
123
|
+
mutualField: string;
|
|
124
|
+
targetEntityType: Entity;
|
|
125
|
+
entityPaths: {
|
|
126
|
+
skipCache?: boolean;
|
|
127
|
+
entityType: Entity;
|
|
128
|
+
processor?: (items: any[], context: Record<string, any>) => any;
|
|
129
|
+
}[];
|
|
130
|
+
}[];
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Use this function to perform side effects on the final schema for example refine/superRefine the schema
|
|
134
|
+
*
|
|
135
|
+
* @param schema The final schema of the entity (the combination of `baseSchema`/`createSchema` and `mutualSchema` if specified)
|
|
136
|
+
* @returns void
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* effect: (schema) => {
|
|
141
|
+
* schema.refine(
|
|
142
|
+
* // refinement logic here
|
|
143
|
+
* )
|
|
144
|
+
* }
|
|
145
|
+
*/
|
|
146
|
+
effect?: (schema: z.ZodObject<z.ZodRawShape>) => z.ZodEffects<z.ZodObject<z.ZodRawShape>>;
|
|
147
|
+
/**
|
|
148
|
+
* @description (Optional) Use tags to create additional access patterns for the entity.
|
|
149
|
+
* Time complexity for retrieving tagged entities is O(1).
|
|
150
|
+
*
|
|
151
|
+
* The following configuration will create a tag named `region` for the `organization` entity grouped by `region`.
|
|
152
|
+
* You would then be able to retrieve all organizations in a specific region by:
|
|
153
|
+
* GET `/core/tag/organization/region?group={region_name}`
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
*
|
|
157
|
+
* ```ts
|
|
158
|
+
* {
|
|
159
|
+
* name: 'organization',
|
|
160
|
+
* tags: [
|
|
161
|
+
* {
|
|
162
|
+
* name: 'region',
|
|
163
|
+
* processor: (entity) => {
|
|
164
|
+
* return [
|
|
165
|
+
* {
|
|
166
|
+
* group: entity.data.region
|
|
167
|
+
* }
|
|
168
|
+
* ]
|
|
169
|
+
* },
|
|
170
|
+
* }
|
|
171
|
+
* ]
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @description
|
|
176
|
+
*
|
|
177
|
+
* The following configuration will create a tag named `dob` for the `user` entity sorted by `dob`.
|
|
178
|
+
* You would then be able to retrieve all users sorted by `dob` by:
|
|
179
|
+
* GET `/core/tag/user/dob?start=2000-01-01&end=2020-12-31`
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* {
|
|
184
|
+
* name: 'user',
|
|
185
|
+
* tags: [
|
|
186
|
+
* {
|
|
187
|
+
* name: 'dob',
|
|
188
|
+
* processor: (entity) => {
|
|
189
|
+
* return [
|
|
190
|
+
* {
|
|
191
|
+
* sortValue: entity.data.dob
|
|
192
|
+
* }
|
|
193
|
+
* ]
|
|
194
|
+
* },
|
|
195
|
+
* }
|
|
196
|
+
* ]
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
tags?: {
|
|
201
|
+
name: string;
|
|
202
|
+
processor: (entity: CreatedEntity<T>) => {
|
|
203
|
+
group?: string;
|
|
204
|
+
sortValue?: string;
|
|
205
|
+
}[];
|
|
206
|
+
}[];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare const createEntityConfig: <T extends Entity, B extends z.ZodRawShape, C extends z.ZodRawShape, M extends z.ZodRawShape, CO extends z.ZodObject<C> | undefined = undefined, MO extends z.ZodObject<M> | undefined = undefined>(config: MonoriseEntityConfig<T, B, C, M, CO, MO>) => {
|
|
210
|
+
finalSchema: (CO extends z.AnyZodObject ? MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & CO["shape"], z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any>[k]; } : never, z.baseObjectInputType<MO["shape"] & CO["shape"]> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<MO["shape"] & CO["shape"]>[k_1]; } : never> : CO : MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any> extends infer T_3 ? { [k_2 in keyof T_3]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any>[k_2]; } : never, z.baseObjectInputType<MO["shape"] & B> extends infer T_4 ? { [k_3 in keyof T_4]: z.baseObjectInputType<MO["shape"] & B>[k_3]; } : never> : z.ZodObject<B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any> extends infer T_5 ? { [k_4 in keyof T_5]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any>[k_4]; } : never, z.baseObjectInputType<B> extends infer T_6 ? { [k_5 in keyof T_6]: z.baseObjectInputType<B>[k_5]; } : never>) | z.ZodEffects<CO extends z.AnyZodObject ? MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & CO["shape"], z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any> extends infer T_7 ? { [k in keyof T_7]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any>[k]; } : never, z.baseObjectInputType<MO["shape"] & CO["shape"]> extends infer T_8 ? { [k_1 in keyof T_8]: z.baseObjectInputType<MO["shape"] & CO["shape"]>[k_1]; } : never> : CO : MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any> extends infer T_9 ? { [k_2 in keyof T_9]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any>[k_2]; } : never, z.baseObjectInputType<MO["shape"] & B> extends infer T_10 ? { [k_3 in keyof T_10]: z.baseObjectInputType<MO["shape"] & B>[k_3]; } : never> : z.ZodObject<B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any> extends infer T_11 ? { [k_4 in keyof T_11]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any>[k_4]; } : never, z.baseObjectInputType<B> extends infer T_12 ? { [k_5 in keyof T_12]: z.baseObjectInputType<B>[k_5]; } : never>, z.output<CO extends z.AnyZodObject ? MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & CO["shape"], z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any> extends infer T_13 ? { [k in keyof T_13]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any>[k]; } : never, z.baseObjectInputType<MO["shape"] & CO["shape"]> extends infer T_14 ? { [k_1 in keyof T_14]: z.baseObjectInputType<MO["shape"] & CO["shape"]>[k_1]; } : never> : CO : MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any> extends infer T_15 ? { [k_2 in keyof T_15]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any>[k_2]; } : never, z.baseObjectInputType<MO["shape"] & B> extends infer T_16 ? { [k_3 in keyof T_16]: z.baseObjectInputType<MO["shape"] & B>[k_3]; } : never> : z.ZodObject<B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any> extends infer T_17 ? { [k_4 in keyof T_17]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any>[k_4]; } : never, z.baseObjectInputType<B> extends infer T_18 ? { [k_5 in keyof T_18]: z.baseObjectInputType<B>[k_5]; } : never>>, z.input<CO extends z.AnyZodObject ? MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & CO["shape"], z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any> extends infer T_19 ? { [k in keyof T_19]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & CO["shape"]>, any>[k]; } : never, z.baseObjectInputType<MO["shape"] & CO["shape"]> extends infer T_20 ? { [k_1 in keyof T_20]: z.baseObjectInputType<MO["shape"] & CO["shape"]>[k_1]; } : never> : CO : MO extends z.AnyZodObject ? z.ZodObject<MO["shape"] & B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any> extends infer T_21 ? { [k_2 in keyof T_21]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<MO["shape"] & B>, any>[k_2]; } : never, z.baseObjectInputType<MO["shape"] & B> extends infer T_22 ? { [k_3 in keyof T_22]: z.baseObjectInputType<MO["shape"] & B>[k_3]; } : never> : z.ZodObject<B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any> extends infer T_23 ? { [k_4 in keyof T_23]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any>[k_4]; } : never, z.baseObjectInputType<B> extends infer T_24 ? { [k_5 in keyof T_24]: z.baseObjectInputType<B>[k_5]; } : never>>>;
|
|
211
|
+
name: string | T;
|
|
212
|
+
displayName: string;
|
|
213
|
+
authMethod?: {
|
|
214
|
+
email: {
|
|
215
|
+
tokenExpiresIn: number;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
baseSchema: z.ZodObject<B, z.UnknownKeysParam, z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any> extends infer T_25 ? { [k_4 in keyof T_25]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<B>, any>[k_4]; } : never, z.baseObjectInputType<B> extends infer T_26 ? { [k_5 in keyof T_26]: z.baseObjectInputType<B>[k_5]; } : never>;
|
|
219
|
+
createSchema?: CO | undefined;
|
|
220
|
+
searchableFields?: (keyof B)[] | undefined;
|
|
221
|
+
uniqueFields?: (keyof B)[] | undefined;
|
|
222
|
+
mutual?: {
|
|
223
|
+
subscribes?: {
|
|
224
|
+
entityType: Entity;
|
|
225
|
+
}[];
|
|
226
|
+
mutualSchema: MO;
|
|
227
|
+
mutualFields: {
|
|
228
|
+
[key: string]: {
|
|
229
|
+
entityType: Entity;
|
|
230
|
+
toMutualIds?: (context: any) => string[];
|
|
231
|
+
mutualDataProcessor?: (mutualIds: string[], currentMutual: any, customContext?: Record<string, any>) => Record<string, any>;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
prejoins?: {
|
|
235
|
+
mutualField: string;
|
|
236
|
+
targetEntityType: Entity;
|
|
237
|
+
entityPaths: {
|
|
238
|
+
skipCache?: boolean;
|
|
239
|
+
entityType: Entity;
|
|
240
|
+
processor?: (items: any[], context: Record<string, any>) => any;
|
|
241
|
+
}[];
|
|
242
|
+
}[];
|
|
243
|
+
} | undefined;
|
|
244
|
+
effect?: (schema: z.ZodObject<z.ZodRawShape>) => z.ZodEffects<z.ZodObject<z.ZodRawShape>>;
|
|
245
|
+
tags?: {
|
|
246
|
+
name: string;
|
|
247
|
+
processor: (entity: undefined<T>) => {
|
|
248
|
+
group?: string;
|
|
249
|
+
sortValue?: string;
|
|
250
|
+
}[];
|
|
251
|
+
}[] | undefined;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export { type CreatedEntity, type DraftEntity, Entity, type EntitySchemaMap, type MonoriseEntityConfig, createEntityConfig };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
// types/monorise.type.ts
|
|
22
|
+
var Entity = /* @__PURE__ */ ((Entity2) => {
|
|
23
|
+
return Entity2;
|
|
24
|
+
})(Entity || {});
|
|
25
|
+
|
|
26
|
+
// utils/index.ts
|
|
27
|
+
import { z } from "zod";
|
|
28
|
+
function makeSchema(config) {
|
|
29
|
+
const { baseSchema, createSchema, mutual, effect } = config;
|
|
30
|
+
const { mutualSchema } = mutual || {};
|
|
31
|
+
const finalSchema = z.object(__spreadValues(__spreadValues(__spreadValues({}, baseSchema.shape), createSchema == null ? void 0 : createSchema.shape), mutualSchema == null ? void 0 : mutualSchema.shape));
|
|
32
|
+
if (effect) {
|
|
33
|
+
return effect(finalSchema);
|
|
34
|
+
}
|
|
35
|
+
return finalSchema;
|
|
36
|
+
}
|
|
37
|
+
var createEntityConfig = (config) => __spreadProps(__spreadValues({}, config), {
|
|
38
|
+
finalSchema: makeSchema(config)
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
Entity,
|
|
42
|
+
createEntityConfig
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../types/monorise.type.ts","../utils/index.ts"],"sourcesContent":["import type { z } from 'zod';\n\nexport enum Entity {}\n\nexport interface EntitySchemaMap {\n [key: string]: Record<string, any>;\n}\n\nexport type DraftEntity<T extends Entity = Entity> =\n T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;\n\nexport type CreatedEntity<T extends Entity = Entity> = {\n entityId: string;\n entityType: string;\n data: T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;\n createdAt: string;\n updatedAt: string;\n};\n\n/**\n * @description Configuration for a monorise entity, a shared configuration that is used across frontend and backend.\n * This can be served as a single source of truth for the entity configuration.\n * It is used to define the schema, and mutual relationships between this entity and other entities.\n *\n * @example\n * ```ts\n * const baseSchema = z.object({\n * title: z.string(),\n * }).partial();\n *\n * const createSchema = baseSchema.extend({\n * title: z.string(),\n * })\n *\n * const config = createEntityConfig({\n * name: 'learner',\n * displayName: 'Learner',\n * baseSchema,\n * createSchema,\n * });\n * ```\n */\nexport interface MonoriseEntityConfig<\n T extends Entity = Entity,\n B extends z.ZodRawShape = z.ZodRawShape,\n C extends z.ZodRawShape = z.ZodRawShape,\n M extends z.ZodRawShape = z.ZodRawShape,\n CO extends z.ZodObject<C> | undefined = undefined,\n MO extends z.ZodObject<M> | undefined = undefined,\n> {\n /**\n * @description Name of the entity. Must be in **lower-kebab-case** and **unique** across all entities\n *\n * @example `learner`, `learning-activity`\n */\n name: string | T;\n\n /**\n * @description Display name of the entity. It is not required to be unique\n */\n displayName: string;\n\n /**\n * @description (DEPRECATED) Use `uniqueFields` instead, Monorise should not handle auth mechanism\n * @description (Optional) Specify the authentication method to be used for the entity\n */\n authMethod?: {\n /**\n * @description Authentication method using email\n *\n * Note: The email used for authentication is unique per entity.\n * For example, if `johndoe@mail.com` is used for `learner` entity,\n * it can be reused again on `admin` entity. However, the same email\n * address cannot be repeated for the same entity.\n */\n email: {\n /**\n * @description Number of milliseconds before the token expires\n */\n tokenExpiresIn: number;\n };\n };\n\n /**\n * @description Base schema for the entity\n */\n baseSchema: z.ZodObject<B>;\n\n /**\n * @description Minimal schema required to create an entity\n */\n createSchema?: CO;\n searchableFields?: (keyof B)[];\n uniqueFields?: (keyof B)[];\n\n /**\n * @description Define mutual relationship of this entity with other entities\n */\n mutual?: {\n /**\n * @description Subscribes to update events from specified entities in the array.\n * These events will be used to run prejoin processor.\n */\n subscribes?: { entityType: Entity }[];\n /**\n * @description Virtual schema for mutual relationship. The schema is only used for validation purpose, but these fields are not stored in the database\n */\n mutualSchema: MO;\n\n /**\n * @description Keys of `mutualFields` are fields defined in `mutualSchema`.\n * Each field is a mutual relationship between this entity and another entity.\n */\n mutualFields: {\n [key: string]: {\n entityType: Entity;\n toMutualIds?: (context: any) => string[];\n /**\n * @description (Optional) Custom function to process `mutualData`. If not provided, `mutualData` will be empty.\n *\n * @returns the final state of `mutualData` to be stored in the mutual record. Must be an object.\n */\n mutualDataProcessor?: (\n mutualIds: string[],\n currentMutual: any,\n customContext?: Record<string, any>,\n ) => Record<string, any>;\n };\n };\n\n /**\n * @description (Optional) Better known as tree processor\n * This is used to prejoin entities that are not directly related as mutual.\n * For example, if `learner` entity is related to `course` entity, and `course` entity is related to `module` entity,\n * prejoins can be used to join `learner` and `module` entities.\n * With this, the `learner` entity can access the `module` entity without having to go through the `course` entity,\n * hence reducing the number of queries.\n *\n * DynamoDB best practices: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-general-normalization.html\n *\n */\n prejoins?: {\n mutualField: string;\n targetEntityType: Entity;\n entityPaths: {\n skipCache?: boolean;\n entityType: Entity;\n processor?: (items: any[], context: Record<string, any>) => any;\n }[];\n }[];\n };\n /**\n * Use this function to perform side effects on the final schema for example refine/superRefine the schema\n *\n * @param schema The final schema of the entity (the combination of `baseSchema`/`createSchema` and `mutualSchema` if specified)\n * @returns void\n *\n * @example\n * ```ts\n * effect: (schema) => {\n * schema.refine(\n * // refinement logic here\n * )\n * }\n */\n effect?: (\n schema: z.ZodObject<z.ZodRawShape>,\n ) => z.ZodEffects<z.ZodObject<z.ZodRawShape>>;\n\n /**\n * @description (Optional) Use tags to create additional access patterns for the entity.\n * Time complexity for retrieving tagged entities is O(1).\n *\n * The following configuration will create a tag named `region` for the `organization` entity grouped by `region`.\n * You would then be able to retrieve all organizations in a specific region by:\n * GET `/core/tag/organization/region?group={region_name}`\n *\n * @example\n *\n * ```ts\n * {\n * name: 'organization',\n * tags: [\n * {\n * name: 'region',\n * processor: (entity) => {\n * return [\n * {\n * group: entity.data.region\n * }\n * ]\n * },\n * }\n * ]\n * }\n * ```\n *\n * @description\n *\n * The following configuration will create a tag named `dob` for the `user` entity sorted by `dob`.\n * You would then be able to retrieve all users sorted by `dob` by:\n * GET `/core/tag/user/dob?start=2000-01-01&end=2020-12-31`\n *\n * @example\n * ```ts\n * {\n * name: 'user',\n * tags: [\n * {\n * name: 'dob',\n * processor: (entity) => {\n * return [\n * {\n * sortValue: entity.data.dob\n * }\n * ]\n * },\n * }\n * ]\n * }\n * ```\n */\n tags?: {\n name: string;\n processor: (entity: CreatedEntity<T>) => {\n group?: string;\n sortValue?: string;\n }[];\n }[];\n}\n","import type { Entity, MonoriseEntityConfig } from '../types/monorise.type';\nimport { z } from 'zod';\n\nfunction makeSchema<\n T extends Entity,\n B extends z.ZodRawShape,\n C extends z.ZodRawShape,\n M extends z.ZodRawShape,\n CO extends z.ZodObject<C> | undefined = undefined,\n MO extends z.ZodObject<M> | undefined = undefined,\n>(config: MonoriseEntityConfig<T, B, C, M, CO, MO>) {\n const { baseSchema, createSchema, mutual, effect } = config;\n const { mutualSchema } = mutual || {};\n\n type FinalSchemaType = CO extends z.AnyZodObject\n ? MO extends z.AnyZodObject\n ? z.ZodObject<MO['shape'] & CO['shape']>\n : CO\n : MO extends z.AnyZodObject\n ? z.ZodObject<MO['shape'] & B>\n : z.ZodObject<B>;\n\n const finalSchema = z.object({\n ...baseSchema.shape,\n ...createSchema?.shape,\n ...mutualSchema?.shape,\n }) as FinalSchemaType;\n\n if (effect) {\n return effect(finalSchema) as z.ZodEffects<FinalSchemaType>;\n }\n\n return finalSchema;\n}\n\nconst createEntityConfig = <\n T extends Entity,\n B extends z.ZodRawShape,\n C extends z.ZodRawShape,\n M extends z.ZodRawShape,\n CO extends z.ZodObject<C> | undefined = undefined,\n MO extends z.ZodObject<M> | undefined = undefined,\n>(\n config: MonoriseEntityConfig<T, B, C, M, CO, MO>,\n) => ({\n ...config,\n finalSchema: makeSchema(config),\n});\n\nexport { createEntityConfig };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,IAAK,SAAL,kBAAKA,YAAL;AAAK,SAAAA;AAAA,GAAA;;;ACDZ,SAAS,SAAS;AAElB,SAAS,WAOP,QAAkD;AAClD,QAAM,EAAE,YAAY,cAAc,QAAQ,OAAO,IAAI;AACrD,QAAM,EAAE,aAAa,IAAI,UAAU,CAAC;AAUpC,QAAM,cAAc,EAAE,OAAO,iDACxB,WAAW,QACX,6CAAc,QACd,6CAAc,MAClB;AAED,MAAI,QAAQ;AACV,WAAO,OAAO,WAAW;AAAA,EAC3B;AAEA,SAAO;AACT;AAEA,IAAM,qBAAqB,CAQzB,WACI,iCACD,SADC;AAAA,EAEJ,aAAa,WAAW,MAAM;AAChC;","names":["Entity"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|