@zapier/zapier-sdk-cli 0.34.4 → 0.34.6
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 +17 -0
- package/dist/cli.cjs +8 -2
- package/dist/cli.mjs +9 -3
- package/dist/index.cjs +7 -1
- package/dist/index.mjs +8 -2
- package/dist/package.json +1 -1
- package/dist/src/plugins/login/index.d.ts +2 -2
- package/dist/src/plugins/login/index.js +4 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.34.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1334eac: Emit login_success lifecycle event on CLI login
|
|
8
|
+
- Updated dependencies [1334eac]
|
|
9
|
+
- @zapier/zapier-sdk@0.32.4
|
|
10
|
+
- @zapier/zapier-sdk-mcp@0.9.15
|
|
11
|
+
|
|
12
|
+
## 0.34.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [3663fc3]
|
|
17
|
+
- @zapier/zapier-sdk-cli-login@0.8.1
|
|
18
|
+
- @zapier/zapier-sdk@0.32.3
|
|
19
|
+
|
|
3
20
|
## 0.34.4
|
|
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.
|
|
926
|
+
version: "0.34.6"};
|
|
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.
|
|
4181
|
+
version: "0.34.6"};
|
|
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.
|
|
889
|
+
version: "0.34.6"};
|
|
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.
|
|
4144
|
+
version: "0.34.6"};
|
|
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.
|
|
2507
|
+
version: "0.34.6"};
|
|
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.
|
|
2474
|
+
version: "0.34.6"};
|
|
2469
2475
|
|
|
2470
2476
|
// src/telemetry/builders.ts
|
|
2471
2477
|
function createCliBaseEvent(context = {}) {
|
package/dist/package.json
CHANGED
|
@@ -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 {
|