frontpage-host 0.3.4 → 0.3.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/AGENTS.md CHANGED
@@ -293,3 +293,5 @@ People CRM has People and Groups tabs. Group details has Group details, Stages a
293
293
  For a manual group, `groups.people` accepts `availability: "all" | "available" | "member"` through `--data`. The server applies saved membership before counts and paging. This filter never grants or requires email permission. In the UI, conditional groups use condition preview instead of manual additions. Existing explicit owner-exception operations stay available through the advanced service.
294
294
 
295
295
  Before a reviewed `groups.update`, read `groups.list` and pass its `emailVersion` as optional `expectedGroup`. A 409 means the saved settings changed; read and review again before writing. Membership counts do not change this version. For the UI's Add people CSV behavior, pass `manualGroupsOnly:true` to `import.start`. The job keeps this choice and reports rows if a destination becomes conditional before processing; it never creates an include exception from that request. Retry with the same accepted key/payload, and inspect the saved job. Existing explicit advanced imports keep their prior contract when the option is omitted.
296
+
297
+ Complete Store edits: use existing items update --file with changed fields and variantUpdates. stock requires expectedStock from a fresh items get. One transaction saves all changes or none. On 409 review current stock; never silently substitute it. firstVariant plus optionNames enables versions. Keep explicit stock/variant commands for single operations. Routines add accepts --request-id UUID; reuse that ID and exact schedule after a lost response. Ordinary form edits live only in the active task; Cancel keeps input, Discard loses unfinished input. Submitted payments, imports, builds, and API-key status are separate operations.
package/README.md CHANGED
@@ -81,7 +81,7 @@ frontpage store items get camp-hat --site my-site --json
81
81
 
82
82
  ### Store inventory and product options
83
83
 
84
- CLI 0.2.9 adds `items update --file`; explicit flags override file values.
84
+ `items update --file` accepts product changes; explicit flags override file values.
85
85
 
