@mynthio/cli 0.0.23 → 0.0.24
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/bin.js +4 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -20,7 +20,7 @@ import fuzzysort from "fuzzysort";
|
|
|
20
20
|
const WORKOS_CLIENT_ID = "client_01KATK792RR5ZCHMF5YMNN1ZSE";
|
|
21
21
|
/** Overridable so the device-login flow can be exercised against a test server. */
|
|
22
22
|
const WORKOS_API_URL = process.env["MYNTH_WORKOS_API_URL"] ?? "https://api.workos.com";
|
|
23
|
-
const CLI_VERSION = "0.0.
|
|
23
|
+
const CLI_VERSION = "0.0.24";
|
|
24
24
|
const trimTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
25
25
|
const nonEmpty = (value) => value !== void 0 && value.length > 0 ? value : void 0;
|
|
26
26
|
const loadConfig = () => ({
|
|
@@ -78,6 +78,8 @@ const EXIT_BY_API_CODE = {
|
|
|
78
78
|
UNAUTHORIZED: EXIT_CODES.auth,
|
|
79
79
|
INSUFFICIENT_SCOPE: EXIT_CODES.auth,
|
|
80
80
|
VALIDATION_ERROR: EXIT_CODES.usage,
|
|
81
|
+
INVALID_JSON: EXIT_CODES.usage,
|
|
82
|
+
UNSUPPORTED_MEDIA_TYPE: EXIT_CODES.usage,
|
|
81
83
|
INSUFFICIENT_BALANCE: EXIT_CODES.insufficientCredits,
|
|
82
84
|
SPENDING_LIMIT_EXCEEDED: EXIT_CODES.insufficientCredits,
|
|
83
85
|
RESTRICTED_CONTENT: EXIT_CODES.moderation
|
|
@@ -89,6 +91,7 @@ const exitCodeForError = (error) => {
|
|
|
89
91
|
const byCode = error.code !== void 0 ? EXIT_BY_API_CODE[error.code] : void 0;
|
|
90
92
|
if (byCode !== void 0) return byCode;
|
|
91
93
|
if (error.status === 401 || error.status === 403) return EXIT_CODES.auth;
|
|
94
|
+
if (error.status === 402) return EXIT_CODES.insufficientCredits;
|
|
92
95
|
if (error.status === 429) return EXIT_CODES.rateLimited;
|
|
93
96
|
return EXIT_CODES.error;
|
|
94
97
|
}
|