@zapier/zapier-sdk-cli 0.52.10 → 0.52.12
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 +43 -0
- package/README.md +19 -1
- package/dist/cli.cjs +80 -82
- package/dist/cli.mjs +81 -83
- package/dist/experimental.cjs +17 -26
- package/dist/experimental.d.mts +1 -1
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.mjs +16 -25
- package/dist/index.cjs +18 -27
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +16 -25
- package/dist/login.cjs +8 -10
- package/dist/login.d.mts +2 -10
- package/dist/login.d.ts +2 -10
- package/dist/login.mjs +5 -9
- package/dist/package.json +1 -1
- package/dist/{sdk-B3nKAZdN.d.mts → sdk-Sa1HjzUj.d.mts} +14 -14
- package/dist/{sdk-B3nKAZdN.d.ts → sdk-Sa1HjzUj.d.ts} +14 -14
- package/dist/src/experimental.js +29 -27
- package/dist/src/login/index.d.ts +1 -9
- package/dist/src/login/index.js +12 -14
- package/dist/src/plugins/add/index.d.ts +15 -15
- package/dist/src/plugins/add/index.js +1 -1
- package/dist/src/plugins/buildManifest/index.d.ts +2 -2
- package/dist/src/plugins/bundleCode/index.d.ts +1 -1
- package/dist/src/plugins/bundleCode/index.js +2 -1
- package/dist/src/plugins/cliOverrides/index.d.ts +5 -10
- package/dist/src/plugins/cliOverrides/index.js +2 -6
- package/dist/src/plugins/curl/index.d.ts +2 -2
- package/dist/src/plugins/curl/schemas.d.ts +2 -2
- package/dist/src/plugins/feedback/index.d.ts +1 -1
- package/dist/src/plugins/generateAppTypes/index.d.ts +11 -11
- package/dist/src/plugins/getLoginConfigPath/index.d.ts +1 -1
- package/dist/src/plugins/index.d.ts +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/init/index.d.ts +1 -1
- package/dist/src/plugins/login/index.d.ts +1 -1
- package/dist/src/plugins/logout/index.d.ts +1 -1
- package/dist/src/plugins/mcp/index.d.ts +1 -1
- package/dist/src/sdk.js +31 -20
- package/dist/src/utils/cli-generator.js +14 -7
- package/dist/src/utils/cli-renderer.d.ts +13 -3
- package/dist/src/utils/cli-renderer.js +27 -20
- package/dist/src/utils/log.js +9 -4
- package/dist/src/utils/parameter-resolver.js +3 -1
- package/dist/src/utils/schema-formatter.d.ts +2 -2
- package/dist/src/utils/schema-formatter.js +4 -30
- package/dist/src/utils/version-checker.js +8 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command, CommanderError, Option } from 'commander';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal,
|
|
4
|
+
import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal, createZapierSdkStack as createZapierSdkStack$1, addPlugin as addPlugin$1, ZapierError, ZapierAuthenticationError, isPositional, runWithTelemetryContext, buildCapabilityMessage, formatErrorMessage, getOsInfo, getPlatformVersions, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import search from '@inquirer/search';
|
|
7
7
|
import chalk from 'chalk';
|
|
@@ -29,8 +29,8 @@ import isInstalledGlobally from 'is-installed-globally';
|
|
|
29
29
|
import { execSync, spawn } from 'child_process';
|
|
30
30
|
import Handlebars from 'handlebars';
|
|
31
31
|
import { fileURLToPath } from 'url';
|
|
32
|
-
import { injectCliLogin as injectCliLogin$1,
|
|
33
|
-
import packageJsonLib from 'package-json';
|
|
32
|
+
import { injectCliLogin as injectCliLogin$1, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
|
|
33
|
+
import packageJsonLib, { VersionNotFoundError } from 'package-json';
|
|
34
34
|
import semver from 'semver';
|
|
35
35
|
|
|
36
36
|
var __defProp = Object.defineProperty;
|
|
@@ -158,7 +158,7 @@ var SchemaParameterResolver = class {
|
|
|
158
158
|
debugLog(message) {
|
|
159
159
|
if (this.debug) {
|
|
160
160
|
this.stopSpinner();
|
|
161
|
-
console.
|
|
161
|
+
console.error(chalk.gray(`[Zapier CLI] ${message}`));
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
startSpinner() {
|
|
@@ -1530,7 +1530,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1530
1530
|
|
|
1531
1531
|
// package.json
|
|
1532
1532
|
var package_default = {
|
|
1533
|
-
version: "0.52.
|
|
1533
|
+
version: "0.52.12"};
|
|
1534
1534
|
|
|
1535
1535
|
// src/telemetry/builders.ts
|
|
1536
1536
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1584,12 +1584,6 @@ function buildCliCommandExecutedEvent({
|
|
|
1584
1584
|
subprocess_count: data.subprocess_count ?? null
|
|
1585
1585
|
};
|
|
1586
1586
|
}
|
|
1587
|
-
function getFormatMetadata(schema) {
|
|
1588
|
-
return schema?._zod?.def?.formatMeta;
|
|
1589
|
-
}
|
|
1590
|
-
function getOutputSchema(schema) {
|
|
1591
|
-
return schema?._zod?.def?.outputSchema;
|
|
1592
|
-
}
|
|
1593
1587
|
function formatJsonOutput(data) {
|
|
1594
1588
|
if (data === void 0) {
|
|
1595
1589
|
return;
|
|
@@ -1598,21 +1592,26 @@ function formatJsonOutput(data) {
|
|
|
1598
1592
|
util.inspect(data, { colors: true, depth: null, breakLength: 80 })
|
|
1599
1593
|
);
|
|
1600
1594
|
}
|
|
1601
|
-
async function formatItemsFromSchema(
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1595
|
+
async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, options) {
|
|
1596
|
+
if (options?.formatter) {
|
|
1597
|
+
let context;
|
|
1598
|
+
if (options.formatter.fetch && options.sdk && options.params) {
|
|
1599
|
+
for (const item of items) {
|
|
1600
|
+
context = await options.formatter.fetch(
|
|
1601
|
+
options.sdk,
|
|
1602
|
+
options.params,
|
|
1603
|
+
item,
|
|
1604
|
+
context
|
|
1605
|
+
);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
items.forEach((item, index) => {
|
|
1609
|
+
const formatted = options.formatter.format(item, context);
|
|
1610
|
+
formatSingleItem(formatted, startingNumber + index);
|
|
1611
|
+
});
|
|
1610
1612
|
return;
|
|
1611
1613
|
}
|
|
1612
|
-
items
|
|
1613
|
-
const formatted = formatMeta.format(item);
|
|
1614
|
-
formatSingleItem(formatted, startingNumber + index);
|
|
1615
|
-
});
|
|
1614
|
+
formatItemsGeneric(items, startingNumber);
|
|
1616
1615
|
}
|
|
1617
1616
|
function formatSingleItem(formatted, itemNumber) {
|
|
1618
1617
|
let titleLine = `${chalk.gray(`${itemNumber + 1}.`)} ${chalk.cyan(formatted.title)}`;
|
|
@@ -1772,7 +1771,7 @@ function createJsonRenderer() {
|
|
|
1772
1771
|
errors: []
|
|
1773
1772
|
});
|
|
1774
1773
|
},
|
|
1775
|
-
renderCollectedList(items, _options) {
|
|
1774
|
+
async renderCollectedList(items, _options) {
|
|
1776
1775
|
outputJson({ data: items, errors: [] });
|
|
1777
1776
|
},
|
|
1778
1777
|
renderItem(value, options) {
|
|
@@ -1804,27 +1803,32 @@ function getListTitle(functionInfo) {
|
|
|
1804
1803
|
if (functionInfo.itemType) return `Available ${functionInfo.itemType} items`;
|
|
1805
1804
|
return "items";
|
|
1806
1805
|
}
|
|
1807
|
-
function
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
`${chalk.gray(`${startingNumber + index + 1}.`)} ${chalk.cyan(String(name))}`
|
|
1806
|
+
function createInteractiveRenderer(context = {}) {
|
|
1807
|
+
async function renderItemsForDisplay(items, functionInfo, startingNumber = 0) {
|
|
1808
|
+
if (functionInfo?.inputSchema) {
|
|
1809
|
+
await formatItemsFromSchema(
|
|
1810
|
+
functionInfo,
|
|
1811
|
+
items,
|
|
1812
|
+
startingNumber,
|
|
1813
|
+
{
|
|
1814
|
+
formatter: functionInfo.formatter,
|
|
1815
|
+
sdk: context.sdk,
|
|
1816
|
+
params: context.params
|
|
1817
|
+
}
|
|
1820
1818
|
);
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1819
|
+
} else {
|
|
1820
|
+
items.forEach((item, index) => {
|
|
1821
|
+
const obj = item;
|
|
1822
|
+
const name = obj?.name || obj?.key || obj?.id || "Item";
|
|
1823
|
+
console.log(
|
|
1824
|
+
`${chalk.gray(`${startingNumber + index + 1}.`)} ${chalk.cyan(String(name))}`
|
|
1825
|
+
);
|
|
1826
|
+
if (obj?.description)
|
|
1827
|
+
console.log(` ${chalk.dim(String(obj.description))}`);
|
|
1828
|
+
console.log();
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1825
1831
|
}
|
|
1826
|
-
}
|
|
1827
|
-
function createInteractiveRenderer() {
|
|
1828
1832
|
return {
|
|
1829
1833
|
async renderPaginatedList(source, functionInfo) {
|
|
1830
1834
|
const itemName = getItemName(functionInfo);
|
|
@@ -1834,7 +1838,7 @@ function createInteractiveRenderer() {
|
|
|
1834
1838
|
console.log(chalk.yellow(`No ${itemName} found.`));
|
|
1835
1839
|
return;
|
|
1836
1840
|
}
|
|
1837
|
-
renderItemsForDisplay(items, functionInfo, 0);
|
|
1841
|
+
await renderItemsForDisplay(items, functionInfo, 0);
|
|
1838
1842
|
console.log(chalk.green(`
|
|
1839
1843
|
\u2705 Showing ${items.length} ${itemName}`));
|
|
1840
1844
|
return;
|
|
@@ -1856,7 +1860,7 @@ function createInteractiveRenderer() {
|
|
|
1856
1860
|
console.log(chalk.blue(`\u{1F4CB} ${getListTitle(functionInfo)}
|
|
1857
1861
|
`));
|
|
1858
1862
|
}
|
|
1859
|
-
renderItemsForDisplay(items, functionInfo, totalShown);
|
|
1863
|
+
await renderItemsForDisplay(items, functionInfo, totalShown);
|
|
1860
1864
|
totalShown += items.length;
|
|
1861
1865
|
console.log(
|
|
1862
1866
|
chalk.green(
|
|
@@ -1881,7 +1885,7 @@ function createInteractiveRenderer() {
|
|
|
1881
1885
|
console.log(chalk.gray(`
|
|
1882
1886
|
\u{1F4C4} Finished browsing ${itemName}`));
|
|
1883
1887
|
},
|
|
1884
|
-
renderCollectedList(items, { maxItems, userSpecifiedMaxItems, functionInfo } = {}) {
|
|
1888
|
+
async renderCollectedList(items, { maxItems, userSpecifiedMaxItems, functionInfo } = {}) {
|
|
1885
1889
|
if (!Array.isArray(items)) {
|
|
1886
1890
|
formatJsonOutput(items);
|
|
1887
1891
|
return;
|
|
@@ -1894,7 +1898,7 @@ function createInteractiveRenderer() {
|
|
|
1894
1898
|
console.log(chalk.green(`
|
|
1895
1899
|
\u2705 Found ${items.length} ${itemName}:
|
|
1896
1900
|
`));
|
|
1897
|
-
renderItemsForDisplay(items, functionInfo);
|
|
1901
|
+
await renderItemsForDisplay(items, functionInfo);
|
|
1898
1902
|
if (userSpecifiedMaxItems && maxItems) {
|
|
1899
1903
|
console.log(
|
|
1900
1904
|
chalk.gray(
|
|
@@ -2357,11 +2361,11 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2357
2361
|
const startTime = Date.now();
|
|
2358
2362
|
let success = true;
|
|
2359
2363
|
let errorMessage = null;
|
|
2360
|
-
|
|
2364
|
+
const resolvedParams = {};
|
|
2361
2365
|
const commandObj = args[args.length - 1];
|
|
2362
2366
|
const options = commandObj.opts();
|
|
2363
2367
|
const interactiveMode = !options.json;
|
|
2364
|
-
const renderer = interactiveMode ? createInteractiveRenderer() : createJsonRenderer();
|
|
2368
|
+
const renderer = interactiveMode ? createInteractiveRenderer({ sdk, params: resolvedParams }) : createJsonRenderer();
|
|
2365
2369
|
try {
|
|
2366
2370
|
emitDeprecationWarning({
|
|
2367
2371
|
cliCommandName,
|
|
@@ -2394,7 +2398,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2394
2398
|
}
|
|
2395
2399
|
if (schema && !usesInputParameters) {
|
|
2396
2400
|
const resolver = new SchemaParameterResolver();
|
|
2397
|
-
|
|
2401
|
+
const resolved = await resolver.resolveParameters(
|
|
2398
2402
|
schema,
|
|
2399
2403
|
rawParams,
|
|
2400
2404
|
sdk,
|
|
@@ -2404,8 +2408,9 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2404
2408
|
debug: !!options.debug || process.env.DEBUG === "true" || process.argv.includes("--debug")
|
|
2405
2409
|
}
|
|
2406
2410
|
);
|
|
2411
|
+
Object.assign(resolvedParams, resolved);
|
|
2407
2412
|
} else {
|
|
2408
|
-
resolvedParams
|
|
2413
|
+
Object.assign(resolvedParams, rawParams);
|
|
2409
2414
|
}
|
|
2410
2415
|
const confirm = functionInfo.confirm;
|
|
2411
2416
|
let confirmMessageAfter;
|
|
@@ -2434,7 +2439,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2434
2439
|
sdkResult,
|
|
2435
2440
|
maxItems
|
|
2436
2441
|
});
|
|
2437
|
-
renderer.renderCollectedList(allItems, {
|
|
2442
|
+
await renderer.renderCollectedList(allItems, {
|
|
2438
2443
|
maxItems,
|
|
2439
2444
|
userSpecifiedMaxItems: hasUserSpecifiedMaxItems,
|
|
2440
2445
|
functionInfo
|
|
@@ -2468,7 +2473,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2468
2473
|
if (normalizedResult.kind === "response") {
|
|
2469
2474
|
await renderer.renderResponse(normalizedResult.value);
|
|
2470
2475
|
} else if (normalizedResult.kind === "list") {
|
|
2471
|
-
renderer.renderCollectedList(normalizedResult.data, {
|
|
2476
|
+
await renderer.renderCollectedList(normalizedResult.data, {
|
|
2472
2477
|
maxItems: resolvedParams.maxItems,
|
|
2473
2478
|
userSpecifiedMaxItems: hasUserSpecifiedMaxItems,
|
|
2474
2479
|
functionInfo
|
|
@@ -2524,7 +2529,7 @@ ${confirmMessageAfter}`));
|
|
|
2524
2529
|
description,
|
|
2525
2530
|
parameters,
|
|
2526
2531
|
handler,
|
|
2527
|
-
hidden: functionInfo.
|
|
2532
|
+
hidden: !!functionInfo.deprecation,
|
|
2528
2533
|
aliases: functionInfo.aliases,
|
|
2529
2534
|
supportsJsonOutput: functionInfo.supportsJsonOutput
|
|
2530
2535
|
};
|
|
@@ -3087,12 +3092,6 @@ async function deleteStoredClientCredentials({
|
|
|
3087
3092
|
}
|
|
3088
3093
|
|
|
3089
3094
|
// src/login/index.ts
|
|
3090
|
-
var ZapierAuthenticationError = class extends Error {
|
|
3091
|
-
constructor(message) {
|
|
3092
|
-
super(message);
|
|
3093
|
-
this.name = "ZapierAuthenticationError";
|
|
3094
|
-
}
|
|
3095
|
-
};
|
|
3096
3095
|
var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
|
|
3097
3096
|
var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
|
|
3098
3097
|
function createDebugLog(enabled) {
|
|
@@ -3102,9 +3101,9 @@ function createDebugLog(enabled) {
|
|
|
3102
3101
|
}
|
|
3103
3102
|
return (message, data) => {
|
|
3104
3103
|
if (data === void 0) {
|
|
3105
|
-
console.
|
|
3104
|
+
console.error(`[Zapier SDK CLI Login] ${message}`);
|
|
3106
3105
|
} else {
|
|
3107
|
-
console.
|
|
3106
|
+
console.error(`[Zapier SDK CLI Login] ${message}`, data);
|
|
3108
3107
|
}
|
|
3109
3108
|
};
|
|
3110
3109
|
}
|
|
@@ -3524,20 +3523,20 @@ var spinPromise = async (promise, text) => {
|
|
|
3524
3523
|
};
|
|
3525
3524
|
var log = {
|
|
3526
3525
|
info: (message, ...args) => {
|
|
3527
|
-
console.
|
|
3526
|
+
console.error(chalk.blue("\u2139"), message, ...args);
|
|
3528
3527
|
},
|
|
3529
3528
|
error: (message, ...args) => {
|
|
3530
3529
|
console.error(chalk.red("\u2716"), message, ...args);
|
|
3531
3530
|
},
|
|
3532
3531
|
success: (message, ...args) => {
|
|
3533
|
-
console.
|
|
3532
|
+
console.error(chalk.green("\u2713"), message, ...args);
|
|
3534
3533
|
},
|
|
3535
3534
|
warn: (message, ...args) => {
|
|
3536
|
-
console.
|
|
3535
|
+
console.error(chalk.yellow("\u26A0"), message, ...args);
|
|
3537
3536
|
},
|
|
3538
3537
|
debug: (message, ...args) => {
|
|
3539
3538
|
if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
|
|
3540
|
-
console.
|
|
3539
|
+
console.error(chalk.gray("\u{1F41B}"), message, ...args);
|
|
3541
3540
|
}
|
|
3542
3541
|
}
|
|
3543
3542
|
};
|
|
@@ -4126,7 +4125,8 @@ var BundleCodeSchema = z.object({
|
|
|
4126
4125
|
var bundleCodePlugin = definePlugin(
|
|
4127
4126
|
(sdk) => createPluginMethod(sdk, {
|
|
4128
4127
|
name: "bundleCode",
|
|
4129
|
-
categories: ["utility"
|
|
4128
|
+
categories: ["utility"],
|
|
4129
|
+
deprecation: { message: "bundleCode is no longer maintained." },
|
|
4130
4130
|
inputSchema: BundleCodeSchema,
|
|
4131
4131
|
handler: async ({ options }) => bundleCode(options)
|
|
4132
4132
|
})
|
|
@@ -4222,7 +4222,7 @@ async function detectTypesOutputDirectory() {
|
|
|
4222
4222
|
}
|
|
4223
4223
|
return "./zapier/apps/";
|
|
4224
4224
|
}
|
|
4225
|
-
var
|
|
4225
|
+
var addAppsPlugin = definePlugin(
|
|
4226
4226
|
(sdk) => createPluginMethod(sdk, {
|
|
4227
4227
|
name: "add",
|
|
4228
4228
|
categories: ["utility"],
|
|
@@ -5627,10 +5627,6 @@ var cliOverridesPlugin = definePlugin(
|
|
|
5627
5627
|
if (sdk.context.meta.fetch) {
|
|
5628
5628
|
meta.fetch = {
|
|
5629
5629
|
...sdk.context.meta.fetch,
|
|
5630
|
-
categories: [
|
|
5631
|
-
...sdk.context.meta.fetch.categories || [],
|
|
5632
|
-
"deprecated"
|
|
5633
|
-
],
|
|
5634
5630
|
deprecation: {
|
|
5635
5631
|
message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
|
|
5636
5632
|
}
|
|
@@ -6611,7 +6607,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
6611
6607
|
// package.json with { type: 'json' }
|
|
6612
6608
|
var package_default2 = {
|
|
6613
6609
|
name: "@zapier/zapier-sdk-cli",
|
|
6614
|
-
version: "0.52.
|
|
6610
|
+
version: "0.52.12"};
|
|
6615
6611
|
|
|
6616
6612
|
// src/sdk.ts
|
|
6617
6613
|
injectCliLogin(login_exports);
|
|
@@ -6620,21 +6616,21 @@ function createZapierCliSdk(options = {}) {
|
|
|
6620
6616
|
const extensionsContextPlugin = () => ({
|
|
6621
6617
|
context: { extensions }
|
|
6622
6618
|
});
|
|
6623
|
-
|
|
6619
|
+
const sdk = createZapierSdkStack$1({
|
|
6624
6620
|
...sdkOptions,
|
|
6625
6621
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
6626
6622
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
6627
|
-
}).
|
|
6623
|
+
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
|
|
6628
6624
|
for (const ext of extensions) {
|
|
6629
6625
|
try {
|
|
6630
|
-
|
|
6626
|
+
addPlugin$1(sdk, ext);
|
|
6631
6627
|
} catch (err) {
|
|
6632
6628
|
console.warn(
|
|
6633
6629
|
`Extension plugin failed to construct: ${err.message}; skipping.`
|
|
6634
6630
|
);
|
|
6635
6631
|
}
|
|
6636
6632
|
}
|
|
6637
|
-
return
|
|
6633
|
+
return sdk;
|
|
6638
6634
|
}
|
|
6639
6635
|
injectCliLogin$1(login_exports);
|
|
6640
6636
|
function createZapierCliSdk2(options = {}) {
|
|
@@ -6645,21 +6641,21 @@ function createZapierCliSdk2(options = {}) {
|
|
|
6645
6641
|
const experimentalContextPlugin = () => ({
|
|
6646
6642
|
context: { experimental: true }
|
|
6647
6643
|
});
|
|
6648
|
-
|
|
6644
|
+
const sdk = createZapierSdkStack({
|
|
6649
6645
|
...sdkOptions,
|
|
6650
6646
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
6651
6647
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
6652
|
-
}).
|
|
6648
|
+
}).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
|
|
6653
6649
|
for (const ext of extensions) {
|
|
6654
6650
|
try {
|
|
6655
|
-
|
|
6651
|
+
addPlugin(sdk, ext);
|
|
6656
6652
|
} catch (err) {
|
|
6657
6653
|
console.warn(
|
|
6658
6654
|
`Extension plugin failed to construct: ${err.message}; skipping.`
|
|
6659
6655
|
);
|
|
6660
6656
|
}
|
|
6661
6657
|
}
|
|
6662
|
-
return
|
|
6658
|
+
return sdk;
|
|
6663
6659
|
}
|
|
6664
6660
|
|
|
6665
6661
|
// src/utils/extensions.ts
|
|
@@ -6793,7 +6789,9 @@ async function checkForUpdates({
|
|
|
6793
6789
|
currentVersion
|
|
6794
6790
|
);
|
|
6795
6791
|
} catch (error) {
|
|
6796
|
-
|
|
6792
|
+
if (!(error instanceof VersionNotFoundError)) {
|
|
6793
|
+
log_default.debug(`Failed to check deprecation for current version: ${error}`);
|
|
6794
|
+
}
|
|
6797
6795
|
currentPackageInfo = latestPackageInfo;
|
|
6798
6796
|
}
|
|
6799
6797
|
const isDeprecated = Boolean(currentPackageInfo.deprecated);
|
package/dist/experimental.cjs
CHANGED
|
@@ -7,10 +7,10 @@ var fs = require('fs');
|
|
|
7
7
|
var crypto = require('crypto');
|
|
8
8
|
var path = require('path');
|
|
9
9
|
var lockfile = require('proper-lockfile');
|
|
10
|
+
var zapierSdk = require('@zapier/zapier-sdk');
|
|
10
11
|
var zod = require('zod');
|
|
11
12
|
var experimental = require('@zapier/zapier-sdk/experimental');
|
|
12
13
|
var os = require('os');
|
|
13
|
-
var zapierSdk = require('@zapier/zapier-sdk');
|
|
14
14
|
var inquirer = require('inquirer');
|
|
15
15
|
var open = require('open');
|
|
16
16
|
var express = require('express');
|
|
@@ -74,7 +74,7 @@ var login_exports = {};
|
|
|
74
74
|
__export(login_exports, {
|
|
75
75
|
AUTH_MODE_HEADER: () => AUTH_MODE_HEADER,
|
|
76
76
|
DEFAULT_AUTH_BASE_URL: () => DEFAULT_AUTH_BASE_URL,
|
|
77
|
-
ZapierAuthenticationError: () => ZapierAuthenticationError,
|
|
77
|
+
ZapierAuthenticationError: () => zapierSdk.ZapierAuthenticationError,
|
|
78
78
|
clearTokensFromKeychain: () => clearTokensFromKeychain,
|
|
79
79
|
createCache: () => createCache,
|
|
80
80
|
getActiveCredentials: () => getActiveCredentials,
|
|
@@ -478,12 +478,6 @@ async function deleteStoredClientCredentials({
|
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
// src/login/index.ts
|
|
481
|
-
var ZapierAuthenticationError = class extends Error {
|
|
482
|
-
constructor(message) {
|
|
483
|
-
super(message);
|
|
484
|
-
this.name = "ZapierAuthenticationError";
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
481
|
var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
|
|
488
482
|
var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
|
|
489
483
|
function createDebugLog(enabled) {
|
|
@@ -493,9 +487,9 @@ function createDebugLog(enabled) {
|
|
|
493
487
|
}
|
|
494
488
|
return (message, data) => {
|
|
495
489
|
if (data === void 0) {
|
|
496
|
-
console.
|
|
490
|
+
console.error(`[Zapier SDK CLI Login] ${message}`);
|
|
497
491
|
} else {
|
|
498
|
-
console.
|
|
492
|
+
console.error(`[Zapier SDK CLI Login] ${message}`, data);
|
|
499
493
|
}
|
|
500
494
|
};
|
|
501
495
|
}
|
|
@@ -741,7 +735,7 @@ async function getToken(options = {}) {
|
|
|
741
735
|
return await resolveOrRefreshToken(options);
|
|
742
736
|
} catch (error) {
|
|
743
737
|
const message = error instanceof Error ? error.message : "Token refresh failed";
|
|
744
|
-
throw new ZapierAuthenticationError(
|
|
738
|
+
throw new zapierSdk.ZapierAuthenticationError(
|
|
745
739
|
`${message}
|
|
746
740
|
Please run 'login' to authenticate again.`
|
|
747
741
|
);
|
|
@@ -943,20 +937,20 @@ var spinPromise = async (promise, text) => {
|
|
|
943
937
|
};
|
|
944
938
|
var log = {
|
|
945
939
|
info: (message, ...args) => {
|
|
946
|
-
console.
|
|
940
|
+
console.error(chalk3__default.default.blue("\u2139"), message, ...args);
|
|
947
941
|
},
|
|
948
942
|
error: (message, ...args) => {
|
|
949
943
|
console.error(chalk3__default.default.red("\u2716"), message, ...args);
|
|
950
944
|
},
|
|
951
945
|
success: (message, ...args) => {
|
|
952
|
-
console.
|
|
946
|
+
console.error(chalk3__default.default.green("\u2713"), message, ...args);
|
|
953
947
|
},
|
|
954
948
|
warn: (message, ...args) => {
|
|
955
|
-
console.
|
|
949
|
+
console.error(chalk3__default.default.yellow("\u26A0"), message, ...args);
|
|
956
950
|
},
|
|
957
951
|
debug: (message, ...args) => {
|
|
958
952
|
if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
|
|
959
|
-
console.
|
|
953
|
+
console.error(chalk3__default.default.gray("\u{1F41B}"), message, ...args);
|
|
960
954
|
}
|
|
961
955
|
}
|
|
962
956
|
};
|
|
@@ -1545,7 +1539,8 @@ var BundleCodeSchema = zod.z.object({
|
|
|
1545
1539
|
var bundleCodePlugin = zapierSdk.definePlugin(
|
|
1546
1540
|
(sdk) => zapierSdk.createPluginMethod(sdk, {
|
|
1547
1541
|
name: "bundleCode",
|
|
1548
|
-
categories: ["utility"
|
|
1542
|
+
categories: ["utility"],
|
|
1543
|
+
deprecation: { message: "bundleCode is no longer maintained." },
|
|
1549
1544
|
inputSchema: BundleCodeSchema,
|
|
1550
1545
|
handler: async ({ options }) => bundleCode(options)
|
|
1551
1546
|
})
|
|
@@ -1641,7 +1636,7 @@ async function detectTypesOutputDirectory() {
|
|
|
1641
1636
|
}
|
|
1642
1637
|
return "./zapier/apps/";
|
|
1643
1638
|
}
|
|
1644
|
-
var
|
|
1639
|
+
var addAppsPlugin = zapierSdk.definePlugin(
|
|
1645
1640
|
(sdk) => zapierSdk.createPluginMethod(sdk, {
|
|
1646
1641
|
name: "add",
|
|
1647
1642
|
categories: ["utility"],
|
|
@@ -3046,10 +3041,6 @@ var cliOverridesPlugin = zapierSdk.definePlugin(
|
|
|
3046
3041
|
if (sdk.context.meta.fetch) {
|
|
3047
3042
|
meta.fetch = {
|
|
3048
3043
|
...sdk.context.meta.fetch,
|
|
3049
|
-
categories: [
|
|
3050
|
-
...sdk.context.meta.fetch.categories || [],
|
|
3051
|
-
"deprecated"
|
|
3052
|
-
],
|
|
3053
3044
|
deprecation: {
|
|
3054
3045
|
message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
|
|
3055
3046
|
}
|
|
@@ -4013,7 +4004,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
4013
4004
|
// package.json with { type: 'json' }
|
|
4014
4005
|
var package_default = {
|
|
4015
4006
|
name: "@zapier/zapier-sdk-cli",
|
|
4016
|
-
version: "0.52.
|
|
4007
|
+
version: "0.52.12"};
|
|
4017
4008
|
|
|
4018
4009
|
// src/experimental.ts
|
|
4019
4010
|
experimental.injectCliLogin(login_exports);
|
|
@@ -4025,21 +4016,21 @@ function createZapierCliSdk(options = {}) {
|
|
|
4025
4016
|
const experimentalContextPlugin = () => ({
|
|
4026
4017
|
context: { experimental: true }
|
|
4027
4018
|
});
|
|
4028
|
-
|
|
4019
|
+
const sdk = experimental.createZapierSdkStack({
|
|
4029
4020
|
...sdkOptions,
|
|
4030
4021
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
4031
4022
|
callerPackage: { name: package_default.name, version: package_default.version }
|
|
4032
|
-
}).
|
|
4023
|
+
}).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
|
|
4033
4024
|
for (const ext of extensions) {
|
|
4034
4025
|
try {
|
|
4035
|
-
|
|
4026
|
+
experimental.addPlugin(sdk, ext);
|
|
4036
4027
|
} catch (err) {
|
|
4037
4028
|
console.warn(
|
|
4038
4029
|
`Extension plugin failed to construct: ${err.message}; skipping.`
|
|
4039
4030
|
);
|
|
4040
4031
|
}
|
|
4041
4032
|
}
|
|
4042
|
-
return
|
|
4033
|
+
return sdk;
|
|
4043
4034
|
}
|
|
4044
4035
|
|
|
4045
4036
|
exports.createZapierCliSdk = createZapierCliSdk;
|
package/dist/experimental.d.mts
CHANGED
package/dist/experimental.d.ts
CHANGED