faceless-cli 1.1.17 → 1.1.18
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 +1 -0
- package/package.json +1 -1
- package/src/generated/operations.json +62 -1
- package/src/index.mjs +10 -0
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Key precedence: `--api-key` flag, then `FACELESS_API_KEY`, then the config file.
|
|
|
37
37
|
| `faceless logout` | Remove the saved API key |
|
|
38
38
|
| `faceless whoami` | Identify the caller (team, plan, scopes) |
|
|
39
39
|
| `faceless credits` | Credit balance and history |
|
|
40
|
+
| `faceless buy-credits` | Buy a credit pack with an agent payment token (`--pack`, `--token`) |
|
|
40
41
|
| `faceless videos create` | Create a faceless video from a script (charges credits) |
|
|
41
42
|
| `faceless videos captions` | Caption an existing video or audio URL |
|
|
42
43
|
| `faceless videos list` | List the team's videos |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedFrom": "src/backend/api/v1/spec/registry.mjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"baseUrl": "https://faceless.so/api/v1",
|
|
5
5
|
"operations": [
|
|
6
6
|
{
|
|
@@ -105,6 +105,67 @@
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"operationId": "buyCredits",
|
|
110
|
+
"method": "post",
|
|
111
|
+
"path": "/credits",
|
|
112
|
+
"resource": "credits",
|
|
113
|
+
"summary": "Buy a credit pack with an agent payment token",
|
|
114
|
+
"description": "Buys a credit pack and adds the credits to the team immediately, paid with a Stripe Shared Payment Token (spt_...) that the customer approved in their Link agent wallet. Packs: pack_10 ($10, 100 credits), pack_25 ($25, 275), pack_50 ($50, 600); active subscribers get more credits per pack at their plan rate. Request the token for the Faceless.so Stripe profile (profile_61UDMKC11wsLfeXaMA6UDMKCL0SQKAF3aHKCFz33IPL6) with a USD max_amount of at least the pack price. Tokens are single use: retrying with the same token never charges twice. A declined, expired or already used token returns 402 payment_failed.",
|
|
115
|
+
"scopes": [
|
|
116
|
+
"credits:write"
|
|
117
|
+
],
|
|
118
|
+
"status": 201,
|
|
119
|
+
"idempotent": true,
|
|
120
|
+
"terminalStates": null,
|
|
121
|
+
"creditCost": "none (adds credits; charges the payment token the pack price in USD)",
|
|
122
|
+
"cli": {
|
|
123
|
+
"command": "buy-credits"
|
|
124
|
+
},
|
|
125
|
+
"mcp": {
|
|
126
|
+
"name": "faceless_buy_credits",
|
|
127
|
+
"enabled": false
|
|
128
|
+
},
|
|
129
|
+
"querySchema": null,
|
|
130
|
+
"requestSchema": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"packId": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": [
|
|
136
|
+
"pack_10",
|
|
137
|
+
"pack_25",
|
|
138
|
+
"pack_50"
|
|
139
|
+
],
|
|
140
|
+
"description": "Credit pack to buy: pack_10 ($10), pack_25 ($25) or pack_50 ($50)"
|
|
141
|
+
},
|
|
142
|
+
"paymentToken": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"pattern": "^spt_[A-Za-z0-9_]+$",
|
|
145
|
+
"description": "Stripe Shared Payment Token granted to Faceless.so by the customer's agent wallet"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"required": [
|
|
149
|
+
"packId",
|
|
150
|
+
"paymentToken"
|
|
151
|
+
],
|
|
152
|
+
"additionalProperties": false
|
|
153
|
+
},
|
|
154
|
+
"requestExample": {
|
|
155
|
+
"packId": "pack_10",
|
|
156
|
+
"paymentToken": "spt_1Rx2abc"
|
|
157
|
+
},
|
|
158
|
+
"responseExample": {
|
|
159
|
+
"success": true,
|
|
160
|
+
"data": {
|
|
161
|
+
"packId": "pack_10",
|
|
162
|
+
"amountUsd": 10,
|
|
163
|
+
"creditsAdded": 100,
|
|
164
|
+
"balance": 440,
|
|
165
|
+
"paymentIntentId": "pi_3Rx2abc"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
108
169
|
{
|
|
109
170
|
"operationId": "createVideo",
|
|
110
171
|
"method": "post",
|
package/src/index.mjs
CHANGED
|
@@ -286,6 +286,16 @@ program
|
|
|
286
286
|
print(result, { json: cmd.optsWithGlobals().json });
|
|
287
287
|
});
|
|
288
288
|
|
|
289
|
+
program
|
|
290
|
+
.command("buy-credits")
|
|
291
|
+
.description(getOp("buyCredits").summary)
|
|
292
|
+
.requiredOption("--pack <id>", "credit pack: pack_10, pack_25 or pack_50")
|
|
293
|
+
.requiredOption("--token <spt>", "Stripe Shared Payment Token (spt_...) from your agent wallet")
|
|
294
|
+
.action(async (opts, cmd) => {
|
|
295
|
+
const result = await execute("buyCredits", { body: { packId: opts.pack, paymentToken: opts.token } }, cmd);
|
|
296
|
+
print(result, { json: cmd.optsWithGlobals().json });
|
|
297
|
+
});
|
|
298
|
+
|
|
289
299
|
const videos = program.command("videos").description("Faceless video projects");
|
|
290
300
|
|
|
291
301
|
withWaitFlags(
|