@stripe/link-cli 0.17.0 → 0.17.1

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 +24 -1
  2. package/dist/cli.js +94 -12
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -111,6 +111,29 @@ link-cli auth login
111
111
 
112
112
  You receive a verification URL and a short phrase. Visit the URL, log in to your Link account, and enter the phrase to approve the connection.
113
113
 
114
+ ### Retrieve user info
115
+
116
+ ```bash
117
+ link-cli user-info retrieve --format json
118
+ ```
119
+
120
+ In addition to identity fields, the response can include Agent Wallet spend limits and step-up status:
121
+
122
+ ```json
123
+ {
124
+ "email": "jane@example.com",
125
+ "name": "Jane Doe",
126
+ "agent_wallet_spend_limits": {
127
+ "per_transaction": { "limit": 50000 },
128
+ "daily": { "limit": 500000, "used": 120000, "remaining": 380000 },
129
+ "thirty_day": { "limit": null, "used": 600000, "remaining": null }
130
+ },
131
+ "agent_wallet_step_up": { "status": "not_required" }
132
+ }
133
+ ```
134
+
135
+ Finite spend-limit values are cents because this response does not include a currency. A `null` limit or remaining amount means unlimited. Either Agent Wallet object can be absent when backend enrichment is unavailable; absence does not imply a limit or step-up status.
136
+
114
137
  ### List payment methods
115
138
 
116
139
  ```bash
@@ -496,4 +519,4 @@ pnpm turbo run build
496
519
  pnpm --filter @stripe/link-cli --filter @stripe/link-sdk publish --dry-run --no-git-checks
497
520
  ```
498
521
 
499
- CI runs the same publish dry-run for every pull request.
522
+ CI runs the same publish dry-run for every pull request.
package/dist/cli.js CHANGED
@@ -934,19 +934,54 @@ var TransactionsResource = class extends BaseResource {
934
934
  );
935
935
  }
936
936
  };
