@zapier/zapier-sdk-cli 0.52.5 → 0.52.7

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.
@@ -1,5 +1,4 @@
1
1
  import { createPluginMethod, definePlugin, } from "@zapier/zapier-sdk";
2
- import inquirer from "inquirer";
3
2
  import { logout as jwtLogout } from "../../login";
4
3
  import { getActiveCredentials } from "../../login/credentials-store";
5
4
  import { revokeCredentials, } from "../../login/credentials-revoke";
@@ -21,20 +20,6 @@ export const logoutPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
21
20
  console.log("✅ Successfully logged out");
22
21
  return;
23
22
  }
24
- const { confirmed } = await inquirer.prompt([
25
- {
26
- type: "confirm",
27
- name: "confirmed",
28
- message: `Logging out will delete credentials "${activeCredentials.name}".\n` +
29
- "This may interrupt other Zapier SDK or CLI sessions using them.\n" +
30
- "Do you want to continue?",
31
- default: true,
32
- },
33
- ]);
34
- if (!confirmed) {
35
- console.log("Logout cancelled.");
36
- return;
37
- }
38
23
  await revokeCredentials({
39
24
  api: sdk.context.api,
40
25
  credentials: activeCredentials,
@@ -1,3 +1,2 @@
1
1
  import { z } from "zod";
2
2
  export declare const LogoutSchema: z.ZodObject<{}, z.core.$strip>;
3
- export type LogoutOptions = z.infer<typeof LogoutSchema>;
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- // Logout schema (no parameters needed)
3
2
  export const LogoutSchema = z
4
3
  .object({})
5
4
  .describe("Log out of your Zapier account");
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Resolve whether a CLI invocation should run non-interactively.
3
+ *
4
+ * A command is non-interactive when the user explicitly opts out via
5
+ * `--non-interactive` / `--skip-prompts`, OR when stdin or stdout isn't a
6
+ * TTY (CI, piped output, etc.). The TTY check matters because prompting
7
+ * against a non-TTY stream hangs or crashes — every plugin that gates
8
+ * inquirer prompts on this flag needs the same answer.
9
+ */
10
+ export declare function resolveNonInteractive(options: {
11
+ nonInteractive?: boolean;
12
+ skipPrompts?: boolean;
13
+ }): boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Resolve whether a CLI invocation should run non-interactively.
3
+ *
4
+ * A command is non-interactive when the user explicitly opts out via
5
+ * `--non-interactive` / `--skip-prompts`, OR when stdin or stdout isn't a
6
+ * TTY (CI, piped output, etc.). The TTY check matters because prompting
7
+ * against a non-TTY stream hangs or crashes — every plugin that gates
8
+ * inquirer prompts on this flag needs the same answer.
9
+ */
10
+ export function resolveNonInteractive(options) {
11
+ return ((options.nonInteractive ?? options.skipPrompts) === true ||
12
+ !process.stdin.isTTY ||
13
+ !process.stdout.isTTY);
14
+ }