@myapihq/cli 1.0.52 → 1.0.54
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 +3 -3
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -143,10 +143,10 @@ async function main() {
|
|
|
143
143
|
if (err.status === 401)
|
|
144
144
|
error('Invalid API key. Run: myapi auth setup');
|
|
145
145
|
else if (err.status === 402) {
|
|
146
|
-
if (err.code === 'REGISTRATION_REQUIRED')
|
|
147
|
-
error('A verified email is required. Run: myapi auth link');
|
|
148
|
-
else if (err.code === 'UPGRADE_REQUIRED')
|
|
146
|
+
if (err.code === 'REGISTRATION_REQUIRED' || err.code === 'UPGRADE_REQUIRED')
|
|
149
147
|
error('A verified email is required. Run: myapi auth link');
|
|
148
|
+
else if (err.code === 'NO_PAYMENT_METHOD')
|
|
149
|
+
error('No payment method on file. Run: myapi billing setup');
|
|
150
150
|
else
|
|
151
151
|
error(`Insufficient balance. Run: myapi billing topup <amount>`);
|
|
152
152
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -121,8 +121,8 @@ async function main() {
|
|
|
121
121
|
if (err instanceof MyApiError) {
|
|
122
122
|
if (err.status === 401) error('Invalid API key. Run: myapi auth setup');
|
|
123
123
|
else if (err.status === 402) {
|
|
124
|
-
if (err.code === 'REGISTRATION_REQUIRED') error('A verified email is required. Run: myapi auth link');
|
|
125
|
-
else if (err.code === '
|
|
124
|
+
if (err.code === 'REGISTRATION_REQUIRED' || err.code === 'UPGRADE_REQUIRED') error('A verified email is required. Run: myapi auth link');
|
|
125
|
+
else if (err.code === 'NO_PAYMENT_METHOD') error('No payment method on file. Run: myapi billing setup');
|
|
126
126
|
else error(`Insufficient balance. Run: myapi billing topup <amount>`);
|
|
127
127
|
}
|
|
128
128
|
else error(err.code || err.message);
|