@zapier/zapier-sdk-cli 0.6.3 → 0.6.5
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 +15 -0
- package/README.md +115 -12
- package/bin/{zapier-sdk.js → zapier-sdk.mjs} +1 -1
- package/dist/cli.cjs +1715 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/{cli.js → cli.mjs} +221 -469
- package/dist/index.cjs +770 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.mjs +739 -0
- package/dist/package.json +67 -0
- package/dist/src/cli.js +8 -14
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -1
- package/dist/src/plugins/bundleCode/index.d.ts +15 -0
- package/dist/src/{commands/bundle-code → plugins/bundleCode}/index.js +19 -1
- package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.d.ts +8 -8
- package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.js +4 -4
- package/dist/src/plugins/generateTypes/index.d.ts +21 -0
- package/dist/src/{commands/generate-types → plugins/generateTypes}/index.js +18 -0
- package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.d.ts +0 -3
- package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.js +1 -2
- package/dist/src/plugins/getConfigPath/index.d.ts +15 -0
- package/dist/src/plugins/getConfigPath/index.js +19 -0
- package/dist/src/plugins/getConfigPath/schemas.d.ts +3 -0
- package/dist/src/plugins/getConfigPath/schemas.js +5 -0
- package/dist/src/plugins/index.d.ts +6 -0
- package/dist/src/plugins/index.js +6 -0
- package/dist/src/plugins/login/index.d.ts +15 -0
- package/dist/src/plugins/login/index.js +26 -0
- package/dist/src/plugins/login/schemas.d.ts +9 -0
- package/dist/src/plugins/login/schemas.js +10 -0
- package/dist/src/plugins/logout/index.d.ts +15 -0
- package/dist/src/plugins/logout/index.js +18 -0
- package/dist/src/plugins/logout/schemas.d.ts +3 -0
- package/dist/src/plugins/logout/schemas.js +5 -0
- package/dist/src/plugins/mcp/index.d.ts +15 -0
- package/dist/src/plugins/mcp/index.js +24 -0
- package/dist/src/plugins/mcp/schemas.d.ts +9 -0
- package/dist/src/plugins/mcp/schemas.js +10 -0
- package/dist/src/sdk.d.ts +9 -0
- package/dist/src/sdk.js +22 -0
- package/dist/src/utils/cli-generator.js +12 -8
- package/dist/src/utils/schema-formatter.d.ts +1 -1
- package/dist/src/utils/schema-formatter.js +8 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -8
- package/src/cli.ts +8 -21
- package/src/index.ts +2 -0
- package/src/{commands/bundle-code → plugins/bundleCode}/index.ts +39 -2
- package/src/{commands/bundle-code → plugins/bundleCode}/schemas.ts +4 -4
- package/src/{commands/generate-types → plugins/generateTypes}/index.ts +56 -3
- package/src/{commands/generate-types → plugins/generateTypes}/schemas.ts +0 -4
- package/src/plugins/getConfigPath/index.ts +42 -0
- package/src/plugins/getConfigPath/schemas.ts +8 -0
- package/src/plugins/index.ts +6 -0
- package/src/plugins/login/index.ts +48 -0
- package/src/plugins/login/schemas.ts +13 -0
- package/src/plugins/logout/index.ts +37 -0
- package/src/plugins/logout/schemas.ts +8 -0
- package/src/plugins/mcp/index.ts +43 -0
- package/src/plugins/mcp/schemas.ts +13 -0
- package/src/sdk.ts +43 -0
- package/src/utils/cli-generator.test.ts +93 -0
- package/src/utils/cli-generator.ts +19 -9
- package/src/utils/schema-formatter.ts +13 -7
- package/tsconfig.build.json +15 -3
- package/tsconfig.json +2 -2
- package/tsup.config.ts +10 -4
- package/bin/zsdk.js +0 -4
- package/dist/index.js +0 -0
- package/dist/src/commands/bundle-code/cli.d.ts +0 -2
- package/dist/src/commands/bundle-code/cli.js +0 -77
- package/dist/src/commands/bundle-code/index.d.ts +0 -5
- package/dist/src/commands/configPath.d.ts +0 -2
- package/dist/src/commands/configPath.js +0 -9
- package/dist/src/commands/generate-types/cli.d.ts +0 -2
- package/dist/src/commands/generate-types/cli.js +0 -84
- package/dist/src/commands/generate-types/index.d.ts +0 -8
- package/dist/src/commands/index.d.ts +0 -6
- package/dist/src/commands/index.js +0 -6
- package/dist/src/commands/login.d.ts +0 -2
- package/dist/src/commands/login.js +0 -25
- package/dist/src/commands/logout.d.ts +0 -2
- package/dist/src/commands/logout.js +0 -16
- package/dist/src/commands/mcp.d.ts +0 -2
- package/dist/src/commands/mcp.js +0 -11
- package/src/commands/bundle-code/cli.ts +0 -118
- package/src/commands/configPath.ts +0 -10
- package/src/commands/generate-types/cli.ts +0 -126
- package/src/commands/index.ts +0 -6
- package/src/commands/login.ts +0 -34
- package/src/commands/logout.ts +0 -19
- package/src/commands/mcp.ts +0 -14
|
@@ -9,30 +9,30 @@ function getOutputSchema(schema) {
|
|
|
9
9
|
// ============================================================================
|
|
10
10
|
// Generic Schema-Driven Formatter
|
|
11
11
|
// ============================================================================
|
|
12
|
-
export function formatItemsFromSchema(inputSchema, items) {
|
|
12
|
+
export function formatItemsFromSchema(inputSchema, items, startingNumber = 0) {
|
|
13
13
|
// Get the output schema and its format metadata
|
|
14
14
|
const outputSchema = getOutputSchema(inputSchema);
|
|
15
15
|
if (!outputSchema) {
|
|
16
16
|
// Fallback to generic formatting if no output schema
|
|
17
|
-
formatItemsGeneric(items);
|
|
17
|
+
formatItemsGeneric(items, startingNumber);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
const formatMeta = getFormatMetadata(outputSchema);
|
|
21
21
|
if (!formatMeta) {
|
|
22
22
|
// Fallback to generic formatting if no format metadata
|
|
23
|
-
formatItemsGeneric(items);
|
|
23
|
+
formatItemsGeneric(items, startingNumber);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
// Format each item using the schema metadata
|
|
27
27
|
items.forEach((item, index) => {
|
|
28
|
-
formatSingleItem(item, index, formatMeta);
|
|
28
|
+
formatSingleItem(item, startingNumber + index, formatMeta);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function formatSingleItem(item,
|
|
31
|
+
function formatSingleItem(item, itemNumber, formatMeta) {
|
|
32
32
|
// Get the formatted item from the format function
|
|
33
33
|
const formatted = formatMeta.format(item);
|
|
34
34
|
// Build the main title line
|
|
35
|
-
let titleLine = `${chalk.gray(`${
|
|
35
|
+
let titleLine = `${chalk.gray(`${itemNumber + 1}.`)} ${chalk.cyan(formatted.title)}`;
|
|
36
36
|
if (formatted.subtitle) {
|
|
37
37
|
titleLine += ` ${chalk.gray(formatted.subtitle)}`;
|
|
38
38
|
}
|
|
@@ -59,12 +59,12 @@ function applyStyle(value, style) {
|
|
|
59
59
|
return chalk.blue(value);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function formatItemsGeneric(items) {
|
|
62
|
+
function formatItemsGeneric(items, startingNumber = 0) {
|
|
63
63
|
// Fallback formatting for items without schema metadata
|
|
64
64
|
items.forEach((item, index) => {
|
|
65
65
|
const itemObj = item;
|
|
66
66
|
const name = itemObj.title || itemObj.name || itemObj.key || itemObj.id || "Item";
|
|
67
|
-
console.log(`${chalk.gray(`${index + 1}.`)} ${chalk.cyan(name)}`);
|
|
67
|
+
console.log(`${chalk.gray(`${startingNumber + index + 1}.`)} ${chalk.cyan(name)}`);
|
|
68
68
|
if (itemObj.description) {
|
|
69
69
|
console.log(` ${chalk.dim(itemObj.description)}`);
|
|
70
70
|
}
|