@zapier/zapier-sdk-cli 0.34.5 → 0.34.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.34.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0feaeb1]
8
+ - @zapier/zapier-sdk@0.32.5
9
+ - @zapier/zapier-sdk-mcp@0.9.16
10
+
11
+ ## 0.34.6
12
+
13
+ ### Patch Changes
14
+
15
+ - 1334eac: Emit login_success lifecycle event on CLI login
16
+ - Updated dependencies [1334eac]
17
+ - @zapier/zapier-sdk@0.32.4
18
+ - @zapier/zapier-sdk-mcp@0.9.15
19
+
3
20
  ## 0.34.5
4
21
 
5
22
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -923,7 +923,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
923
923
 
924
924
  // package.json
925
925
  var package_default = {
926
- version: "0.34.5"};
926
+ version: "0.34.7"};
927
927
 
928
928
  // src/telemetry/builders.ts
929
929
  function createCliBaseEvent(context = {}) {
@@ -2015,6 +2015,12 @@ var loginPlugin = ({
2015
2015
  credentials: pkceCredentials
2016
2016
  });
2017
2017
  const user = await cliLogin.getLoggedInUser();
2018
+ context.eventEmission.emit(
2019
+ "platform.sdk.ApplicationLifecycleEvent",
2020
+ zapierSdk.buildApplicationLifecycleEvent({
2021
+ lifecycle_event_type: "login_success"
2022
+ })
2023
+ );
2018
2024
  console.log(`\u2705 Successfully logged in as ${user.email}`);
2019
2025
  };
