@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "MyAPI command-line interface",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
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 === 'UPGRADE_REQUIRED') error('A verified email is required. Run: myapi auth link');
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);