@velaro/cli 0.7.0 → 1.4.8

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 (98) hide show
  1. package/README.md +161 -138
  2. package/bin/velaro.js +177 -62
  3. package/lib/api.js +91 -52
  4. package/lib/api.test.js +46 -0
  5. package/lib/banner.js +76 -0
  6. package/lib/commands/activity.js +133 -0
  7. package/lib/commands/acuity.js +66 -0
  8. package/lib/commands/agent.js +204 -50
  9. package/lib/commands/ai-config.js +193 -0
  10. package/lib/commands/ai-models.js +159 -0
  11. package/lib/commands/appointments.js +198 -0
  12. package/lib/commands/article.js +668 -388
  13. package/lib/commands/automation-draft.js +134 -0
  14. package/lib/commands/avatar.js +75 -0
  15. package/lib/commands/bigcommerce.js +50 -0
  16. package/lib/commands/billing-contacts.js +62 -0
  17. package/lib/commands/billing-email-preference.js +64 -0
  18. package/lib/commands/billing-subscription.js +265 -0
  19. package/lib/commands/billing.js +138 -0
  20. package/lib/commands/bot.js +141 -137
  21. package/lib/commands/bundle.js +168 -0
  22. package/lib/commands/calendly.js +62 -0
  23. package/lib/commands/callback.js +125 -0
  24. package/lib/commands/callrail.js +88 -0
  25. package/lib/commands/campaigns.js +44 -0
  26. package/lib/commands/case.js +102 -0
  27. package/lib/commands/check.js +163 -163
  28. package/lib/commands/compliance.js +229 -0
  29. package/lib/commands/conversation-efficiency.js +178 -0
  30. package/lib/commands/copilotstudio.js +114 -0
  31. package/lib/commands/coupon-grant.js +192 -0
  32. package/lib/commands/db.js +101 -0
  33. package/lib/commands/deployment.js +107 -107
  34. package/lib/commands/diagnostics.js +298 -0
  35. package/lib/commands/email-campaign.js +47 -0
  36. package/lib/commands/email-inbox.js +88 -0
  37. package/lib/commands/entitlement.js +176 -0
  38. package/lib/commands/env.js +45 -45
  39. package/lib/commands/feature-discovery.js +40 -0
  40. package/lib/commands/focus.js +278 -0
  41. package/lib/commands/index.js +38 -5
  42. package/lib/commands/ingest.js +31 -31
  43. package/lib/commands/inline-widget-config.js +126 -0
  44. package/lib/commands/integration.js +93 -0
  45. package/lib/commands/kb.js +450 -309
  46. package/lib/commands/login.js +86 -86
  47. package/lib/commands/logs.js +680 -0
  48. package/lib/commands/magento.js +210 -0
  49. package/lib/commands/mcp-key.js +188 -159
  50. package/lib/commands/migrate.js +134 -0
  51. package/lib/commands/migration-status.js +66 -0
  52. package/lib/commands/monday.js +137 -0
  53. package/lib/commands/netsuite.js +87 -0
  54. package/lib/commands/notifications.js +63 -0
  55. package/lib/commands/notion.js +70 -0
  56. package/lib/commands/ops.js +267 -173
  57. package/lib/commands/payment-recovery.js +170 -0
  58. package/lib/commands/pickup.js +172 -0
  59. package/lib/commands/pricing.js +132 -0
  60. package/lib/commands/product.js +55 -0
  61. package/lib/commands/recruiting.js +374 -0
  62. package/lib/commands/report.js +462 -0
  63. package/lib/commands/routing.js +304 -0
  64. package/lib/commands/rule.js +85 -85
  65. package/lib/commands/sharepoint.js +167 -0
  66. package/lib/commands/site-provision.js +68 -0
  67. package/lib/commands/site.js +62 -62
  68. package/lib/commands/sitesync.js +158 -0
  69. package/lib/commands/slack.js +64 -0
  70. package/lib/commands/squarespace.js +108 -0
  71. package/lib/commands/status.js +24 -24
  72. package/lib/commands/subscription.js +43 -0
  73. package/lib/commands/support.js +128 -0
  74. package/lib/commands/survey.js +216 -0
  75. package/lib/commands/team.js +144 -144
  76. package/lib/commands/teams-phone.js +131 -0
  77. package/lib/commands/teams.js +106 -0
  78. package/lib/commands/telephony.js +99 -0
  79. package/lib/commands/update.js +47 -47
  80. package/lib/commands/webflow.js +128 -0
  81. package/lib/commands/whoami.js +25 -22
  82. package/lib/commands/widget-container.js +152 -0
  83. package/lib/commands/woocommerce.js +240 -0
  84. package/lib/commands/workflow.js +233 -98
  85. package/lib/config.js +85 -83
  86. package/lib/kb-screenshot.js +320 -0
  87. package/lib/migrations/amscro.json +72 -0
  88. package/lib/migrations/azenta.json +68 -0
  89. package/lib/migrations/bluefire.json +49 -0
  90. package/lib/migrations/donaldson.json +75 -0
  91. package/lib/oauth.js +149 -135
  92. package/lib/run.js +21 -16
  93. package/lib/sharepoint-auth.js +138 -0
  94. package/lib/subscription.js +41 -39
  95. package/lib/track.js +35 -35
  96. package/lib/update-check.js +64 -64
  97. package/package.json +34 -19
  98. package/scripts/postinstall.js +12 -0
