commet 0.7.0 → 0.7.1
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 +4 -4
- package/dist/index.js +8 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,8 +43,8 @@ commet login
|
|
|
43
43
|
Prompts you to select an environment (Sandbox or Production), then opens your browser to authenticate. Creates `~/.commet/auth.json` with your credentials.
|
|
44
44
|
|
|
45
45
|
**Important:** Sandbox and Production are completely isolated platforms with separate accounts:
|
|
46
|
-
- **Sandbox**: `
|
|
47
|
-
- **Production**: `
|
|
46
|
+
- **Sandbox**: `sandbox.commet.co` - Development and testing
|
|
47
|
+
- **Production**: `commet.co` - Live billing operations
|
|
48
48
|
|
|
49
49
|
Make sure to login to the correct environment for your needs.
|
|
50
50
|
|
|
@@ -210,8 +210,8 @@ Add `.commet/` to `.gitignore` if different developers use different organizatio
|
|
|
210
210
|
|
|
211
211
|
Commet supports two completely isolated environments:
|
|
212
212
|
|
|
213
|
-
- **Sandbox** (`
|
|
214
|
-
- **Production** (`
|
|
213
|
+
- **Sandbox** (`sandbox.commet.co`): Development and testing with separate data
|
|
214
|
+
- **Production** (`commet.co`): Live billing operations with real customers
|
|
215
215
|
|
|
216
216
|
**Important:** Each environment requires separate authentication because they are independent platforms. To work with both:
|
|
217
217
|
|
package/dist/index.js
CHANGED
|
@@ -135,18 +135,12 @@ var import_commander2 = require("commander");
|
|
|
135
135
|
var import_ora = __toESM(require("ora"));
|
|
136
136
|
|
|
137
137
|
// src/utils/api.ts
|
|
138
|
-
function
|
|
138
|
+
function getBaseURL(environment) {
|
|
139
139
|
if (environment === "production") {
|
|
140
|
-
return "https://
|
|
140
|
+
return "https://commet.co";
|
|
141
141
|
}
|
|
142
142
|
return "https://sandbox.commet.co";
|
|
143
143
|
}
|
|
144
|
-
function getApiBaseURL(environment) {
|
|
145
|
-
if (environment === "production") {
|
|
146
|
-
return "https://api.commet.co";
|
|
147
|
-
}
|
|
148
|
-
return "https://api.sandbox.commet.co";
|
|
149
|
-
}
|
|
150
144
|
async function apiRequest(endpoint, options = {}) {
|
|
151
145
|
const auth = loadAuth();
|
|
152
146
|
if (!auth) {
|
|
@@ -253,7 +247,7 @@ var linkCommand = new import_commander2.Command("link").description("Link this p
|
|
|
253
247
|
console.log(import_chalk3.default.red("\u2717 Could not load authentication"));
|
|
254
248
|
return;
|
|
255
249
|
}
|
|
256
|
-
const baseURL =
|
|
250
|
+
const baseURL = getBaseURL(auth.environment);
|
|
257
251
|
const result = await apiRequest(
|
|
258
252
|
`${baseURL}/cli/organizations`
|
|
259
253
|
);
|
|
@@ -267,7 +261,7 @@ var linkCommand = new import_commander2.Command("link").description("Link this p
|
|
|
267
261
|
spinner.stop();
|
|
268
262
|
console.log(import_chalk3.default.yellow("\u26A0 No organizations found"));
|
|
269
263
|
console.log(
|
|
270
|
-
import_chalk3.default.dim("Create an organization at https://
|
|
264
|
+
import_chalk3.default.dim("Create an organization at https://commet.co first")
|
|
271
265
|
);
|
|
272
266
|
return;
|
|
273
267
|
}
|
|
@@ -339,7 +333,7 @@ var listCommand = new import_commander3.Command("list").description("List event
|
|
|
339
333
|
return;
|
|
340
334
|
}
|
|
341
335
|
const spinner = (0, import_ora2.default)(`Fetching ${type}...`).start();
|
|
342
|
-
const baseURL =
|
|
336
|
+
const baseURL = getBaseURL(projectConfig.environment);
|
|
343
337
|
const result = await apiRequest(
|
|
344
338
|
`${baseURL}/cli/types?orgId=${projectConfig.orgId}`
|
|
345
339
|
);
|
|
@@ -433,7 +427,7 @@ var loginCommand = new import_commander4.Command("login").description("Authentic
|
|
|
433
427
|
return;
|
|
434
428
|
}
|
|
435
429
|
const spinner = (0, import_ora3.default)("Initiating login flow...").start();
|
|
436
|
-
const baseURL =
|
|
430
|
+
const baseURL = getBaseURL(environment);
|
|
437
431
|
try {
|
|
438
432
|
const deviceResponse = await fetch(`${baseURL}/api/auth/device/code`, {
|
|
439
433
|
method: "POST",
|
|
@@ -706,7 +700,7 @@ var pullCommand = new import_commander6.Command("pull").description("Pull type d
|
|
|
706
700
|
return;
|
|
707
701
|
}
|
|
708
702
|
const spinner = (0, import_ora4.default)("Fetching type definitions...").start();
|
|
709
|
-
const baseURL =
|
|
703
|
+
const baseURL = getBaseURL(projectConfig.environment);
|
|
710
704
|
const result = await apiRequest(
|
|
711
705
|
`${baseURL}/cli/types?orgId=${projectConfig.orgId}`
|
|
712
706
|
);
|
|
@@ -797,7 +791,7 @@ var switchCommand = new import_commander7.Command("switch").description("Switch
|
|
|
797
791
|
console.log(import_chalk8.default.red("\u2717 Could not load authentication"));
|
|
798
792
|
return;
|
|
799
793
|
}
|
|
800
|
-
const baseURL =
|
|
794
|
+
const baseURL = getBaseURL(auth.environment);
|
|
801
795
|
const result = await apiRequest(
|
|
802
796
|
`${baseURL}/cli/organizations`
|
|
803
797
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commet",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Commet CLI - Manage your billing platform from the command line",
|
|
5
5
|
"bin": {
|
|
6
6
|
"commet": "./bin/commet"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"jsonc-parser": "^3.3.1",
|
|
26
26
|
"open": "^10.0.0",
|
|
27
27
|
"ora": "^7.0.1",
|
|
28
|
-
"@commet/node": "0.7.
|
|
28
|
+
"@commet/node": "0.7.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^20.10.0",
|