2020
2026
  return {
@@ -4172,7 +4178,7 @@ function createZapierCliSdk(options = {}) {
4172
4178
  // package.json with { type: 'json' }
4173
4179
  var package_default2 = {
4174
4180
  name: "@zapier/zapier-sdk-cli",
4175
- version: "0.34.5"};
4181
+ version: "0.34.7"};
4176
4182
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
4177
4183
  var CACHE_RESET_INTERVAL_MS = (() => {
4178
4184
  const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, CommanderError } from 'commander';
3
3
  import { z } from 'zod';
4
- import { createFunction, OutputPropertySchema, DEFAULT_CONFIG_PATH, injectCliLogin, createZapierSdkWithoutRegistry, registryPlugin, ZapierError, ZapierValidationError, ZapierUnknownError, batch, toSnakeCase, formatErrorMessage, isCredentialsObject, isPositional, getOsInfo, getPlatformVersions, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
4
+ import { createFunction, OutputPropertySchema, DEFAULT_CONFIG_PATH, injectCliLogin, createZapierSdkWithoutRegistry, registryPlugin, ZapierError, ZapierValidationError, ZapierUnknownError, batch, toSnakeCase, buildApplicationLifecycleEvent, formatErrorMessage, isCredentialsObject, isPositional, getOsInfo, getPlatformVersions, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
5
5
  import inquirer from 'inquirer';
6
6
  import chalk6 from 'chalk';
7
7
  import util from 'util';
@@ -886,7 +886,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
886
886
 
887
887
  // package.json
888
888
  var package_default = {
889
- version: "0.34.5"};
889
+ version: "0.34.7"};
890
890
 
891
891
  // src/telemetry/builders.ts
892
892
  function createCliBaseEvent(context = {}) {
@@ -1978,6 +1978,12 @@ var loginPlugin = ({
1978
1978
  credentials: pkceCredentials
1979
1979
  });
1980
1980
  const user = await getLoggedInUser();
1981
+ context.eventEmission.emit(
1982
+ "platform.sdk.ApplicationLifecycleEvent",
1983
+ buildApplicationLifecycleEvent({
1984
+ lifecycle_event_type: "login_success"
1985
+ })
1986
+ );
1981
1987
  console.log(`\u2705 Successfully logged in as ${user.email}`);
1982
1988
  };
1983
1989
  return {
@@ -4135,7 +4141,7 @@ function createZapierCliSdk(options = {}) {
4135
4141
  // package.json with { type: 'json' }
4136
4142
  var package_default2 = {
4137
4143
  name: "@zapier/zapier-sdk-cli",
4138
- version: "0.34.5"};
4144
+ version: "0.34.7"};
4139
4145
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
4140
4146
  var CACHE_RESET_INTERVAL_MS = (() => {
4141
4147
  const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
package/dist/index.cjs CHANGED
@@ -369,6 +369,12 @@ var loginPlugin = ({
369
369
  credentials: pkceCredentials
370
370
  });
371
371
  const user = await cliLogin.getLoggedInUser();
372
+ context.eventEmission.emit(
373
+ "platform.sdk.ApplicationLifecycleEvent",
374
+ zapierSdk.buildApplicationLifecycleEvent({
375
+ lifecycle_event_type: "login_success"
376
+ })
377
+ );
372
378
  console.log(`\u2705 Successfully logged in as ${user.email}`);
373
379
  };
374
380
  return {
@@ -2498,7 +2504,7 @@ function createZapierCliSdk(options = {}) {
2498
2504
 
2499
2505
  // package.json
2500
2506
  var package_default = {
2501
- version: "0.34.5"};
2507
+ version: "0.34.7"};
2502
2508
 
2503
2509
  // src/telemetry/builders.ts
2504
2510
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as cliLogin from '@zapier/zapier-sdk-cli-login';
2
2
  import { logout, getConfigPath, getLoggedInUser, getPkceLoginConfig, AUTH_MODE_HEADER, getLoginStorageMode, updateLogin } from '@zapier/zapier-sdk-cli-login';
3
- import { createFunction, OutputPropertySchema, DEFAULT_CONFIG_PATH, injectCliLogin, createZapierSdkWithoutRegistry, registryPlugin, getOsInfo, getPlatformVersions, getCiPlatform, isCi, ZapierValidationError, ZapierUnknownError, getReleaseId, getCurrentTimestamp, generateEventId, batch, toSnakeCase, ZapierError, isCredentialsObject } from '@zapier/zapier-sdk';
3
+ import { createFunction, OutputPropertySchema, DEFAULT_CONFIG_PATH, injectCliLogin, createZapierSdkWithoutRegistry, registryPlugin, getOsInfo, getPlatformVersions, getCiPlatform, isCi, ZapierValidationError, ZapierUnknownError, getReleaseId, getCurrentTimestamp, generateEventId, batch, toSnakeCase, buildApplicationLifecycleEvent, ZapierError, isCredentialsObject } from '@zapier/zapier-sdk';
4
4
  import open from 'open';
5
5
  import crypto, { createHash } from 'crypto';
6
6
  import express from 'express';
@@ -336,6 +336,12 @@ var loginPlugin = ({
336
336
  credentials: pkceCredentials
337
337
  });
338
338
  const user = await getLoggedInUser();
339
+ context.eventEmission.emit(
340
+ "platform.sdk.ApplicationLifecycleEvent",
341
+ buildApplicationLifecycleEvent({
342
+ lifecycle_event_type: "login_success"
343
+ })
344
+ );
339
345
  console.log(`\u2705 Successfully logged in as ${user.email}`);
340
346
  };
341
347
  return {
@@ -2465,7 +2471,7 @@ function createZapierCliSdk(options = {}) {
2465
2471
 
2466
2472
  // package.json
2467
2473
  var package_default = {
2468
- version: "0.34.5"};
2474
+ version: "0.34.7"};
2469
2475
 
2470
2476
  // src/telemetry/builders.ts
2471
2477
  function createCliBaseEvent(context = {}) {
package/dist/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.34.5",
3
+ "version": "0.34.7",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "source": "./src/index.ts",
10
11
  "require": {
11
12
  "types": "./dist/index.d.ts",
12
13
  "default": "./dist/index.cjs"
@@ -17,6 +18,7 @@
17
18
  }
18
19
  },
19
20
  "./login": {
21
+ "source": "./src/login.ts",
20
22
  "require": {
21
23
  "types": "./dist/login.d.ts",
22
24
  "default": "./dist/login.cjs"
@@ -1,6 +1,6 @@
1
- import type { Plugin, ResolvedCredentials } from "@zapier/zapier-sdk";
1
+ import type { Plugin, ResolvedCredentials, EventEmissionContext } from "@zapier/zapier-sdk";
2
2
  import { LoginSchema, type LoginOptions } from "./schemas";
3
- interface CliContext {
3
+ interface CliContext extends EventEmissionContext {
4
4
  session_id?: string | null;
5
5
  selected_api?: string | null;
6
6
  app_id?: number | null;
@@ -1,4 +1,4 @@
1
- import { isCredentialsObject } from "@zapier/zapier-sdk";
1
+ import { isCredentialsObject, buildApplicationLifecycleEvent, } from "@zapier/zapier-sdk";
2
2
  import login from "../../utils/auth/login";
3
3
  import { getLoggedInUser, } from "@zapier/zapier-sdk-cli-login";
4
4
  import { LoginSchema } from "./schemas";
@@ -30,6 +30,9 @@ export const loginPlugin = ({ context, }) => {
30
30
  credentials: pkceCredentials,
31
31
  });
32
32
  const user = await getLoggedInUser();
33
+ context.eventEmission.emit("platform.sdk.ApplicationLifecycleEvent", buildApplicationLifecycleEvent({
34
+ lifecycle_event_type: "login_success",
35
+ }));
33
36
  console.log(`✅ Successfully logged in as ${user.email}`);
34
37
  };
35
38
  return {