faces-cli 1.6.6 → 1.6.7
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/commands/billing/{checkout.d.ts → subscription/activate.d.ts} +2 -2
- package/dist/commands/billing/subscription/activate.js +75 -0
- package/dist/commands/billing/subscription/cancel.d.ts +12 -0
- package/dist/commands/billing/subscription/cancel.js +68 -0
- package/dist/commands/billing/subscription/index.d.ts +10 -0
- package/dist/commands/billing/subscription/index.js +24 -0
- package/oclif.manifest.json +393 -332
- package/package.json +1 -1
- package/dist/commands/billing/checkout.js +0 -30
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
|
-
import { BaseCommand } from '../../base.js';
|
|
3
|
-
import { FacesAPIError } from '../../client.js';
|
|
4
|
-
export default class BillingCheckout extends BaseCommand {
|
|
5
|
-
static description = 'Get a Stripe checkout URL to upgrade your subscription plan';
|
|
6
|
-
static flags = {
|
|
7
|
-
...BaseCommand.baseFlags,
|
|
8
|
-
plan: Flags.string({
|
|
9
|
-
description: 'Plan to subscribe to',
|
|
10
|
-
options: ['connect'],
|
|
11
|
-
default: 'connect',
|
|
12
|
-
}),
|
|
13
|
-
};
|
|
14
|
-
async run() {
|
|
15
|
-
const { flags } = await this.parse(BillingCheckout);
|
|
16
|
-
const client = this.makeClient(flags);
|
|
17
|
-
let data;
|
|
18
|
-
try {
|
|
19
|
-
data = await client.post(`/v1/billing/checkout?plan=${flags.plan}&source=cli`);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
if (err instanceof FacesAPIError)
|
|
23
|
-
this.error(`Error (${err.statusCode}): ${err.message}`);
|
|
24
|
-
throw err;
|
|
25
|
-
}
|
|
26
|
-
if (!this.jsonEnabled())
|
|
27
|
-
this.printHuman(data);
|
|
28
|
-
return data;
|
|
29
|
-
}
|
|
30
|
-
}
|