forked from supabase/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.command.ts
More file actions
33 lines (29 loc) · 1.62 KB
/
Copy pathactivate.command.ts
File metadata and controls
33 lines (29 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Command, Flag } from "effect/unstable/cli";
import type * as CliCommand from "effect/unstable/cli/Command";
import { withJsonErrorHandling } from "../../../../shared/output/json-error-handling.ts";
import { legacyManagementApiRuntimeLayer } from "../../../shared/legacy-management-api-runtime.layer.ts";
import { withLegacyCommandInstrumentation } from "../../../telemetry/legacy-command-instrumentation.ts";
import { legacyVanitySubdomainsActivate } from "./activate.handler.ts";
const config = {
projectRef: Flag.string("project-ref").pipe(
Flag.withDescription("Project ref of the Supabase project."),
Flag.optional,
),
desiredSubdomain: Flag.string("desired-subdomain").pipe(
Flag.withDescription("The desired vanity subdomain to use for your Supabase project."),
),
} as const;
export type LegacyVanitySubdomainsActivateFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacyVanitySubdomainsActivateCommand = Command.make("activate", config).pipe(
Command.withDescription(
"Activate a vanity subdomain for your Supabase project. This reconfigures your Supabase project to respond to requests on your vanity subdomain. After the vanity subdomain is activated, your project's auth services will no longer function on the {project-ref}.{supabase-domain} hostname.",
),
Command.withShortDescription("Activate a vanity subdomain"),
Command.withHandler((flags) =>
legacyVanitySubdomainsActivate(flags).pipe(
withLegacyCommandInstrumentation({ flags }),
withJsonErrorHandling,
),
),
Command.provide(legacyManagementApiRuntimeLayer(["vanity-subdomains", "activate"])),
);