@series-a/cli 1.1.0 → 1.2.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to `@series-a/cli` (and the paired `@series-a/mcp` server).
4
4
 
5
+ ## 1.2.0 — booking links and full profile-settings editing
6
+
7
+ ### Added
8
+ - `practice update` / `dentist update` `--booking <url>` and `--website <url>` shortcuts for setting the booking and website links without `--set`
9
+ - `--set-enrichment path=value` for nested practice profile values (positioning summary/archetype/marketing descriptions, amenities, default currency), so every field on the practice profile settings screen is editable from the CLI
10
+ - `--fields` now also lists the available `--set-enrichment` paths
11
+ - MCP `setu_profile_update` accepts `enrichment_set`
12
+
5
13
  ## 1.1.0 — editing, pricing and media
6
14
 
7
15
  ### Added
package/README.md CHANGED
@@ -94,10 +94,26 @@ else is reported and skipped before any API call is made.
94
94
  setu practice update <practice-id> --fields # what you can set
95
95
  setu practice update <practice-id> --set tagline="Gentle care" --set emergency_available=true
96
96
  setu dentist update <dentist-id> --set bio="20 years in implants"
97
+
98
+ # Booking / website link shortcuts
99
+ setu practice update <practice-id> --booking https://clinic.co.uk/book
100
+ setu dentist update <dentist-id> --booking https://clinic.co.uk/book --website https://clinic.co.uk
97
101
  ```
98
102
 
99
103
  Lists take comma-separated values, e.g. `--set services="Implants,Whitening"`.
100
104
 
105
+ Everything on the practice profile settings screen is settable. The few values that
106
+ live in the nested profile record — positioning, amenities, default currency — use
107
+ `--set-enrichment`:
108
+
109
+ ```bash
110
+ setu practice update <practice-id> --set-enrichment positioning.summary="Calm, modern care in Leeds"
111
+ setu practice update <practice-id> --set-enrichment amenities="Wi-Fi,Free parking,Step-free access"
112
+ setu practice update <practice-id> --set-enrichment positioning.archetype=boutique
113
+ setu practice update <practice-id> --set parking_info="Two-hour free bay on site" \
114
+ --set accessibility="Step-free,Hearing loop" --set languages="English,Polish"
115
+ ```
116
+
101
117
  ## Photos and logos
102
118
 
103
119
  ```bash
package/bin/setu.mjs CHANGED
@@ -71,6 +71,8 @@ ${c.bold("Commands")}
71
71
  [--unpublish] [--yes]
72
72
  practice update <practice-id> Edit fields on a seeded profile
73
73
  --set field=value repeatable, e.g. --set tagline="Gentle care"
74
+ --set-enrichment path=value e.g. --set-enrichment amenities="Wi-Fi|Parking"
75
+ [--booking <url>] [--website <url>] shortcuts for the booking / website links
74
76
  [--fields] list the fields you can set
75
77
  practice images <practice-id> Manage photos on a seeded profile
76
78
  [--add <url>] [--remove <url|index>] [--order "url1,url2"]
@@ -134,9 +136,13 @@ async function cmdProfileUpdate(type, id) {
134
136
  // The server answers with the whitelist when nothing valid is sent.
135
137
  try {
136
138
  const r = await call("cli-profile-update", { id: id || "00000000-0000-0000-0000-000000000000", profile_type: type, read: true });
137
- if (JSON_OUT) return out({ fields: r.allowed_fields });
139
+ if (JSON_OUT) return out({ fields: r.allowed_fields, enrichment_paths: r.allowed_enrichment_paths ?? [] });
138
140
  heading(`Fields you can set on a ${type}`);
139
141
  log(" " + r.allowed_fields.join(", "));
142
+ if (r.allowed_enrichment_paths?.length) {
143
+ heading("Extra fields (use --set-enrichment path=value)");
144
+ log(" " + r.allowed_enrichment_paths.join(", "));
145
+ }
140
146
  return;
141
147
  } catch (e) {
142
148
  const fields = e.data?.allowed_fields;
@@ -150,19 +156,33 @@ async function cmdProfileUpdate(type, id) {
150
156
  }
151
157
  return;
152
158
  }
153
- if (!id) { fail(`Usage: setu ${type} update <id> --set field=value`); process.exit(1); }
159
+ if (!id) { fail(`Usage: setu ${type} update <id> [--set field=value] [--booking <url>] [--website <url>]`); process.exit(1); }
154
160
 
155
- const pairs = asList(flags.set);
156
- if (!pairs.length) { fail("Pass at least one --set field=value (or --fields to see what you can set)."); process.exit(1); }
157
161
  const set = {};
162
+ const pairs = asList(flags.set);
158
163
  for (const pair of pairs) {
159
164
  const raw = String(pair);
160
165
  const eq = raw.indexOf("=");
161
166
  if (eq < 1) { fail(`Bad --set value: "${raw}". Use field=value.`); process.exit(1); }
162
167
  set[raw.slice(0, eq).trim()] = raw.slice(eq + 1);
163
168
  }
169
+ const enrichmentSet = {};
170
+ for (const pair of asList(flags["set-enrichment"])) {
171
+ const raw = String(pair);
172
+ const eq = raw.indexOf("=");
173
+ if (eq < 1) { fail(`Bad --set-enrichment value: "${raw}". Use path=value.`); process.exit(1); }
174
+ enrichmentSet[raw.slice(0, eq).trim()] = raw.slice(eq + 1);
175
+ }
176
+ if (flags.booking !== undefined) set.booking_url = flags.booking === true ? "" : String(flags.booking);
177
+ if (flags.website !== undefined) set[type === "dentist" ? "website_url" : "website"] = flags.website === true ? "" : String(flags.website);
178
+ if (!Object.keys(set).length && !Object.keys(enrichmentSet).length) { fail("Pass at least one --set field=value, --set-enrichment path=value, --booking <url> or --website <url> (or --fields to see what you can set)."); process.exit(1); }
164
179
 
165
- const res = await call("cli-profile-update", { id, profile_type: type, set });
180
+ const res = await call("cli-profile-update", {
181
+ id,
182
+ profile_type: type,
183
+ set,
184
+ ...(Object.keys(enrichmentSet).length ? { enrichment_set: enrichmentSet } : {}),
185
+ });
166
186
  if (JSON_OUT) return out(res);
167
187
  ok(`${res.name} — updated ${res.updated.join(", ")}`);
168
188
  if (res.rejected?.length) warn(`Ignored unknown field(s): ${res.rejected.join(", ")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-a/cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "Setu CLI — build, review and publish claimable practice and dentist profiles.",
6
6
  "type": "module",