@stripe/link-cli 0.7.2 → 0.7.4

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.
Files changed (3) hide show
  1. package/README.md +4 -3
  2. package/dist/cli.js +16 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -216,7 +216,7 @@ A spend request moves through: **create** → **request approval** → **approve
216
216
 
217
217
  **Required fields for create:** `payment_method_id`, `merchant_name`, `merchant_url`, `context`, `amount`
218
218
 
219
- **Constraints:** `context` must be at least 100 characters; `amount` must not exceed 50000 (cents); `currency` must be a 3-letter ISO code. The user has 10 minutes from when approval is requested to approve. Approved credentials (card or SPT) are valid for 12 hours from spend request creation.
219
+ **Constraints:** `context` must be at least 100 characters; `amount` must not exceed 500000 (cents); `currency` must be a 3-letter ISO code. The user has 10 minutes from when approval is requested to approve. Approved credentials (card or SPT) are valid for 12 hours from spend request creation.
220
220
  **Test mode:** Pass `--test` to create testmode credentials (uses test card `4242424242424242`), useful for development and integration testing without real payment methods.
221
221
 
222
222
  ```bash
@@ -238,10 +238,11 @@ link-cli spend-request cancel lsrq_001
238
238
 
239
239
  | Limit | Value |
240
240
  |-------|-------|
241
- | Max amount per spend request | $500 (50,000 cents) |
241
+ | Max amount per spend request | $5,000 (500,000 cents) |
242
242
  | Approval window | 10 minutes — user must approve within 10 min of `request-approval` |
243
243
  | Card / SPT validity | 12 hours from spend request creation |
244
- | Daily spend | $500 |
244
+ | Daily spend | $5,000 |
245
+ | Monthly spend (30 days) | $20,000 |
245
246
  | Concurrent active requests (created + approved) | 30 |
246
247
  | Concurrent approved requests | 10 |
247
248
  | Hourly creation rate | 50 per hour |
package/dist/cli.js CHANGED
@@ -11424,11 +11424,13 @@ var SpendRequestResource = class {
11424
11424
  return this.createSpendRequest(params);
11425
11425
  }
11426
11426
  async createSpendRequest(params) {
11427
+ const { approve, ...body } = params;
11428
+ const url = approve ? `${this.spendRequestsEndpoint}/create_delegated` : this.spendRequestsEndpoint;
11427
11429
  const { status, data, rawBody } = await this.apiFetch({
11428
11430
  method: "POST",
11429
- url: this.spendRequestsEndpoint,
11431
+ url,
11430
11432
  headers: { "Content-Type": "application/json" },
11431
- body: JSON.stringify(params)
11433
+ body: JSON.stringify(body)
11432
11434
  });
11433
11435
  if (status < 200 || status >= 300) {
11434
11436
  throw new LinkApiError(
@@ -15304,6 +15306,13 @@ var RetrieveSpendRequest = ({
15304
15306
  " ",
15305
15307
  /* @__PURE__ */ jsx26(Text20, { bold: true, children: request?.line_items.map((li) => li.name).join(", ") })
15306
15308
  ] }),
15309
+ request?.link_pay_token && /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", marginTop: 1, children: [
15310
+ /* @__PURE__ */ jsx26(Text20, { bold: true, children: "Link Pay Token:" }),
15311
+ /* @__PURE__ */ jsxs19(Text20, { children: [
15312
+ " ",
15313
+ /* @__PURE__ */ jsx26(Text20, { bold: true, children: request.link_pay_token })
15314
+ ] })
15315
+ ] }),
15307
15316
  request?.payment_status_details && /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", marginTop: 1, children: [
15308
15317
  /* @__PURE__ */ jsx26(Text20, { bold: true, children: "Last Payment Attempt:" }),
15309
15318
  /* @__PURE__ */ jsxs19(Text20, { children: [
@@ -15429,7 +15438,7 @@ var createOptions = z7.object({
15429
15438
  networkId: z7.string().optional().describe(
15430
15439
  "Network ID (required for shared_payment_token) \u2014 use `link-cli mpp decode` to extract"
15431
15440
  ),
15432
- amount: z7.coerce.number().int().positive().max(5e4).describe("Amount in cents, max 50000 ($500.00)"),
15441
+ amount: z7.coerce.number().int().positive().max(5e5).describe("Amount in cents, max 500000 ($5,000.00)"),
15433
15442
  currency: z7.string().length(3).default("usd").describe("Currency code"),
15434
15443
  merchantName: z7.string().optional().describe(
15435
15444
  "Merchant name (required for card; forbidden for shared_payment_token)"
@@ -15450,6 +15459,7 @@ var createOptions = z7.object({
15450
15459
  test: z7.boolean().default(false).describe(
15451
15460
  "Use test mode (creates testmode credentials from test card data)"
15452
15461
  ),
15462
+ approve: z7.boolean().default(false).describe(""),
15453
15463
  outputFile: z7.string().optional().describe(
15454
15464
  "Write full card credentials to this file path; stdout shows redacted card data only"
15455
15465
  ),
@@ -15647,7 +15657,8 @@ function createSpendRequestCli(repository, authStorage2, envAccessToken2) {
15647
15657
  line_items: lineItems,
15648
15658
  totals,
15649
15659
  request_approval: requestApproval || void 0,
15650
- test: opts.test ? true : void 0
15660
+ test: opts.test ? true : void 0,
15661
+ approve: opts.approve ? true : void 0
15651
15662
  };
15652
15663
  const outputFile = opts.outputFile;
15653
15664
  const forceOverwrite = opts.force;
@@ -16463,7 +16474,7 @@ function cacheUpdateInfo(value, ttlMs = UPDATE_CACHE_TTL_MS) {
16463
16474
  }
16464
16475
 
16465
16476
  // src/cli.tsx
16466
- var cliVersion = "0.7.2";
16477
+ var cliVersion = "0.7.4";
16467
16478
  var cliName = "@stripe/link-cli";
16468
16479
  var defaultHeaders = {
16469
16480
  "User-Agent": `link-cli/${cliVersion}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/link-cli",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "link-cli": "./dist/cli.js"