@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
|
@@ -13,6 +13,18 @@ export const RailwayCliProjectSchema = z.object({
|
|
|
13
13
|
}),
|
|
14
14
|
});
|
|
15
15
|
export const RailwayProjectListSchema = z.array(RailwayCliProjectSchema);
|
|
16
|
+
export const RailwayCliEnvironmentListSchema = z.object({
|
|
17
|
+
environments: z.array(z.object({
|
|
18
|
+
id: z.string(),
|
|
19
|
+
name: z.string(),
|
|
20
|
+
isLinked: z.boolean(),
|
|
21
|
+
})),
|
|
22
|
+
});
|
|
23
|
+
export const RailwayCliServiceListSchema = z.array(RailwayCliServiceSchema.extend({
|
|
24
|
+
volumes: z.array(z.object({
|
|
25
|
+
mountPath: z.string(),
|
|
26
|
+
})),
|
|
27
|
+
}));
|
|
16
28
|
export const DeploymentStatusSchema = z.enum([
|
|
17
29
|
"BUILDING",
|
|
18
30
|
"CRASHED",
|
|
@@ -28,45 +40,18 @@ export const DeploymentStatusSchema = z.enum([
|
|
|
28
40
|
"SUCCESS",
|
|
29
41
|
"WAITING",
|
|
30
42
|
]);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
edges: z.array(z.object({
|
|
36
|
-
node: z.object({
|
|
37
|
-
serviceName: z.string(),
|
|
38
|
-
latestDeployment: z
|
|
39
|
-
.object({
|
|
40
|
-
status: DeploymentStatusSchema,
|
|
41
|
-
})
|
|
42
|
-
.nullish(),
|
|
43
|
-
}),
|
|
44
|
-
})),
|
|
45
|
-
}),
|
|
46
|
-
}),
|
|
47
|
-
})),
|
|
43
|
+
export const RailwayCliServiceStatusSchema = z.object({
|
|
44
|
+
// A missing status (service never deployed) or an unrecognized status
|
|
45
|
+
// defaults to `null`.
|
|
46
|
+
status: DeploymentStatusSchema.nullable().catch(null).default(null),
|
|
48
47
|
});
|
|
49
|
-
// Railway CLI >=4.35 nests service instances under `environments`.
|
|
50
|
-
const NewFormatProjectStatusSchema = z.object({
|
|
51
|
-
environments: GroupedServiceInstancesSchema,
|
|
52
|
-
});
|
|
53
|
-
// Older Railway CLI versions (e.g. 4.11) nest service instances under `services`.
|
|
54
|
-
const OldFormatProjectStatusSchema = z.object({
|
|
55
|
-
services: GroupedServiceInstancesSchema,
|
|
56
|
-
});
|
|
57
|
-
export const RailwayCliProjectStatusSchema = z.union([
|
|
58
|
-
NewFormatProjectStatusSchema,
|
|
59
|
-
OldFormatProjectStatusSchema.transform(({ services }) => ({
|
|
60
|
-
environments: services,
|
|
61
|
-
})),
|
|
62
|
-
]);
|
|
63
48
|
export const RailwayCliDomainSchema = z.union([
|
|
64
|
-
//
|
|
49
|
+
// `railway domain` prints all existing domains when the service already
|
|
50
|
+
// has one...
|
|
65
51
|
z.object({ domains: z.array(z.string()).min(1) }),
|
|
66
|
-
//
|
|
52
|
+
// ...and just the new domain when it creates it.
|
|
67
53
|
z
|
|
68
54
|
.object({ domain: z.string() })
|
|
69
|
-
// Convert to the newer format
|
|
70
55
|
.transform(({ domain }) => ({ domains: [domain] })),
|
|
71
56
|
]);
|
|
72
57
|
//# sourceMappingURL=jsonOutputSchemas.js.map
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SemVer } from "semver";
|
|
2
2
|
import { $ } from "zx";
|
|
3
3
|
import { confirm } from "@inquirer/prompts";
|
|
4
|
+
import { assertCliVersionMeetsMinimum, parseCliVersion, } from "../../common/cliVersion.js";
|
|
4
5
|
import { serviceNameSuffixes } from "./railwayService/nameGenerator.js";
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
// https://github.com/railwayapp/cli/pull/596
|
|
8
|
-
const minSupportedRailwayCliVersion = new SemVer("4.6.3");
|
|
6
|
+
// Wasp relies on the `railway api` command added in Railway CLI 5.28.0.
|
|
7
|
+
const minSupportedRailwayCliVersion = new SemVer("5.28.0");
|
|
9
8
|
export async function ensureRailwayCliReady(railwayExe) {
|
|
10
9
|
const railwayCliVersion = await getRailwayCliVersion(railwayExe);
|
|
11
|
-
|
|
10
|
+
assertCliVersionMeetsMinimum({
|
|
11
|
+
cliName: "Railway CLI",
|
|
12
|
+
currentVersion: railwayCliVersion,
|
|
13
|
+
minimumVersion: minSupportedRailwayCliVersion,
|
|
14
|
+
updateInstructions: "Read how to update the Railway CLI here: https://docs.railway.com/guides/cli",
|
|
15
|
+
});
|
|
12
16
|
await ensureUserLoggedIn(railwayExe);
|
|
13
17
|
}
|
|
14
18
|
async function ensureUserLoggedIn(railwayExe) {
|
|
@@ -50,20 +54,7 @@ async function getRailwayCliVersion(railwayExe) {
|
|
|
50
54
|
if (match === null) {
|
|
51
55
|
throw new Error(`Failed to get Railway CLI version from output "${result.stdout.trim()}".`);
|
|
52
56
|
}
|
|
53
|
-
|
|
54
|
-
if (version === null) {
|
|
55
|
-
throw new Error(`Unable to parse Railway CLI version "${match[1]}".`);
|
|
56
|
-
}
|
|
57
|
-
return version;
|
|
58
|
-
}
|
|
59
|
-
function assertUsingMinimumSupportedRailwayCliVersion(railwayCliVersion) {
|
|
60
|
-
if (!semver.gte(railwayCliVersion, minSupportedRailwayCliVersion)) {
|
|
61
|
-
const message = [
|
|
62
|
-
`Wasp expects at least Railway CLI version ${minSupportedRailwayCliVersion}.`,
|
|
63
|
-
"Read how to update the Railway CLI here: https://docs.railway.com/guides/cli",
|
|
64
|
-
].join("\n");
|
|
65
|
-
throw new Error(message);
|
|
66
|
-
}
|
|
57
|
+
return parseCliVersion("Railway CLI", match[1]);
|
|
67
58
|
}
|
|
68
59
|
export function assertRailwayProjectNameIsValid(projectName) {
|
|
69
60
|
const maximumProjectNameLength = getMaximumProjectNameLength();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createCommandWithCwd, runJsonCommand } from "../../../common/zx.js";
|
|
2
|
+
import { RailwayCliEnvironmentListSchema } from "../jsonOutputSchemas.js";
|
|
3
|
+
// `railway status --json` returns all of the project's environments without
|
|
4
|
+
// saying which one is linked, so we ask `railway environment list` instead.
|
|
5
|
+
export async function getLinkedEnvironmentId(options) {
|
|
6
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
7
|
+
const { environments } = await runJsonCommand(railwayCli, ["environment", "list", "--json"], RailwayCliEnvironmentListSchema);
|
|
8
|
+
const linkedEnvironment = environments.find((environment) => environment.isLinked);
|
|
9
|
+
// We don't expect this to happen in a normally provisioned Railway project:
|
|
10
|
+
// `railway init` creates a default "production" environment and links it,
|
|
11
|
+
// and `railway link` always selects an environment as well.
|
|
12
|
+
if (linkedEnvironment === undefined) {
|
|
13
|
+
const environmentNames = environments
|
|
14
|
+
.map((environment) => environment.name)
|
|
15
|
+
.join(", ");
|
|
16
|
+
throw new Error(`No Railway environment is linked to this directory. Run \`railway environment\` to link one of: ${environmentNames}.`);
|
|
17
|
+
}
|
|
18
|
+
return linkedEnvironment.id;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -6,8 +6,11 @@ export function createRailwayProject(cliProject) {
|
|
|
6
6
|
id: edge.node.id,
|
|
7
7
|
name: edge.node.name,
|
|
8
8
|
})),
|
|
9
|
+
findService(serviceName) {
|
|
10
|
+
return this.services.find((service) => service.name === serviceName);
|
|
11
|
+
},
|
|
9
12
|
doesServiceExist(serviceName) {
|
|
10
|
-
return this.
|
|
13
|
+
return this.findService(serviceName) !== undefined;
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { $ } from "zx";
|
|
2
1
|
import { waspSays } from "../../../common/terminal.js";
|
|
3
|
-
import { createCommandWithCwd } from "../../../common/zx.js";
|
|
2
|
+
import { createCommand, createCommandWithCwd, runJsonCommand, tryRunJsonCommand, } from "../../../common/zx.js";
|
|
4
3
|
import { RailwayCliProjectSchema, RailwayProjectListSchema, } from "../jsonOutputSchemas.js";
|
|
5
4
|
import { createRailwayProject } from "./RailwayProject.js";
|
|
6
5
|
/**
|
|
@@ -47,16 +46,11 @@ export async function linkRailwayProjectToWaspProjectDir(project, { railwayExe,
|
|
|
47
46
|
}
|
|
48
47
|
export async function getRailwayProjectForDirectory(railwayExe, directoryPath) {
|
|
49
48
|
const railwayCli = createCommandWithCwd(railwayExe, directoryPath);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
nothrow: true,
|
|
53
|
-
});
|
|
54
|
-
if (result.exitCode === 0) {
|
|
55
|
-
return createRailwayProject(RailwayCliProjectSchema.parse(result.json()));
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
49
|
+
const project = await tryRunJsonCommand(railwayCli, ["status", "--json"], RailwayCliProjectSchema);
|
|
50
|
+
if (project === null) {
|
|
58
51
|
return null;
|
|
59
52
|
}
|
|
53
|
+
return createRailwayProject(project);
|
|
60
54
|
}
|
|
61
55
|
export async function getRailwayProjectById(railwayExe, id) {
|
|
62
56
|
const projects = await getRailwayProjects(railwayExe);
|
|
@@ -69,10 +63,8 @@ export async function getRailwayProjectByName(railwayExe, name) {
|
|
|
69
63
|
// TODO: Figure out how to specify the workspace when listing projects.
|
|
70
64
|
// This command lists all projects in all the workspaces the user has access to.
|
|
71
65
|
async function getRailwayProjects(railwayExe) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
}) `${railwayExe} list --json`;
|
|
75
|
-
const projects = RailwayProjectListSchema.parse(JSON.parse(result.stdout));
|
|
66
|
+
const railwayCli = createCommand(railwayExe);
|
|
67
|
+
const projects = await runJsonCommand(railwayCli, ["list", "--json"], RailwayProjectListSchema);
|
|
76
68
|
return projects.map((cliProject) => {
|
|
77
69
|
return createRailwayProject(cliProject);
|
|
78
70
|
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { waspSays } from "../../../common/terminal.js";
|
|
2
|
+
import { createCommandWithCwd, runJsonCommand } from "../../../common/zx.js";
|
|
3
|
+
import { getRailwayEnvVarValueReference } from "../env.js";
|
|
4
|
+
import { RailwayCliServiceListSchema, RailwayCliServiceSchema, } from "../jsonOutputSchemas.js";
|
|
5
|
+
import { setServiceInstanceImage, startServiceInstanceDeployment, } from "./serviceInstance.js";
|
|
6
|
+
// Creating a service with an image immediately starts a deployment, and
|
|
7
|
+
// Postgres crashes when its volume isn't attached yet.
|
|
8
|
+
export async function createDatabaseService({ serviceName, imageSpec, environmentId, railwayExe, waspProjectDir, }) {
|
|
9
|
+
const options = { railwayExe, waspProjectDir };
|
|
10
|
+
const dbService = await addDatabaseServiceWithoutImage(serviceName, imageSpec.volumeMountPath, options);
|
|
11
|
+
const dbServiceInstance = {
|
|
12
|
+
serviceId: dbService.id,
|
|
13
|
+
environmentId,
|
|
14
|
+
};
|
|
15
|
+
try {
|
|
16
|
+
await addDatabaseVolume(dbService, imageSpec.volumeMountPath, options);
|
|
17
|
+
await setServiceInstanceImage(dbServiceInstance, imageSpec.image, options);
|
|
18
|
+
await startServiceInstanceDeployment(dbServiceInstance, options);
|
|
19
|
+
}
|
|
20
|
+
catch (setupError) {
|
|
21
|
+
await deleteIncompleteDatabaseService(dbService, setupError, options);
|
|
22
|
+
throw setupError;
|
|
23
|
+
}
|
|
24
|
+
return dbService;
|
|
25
|
+
}
|
|
26
|
+
export async function assertDatabaseServiceHasVolume(dbService, dbVolumeMountPath, options) {
|
|
27
|
+
if (!(await hasDatabaseVolume(dbService, dbVolumeMountPath, options))) {
|
|
28
|
+
throw new Error([
|
|
29
|
+
`Railway database service "${dbService.name}" (${dbService.id}) has no volume mounted at ${dbVolumeMountPath}.`,
|
|
30
|
+
"Mounting a volume there now would hide the database's existing data, so Wasp won't do it automatically.",
|
|
31
|
+
"Back up any existing data before changing the service in Railway. Then add the required volume and restore the backup, or remove the service before trying again.",
|
|
32
|
+
].join("\n"));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function addDatabaseServiceWithoutImage(dbServiceName, dbVolumeMountPath, options) {
|
|
36
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
37
|
+
// Image-backed services don't get the variables from Railway's Postgres
|
|
38
|
+
// template, so we configure them explicitly.
|
|
39
|
+
const dbVariables = {
|
|
40
|
+
POSTGRES_DB: "railway",
|
|
41
|
+
POSTGRES_USER: "postgres",
|
|
42
|
+
POSTGRES_PASSWORD: getRailwayEnvVarValueReference("secret()"),
|
|
43
|
+
PORT: "5432",
|
|
44
|
+
// PGDATA must be a subdirectory of the volume mount.
|
|
45
|
+
PGDATA: `${dbVolumeMountPath}/pgdata`,
|
|
46
|
+
DATABASE_URL: `postgresql://${getRailwayEnvVarValueReference("POSTGRES_USER")}:${getRailwayEnvVarValueReference("POSTGRES_PASSWORD")}@${getRailwayEnvVarValueReference("RAILWAY_PRIVATE_DOMAIN")}:${getRailwayEnvVarValueReference("PORT")}/${getRailwayEnvVarValueReference("POSTGRES_DB")}`,
|
|
47
|
+
};
|
|
48
|
+
const variableArgs = Object.entries(dbVariables).flatMap(([name, value]) => [
|
|
49
|
+
"--variables",
|
|
50
|
+
`${name}=${value}`,
|
|
51
|
+
]);
|
|
52
|
+
return runJsonCommand(railwayCli, ["add", ...["--service", dbServiceName], ...variableArgs, "--json"], RailwayCliServiceSchema);
|
|
53
|
+
}
|
|
54
|
+
async function addDatabaseVolume(dbService, dbVolumeMountPath, options) {
|
|
55
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
56
|
+
await railwayCli([
|
|
57
|
+
"volume",
|
|
58
|
+
...["--service", dbService.id],
|
|
59
|
+
"add",
|
|
60
|
+
...["--mount-path", dbVolumeMountPath],
|
|
61
|
+
"--json",
|
|
62
|
+
], { verbose: false });
|
|
63
|
+
}
|
|
64
|
+
async function deleteIncompleteDatabaseService(dbService, setupError, options) {
|
|
65
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
66
|
+
try {
|
|
67
|
+
await railwayCli(["service", "delete", ...["--service", dbService.id], "--yes", "--json"], { verbose: false });
|
|
68
|
+
}
|
|
69
|
+
catch (cleanupError) {
|
|
70
|
+
throw new Error([
|
|
71
|
+
`Wasp couldn't finish setting up Railway database service "${dbService.name}" (${dbService.id}).`,
|
|
72
|
+
"Wasp also couldn't remove the incomplete service. Remove it from Railway before trying again.",
|
|
73
|
+
`Setup error: ${getErrorMessage(setupError)}`,
|
|
74
|
+
`Cleanup error: ${getErrorMessage(cleanupError)}`,
|
|
75
|
+
].join("\n"));
|
|
76
|
+
}
|
|
77
|
+
waspSays(`Removed incomplete database service "${dbService.name}".`);
|
|
78
|
+
}
|
|
79
|
+
async function hasDatabaseVolume(dbService, dbVolumeMountPath, options) {
|
|
80
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
81
|
+
const services = await runJsonCommand(railwayCli, ["service", "list", "--json"], RailwayCliServiceListSchema);
|
|
82
|
+
return services.some((service) => service.id === dbService.id &&
|
|
83
|
+
service.volumes.some((volume) => volume.mountPath === dbVolumeMountPath));
|
|
84
|
+
}
|
|
85
|
+
function getErrorMessage(error) {
|
|
86
|
+
return error instanceof Error ? error.message : String(error);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -1,45 +1,32 @@
|
|
|
1
1
|
import { setTimeout } from "node:timers/promises";
|
|
2
2
|
import { waspSays } from "../../../common/terminal.js";
|
|
3
|
-
import { createCommandWithCwd } from "../../../common/zx.js";
|
|
4
|
-
import {
|
|
3
|
+
import { createCommandWithCwd, tryRunJsonCommand } from "../../../common/zx.js";
|
|
4
|
+
import { RailwayCliServiceStatusSchema, } from "../jsonOutputSchemas.js";
|
|
5
5
|
const POLL_INTERVAL_MS = 5000;
|
|
6
6
|
const TIMEOUT_MS = 5 * 60 * 1000;
|
|
7
7
|
// Any other status means the deployment is still in progress.
|
|
8
8
|
const SUCCESS_STATUS = "SUCCESS";
|
|
9
9
|
const FAILURE_STATUSES = ["FAILED", "CRASHED"];
|
|
10
|
-
export async function waitForServiceDeploymentSuccess(
|
|
10
|
+
export async function waitForServiceDeploymentSuccess(service, options) {
|
|
11
11
|
const deadline = Date.now() + TIMEOUT_MS;
|
|
12
12
|
while (Date.now() < deadline) {
|
|
13
|
-
const status = await getLatestServiceDeploymentStatus(
|
|
13
|
+
const status = await getLatestServiceDeploymentStatus(service, options);
|
|
14
14
|
if (status === SUCCESS_STATUS) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (status !== null && FAILURE_STATUSES.includes(status)) {
|
|
18
|
-
throw new Error(`"${
|
|
18
|
+
throw new Error(`"${service.name}" deployment finished with status "${status}". Check the Railway dashboard for details.`);
|
|
19
19
|
}
|
|
20
|
-
waspSays(`Waiting for "${
|
|
20
|
+
waspSays(`Waiting for "${service.name}" deployment... (Status: "${status ?? "UNKNOWN"}")`);
|
|
21
21
|
await setTimeout(POLL_INTERVAL_MS);
|
|
22
22
|
}
|
|
23
|
-
throw new Error(`Timed out waiting for "${
|
|
23
|
+
throw new Error(`Timed out waiting for "${service.name}" to be deployed. Check the Railway dashboard for details.`);
|
|
24
24
|
}
|
|
25
|
-
async function getLatestServiceDeploymentStatus(
|
|
25
|
+
async function getLatestServiceDeploymentStatus(service, options) {
|
|
26
26
|
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (result.exitCode !== 0) {
|
|
32
|
-
// Treat transient `railway status` failures as "not ready yet".
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const projectStatus = RailwayCliProjectStatusSchema.parse(result.json());
|
|
36
|
-
return findServiceDeploymentStatus(projectStatus, serviceName);
|
|
37
|
-
}
|
|
38
|
-
export function findServiceDeploymentStatus(projectStatus, serviceName) {
|
|
39
|
-
const serviceInstance = projectStatus.environments.edges
|
|
40
|
-
.flatMap((environment) => environment.node.serviceInstances.edges)
|
|
41
|
-
.map((edge) => edge.node)
|
|
42
|
-
.find((instance) => instance.serviceName === serviceName);
|
|
43
|
-
return serviceInstance?.latestDeployment?.status ?? null;
|
|
27
|
+
const serviceStatus = await tryRunJsonCommand(railwayCli, ["service", "status", "--service", service.id, "--json"], RailwayCliServiceStatusSchema);
|
|
28
|
+
// Treat a failed command as a transient Railway CLI failure, i.e. "not
|
|
29
|
+
// ready yet".
|
|
30
|
+
return serviceStatus?.status ?? null;
|
|
44
31
|
}
|
|
45
32
|
//# sourceMappingURL=deployment.js.map
|
|
@@ -4,6 +4,11 @@ export function createRailwayClientServiceName(projectName) {
|
|
|
4
4
|
export function createRailwayServerServiceName(projectName) {
|
|
5
5
|
return createRailwayServiceName(projectName, ServiceWithSuffixedName.Server);
|
|
6
6
|
}
|
|
7
|
+
export function createRailwayDbServiceName() {
|
|
8
|
+
// Kept as "Postgres" for compatibility with databases created by earlier
|
|
9
|
+
// Wasp versions.
|
|
10
|
+
return "Postgres";
|
|
11
|
+
}
|
|
7
12
|
function createRailwayServiceName(projectName, service) {
|
|
8
13
|
const serviceNameSuffix = serviceNameSuffixes[service];
|
|
9
14
|
return `${projectName}${serviceNameSuffix}`;
|
|
@@ -17,8 +22,4 @@ export const serviceNameSuffixes = {
|
|
|
17
22
|
[ServiceWithSuffixedName.Client]: "-client",
|
|
18
23
|
[ServiceWithSuffixedName.Server]: "-server",
|
|
19
24
|
};
|
|
20
|
-
export function createRailwayDbServiceName() {
|
|
21
|
-
// Railway doesn't allow us to choose the database service name.
|
|
22
|
-
return "Postgres";
|
|
23
|
-
}
|
|
24
25
|
//# sourceMappingURL=nameGenerator.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { createCommandWithCwd, runJsonCommand } from "../../../common/zx.js";
|
|
3
|
+
const RailwayApiServiceInstanceUpdateResponseSchema = z.object({
|
|
4
|
+
data: z.object({
|
|
5
|
+
serviceInstanceUpdate: z.literal(true),
|
|
6
|
+
}),
|
|
7
|
+
});
|
|
8
|
+
export async function setServiceInstanceImage(serviceInstance, image, options) {
|
|
9
|
+
const serviceInstanceUpdateMutation = `
|
|
10
|
+
mutation ServiceInstanceUpdate(
|
|
11
|
+
$serviceId: String!
|
|
12
|
+
$environmentId: String
|
|
13
|
+
$input: ServiceInstanceUpdateInput!
|
|
14
|
+
) {
|
|
15
|
+
serviceInstanceUpdate(
|
|
16
|
+
serviceId: $serviceId
|
|
17
|
+
environmentId: $environmentId
|
|
18
|
+
input: $input
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
const imageSourceInput = JSON.stringify({ input: { source: { image } } });
|
|
23
|
+
await runServiceInstanceMutation(serviceInstance, serviceInstanceUpdateMutation, ["--variables", imageSourceInput], RailwayApiServiceInstanceUpdateResponseSchema, options);
|
|
24
|
+
}
|
|
25
|
+
const RailwayApiServiceInstanceDeployV2ResponseSchema = z.object({
|
|
26
|
+
data: z.object({
|
|
27
|
+
serviceInstanceDeployV2: z.string(),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
export async function startServiceInstanceDeployment(serviceInstance, options) {
|
|
31
|
+
const serviceInstanceDeployV2Mutation = `
|
|
32
|
+
mutation ServiceInstanceDeployV2($serviceId: String!, $environmentId: String!) {
|
|
33
|
+
serviceInstanceDeployV2(serviceId: $serviceId, environmentId: $environmentId)
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
await runServiceInstanceMutation(serviceInstance, serviceInstanceDeployV2Mutation, [], RailwayApiServiceInstanceDeployV2ResponseSchema, options);
|
|
37
|
+
}
|
|
38
|
+
async function runServiceInstanceMutation(serviceInstance, mutation, mutationArgs, responseSchema, options) {
|
|
39
|
+
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
40
|
+
return runJsonCommand(railwayCli, [
|
|
41
|
+
"api",
|
|
42
|
+
mutation,
|
|
43
|
+
...["--raw-var", `serviceId=${serviceInstance.serviceId}`],
|
|
44
|
+
...["--raw-var", `environmentId=${serviceInstance.environmentId}`],
|
|
45
|
+
...mutationArgs,
|
|
46
|
+
], responseSchema);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=serviceInstance.js.map
|
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
import { waspInfo } from "../../../common/terminal.js";
|
|
2
|
-
import { createCommandWithCwd } from "../../../common/zx.js";
|
|
2
|
+
import { createCommandWithCwd, tryRunJsonCommand } from "../../../common/zx.js";
|
|
3
3
|
import { RailwayCliDomainSchema } from "../jsonOutputSchemas.js";
|
|
4
|
-
export var ServiceUrlStatus;
|
|
5
|
-
(function (ServiceUrlStatus) {
|
|
6
|
-
ServiceUrlStatus["URL_CREATED"] = "URL_CREATED";
|
|
7
|
-
ServiceUrlStatus["URL_ALREADY_EXISTS"] = "URL_ALREADY_EXISTS";
|
|
8
|
-
})(ServiceUrlStatus || (ServiceUrlStatus = {}));
|
|
9
4
|
export async function generateServiceUrl(serviceName, port, options) {
|
|
10
5
|
const railwayCli = createCommandWithCwd(options.railwayExe, options.waspProjectDir);
|
|
11
|
-
const result = await railwayCli
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
if (result.exitCode !== 0) {
|
|
6
|
+
const result = await tryRunJsonCommand(railwayCli, ["domain", "--service", serviceName, "--port", port.toString(), "--json"], RailwayCliDomainSchema);
|
|
7
|
+
if (result === null) {
|
|
15
8
|
throw new Error(`There was a problem getting a domain for ${serviceName}.`);
|
|
16
9
|
}
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
10
|
+
const { domains } = result;
|
|
11
|
+
const domain = domains[0];
|
|
12
|
+
if (domains.length > 1) {
|
|
13
|
+
waspInfo(`Multiple domains detected, using the first one: ${domain}.`);
|
|
14
|
+
waspInfo('If you want to use a custom domain for the server, you should add the "--custom-server-url <url>" flag.');
|
|
21
15
|
}
|
|
22
|
-
|
|
23
|
-
const { domains } = RailwayCliDomainSchema.parse(result.json());
|
|
24
|
-
const domain = domains[0];
|
|
25
|
-
if (domains.length > 1) {
|
|
26
|
-
waspInfo(`Multiple domains detected, using the first one: ${domain}.`);
|
|
27
|
-
waspInfo('If you want to use a custom domain for the server, you should add the "--custom-server-url <url>" flag.');
|
|
28
|
-
}
|
|
29
|
-
return domain;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export function extractServiceUrlFromString(text) {
|
|
33
|
-
const match = text.match(/https:\/\/[^\s]*/);
|
|
34
|
-
if (match === null) {
|
|
35
|
-
throw new Error("Failed to get service domain");
|
|
36
|
-
}
|
|
37
|
-
return match[0];
|
|
16
|
+
return domain;
|
|
38
17
|
}
|
|
39
18
|
//# sourceMappingURL=url.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasp-deploy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "wasp-deploy",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/prompts": "^7.5.3",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasp-prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "wasp-prisma",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"json5": "^2.2.3",
|