@zapier/zapier-sdk-cli 0.16.1 → 0.16.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 +18 -0
- package/dist/cli.cjs +7 -7
- package/dist/cli.mjs +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/package.json +8 -2
- package/dist/src/cli.js +2 -1
- package/dist/src/utils/cli-generator.js +8 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -5
- package/src/cli.test.ts +0 -28
- package/src/cli.ts +0 -96
- package/src/generators/ast-generator.test.ts +0 -908
- package/src/generators/ast-generator.ts +0 -774
- package/src/index.ts +0 -12
- package/src/plugins/add/index.test.ts +0 -58
- package/src/plugins/add/index.ts +0 -177
- package/src/plugins/add/schemas.ts +0 -35
- package/src/plugins/buildManifest/index.test.ts +0 -679
- package/src/plugins/buildManifest/index.ts +0 -131
- package/src/plugins/buildManifest/schemas.ts +0 -55
- package/src/plugins/bundleCode/index.ts +0 -128
- package/src/plugins/bundleCode/schemas.ts +0 -24
- package/src/plugins/generateAppTypes/index.test.ts +0 -679
- package/src/plugins/generateAppTypes/index.ts +0 -227
- package/src/plugins/generateAppTypes/schemas.ts +0 -61
- package/src/plugins/getLoginConfigPath/index.ts +0 -45
- package/src/plugins/getLoginConfigPath/schemas.ts +0 -10
- package/src/plugins/index.ts +0 -8
- package/src/plugins/login/index.ts +0 -135
- package/src/plugins/login/schemas.ts +0 -13
- package/src/plugins/logout/index.ts +0 -37
- package/src/plugins/logout/schemas.ts +0 -8
- package/src/plugins/mcp/index.ts +0 -43
- package/src/plugins/mcp/schemas.ts +0 -13
- package/src/sdk.ts +0 -45
- package/src/telemetry/builders.ts +0 -113
- package/src/telemetry/events.ts +0 -39
- package/src/types/sdk.ts +0 -8
- package/src/utils/api/client.ts +0 -44
- package/src/utils/auth/login.ts +0 -214
- package/src/utils/cli-generator-utils.ts +0 -169
- package/src/utils/cli-generator.test.ts +0 -347
- package/src/utils/cli-generator.ts +0 -807
- package/src/utils/constants.ts +0 -9
- package/src/utils/directory-detection.ts +0 -23
- package/src/utils/errors.ts +0 -26
- package/src/utils/getCallablePromise.ts +0 -21
- package/src/utils/log.ts +0 -23
- package/src/utils/manifest-helpers.ts +0 -25
- package/src/utils/package-manager-detector.ts +0 -83
- package/src/utils/parameter-resolver.ts +0 -1075
- package/src/utils/schema-formatter.ts +0 -153
- package/src/utils/serializeAsync.ts +0 -26
- package/src/utils/spinner.ts +0 -23
- package/src/utils/version-checker.test.ts +0 -239
- package/src/utils/version-checker.ts +0 -237
- package/tsconfig.build.json +0 -18
- package/tsconfig.json +0 -19
- package/tsup.config.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.16.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 142c1ce: Fix CLI UX issues: stdout truncation when piped, nullable schema detection for Zod 4, error body display, and auto Content-Type for JSON bodies
|
|
8
|
+
- Updated dependencies [142c1ce]
|
|
9
|
+
- @zapier/zapier-sdk@0.16.1
|
|
10
|
+
- @zapier/zapier-sdk-mcp@0.4.1
|
|
11
|
+
|
|
12
|
+
## 0.16.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 0434971: Make zapier-sdk-cli and zapier-sdk-cli-login packages public
|
|
17
|
+
- Updated dependencies [0434971]
|
|
18
|
+
- @zapier/zapier-sdk-cli-login@0.3.6
|
|
19
|
+
- @zapier/zapier-sdk@0.16.0
|
|
20
|
+
|
|
3
21
|
## 0.16.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cli.cjs
CHANGED
|
@@ -911,7 +911,7 @@ function analyzeZodField(name, schema, functionInfo) {
|
|
|
911
911
|
baseSchema = baseSchema._zod.def.innerType;
|
|
912
912
|
} else {
|
|
913
913
|
const zodDef = baseSchema._zod?.def;
|
|
914
|
-
if (zodDef?.
|
|
914
|
+
if (zodDef?.type === "nullable" && zodDef.innerType) {
|
|
915
915
|
baseSchema = zodDef.innerType;
|
|
916
916
|
continue;
|
|
917
917
|
}
|
|
@@ -1081,12 +1081,12 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1081
1081
|
if (result instanceof Response) {
|
|
1082
1082
|
const response = result;
|
|
1083
1083
|
let body;
|
|
1084
|
+
const text = await response.text().catch(() => "[unable to read body]");
|
|
1084
1085
|
try {
|
|
1085
|
-
body =
|
|
1086
|
+
body = JSON.parse(text);
|
|
1086
1087
|
} catch {
|
|
1087
|
-
const text = response.bodyUsed ? "[body already consumed]" : await response.text().catch(() => "[unable to read body]");
|
|
1088
1088
|
throw new Error(
|
|
1089
|
-
`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0,
|
|
1089
|
+
`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0, 500)}`
|
|
1090
1090
|
);
|
|
1091
1091
|
}
|
|
1092
1092
|
result = {
|
|
@@ -1645,7 +1645,7 @@ var LoginSchema = zod.z.object({
|
|
|
1645
1645
|
|
|
1646
1646
|
// package.json
|
|
1647
1647
|
var package_default = {
|
|
1648
|
-
version: "0.16.
|
|
1648
|
+
version: "0.16.3"};
|
|
1649
1649
|
|
|
1650
1650
|
// src/telemetry/builders.ts
|
|
1651
1651
|
function createCliBaseEvent(context = {}) {
|
|
@@ -2924,7 +2924,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2924
2924
|
// package.json with { type: 'json' }
|
|
2925
2925
|
var package_default2 = {
|
|
2926
2926
|
name: "@zapier/zapier-sdk-cli",
|
|
2927
|
-
version: "0.16.
|
|
2927
|
+
version: "0.16.3"};
|
|
2928
2928
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2929
2929
|
const ua = process.env.npm_config_user_agent;
|
|
2930
2930
|
if (ua) {
|
|
@@ -3175,5 +3175,5 @@ program.exitOverride();
|
|
|
3175
3175
|
}
|
|
3176
3176
|
}
|
|
3177
3177
|
await versionCheckPromise;
|
|
3178
|
-
process.
|
|
3178
|
+
process.exitCode = exitCode;
|
|
3179
3179
|
})();
|
package/dist/cli.mjs
CHANGED
|
@@ -875,7 +875,7 @@ function analyzeZodField(name, schema, functionInfo) {
|
|
|
875
875
|
baseSchema = baseSchema._zod.def.innerType;
|
|
876
876
|
} else {
|
|
877
877
|
const zodDef = baseSchema._zod?.def;
|
|
878
|
-
if (zodDef?.
|
|
878
|
+
if (zodDef?.type === "nullable" && zodDef.innerType) {
|
|
879
879
|
baseSchema = zodDef.innerType;
|
|
880
880
|
continue;
|
|
881
881
|
}
|
|
@@ -1045,12 +1045,12 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1045
1045
|
if (result instanceof Response) {
|
|
1046
1046
|
const response = result;
|
|
1047
1047
|
let body;
|
|
1048
|
+
const text = await response.text().catch(() => "[unable to read body]");
|
|
1048
1049
|
try {
|
|
1049
|
-
body =
|
|
1050
|
+
body = JSON.parse(text);
|
|
1050
1051
|
} catch {
|
|
1051
|
-
const text = response.bodyUsed ? "[body already consumed]" : await response.text().catch(() => "[unable to read body]");
|
|
1052
1052
|
throw new Error(
|
|
1053
|
-
`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0,
|
|
1053
|
+
`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0, 500)}`
|
|
1054
1054
|
);
|
|
1055
1055
|
}
|
|
1056
1056
|
result = {
|
|
@@ -1609,7 +1609,7 @@ var LoginSchema = z.object({
|
|
|
1609
1609
|
|
|
1610
1610
|
// package.json
|
|
1611
1611
|
var package_default = {
|
|
1612
|
-
version: "0.16.
|
|
1612
|
+
version: "0.16.3"};
|
|
1613
1613
|
|
|
1614
1614
|
// src/telemetry/builders.ts
|
|
1615
1615
|
function createCliBaseEvent(context = {}) {
|
|
@@ -2888,7 +2888,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
2888
2888
|
// package.json with { type: 'json' }
|
|
2889
2889
|
var package_default2 = {
|
|
2890
2890
|
name: "@zapier/zapier-sdk-cli",
|
|
2891
|
-
version: "0.16.
|
|
2891
|
+
version: "0.16.3"};
|
|
2892
2892
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2893
2893
|
const ua = process.env.npm_config_user_agent;
|
|
2894
2894
|
if (ua) {
|
|
@@ -3139,5 +3139,5 @@ program.exitOverride();
|
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
3141
|
await versionCheckPromise;
|
|
3142
|
-
process.
|
|
3142
|
+
process.exitCode = exitCode;
|
|
3143
3143
|
})();
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "Command line interface for Zapier SDK",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -36,8 +36,14 @@
|
|
|
36
36
|
],
|
|
37
37
|
"author": "",
|
|
38
38
|
"license": "SEE LICENSE IN LICENSE",
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"bin",
|
|
42
|
+
"README.md",
|
|
43
|
+
"CHANGELOG.md"
|
|
44
|
+
],
|
|
39
45
|
"publishConfig": {
|
|
40
|
-
"access": "
|
|
46
|
+
"access": "public"
|
|
41
47
|
},
|
|
42
48
|
"dependencies": {
|
|
43
49
|
"@zapier/zapier-sdk": "workspace:*",
|
package/dist/src/cli.js
CHANGED
|
@@ -44,8 +44,9 @@ function analyzeZodField(name, schema, functionInfo) {
|
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
// Check for ZodNullable - nullable doesn't affect CLI required status, but we need to unwrap it to get the base type
|
|
47
|
+
// Use _zod.def.type for Zod 4 compatibility (matches patterns elsewhere in codebase)
|
|
47
48
|
const zodDef = baseSchema._zod?.def;
|
|
48
|
-
if (zodDef?.
|
|
49
|
+
if (zodDef?.type === "nullable" && zodDef.innerType) {
|
|
49
50
|
baseSchema = zodDef.innerType;
|
|
50
51
|
continue;
|
|
51
52
|
}
|
|
@@ -231,15 +232,15 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
|
|
|
231
232
|
if (result instanceof Response) {
|
|
232
233
|
const response = result;
|
|
233
234
|
let body;
|
|
235
|
+
// Read as text first to preserve body for error messages
|
|
236
|
+
const text = await response
|
|
237
|
+
.text()
|
|
238
|
+
.catch(() => "[unable to read body]");
|
|
234
239
|
try {
|
|
235
|
-
body =
|
|
240
|
+
body = JSON.parse(text);
|
|
236
241
|
}
|
|
237
242
|
catch {
|
|
238
|
-
|
|
239
|
-
const text = response.bodyUsed
|
|
240
|
-
? "[body already consumed]"
|
|
241
|
-
: await response.text().catch(() => "[unable to read body]");
|
|
242
|
-
throw new Error(`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0, 200)}`);
|
|
243
|
+
throw new Error(`Failed to parse response as JSON (status: ${response.status}). Body: ${text.slice(0, 500)}`);
|
|
243
244
|
}
|
|
244
245
|
result = {
|
|
245
246
|
statusCode: response.status,
|