@zapier/zapier-sdk-cli 0.59.2 → 0.59.3
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 +14 -0
- package/dist/cli.cjs +51 -36
- package/dist/cli.mjs +53 -38
- package/dist/experimental.cjs +11 -3
- package/dist/experimental.mjs +12 -4
- package/dist/index.cjs +12 -4
- package/dist/index.mjs +13 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.59.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b8ff1dd: Refactor the SDKs onto kitcore's new internal plugin model.
|
|
8
|
+
|
|
9
|
+
kitcore (an internal building block) gained a new plugin model, and the SDKs were rebuilt on it behind a compatibility bridge, so existing behavior is unchanged. The only changes to the published packages' surface:
|
|
10
|
+
- Removed the deprecated `sdk.addPlugin(...)` chain method (and the `WithAddPlugin` type / chain-style no-arg `createSdk()` doorway). Extend a built SDK with the top-level `addPlugin(sdk, plugin)` instead.
|
|
11
|
+
- `@zapier/zapier-sdk` now re-exports the plugin-authoring helpers (`createSdk`, `defineMethod` / `definePlugin` / `declareMethod` / etc., `selectExports`, `addPlugin`). Note `createSdk` reuses the old doorway's name but now takes a root plugin, so a stale no-arg `createSdk()` call is a compile error rather than silent misbehavior.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [b8ff1dd]
|
|
14
|
+
- @zapier/zapier-sdk@0.78.0
|
|
15
|
+
- @zapier/zapier-sdk-mcp@0.15.3
|
|
16
|
+
|
|
3
17
|
## 0.59.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cli.cjs
CHANGED
|
@@ -183,18 +183,20 @@ function coerceToSchemaType(value, schema) {
|
|
|
183
183
|
return value;
|
|
184
184
|
}
|
|
185
185
|
function renderChoiceLabel(choice) {
|
|
186
|
+
const baseName = choice.label ?? choice.name ?? "";
|
|
187
|
+
const alreadyNamed = choice.name === baseName;
|
|
186
188
|
let effectiveHint = choice.hint;
|
|
187
189
|
if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
|
|
188
190
|
effectiveHint = String(choice.value);
|
|
189
191
|
}
|
|
190
192
|
if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
|
|
191
|
-
return choice;
|
|
193
|
+
return alreadyNamed ? choice : { ...choice, name: baseName };
|
|
192
194
|
}
|
|
193
195
|
const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
|
|
194
|
-
if (hintText ===
|
|
195
|
-
return choice;
|
|
196
|
+
if (hintText === baseName) {
|
|
197
|
+
return alreadyNamed ? choice : { ...choice, name: baseName };
|
|
196
198
|
}
|
|
197
|
-
return { ...choice, name: `${
|
|
199
|
+
return { ...choice, name: `${baseName} ${chalk__default.default.dim(`(${hintText})`)}` };
|
|
198
200
|
}
|
|
199
201
|
var SchemaParameterResolver = class {
|
|
200
202
|
constructor() {
|
|
@@ -792,8 +794,9 @@ var SchemaParameterResolver = class {
|
|
|
792
794
|
context.resolvedParams
|
|
793
795
|
);
|
|
794
796
|
promptConfig.name = promptName;
|
|
797
|
+
const renderedChoices = promptConfig.choices ? promptConfig.choices.map(renderChoiceLabel) : [];
|
|
795
798
|
if (promptConfig.choices) {
|
|
796
|
-
promptConfig.choices =
|
|
799
|
+
promptConfig.choices = renderedChoices;
|
|
797
800
|
}
|
|
798
801
|
const hasSelectableChoice = promptConfig.choices?.some(
|
|
799
802
|
(c) => !c.disabled
|
|
@@ -819,7 +822,7 @@ var SchemaParameterResolver = class {
|
|
|
819
822
|
}
|
|
820
823
|
let selected;
|
|
821
824
|
if (promptConfig.type === "list") {
|
|
822
|
-
const dataChoices =
|
|
825
|
+
const dataChoices = renderedChoices;
|
|
823
826
|
selected = await search__default.default({
|
|
824
827
|
message: promptConfig.message,
|
|
825
828
|
validate: this.wrapPromptValidate(promptConfig.validate),
|
|
@@ -1576,7 +1579,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1576
1579
|
|
|
1577
1580
|
// package.json
|
|
1578
1581
|
var package_default = {
|
|
1579
|
-
version: "0.59.
|
|
1582
|
+
version: "0.59.3"};
|
|
1580
1583
|
|
|
1581
1584
|
// src/telemetry/builders.ts
|
|
1582
1585
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1649,19 +1652,11 @@ function formatJsonOutput(data) {
|
|
|
1649
1652
|
}
|
|
1650
1653
|
async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, options) {
|
|
1651
1654
|
if (options?.formatter) {
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
context = await options.formatter.fetch(
|
|
1656
|
-
options.sdk,
|
|
1657
|
-
options.params,
|
|
1658
|
-
item,
|
|
1659
|
-
context
|
|
1660
|
-
);
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1655
|
+
const formatter = options.formatter;
|
|
1656
|
+
const input = options.input ?? {};
|
|
1657
|
+
const context = formatter.fetchContext ? await formatter.fetchContext({ items, input }) : void 0;
|
|
1663
1658
|
items.forEach((item, index) => {
|
|
1664
|
-
const formatted =
|
|
1659
|
+
const formatted = formatter.format({ item, input, context });
|
|
1665
1660
|
formatSingleItem(formatted, startingNumber + index);
|
|
1666
1661
|
});
|
|
1667
1662
|
return;
|
|
@@ -1671,13 +1666,19 @@ async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, o
|
|
|
1671
1666
|
function formatSingleItem(formatted, itemNumber) {
|
|
1672
1667
|
let titleLine = `${chalk__default.default.gray(`${itemNumber + 1}.`)} ${chalk__default.default.cyan(formatted.title)}`;
|
|
1673
1668
|
const subtitleParts = [];
|
|
1674
|
-
if (formatted.
|
|
1675
|
-
subtitleParts.push(
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
|
|
1669
|
+
if (formatted.hint !== void 0) {
|
|
1670
|
+
subtitleParts.push(
|
|
1671
|
+
...Array.isArray(formatted.hint) ? formatted.hint : [formatted.hint]
|
|
1672
|
+
);
|
|
1673
|
+
} else {
|
|
1674
|
+
if (formatted.keys) {
|
|
1675
|
+
subtitleParts.push(...formatted.keys);
|
|
1676
|
+
} else if (formatted.key) {
|
|
1677
|
+
subtitleParts.push(formatted.key);
|
|
1678
|
+
}
|
|
1679
|
+
if (formatted.id) {
|
|
1680
|
+
subtitleParts.push(formatted.id);
|
|
1681
|
+
}
|
|
1681
1682
|
}
|
|
1682
1683
|
const uniqueParts = [...new Set(subtitleParts)];
|
|
1683
1684
|
if (uniqueParts.length > 0) {
|
|
@@ -1687,8 +1688,8 @@ function formatSingleItem(formatted, itemNumber) {
|
|
|
1687
1688
|
if (formatted.description) {
|
|
1688
1689
|
console.log(` ${chalk__default.default.dim(formatted.description)}`);
|
|
1689
1690
|
}
|
|
1690
|
-
if (formatted.
|
|
1691
|
-
formatJsonOutput(formatted.
|
|
1691
|
+
if (formatted.raw !== void 0) {
|
|
1692
|
+
formatJsonOutput(formatted.raw);
|
|
1692
1693
|
console.log();
|
|
1693
1694
|
return;
|
|
1694
1695
|
}
|
|
@@ -1874,8 +1875,7 @@ function createInteractiveRenderer(context = {}) {
|
|
|
1874
1875
|
startingNumber,
|
|
1875
1876
|
{
|
|
1876
1877
|
formatter: functionInfo.formatter,
|
|
1877
|
-
|
|
1878
|
-
params: context.params
|
|
1878
|
+
input: context.params
|
|
1879
1879
|
}
|
|
1880
1880
|
);
|
|
1881
1881
|
} else {
|
|
@@ -2428,7 +2428,6 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2428
2428
|
const options = commandObj.opts();
|
|
2429
2429
|
const interactiveMode = !options.json;
|
|
2430
2430
|
const renderer = interactiveMode ? createInteractiveRenderer({
|
|
2431
|
-
sdk,
|
|
2432
2431
|
params: resolvedParams
|
|
2433
2432
|
}) : createJsonRenderer();
|
|
2434
2433
|
try {
|
|
@@ -7267,7 +7266,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
7267
7266
|
// package.json with { type: 'json' }
|
|
7268
7267
|
var package_default2 = {
|
|
7269
7268
|
name: "@zapier/zapier-sdk-cli",
|
|
7270
|
-
version: "0.59.
|
|
7269
|
+
version: "0.59.3"};
|
|
7271
7270
|
|
|
7272
7271
|
// src/sdk.ts
|
|
7273
7272
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -7276,11 +7275,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
7276
7275
|
const extensionsContextPlugin = () => ({
|
|
7277
7276
|
context: { extensions }
|
|
7278
7277
|
});
|
|
7279
|
-
const
|
|
7278
|
+
const stack = zapierSdk.createZapierSdkStack({
|
|
7280
7279
|
...sdkOptions,
|
|
7281
7280
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
7282
7281
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
7283
|
-
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
7282
|
+
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
7283
|
+
const sdk = zapierSdk.createSdk(
|
|
7284
|
+
zapierSdk.defineLegacyMerge({
|
|
7285
|
+
namespace: "zapier",
|
|
7286
|
+
name: "cli-stack-merge",
|
|
7287
|
+
legacy: stack.toPlugin(),
|
|
7288
|
+
plugin: zapierSdk.zapierSdkPlugin
|
|
7289
|
+
})
|
|
7290
|
+
);
|
|
7284
7291
|
for (const ext of extensions) {
|
|
7285
7292
|
try {
|
|
7286
7293
|
zapierSdk.addPlugin(sdk, ext);
|
|
@@ -7301,11 +7308,19 @@ function createZapierCliSdk2(options = {}) {
|
|
|
7301
7308
|
const experimentalContextPlugin = () => ({
|
|
7302
7309
|
context: { experimental: true }
|
|
7303
7310
|
});
|
|
7304
|
-
const
|
|
7311
|
+
const stack = experimental.createZapierSdkStack({
|
|
7305
7312
|
...sdkOptions,
|
|
7306
7313
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
7307
7314
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
7308
|
-
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
7315
|
+
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
7316
|
+
const sdk = experimental.createSdk(
|
|
7317
|
+
experimental.defineLegacyMerge({
|
|
7318
|
+
namespace: "zapier",
|
|
7319
|
+
name: "cli-experimental-stack-merge",
|
|
7320
|
+
legacy: stack.toPlugin(),
|
|
7321
|
+
plugin: experimental.zapierSdkPlugin
|
|
7322
|
+
})
|
|
7323
|
+
);
|
|
7309
7324
|
for (const ext of extensions) {
|
|
7310
7325
|
try {
|
|
7311
7326
|
experimental.addPlugin(sdk, ext);
|
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, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, createZapierSdkStack as createZapierSdkStack$1, addPlugin as addPlugin$1, ZapierError, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, runWithCallerContext, isPositional, runWithTelemetryContext, buildCapabilityMessage, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, ZapierApprovalError } from '@zapier/zapier-sdk';
|
|
4
|
+
import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, BaseSdkOptionsSchema, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, createZapierSdkStack as createZapierSdkStack$1, createSdk as createSdk$1, defineLegacyMerge as defineLegacyMerge$1, zapierSdkPlugin as zapierSdkPlugin$1, addPlugin as addPlugin$1, ZapierError, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, runWithCallerContext, isPositional, runWithTelemetryContext, buildCapabilityMessage, formatErrorMessage, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId, ZapierApprovalError } from '@zapier/zapier-sdk';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import search from '@inquirer/search';
|
|
7
7
|
import chalk from 'chalk';
|
|
@@ -30,7 +30,7 @@ import isInstalledGlobally from 'is-installed-globally';
|
|
|
30
30
|
import { execSync, spawn } from 'child_process';
|
|
31
31
|
import Handlebars from 'handlebars';
|
|
32
32
|
import { fileURLToPath } from 'url';
|
|
33
|
-
import { injectCliLogin as injectCliLogin$1, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
|
|
33
|
+
import { injectCliLogin as injectCliLogin$1, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin } from '@zapier/zapier-sdk/experimental';
|
|
34
34
|
import packageJsonLib, { VersionNotFoundError } from 'package-json';
|
|
35
35
|
import semver from 'semver';
|
|
36
36
|
import React from 'react';
|
|
@@ -140,18 +140,20 @@ function coerceToSchemaType(value, schema) {
|
|
|
140
140
|
return value;
|
|
141
141
|
}
|
|
142
142
|
function renderChoiceLabel(choice) {
|
|
143
|
+
const baseName = choice.label ?? choice.name ?? "";
|
|
144
|
+
const alreadyNamed = choice.name === baseName;
|
|
143
145
|
let effectiveHint = choice.hint;
|
|
144
146
|
if (effectiveHint === void 0 && (typeof choice.value === "string" || typeof choice.value === "number")) {
|
|
145
147
|
effectiveHint = String(choice.value);
|
|
146
148
|
}
|
|
147
149
|
if (!effectiveHint || Array.isArray(effectiveHint) && effectiveHint.length === 0) {
|
|
148
|
-
return choice;
|
|
150
|
+
return alreadyNamed ? choice : { ...choice, name: baseName };
|
|
149
151
|
}
|
|
150
152
|
const hintText = Array.isArray(effectiveHint) ? effectiveHint.join(", ") : effectiveHint;
|
|
151
|
-
if (hintText ===
|
|
152
|
-
return choice;
|
|
153
|
+
if (hintText === baseName) {
|
|
154
|
+
return alreadyNamed ? choice : { ...choice, name: baseName };
|
|
153
155
|
}
|
|
154
|
-
return { ...choice, name: `${
|
|
156
|
+
return { ...choice, name: `${baseName} ${chalk.dim(`(${hintText})`)}` };
|
|
155
157
|
}
|
|
156
158
|
var SchemaParameterResolver = class {
|
|
157
159
|
constructor() {
|
|
@@ -749,8 +751,9 @@ var SchemaParameterResolver = class {
|
|
|
749
751
|
context.resolvedParams
|
|
750
752
|
);
|
|
751
753
|
promptConfig.name = promptName;
|
|
754
|
+
const renderedChoices = promptConfig.choices ? promptConfig.choices.map(renderChoiceLabel) : [];
|
|
752
755
|
if (promptConfig.choices) {
|
|
753
|
-
promptConfig.choices =
|
|
756
|
+
promptConfig.choices = renderedChoices;
|
|
754
757
|
}
|
|
755
758
|
const hasSelectableChoice = promptConfig.choices?.some(
|
|
756
759
|
(c) => !c.disabled
|
|
@@ -776,7 +779,7 @@ var SchemaParameterResolver = class {
|
|
|
776
779
|
}
|
|
777
780
|
let selected;
|
|
778
781
|
if (promptConfig.type === "list") {
|
|
779
|
-
const dataChoices =
|
|
782
|
+
const dataChoices = renderedChoices;
|
|
780
783
|
selected = await search({
|
|
781
784
|
message: promptConfig.message,
|
|
782
785
|
validate: this.wrapPromptValidate(promptConfig.validate),
|
|
@@ -1533,7 +1536,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
1533
1536
|
|
|
1534
1537
|
// package.json
|
|
1535
1538
|
var package_default = {
|
|
1536
|
-
version: "0.59.
|
|
1539
|
+
version: "0.59.3"};
|
|
1537
1540
|
|
|
1538
1541
|
// src/telemetry/builders.ts
|
|
1539
1542
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1606,19 +1609,11 @@ function formatJsonOutput(data) {
|
|
|
1606
1609
|
}
|
|
1607
1610
|
async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, options) {
|
|
1608
1611
|
if (options?.formatter) {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
context = await options.formatter.fetch(
|
|
1613
|
-
options.sdk,
|
|
1614
|
-
options.params,
|
|
1615
|
-
item,
|
|
1616
|
-
context
|
|
1617
|
-
);
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1612
|
+
const formatter = options.formatter;
|
|
1613
|
+
const input = options.input ?? {};
|
|
1614
|
+
const context = formatter.fetchContext ? await formatter.fetchContext({ items, input }) : void 0;
|
|
1620
1615
|
items.forEach((item, index) => {
|
|
1621
|
-
const formatted =
|
|
1616
|
+
const formatted = formatter.format({ item, input, context });
|
|
1622
1617
|
formatSingleItem(formatted, startingNumber + index);
|
|
1623
1618
|
});
|
|
1624
1619
|
return;
|
|
@@ -1628,13 +1623,19 @@ async function formatItemsFromSchema(_functionInfo, items, startingNumber = 0, o
|
|
|
1628
1623
|
function formatSingleItem(formatted, itemNumber) {
|
|
1629
1624
|
let titleLine = `${chalk.gray(`${itemNumber + 1}.`)} ${chalk.cyan(formatted.title)}`;
|
|
1630
1625
|
const subtitleParts = [];
|
|
1631
|
-
if (formatted.
|
|
1632
|
-
subtitleParts.push(
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1626
|
+
if (formatted.hint !== void 0) {
|
|
1627
|
+
subtitleParts.push(
|
|
1628
|
+
...Array.isArray(formatted.hint) ? formatted.hint : [formatted.hint]
|
|
1629
|
+
);
|
|
1630
|
+
} else {
|
|
1631
|
+
if (formatted.keys) {
|
|
1632
|
+
subtitleParts.push(...formatted.keys);
|
|
1633
|
+
} else if (formatted.key) {
|
|
1634
|
+
subtitleParts.push(formatted.key);
|
|
1635
|
+
}
|
|
1636
|
+
if (formatted.id) {
|
|
1637
|
+
subtitleParts.push(formatted.id);
|
|
1638
|
+
}
|
|
1638
1639
|
}
|
|
1639
1640
|
const uniqueParts = [...new Set(subtitleParts)];
|
|
1640
1641
|
if (uniqueParts.length > 0) {
|
|
@@ -1644,8 +1645,8 @@ function formatSingleItem(formatted, itemNumber) {
|
|
|
1644
1645
|
if (formatted.description) {
|
|
1645
1646
|
console.log(` ${chalk.dim(formatted.description)}`);
|
|
1646
1647
|
}
|
|
1647
|
-
if (formatted.
|
|
1648
|
-
formatJsonOutput(formatted.
|
|
1648
|
+
if (formatted.raw !== void 0) {
|
|
1649
|
+
formatJsonOutput(formatted.raw);
|
|
1649
1650
|
console.log();
|
|
1650
1651
|
return;
|
|
1651
1652
|
}
|
|
@@ -1831,8 +1832,7 @@ function createInteractiveRenderer(context = {}) {
|
|
|
1831
1832
|
startingNumber,
|
|
1832
1833
|
{
|
|
1833
1834
|
formatter: functionInfo.formatter,
|
|
1834
|
-
|
|
1835
|
-
params: context.params
|
|
1835
|
+
input: context.params
|
|
1836
1836
|
}
|
|
1837
1837
|
);
|
|
1838
1838
|
} else {
|
|
@@ -2385,7 +2385,6 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
2385
2385
|
const options = commandObj.opts();
|
|
2386
2386
|
const interactiveMode = !options.json;
|
|
2387
2387
|
const renderer = interactiveMode ? createInteractiveRenderer({
|
|
2388
|
-
sdk,
|
|
2389
2388
|
params: resolvedParams
|
|
2390
2389
|
}) : createJsonRenderer();
|
|
2391
2390
|
try {
|
|
@@ -7224,7 +7223,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
7224
7223
|
// package.json with { type: 'json' }
|
|
7225
7224
|
var package_default2 = {
|
|
7226
7225
|
name: "@zapier/zapier-sdk-cli",
|
|
7227
|
-
version: "0.59.
|
|
7226
|
+
version: "0.59.3"};
|
|
7228
7227
|
|
|
7229
7228
|
// src/sdk.ts
|
|
7230
7229
|
injectCliLogin(login_exports);
|
|
@@ -7233,11 +7232,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
7233
7232
|
const extensionsContextPlugin = () => ({
|
|
7234
7233
|
context: { extensions }
|
|
7235
7234
|
});
|
|
7236
|
-
const
|
|
7235
|
+
const stack = createZapierSdkStack$1({
|
|
7237
7236
|
...sdkOptions,
|
|
7238
7237
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
7239
7238
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
7240
|
-
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
7239
|
+
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
7240
|
+
const sdk = createSdk$1(
|
|
7241
|
+
defineLegacyMerge$1({
|
|
7242
|
+
namespace: "zapier",
|
|
7243
|
+
name: "cli-stack-merge",
|
|
7244
|
+
legacy: stack.toPlugin(),
|
|
7245
|
+
plugin: zapierSdkPlugin$1
|
|
7246
|
+
})
|
|
7247
|
+
);
|
|
7241
7248
|
for (const ext of extensions) {
|
|
7242
7249
|
try {
|
|
7243
7250
|
addPlugin$1(sdk, ext);
|
|
@@ -7258,11 +7265,19 @@ function createZapierCliSdk2(options = {}) {
|
|
|
7258
7265
|
const experimentalContextPlugin = () => ({
|
|
7259
7266
|
context: { experimental: true }
|
|
7260
7267
|
});
|
|
7261
|
-
const
|
|
7268
|
+
const stack = createZapierSdkStack({
|
|
7262
7269
|
...sdkOptions,
|
|
7263
7270
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
7264
7271
|
callerPackage: { name: package_default2.name, version: package_default2.version }
|
|
7265
|
-
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
7272
|
+
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
7273
|
+
const sdk = createSdk(
|
|
7274
|
+
defineLegacyMerge({
|
|
7275
|
+
namespace: "zapier",
|
|
7276
|
+
name: "cli-experimental-stack-merge",
|
|
7277
|
+
legacy: stack.toPlugin(),
|
|
7278
|
+
plugin: zapierSdkPlugin
|
|
7279
|
+
})
|
|
7280
|
+
);
|
|
7266
7281
|
for (const ext of extensions) {
|
|
7267
7282
|
try {
|
|
7268
7283
|
addPlugin(sdk, ext);
|
package/dist/experimental.cjs
CHANGED
|
@@ -4594,7 +4594,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
4594
4594
|
// package.json with { type: 'json' }
|
|
4595
4595
|
var package_default = {
|
|
4596
4596
|
name: "@zapier/zapier-sdk-cli",
|
|
4597
|
-
version: "0.59.
|
|
4597
|
+
version: "0.59.3"};
|
|
4598
4598
|
|
|
4599
4599
|
// src/experimental.ts
|
|
4600
4600
|
experimental.injectCliLogin(login_exports);
|
|
@@ -4606,11 +4606,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
4606
4606
|
const experimentalContextPlugin = () => ({
|
|
4607
4607
|
context: { experimental: true }
|
|
4608
4608
|
});
|
|
4609
|
-
const
|
|
4609
|
+
const stack = experimental.createZapierSdkStack({
|
|
4610
4610
|
...sdkOptions,
|
|
4611
4611
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
4612
4612
|
callerPackage: { name: package_default.name, version: package_default.version }
|
|
4613
|
-
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
4613
|
+
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
4614
|
+
const sdk = experimental.createSdk(
|
|
4615
|
+
experimental.defineLegacyMerge({
|
|
4616
|
+
namespace: "zapier",
|
|
4617
|
+
name: "cli-experimental-stack-merge",
|
|
4618
|
+
legacy: stack.toPlugin(),
|
|
4619
|
+
plugin: experimental.zapierSdkPlugin
|
|
4620
|
+
})
|
|
4621
|
+
);
|
|
4614
4622
|
for (const ext of extensions) {
|
|
4615
4623
|
try {
|
|
4616
4624
|
experimental.addPlugin(sdk, ext);
|
package/dist/experimental.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { resolve, join, dirname, basename, relative, extname } from 'path';
|
|
|
9
9
|
import * as lockfile from 'proper-lockfile';
|
|
10
10
|
import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError } from '@zapier/zapier-sdk';
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { injectCliLogin, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
|
|
12
|
+
import { injectCliLogin, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin } from '@zapier/zapier-sdk/experimental';
|
|
13
13
|
import { hostname } from 'os';
|
|
14
14
|
import inquirer from 'inquirer';
|
|
15
15
|
import express from 'express';
|
|
@@ -4558,7 +4558,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
4558
4558
|
// package.json with { type: 'json' }
|
|
4559
4559
|
var package_default = {
|
|
4560
4560
|
name: "@zapier/zapier-sdk-cli",
|
|
4561
|
-
version: "0.59.
|
|
4561
|
+
version: "0.59.3"};
|
|
4562
4562
|
|
|
4563
4563
|
// src/experimental.ts
|
|
4564
4564
|
injectCliLogin(login_exports);
|
|
@@ -4570,11 +4570,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
4570
4570
|
const experimentalContextPlugin = () => ({
|
|
4571
4571
|
context: { experimental: true }
|
|
4572
4572
|
});
|
|
4573
|
-
const
|
|
4573
|
+
const stack = createZapierSdkStack({
|
|
4574
4574
|
...sdkOptions,
|
|
4575
4575
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
4576
4576
|
callerPackage: { name: package_default.name, version: package_default.version }
|
|
4577
|
-
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
4577
|
+
}).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(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
4578
|
+
const sdk = createSdk(
|
|
4579
|
+
defineLegacyMerge({
|
|
4580
|
+
namespace: "zapier",
|
|
4581
|
+
name: "cli-experimental-stack-merge",
|
|
4582
|
+
legacy: stack.toPlugin(),
|
|
4583
|
+
plugin: zapierSdkPlugin
|
|
4584
|
+
})
|
|
4585
|
+
);
|
|
4578
4586
|
for (const ext of extensions) {
|
|
4579
4587
|
try {
|
|
4580
4588
|
addPlugin(sdk, ext);
|
package/dist/index.cjs
CHANGED
|
@@ -4593,7 +4593,7 @@ zapierSdk.definePlugin(
|
|
|
4593
4593
|
// package.json with { type: 'json' }
|
|
4594
4594
|
var package_default = {
|
|
4595
4595
|
name: "@zapier/zapier-sdk-cli",
|
|
4596
|
-
version: "0.59.
|
|
4596
|
+
version: "0.59.3"};
|
|
4597
4597
|
|
|
4598
4598
|
// src/sdk.ts
|
|
4599
4599
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -4602,11 +4602,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
4602
4602
|
const extensionsContextPlugin = () => ({
|
|
4603
4603
|
context: { extensions }
|
|
4604
4604
|
});
|
|
4605
|
-
const
|
|
4605
|
+
const stack = zapierSdk.createZapierSdkStack({
|
|
4606
4606
|
...sdkOptions,
|
|
4607
4607
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
4608
4608
|
callerPackage: { name: package_default.name, version: package_default.version }
|
|
4609
|
-
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
4609
|
+
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
4610
|
+
const sdk = zapierSdk.createSdk(
|
|
4611
|
+
zapierSdk.defineLegacyMerge({
|
|
4612
|
+
namespace: "zapier",
|
|
4613
|
+
name: "cli-stack-merge",
|
|
4614
|
+
legacy: stack.toPlugin(),
|
|
4615
|
+
plugin: zapierSdk.zapierSdkPlugin
|
|
4616
|
+
})
|
|
4617
|
+
);
|
|
4610
4618
|
for (const ext of extensions) {
|
|
4611
4619
|
try {
|
|
4612
4620
|
zapierSdk.addPlugin(sdk, ext);
|
|
@@ -4621,7 +4629,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
4621
4629
|
|
|
4622
4630
|
// package.json
|
|
4623
4631
|
var package_default2 = {
|
|
4624
|
-
version: "0.59.
|
|
4632
|
+
version: "0.59.3"};
|
|
4625
4633
|
|
|
4626
4634
|
// src/telemetry/builders.ts
|
|
4627
4635
|
function createCliBaseEvent(context = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import crypto, { createHash } from 'crypto';
|
|
|
7
7
|
import * as path from 'path';
|
|
8
8
|
import { resolve, join, dirname, basename, relative, extname } from 'path';
|
|
9
9
|
import * as lockfile from 'proper-lockfile';
|
|
10
|
-
import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError, createZapierSdkStack, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
|
|
10
|
+
import { definePlugin, createPluginMethod, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, getOrCreateApiClient, isPermanentHttpError, invalidateCachedToken, batch, toSnakeCase, ZapierAbortDrainSignal, isCredentialsObject, buildApplicationLifecycleEvent, AuthMechanism, ZapierAuthenticationError, ZapierError, createZapierSdkStack, createSdk, defineLegacyMerge, zapierSdkPlugin, addPlugin, getOsInfo, getPlatformVersions, getAgent, getTtyContext, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { hostname } from 'os';
|
|
13
13
|
import inquirer from 'inquirer';
|
|
@@ -4557,7 +4557,7 @@ definePlugin(
|
|
|
4557
4557
|
// package.json with { type: 'json' }
|
|
4558
4558
|
var package_default = {
|
|
4559
4559
|
name: "@zapier/zapier-sdk-cli",
|
|
4560
|
-
version: "0.59.
|
|
4560
|
+
version: "0.59.3"};
|
|
4561
4561
|
|
|
4562
4562
|
// src/sdk.ts
|
|
4563
4563
|
injectCliLogin(login_exports);
|
|
@@ -4566,11 +4566,19 @@ function createZapierCliSdk(options = {}) {
|
|
|
4566
4566
|
const extensionsContextPlugin = () => ({
|
|
4567
4567
|
context: { extensions }
|
|
4568
4568
|
});
|
|
4569
|
-
const
|
|
4569
|
+
const stack = createZapierSdkStack({
|
|
4570
4570
|
...sdkOptions,
|
|
4571
4571
|
eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
|
|
4572
4572
|
callerPackage: { name: package_default.name, version: package_default.version }
|
|
4573
|
-
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true })
|
|
4573
|
+
}).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(signupPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true });
|
|
4574
|
+
const sdk = createSdk(
|
|
4575
|
+
defineLegacyMerge({
|
|
4576
|
+
namespace: "zapier",
|
|
4577
|
+
name: "cli-stack-merge",
|
|
4578
|
+
legacy: stack.toPlugin(),
|
|
4579
|
+
plugin: zapierSdkPlugin
|
|
4580
|
+
})
|
|
4581
|
+
);
|
|
4574
4582
|
for (const ext of extensions) {
|
|
4575
4583
|
try {
|
|
4576
4584
|
addPlugin(sdk, ext);
|
|
@@ -4585,7 +4593,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
4585
4593
|
|
|
4586
4594
|
// package.json
|
|
4587
4595
|
var package_default2 = {
|
|
4588
|
-
version: "0.59.
|
|
4596
|
+
version: "0.59.3"};
|
|
4589
4597
|
|
|
4590
4598
|
// src/telemetry/builders.ts
|
|
4591
4599
|
function createCliBaseEvent(context = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.3",
|
|
4
4
|
"description": "Command line interface for Zapier SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"typescript": "^5.8.3",
|
|
96
96
|
"wrap-ansi": "^10.0.0",
|
|
97
97
|
"zod": "4.3.6",
|
|
98
|
-
"@zapier/zapier-sdk": "0.
|
|
99
|
-
"@zapier/zapier-sdk-mcp": "0.15.
|
|
98
|
+
"@zapier/zapier-sdk": "0.78.0",
|
|
99
|
+
"@zapier/zapier-sdk-mcp": "0.15.3"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@types/express": "^5.0.3",
|