@akropolys/cli 1.5.8 → 1.6.0
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/dist/index.js +1 -16
- package/package.json +1 -1
- package/src/commands/doctor.ts +1 -4
- package/src/commands/init.ts +2 -13
package/dist/index.js
CHANGED
|
@@ -43,20 +43,8 @@ async function runInit() {
|
|
|
43
43
|
try {
|
|
44
44
|
const siteId = await question(rl, import_picocolors.default.cyan("? Enter your Akropolys Site ID: "));
|
|
45
45
|
const apiToken = await question(rl, import_picocolors.default.cyan("? Enter your Akropolys API Token: "));
|
|
46
|
-
const apiUrlInput = await question(rl, import_picocolors.default.cyan("? Enter your Akropolys API URL (default: https://api.akropolys.io): "));
|
|
47
|
-
const apiUrl = apiUrlInput.trim() || "https://api.akropolys.io";
|
|
48
|
-
console.log(import_picocolors.default.cyan("? Select your vertical:"));
|
|
49
|
-
console.log(" 1. commerce");
|
|
50
|
-
console.log(" 2. property");
|
|
51
|
-
console.log(" 3. motor");
|
|
52
|
-
const verticalIndex = await question(rl, import_picocolors.default.cyan(" Select (1-3, default: 1): "));
|
|
53
|
-
let vertical = "commerce";
|
|
54
|
-
if (verticalIndex === "2") vertical = "property";
|
|
55
|
-
else if (verticalIndex === "3") vertical = "motor";
|
|
56
46
|
const envContent = `NEXT_PUBLIC_AKROPOLYS_SITE_ID=${siteId.trim()}
|
|
57
47
|
NEXT_PUBLIC_AKROPOLYS_API_TOKEN=${apiToken.trim()}
|
|
58
|
-
NEXT_PUBLIC_AKROPOLYS_API_URL=${apiUrl.trim()}
|
|
59
|
-
NEXT_PUBLIC_AKROPOLYS_VERTICAL=${vertical}
|
|
60
48
|
`;
|
|
61
49
|
import_fs.default.writeFileSync(".env", envContent, "utf-8");
|
|
62
50
|
console.log(import_picocolors.default.dim("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
@@ -101,13 +89,11 @@ async function runDoctor(options) {
|
|
|
101
89
|
loadEnv();
|
|
102
90
|
const siteId = process.env.NEXT_PUBLIC_AKROPOLYS_SITE_ID || process.env.VITE_AKROPOLYS_SITE_ID || "";
|
|
103
91
|
const apiToken = process.env.NEXT_PUBLIC_AKROPOLYS_API_TOKEN || process.env.VITE_AKROPOLYS_API_TOKEN || "";
|
|
104
|
-
const apiUrl = process.env.NEXT_PUBLIC_AKROPOLYS_API_URL || process.env.VITE_AKROPOLYS_API_URL || "https://api.akropolys.
|
|
105
|
-
const vertical = process.env.NEXT_PUBLIC_AKROPOLYS_VERTICAL || process.env.VITE_AKROPOLYS_VERTICAL || "commerce";
|
|
92
|
+
const apiUrl = process.env.NEXT_PUBLIC_AKROPOLYS_API_URL || process.env.VITE_AKROPOLYS_API_URL || "https://api.akropolys.cloud/v1";
|
|
106
93
|
if (options.verbose) {
|
|
107
94
|
console.log(import_picocolors2.default.dim(`[Verbose] Site ID: ${siteId || "<not set>"}`));
|
|
108
95
|
console.log(import_picocolors2.default.dim(`[Verbose] API Token: ${apiToken ? "********" : "<not set>"}`));
|
|
109
96
|
console.log(import_picocolors2.default.dim(`[Verbose] API URL: ${apiUrl}`));
|
|
110
|
-
console.log(import_picocolors2.default.dim(`[Verbose] Vertical: ${vertical}`));
|
|
111
97
|
}
|
|
112
98
|
if (!siteId) {
|
|
113
99
|
console.log(import_picocolors2.default.red("\u274C Configuration: Site ID is missing. Set NEXT_PUBLIC_AKROPOLYS_SITE_ID in your env."));
|
|
@@ -136,7 +122,6 @@ async function runDoctor(options) {
|
|
|
136
122
|
process.exit(2);
|
|
137
123
|
}
|
|
138
124
|
console.log(import_picocolors2.default.green(`\u2713 Connection: Successfully connected to ${apiUrl} (ping: ${duration}ms)`));
|
|
139
|
-
console.log(import_picocolors2.default.green(`\u2713 Integration: Site vertical configured as "${vertical}"`));
|
|
140
125
|
console.log(import_picocolors2.default.bold(import_picocolors2.default.green("\nStatus: Healthy (All configuration and connectivity checks passed)")));
|
|
141
126
|
process.exit(0);
|
|
142
127
|
} catch (err) {
|
package/package.json
CHANGED
package/src/commands/doctor.ts
CHANGED
|
@@ -31,14 +31,12 @@ export async function runDoctor(options: { verbose?: boolean }) {
|
|
|
31
31
|
|
|
32
32
|
const siteId = process.env.NEXT_PUBLIC_AKROPOLYS_SITE_ID || process.env.VITE_AKROPOLYS_SITE_ID || '';
|
|
33
33
|
const apiToken = process.env.NEXT_PUBLIC_AKROPOLYS_API_TOKEN || process.env.VITE_AKROPOLYS_API_TOKEN || '';
|
|
34
|
-
const apiUrl = process.env.NEXT_PUBLIC_AKROPOLYS_API_URL || process.env.VITE_AKROPOLYS_API_URL || 'https://api.akropolys.
|
|
35
|
-
const vertical = process.env.NEXT_PUBLIC_AKROPOLYS_VERTICAL || process.env.VITE_AKROPOLYS_VERTICAL || 'commerce';
|
|
34
|
+
const apiUrl = process.env.NEXT_PUBLIC_AKROPOLYS_API_URL || process.env.VITE_AKROPOLYS_API_URL || 'https://api.akropolys.cloud/v1';
|
|
36
35
|
|
|
37
36
|
if (options.verbose) {
|
|
38
37
|
console.log(pc.dim(`[Verbose] Site ID: ${siteId || '<not set>'}`));
|
|
39
38
|
console.log(pc.dim(`[Verbose] API Token: ${apiToken ? '********' : '<not set>'}`));
|
|
40
39
|
console.log(pc.dim(`[Verbose] API URL: ${apiUrl}`));
|
|
41
|
-
console.log(pc.dim(`[Verbose] Vertical: ${vertical}`));
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
// 1. Configuration check
|
|
@@ -76,7 +74,6 @@ export async function runDoctor(options: { verbose?: boolean }) {
|
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
console.log(pc.green(`✓ Connection: Successfully connected to ${apiUrl} (ping: ${duration}ms)`));
|
|
79
|
-
console.log(pc.green(`✓ Integration: Site vertical configured as "${vertical}"`));
|
|
80
77
|
|
|
81
78
|
console.log(pc.bold(pc.green('\nStatus: Healthy (All configuration and connectivity checks passed)')));
|
|
82
79
|
process.exit(0);
|
package/src/commands/init.ts
CHANGED
|
@@ -18,22 +18,11 @@ export async function runInit() {
|
|
|
18
18
|
try {
|
|
19
19
|
const siteId = await question(rl, pc.cyan('? Enter your Akropolys Site ID: '));
|
|
20
20
|
const apiToken = await question(rl, pc.cyan('? Enter your Akropolys API Token: '));
|
|
21
|
-
const apiUrlInput = await question(rl, pc.cyan('? Enter your Akropolys API URL (default: https://api.akropolys.io): '));
|
|
22
|
-
const apiUrl = apiUrlInput.trim() || 'https://api.akropolys.io';
|
|
23
|
-
|
|
24
|
-
console.log(pc.cyan('? Select your vertical:'));
|
|
25
|
-
console.log(' 1. commerce');
|
|
26
|
-
console.log(' 2. property');
|
|
27
|
-
console.log(' 3. motor');
|
|
28
|
-
const verticalIndex = await question(rl, pc.cyan(' Select (1-3, default: 1): '));
|
|
29
|
-
let vertical = 'commerce';
|
|
30
|
-
if (verticalIndex === '2') vertical = 'property';
|
|
31
|
-
else if (verticalIndex === '3') vertical = 'motor';
|
|
32
21
|
|
|
22
|
+
// apiUrl is optional — the SDK defaults to the shared managed backend
|
|
23
|
+
// (https://api.akropolys.cloud/v1). Only self-hosted/local dev needs to set it.
|
|
33
24
|
const envContent = `NEXT_PUBLIC_AKROPOLYS_SITE_ID=${siteId.trim()}
|
|
34
25
|
NEXT_PUBLIC_AKROPOLYS_API_TOKEN=${apiToken.trim()}
|
|
35
|
-
NEXT_PUBLIC_AKROPOLYS_API_URL=${apiUrl.trim()}
|
|
36
|
-
NEXT_PUBLIC_AKROPOLYS_VERTICAL=${vertical}
|
|
37
26
|
`;
|
|
38
27
|
|
|
39
28
|
fs.writeFileSync('.env', envContent, 'utf-8');
|