86
86
  ```bash
87
87
  frontpage store variants update camp-hat --id default --stock unlimited --site my-site
@@ -96,3 +96,17 @@ A whole stock count of `0` means sold out; `unlimited` sends JSON null. Omit sto
96
96
  See [MAIL.md](./MAIL.md) for the complete save contract, reusable people picker directory, saved campaign recipients, Off-series enrollment and resume timing, all sender settings/null resets, suppression rules, Sent queries and details, and retry-safe examples. `frontpage mail save --file save.json` saves template and pending series together; it never sends. `frontpage mail people` reads the same site-scoped directory as the workspace. Use `frontpage help mail --json` for current commands and flags. No new CLI binary, API namespace or migration command is required. Hosted guides and article help must be updated through the Frontpage CLI.
97
97
 
98
98
  The workspace validates and saves unfinished group settings before opening email setup. CLI and agent callers use `groups.create` / `groups.update` with a stable `requestKey` before attaching; `groups.count` reads the full visible match count. Group details Email and stage email tasks use the existing `frontpage mail save` / `save_mail_editor` completion. `attachment` checks saved group/stage emailVersion, creates paused rules, supports shared-template edits with rule revisions, and recovers identical retries. Read MAIL.md, Group and stage email tasks. Template get includes ruleUsage; deletion protects paused and active rule dependencies. Creating or saving never activates, enrolls or sends.
99
+
100
+ ### Complete product edits
101
+
102
+ `frontpage store items update ITEM_ID --file edit.json` uses the existing `/shop/items/ITEM_ID` PATCH. Send only changed fields. Product details and `variantUpdates` save in one transaction: all changes save or none do. Ordinary fields use the last successful save. Unchanged fields stay untouched.
103
+
104
+ ```json
105
+ {"title":"Camp hat","variantUpdates":[{"variantId":"default","priceCents":1300,"stock":3,"expectedStock":5}]}
106
+ ```
107
+
108
+ Read `items get` first. Include `expectedStock` only when changing stock; copy the current count or null for unlimited. If stock changed before Save, the whole edit fails with 409 and nothing saves. Read the product and review that stock change before retrying. Do not silently replace the expected count. Omitted stock stays untouched. `discountPriceCents:null` clears a sale. Prices use integer cents.
109
+
110
+ To turn versions on in the same edit, send `optionNames` and `firstVariant` using the normal variant fields. Do not combine `firstVariant` with `variantUpdates`. To turn versions off, send `optionNames:[]`; optional changes then address the `default` variant. Existing stock and variant commands remain available for explicit individual operations. IDs, order history, site/role/plan gates, and provider ownership stay unchanged. Browser forms use the same service. A successful save returns the saved product; a later list refresh cannot undo it.
111
+
112
+ An explicit stock target already equal to the current count is a no-op. Repeating that same target after a lost response does not fail merely because the earlier save applied it. A different current count still requires review; never automatically replace expectedStock.
@@ -99,7 +99,13 @@ export async function runRoutines(args) {
99
99
  }
100
100
  if (sub === "add") {
101
101
  const work = rest.slice(1);
102
- const body = scheduleBody(work, true);
102
+ const requestId = takeFlag(work, "--request-id");
103
+ if (requestId && !ID_RE.test(requestId))
104
+ throw new CliHttpError("request-id must be a UUID.", EXIT_USAGE, 0, "bad_request");
105
+ const body = {
106
+ ...scheduleBody(work, true),
107
+ ...(requestId ? { requestId } : {}),
108
+ };
103
109
  assertNoUnknownFlags(work, "routines");
104
110
  const data = await v1Post(base, body);
105
111
  if (isJson())
@@ -287,7 +287,23 @@ export async function runShop(args) {
287
287
  assertNoUnknownFlags(work, "store");
288
288
  const body = file ? await readJsonFile(file) : {};
289
289
  if (file) {
290
- const allowed = new Set(["title", "description", "images", "checkout", "amount", "minCents", "requiresShipping", "extraShippingCents", "active", "optionNames", "categories", "categorySlugs", "customizations"]);
290
+ const allowed = new Set([
291
+ "title",
292
+ "description",
293
+ "images",
294
+ "checkout",
295
+ "amount",
296
+ "minCents",
297
+ "requiresShipping",
298
+ "extraShippingCents",
299
+ "active",
300
+ "optionNames",
301
+ "categories",
302
+ "categorySlugs",
303
+ "customizations",
304
+ "variantUpdates",
305
+ "firstVariant",
306
+ ]);
291
307
  const unknown = Object.keys(body).filter(key => !allowed.has(key));
292
308
  if (unknown.length)
293
309
  throw new CliHttpError(`Unsupported items update file field: ${unknown.join(", ")}. Use variant commands for SKU changes.`, EXIT_USAGE, 0, "bad_request");
package/dist/registry.js CHANGED
@@ -456,6 +456,7 @@ export const COMMANDS = [
456
456
  ],
457
457
  flags: [
458
458
  "add requires --name, --prompt, --cadence hourly|daily|weekly|monthly, and --timezone (IANA, such as America/Chicago)",
459
+ "routines add --request-id UUID may identify a create attempt. Reuse it with the exact schedule after a lost response; a repeat returns the saved routine without creating another.",
459
460
  "--hours accepts 8, 8am, 12pm, 4pm. Several hours: 8am,12pm,4pm stores [8, 12, 16]",
460
461
  "--weekdays accepts tue,thu,fri or 2,4,5. Sunday is 0. Weekly only",
461
462
  "--month-days accepts 1,15. Days are 1 through 28. Monthly only",
@@ -519,6 +520,7 @@ export const COMMANDS = [
519
520
  "variants update <itemId> --id <variantId> --clear-discount ends a sale and preserves the regular price. --discount-cents sets a sale; omit both on update to preserve it. The flags cannot be combined. 0 means free, not removal. Verify with items get. Prices update live.",
520
521
  "Descriptions use a small markdown subset. Bind data-fp-store-bind=description for the full product story; do not bake titles, prices or images into the page. Store is cart-only; use Payments for explicit Pay now.",
521
522
  "items stock uses --add/--remove as a signed delta, or --set/--unlimited. Never combine these verbs. Product pages use data-fp-store-product and the platform cart templates. Store prices read the shared currency owned by Payments.",
523
+ "items update --file accepts variantUpdates:[{variantId,priceCents?,discountPriceCents?,options?,stock?,expectedStock?}] and firstVariant with optionNames to enable versions. Send only changed fields. Explicit stock changes require expectedStock from items get; a conflict saves nothing. Complete edits commit together. Existing single-variant and stock commands stay available.",
522
524
  "variants update --stock unlimited or items stock --set unlimited restores unlimited stock; 0 means sold out; omit stock on update to preserve it. items update --file supports optionNames: same-length rename or [] to return to one SKU, preserving the first live variant price/sale/stock. Read items get before and after.",
523
525
  "variants add|update|archive|restore; categories list|create|rename|archive. Create categories before assigning their slugs.",
524
526
  "settings get|set-fulfillment|set-checkout-fee|set-receipt|availability get|on|off. Fee mode flat uses --cents; percent uses --bps (250 is 2.5%). Receipt takes --template <id> or --stock. Availability requires admin and --yes in scripts.",
package/llms.txt CHANGED
@@ -55,3 +55,5 @@ Customer Inbox: Frontpage website chat uses one settings toggle, no website edit
55
55
  See [MAIL.md](./MAIL.md) for the complete save contract, reusable people picker directory, saved campaign recipients, Off-series enrollment and resume timing, all sender settings/null resets, suppression rules, Sent queries and details, and retry-safe examples. `frontpage mail save --file save.json` saves template and pending series together; it never sends. `frontpage mail people` reads the same site-scoped directory as the workspace. Use `frontpage help mail --json` for current commands and flags. No new CLI binary, API namespace or migration command is required. Hosted guides and article help must be updated through the Frontpage CLI.
56
56
 
57
57
  The workspace validates and saves unfinished group settings before opening email setup. CLI and agent callers use `groups.create` / `groups.update` with a stable `requestKey` before attaching; `groups.count` reads the full visible match count. Group details Email and stage email tasks use the existing `frontpage mail save` / `save_mail_editor` completion. `attachment` checks saved group/stage emailVersion, creates paused rules, supports shared-template edits with rule revisions, and recovers identical retries. Read MAIL.md, Group and stage email tasks. Template get includes ruleUsage; deletion protects paused and active rule dependencies. Creating or saving never activates, enrolls or sends.
58
+
59
+ Complete Store edits: use existing items update --file with changed fields and variantUpdates. stock requires expectedStock from a fresh items get. One transaction saves all changes or none. On 409 review current stock; never silently substitute it. firstVariant plus optionNames enables versions. Keep explicit stock/variant commands for single operations. Routines add accepts --request-id UUID; reuse that ID and exact schedule after a lost response. Ordinary form edits live only in the active task; Cancel keeps input, Discard loses unfinished input. Submitted payments, imports, builds, and API-key status are separate operations.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frontpage-host",
3
- "version": "0.3.4",
4
- "description": "Frontpage CLI — manage your site from the terminal",
3
+ "version": "0.3.5",
4
+ "description": "Frontpage CLI \u2014 manage your site from the terminal",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "frontpage": "dist/bin.js"