@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.
Files changed (95) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +115 -12
  3. package/bin/{zapier-sdk.js → zapier-sdk.mjs} +1 -1
  4. package/dist/cli.cjs +1715 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/{cli.js → cli.mjs} +221 -469
  8. package/dist/index.cjs +770 -0
  9. package/dist/index.d.mts +12 -0
  10. package/dist/index.d.ts +12 -0
  11. package/dist/index.mjs +739 -0
  12. package/dist/package.json +67 -0
  13. package/dist/src/cli.js +8 -14
  14. package/dist/src/index.d.ts +1 -0
  15. package/dist/src/index.js +1 -1
  16. package/dist/src/plugins/bundleCode/index.d.ts +15 -0
  17. package/dist/src/{commands/bundle-code → plugins/bundleCode}/index.js +19 -1
  18. package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.d.ts +8 -8
  19. package/dist/src/{commands/bundle-code → plugins/bundleCode}/schemas.js +4 -4
  20. package/dist/src/plugins/generateTypes/index.d.ts +21 -0
  21. package/dist/src/{commands/generate-types → plugins/generateTypes}/index.js +18 -0
  22. package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.d.ts +0 -3
  23. package/dist/src/{commands/generate-types → plugins/generateTypes}/schemas.js +1 -2
  24. package/dist/src/plugins/getConfigPath/index.d.ts +15 -0
  25. package/dist/src/plugins/getConfigPath/index.js +19 -0
  26. package/dist/src/plugins/getConfigPath/schemas.d.ts +3 -0
  27. package/dist/src/plugins/getConfigPath/schemas.js +5 -0
  28. package/dist/src/plugins/index.d.ts +6 -0
  29. package/dist/src/plugins/index.js +6 -0
  30. package/dist/src/plugins/login/index.d.ts +15 -0
  31. package/dist/src/plugins/login/index.js +26 -0
  32. package/dist/src/plugins/login/schemas.d.ts +9 -0
  33. package/dist/src/plugins/login/schemas.js +10 -0
  34. package/dist/src/plugins/logout/index.d.ts +15 -0
  35. package/dist/src/plugins/logout/index.js +18 -0
  36. package/dist/src/plugins/logout/schemas.d.ts +3 -0
  37. package/dist/src/plugins/logout/schemas.js +5 -0
  38. package/dist/src/plugins/mcp/index.d.ts +15 -0
  39. package/dist/src/plugins/mcp/index.js +24 -0
  40. package/dist/src/plugins/mcp/schemas.d.ts +9 -0
  41. package/dist/src/plugins/mcp/schemas.js +10 -0
  42. package/dist/src/sdk.d.ts +9 -0
  43. package/dist/src/sdk.js +22 -0
  44. package/dist/src/utils/cli-generator.js +12 -8
  45. package/dist/src/utils/schema-formatter.d.ts +1 -1
  46. package/dist/src/utils/schema-formatter.js +8 -8
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +19 -8
  49. package/src/cli.ts +8 -21
  50. package/src/index.ts +2 -0
  51. package/src/{commands/bundle-code → plugins/bundleCode}/index.ts +39 -2
  52. package/src/{commands/bundle-code → plugins/bundleCode}/schemas.ts +4 -4
  53. package/src/{commands/generate-types → plugins/generateTypes}/index.ts +56 -3
  54. package/src/{commands/generate-types → plugins/generateTypes}/schemas.ts +0 -4
  55. package/src/plugins/getConfigPath/index.ts +42 -0
  56. package/src/plugins/getConfigPath/schemas.ts +8 -0
  57. package/src/plugins/index.ts +6 -0
  58. package/src/plugins/login/index.ts +48 -0
  59. package/src/plugins/login/schemas.ts +13 -0
  60. package/src/plugins/logout/index.ts +37 -0
  61. package/src/plugins/logout/schemas.ts +8 -0
  62. package/src/plugins/mcp/index.ts +43 -0
  63. package/src/plugins/mcp/schemas.ts +13 -0
  64. package/src/sdk.ts +43 -0
  65. package/src/utils/cli-generator.test.ts +93 -0
  66. package/src/utils/cli-generator.ts +19 -9
  67. package/src/utils/schema-formatter.ts +13 -7
  68. package/tsconfig.build.json +15 -3
  69. package/tsconfig.json +2 -2
  70. package/tsup.config.ts +10 -4
  71. package/bin/zsdk.js +0 -4
  72. package/dist/index.js +0 -0
  73. package/dist/src/commands/bundle-code/cli.d.ts +0 -2
  74. package/dist/src/commands/bundle-code/cli.js +0 -77
  75. package/dist/src/commands/bundle-code/index.d.ts +0 -5
  76. package/dist/src/commands/configPath.d.ts +0 -2
  77. package/dist/src/commands/configPath.js +0 -9
  78. package/dist/src/commands/generate-types/cli.d.ts +0 -2
  79. package/dist/src/commands/generate-types/cli.js +0 -84
  80. package/dist/src/commands/generate-types/index.d.ts +0 -8
  81. package/dist/src/commands/index.d.ts +0 -6
  82. package/dist/src/commands/index.js +0 -6
  83. package/dist/src/commands/login.d.ts +0 -2
  84. package/dist/src/commands/login.js +0 -25
  85. package/dist/src/commands/logout.d.ts +0 -2
  86. package/dist/src/commands/logout.js +0 -16
  87. package/dist/src/commands/mcp.d.ts +0 -2
  88. package/dist/src/commands/mcp.js +0 -11
  89. package/src/commands/bundle-code/cli.ts +0 -118
  90. package/src/commands/configPath.ts +0 -10
  91. package/src/commands/generate-types/cli.ts +0 -126
  92. package/src/commands/index.ts +0 -6
  93. package/src/commands/login.ts +0 -34
  94. package/src/commands/logout.ts +0 -19
  95. 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, index, formatMeta) {
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(`${index + 1}.`)} ${chalk.cyan(formatted.title)}`;
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
  }