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
39 lines (35 loc) · 1.74 KB
/
Copy pathactivate.command.ts
File metadata and controls
39 lines (35 loc) · 1.74 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
34
35
36
37
38
39
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 { legacyDomainsActivate } from "./activate.handler.ts";
const config = {
projectRef: Flag.string("project-ref").pipe(
Flag.withDescription("Project ref of the Supabase project."),
Flag.optional,
),
includeRawOutput: Flag.boolean("include-raw-output").pipe(
Flag.withDescription("(Deprecated) use -o json instead."),
),
} as const;
export type LegacyDomainsActivateFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacyDomainsActivateCommand = Command.make("activate", config).pipe(
Command.withDescription(
"Activates the custom hostname configuration for a project. This reconfigures your Supabase project to respond to requests on your custom hostname. After the custom hostname is activated, your project's auth services will no longer function on the Supabase-provisioned subdomain.",
),
Command.withShortDescription("Activate the custom hostname for a project"),
Command.withExamples([
{
command: "supabase domains activate --project-ref abcdefghijklmnopqrst",
description: "Activate the custom hostname for a project",
},
]),
Command.withHandler((flags) =>
legacyDomainsActivate(flags).pipe(
withLegacyCommandInstrumentation({ flags }),
withJsonErrorHandling,
),
),
Command.provide(legacyManagementApiRuntimeLayer(["domains", "activate"])),
);