@@ -1,86 +1,86 @@
1
- import { requestDeviceCode, pollForToken, exchangeForVelaroToken } from '../oauth.js';
2
- import { readConfig, writeConfig, setEnvCredentials, getActiveEnv, ENVS } from '../config.js';
3
- import { runCommand } from '../run.js';
4
-
5
- export const loginCommand = {
6
- command: 'login',
7
- describe: 'Authenticate with Velaro (saves credentials for the chosen environment)',
8
- builder: (y) =>
9
- y
10
- .option('staging', {
11
- describe: 'Log in to the staging environment',
12
- type: 'boolean',
13
- default: false,
14
- })
15
- .option('api', {
16
- describe: 'Override the admin API base URL (advanced)',
17
- type: 'string',
18
- }),
19
-
20
- handler: runCommand(async (argv) => {
21
- const env = argv.staging || argv.api?.includes('staging') ? 'staging' : 'prod';
22
- const adminApiBase = argv.api || ENVS[env].adminApiBase;
23
-
24
- console.log(`Starting Velaro login (${env})...\n`);
25
-
26
- const deviceData = await requestDeviceCode();
27
-
28
- console.log(` Open: ${deviceData.verification_uri}`);
29
- console.log(` Enter: ${deviceData.user_code}\n`);
30
- console.log('Waiting for you to complete login in your browser...');
31
-
32
- const entraTokens = await pollForToken(deviceData.device_code, deviceData.interval ?? 5);
33
- const velaroResult = await exchangeForVelaroToken(entraTokens.access_token, adminApiBase);
34
-
35
- setEnvCredentials(env, {
36
- adminApiBase,
37
- velaroToken: velaroResult.token.token,
38
- velaroExpires: velaroResult.token.expires,
39
- entraRefreshToken: entraTokens.refresh_token,
40
- siteId: velaroResult.profile?.SiteId,
41
- userName: velaroResult.profile?.Name,
42
- });
43
-
44
- // Set as active if it's the only env logged in, or if explicitly chosen
45
- const cfg = readConfig();
46
- if (!cfg.activeEnv || Object.keys(cfg.envs || {}).length === 1) {
47
- cfg.activeEnv = env;
48
- writeConfig(cfg);
49
- }
50
-
51
- console.log(`\n✅ Logged in to ${env} as ${velaroResult.profile?.Name ?? velaroResult.profile?.UserName}`);
52
- console.log(` Site ID: ${velaroResult.profile?.SiteId}`);
53
- console.log(` API: ${adminApiBase}`);
54
- console.log('\nCredentials saved. Run "velaro env" to see all environments.');
55
- }),
56
- };
57
-
58
- export const logoutCommand = {
59
- command: 'logout',
60
- describe: 'Clear stored credentials',
61
- builder: (y) =>
62
- y.option('staging', { describe: 'Log out of staging only', type: 'boolean', default: false })
63
- .option('all', { describe: 'Log out of all environments', type: 'boolean', default: false }),
64
-
65
- handler: runCommand(async (argv) => {
66
- const { readConfig, writeConfig, clearConfig } = await import('../config.js');
67
- if (argv.all) {
68
- clearConfig();
69
- console.log('Logged out of all environments.');
70
- return;
71
- }
72
- const env = argv.staging ? 'staging' : getActiveEnv();
73
- const cfg = readConfig();
74
- if (cfg.envs?.[env]) {
75
- delete cfg.envs[env];
76
- if (cfg.activeEnv === env) {
77
- const remaining = Object.keys(cfg.envs || {});
78
- cfg.activeEnv = remaining[0] || 'prod';
79
- }
80
- writeConfig(cfg);
81
- console.log(`Logged out of ${env}.`);
82
- } else {
83
- console.log(`Not logged in to ${env}.`);
84
- }
85
- }),
86
- };
1
+ import { requestDeviceCode, pollForToken, exchangeForVelaroToken } from '../oauth.js';
2
+ import { readConfig, writeConfig, setEnvCredentials, getActiveEnv, ENVS } from '../config.js';
3
+ import { runCommand } from '../run.js';
4
+
5
+ export const loginCommand = {
6
+ command: 'login',
7
+ describe: 'Authenticate with Velaro (saves credentials for the chosen environment)',
8
+ builder: (y) =>
9
+ y
10
+ .option('staging', {
11
+ describe: 'Log in to the staging environment',
12
+ type: 'boolean',
13
+ default: false,
14
+ })
15
+ .option('api', {
16
+ describe: 'Override the admin API base URL (advanced)',
17
+ type: 'string',
18
+ }),
19
+
20
+ handler: runCommand(async (argv) => {
21
+ const env = argv.staging || argv.api?.includes('staging') ? 'staging' : 'prod';
22
+ const adminApiBase = argv.api || ENVS[env].adminApiBase;
23
+
24
+ console.log(`Starting Velaro login (${env})...\n`);
25
+
26
+ const deviceData = await requestDeviceCode();
27
+
28
+ console.log(` Open: ${deviceData.verification_uri}`);
29
+ console.log(` Enter: ${deviceData.user_code}\n`);
30
+ console.log('Waiting for you to complete login in your browser...');
31
+
32
+ const entraTokens = await pollForToken(deviceData.device_code, deviceData.interval ?? 5);
33
+ const velaroResult = await exchangeForVelaroToken(entraTokens.access_token, adminApiBase);
34
+
35
+ setEnvCredentials(env, {
36
+ adminApiBase,
37
+ velaroToken: velaroResult.token.token,
38
+ velaroExpires: velaroResult.token.expires,
39
+ entraRefreshToken: entraTokens.refresh_token,
40
+ siteId: velaroResult.profile?.siteId,
41
+ userName: velaroResult.profile?.userName,
42
+ });
43
+
44
+ // Set as active if it's the only env logged in, or if explicitly chosen
45
+ const cfg = readConfig();
46
+ if (!cfg.activeEnv || Object.keys(cfg.envs || {}).length === 1) {
47
+ cfg.activeEnv = env;
48
+ writeConfig(cfg);
49
+ }
50
+
51
+ console.log(`\n✅ Logged in to ${env} as ${velaroResult.profile?.userName}`);
52
+ console.log(` Site ID: ${velaroResult.profile?.siteId}`);
53
+ console.log(` API: ${adminApiBase}`);
54
+ console.log('\nCredentials saved. Run "velaro env" to see all environments.');
55
+ }),
56
+ };
57
+
58
+ export const logoutCommand = {
59
+ command: 'logout',
60
+ describe: 'Clear stored credentials',
61
+ builder: (y) =>
62
+ y.option('staging', { describe: 'Log out of staging only', type: 'boolean', default: false })
63
+ .option('all', { describe: 'Log out of all environments', type: 'boolean', default: false }),
64
+
65
+ handler: runCommand(async (argv) => {
66
+ const { readConfig, writeConfig, clearConfig } = await import('../config.js');
67
+ if (argv.all) {
68
+ clearConfig();
69
+ console.log('Logged out of all environments.');
70
+ return;
71
+ }
72
+ const env = argv.staging ? 'staging' : getActiveEnv();
73
+ const cfg = readConfig();
74
+ if (cfg.envs?.[env]) {
75
+ delete cfg.envs[env];
76
+ if (cfg.activeEnv === env) {
77
+ const remaining = Object.keys(cfg.envs || {});
78
+ cfg.activeEnv = remaining[0] || 'prod';
79
+ }
80
+ writeConfig(cfg);
81
+ console.log(`Logged out of ${env}.`);
82
+ } else {
83
+ console.log(`Not logged in to ${env}.`);
84
+ }
85
+ }),
86
+ };