@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.
- package/README.md +161 -138
- package/bin/velaro.js +177 -62
- package/lib/api.js +91 -52
- package/lib/api.test.js +46 -0
- package/lib/banner.js +76 -0
- package/lib/commands/activity.js +133 -0
- package/lib/commands/acuity.js +66 -0
- package/lib/commands/agent.js +204 -50
- package/lib/commands/ai-config.js +193 -0
- package/lib/commands/ai-models.js +159 -0
- package/lib/commands/appointments.js +198 -0
- package/lib/commands/article.js +668 -388
- package/lib/commands/automation-draft.js +134 -0
- package/lib/commands/avatar.js +75 -0
- package/lib/commands/bigcommerce.js +50 -0
- package/lib/commands/billing-contacts.js +62 -0
- package/lib/commands/billing-email-preference.js +64 -0
- package/lib/commands/billing-subscription.js +265 -0
- package/lib/commands/billing.js +138 -0
- package/lib/commands/bot.js +141 -137
- package/lib/commands/bundle.js +168 -0
- package/lib/commands/calendly.js +62 -0
- package/lib/commands/callback.js +125 -0
- package/lib/commands/callrail.js +88 -0
- package/lib/commands/campaigns.js +44 -0
- package/lib/commands/case.js +102 -0
- package/lib/commands/check.js +163 -163
- package/lib/commands/compliance.js +229 -0
- package/lib/commands/conversation-efficiency.js +178 -0
- package/lib/commands/copilotstudio.js +114 -0
- package/lib/commands/coupon-grant.js +192 -0
- package/lib/commands/db.js +101 -0
- package/lib/commands/deployment.js +107 -107
- package/lib/commands/diagnostics.js +298 -0
- package/lib/commands/email-campaign.js +47 -0
- package/lib/commands/email-inbox.js +88 -0
- package/lib/commands/entitlement.js +176 -0
- package/lib/commands/env.js +45 -45
- package/lib/commands/feature-discovery.js +40 -0
- package/lib/commands/focus.js +278 -0
- package/lib/commands/index.js +38 -5
- package/lib/commands/ingest.js +31 -31
- package/lib/commands/inline-widget-config.js +126 -0
- package/lib/commands/integration.js +93 -0
- package/lib/commands/kb.js +450 -309
- package/lib/commands/login.js +86 -86
- package/lib/commands/logs.js +680 -0
- package/lib/commands/magento.js +210 -0
- package/lib/commands/mcp-key.js +188 -159
- package/lib/commands/migrate.js +134 -0
- package/lib/commands/migration-status.js +66 -0
- package/lib/commands/monday.js +137 -0
- package/lib/commands/netsuite.js +87 -0
- package/lib/commands/notifications.js +63 -0
- package/lib/commands/notion.js +70 -0
- package/lib/commands/ops.js +267 -173
- package/lib/commands/payment-recovery.js +170 -0
- package/lib/commands/pickup.js +172 -0
- package/lib/commands/pricing.js +132 -0
- package/lib/commands/product.js +55 -0
- package/lib/commands/recruiting.js +374 -0
- package/lib/commands/report.js +462 -0
- package/lib/commands/routing.js +304 -0
- package/lib/commands/rule.js +85 -85
- package/lib/commands/sharepoint.js +167 -0
- package/lib/commands/site-provision.js +68 -0
- package/lib/commands/site.js +62 -62
- package/lib/commands/sitesync.js +158 -0
- package/lib/commands/slack.js +64 -0
- package/lib/commands/squarespace.js +108 -0
- package/lib/commands/status.js +24 -24
- package/lib/commands/subscription.js +43 -0
- package/lib/commands/support.js +128 -0
- package/lib/commands/survey.js +216 -0
- package/lib/commands/team.js +144 -144
- package/lib/commands/teams-phone.js +131 -0
- package/lib/commands/teams.js +106 -0
- package/lib/commands/telephony.js +99 -0
- package/lib/commands/update.js +47 -47
- package/lib/commands/webflow.js +128 -0
- package/lib/commands/whoami.js +25 -22
- package/lib/commands/widget-container.js +152 -0
- package/lib/commands/woocommerce.js +240 -0
- package/lib/commands/workflow.js +233 -98
- package/lib/config.js +85 -83
- package/lib/kb-screenshot.js +320 -0
- package/lib/migrations/amscro.json +72 -0
- package/lib/migrations/azenta.json +68 -0
- package/lib/migrations/bluefire.json +49 -0
- package/lib/migrations/donaldson.json +75 -0
- package/lib/oauth.js +149 -135
- package/lib/run.js +21 -16
- package/lib/sharepoint-auth.js +138 -0
- package/lib/subscription.js +41 -39
- package/lib/track.js +35 -35
- package/lib/update-check.js +64 -64
- package/package.json +34 -19
- package/scripts/postinstall.js +12 -0
package/lib/update-check.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Non-blocking update checker.
|
|
3
|
-
* Fetches the latest version from npm once per day (cached in ~/.velaro/config.json).
|
|
4
|
-
* Prints a one-line notice AFTER the command completes if a newer version is available.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { readConfig, writeConfig } from './config.js';
|
|
8
|
-
import { createRequire } from 'module';
|
|
9
|
-
|
|
10
|
-
const require = createRequire(import.meta.url);
|
|
11
|
-
const { version: currentVersion } = require('../package.json');
|
|
12
|
-
|
|
13
|
-
const NPM_REGISTRY = 'https://registry.npmjs.org/@velaro/cli/latest';
|
|
14
|
-
const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // once per day
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Starts the update check in the background.
|
|
18
|
-
* Returns a function you await AFTER your command finishes to print any notice.
|
|
19
|
-
*/
|
|
20
|
-
export function startUpdateCheck() {
|
|
21
|
-
const cfg = readConfig();
|
|
22
|
-
const lastCheck = cfg._lastUpdateCheck ?? 0;
|
|
23
|
-
const now = Date.now();
|
|
24
|
-
|
|
25
|
-
if (now - lastCheck < CHECK_INTERVAL_MS) {
|
|
26
|
-
// Use cached result — no network call
|
|
27
|
-
return async () => printNoticeIfStale(cfg._latestVersion);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Fire off the network request without awaiting it here
|
|
31
|
-
const fetchPromise = fetch(NPM_REGISTRY, { signal: AbortSignal.timeout(4000) })
|
|
32
|
-
.then((r) => r.json())
|
|
33
|
-
.then((data) => {
|
|
34
|
-
const latest = data?.version ?? null;
|
|
35
|
-
writeConfig({ ...readConfig(), _lastUpdateCheck: now, _latestVersion: latest });
|
|
36
|
-
return latest;
|
|
37
|
-
})
|
|
38
|
-
.catch(() => null); // never block the CLI on a network failure
|
|
39
|
-
|
|
40
|
-
return async () => {
|
|
41
|
-
const latest = await fetchPromise;
|
|
42
|
-
printNoticeIfStale(latest);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function printNoticeIfStale(latest) {
|
|
47
|
-
if (!latest || latest === currentVersion) return;
|
|
48
|
-
if (!isNewer(latest, currentVersion)) return;
|
|
49
|
-
|
|
50
|
-
process.stderr.write(
|
|
51
|
-
`\n Update available: ${currentVersion} → ${latest}\n` +
|
|
52
|
-
` Run: npm install -g @velaro/cli@latest\n\n`
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function isNewer(a, b) {
|
|
57
|
-
const pa = a.split('.').map(Number);
|
|
58
|
-
const pb = b.split('.').map(Number);
|
|
59
|
-
for (let i = 0; i < 3; i++) {
|
|
60
|
-
if ((pa[i] ?? 0) > (pb[i] ?? 0)) return true;
|
|
61
|
-
if ((pa[i] ?? 0) < (pb[i] ?? 0)) return false;
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Non-blocking update checker.
|
|
3
|
+
* Fetches the latest version from npm once per day (cached in ~/.velaro/config.json).
|
|
4
|
+
* Prints a one-line notice AFTER the command completes if a newer version is available.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { readConfig, writeConfig } from './config.js';
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
|
+
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const { version: currentVersion } = require('../package.json');
|
|
12
|
+
|
|
13
|
+
const NPM_REGISTRY = 'https://registry.npmjs.org/@velaro/cli/latest';
|
|
14
|
+
const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // once per day
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Starts the update check in the background.
|
|
18
|
+
* Returns a function you await AFTER your command finishes to print any notice.
|
|
19
|
+
*/
|
|
20
|
+
export function startUpdateCheck() {
|
|
21
|
+
const cfg = readConfig();
|
|
22
|
+
const lastCheck = cfg._lastUpdateCheck ?? 0;
|
|
23
|
+
const now = Date.now();
|
|
24
|
+
|
|
25
|
+
if (now - lastCheck < CHECK_INTERVAL_MS) {
|
|
26
|
+
// Use cached result — no network call
|
|
27
|
+
return async () => printNoticeIfStale(cfg._latestVersion);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Fire off the network request without awaiting it here
|
|
31
|
+
const fetchPromise = fetch(NPM_REGISTRY, { signal: AbortSignal.timeout(4000) })
|
|
32
|
+
.then((r) => r.json())
|
|
33
|
+
.then((data) => {
|
|
34
|
+
const latest = data?.version ?? null;
|
|
35
|
+
writeConfig({ ...readConfig(), _lastUpdateCheck: now, _latestVersion: latest });
|
|
36
|
+
return latest;
|
|
37
|
+
})
|
|
38
|
+
.catch(() => null); // never block the CLI on a network failure
|
|
39
|
+
|
|
40
|
+
return async () => {
|
|
41
|
+
const latest = await fetchPromise;
|
|
42
|
+
printNoticeIfStale(latest);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function printNoticeIfStale(latest) {
|
|
47
|
+
if (!latest || latest === currentVersion) return;
|
|
48
|
+
if (!isNewer(latest, currentVersion)) return;
|
|
49
|
+
|
|
50
|
+
process.stderr.write(
|
|
51
|
+
`\n Update available: ${currentVersion} → ${latest}\n` +
|
|
52
|
+
` Run: npm install -g @velaro/cli@latest\n\n`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isNewer(a, b) {
|
|
57
|
+
const pa = a.split('.').map(Number);
|
|
58
|
+
const pb = b.split('.').map(Number);
|
|
59
|
+
for (let i = 0; i < 3; i++) {
|
|
60
|
+
if ((pa[i] ?? 0) > (pb[i] ?? 0)) return true;
|
|
61
|
+
if ((pa[i] ?? 0) < (pb[i] ?? 0)) return false;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@velaro/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"velaro": "bin/velaro.js"
|
|
8
|
-
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@velaro/cli",
|
|
3
|
+
"version": "1.4.8",
|
|
4
|
+
"description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"velaro": "bin/velaro.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/postinstall.js"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18.0.0"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@azure/identity": "^4.4.1",
|
|
17
|
+
"@azure/keyvault-secrets": "^4.9.0",
|
|
18
|
+
"mssql": "^12.7.0",
|
|
19
|
+
"xlsx": "^0.18.5",
|
|
20
|
+
"yargs": "^17.7.2"
|
|
21
|
+
},
|
|
22
|
+
"optionalDependencies": {
|
|
23
|
+
"playwright": "^1.43.1"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/velaro/velaro-admin"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"lib/",
|
|
32
|
+
"scripts/"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Best-effort banner on install. Must NEVER throw — a postinstall failure
|
|
2
|
+
// can fail the entire `npm install` for the end user.
|
|
3
|
+
try {
|
|
4
|
+
const { printBannerIfFirstRun } = await import('../lib/banner.js');
|
|
5
|
+
printBannerIfFirstRun();
|
|
6
|
+
} catch (err) {
|
|
7
|
+
try {
|
|
8
|
+
process.stderr.write(`[velaro] postinstall banner skipped: ${err && err.message ? err.message : err}\n`);
|
|
9
|
+
} catch {
|
|
10
|
+
// swallow — nothing more we can do
|
|
11
|
+
}
|
|
12
|
+
}
|