@wasp.sh/wasp-cli-darwin-x64-unknown 0.25.0 → 0.26.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 +2 -0
- package/data/Cli/starters/basic/README.md +3 -3
- package/data/Cli/starters/basic/src/tags/components/CreateTagForm.tsx +2 -3
- package/data/Cli/starters/basic/vite.config.ts +0 -3
- package/data/Cli/starters/minimal/package.json +4 -1
- package/data/Cli/starters/minimal/vite.config.ts +0 -3
- package/data/Cli/starters/skeleton/AGENTS.md +6 -0
- package/data/Cli/starters/skeleton/CLAUDE.md +6 -0
- package/data/Cli/starters/skeleton/tsconfig.src.json +1 -11
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.26.0.tgz +0 -0
- package/data/Generator/libs/sdk-core/node_modules/@wasp.sh/lib-auth/wasp.sh-lib-auth-0.26.0.tgz +0 -0
- package/data/Generator/libs/sdk-core/wasp.sh-lib-sdk-core-0.26.0.tgz +0 -0
- package/data/Generator/libs/vite-ssr/{wasp.sh-lib-vite-ssr-0.25.0.tgz → wasp.sh-lib-vite-ssr-0.26.0.tgz} +0 -0
- package/data/Generator/templates/Dockerfile +1 -0
- package/data/Generator/templates/sdk/wasp/api/index.ts +5 -86
- package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +2 -2
- package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +7 -6
- package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx +12 -6
- package/data/Generator/templates/sdk/wasp/auth/forms/ForgotPassword.tsx +2 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/Login.tsx +2 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/ResetPassword.tsx +2 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/Signup.tsx +5 -5
- package/data/Generator/templates/sdk/wasp/auth/forms/VerifyEmail.tsx +2 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +34 -33
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/DummyEmailSenderNotice.module.css +11 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/DummyEmailSenderNotice.tsx +17 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx +9 -13
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx +8 -9
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx +4 -8
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/useEmail.ts +5 -5
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/usernameAndPassword/useUsernameAndPassword.ts +6 -5
- package/data/Generator/templates/sdk/wasp/auth/forms/types.ts +0 -59
- package/data/Generator/templates/sdk/wasp/auth/helpers/_Provider.tsx +2 -2
- package/data/Generator/templates/sdk/wasp/auth/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/logout.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/providers/index.ts +4 -4
- package/data/Generator/templates/sdk/wasp/auth/providers/types.ts +20 -24
- package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +5 -5
- package/data/Generator/templates/sdk/wasp/auth/user.ts +147 -14
- package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +2 -2
- package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +6 -5
- package/data/Generator/templates/sdk/wasp/auth/validation.ts +1 -83
- package/data/Generator/templates/sdk/wasp/client/app/pages/OAuthCallback.tsx +8 -5
- package/data/Generator/templates/sdk/wasp/client/app/pages/createAuthRequiredPage.jsx +6 -4
- package/data/Generator/templates/sdk/wasp/client/app/router.tsx +2 -2
- package/data/Generator/templates/sdk/wasp/client/auth/ui.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/auth/username.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/config.ts +1 -6
- package/data/Generator/templates/sdk/wasp/client/crud/_crud.ts +129 -75
- package/data/Generator/templates/sdk/wasp/client/env/schema.ts +14 -7
- package/data/Generator/templates/sdk/wasp/client/env.ts +4 -3
- package/data/Generator/templates/sdk/wasp/client/index.ts +3 -12
- package/data/Generator/templates/sdk/wasp/client/operations/actions/core.ts +14 -10
- package/data/Generator/templates/sdk/wasp/client/operations/actions/index.ts +7 -4
- package/data/Generator/templates/sdk/wasp/client/operations/index.ts +5 -5
- package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +1 -8
- package/data/Generator/templates/sdk/wasp/client/operations/queries/core.ts +13 -55
- package/data/Generator/templates/sdk/wasp/client/operations/queries/index.ts +7 -7
- package/data/Generator/templates/sdk/wasp/client/router/Link.tsx +8 -8
- package/data/Generator/templates/sdk/wasp/client/router/NavLink.tsx +8 -8
- package/data/Generator/templates/sdk/wasp/client/router/index.ts +15 -15
- package/data/Generator/templates/sdk/wasp/client/test/index.ts +2 -1
- package/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx +5 -36
- package/data/Generator/templates/sdk/wasp/client/vite/index.ts +2 -1
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/virtualUserModules.ts +43 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/{virtualModules.ts → virtualWaspModules.ts} +4 -4
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +17 -14
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/waspConfig.ts +60 -18
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/client-entry.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/routes.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/ssr-entry.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/client/webSocket/WebSocketProvider.tsx +3 -3
- package/data/Generator/templates/sdk/wasp/client/webSocket/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/core/serialization/index.ts +2 -47
- package/data/Generator/templates/sdk/wasp/core/serialization/prisma.ts +0 -1
- package/data/Generator/templates/sdk/wasp/entities/index.ts +6 -6
- package/data/Generator/templates/sdk/wasp/env/index.ts +1 -9
- package/data/Generator/templates/sdk/wasp/package.json +150 -104
- package/data/Generator/templates/sdk/wasp/server/_types/index.ts +8 -10
- package/data/Generator/templates/sdk/wasp/server/_types/taggedEntities.ts +4 -4
- package/data/Generator/templates/sdk/wasp/server/api/index.ts +5 -5
- package/data/Generator/templates/sdk/wasp/server/auth/email/index.ts +2 -12
- package/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts +8 -30
- package/data/Generator/templates/sdk/wasp/server/auth/hooks.ts +5 -2
- package/data/Generator/templates/sdk/wasp/server/auth/index.ts +3 -3
- package/data/Generator/templates/sdk/wasp/{auth → server/auth}/jwt.ts +1 -1
- package/data/Generator/templates/sdk/wasp/{auth → server/auth}/lucia.ts +4 -4
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/oneTimeCode.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/microsoft.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/slack.ts +1 -1
- package/data/Generator/templates/sdk/wasp/{auth → server/auth}/session.ts +17 -6
- package/data/Generator/templates/sdk/wasp/{auth → server/auth}/utils.ts +40 -183
- package/data/Generator/templates/sdk/wasp/server/config.ts +1 -1
- package/data/Generator/templates/sdk/wasp/{core → server/core}/auth.ts +3 -3
- package/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts +16 -63
- package/data/Generator/templates/sdk/wasp/server/dbClient.ts +15 -17
- package/data/Generator/templates/sdk/wasp/server/email/core/helpers.ts +3 -20
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/dummy.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/resend.ts +2 -1
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/smtp.ts +2 -1
- package/data/Generator/templates/sdk/wasp/server/email/core/types.ts +2 -45
- package/data/Generator/templates/sdk/wasp/server/email/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/env.ts +20 -11
- package/data/Generator/templates/sdk/wasp/server/index.ts +3 -3
- package/data/Generator/templates/sdk/wasp/server/jobs/_job.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +4 -4
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/types.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/middleware/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/operations/actions/index.ts +14 -8
- package/data/Generator/templates/sdk/wasp/server/operations/actions/types.ts +5 -5
- package/data/Generator/templates/sdk/wasp/server/operations/queries/index.ts +14 -8
- package/data/Generator/templates/sdk/wasp/server/operations/queries/types.ts +5 -5
- package/data/Generator/templates/sdk/wasp/server/operations/wrappers.ts +40 -14
- package/data/Generator/templates/sdk/wasp/server/types/index.ts +1 -11
- package/data/Generator/templates/sdk/wasp/server/utils.ts +5 -20
- package/data/Generator/templates/sdk/wasp/server/webSocket/index.ts +7 -7
- package/data/Generator/templates/sdk/wasp/tsconfig.json +20 -46
- package/data/Generator/templates/sdk/wasp/types/index.ts +8 -0
- package/data/Generator/templates/sdk/wasp/types/register.ts +21 -0
- package/data/Generator/templates/sdk/wasp/vite-env.d.ts +0 -9
- package/data/Generator/templates/sdk/wasp/wasp-ssr.d.ts +8 -0
- package/data/Generator/templates/sdk/wasp/wasp-user-virtual-modules.d.ts +20 -0
- package/data/Generator/templates/server/package.json +2 -1
- package/data/Generator/templates/server/rollup.config.js +2 -43
- package/data/Generator/templates/server/rollup.dbSeed.config.js +3 -0
- package/data/Generator/templates/server/src/app.js +2 -2
- package/data/Generator/templates/server/src/auth/providers/config/email.ts +5 -5
- package/data/Generator/templates/server/src/auth/providers/email/login.ts +4 -4
- package/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts +4 -4
- package/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts +13 -5
- package/data/Generator/templates/server/src/auth/providers/email/signup.ts +29 -18
- package/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts +7 -2
- package/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts +5 -1
- package/data/Generator/templates/server/src/auth/providers/oauth/handler.ts +1 -1
- package/data/Generator/templates/server/src/auth/providers/oauth/oneTimeCode.ts +2 -2
- package/data/Generator/templates/server/src/auth/providers/oauth/state.ts +55 -13
- package/data/Generator/templates/server/src/auth/providers/oauth/user.ts +6 -3
- package/data/Generator/templates/server/src/auth/providers/username/login.ts +4 -4
- package/data/Generator/templates/server/src/auth/providers/username/signup.ts +12 -4
- package/data/Generator/templates/server/src/createRollupBundle.js +47 -0
- package/data/Generator/templates/server/src/crud/_operations.ts +16 -16
- package/data/Generator/templates/server/src/plugins/virtualUserModules.js +40 -0
- package/data/Generator/templates/server/src/routes/apis/index.ts +3 -3
- package/data/Generator/templates/server/src/routes/auth/index.js +1 -1
- package/data/Generator/templates/server/src/routes/auth/logout.ts +2 -2
- package/data/Generator/templates/server/src/routes/crud/_crud.ts +1 -1
- package/data/Generator/templates/server/src/routes/index.js +18 -18
- package/data/Generator/templates/server/src/routes/operations/index.js +1 -1
- package/data/Generator/templates/server/src/webSocket/initialization.ts +1 -1
- package/data/Generator/templates/server/tsconfig.json +7 -13
- package/data/Generator/templates/types/app/sdk/register.ts +57 -0
- package/data/packages/deploy/dist/common/cliVersion.js +17 -0
- package/data/packages/deploy/dist/common/waspProject.js +1 -1
- package/data/packages/deploy/dist/common/zx.js +24 -6
- package/data/packages/deploy/dist/providers/fly/commands/createDb/createDb.js +13 -5
- package/data/packages/deploy/dist/providers/fly/flyCli.js +29 -17
- package/data/packages/deploy/dist/providers/fly/index.js +16 -8
- package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +19 -31
- package/data/packages/deploy/dist/providers/railway/index.js +11 -2
- package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +19 -34
- package/data/packages/deploy/dist/providers/railway/railwayCli.js +11 -20
- package/data/packages/deploy/dist/providers/railway/railwayEnvironment/cli.js +20 -0
- package/data/packages/deploy/dist/providers/railway/railwayProject/RailwayProject.js +4 -1
- package/data/packages/deploy/dist/providers/railway/railwayProject/cli.js +6 -14
- package/data/packages/deploy/dist/providers/railway/railwayService/database.js +88 -0
- package/data/packages/deploy/dist/providers/railway/railwayService/deployment.js +12 -25
- package/data/packages/deploy/dist/providers/railway/railwayService/nameGenerator.js +5 -4
- package/data/packages/deploy/dist/providers/railway/railwayService/serviceInstance.js +48 -0
- package/data/packages/deploy/dist/providers/railway/railwayService/url.js +9 -30
- package/data/packages/deploy/package-lock.json +2 -2
- package/data/packages/deploy/package.json +1 -1
- package/data/packages/prisma/package-lock.json +2 -2
- package/data/packages/prisma/package.json +1 -1
- package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.js +19 -15
- package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.js +6 -0
- package/data/packages/spec/dist/src/appSpec.d.ts +15 -2
- package/data/packages/spec/dist/src/appSpec.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec/mapper/app.d.ts +1 -0
- package/data/packages/spec/dist/src/spec/mapper/app.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec/mapper/app.js +8 -2
- package/data/packages/spec/dist/src/spec/mapper/context.js +4 -4
- package/data/packages/spec/dist/src/spec/mapper/specElements.js +9 -9
- package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts +11 -11
- package/data/packages/spec/dist/src/spec/publicApi/constructors.js +11 -11
- package/data/packages/spec/dist/src/spec/publicApi/register.d.ts +1 -1
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts +58 -38
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts.map +1 -1
- package/data/packages/spec/package-lock.json +2 -2
- package/data/packages/spec/package.json +1 -1
- package/data/packages/studio/package-lock.json +15 -23
- package/data/packages/studio/package.json +2 -2
- package/package.json +1 -1
- package/wasp-bin +0 -0
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.25.0.tgz +0 -0
- package/data/Generator/templates/sdk/wasp/api/events.ts +0 -11
- package/data/Generator/templates/sdk/wasp/auth/email/index.ts +0 -5
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.module.css +0 -99
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Form.tsx +0 -74
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.module.css +0 -22
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/Message.tsx +0 -34
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/auth-styles.css +0 -30
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.module.css +0 -33
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialButton.tsx +0 -14
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.module.css +0 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx +0 -85
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/util.ts +0 -16
- package/data/Generator/templates/sdk/wasp/auth/helpers/user.ts +0 -15
- package/data/Generator/templates/sdk/wasp/auth/responseSchemas.ts +0 -10
- package/data/Generator/templates/sdk/wasp/auth/types.ts +0 -2
- package/data/Generator/templates/sdk/wasp/auth/username/index.ts +0 -2
- package/data/Generator/templates/sdk/wasp/client/app/components/DefaultRootErrorBoundary.tsx +0 -16
- package/data/Generator/templates/sdk/wasp/client/app/components/FullPageWrapper.tsx +0 -21
- package/data/Generator/templates/sdk/wasp/client/app/components/Loader.module.css +0 -37
- package/data/Generator/templates/sdk/wasp/client/app/components/Loader.tsx +0 -12
- package/data/Generator/templates/sdk/wasp/client/app/components/Message.tsx +0 -86
- package/data/Generator/templates/sdk/wasp/client/crud/operationsHelpers.ts +0 -21
- package/data/Generator/templates/sdk/wasp/client/hooks.ts +0 -19
- package/data/Generator/templates/sdk/wasp/client/operations/hooks.ts +0 -347
- package/data/Generator/templates/sdk/wasp/client/operations/internal/resources.js +0 -85
- package/data/Generator/templates/sdk/wasp/client/operations/internal/updateHandlersMap.js +0 -37
- package/data/Generator/templates/sdk/wasp/client/operations/queryClient.ts +0 -34
- package/data/Generator/templates/sdk/wasp/client/operations/rpc.ts +0 -96
- package/data/Generator/templates/sdk/wasp/client/router/linkHelpers.ts +0 -48
- package/data/Generator/templates/sdk/wasp/client/router/types.ts +0 -98
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/detectServerImports.ts +0 -50
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/envFile.ts +0 -112
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +0 -36
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/validateEnv.ts +0 -88
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/resolver.ts +0 -35
- package/data/Generator/templates/sdk/wasp/core/serialization/custom-register.ts +0 -21
- package/data/Generator/templates/sdk/wasp/core/storage.ts +0 -73
- package/data/Generator/templates/sdk/wasp/env/validation.ts +0 -44
- package/data/Generator/templates/sdk/wasp/server/HttpError.ts +0 -30
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts +0 -20
- package/data/Generator/templates/sdk/wasp/server/auth/user.ts +0 -154
- package/data/Generator/templates/sdk/wasp/server/auth/username.ts +0 -1
- package/data/Generator/templates/sdk/wasp/server/jobs/core/job.ts +0 -28
- package/data/Generator/templates/sdk/wasp/server/middleware/globalMiddleware.ts +0 -8
- package/data/Generator/templates/sdk/wasp/universal/ansiColors.ts +0 -58
- package/data/Generator/templates/sdk/wasp/universal/predicates.ts +0 -3
- package/data/Generator/templates/sdk/wasp/universal/types.ts +0 -74
- package/data/Generator/templates/sdk/wasp/universal/url.ts +0 -9
- package/data/Generator/templates/sdk/wasp/universal/validators.ts +0 -21
- package/data/packages/ts-inspect/dist/exports.js +0 -82
- package/data/packages/ts-inspect/dist/index.js +0 -28
- package/data/packages/ts-inspect/package-lock.json +0 -4724
- package/data/packages/ts-inspect/package.json +0 -31
- /package/data/Generator/templates/sdk/wasp/{auth → server/auth}/password.ts +0 -0
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
import {
|
|
3
|
-
type {= userEntityName =},
|
|
4
|
-
type {= authEntityName =},
|
|
5
|
-
type {= authIdentityEntityName =},
|
|
6
|
-
} from '../../entities/index.js'
|
|
7
|
-
import {
|
|
8
|
-
type PossibleProviderData,
|
|
9
|
-
getProviderData,
|
|
10
|
-
} from '../../auth/utils.js'
|
|
11
|
-
import { type ProviderName } from '../_types/index.js'
|
|
12
|
-
import { Expand } from '../../universal/types.js'
|
|
13
|
-
|
|
14
|
-
// PUBLIC API
|
|
15
|
-
export type AuthUser = AuthUserData & {
|
|
16
|
-
getFirstProviderUserId: () => string | null,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// PRIVATE API
|
|
20
|
-
/*
|
|
21
|
-
* Ideally, we'd do something like this:
|
|
22
|
-
* ```
|
|
23
|
-
* export type AuthUserData = ReturnType<typeof createAuthUserData>
|
|
24
|
-
* ```
|
|
25
|
-
* to get the benefits of the createAuthUser and the AuthUserData type being in sync.
|
|
26
|
-
*
|
|
27
|
-
* But since we are not using strict mode, the inferred return type of createAuthUser
|
|
28
|
-
* is not correct. So we have to define the AuthUserData type manually.
|
|
29
|
-
*
|
|
30
|
-
* TODO: Change this once/if we switch to strict mode. https://github.com/wasp-lang/wasp/issues/1938
|
|
31
|
-
*/
|
|
32
|
-
export type AuthUserData = Omit<CompleteUserEntityWithAuth, '{= authFieldOnUserEntityName =}'> & {
|
|
33
|
-
identities: {
|
|
34
|
-
{=# enabledProviders.isEmailAuthEnabled =}
|
|
35
|
-
email: Expand<UserFacingProviderData<'email'>> | null
|
|
36
|
-
{=/ enabledProviders.isEmailAuthEnabled =}
|
|
37
|
-
{=# enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
|
38
|
-
username: Expand<UserFacingProviderData<'username'>> | null
|
|
39
|
-
{=/ enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
|
40
|
-
{=# enabledProviders.isSlackAuthEnabled =}
|
|
41
|
-
slack: Expand<UserFacingProviderData<'slack'>> | null
|
|
42
|
-
{=/ enabledProviders.isSlackAuthEnabled =}
|
|
43
|
-
{=# enabledProviders.isDiscordAuthEnabled =}
|
|
44
|
-
discord: Expand<UserFacingProviderData<'discord'>> | null
|
|
45
|
-
{=/ enabledProviders.isDiscordAuthEnabled =}
|
|
46
|
-
{=# enabledProviders.isGoogleAuthEnabled =}
|
|
47
|
-
google: Expand<UserFacingProviderData<'google'>> | null
|
|
48
|
-
{=/ enabledProviders.isGoogleAuthEnabled =}
|
|
49
|
-
{=# enabledProviders.isKeycloakAuthEnabled =}
|
|
50
|
-
keycloak: Expand<UserFacingProviderData<'keycloak'>> | null
|
|
51
|
-
{=/ enabledProviders.isKeycloakAuthEnabled =}
|
|
52
|
-
{=# enabledProviders.isGitHubAuthEnabled =}
|
|
53
|
-
github: Expand<UserFacingProviderData<'github'>> | null
|
|
54
|
-
{=/ enabledProviders.isGitHubAuthEnabled =}
|
|
55
|
-
{=# enabledProviders.isMicrosoftAuthEnabled =}
|
|
56
|
-
microsoft: Expand<UserFacingProviderData<'microsoft'>> | null
|
|
57
|
-
{=/ enabledProviders.isMicrosoftAuthEnabled =}
|
|
58
|
-
},
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
type UserFacingProviderData<PN extends ProviderName> = {
|
|
62
|
-
id: string
|
|
63
|
-
} & Omit<PossibleProviderData[PN], 'hashedPassword'>
|
|
64
|
-
|
|
65
|
-
// PRIVATE API
|
|
66
|
-
export type CompleteUserEntityWithAuth =
|
|
67
|
-
MakeUserEntityWithAuth<CompleteAuthEntityWithIdentities>
|
|
68
|
-
|
|
69
|
-
// PRIVATE API
|
|
70
|
-
export type CompleteAuthEntityWithIdentities =
|
|
71
|
-
MakeAuthEntityWithIdentities<{= authIdentityEntityName =}>
|
|
72
|
-
|
|
73
|
-
// PRIVATE API
|
|
74
|
-
/**
|
|
75
|
-
* User entity with all of the auth related data that's needed for the user facing
|
|
76
|
-
* helper functions like `getUsername` and `getEmail`.
|
|
77
|
-
*/
|
|
78
|
-
export type UserEntityWithAuth = MakeUserEntityWithAuth<
|
|
79
|
-
MakeAuthEntityWithIdentities<
|
|
80
|
-
// It's constructed like the Complete* types, but only with the fields needed
|
|
81
|
-
// for the user facing functions.
|
|
82
|
-
Pick<{= authIdentityEntityName =}, 'providerName' | 'providerUserId'>
|
|
83
|
-
>
|
|
84
|
-
>
|
|
85
|
-
|
|
86
|
-
type MakeUserEntityWithAuth<AuthType> = {= userEntityName =} & {
|
|
87
|
-
{= authFieldOnUserEntityName =}: AuthType | null
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
type MakeAuthEntityWithIdentities<IdentityType> = {= authEntityName =} & {
|
|
91
|
-
{= identitiesFieldOnAuthEntityName =}: IdentityType[]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// PRIVATE API
|
|
95
|
-
export function createAuthUserData(user: CompleteUserEntityWithAuth): AuthUserData {
|
|
96
|
-
const { {= authFieldOnUserEntityName =}, ...rest } = user
|
|
97
|
-
if (!{= authFieldOnUserEntityName =}) {
|
|
98
|
-
throw new Error(`🐝 Error: trying to create a user without auth data.
|
|
99
|
-
This should never happen, but it did which means there is a bug in the code.`)
|
|
100
|
-
}
|
|
101
|
-
const identities = {
|
|
102
|
-
{=# enabledProviders.isEmailAuthEnabled =}
|
|
103
|
-
email: getProviderInfo<'email'>({= authFieldOnUserEntityName =}, 'email'),
|
|
104
|
-
{=/ enabledProviders.isEmailAuthEnabled =}
|
|
105
|
-
{=# enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
|
106
|
-
username: getProviderInfo<'username'>({= authFieldOnUserEntityName =}, 'username'),
|
|
107
|
-
{=/ enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
|
108
|
-
{=# enabledProviders.isSlackAuthEnabled =}
|
|
109
|
-
slack: getProviderInfo<'slack'>({= authFieldOnUserEntityName =}, 'slack'),
|
|
110
|
-
{=/ enabledProviders.isSlackAuthEnabled =}
|
|
111
|
-
{=# enabledProviders.isDiscordAuthEnabled =}
|
|
112
|
-
discord: getProviderInfo<'discord'>({= authFieldOnUserEntityName =}, 'discord'),
|
|
113
|
-
{=/ enabledProviders.isDiscordAuthEnabled =}
|
|
114
|
-
{=# enabledProviders.isGoogleAuthEnabled =}
|
|
115
|
-
google: getProviderInfo<'google'>({= authFieldOnUserEntityName =}, 'google'),
|
|
116
|
-
{=/ enabledProviders.isGoogleAuthEnabled =}
|
|
117
|
-
{=# enabledProviders.isKeycloakAuthEnabled =}
|
|
118
|
-
keycloak: getProviderInfo<'keycloak'>({= authFieldOnUserEntityName =}, 'keycloak'),
|
|
119
|
-
{=/ enabledProviders.isKeycloakAuthEnabled =}
|
|
120
|
-
{=# enabledProviders.isGitHubAuthEnabled =}
|
|
121
|
-
github: getProviderInfo<'github'>({= authFieldOnUserEntityName =}, 'github'),
|
|
122
|
-
{=/ enabledProviders.isGitHubAuthEnabled =}
|
|
123
|
-
{=# enabledProviders.isMicrosoftAuthEnabled =}
|
|
124
|
-
microsoft: getProviderInfo<'microsoft'>({= authFieldOnUserEntityName =}, 'microsoft'),
|
|
125
|
-
{=/ enabledProviders.isMicrosoftAuthEnabled =}
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
...rest,
|
|
129
|
-
identities,
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function getProviderInfo<PN extends ProviderName>(
|
|
134
|
-
auth: CompleteAuthEntityWithIdentities,
|
|
135
|
-
providerName: PN
|
|
136
|
-
):
|
|
137
|
-
| UserFacingProviderData<PN>
|
|
138
|
-
| null {
|
|
139
|
-
const identity = getIdentity(auth, providerName)
|
|
140
|
-
if (!identity) {
|
|
141
|
-
return null
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
...getProviderData<PN>(identity.providerData),
|
|
145
|
-
id: identity.providerUserId,
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function getIdentity(
|
|
150
|
-
auth: CompleteAuthEntityWithIdentities,
|
|
151
|
-
providerName: ProviderName
|
|
152
|
-
): {= authIdentityEntityName =} | null {
|
|
153
|
-
return auth.{= identitiesFieldOnAuthEntityName =}.find((i) => i.providerName === providerName) ?? null
|
|
154
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ensureValidUsername } from '../../auth/validation.js'
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a definition of a job (think draft or invocable computation), not the running instance itself.
|
|
3
|
-
* This can be submitted one or more times to be executed by some job executor via the same instance.
|
|
4
|
-
* Once submitted, you get a SubmittedJob to track it later.
|
|
5
|
-
*/
|
|
6
|
-
export class Job {
|
|
7
|
-
public readonly jobName: string
|
|
8
|
-
public readonly executorName: string | symbol
|
|
9
|
-
|
|
10
|
-
constructor(jobName: string, executorName: string | symbol) {
|
|
11
|
-
this.jobName = jobName
|
|
12
|
-
this.executorName = executorName
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This is the result of submitting a Job to some executor.
|
|
18
|
-
* It can be used by callers to track things, or call executor-specific subclass functionality.
|
|
19
|
-
*/
|
|
20
|
-
export class SubmittedJob {
|
|
21
|
-
public readonly job: Job
|
|
22
|
-
public readonly jobId: string
|
|
23
|
-
|
|
24
|
-
constructor(job: Job, jobId: string) {
|
|
25
|
-
this.job = job
|
|
26
|
-
this.jobId = jobId
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// PRIVATE API (SDK, client)
|
|
2
|
-
/**
|
|
3
|
-
* Wraps each line of text with ANSI color codes.
|
|
4
|
-
* Only works in Node.js (server-side), not in the browser.
|
|
5
|
-
*
|
|
6
|
-
* Each line is individually wrapped because Wasp reads child process
|
|
7
|
-
* output line-by-line and re-prints it with a prefix (e.g. `[ Server ]`).
|
|
8
|
-
* A single color code spanning multiple lines would only color the first line.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* console.log(colorize('red', 'This is red text'));
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @internal This is a private API for: SDK, client.
|
|
16
|
-
*/
|
|
17
|
-
export function colorize(
|
|
18
|
-
color: keyof typeof ansiColorCodes,
|
|
19
|
-
text: string,
|
|
20
|
-
): string {
|
|
21
|
-
if (!supportsAnsiFormatting()) {
|
|
22
|
-
return text;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const ansiColorCode = ansiColorCodes[color];
|
|
26
|
-
return text
|
|
27
|
-
.split("\n")
|
|
28
|
-
.map((line) => `${ansiColorCode}${line}${ansiResetCode}`)
|
|
29
|
-
.join("\n");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function supportsAnsiFormatting(): boolean {
|
|
33
|
-
const isBrowser = !!globalThis.window;
|
|
34
|
-
const isNode = !!globalThis.process;
|
|
35
|
-
|
|
36
|
-
if (isBrowser && "chrome" in window) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
if (isNode) {
|
|
40
|
-
if ("NO_COLOR" in process.env) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
// Wasp runs the server as a child process with piped stdout/stderr,
|
|
44
|
-
// so streams are not TTYs and hasColors() won't exist on them.
|
|
45
|
-
// We default to true for non-browser runtimes because Wasp's CLI
|
|
46
|
-
// handles the final terminal output and supports ANSI codes.
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const ansiColorCodes = {
|
|
54
|
-
red: "\x1b[31m",
|
|
55
|
-
yellow: "\x1b[33m",
|
|
56
|
-
} as const;
|
|
57
|
-
|
|
58
|
-
const ansiResetCode = "\x1b[0m";
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// This is a helper type used exclusively for DX purposes. It's a No-op for the
|
|
2
|
-
// compiler, but expands the type's representatoin in IDEs (i.e., inlines all
|
|
3
|
-
// type constructors) to make it more readable for the user.
|
|
4
|
-
//
|
|
5
|
-
// It expands this SO answer to functions: https://stackoverflow.com/a/57683652
|
|
6
|
-
export type Expand<T> = T extends (...args: infer A) => infer R
|
|
7
|
-
? (...args: A) => R
|
|
8
|
-
: T extends infer O
|
|
9
|
-
? { [K in keyof O]: O[K] }
|
|
10
|
-
: never
|
|
11
|
-
|
|
12
|
-
// TypeScript's native Awaited type exhibits strange behavior in VS Code (see
|
|
13
|
-
// https://github.com/wasp-lang/wasp/pull/1090#discussion_r1159687537 for
|
|
14
|
-
// details). Until it's fixed, we're using our own type for this.
|
|
15
|
-
//
|
|
16
|
-
// TODO: investigate further. This most likely has something to do with an
|
|
17
|
-
// unsatisfied 'extends' constraints. A mismatch is probably happening with
|
|
18
|
-
// function parameter types and/or return types (check '_ReturnType' below for
|
|
19
|
-
// more).
|
|
20
|
-
export type _Awaited<T> = T extends Promise<infer V>
|
|
21
|
-
? _Awaited<V>
|
|
22
|
-
: T
|
|
23
|
-
|
|
24
|
-
// TypeScript's native ReturnType does not work for functions of type '(...args:
|
|
25
|
-
// never[]) => unknown' (and that's what operations currently use).
|
|
26
|
-
//
|
|
27
|
-
// TODO: investigate how to properly specify the 'extends' constraint for function
|
|
28
|
-
// type (i.e., any vs never and unknown) and stick with that. Take DX into
|
|
29
|
-
// consideration.
|
|
30
|
-
export type _ReturnType<T extends (...args: never[]) => unknown> =
|
|
31
|
-
T extends (...args: never[]) => infer R ? R : never
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Returns elements of an array except the first one.
|
|
35
|
-
export type Tail<T extends [unknown, ...unknown[]]> = T extends [unknown, ...infer R] ? R : never;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Source: https://stackoverflow.com/a/55541672
|
|
39
|
-
export type IfAny<Value, Then, Else> = 0 extends (1 & Value) ? Then : Else;
|
|
40
|
-
|
|
41
|
-
// If users use JS to define their operations and destructure object arguments,
|
|
42
|
-
// Wasp's TS helper types can't infer correct types due to this TS bug:
|
|
43
|
-
// https://github.com/microsoft/TypeScript/issues/52768
|
|
44
|
-
// The bug breaks the built-in `Parameters` helper, so we introduce a custom version
|
|
45
|
-
// that works with Wasp's TS helper types like `EntityMapFor`.
|
|
46
|
-
export type _Parameters<T extends (...args: any) => any> = T extends (
|
|
47
|
-
firstParam: infer FirstParam,
|
|
48
|
-
...rest: infer Rest
|
|
49
|
-
) => any
|
|
50
|
-
? [FirstParam, ...Rest]
|
|
51
|
-
: Parameters<T>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* Exact ensures a type has exactly the properties of another type.
|
|
56
|
-
* Helps with simulating excess property checking for generics in function definitions.
|
|
57
|
-
*
|
|
58
|
-
* Inspired by: https://stackoverflow.com/questions/49580725/is-it-possible-to-restrict-typescript-object-to-contain-only-properties-define
|
|
59
|
-
*
|
|
60
|
-
* @template T - The base type that defines the allowed properties
|
|
61
|
-
* @template U - The type to be constrained (must extend T)
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* // User can no longer add properties outside of UserSignupFields to T
|
|
65
|
-
* function defineUserSignupFields<T extends UserSignupFields>(
|
|
66
|
-
* fields: Exact<UserSignupFields, T>
|
|
67
|
-
* ): T {
|
|
68
|
-
* return fields
|
|
69
|
-
* }
|
|
70
|
-
*/
|
|
71
|
-
export type Exact<T, U extends T = T> = U & {
|
|
72
|
-
[P in Exclude<keyof U, keyof T>]: never;
|
|
73
|
-
}
|
|
74
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function stripTrailingSlash(url: string): string
|
|
2
|
-
export function stripTrailingSlash(url: undefined): undefined
|
|
3
|
-
export function stripTrailingSlash(url?: string): string | undefined {
|
|
4
|
-
return url?.replace(/\/$/, "");
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function getOrigin(url: string) {
|
|
8
|
-
return new URL(url).origin;
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function isValidAbsoluteURL(rawUrl: string): boolean {
|
|
2
|
-
try {
|
|
3
|
-
const url = new URL(rawUrl);
|
|
4
|
-
/*
|
|
5
|
-
URL constructor will parse some invalid absolute URLs as valid URLs
|
|
6
|
-
so we need to do some extra checks.
|
|
7
|
-
|
|
8
|
-
Example: "localhost:3000" will be parsed as URL with protocol of
|
|
9
|
-
"localhost:" and host of "3000"
|
|
10
|
-
*/
|
|
11
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
|
12
|
-
} catch (e) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function throwIfNotValidAbsoluteURL(value: string | undefined, name: string): void {
|
|
18
|
-
if (value && !isValidAbsoluteURL(value)) {
|
|
19
|
-
throw new Error(`${name} must be a valid absolute URL`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs/promises";
|
|
2
|
-
import JSON5 from "json5";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
export const ExportsRequest = z.object({
|
|
7
|
-
tsconfig: z.string().optional(),
|
|
8
|
-
filepaths: z.array(z.string()),
|
|
9
|
-
});
|
|
10
|
-
export const ExportsRequests = z.array(ExportsRequest);
|
|
11
|
-
export async function getExportsOfFiles(request) {
|
|
12
|
-
let compilerOptions = {};
|
|
13
|
-
// If a tsconfig is given, load the configuration.
|
|
14
|
-
if (request.tsconfig) {
|
|
15
|
-
compilerOptions = await loadCompilerOptionsFromTsConfig(request.tsconfig);
|
|
16
|
-
}
|
|
17
|
-
const exportsMap = {};
|
|
18
|
-
// Initialize the TS compiler.
|
|
19
|
-
const program = ts.createProgram(request.filepaths, compilerOptions);
|
|
20
|
-
const checker = program.getTypeChecker();
|
|
21
|
-
// Loop through each given file and try to get its exports.
|
|
22
|
-
for (let filename of request.filepaths) {
|
|
23
|
-
try {
|
|
24
|
-
exportsMap[filename] = getExportsOfFile(program, checker, filename);
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
console.error(err);
|
|
28
|
-
exportsMap[filename] = [];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return exportsMap;
|
|
32
|
-
}
|
|
33
|
-
async function loadCompilerOptionsFromTsConfig(tsconfig) {
|
|
34
|
-
const configJson = JSON5.parse(await fs.readFile(tsconfig, "utf8"));
|
|
35
|
-
const basePath = path.dirname(tsconfig);
|
|
36
|
-
const { options, errors } = ts.convertCompilerOptionsFromJson(configJson.compilerOptions, basePath, tsconfig);
|
|
37
|
-
if (errors && errors.length) {
|
|
38
|
-
throw errors;
|
|
39
|
-
}
|
|
40
|
-
return options;
|
|
41
|
-
}
|
|
42
|
-
function getExportsOfFile(program, checker, filename) {
|
|
43
|
-
const source = program.getSourceFile(filename);
|
|
44
|
-
if (!source) {
|
|
45
|
-
throw new Error(`Error getting source for ${filename}`);
|
|
46
|
-
}
|
|
47
|
-
const moduleSymbol = checker.getSymbolAtLocation(source);
|
|
48
|
-
if (!moduleSymbol) {
|
|
49
|
-
// This is caused by errors within the TS file, so we say there are no exports.
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
const exportSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
53
|
-
return exportSymbols.map((exp) => getExportForExportSymbol(program, checker, exp));
|
|
54
|
-
}
|
|
55
|
-
function getExportForExportSymbol(program, checker, exportSymbol) {
|
|
56
|
-
let range = undefined;
|
|
57
|
-
// Try to get the location information from the first value declaration for
|
|
58
|
-
// the export. If there are no value declarations, we don't return any location
|
|
59
|
-
// info for this export and `range` remains undefined.
|
|
60
|
-
if (exportSymbol.valueDeclaration) {
|
|
61
|
-
// NOTE: This isn't a very robust way of getting the location: it will always
|
|
62
|
-
// point to the line that has `export`, rather than the line where the exported
|
|
63
|
-
// symbol is defined.
|
|
64
|
-
const startOffset = exportSymbol.valueDeclaration.getStart();
|
|
65
|
-
const startPos = ts.getLineAndCharacterOfPosition(exportSymbol.valueDeclaration.getSourceFile(), startOffset);
|
|
66
|
-
const endOffset = exportSymbol.valueDeclaration.getEnd();
|
|
67
|
-
const endPos = ts.getLineAndCharacterOfPosition(exportSymbol.valueDeclaration.getSourceFile(), endOffset);
|
|
68
|
-
range = {
|
|
69
|
-
start: { line: startPos.line, column: startPos.character },
|
|
70
|
-
end: { line: endPos.line, column: endPos.character },
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
// Convert export to the output format.
|
|
74
|
-
const exportName = exportSymbol.getName();
|
|
75
|
-
if (exportName === "default") {
|
|
76
|
-
return { type: "default", range };
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
return { type: "named", name: exportName, range };
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=exports.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ExportsRequests, getExportsOfFiles } from "./exports.js";
|
|
2
|
-
async function readAllFromStdin() {
|
|
3
|
-
return new Promise((resolve, reject) => {
|
|
4
|
-
let chunks = "";
|
|
5
|
-
process.stdin.on("data", (data) => {
|
|
6
|
-
chunks += data;
|
|
7
|
-
});
|
|
8
|
-
process.stdin.on("end", () => resolve(chunks));
|
|
9
|
-
process.stdin.on("close", () => resolve(chunks));
|
|
10
|
-
process.stdin.on("error", (err) => reject(err));
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
async function main() {
|
|
14
|
-
const inputStr = await readAllFromStdin();
|
|
15
|
-
const input = JSON.parse(inputStr);
|
|
16
|
-
const requests = ExportsRequests.parse(input);
|
|
17
|
-
let exports = {};
|
|
18
|
-
for (let request of requests) {
|
|
19
|
-
const newExports = await getExportsOfFiles(request);
|
|
20
|
-
exports = { ...exports, ...newExports };
|
|
21
|
-
}
|
|
22
|
-
console.log(JSON.stringify(exports));
|
|
23
|
-
}
|
|
24
|
-
main().catch((err) => {
|
|
25
|
-
console.error(err);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=index.js.map
|