@wasp.sh/wasp-cli-darwin-x64-unknown 0.20.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/data/Cli/starters/README.md +22 -0
- package/data/Cli/starters/basic/README.md +35 -0
- package/data/Cli/starters/basic/eslint.config.js +24 -0
- package/data/Cli/starters/basic/main.wasp +100 -0
- package/data/Cli/starters/basic/package.json +29 -0
- package/data/Cli/starters/basic/postcss.config.js +6 -0
- package/data/Cli/starters/basic/schema.prisma +42 -0
- package/data/Cli/starters/basic/src/App.css +13 -0
- package/data/Cli/starters/basic/src/App.tsx +12 -0
- package/data/Cli/starters/basic/src/assets/logo.svg +1 -0
- package/data/Cli/starters/basic/src/auth/AuthLayout.tsx +10 -0
- package/data/Cli/starters/basic/src/auth/email/EmailVerificationPage.tsx +19 -0
- package/data/Cli/starters/basic/src/auth/email/LoginPage.tsx +27 -0
- package/data/Cli/starters/basic/src/auth/email/PasswordResetPage.tsx +19 -0
- package/data/Cli/starters/basic/src/auth/email/RequestPasswordResetPage.tsx +10 -0
- package/data/Cli/starters/basic/src/auth/email/SignupPage.tsx +34 -0
- package/data/Cli/starters/basic/src/auth/email/userSignupFields.ts +13 -0
- package/data/Cli/starters/basic/src/shared/components/Button.tsx +90 -0
- package/data/Cli/starters/basic/src/shared/components/Dialog.tsx +85 -0
- package/data/Cli/starters/basic/src/shared/components/Header.tsx +39 -0
- package/data/Cli/starters/basic/src/shared/components/Input.tsx +36 -0
- package/data/Cli/starters/basic/src/shared/components/Portal.tsx +26 -0
- package/data/Cli/starters/basic/src/tags/actions.ts +23 -0
- package/data/Cli/starters/basic/src/tags/components/ColorRadioButton.tsx +44 -0
- package/data/Cli/starters/basic/src/tags/components/ColorRadioButtons.tsx +59 -0
- package/data/Cli/starters/basic/src/tags/components/CreateTagDialog.tsx +50 -0
- package/data/Cli/starters/basic/src/tags/components/CreateTagForm.tsx +100 -0
- package/data/Cli/starters/basic/src/tags/components/TagLabel.tsx +55 -0
- package/data/Cli/starters/basic/src/tags/components/colors.ts +8 -0
- package/data/Cli/starters/basic/src/tags/queries.ts +14 -0
- package/data/Cli/starters/basic/src/tasks/TasksPage.tsx +19 -0
- package/data/Cli/starters/basic/src/tasks/actions.ts +71 -0
- package/data/Cli/starters/basic/src/tasks/components/CreateTaskForm.tsx +103 -0
- package/data/Cli/starters/basic/src/tasks/components/TaskList.tsx +68 -0
- package/data/Cli/starters/basic/src/tasks/components/TaskListItem.tsx +56 -0
- package/data/Cli/starters/basic/src/tasks/queries.ts +21 -0
- package/data/Cli/starters/basic/tailwind.config.js +30 -0
- package/data/Cli/starters/basic/vite.config.ts +7 -0
- package/data/Cli/starters/minimal/main.wasp +14 -0
- package/data/Cli/starters/minimal/package.json +18 -0
- package/data/Cli/starters/minimal/schema.prisma +10 -0
- package/data/Cli/starters/minimal/src/Main.css +103 -0
- package/data/Cli/starters/minimal/src/MainPage.tsx +37 -0
- package/data/Cli/starters/minimal/src/assets/logo.svg +1 -0
- package/data/Cli/starters/minimal/vite.config.ts +7 -0
- package/data/Cli/starters/skeleton/public/favicon.ico +0 -0
- package/data/Cli/starters/skeleton/src/vite-env.d.ts +7 -0
- package/data/Cli/starters/skeleton/tsconfig.json +28 -0
- package/data/Generator/templates/Dockerfile +78 -0
- package/data/Generator/templates/db/schema.prisma +24 -0
- package/data/Generator/templates/dockerignore +2 -0
- package/data/Generator/templates/react-app/README.md +21 -0
- package/data/Generator/templates/react-app/gitignore +23 -0
- package/data/Generator/templates/react-app/index.html +22 -0
- package/data/Generator/templates/react-app/netlify.toml +8 -0
- package/data/Generator/templates/react-app/npmrc +1 -0
- package/data/Generator/templates/react-app/package.json +31 -0
- package/data/Generator/templates/react-app/public/manifest.json +15 -0
- package/data/Generator/templates/react-app/src/auth/pages/OAuthCallback.tsx +93 -0
- package/data/Generator/templates/react-app/src/auth/pages/createAuthRequiredPage.jsx +40 -0
- package/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx +16 -0
- package/data/Generator/templates/react-app/src/components/FullPageWrapper.tsx +21 -0
- package/data/Generator/templates/react-app/src/components/Loader.module.css +37 -0
- package/data/Generator/templates/react-app/src/components/Loader.tsx +12 -0
- package/data/Generator/templates/react-app/src/components/Message.tsx +86 -0
- package/data/Generator/templates/react-app/src/index.tsx +47 -0
- package/data/Generator/templates/react-app/src/logo.png +0 -0
- package/data/Generator/templates/react-app/src/router.tsx +59 -0
- package/data/Generator/templates/react-app/src/test/vitest/setup.ts +8 -0
- package/data/Generator/templates/react-app/src/utils.js +3 -0
- package/data/Generator/templates/react-app/src/vite-env.d.ts +1 -0
- package/data/Generator/templates/react-app/tsconfig.app.json +28 -0
- package/data/Generator/templates/react-app/tsconfig.json +11 -0
- package/data/Generator/templates/react-app/tsconfig.vite.json +16 -0
- package/data/Generator/templates/react-app/vite/detectServerImports.ts +53 -0
- package/data/Generator/templates/react-app/vite/validateEnv.ts +45 -0
- package/data/Generator/templates/react-app/vite.config.ts +74 -0
- package/data/Generator/templates/sdk/wasp/api/events.ts +11 -0
- package/data/Generator/templates/sdk/wasp/api/index.ts +136 -0
- package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +13 -0
- package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +22 -0
- package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +20 -0
- package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +14 -0
- package/data/Generator/templates/sdk/wasp/auth/email/index.ts +5 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/Auth.module.css +16 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx +94 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/ForgotPassword.tsx +18 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/Login.tsx +18 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/ResetPassword.tsx +18 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/Signup.tsx +24 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/VerifyEmail.tsx +18 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.module.css +99 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.tsx +74 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.module.css +22 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.tsx +34 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/auth-styles.css +30 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.module.css +55 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +291 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx +52 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx +82 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx +43 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/useEmail.ts +33 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.module.css +33 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.tsx +14 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.module.css +4 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx +74 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts +29 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/util.ts +16 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/types.ts +77 -0
- package/data/Generator/templates/sdk/wasp/auth/helpers/_Provider.tsx +17 -0
- package/data/Generator/templates/sdk/wasp/auth/helpers/user.ts +15 -0
- package/data/Generator/templates/sdk/wasp/auth/index.ts +9 -0
- package/data/Generator/templates/sdk/wasp/auth/jwt.ts +22 -0
- package/data/Generator/templates/sdk/wasp/auth/logout.ts +18 -0
- package/data/Generator/templates/sdk/wasp/auth/lucia.ts +53 -0
- package/data/Generator/templates/sdk/wasp/auth/password.ts +36 -0
- package/data/Generator/templates/sdk/wasp/auth/providers/index.ts +9 -0
- package/data/Generator/templates/sdk/wasp/auth/providers/types.ts +68 -0
- package/data/Generator/templates/sdk/wasp/auth/session.ts +78 -0
- package/data/Generator/templates/sdk/wasp/auth/types.ts +2 -0
- package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +37 -0
- package/data/Generator/templates/sdk/wasp/auth/user.ts +63 -0
- package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +13 -0
- package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +20 -0
- package/data/Generator/templates/sdk/wasp/auth/username/index.ts +2 -0
- package/data/Generator/templates/sdk/wasp/auth/utils.ts +369 -0
- package/data/Generator/templates/sdk/wasp/auth/validation.ts +83 -0
- package/data/Generator/templates/sdk/wasp/client/auth/discord.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/email.ts +5 -0
- package/data/Generator/templates/sdk/wasp/client/auth/github.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/google.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/index.ts +29 -0
- package/data/Generator/templates/sdk/wasp/client/auth/keycloak.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/slack.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/ui.ts +32 -0
- package/data/Generator/templates/sdk/wasp/client/auth/username.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/config.ts +15 -0
- package/data/Generator/templates/sdk/wasp/client/crud/_crud.ts +89 -0
- package/data/Generator/templates/sdk/wasp/client/crud/index.ts +4 -0
- package/data/Generator/templates/sdk/wasp/client/crud/operationsHelpers.ts +21 -0
- package/data/Generator/templates/sdk/wasp/client/env/schema.ts +22 -0
- package/data/Generator/templates/sdk/wasp/client/env.ts +5 -0
- package/data/Generator/templates/sdk/wasp/client/hooks.ts +19 -0
- package/data/Generator/templates/sdk/wasp/client/index.ts +17 -0
- package/data/Generator/templates/sdk/wasp/client/operations/actions/core.ts +49 -0
- package/data/Generator/templates/sdk/wasp/client/operations/actions/index.ts +13 -0
- package/data/Generator/templates/sdk/wasp/client/operations/hooks.ts +347 -0
- package/data/Generator/templates/sdk/wasp/client/operations/index.ts +22 -0
- package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +22 -0
- package/data/Generator/templates/sdk/wasp/client/operations/internal/resources.js +83 -0
- package/data/Generator/templates/sdk/wasp/client/operations/internal/updateHandlersMap.js +37 -0
- package/data/Generator/templates/sdk/wasp/client/operations/queries/core.ts +91 -0
- package/data/Generator/templates/sdk/wasp/client/operations/queries/index.ts +16 -0
- package/data/Generator/templates/sdk/wasp/client/operations/queryClient.ts +34 -0
- package/data/Generator/templates/sdk/wasp/client/operations/rpc.ts +96 -0
- package/data/Generator/templates/sdk/wasp/client/router/Link.tsx +21 -0
- package/data/Generator/templates/sdk/wasp/client/router/index.ts +53 -0
- package/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts +48 -0
- package/data/Generator/templates/sdk/wasp/client/router/types.ts +98 -0
- package/data/Generator/templates/sdk/wasp/client/test/index.ts +1 -0
- package/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx +95 -0
- package/data/Generator/templates/sdk/wasp/client/webSocket/WebSocketProvider.tsx +77 -0
- package/data/Generator/templates/sdk/wasp/client/webSocket/index.ts +39 -0
- package/data/Generator/templates/sdk/wasp/core/auth.ts +40 -0
- package/data/Generator/templates/sdk/wasp/core/serialization/custom-register.ts +21 -0
- package/data/Generator/templates/sdk/wasp/core/serialization/index.ts +56 -0
- package/data/Generator/templates/sdk/wasp/core/serialization/prisma.ts +54 -0
- package/data/Generator/templates/sdk/wasp/core/storage.ts +50 -0
- package/data/Generator/templates/sdk/wasp/dev/index.ts +19 -0
- package/data/Generator/templates/sdk/wasp/entities/index.ts +28 -0
- package/data/Generator/templates/sdk/wasp/env/index.ts +9 -0
- package/data/Generator/templates/sdk/wasp/env/validation.ts +38 -0
- package/data/Generator/templates/sdk/wasp/package.json +152 -0
- package/data/Generator/templates/sdk/wasp/prisma-runtime-library.d.ts +17 -0
- package/data/Generator/templates/sdk/wasp/scripts/copy-assets.js +14 -0
- package/data/Generator/templates/sdk/wasp/server/HttpError.ts +30 -0
- package/data/Generator/templates/sdk/wasp/server/_types/index.ts +105 -0
- package/data/Generator/templates/sdk/wasp/server/_types/taggedEntities.ts +26 -0
- package/data/Generator/templates/sdk/wasp/server/api/index.ts +44 -0
- package/data/Generator/templates/sdk/wasp/server/auth/email/index.ts +20 -0
- package/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts +104 -0
- package/data/Generator/templates/sdk/wasp/server/auth/hooks.ts +188 -0
- package/data/Generator/templates/sdk/wasp/server/auth/index.ts +49 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/index.ts +38 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/oneTimeCode.ts +50 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts +20 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts +22 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts +20 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts +22 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts +23 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/slack.ts +22 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/redirect.ts +43 -0
- package/data/Generator/templates/sdk/wasp/server/auth/user.ts +148 -0
- package/data/Generator/templates/sdk/wasp/server/auth/username.ts +1 -0
- package/data/Generator/templates/sdk/wasp/server/config.ts +47 -0
- package/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts +134 -0
- package/data/Generator/templates/sdk/wasp/server/crud/index.ts +5 -0
- package/data/Generator/templates/sdk/wasp/server/dbClient.ts +35 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/helpers.ts +40 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/index.ts +17 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/dummy.ts +34 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/mailgun.ts +31 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts +44 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/smtp.ts +29 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/types.ts +59 -0
- package/data/Generator/templates/sdk/wasp/server/email/index.ts +39 -0
- package/data/Generator/templates/sdk/wasp/server/env.ts +173 -0
- package/data/Generator/templates/sdk/wasp/server/index.ts +17 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/_job.ts +39 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/core/job.ts +28 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/index.ts +3 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +76 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +230 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/types.ts +9 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/index.ts +5 -0
- package/data/Generator/templates/sdk/wasp/server/middleware/globalMiddleware.ts +8 -0
- package/data/Generator/templates/sdk/wasp/server/middleware/index.ts +1 -0
- package/data/Generator/templates/sdk/wasp/server/operations/actions/index.ts +41 -0
- package/data/Generator/templates/sdk/wasp/server/operations/actions/types.ts +35 -0
- package/data/Generator/templates/sdk/wasp/server/operations/index.ts +13 -0
- package/data/Generator/templates/sdk/wasp/server/operations/queries/index.ts +42 -0
- package/data/Generator/templates/sdk/wasp/server/operations/queries/types.ts +36 -0
- package/data/Generator/templates/sdk/wasp/server/operations/wrappers.ts +242 -0
- package/data/Generator/templates/sdk/wasp/server/types/index.ts +11 -0
- package/data/Generator/templates/sdk/wasp/server/utils.ts +38 -0
- package/data/Generator/templates/sdk/wasp/server/webSocket/index.ts +57 -0
- package/data/Generator/templates/sdk/wasp/tsconfig.json +102 -0
- package/data/Generator/templates/sdk/wasp/universal/ansiColors.ts +14 -0
- package/data/Generator/templates/sdk/wasp/universal/predicates.ts +3 -0
- package/data/Generator/templates/sdk/wasp/universal/types.ts +74 -0
- package/data/Generator/templates/sdk/wasp/universal/url.ts +9 -0
- package/data/Generator/templates/sdk/wasp/universal/validators.ts +21 -0
- package/data/Generator/templates/sdk/wasp/vite-env.d.ts +1 -0
- package/data/Generator/templates/server/README.md +1 -0
- package/data/Generator/templates/server/gitignore +6 -0
- package/data/Generator/templates/server/nodemon.json +13 -0
- package/data/Generator/templates/server/npmrc +1 -0
- package/data/Generator/templates/server/package.json +27 -0
- package/data/Generator/templates/server/rollup.config.js +44 -0
- package/data/Generator/templates/server/src/actions/_action.ts +18 -0
- package/data/Generator/templates/server/src/app.js +36 -0
- package/data/Generator/templates/server/src/auth/hooks.ts +135 -0
- package/data/Generator/templates/server/src/auth/providers/config/discord.ts +69 -0
- package/data/Generator/templates/server/src/auth/providers/config/email.ts +96 -0
- package/data/Generator/templates/server/src/auth/providers/config/github.ts +78 -0
- package/data/Generator/templates/server/src/auth/providers/config/google.ts +65 -0
- package/data/Generator/templates/server/src/auth/providers/config/keycloak.ts +67 -0
- package/data/Generator/templates/server/src/auth/providers/config/slack.ts +65 -0
- package/data/Generator/templates/server/src/auth/providers/config/username.ts +33 -0
- package/data/Generator/templates/server/src/auth/providers/email/login.ts +66 -0
- package/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts +74 -0
- package/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts +48 -0
- package/data/Generator/templates/server/src/auth/providers/email/signup.ts +165 -0
- package/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts +42 -0
- package/data/Generator/templates/server/src/auth/providers/index.ts +32 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/config.ts +19 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts +35 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/handler.ts +130 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/oneTimeCode.ts +39 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/state.ts +144 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/types.ts +7 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/user.ts +139 -0
- package/data/Generator/templates/server/src/auth/providers/username/login.ts +64 -0
- package/data/Generator/templates/server/src/auth/providers/username/signup.ts +59 -0
- package/data/Generator/templates/server/src/crud/_operations.ts +184 -0
- package/data/Generator/templates/server/src/dbSeed.ts +37 -0
- package/data/Generator/templates/server/src/jobs/_job.ts +9 -0
- package/data/Generator/templates/server/src/jobs/core/allJobs.ts +8 -0
- package/data/Generator/templates/server/src/middleware/globalMiddleware.ts +45 -0
- package/data/Generator/templates/server/src/middleware/index.ts +1 -0
- package/data/Generator/templates/server/src/middleware/operations.ts +28 -0
- package/data/Generator/templates/server/src/queries/_query.ts +18 -0
- package/data/Generator/templates/server/src/routes/apis/index.ts +67 -0
- package/data/Generator/templates/server/src/routes/auth/index.js +16 -0
- package/data/Generator/templates/server/src/routes/auth/logout.ts +12 -0
- package/data/Generator/templates/server/src/routes/auth/me.ts +10 -0
- package/data/Generator/templates/server/src/routes/crud/_crud.ts +46 -0
- package/data/Generator/templates/server/src/routes/crud/index.ts +12 -0
- package/data/Generator/templates/server/src/routes/index.js +55 -0
- package/data/Generator/templates/server/src/routes/operations/_action.js +5 -0
- package/data/Generator/templates/server/src/routes/operations/_query.js +5 -0
- package/data/Generator/templates/server/src/routes/operations/index.js +18 -0
- package/data/Generator/templates/server/src/server.ts +76 -0
- package/data/Generator/templates/server/src/views/wrong-port.ts +123 -0
- package/data/Generator/templates/server/src/webSocket/initialization.ts +59 -0
- package/data/Generator/templates/server/tsconfig.json +41 -0
- package/data/Lsp/templates/ts/action.fn.ts +12 -0
- package/data/Lsp/templates/ts/operation.fn.js +7 -0
- package/data/Lsp/templates/ts/page.component.jsx +9 -0
- package/data/Lsp/templates/ts/query.fn.ts +12 -0
- package/data/packages/deploy/dist/common/brandedTypes.js +2 -0
- package/data/packages/deploy/dist/common/clientApp.js +26 -0
- package/data/packages/deploy/dist/common/commander.js +8 -0
- package/data/packages/deploy/dist/common/random.js +5 -0
- package/data/packages/deploy/dist/common/terminal.js +24 -0
- package/data/packages/deploy/dist/common/typeUtils.js +2 -0
- package/data/packages/deploy/dist/common/validation.js +14 -0
- package/data/packages/deploy/dist/common/waspBuild.js +21 -0
- package/data/packages/deploy/dist/common/waspProject.js +43 -0
- package/data/packages/deploy/dist/common/zx.js +10 -0
- package/data/packages/deploy/dist/index.js +30 -0
- package/data/packages/deploy/dist/providers/fly/CommonCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/CommonOps.js +36 -0
- package/data/packages/deploy/dist/providers/fly/DeploymentInstructions.js +12 -0
- package/data/packages/deploy/dist/providers/fly/commands/cmd/CmdCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/commands/cmd/cmd.js +29 -0
- package/data/packages/deploy/dist/providers/fly/commands/createDb/CreateDbCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/commands/createDb/createDb.js +55 -0
- package/data/packages/deploy/dist/providers/fly/commands/deploy/DeployCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/commands/deploy/deploy.js +88 -0
- package/data/packages/deploy/dist/providers/fly/commands/launch/LaunchCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/commands/launch/launch.js +17 -0
- package/data/packages/deploy/dist/providers/fly/commands/setup/SetupCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/fly/commands/setup/setup.js +141 -0
- package/data/packages/deploy/dist/providers/fly/flyAppUrl.js +4 -0
- package/data/packages/deploy/dist/providers/fly/flyCli.js +74 -0
- package/data/packages/deploy/dist/providers/fly/index.js +121 -0
- package/data/packages/deploy/dist/providers/fly/jsonOutputSchemas.js +37 -0
- package/data/packages/deploy/dist/providers/fly/tomlFile.js +65 -0
- package/data/packages/deploy/dist/providers/railway/DeploymentInstructions.js +11 -0
- package/data/packages/deploy/dist/providers/railway/brandedTypes.js +2 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/DeployCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/client.js +22 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/common.js +40 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/index.js +57 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/server.js +17 -0
- package/data/packages/deploy/dist/providers/railway/commands/launch/LaunchCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/railway/commands/launch/launch.js +9 -0
- package/data/packages/deploy/dist/providers/railway/commands/setup/SetupCmdOptions.js +2 -0
- package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +146 -0
- package/data/packages/deploy/dist/providers/railway/index.js +83 -0
- package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +19 -0
- package/data/packages/deploy/dist/providers/railway/ports.js +6 -0
- package/data/packages/deploy/dist/providers/railway/railwayCli.js +85 -0
- package/data/packages/deploy/dist/providers/railway/railwayProject/RailwayProject.js +14 -0
- package/data/packages/deploy/dist/providers/railway/railwayProject/cli.js +80 -0
- package/data/packages/deploy/dist/providers/railway/railwayProject/index.js +48 -0
- package/data/packages/deploy/dist/providers/railway/railwayService/nameGenerator.js +24 -0
- package/data/packages/deploy/dist/providers/railway/railwayService/url.js +32 -0
- package/data/packages/deploy/package-lock.json +3536 -0
- package/data/packages/deploy/package.json +29 -0
- package/data/packages/prisma/dist/format.js +35 -0
- package/data/packages/prisma/dist/index.js +33 -0
- package/data/packages/prisma/package-lock.json +5101 -0
- package/data/packages/prisma/package.json +30 -0
- package/data/packages/studio/dist/index.js +48 -0
- package/data/packages/studio/dist/public/assets/Flow-b5112d3d.js +26 -0
- package/data/packages/studio/dist/public/assets/index-17ce6ed4.css +1 -0
- package/data/packages/studio/dist/public/assets/index-62a9d21a.js +120 -0
- package/data/packages/studio/dist/public/index.html +14 -0
- package/data/packages/studio/package-lock.json +1866 -0
- package/data/packages/studio/package.json +33 -0
- package/data/packages/ts-inspect/dist/exports.js +82 -0
- package/data/packages/ts-inspect/dist/index.js +28 -0
- package/data/packages/ts-inspect/package-lock.json +4947 -0
- package/data/packages/ts-inspect/package.json +31 -0
- package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.d.ts +2 -0
- package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.js +59 -0
- package/data/packages/wasp-config/dist/__tests__/cli.unit.test.d.ts +2 -0
- package/data/packages/wasp-config/dist/__tests__/cli.unit.test.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/cli.unit.test.js +65 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.d.ts +2 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.js +126 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.d.ts +2 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.js +743 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.d.ts +224 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.js +656 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.d.ts +2 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.js +57 -0
- package/data/packages/wasp-config/dist/src/_private.d.ts +2 -0
- package/data/packages/wasp-config/dist/src/_private.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/_private.js +1 -0
- package/data/packages/wasp-config/dist/src/appAnalyzer.d.ts +16 -0
- package/data/packages/wasp-config/dist/src/appAnalyzer.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/appAnalyzer.js +34 -0
- package/data/packages/wasp-config/dist/src/appSpec.d.ts +223 -0
- package/data/packages/wasp-config/dist/src/appSpec.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/appSpec.js +6 -0
- package/data/packages/wasp-config/dist/src/branded.d.ts +7 -0
- package/data/packages/wasp-config/dist/src/branded.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/branded.js +1 -0
- package/data/packages/wasp-config/dist/src/cli.d.ts +6 -0
- package/data/packages/wasp-config/dist/src/cli.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/cli.js +24 -0
- package/data/packages/wasp-config/dist/src/index.d.ts +8 -0
- package/data/packages/wasp-config/dist/src/index.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/index.js +1 -0
- package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.d.ts +38 -0
- package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.js +294 -0
- package/data/packages/wasp-config/dist/src/publicApi/App.d.ts +24 -0
- package/data/packages/wasp-config/dist/src/publicApi/App.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/publicApi/App.js +75 -0
- package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.d.ts +171 -0
- package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.js +1 -0
- package/data/packages/wasp-config/dist/src/run.d.ts +3 -0
- package/data/packages/wasp-config/dist/src/run.d.ts.map +1 -0
- package/data/packages/wasp-config/dist/src/run.js +18 -0
- package/data/packages/wasp-config/package-lock.json +3992 -0
- package/data/packages/wasp-config/package.json +39 -0
- package/main.js +9 -0
- package/package.json +1 -0
- package/readme.md +3 -0
- package/wasp-bin +0 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module maps the TsAppSpec-facing API to the internal representation of the app (AppSpec Decl).
|
|
3
|
+
* All of the mapping functions are exported so that they can be individually tested.
|
|
4
|
+
*/
|
|
5
|
+
export function mapTsAppSpecToAppSpecDecls(tsAppSpec, entityNames) {
|
|
6
|
+
const { app, actions, apis, apiNamespaces, auth, client, db, emailSender, jobs, pages, queries, routes, server, websocket, cruds, } = tsAppSpec;
|
|
7
|
+
const pageNames = Array.from(pages.keys());
|
|
8
|
+
const routeNames = Array.from(routes.keys());
|
|
9
|
+
const entityRefParser = makeRefParser("Entity", entityNames);
|
|
10
|
+
const pageRefParser = makeRefParser("Page", pageNames);
|
|
11
|
+
const routeRefParser = makeRefParser("Route", routeNames);
|
|
12
|
+
const pageDecls = mapToDecls(pages, "Page", mapPage);
|
|
13
|
+
const routeDecls = mapToDecls(routes, "Route", (routeConfig) => mapRoute(routeConfig, pageRefParser));
|
|
14
|
+
const actionDecls = mapToDecls(actions, "Action", (actionConfig) => mapOperation(actionConfig, entityRefParser));
|
|
15
|
+
const queryDecls = mapToDecls(queries, "Query", (queryConfig) => mapOperation(queryConfig, entityRefParser));
|
|
16
|
+
const apiDecls = mapToDecls(apis, "Api", (apiConfig) => mapApi(apiConfig, entityRefParser));
|
|
17
|
+
const jobDecls = mapToDecls(jobs, "Job", (jobConfig) => mapJob(jobConfig, entityRefParser));
|
|
18
|
+
const apiNamespaceDecls = mapToDecls(apiNamespaces, "ApiNamespace", mapApiNamespace);
|
|
19
|
+
const crudDecls = mapToDecls(cruds, "Crud", (crudConfig) => mapCrud(crudConfig, entityRefParser));
|
|
20
|
+
const appDecl = {
|
|
21
|
+
declType: "App",
|
|
22
|
+
declName: app.name,
|
|
23
|
+
declValue: mapApp(app.config, entityRefParser, routeRefParser, auth, client, server, db, emailSender, websocket),
|
|
24
|
+
};
|
|
25
|
+
return makeDeclsArray({
|
|
26
|
+
App: [appDecl],
|
|
27
|
+
Page: pageDecls,
|
|
28
|
+
Route: routeDecls,
|
|
29
|
+
Action: actionDecls,
|
|
30
|
+
Query: queryDecls,
|
|
31
|
+
Api: apiDecls,
|
|
32
|
+
Job: jobDecls,
|
|
33
|
+
ApiNamespace: apiNamespaceDecls,
|
|
34
|
+
Crud: crudDecls,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function makeDeclsArray(decls) {
|
|
38
|
+
return Object.values(decls).flatMap((decl) => [...decl]);
|
|
39
|
+
}
|
|
40
|
+
function mapToDecls(configs, type, configToDeclValue) {
|
|
41
|
+
return [...configs].map(([name, config]) => ({
|
|
42
|
+
declType: type,
|
|
43
|
+
declName: name,
|
|
44
|
+
declValue: configToDeclValue(config),
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
export function mapOperation(config, entityRefParser) {
|
|
48
|
+
const { fn, entities, auth } = config;
|
|
49
|
+
return {
|
|
50
|
+
fn: mapExtImport(fn),
|
|
51
|
+
entities: entities?.map(entityRefParser),
|
|
52
|
+
auth,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function mapExtImport(extImport) {
|
|
56
|
+
if ("import" in extImport) {
|
|
57
|
+
return {
|
|
58
|
+
kind: "named",
|
|
59
|
+
name: extImport.import,
|
|
60
|
+
path: extImport.from,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else if ("importDefault" in extImport) {
|
|
64
|
+
return {
|
|
65
|
+
kind: "default",
|
|
66
|
+
name: extImport.importDefault,
|
|
67
|
+
path: extImport.from,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new Error("Invalid ExtImport: neither `import` nor `importDefault` is defined");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export function mapHttpRoute(httpRoute) {
|
|
75
|
+
return [httpRoute.method, httpRoute.route];
|
|
76
|
+
}
|
|
77
|
+
export function mapApi(config, entityRefParser) {
|
|
78
|
+
const { fn, middlewareConfigFn, entities, httpRoute, auth } = config;
|
|
79
|
+
return {
|
|
80
|
+
fn: mapExtImport(fn),
|
|
81
|
+
middlewareConfigFn: middlewareConfigFn && mapExtImport(middlewareConfigFn),
|
|
82
|
+
entities: entities && entities.map(entityRefParser),
|
|
83
|
+
httpRoute: mapHttpRoute(httpRoute),
|
|
84
|
+
auth,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export function mapApiNamespace(config) {
|
|
88
|
+
const { middlewareConfigFn, path } = config;
|
|
89
|
+
return {
|
|
90
|
+
middlewareConfigFn: mapExtImport(middlewareConfigFn),
|
|
91
|
+
path,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function mapApp(app,
|
|
95
|
+
// TODO: Make this better, optional props are problematic so I have to pass the parsers first
|
|
96
|
+
entityRefParser, routeRefParser, auth, client, server, db, emailSender, webSocket) {
|
|
97
|
+
const { title, wasp, head } = app;
|
|
98
|
+
return {
|
|
99
|
+
wasp,
|
|
100
|
+
title,
|
|
101
|
+
head,
|
|
102
|
+
auth: auth && mapAuth(auth, entityRefParser, routeRefParser),
|
|
103
|
+
client: client && mapClient(client),
|
|
104
|
+
server: server && mapServer(server),
|
|
105
|
+
webSocket: webSocket && mapWebSocket(webSocket),
|
|
106
|
+
db: db && mapDb(db),
|
|
107
|
+
emailSender: emailSender && mapEmailSender(emailSender),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export function mapAuth(auth, entityRefParser, routeRefParser) {
|
|
111
|
+
const { userEntity, externalAuthEntity, methods, onAuthFailedRedirectTo, onAuthSucceededRedirectTo, onBeforeSignup, onAfterSignup, onAfterEmailVerified, onBeforeOAuthRedirect, onBeforeLogin, onAfterLogin, } = auth;
|
|
112
|
+
return {
|
|
113
|
+
userEntity: entityRefParser(userEntity),
|
|
114
|
+
// TODO: Abstract away this pattern
|
|
115
|
+
externalAuthEntity: externalAuthEntity === undefined
|
|
116
|
+
? undefined
|
|
117
|
+
: entityRefParser(externalAuthEntity),
|
|
118
|
+
methods: mapAuthMethods(methods, routeRefParser),
|
|
119
|
+
onAuthFailedRedirectTo,
|
|
120
|
+
onAuthSucceededRedirectTo,
|
|
121
|
+
onBeforeSignup: onBeforeSignup && mapExtImport(onBeforeSignup),
|
|
122
|
+
onAfterSignup: onAfterSignup && mapExtImport(onAfterSignup),
|
|
123
|
+
onAfterEmailVerified: onAfterEmailVerified && mapExtImport(onAfterEmailVerified),
|
|
124
|
+
onBeforeOAuthRedirect: onBeforeOAuthRedirect && mapExtImport(onBeforeOAuthRedirect),
|
|
125
|
+
onBeforeLogin: onBeforeLogin && mapExtImport(onBeforeLogin),
|
|
126
|
+
onAfterLogin: onAfterLogin && mapExtImport(onAfterLogin),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export function mapAuthMethods(methods, routeRefParser) {
|
|
130
|
+
// TODO: check keyof danger, effective ts
|
|
131
|
+
const { usernameAndPassword, discord, google, gitHub, keycloak, email } = methods;
|
|
132
|
+
return {
|
|
133
|
+
usernameAndPassword: usernameAndPassword && mapUsernameAndPassword(usernameAndPassword),
|
|
134
|
+
discord: discord && mapExternalAuth(discord),
|
|
135
|
+
google: google && mapExternalAuth(google),
|
|
136
|
+
gitHub: gitHub && mapExternalAuth(gitHub),
|
|
137
|
+
keycloak: keycloak && mapExternalAuth(keycloak),
|
|
138
|
+
email: email && mapEmailAuth(email, routeRefParser),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export function mapUsernameAndPassword(usernameAndPassword) {
|
|
142
|
+
const { userSignupFields } = usernameAndPassword;
|
|
143
|
+
return {
|
|
144
|
+
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export function mapExternalAuth(externalAuth) {
|
|
148
|
+
const { configFn, userSignupFields } = externalAuth;
|
|
149
|
+
return {
|
|
150
|
+
configFn: configFn && mapExtImport(configFn),
|
|
151
|
+
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function mapEmailAuth(emailConfig, routeRefParser) {
|
|
155
|
+
const { userSignupFields, fromField, emailVerification, passwordReset } = emailConfig;
|
|
156
|
+
return {
|
|
157
|
+
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
158
|
+
fromField: mapEmailFromField(fromField),
|
|
159
|
+
emailVerification: mapEmailVerification(emailVerification, routeRefParser),
|
|
160
|
+
passwordReset: mapPasswordReset(passwordReset, routeRefParser),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export function mapEmailVerification(emailVerification, routeRefParser) {
|
|
164
|
+
const { getEmailContentFn, clientRoute } = emailVerification;
|
|
165
|
+
return {
|
|
166
|
+
getEmailContentFn: getEmailContentFn && mapExtImport(getEmailContentFn),
|
|
167
|
+
clientRoute: routeRefParser(clientRoute),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export function mapPasswordReset(passwordReset, routeRefParser) {
|
|
171
|
+
const { getEmailContentFn, clientRoute } = passwordReset;
|
|
172
|
+
return {
|
|
173
|
+
getEmailContentFn: getEmailContentFn && mapExtImport(getEmailContentFn),
|
|
174
|
+
clientRoute: routeRefParser(clientRoute),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export function mapDb(db) {
|
|
178
|
+
const { seeds, prismaSetupFn } = db;
|
|
179
|
+
return {
|
|
180
|
+
seeds: seeds?.map(mapExtImport),
|
|
181
|
+
prismaSetupFn: prismaSetupFn && mapExtImport(prismaSetupFn),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export function mapEmailSender(emailSender) {
|
|
185
|
+
const { provider, defaultFrom } = emailSender;
|
|
186
|
+
return {
|
|
187
|
+
provider,
|
|
188
|
+
defaultFrom: defaultFrom && mapEmailFromField(defaultFrom),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export function mapEmailFromField(defaultFrom) {
|
|
192
|
+
return (defaultFrom && {
|
|
193
|
+
name: defaultFrom.name,
|
|
194
|
+
email: defaultFrom.email,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
export function mapServer(server) {
|
|
198
|
+
const { setupFn, middlewareConfigFn, envValidationSchema } = server;
|
|
199
|
+
return {
|
|
200
|
+
setupFn: setupFn && mapExtImport(setupFn),
|
|
201
|
+
middlewareConfigFn: middlewareConfigFn && mapExtImport(middlewareConfigFn),
|
|
202
|
+
envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export function mapClient(client) {
|
|
206
|
+
const { setupFn, rootComponent, baseDir, envValidationSchema } = client;
|
|
207
|
+
return {
|
|
208
|
+
setupFn: setupFn && mapExtImport(setupFn),
|
|
209
|
+
rootComponent: rootComponent && mapExtImport(rootComponent),
|
|
210
|
+
baseDir,
|
|
211
|
+
envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
export function mapWebSocket(websocket) {
|
|
215
|
+
const { fn, autoConnect } = websocket;
|
|
216
|
+
return {
|
|
217
|
+
fn: mapExtImport(fn),
|
|
218
|
+
autoConnect,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
export function mapJob(job, entityRefParser) {
|
|
222
|
+
const { executor, perform, schedule, entities } = job;
|
|
223
|
+
return {
|
|
224
|
+
executor,
|
|
225
|
+
perform: mapPerform(perform),
|
|
226
|
+
schedule: schedule && mapSchedule(schedule),
|
|
227
|
+
entities: entities && entities.map(entityRefParser),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
export function mapSchedule(schedule) {
|
|
231
|
+
const { cron, args, executorOptions } = schedule;
|
|
232
|
+
return {
|
|
233
|
+
cron,
|
|
234
|
+
args,
|
|
235
|
+
executorOptions,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
export function mapPerform(perform) {
|
|
239
|
+
const { fn, executorOptions } = perform;
|
|
240
|
+
return {
|
|
241
|
+
fn: mapExtImport(fn),
|
|
242
|
+
executorOptions,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export function mapRoute(route, pageRefParser) {
|
|
246
|
+
const { path, to } = route;
|
|
247
|
+
return {
|
|
248
|
+
path,
|
|
249
|
+
to: pageRefParser(to),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export function mapCrud(crudConfig, entityRefParser) {
|
|
253
|
+
const { entity, operations } = crudConfig;
|
|
254
|
+
return {
|
|
255
|
+
entity: entityRefParser(entity),
|
|
256
|
+
operations: mapCrudOperations(operations),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
export function mapCrudOperations(operations) {
|
|
260
|
+
const { get, getAll, create, update, delete: del } = operations;
|
|
261
|
+
// TODO: Do this for all keys
|
|
262
|
+
return {
|
|
263
|
+
get: get && mapCrudOperationOptions(get),
|
|
264
|
+
getAll: getAll && mapCrudOperationOptions(getAll),
|
|
265
|
+
create: create && mapCrudOperationOptions(create),
|
|
266
|
+
update: update && mapCrudOperationOptions(update),
|
|
267
|
+
delete: del && mapCrudOperationOptions(del),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
export function mapCrudOperationOptions(options) {
|
|
271
|
+
const { isPublic, overrideFn } = options;
|
|
272
|
+
return {
|
|
273
|
+
isPublic,
|
|
274
|
+
overrideFn: overrideFn && mapExtImport(overrideFn),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
export function mapPage(pageConfig) {
|
|
278
|
+
const { component, authRequired } = pageConfig;
|
|
279
|
+
return {
|
|
280
|
+
component: mapExtImport(component),
|
|
281
|
+
authRequired,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
export function makeRefParser(declType, declNames) {
|
|
285
|
+
return function parseRef(potentialRef) {
|
|
286
|
+
if (!declNames.includes(potentialRef)) {
|
|
287
|
+
throw new Error(`Invalid ${declType} reference: ${potentialRef}`);
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
name: potentialRef,
|
|
291
|
+
declType,
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** This module defines the user-facing API for defining a Wasp app.
|
|
2
|
+
*/
|
|
3
|
+
import { GET_TS_APP_SPEC } from "../_private.js";
|
|
4
|
+
import * as TsAppSpec from "./tsAppSpec.js";
|
|
5
|
+
export declare class App {
|
|
6
|
+
#private;
|
|
7
|
+
[GET_TS_APP_SPEC](): TsAppSpec.TsAppSpec;
|
|
8
|
+
constructor(name: string, config: TsAppSpec.AppConfig);
|
|
9
|
+
action(this: App, name: string, config: TsAppSpec.ActionConfig): void;
|
|
10
|
+
apiNamespace(this: App, name: string, config: TsAppSpec.ApiNamespaceConfig): void;
|
|
11
|
+
api(this: App, name: string, config: TsAppSpec.ApiConfig): void;
|
|
12
|
+
auth(this: App, config: TsAppSpec.AuthConfig): void;
|
|
13
|
+
client(this: App, config: TsAppSpec.ClientConfig): void;
|
|
14
|
+
crud(this: App, name: string, config: TsAppSpec.CrudConfig): void;
|
|
15
|
+
db(this: App, config: TsAppSpec.DbConfig): void;
|
|
16
|
+
emailSender(this: App, config: TsAppSpec.EmailSenderConfig): void;
|
|
17
|
+
job(this: App, name: string, config: TsAppSpec.JobConfig): void;
|
|
18
|
+
page(this: App, name: string, config: TsAppSpec.PageConfig): TsAppSpec.PageName;
|
|
19
|
+
query(this: App, name: string, config: TsAppSpec.QueryConfig): void;
|
|
20
|
+
route(this: App, name: string, config: TsAppSpec.RouteConfig): void;
|
|
21
|
+
server(this: App, config: TsAppSpec.ServerConfig): void;
|
|
22
|
+
webSocket(this: App, config: TsAppS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AE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,GAAG,IAAI;IAI/D,IAAI,CACF,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,CAAC,UAAU,GAC3B,SAAS,CAAC,QAAQ;IAKrB,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI;IAInE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI;IAInE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI;IAIvD,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe;CAGvD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** This module defines the user-facing API for defining a Wasp app.
|
|
2
|
+
*/
|
|
3
|
+
import { GET_TS_APP_SPEC } from "../_private.js";
|
|
4
|
+
export class App {
|
|
5
|
+
#tsAppSpec;
|
|
6
|
+
// NOTE: Using a non-public symbol gives us a package-private property.
|
|
7
|
+
// It's not that important to hide it from the users, but we still don't want
|
|
8
|
+
// user's IDE to suggest it during autocompletion.
|
|
9
|
+
[GET_TS_APP_SPEC]() {
|
|
10
|
+
return this.#tsAppSpec;
|
|
11
|
+
}
|
|
12
|
+
constructor(name, config) {
|
|
13
|
+
this.#tsAppSpec = {
|
|
14
|
+
app: { name, config },
|
|
15
|
+
actions: new Map(),
|
|
16
|
+
apiNamespaces: new Map(),
|
|
17
|
+
apis: new Map(),
|
|
18
|
+
auth: undefined,
|
|
19
|
+
client: undefined,
|
|
20
|
+
cruds: new Map(),
|
|
21
|
+
db: undefined,
|
|
22
|
+
emailSender: undefined,
|
|
23
|
+
jobs: new Map(),
|
|
24
|
+
pages: new Map(),
|
|
25
|
+
queries: new Map(),
|
|
26
|
+
routes: new Map(),
|
|
27
|
+
server: undefined,
|
|
28
|
+
websocket: undefined,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// TODO: Enforce that all methods are covered in compile time
|
|
32
|
+
action(name, config) {
|
|
33
|
+
this.#tsAppSpec.actions.set(name, config);
|
|
34
|
+
}
|
|
35
|
+
apiNamespace(name, config) {
|
|
36
|
+
this.#tsAppSpec.apiNamespaces.set(name, config);
|
|
37
|
+
}
|
|
38
|
+
api(name, config) {
|
|
39
|
+
this.#tsAppSpec.apis.set(name, config);
|
|
40
|
+
}
|
|
41
|
+
auth(config) {
|
|
42
|
+
this.#tsAppSpec.auth = config;
|
|
43
|
+
}
|
|
44
|
+
client(config) {
|
|
45
|
+
this.#tsAppSpec.client = config;
|
|
46
|
+
}
|
|
47
|
+
crud(name, config) {
|
|
48
|
+
this.#tsAppSpec.cruds.set(name, config);
|
|
49
|
+
}
|
|
50
|
+
db(config) {
|
|
51
|
+
this.#tsAppSpec.db = config;
|
|
52
|
+
}
|
|
53
|
+
emailSender(config) {
|
|
54
|
+
this.#tsAppSpec.emailSender = config;
|
|
55
|
+
}
|
|
56
|
+
job(name, config) {
|
|
57
|
+
this.#tsAppSpec.jobs.set(name, config);
|
|
58
|
+
}
|
|
59
|
+
page(name, config) {
|
|
60
|
+
this.#tsAppSpec.pages.set(name, config);
|
|
61
|
+
return name;
|
|
62
|
+
}
|
|
63
|
+
query(name, config) {
|
|
64
|
+
this.#tsAppSpec.queries.set(name, config);
|
|
65
|
+
}
|
|
66
|
+
route(name, config) {
|
|
67
|
+
this.#tsAppSpec.routes.set(name, config);
|
|
68
|
+
}
|
|
69
|
+
server(config) {
|
|
70
|
+
this.#tsAppSpec.server = config;
|
|
71
|
+
}
|
|
72
|
+
webSocket(config) {
|
|
73
|
+
this.#tsAppSpec.websocket = config;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import * as AppSpec from "../appSpec.js";
|
|
2
|
+
import { Branded } from "../branded.js";
|
|
3
|
+
export type TsAppSpec = {
|
|
4
|
+
app: {
|
|
5
|
+
name: string;
|
|
6
|
+
config: AppConfig;
|
|
7
|
+
};
|
|
8
|
+
actions: Map<string, ActionConfig>;
|
|
9
|
+
apiNamespaces: Map<string, ApiNamespaceConfig>;
|
|
10
|
+
apis: Map<string, ApiConfig>;
|
|
11
|
+
auth?: AuthConfig;
|
|
12
|
+
client?: ClientConfig;
|
|
13
|
+
cruds: Map<string, CrudConfig>;
|
|
14
|
+
db?: DbConfig;
|
|
15
|
+
emailSender?: EmailSenderConfig;
|
|
16
|
+
jobs: Map<string, JobConfig>;
|
|
17
|
+
pages: Map<string, PageConfig>;
|
|
18
|
+
queries: Map<string, QueryConfig>;
|
|
19
|
+
routes: Map<string, RouteConfig>;
|
|
20
|
+
server?: ServerConfig;
|
|
21
|
+
websocket?: WebsocketConfig;
|
|
22
|
+
};
|
|
23
|
+
export type AppConfig = {
|
|
24
|
+
title: string;
|
|
25
|
+
wasp: AppSpec.Wasp;
|
|
26
|
+
head?: string[];
|
|
27
|
+
};
|
|
28
|
+
export type ActionConfig = {
|
|
29
|
+
fn: ExtImport;
|
|
30
|
+
entities?: string[];
|
|
31
|
+
auth?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type ApiNamespaceConfig = {
|
|
34
|
+
middlewareConfigFn: ExtImport;
|
|
35
|
+
path: string;
|
|
36
|
+
};
|
|
37
|
+
export type ApiConfig = {
|
|
38
|
+
fn: ExtImport;
|
|
39
|
+
middlewareConfigFn?: ExtImport;
|
|
40
|
+
entities?: string[];
|
|
41
|
+
httpRoute: HttpRoute;
|
|
42
|
+
auth?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type HttpRoute = {
|
|
45
|
+
method: AppSpec.HttpMethod;
|
|
46
|
+
route: string;
|
|
47
|
+
};
|
|
48
|
+
export type AuthConfig = {
|
|
49
|
+
userEntity: string;
|
|
50
|
+
methods: AuthMethods;
|
|
51
|
+
externalAuthEntity?: string;
|
|
52
|
+
onAuthFailedRedirectTo: string;
|
|
53
|
+
onAuthSucceededRedirectTo?: string;
|
|
54
|
+
onBeforeSignup?: ExtImport;
|
|
55
|
+
onAfterSignup?: ExtImport;
|
|
56
|
+
onAfterEmailVerified?: ExtImport;
|
|
57
|
+
onBeforeOAuthRedirect?: ExtImport;
|
|
58
|
+
onBeforeLogin?: ExtImport;
|
|
59
|
+
onAfterLogin?: ExtImport;
|
|
60
|
+
};
|
|
61
|
+
export type AuthMethods = {
|
|
62
|
+
usernameAndPassword?: UsernameAndPasswordConfig;
|
|
63
|
+
discord?: ExternalAuthConfig;
|
|
64
|
+
google?: ExternalAuthConfig;
|
|
65
|
+
gitHub?: ExternalAuthConfig;
|
|
66
|
+
keycloak?: ExternalAuthConfig;
|
|
67
|
+
email?: EmailAuthConfig;
|
|
68
|
+
};
|
|
69
|
+
export type UsernameAndPasswordConfig = {
|
|
70
|
+
userSignupFields?: ExtImport;
|
|
71
|
+
};
|
|
72
|
+
export type EmailAuthConfig = {
|
|
73
|
+
userSignupFields?: ExtImport;
|
|
74
|
+
fromField: EmailFromField;
|
|
75
|
+
emailVerification: EmailVerificationConfig;
|
|
76
|
+
passwordReset: PasswordResetConfig;
|
|
77
|
+
};
|
|
78
|
+
export type EmailVerificationConfig = {
|
|
79
|
+
getEmailContentFn?: ExtImport;
|
|
80
|
+
clientRoute: string;
|
|
81
|
+
};
|
|
82
|
+
export type PasswordResetConfig = {
|
|
83
|
+
getEmailContentFn?: ExtImport;
|
|
84
|
+
clientRoute: string;
|
|
85
|
+
};
|
|
86
|
+
export type ExternalAuthConfig = {
|
|
87
|
+
configFn?: ExtImport;
|
|
88
|
+
userSignupFields?: ExtImport;
|
|
89
|
+
};
|
|
90
|
+
export type ClientConfig = {
|
|
91
|
+
rootComponent?: ExtImport;
|
|
92
|
+
setupFn?: ExtImport;
|
|
93
|
+
baseDir?: `/${string}`;
|
|
94
|
+
envValidationSchema?: ExtImport;
|
|
95
|
+
};
|
|
96
|
+
export type CrudConfig = {
|
|
97
|
+
entity: string;
|
|
98
|
+
operations: CrudOperations;
|
|
99
|
+
};
|
|
100
|
+
export type CrudOperations = {
|
|
101
|
+
get?: CrudOperationOptions;
|
|
102
|
+
getAll?: CrudOperationOptions;
|
|
103
|
+
create?: CrudOperationOptions;
|
|
104
|
+
update?: CrudOperationOptions;
|
|
105
|
+
delete?: CrudOperationOptions;
|
|
106
|
+
};
|
|
107
|
+
export type CrudOperationOptions = {
|
|
108
|
+
isPublic?: boolean;
|
|
109
|
+
overrideFn?: ExtImport;
|
|
110
|
+
};
|
|
111
|
+
export type DbConfig = {
|
|
112
|
+
seeds?: ExtImport[];
|
|
113
|
+
prismaSetupFn?: ExtImport;
|
|
114
|
+
};
|
|
115
|
+
export type EmailSenderConfig = {
|
|
116
|
+
provider: AppSpec.EmailProvider;
|
|
117
|
+
defaultFrom?: EmailFromField;
|
|
118
|
+
};
|
|
119
|
+
export type JobConfig = {
|
|
120
|
+
executor: AppSpec.JobExecutor;
|
|
121
|
+
perform: Perform;
|
|
122
|
+
schedule?: Schedule;
|
|
123
|
+
entities?: string[];
|
|
124
|
+
};
|
|
125
|
+
export type Perform = {
|
|
126
|
+
fn: ExtImport;
|
|
127
|
+
executorOptions?: ExecutorOptions;
|
|
128
|
+
};
|
|
129
|
+
export type Schedule = {
|
|
130
|
+
cron: string;
|
|
131
|
+
args?: object;
|
|
132
|
+
executorOptions?: ExecutorOptions;
|
|
133
|
+
};
|
|
134
|
+
export type ExecutorOptions = {
|
|
135
|
+
pgBoss: object;
|
|
136
|
+
};
|
|
137
|
+
export type PageConfig = {
|
|
138
|
+
component: ExtImport;
|
|
139
|
+
authRequired?: boolean;
|
|
140
|
+
};
|
|
141
|
+
export type QueryConfig = {
|
|
142
|
+
fn: ExtImport;
|
|
143
|
+
entities?: string[];
|
|
144
|
+
auth?: boolean;
|
|
145
|
+
};
|
|
146
|
+
export type RouteConfig = {
|
|
147
|
+
path: string;
|
|
148
|
+
to: PageName;
|
|
149
|
+
};
|
|
150
|
+
export type PageName = Branded<string, "PageName">;
|
|
151
|
+
export type ServerConfig = {
|
|
152
|
+
setupFn?: ExtImport;
|
|
153
|
+
middlewareConfigFn?: ExtImport;
|
|
154
|
+
envValidationSchema?: ExtImport;
|
|
155
|
+
};
|
|
156
|
+
export type WebsocketConfig = {
|
|
157
|
+
fn: ExtImport;
|
|
158
|
+
autoConnect?: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type ExtImport = {
|
|
161
|
+
import: string;
|
|
162
|
+
from: AppSpec.ExtImport["path"];
|
|
163
|
+
} | {
|
|
164
|
+
importDefault: string;
|
|
165
|
+
from: AppSpec.ExtImport["path"];
|
|
166
|
+
};
|
|
167
|
+
export type EmailFromField = {
|
|
168
|
+
name?: string;
|
|
169
|
+
email: string;
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=tsAppSpec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsAppSpec.d.ts","sourceRoot":"","sources":["../../../src/publicApi/tsAppSpec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,CAAA;KAAE,CAAC;IACzC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACnC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/C,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE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,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { writeFileSync } from "fs";
|
|
3
|
+
import { analyzeApp } from "./appAnalyzer.js";
|
|
4
|
+
import { parseProcessArgsOrThrow } from "./cli.js";
|
|
5
|
+
main(process.argv);
|
|
6
|
+
/**
|
|
7
|
+
* Main function that processes command line arguments, analyzes the user app,
|
|
8
|
+
* and writes the output to a file.
|
|
9
|
+
*/
|
|
10
|
+
async function main(args) {
|
|
11
|
+
const { waspTsSpecPath, outputFilePath, entityNames } = parseProcessArgsOrThrow(args);
|
|
12
|
+
const declsResult = await analyzeApp(waspTsSpecPath, entityNames);
|
|
13
|
+
if (declsResult.status === "error") {
|
|
14
|
+
console.error(declsResult.error);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
writeFileSync(outputFilePath, JSON.stringify(declsResult.value));
|
|
18
|
+
}
|