937
+ var rollingSpendLimitSchema = z8.object({
938
+ limit: z8.number().int().nullable(),
939
+ used: z8.number().int(),
940
+ remaining: z8.number().int().nullable()
941
+ });
942
+ var agentWalletSpendLimitsSchema = z8.object({
943
+ per_transaction: z8.object({
944
+ limit: z8.number().int().nullable()
945
+ }),
946
+ daily: rollingSpendLimitSchema,
947
+ thirty_day: rollingSpendLimitSchema
948
+ });
949
+ var agentWalletStepUpSchema = z8.object({
950
+ status: z8.enum([
951
+ "not_required",
952
+ "ssn_verification",
953
+ "identity_verification",
954
+ "contact_support",
955
+ "complete"
956
+ ])
957
+ });
937
958
  var userInfoSchema = z8.looseObject({
938
959
  email: z8.string().nullable().optional(),
939
960
  name: z8.string().nullable().optional(),
940
961
  first_name: z8.string().nullable().optional(),
941
962
  last_name: z8.string().nullable().optional(),
942
- phone: z8.string().nullable().optional()
943
- }).transform(({ email, name, first_name, last_name, phone }) => ({
944
- email: email ?? null,
945
- name: name ?? null,
946
- first_name: first_name ?? null,
947
- last_name: last_name ?? null,
948
- phone: phone ?? null
949
- }));
963
+ phone: z8.string().nullable().optional(),
964
+ agent_wallet_spend_limits: agentWalletSpendLimitsSchema.optional(),
965
+ agent_wallet_step_up: agentWalletStepUpSchema.optional()
966
+ }).transform(
967
+ ({
968
+ email,
969
+ name,
970
+ first_name,
971
+ last_name,
972
+ phone,
973
+ agent_wallet_spend_limits,
974
+ agent_wallet_step_up
975
+ }) => ({
976
+ email: email ?? null,
977
+ name: name ?? null,
978
+ first_name: first_name ?? null,
979
+ last_name: last_name ?? null,
980
+ phone: phone ?? null,
981
+ ...agent_wallet_spend_limits === void 0 ? {} : { agent_wallet_spend_limits },
982
+ ...agent_wallet_step_up === void 0 ? {} : { agent_wallet_step_up }
983
+ })
984
+ );
950
985
  var UserInfoResource = class extends BaseResource {
951
986
  constructor(options) {
952
987
  super(options, "/userinfo");
@@ -2803,7 +2838,7 @@ function buildHeaders(data, headers) {
2803
2838
  if (key) result[key] = value;
2804
2839
  }
2805
2840
  if (!Object.keys(result).some((key) => key.toLowerCase() === "user-agent")) {
2806
- result["User-Agent"] = `link-cli/${"0.17.0"}`;
2841
+ result["User-Agent"] = `link-cli/${"0.17.1"}`;
2807
2842
  }
2808
2843
  return result;
2809
2844
  }
@@ -7016,6 +7051,9 @@ import { Box as Box24, Text as Text26 } from "ink";
7016
7051
  import Spinner16 from "ink-spinner";
7017
7052
  import { useCallback as useCallback13 } from "react";
7018
7053
  import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
7054
+ function formatLimit(value) {
7055
+ return value === null ? "Unlimited" : `${value} cents`;
7056
+ }
7019
7057
  var UserInfoRetrieve = ({
7020
7058
  resource,
7021
7059
  onComplete
@@ -7048,7 +7086,51 @@ var UserInfoRetrieve = ({
7048
7086
  /* @__PURE__ */ jsxs24(Text26, { children: [
7049
7087
  /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "Phone: " }),
7050
7088
  userInfo?.phone ?? /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "Not set" })
7051
- ] })
7089
+ ] }),
7090
+ userInfo?.agent_wallet_spend_limits && /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", marginTop: 1, children: [
7091
+ /* @__PURE__ */ jsx35(Text26, { bold: true, children: "Agent Wallet Spend Limits" }),
7092
+ /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", paddingLeft: 2, children: [
7093
+ /* @__PURE__ */ jsxs24(Text26, { children: [
7094
+ /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "Per-transaction: " }),
7095
+ formatLimit(
7096
+ userInfo.agent_wallet_spend_limits.per_transaction.limit
7097
+ )
7098
+ ] }),
7099
+ /* @__PURE__ */ jsxs24(Text26, { children: [
7100
+ /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "Daily: " }),
7101
+ "limit",
7102
+ " ",
7103
+ formatLimit(userInfo.agent_wallet_spend_limits.daily.limit),
7104
+ ", used ",
7105
+ userInfo.agent_wallet_spend_limits.daily.used,
7106
+ " cents, remaining",
7107
+ " ",
7108
+ formatLimit(
7109
+ userInfo.agent_wallet_spend_limits.daily.remaining
7110
+ )
7111
+ ] }),
7112
+ /* @__PURE__ */ jsxs24(Text26, { children: [
7113
+ /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "30-day: " }),
7114
+ "limit",
7115
+ " ",
7116
+ formatLimit(
7117
+ userInfo.agent_wallet_spend_limits.thirty_day.limit
7118
+ ),
7119
+ ", used ",
7120
+ userInfo.agent_wallet_spend_limits.thirty_day.used,
7121
+ " ",
7122
+ "cents, remaining",
7123
+ " ",
7124
+ formatLimit(
7125
+ userInfo.agent_wallet_spend_limits.thirty_day.remaining
7126
+ )
7127
+ ] })
7128
+ ] })
7129
+ ] }),
7130
+ userInfo?.agent_wallet_step_up && /* @__PURE__ */ jsx35(Box24, { marginTop: 1, children: /* @__PURE__ */ jsxs24(Text26, { children: [
7131
+ /* @__PURE__ */ jsx35(Text26, { dimColor: true, children: "Agent Wallet step-up status: " }),
7132
+ userInfo.agent_wallet_step_up.status
7133
+ ] }) })
7052
7134
  ] })
7053
7135
  ] });
7054
7136
  };
@@ -7060,7 +7142,7 @@ function createUserInfoCli(createResource, authStorage2, envAccessToken2) {
7060
7142
  description: "User information commands"
7061
7143
  });
7062
7144
  cli2.command("retrieve", {
7063
- description: "Retrieve user info (email, name, phone)",
7145
+ description: "Retrieve user info, including optional Agent Wallet spend limits and step-up status",
7064
7146
  outputPolicy: "agent-only",
7065
7147
  middleware: [requireAuth(authStorage2, envAccessToken2)],
7066
7148
  async run(c) {
@@ -7677,7 +7759,7 @@ function cacheUpdateInfo(value, ttlMs = UPDATE_CACHE_TTL_MS) {
7677
7759
  }
7678
7760
 
7679
7761
  // src/cli.tsx
7680
- var cliVersion = "0.17.0";
7762
+ var cliVersion = "0.17.1";
7681
7763
  var cliName = "@stripe/link-cli";
7682
7764
  var defaultHeaders = {
7683
7765
  "User-Agent": `link-cli/${cliVersion}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/link-cli",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "link-cli": "./dist/cli.js"
@@ -45,7 +45,7 @@
45
45
  "tsx": "^4.23.5",
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^4.1.10",
48
- "@stripe/link-sdk": "0.3.0",
48
+ "@stripe/link-sdk": "0.3.1",
49
49
  "@stripe/link-typescript-config": "0.0.0"
50
50
  },
51
51
  "scripts": {