@sangria-sdk/cli 0.2.4 → 0.2.5

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 CHANGED
@@ -34,6 +34,8 @@ sangria settings show
34
34
  sangria settings set-phone "(415) 555-2671"
35
35
  sangria settings update --country US --postal-code 94105
36
36
  sangria settings update --country US --line1 "123 Market St" --city "San Francisco" --state CA --postal-code 94105
37
+ sangria settings update --line2 "Apt 4B" # any subset: omitted fields keep their saved value
38
+ sangria settings update --line2 "" # empty clears
37
39
  sangria discover "decaf espresso pods" --reasoning "nespresso-compatible, caffeine-sensitive user" --max-price 30
38
40
  sangria discover --url https://www.amazon.com/dp/B0XXXXXXXX
39
41
  sangria discover --url https://a.co/d/XXXXXXXX
@@ -22,26 +22,28 @@ async function updatePhone(phone, ctx) {
22
22
  process.stdout.write(`Phone: ${result.phone}\n`);
23
23
  return EXIT.success;
24
24
  }
25
- // updateShipping accepts partial shapes, mirroring the backend: --country alone
26
- // (pins your marketplace + currency), --country + --postal-code (discovery-
27
- // ready), --postal-code alone (once your country is set), or a full address
28
- // (--country --line1 --city --postal-code [--state] buy-ready). The message
29
- // reflects what was sent since a country-only pin writes no address.
25
+ // updateShipping sends whatever flags were given. Any subset is valid: what you
26
+ // pass replaces, what you leave out keeps its saved value, so correcting one
27
+ // line costs one flag. Passing an empty value clears the field — `--line2 ""`
28
+ // removes an apartment which the API allows only where losing the value still
29
+ // leaves a deliverable address: the second line always, and the state in markets
30
+ // that have none. Everything else it refuses to blank rather than store an
31
+ // address that cannot ship.
32
+ //
33
+ // The result is the whole stored address rather than a summary of what was sent:
34
+ // the API normalizes (whitespace, casing, the country from your pinned market),
35
+ // so reading back the request would show what you typed instead of what is now
36
+ // saved.
30
37
  async function updateShipping(flags, ctx) {
31
38
  const shipping = buildShippingUpdate(flags);
32
39
  const client = new SangriaAgentClient(ctx.config);
33
40
  const result = await client.updateShippingAddress(shipping);
34
- if (ctx.json)
41
+ if (ctx.json) {
35
42
  printJson(result);
36
- else if (shipping.line1) {
37
- process.stdout.write(`Shipping address saved. You can now discover and buy products.\n`);
38
- }
39
- else if (shipping.postal_code) {
40
- process.stdout.write(`Postal code set. You can now run 'sangria discover "<what to find>" --reasoning "<why>"'.\n`);
41
- }
42
- else {
43
- process.stdout.write(`Country set to ${shipping.country}. Add a postal code to start discovering: sangria settings update --postal-code <code>.\n`);
43
+ return EXIT.success;
44
44
  }
45
+ process.stdout.write("Saved.\n");
46
+ printShipping(result.shipping);
45
47
  return EXIT.success;
46
48
  }
47
49
  async function showSettings(ctx) {
@@ -53,10 +55,20 @@ async function showSettings(ctx) {
53
55
  }
54
56
  const phoneSet = result.phone != null;
55
57
  process.stdout.write(`Phone: ${phoneSet ? result.phone : "(not set) — run 'sangria settings set-phone <phone>'"}\n`);
56
- const s = result.shipping;
58
+ printShipping(result.shipping);
59
+ return EXIT.success;
60
+ }
61
+ // printShipping renders what is saved and, when the account isn't ready yet,
62
+ // the one command that moves it forward.
63
+ //
64
+ // The "still needed" line matters most for the account that has a country and
65
+ // nothing else. That account IS set up — it has a pinned market and can top up
66
+ // — so calling it "(not set)" is both wrong and unhelpful, since the person
67
+ // earliest in setup is the one who most needs the next command.
68
+ function printShipping(s) {
57
69
  if (!s || !(s.line1 || s.city || s.state || s.postal_code || s.country)) {
58
70
  process.stdout.write("Shipping: (not set) — run 'sangria settings update --country <US|SG> --postal-code <code>'\n");
59
- return EXIT.success;
71
+ return;
60
72
  }
61
73
  process.stdout.write("Shipping:\n");
62
74
  process.stdout.write(` line1: ${s.line1 || "(not set)"}\n`);
@@ -66,50 +78,41 @@ async function showSettings(ctx) {
66
78
  process.stdout.write(` state: ${s.state || "(not set)"}\n`);
67
79
  process.stdout.write(` postal_code: ${s.postal_code || "(not set)"}\n`);
68
80
  process.stdout.write(` country: ${s.country || "(not set)"}\n`);
69
- return EXIT.success;
70
- }
71
- function buildShippingUpdate(flags) {
72
- const has = (v) => v !== undefined && v.trim() !== "";
73
- const hasLine1 = has(flags.line1);
74
- const hasLine2 = has(flags.line2);
75
- const hasCity = has(flags.city);
76
- const hasState = has(flags.state);
77
- const hasPostal = has(flags.postalCode);
78
- const hasCountry = has(flags.country);
79
- // Full address (buy-ready). state is required only where the market requires
80
- // it (US), so the CLI doesn't force --state — the backend validates per market.
81
- const fullAddress = hasLine1 && hasCity && hasPostal && hasCountry;
82
- if (fullAddress) {
83
- return {
84
- line1: flags.line1,
85
- ...(flags.line2 === undefined ? {} : { line2: flags.line2 }),
86
- city: flags.city,
87
- ...(hasState ? { state: flags.state } : {}),
88
- postal_code: flags.postalCode,
89
- country: flags.country,
90
- };
91
- }
92
- // Any street-level flag signals intent to set a full address. If the full set
93
- // isn't present, reject — otherwise the request would reduce to a postal-only
94
- // update and silently drop line1/city/state (mirrors the backend guard).
95
- if (hasLine1 || hasLine2 || hasCity || hasState) {
96
- throw new CliError("A full address needs --country --line1 --city --postal-code together (plus --state where required). Provide the complete address, or pass only --country and/or --postal-code.", EXIT.usage);
81
+ // In dependency order, so the hint is always the immediate next step rather
82
+ // than a list of everything still outstanding.
83
+ if (!s.postal_code) {
84
+ process.stdout.write(" → add a postal code to start discovering: sangria settings update --postal-code <code>\n");
97
85
  }
98
- // Country present (± postal) — pins the wallet; country+postal = discovery-ready.
99
- if (hasCountry) {
100
- return { country: flags.country, ...(hasPostal ? { postal_code: flags.postalCode } : {}) };
86
+ else if (!s.line1 || !s.city) {
87
+ process.stdout.write(" → add a delivery address before buying: sangria settings update --line1 <line1> --city <city> [--state <state>]\n");
101
88
  }
102
- // Postal-only — requires an already-pinned country (backend returns country_required otherwise).
103
- if (hasPostal) {
104
- return { postal_code: flags.postalCode };
89
+ else if (s.country === "US" && !s.state) {
90
+ // The one field the API accepts now and refuses at the buy. Saving is no
91
+ // longer the moment it is checked — completeness is the buy gate's business
92
+ // — so without this the gap surfaces after a search, a quote and an
93
+ // approval. Naming the country rather than asking the server keeps it a
94
+ // hint: the API stays the authority on whether an address can ship.
95
+ process.stdout.write(" → US addresses need a state before buying: sangria settings update --state <state>\n");
105
96
  }
106
- throw new CliError("Provide --country to get started, --postal-code, or a complete address (--country --line1 --city --postal-code [--state]).", EXIT.usage);
107
97
  }
108
- function formatShipping(a) {
109
- if (a.line1 && a.city && a.state && a.postal_code) {
110
- const line2 = a.line2 ? ` ${a.line2}` : "";
111
- return `${a.line1}${line2}, ${a.city}, ${a.state} ${a.postal_code}, ${a.country}`;
98
+ // buildShippingUpdate forwards exactly the flags that were given. A flag that
99
+ // was not passed is absent from the payload and keeps its saved value; a flag
100
+ // passed empty is sent as empty, which clears it. The parser preserves that
101
+ // distinction (`--line2 ""` is not the same as omitting --line2), and the API
102
+ // is what decides which fields may be cleared, so there are no shape rules here
103
+ // to drift out of step with it.
104
+ function buildShippingUpdate(flags) {
105
+ const update = {
106
+ ...(flags.line1 === undefined ? {} : { line1: flags.line1 }),
107
+ ...(flags.line2 === undefined ? {} : { line2: flags.line2 }),
108
+ ...(flags.city === undefined ? {} : { city: flags.city }),
109
+ ...(flags.state === undefined ? {} : { state: flags.state }),
110
+ ...(flags.postalCode === undefined ? {} : { postal_code: flags.postalCode }),
111
+ ...(flags.country === undefined ? {} : { country: flags.country }),
112
+ };
113
+ if (Object.keys(update).length === 0) {
114
+ throw new CliError("Nothing to update. Pass any of --country --line1 --line2 --city --state --postal-code; only the ones you pass change.", EXIT.usage);
112
115
  }
113
- return `zipcode ${a.postal_code || "(not set)"}`;
116
+ return update;
114
117
  }
115
118
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/commands/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAa7C,MAAM,CAAC,KAAK,UAAU,kB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AoB;IAC/C,MAAM,MAAM,GAAmB;QAC7B,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5D,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5D,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QACzD,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5D,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC5E,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;KACnE,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,QAAQ,CAChB,uHAAuH,EACvH,IAAI,CAAC,KAAK,CACX,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/lib/help.js CHANGED
@@ -13,9 +13,9 @@ Usage:
13
13
  sangria balance [--json]
14
14
  sangria settings show [--json]
15
15
  sangria settings set-phone <phone> [--json]
16
- sangria settings update --country <US|SG> [--postal-code <code>] [--json]
17
- sangria settings update --postal-code <code> [--json]
18
- sangria settings update --country <US|SG> --line1 <line1> [--line2 <line2>] --city <city> [--state <state>] --postal-code <code> [--json]
16
+ sangria settings update [--country <US|SG>] [--line1 <line1>] [--line2 <line2>] [--city <city>] [--state <state>] [--postal-code <code>] [--json]
17
+ Pass any subset: flags you send replace, flags you omit keep their saved value.
18
+ Pass an empty value to clear a field, e.g. --line2 "" to remove an apartment.
19
19
  sangria discover <intent> --reasoning <text> [--context <json>] [--min-price <amount>] [--max-price <amount>] [--json]
20
20
  sangria discover --url <product_url> [--context <json>] [--json]
21
21
  sangria buy <discovery_id> <sku> [--json]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sangria-sdk/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Sangria agent CLI for discovery and buying",
5
5
  "repository": {
6
6
  "type": "git",