@zapier/zapier-sdk-cli 0.48.1 → 0.49.0
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 +30 -0
- package/README.md +20 -0
- package/dist/cli.cjs +562 -191
- package/dist/cli.mjs +560 -190
- package/dist/experimental.cjs +1 -1
- package/dist/experimental.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/package.json +2 -1
- package/dist/src/utils/parameter-resolver.d.ts +91 -1
- package/dist/src/utils/parameter-resolver.js +593 -120
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
package/dist/experimental.cjs
CHANGED
|
@@ -3963,7 +3963,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
|
|
|
3963
3963
|
// package.json with { type: 'json' }
|
|
3964
3964
|
var package_default = {
|
|
3965
3965
|
name: "@zapier/zapier-sdk-cli",
|
|
3966
|
-
version: "0.
|
|
3966
|
+
version: "0.49.0"};
|
|
3967
3967
|
|
|
3968
3968
|
// src/experimental.ts
|
|
3969
3969
|
experimental.injectCliLogin(login_exports);
|
package/dist/experimental.mjs
CHANGED
|
@@ -3927,7 +3927,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
|
|
|
3927
3927
|
// package.json with { type: 'json' }
|
|
3928
3928
|
var package_default = {
|
|
3929
3929
|
name: "@zapier/zapier-sdk-cli",
|
|
3930
|
-
version: "0.
|
|
3930
|
+
version: "0.49.0"};
|
|
3931
3931
|
|
|
3932
3932
|
// src/experimental.ts
|
|
3933
3933
|
injectCliLogin(login_exports);
|
package/dist/index.cjs
CHANGED
|
@@ -3962,7 +3962,7 @@ zapierSdk.definePlugin(
|
|
|
3962
3962
|
// package.json with { type: 'json' }
|
|
3963
3963
|
var package_default = {
|
|
3964
3964
|
name: "@zapier/zapier-sdk-cli",
|
|
3965
|
-
version: "0.
|
|
3965
|
+
version: "0.49.0"};
|
|
3966
3966
|
|
|
3967
3967
|
// src/sdk.ts
|
|
3968
3968
|
zapierSdk.injectCliLogin(login_exports);
|
|
@@ -3990,7 +3990,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
3990
3990
|
|
|
3991
3991
|
// package.json
|
|
3992
3992
|
var package_default2 = {
|
|
3993
|
-
version: "0.
|
|
3993
|
+
version: "0.49.0"};
|
|
3994
3994
|
|
|
3995
3995
|
// src/telemetry/builders.ts
|
|
3996
3996
|
function createCliBaseEvent(context = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -3926,7 +3926,7 @@ definePlugin(
|
|
|
3926
3926
|
// package.json with { type: 'json' }
|
|
3927
3927
|
var package_default = {
|
|
3928
3928
|
name: "@zapier/zapier-sdk-cli",
|
|
3929
|
-
version: "0.
|
|
3929
|
+
version: "0.49.0"};
|
|
3930
3930
|
|
|
3931
3931
|
// src/sdk.ts
|
|
3932
3932
|
injectCliLogin(login_exports);
|
|
@@ -3954,7 +3954,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
3954
3954
|
|
|
3955
3955
|
// package.json
|
|
3956
3956
|
var package_default2 = {
|
|
3957
|
-
version: "0.
|
|
3957
|
+
version: "0.49.0"};
|
|
3958
3958
|
|
|
3959
3959
|
// src/telemetry/builders.ts
|
|
3960
3960
|
function createCliBaseEvent(context = {}) {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "Command line interface for Zapier SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
+
"@inquirer/search": "^3.2.2",
|
|
81
82
|
"@zapier/zapier-sdk": "workspace:*",
|
|
82
83
|
"@zapier/zapier-sdk-mcp": "workspace:*",
|
|
83
84
|
"chalk": "^5.3.0",
|
|
@@ -25,7 +25,94 @@ export declare class SchemaParameterResolver {
|
|
|
25
25
|
* throws ZapierCliMissingParametersError for anything that requires user input.
|
|
26
26
|
*/
|
|
27
27
|
private resolveRequiredParamsNonInteractive;
|
|
28
|
+
/**
|
|
29
|
+
* Wrap a PromptConfig.validate so internal sentinels (Symbols) bypass
|
|
30
|
+
* it. The resolver's validator is intended for actual user values; our
|
|
31
|
+
* Skip / Custom / Load-more sentinels are internal control-flow and
|
|
32
|
+
* should pass through. Returns `undefined` when the resolver didn't
|
|
33
|
+
* supply a validator (so `await search({ ...rest })` doesn't get a
|
|
34
|
+
* pass-through identity function).
|
|
35
|
+
*/
|
|
36
|
+
private wrapPromptValidate;
|
|
37
|
+
/**
|
|
38
|
+
* Apply a PromptConfig.filter to a selected value, but only when the
|
|
39
|
+
* value is a real data choice (not an internal sentinel). @inquirer/search
|
|
40
|
+
* has no built-in filter hook, so the search-backed paths call this
|
|
41
|
+
* explicitly before returning.
|
|
42
|
+
*/
|
|
43
|
+
private applyPromptFilter;
|
|
44
|
+
/**
|
|
45
|
+
* If the resolver's PromptConfig sets a `default` value, move the
|
|
46
|
+
* matching choice to the front so it's the first selectable item in
|
|
47
|
+
* the rendered source. @inquirer/search has no built-in `default`
|
|
48
|
+
* option; first-selectable is what Enter picks, so reordering achieves
|
|
49
|
+
* the same semantics inquirer.prompt's list had natively.
|
|
50
|
+
*
|
|
51
|
+
* Returns the original array if no default is set or the default
|
|
52
|
+
* doesn't match any current choice.
|
|
53
|
+
*/
|
|
54
|
+
private reorderForDefault;
|
|
55
|
+
/**
|
|
56
|
+
* Build the disabled "if you had X capability, more results would show"
|
|
57
|
+
* hints for any unmet capabilities the resolver declared. Returns the
|
|
58
|
+
* raw hint strings — callers wrap them into choice objects with whatever
|
|
59
|
+
* sentinel value they prefer (disabled choices' values are inert).
|
|
60
|
+
*/
|
|
61
|
+
private computeCapabilityHints;
|
|
62
|
+
/**
|
|
63
|
+
* Unpack a DynamicResolver.fetch result into the three shapes the caller
|
|
64
|
+
* cares about: a flat items array, an optional AsyncIterator for further
|
|
65
|
+
* pagination, and a hasMore flag. Centralizing keeps the AsyncIterable /
|
|
66
|
+
* `{data, nextCursor}` / `TItem[]` discrimination in one place — both
|
|
67
|
+
* the main dropdown loop and the search-mode flow consume it.
|
|
68
|
+
*
|
|
69
|
+
* The function is `async` for the AsyncIterable branch only (we eagerly
|
|
70
|
+
* consume the first page so callers don't have to discriminate). The
|
|
71
|
+
* other two branches return synchronously; an explicit Promise.resolve
|
|
72
|
+
* is unnecessary because async automatically wraps.
|
|
73
|
+
*
|
|
74
|
+
* Note: callers in search mode intentionally drop `pageIterator` /
|
|
75
|
+
* `hasMore` because each search() invocation re-prompts from scratch;
|
|
76
|
+
* pagination only matters when the prompt is the dropdown itself.
|
|
77
|
+
*/
|
|
78
|
+
private unpackFetchResult;
|
|
79
|
+
/**
|
|
80
|
+
* Search-mode dynamic resolver: prompts the user for free-form text, passes
|
|
81
|
+
* it to fetch via `search`, and either short-circuits on a primitive return
|
|
82
|
+
* (exact match) or renders the results as a search-filterable dropdown.
|
|
83
|
+
* Empty results still render the dropdown so the user can fall through to
|
|
84
|
+
* "(Use 'foo' as-is)" or "(Try a different search)" rather than being
|
|
85
|
+
* stuck.
|
|
86
|
+
*
|
|
87
|
+
* Known limitation: pagination beyond the first page is dropped. Each
|
|
88
|
+
* search() invocation re-prompts from scratch and the user is expected
|
|
89
|
+
* to refine their query if too many results came back. If a future
|
|
90
|
+
* high-cardinality search resolver needs Load-more here, the
|
|
91
|
+
* `pageIterator` / `hasMore` from `unpackFetchResult` is what to wire in.
|
|
92
|
+
*/
|
|
93
|
+
private resolveDynamicWithSearchInput;
|
|
28
94
|
private resolveParameter;
|
|
95
|
+
/**
|
|
96
|
+
* Run a resolver to obtain a value for one parameter, prompting the
|
|
97
|
+
* user when necessary. Routes to one of several prompt backends and
|
|
98
|
+
* has to keep the `PromptConfig` contract honest across each one.
|
|
99
|
+
*
|
|
100
|
+
* `PromptConfig` field × prompt-backend handling:
|
|
101
|
+
*
|
|
102
|
+
* | field | list (search()) | checkbox/confirm (inquirer.prompt) | search-mode dropdown (search()) |
|
|
103
|
+
* | -------- | --------------- | ---------------------------------- | ------------------------------- |
|
|
104
|
+
* | type | required | required | required |
|
|
105
|
+
* | name | (set internally)| forwarded | (set internally) |
|
|
106
|
+
* | message | forwarded | forwarded | forwarded |
|
|
107
|
+
* | choices | filtered in src | passed to inquirer | filtered in src |
|
|
108
|
+
* | default | reorder matches | passed (also internal cursor jump) | reorder matches |
|
|
109
|
+
* | validate | wrapped | passed (inquirer native) | wrapped + manual for (Use as-is)|
|
|
110
|
+
* | filter | manual once | inquirer native (do NOT double) | manual once |
|
|
111
|
+
*
|
|
112
|
+
* Escape-hatch sentinels (Skip / Custom value / Use as-is / Load more
|
|
113
|
+
* / Try again) bypass the resolver's validate/filter because they
|
|
114
|
+
* aren't real user values — they're CLI control-flow.
|
|
115
|
+
*/
|
|
29
116
|
private resolveWithResolver;
|
|
30
117
|
private resolveFieldsRecursively;
|
|
31
118
|
/**
|
|
@@ -48,7 +135,10 @@ export declare class SchemaParameterResolver {
|
|
|
48
135
|
*/
|
|
49
136
|
private fetchChoices;
|
|
50
137
|
/**
|
|
51
|
-
* Prompt user with choices (handles both single and multi-select with pagination)
|
|
138
|
+
* Prompt user with choices (handles both single and multi-select with pagination).
|
|
139
|
+
* Single-select goes through @inquirer/search so users can type-to-filter long
|
|
140
|
+
* dropdowns (SELECT fields); multi-select stays on inquirer.prompt since search
|
|
141
|
+
* is single-select only.
|
|
52
142
|
*/
|
|
53
143
|
private promptWithChoices;
|
|
54
144
|
/**
|