forked from supabase/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove.command.ts
More file actions
39 lines (36 loc) · 1.65 KB
/
Copy pathremove.command.ts
File metadata and controls
39 lines (36 loc) · 1.65 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 { Argument, 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 { legacySsoRemove } from "./remove.handler.ts";
const config = {
projectRef: Flag.string("project-ref").pipe(
Flag.withDescription("Project ref of the Supabase project."),
Flag.optional,
),
providerId: Argument.string("provider-id").pipe(
Argument.withDescription("The ID of the SSO identity provider to remove."),
),
};
export type LegacySsoRemoveFlags = CliCommand.Command.Config.Infer<typeof config>;
export const legacySsoRemoveCommand = Command.make("remove", config).pipe(
Command.withDescription(
"Remove a connection to an already added SSO identity provider. Removing the provider will prevent existing users from logging in. Please treat this command with care.",
),
Command.withShortDescription("Remove an existing SSO identity provider"),
Command.withExamples([
{
command:
"supabase sso remove b5ae62f9-ef1d-4f11-a02b-731c8bbb11e8 --project-ref mwjylndxudmiehsxhmmz",
description: "Remove an SSO provider by ID",
},
]),
Command.withHandler((flags) =>
legacySsoRemove(flags).pipe(
withLegacyCommandInstrumentation({ flags, safeFlags: ["project-ref"] }),
withJsonErrorHandling,
),
),
Command.provide(legacyManagementApiRuntimeLayer(["sso", "remove"])),
);