frontpage-host 0.2.8 → 0.2.9
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 +1 -1
- package/README.md +13 -0
- package/dist/commands/shop.js +8 -1
- package/dist/registry.js +1 -0
- package/llms.txt +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -129,7 +129,7 @@ Sites are Astro 6 + Tailwind v4. More detail: `frontpage help site-building` or
|
|
|
129
129
|
- Analytics: bare `frontpage analytics` = dashboard; also `summary|query|funnel|timeseries|compare|sql` for structured reads (SQL is guard + RLS site-scoped).
|
|
130
130
|
- People CRM: `frontpage people list|get|add|set|note|rm-note|follow-up|hide|unhide|tag|export`. Site-scoped person graph (email or phone). Inbox stays the raw ledger. Hide is not forget. List export is CSV (not a one-person legal dump). Full guide: https://frontpage.host/developers/people
|
|
131
131
|
- Routines: `frontpage routines list|get|add|set|pause|resume|rm|run|runs`. One routine can hold several hours and several days. `8am,12pm,4pm` on `tue,thu,fri` stores hours `[8, 12, 16]` and weekdays `[2, 4, 5]`. Ask for an IANA timezone. Do not guess UTC. Full guide: https://frontpage.host/developers/routines
|
|
132
|
-
- Store catalog: `frontpage store items|variants|categories|settings|orders|import`. Integer cents only (`$49.99` is `4999`). `--price-cents` is the usual cost. Optional `--discount-cents` is the sale the buyer pays (must be lower). End a sale with `frontpage store variants update <itemId> --id <variantId> --clear-discount`. This sends discountPriceCents: null and keeps the regular price. Omit both sale flags on update to preserve the current sale. Do not combine --clear-discount with --discount-cents; 0 means free, not removal. Read the item back to verify. Create a category before assigning it. Photos are a site path `/__media/uploads/<this-slug>/…` or an HTTPS URL already saved on this site. `frontpage payments connect [--no-open]` opens Frontpage then Stripe. Store always uses Add to cart. Use Payments for standalone Pay now and invoices. Service fee is `settings set-checkout-fee`. The cart starts hidden. Product pages are the default: unless they said they do not want product pages, write one `src/pages/products/item.astro` (or shop) with `data-fp-store-product`. If they said no, skip that file and do not bind `href` or `url`. Description is a small markdown subset; product-page bind is `<div data-fp-store-bind="description">`. Every store control carries `data-fp-requires="store"`. Do not bake titles or prices. Full guide: https://frontpage.host/developers/store
|
|
132
|
+
- Store catalog: `frontpage store items|variants|categories|settings|orders|import`. Integer cents only (`$49.99` is `4999`). `--price-cents` is the usual cost. Optional `--discount-cents` is the sale the buyer pays (must be lower). End a sale with `frontpage store variants update <itemId> --id <variantId> --clear-discount`. This sends discountPriceCents: null and keeps the regular price. Omit both sale flags on update to preserve the current sale. Do not combine --clear-discount with --discount-cents; 0 means free, not removal. Read the item back to verify. Stock: use --stock unlimited on variants update or items stock --set unlimited; zero is sold out. Omit stock on update to preserve it. Rename option types or return to one SKU with items update --file, preserving the surviving variant’s regular price, sale and stock. Create a category before assigning it. Photos are a site path `/__media/uploads/<this-slug>/…` or an HTTPS URL already saved on this site. `frontpage payments connect [--no-open]` opens Frontpage then Stripe. Store always uses Add to cart. Use Payments for standalone Pay now and invoices. Service fee is `settings set-checkout-fee`. The cart starts hidden. Product pages are the default: unless they said they do not want product pages, write one `src/pages/products/item.astro` (or shop) with `data-fp-store-product`. If they said no, skip that file and do not bind `href` or `url`. Description is a small markdown subset; product-page bind is `<div data-fp-store-bind="description">`. Every store control carries `data-fp-requires="store"`. Do not bake titles or prices. Full guide: https://frontpage.host/developers/store
|
|
133
133
|
|
|
134
134
|
## Agent prompt loop
|
|
135
135
|
|
package/README.md
CHANGED
|
@@ -77,3 +77,16 @@ frontpage store items get camp-hat --site my-site --json
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
`--price-cents` sets the regular price. `--discount-cents` sets a lower sale price. `--clear-discount` removes the sale and keeps the regular price; it sends `discountPriceCents: null`. Omit both sale flags on update to keep the current sale. Do not combine them. A sale price of `0` means free, not sale removal. Repeat for each live variant when ending a sale across the catalog. Store prices update live; a page publish or banner removal does not clear discounts.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Store inventory and product options
|
|
83
|
+
|
|
84
|
+
CLI 0.2.9 adds `items update --file`; explicit flags override file values.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
frontpage store variants update camp-hat --id default --stock unlimited --site my-site
|
|
88
|
+
frontpage store items stock camp-hat --set unlimited --site my-site
|
|
89
|
+
frontpage store items get camp-hat --site my-site --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
A whole stock count of `0` means sold out; `unlimited` sends JSON null. Omit stock on update to keep it. To rename existing option types, pass an `optionNames` list with the same number of names through `items update --file`. To return to one default SKU, pass `{"optionNames":[]}`. The existing first live variant supplies the regular price, sale price (including no sale), and stock (including unlimited). Inspect the live variants first and read back the result; other live variants are archived. Use `variants add` to turn options on. Do not recreate the product.
|
package/dist/commands/shop.js
CHANGED
|
@@ -275,6 +275,7 @@ export async function runShop(args) {
|
|
|
275
275
|
}
|
|
276
276
|
if (sub === "update") {
|
|
277
277
|
const itemId = requireShopId(work);
|
|
278
|
+
const file = takeFlag(work, "--file");
|
|
278
279
|
const title = takeFlag(work, "--title");
|
|
279
280
|
const description = takeFlag(work, "--description");
|
|
280
281
|
const amount = takeFlag(work, "--amount");
|
|
@@ -284,7 +285,13 @@ export async function runShop(args) {
|
|
|
284
285
|
const categories = parseCsv(takeFlag(work, "--categories"));
|
|
285
286
|
const images = parseUrls(work);
|
|
286
287
|
assertNoUnknownFlags(work, "store");
|
|
287
|
-
const body = {};
|
|
288
|
+
const body = file ? await readJsonFile(file) : {};
|
|
289
|
+
if (file) {
|
|
290
|
+
const allowed = new Set(["title", "description", "images", "checkout", "amount", "minCents", "requiresShipping", "extraShippingCents", "active", "optionNames", "categories", "categorySlugs", "customizations"]);
|
|
291
|
+
const unknown = Object.keys(body).filter(key => !allowed.has(key));
|
|
292
|
+
if (unknown.length)
|
|
293
|
+
throw new CliHttpError(`Unsupported items update file field: ${unknown.join(", ")}. Use variant commands for SKU changes.`, EXIT_USAGE, 0, "bad_request");
|
|
294
|
+
}
|
|
288
295
|
if (title !== undefined)
|
|
289
296
|
body.title = title;
|
|
290
297
|
if (description !== undefined)
|
package/dist/registry.js
CHANGED
|
@@ -520,6 +520,7 @@ export const COMMANDS = [
|
|
|
520
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.",
|
|
521
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.",
|
|
522
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
|
+
"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
524
|
"variants add|update|archive|restore; categories list|create|rename|archive. Create categories before assigning their slugs.",
|
|
524
525
|
"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.",
|
|
525
526
|
"orders list|get; import explicitly reads the existing site product files. No fleet import or data conversion occurs.",
|
package/llms.txt
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- Redirects: frontpage redirects list|set|rm — HTTP 301/308, instant, not a file; revert does not undo; do not fake with Astro.redirect / meta refresh
|
|
19
19
|
- People CRM: frontpage people list|get|add|set|note|rm-note|follow-up|hide|unhide|tag|export. Site-scoped person graph (email or phone). Inbox stays the raw ledger. Hide is not forget. List export is CSV. Unknown leftover flags fail closed. Guide: https://frontpage.host/developers/people
|
|
20
20
|
- Routines: frontpage routines list|get|add|set|pause|resume|rm|run|runs. Several hours and several days are one routine. 8am,12pm,4pm and tue,thu,fri store hours [8, 12, 16] and weekdays [2, 4, 5]. Timezone is IANA. Do not guess UTC. Guide: https://frontpage.host/developers/routines
|
|
21
|
-
- Store catalog: frontpage store items|variants|categories|settings|orders|import. Integer cents only ($49.99 is 4999). --price-cents is the usual cost. Optional --discount-cents is the sale the buyer pays (must be lower). End a sale with `frontpage store variants update <itemId> --id <variantId> --clear-discount`. This sends discountPriceCents: null and keeps the regular price. Omit both sale flags on update to preserve the current sale. Do not combine --clear-discount with --discount-cents; 0 means free, not removal. Read the item back to verify. Create a category before assigning it. Photos are /__media/uploads/<this-slug>/… or an HTTPS URL already saved on this site. frontpage payments connect [--no-open] opens Frontpage then Stripe. Store is cart-only; currency comes from Stripe and cannot be set. Use frontpage payments for standalone Pay now and invoices. Service fee is settings set-checkout-fee. The cart starts hidden. Product pages are the default: unless they said they do not want product pages, write one src/pages/products/item.astro (or shop) with data-fp-store-product. If they said no, skip that file and do not bind href or url. Description is a small markdown subset; product-page bind is <div data-fp-store-bind="description">. Every store control carries data-fp-requires="store". Leave data-fp-store-variants empty. Do not bake titles or prices. Guide: https://frontpage.host/developers/store
|
|
21
|
+
- Store catalog: frontpage store items|variants|categories|settings|orders|import. Integer cents only ($49.99 is 4999). --price-cents is the usual cost. Optional --discount-cents is the sale the buyer pays (must be lower). End a sale with `frontpage store variants update <itemId> --id <variantId> --clear-discount`. This sends discountPriceCents: null and keeps the regular price. Omit both sale flags on update to preserve the current sale. Do not combine --clear-discount with --discount-cents; 0 means free, not removal. Read the item back to verify. Stock: use --stock unlimited on variants update or items stock --set unlimited; zero is sold out. Omit stock on update to preserve it. Rename option types or return to one SKU with items update --file, preserving the surviving variant’s regular price, sale and stock. Create a category before assigning it. Photos are /__media/uploads/<this-slug>/… or an HTTPS URL already saved on this site. frontpage payments connect [--no-open] opens Frontpage then Stripe. Store is cart-only; currency comes from Stripe and cannot be set. Use frontpage payments for standalone Pay now and invoices. Service fee is settings set-checkout-fee. The cart starts hidden. Product pages are the default: unless they said they do not want product pages, write one src/pages/products/item.astro (or shop) with data-fp-store-product. If they said no, skip that file and do not bind href or url. Description is a small markdown subset; product-page bind is <div data-fp-store-bind="description">. Every store control carries data-fp-requires="store". Leave data-fp-store-variants empty. Do not bake titles or prices. Guide: https://frontpage.host/developers/store
|
|
22
22
|
- Analytics funnel: --steps JSON array or comma paths (/, /pricing); bad JSON → Invalid JSON for --steps
|
|
23
23
|
- Modules: unknown key errors list Known: …; mailing list module key is signups (not subscribe)
|
|
24
24
|
- Errors: --json API envelopes include requestId when the server returned one; local validation omits requestId/httpStatus; runs wait failed/canceled → ok:false + run.error (exit 2); deploy wait = agent idle + tip compile ready (fail-closed / compile timeout → exit 2); push --wait and publish --wait wait for GET /deploy ready
|