@tansy/shop 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/admin.d.ts +2 -0
- package/admin.js +100 -0
- package/client.d.ts +2 -0
- package/client.js +96 -0
- package/index.d.ts +9 -0
- package/index.js +416 -0
- package/logic.d.ts +75 -0
- package/logic.js +121 -0
- package/messages.d.ts +206 -0
- package/messages.js +534 -0
- package/package.json +48 -4
- package/parts.d.ts +81 -0
- package/parts.js +305 -0
- package/render.d.ts +19 -0
- package/render.js +84 -0
- package/schema.d.ts +767 -0
- package/schema.js +215 -0
- package/service.d.ts +72 -0
- package/service.js +195 -0
- package/shop.css +101 -0
- package/site-messages.d.ts +3 -0
- package/site-messages.js +173 -0
- package/tools.d.ts +3 -0
- package/tools.js +51 -0
- package/words.d.ts +3 -0
- package/words.js +5 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
What changed in each release of `@tansy/shop`. Releases up to 0.1.0 went out with every other package
|
|
4
|
+
on one version and are described in [tansy's changelog](../../CHANGELOG.md).
|
|
5
|
+
|
|
6
|
+
## 0.1.1 — 2026-11-22
|
|
7
|
+
|
|
8
|
+
No changes of its own. Released beside `tansy` 0.1.1, from which every package moves on its own
|
|
9
|
+
version, and it now requires it: the `tansy` peer range is ^0.1.1.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mohamed Salah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Generated by scripts/package-metadata.mjs. Change that script, not this file. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @tansy/shop
|
|
4
|
+
|
|
5
|
+
Turns tansy into an online shop: products, variants, stock, categories, a cart, shipping zones, orders and fulfilment. Takes payment through @tansy/payments.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tansy/shop
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Add it to `tansy.config.ts`. See [the shop plugin documentation](https://github.com/mhmdsalahsebai/tansy/blob/main/docs/plugins/shop.md) for what it adds and the options it takes.
|
|
12
|
+
|
|
13
|
+
A first-party plugin for [tansy](https://github.com/mhmdsalahsebai/tansy), a self-hosted, runtime-schema CMS for Next.js. MIT licensed.
|
package/admin.d.ts
ADDED
package/admin.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, DataTable, defineAdminPlugin, PageHeader } from "tansy/admin";
|
|
3
|
+
import { getT } from "tansy/server";
|
|
4
|
+
import { formatMoney as money, str, toMilli, fromMilli } from "./logic";
|
|
5
|
+
import { ORDERS, PRODUCTS, VARIANTS } from "./schema";
|
|
6
|
+
/** As the signed-in person, so someone who can't read a collection gets nothing rather than another person's view. */
|
|
7
|
+
async function allRows(records, slug, query, limit = 2000) {
|
|
8
|
+
try {
|
|
9
|
+
const rows = [];
|
|
10
|
+
for (let page = 1; rows.length < limit; page++) {
|
|
11
|
+
const result = await records.list(slug, { ...query, page, perPage: 200 });
|
|
12
|
+
rows.push(...result.items);
|
|
13
|
+
if (page >= result.totalPages)
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return rows;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const MONTH = 30 * 24 * 60 * 60 * 1000;
|
|
23
|
+
const recent = (value) => typeof value === "string" && Date.now() - Date.parse(value) < MONTH;
|
|
24
|
+
const SOLD = new Set(["paid", "shipped", "delivered"]);
|
|
25
|
+
/** This plugin's words and formats in the person's interface language. */
|
|
26
|
+
async function words(userId) {
|
|
27
|
+
const { t, locale, formatDate } = await getT(userId);
|
|
28
|
+
return {
|
|
29
|
+
t: (key, values) => t(`ext.shop.${key}`, values),
|
|
30
|
+
date: (value) => (typeof value === "string" && value ? formatDate(value) : "—"),
|
|
31
|
+
formatMoney: (amount, currency) => money(amount, currency, locale),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Products and variants with this many or fewer left are listed as running low. */
|
|
35
|
+
const LOW_STOCK = 5;
|
|
36
|
+
async function Overview({ records, user }) {
|
|
37
|
+
const { t, date, formatMoney } = await words(user.id);
|
|
38
|
+
const [orders, products, variants] = await Promise.all([
|
|
39
|
+
allRows(records, ORDERS, { sort: "-createdAt", fields: "id,title,state,total,currency,email,country,paidAt,flag,needsShipping" }, 2000),
|
|
40
|
+
allRows(records, PRODUCTS, { fields: "id,title,stock" }, 2000),
|
|
41
|
+
allRows(records, VARIANTS, { fields: "id,title,product,stock" }, 2000),
|
|
42
|
+
]);
|
|
43
|
+
if (!orders) {
|
|
44
|
+
return _jsxs("div", { className: "cms-gutter", children: [_jsx(PageHeader, { title: t("overview.title") }), _jsx("p", { className: "cms-empty", children: t("overview.cantReadOrders") })] });
|
|
45
|
+
}
|
|
46
|
+
const toShip = orders.filter((order) => order.state === "paid" && order.needsShipping === true);
|
|
47
|
+
const flagged = orders.filter((order) => str(order.flag) && order.state !== "refunded" && order.state !== "cancelled");
|
|
48
|
+
const sold = orders.filter((order) => SOLD.has(str(order.state)) && recent(order.paidAt));
|
|
49
|
+
const currency = str(sold[0]?.currency) || str(orders[0]?.currency) || "usd";
|
|
50
|
+
const revenue = fromMilli(sold.reduce((total, order) => total + toMilli(typeof order.total === "number" ? order.total : 0), 0));
|
|
51
|
+
const productTitle = new Map((products ?? []).map((product) => [product.id, str(product.title)]));
|
|
52
|
+
const low = [
|
|
53
|
+
...(products ?? []).filter((product) => typeof product.stock === "number" && product.stock <= LOW_STOCK).map((product) => ({ key: `p${String(product.id)}`, title: str(product.title), stock: product.stock })),
|
|
54
|
+
...(variants ?? []).filter((variant) => typeof variant.stock === "number" && variant.stock <= LOW_STOCK).map((variant) => ({ key: `v${String(variant.id)}`, title: `${productTitle.get(variant.product) || t("overview.product", { id: String(variant.product) })} · ${str(variant.title)}`, stock: variant.stock })),
|
|
55
|
+
].sort((a, b) => a.stock - b.stock);
|
|
56
|
+
return (_jsxs("div", { className: "cms-gutter", children: [_jsx(PageHeader, { title: t("overview.title"), description: t("overview.description") }), _jsxs("div", { className: "cms-stat-strip cms-mb-6", children: [_jsxs("div", { children: [_jsx("p", { className: "cms-stat-label", children: t("overview.stats.orders") }), _jsx("p", { className: "cms-stat-value", children: sold.length })] }), _jsxs("div", { children: [_jsx("p", { className: "cms-stat-label", children: t("overview.stats.revenue") }), _jsx("p", { className: "cms-stat-value", children: formatMoney(revenue, currency) })] }), _jsxs("div", { children: [_jsx("p", { className: "cms-stat-label", children: t("overview.stats.toShip") }), _jsx("p", { className: "cms-stat-value", children: toShip.length })] }), _jsxs("div", { children: [_jsx("p", { className: "cms-stat-label", children: t("overview.stats.pending") }), _jsx("p", { className: "cms-stat-value", children: orders.filter((order) => order.state === "pending").length })] })] }), _jsxs("div", { className: "cms-stack-6", children: [_jsx(DataTable, { label: t("overview.toShip"), title: t("overview.toShip"), columns: [{ id: "order", label: t("columns.order") }, { id: "items", label: t("columns.items") }, { id: "customer", label: t("columns.customer") }, { id: "country", label: t("columns.country") }, { id: "paid", label: t("columns.paid") }, { id: "total", label: t("columns.total"), numeric: true }], rows: toShip.map((order) => ({
|
|
57
|
+
id: String(order.id),
|
|
58
|
+
cells: {
|
|
59
|
+
order: `#${String(order.id)}`,
|
|
60
|
+
items: str(order.title) || null,
|
|
61
|
+
customer: str(order.email) || null,
|
|
62
|
+
country: str(order.country) || null,
|
|
63
|
+
paid: date(order.paidAt),
|
|
64
|
+
total: typeof order.total === "number" ? formatMoney(order.total, str(order.currency) || currency) : null,
|
|
65
|
+
},
|
|
66
|
+
})), empty: { title: t("overview.nothingToShip") } }), flagged.length > 0 && (_jsx(DataTable, { label: t("overview.needsLook"), title: t("overview.needsLook"), columns: [{ id: "order", label: t("columns.order") }, { id: "state", label: t("columns.state") }, { id: "problem", label: t("columns.problem") }], rows: flagged.map((order) => ({ id: String(order.id), cells: { order: `#${String(order.id)}`, state: _jsx(Badge, { children: str(order.state) }), problem: str(order.flag) } })), empty: { title: "" } })), _jsx(DataTable, { label: t("overview.lowStock"), title: t("overview.lowStock"), columns: [{ id: "product", label: t("columns.product") }, { id: "left", label: t("columns.left"), numeric: true }], rows: (products ? low : []).map((row) => ({ id: row.key, cells: { product: row.title, left: row.stock === 0 ? _jsx(Badge, { tone: "warning", children: t("overview.soldOut") }) : row.stock } })), empty: { title: products === null ? t("overview.cantReadProducts") : t("overview.nothingLow") } })] })] }));
|
|
67
|
+
}
|
|
68
|
+
async function ToShip({ records, user }) {
|
|
69
|
+
const { t } = await words(user.id);
|
|
70
|
+
const orders = await allRows(records, ORDERS, { filter: 'state = "paid" || state = "pending"', fields: "state,needsShipping,flag" }, 2000);
|
|
71
|
+
if (!orders)
|
|
72
|
+
return _jsx("p", { className: "cms-muted cms-text-sm", children: t("widget.cantRead") });
|
|
73
|
+
return (_jsxs("ul", { className: "cms-muted cms-text-sm", children: [_jsx("li", { children: t("widget.toShip", { count: orders.filter((order) => order.state === "paid" && order.needsShipping === true).length }) }), _jsx("li", { children: t("widget.pending", { count: orders.filter((order) => order.state === "pending").length }) }), orders.some((order) => str(order.flag)) && _jsx("li", { children: t("widget.needsLook") })] }));
|
|
74
|
+
}
|
|
75
|
+
/** A shopping bag, from Heroicons (MIT), drawn by the navigation like its own icons. */
|
|
76
|
+
const BAG = {
|
|
77
|
+
viewBox: "0 0 16 16",
|
|
78
|
+
fillRule: "evenodd",
|
|
79
|
+
paths: ["M5 4a3 3 0 0 1 6 0v1h.643a1.5 1.5 0 0 1 1.492 1.35l.7 7A1.5 1.5 0 0 1 12.342 15H3.657a1.5 1.5 0 0 1-1.492-1.65l.7-7A1.5 1.5 0 0 1 4.357 5H5V4Zm4.5 0v1h-3V4a1.5 1.5 0 0 1 3 0Zm-3 3.75a.75.75 0 0 0-1.5 0v1a3 3 0 1 0 6 0v-1a.75.75 0 0 0-1.5 0v1a1.5 1.5 0 1 1-3 0v-1Z"],
|
|
80
|
+
};
|
|
81
|
+
export default defineAdminPlugin({
|
|
82
|
+
pages: [{ path: "shop/overview", title: "Overview", permission: "ext.shop:fulfill", component: Overview }],
|
|
83
|
+
section: {
|
|
84
|
+
title: "Shop",
|
|
85
|
+
icon: BAG,
|
|
86
|
+
items: [
|
|
87
|
+
{ page: "shop/overview" },
|
|
88
|
+
{ collection: ORDERS },
|
|
89
|
+
{ collection: PRODUCTS },
|
|
90
|
+
{ collection: VARIANTS },
|
|
91
|
+
{ collection: "shop-categories" },
|
|
92
|
+
{ collection: "shop-shipping-zones" },
|
|
93
|
+
{ collection: "shop-store", title: "Shop page" },
|
|
94
|
+
{ collection: "shop-cart", title: "Cart page" },
|
|
95
|
+
{ collection: "shop-account", title: "Orders page" },
|
|
96
|
+
{ settings: true },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
widgets: [{ id: "shop-to-ship", title: "Shop", permission: "ext.shop:fulfill", component: ToShip }],
|
|
100
|
+
});
|
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { adminPath, apiPath, defineAdminClient, translate, useT } from "tansy/admin";
|
|
5
|
+
import { formatMoney as money, linesOf, str } from "./logic";
|
|
6
|
+
/** This plugin's words outside a component. */
|
|
7
|
+
const word = (key, values) => translate(`ext.shop.${key}`, values);
|
|
8
|
+
/** This plugin's words and money in the person's interface language. */
|
|
9
|
+
function useWords() {
|
|
10
|
+
const { t, locale } = useT();
|
|
11
|
+
return { t: (key, values) => t(`ext.shop.${key}`, values), formatMoney: (amount, currency) => money(amount, currency, locale) };
|
|
12
|
+
}
|
|
13
|
+
async function setState(orderId, state, trackingUrl) {
|
|
14
|
+
const response = await fetch(apiPath(`/ext/shop/orders/${orderId}/status`), { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ state, ...(trackingUrl ? { trackingUrl } : {}) }) });
|
|
15
|
+
if (response.ok)
|
|
16
|
+
return null;
|
|
17
|
+
const json = await response.json().catch(() => null);
|
|
18
|
+
return json?.error?.details?.[0]?.message ?? json?.error?.message ?? word("order.notChanged");
|
|
19
|
+
}
|
|
20
|
+
/** What was ordered and where it goes, readable, instead of the raw JSON fields. */
|
|
21
|
+
function OrderPanel({ values }) {
|
|
22
|
+
const { t, formatMoney } = useWords();
|
|
23
|
+
const lines = linesOf(values.lines);
|
|
24
|
+
if (!lines.length)
|
|
25
|
+
return null;
|
|
26
|
+
const currency = str(values.currency) || "usd";
|
|
27
|
+
const address = (values.address ?? null);
|
|
28
|
+
return (_jsxs("section", { className: "cms-panel cms-cell", children: [_jsx("h3", { className: "cms-section-title cms-mb-2", children: t("order.title") }), _jsxs("table", { className: "cms-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t("columns.item") }), _jsx("th", { children: t("columns.sku") }), _jsx("th", { children: t("columns.price") }), _jsx("th", { children: t("columns.qty") }), _jsx("th", { children: t("columns.subtotal") })] }) }), _jsx("tbody", { children: lines.map((line, index) => (_jsxs("tr", { children: [_jsxs("td", { children: [line.title, line.variantTitle ? ` · ${line.variantTitle}` : ""] }), _jsx("td", { children: line.sku ?? "—" }), _jsx("td", { children: formatMoney(line.unitPrice, currency) }), _jsx("td", { children: line.quantity }), _jsx("td", { children: formatMoney(line.subtotal, currency) })] }, index))) })] }), _jsx("p", { className: "cms-text-sm cms-muted", children: t("order.sums", { items: formatMoney(Number(values.subtotal) || 0, currency), shipping: formatMoney(Number(values.shippingCost) || 0, currency), total: formatMoney(Number(values.total) || 0, currency) }) }), address && (_jsx("address", { className: "cms-text-sm", style: { fontStyle: "normal", whiteSpace: "pre-line" }, children: [address.name, address.line1, address.line2, [address.postalCode, address.city].filter(Boolean).join(" "), address.region, address.country, address.phone].map(str).filter(Boolean).join("\n") }))] }));
|
|
29
|
+
}
|
|
30
|
+
/** A product's variants and their stock, with links to edit them. */
|
|
31
|
+
function VariantsPanel({ recordId }) {
|
|
32
|
+
const { t } = useWords();
|
|
33
|
+
const [state, setState] = useState(null);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!recordId)
|
|
36
|
+
return;
|
|
37
|
+
let live = true;
|
|
38
|
+
void Promise.all([
|
|
39
|
+
fetch(apiPath(`/collections/shop-variants/records?perPage=100&sort=position&fields=id,title,sku,price,stock,status&filter=${encodeURIComponent(`product = ${Number(recordId)}`)}`)).then((r) => (r.ok ? r.json() : { items: [] })),
|
|
40
|
+
fetch(apiPath("/collections")).then((r) => (r.ok ? r.json() : [])),
|
|
41
|
+
]).then(([list, collections]) => {
|
|
42
|
+
const found = collections.find((collection) => collection.slug === "shop-variants");
|
|
43
|
+
if (live)
|
|
44
|
+
setState({ variants: list.items ?? [], collection: found?.id ?? null });
|
|
45
|
+
}).catch(() => { if (live)
|
|
46
|
+
setState({ variants: [], collection: null }); });
|
|
47
|
+
return () => { live = false; };
|
|
48
|
+
}, [recordId]);
|
|
49
|
+
if (!recordId || !state)
|
|
50
|
+
return null;
|
|
51
|
+
const link = (path) => (state.collection ? adminPath(`/collections/${state.collection}/content/${path}`) : null);
|
|
52
|
+
return (_jsxs("section", { className: "cms-panel cms-cell", children: [_jsx("h3", { className: "cms-section-title cms-mb-2", children: t("variants.title") }), state.variants.length === 0 ? _jsx("p", { className: "cms-text-sm cms-muted", children: t("variants.none") }) : (_jsxs("table", { className: "cms-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t("columns.option") }), _jsx("th", { children: t("columns.sku") }), _jsx("th", { children: t("columns.price") }), _jsx("th", { children: t("columns.stock") })] }) }), _jsx("tbody", { children: state.variants.map((variant) => (_jsxs("tr", { children: [_jsxs("td", { children: [link(String(variant.id)) ? _jsx("a", { className: "cms-link", href: link(String(variant.id)), children: variant.title }) : variant.title, variant.status === "draft" && _jsx("span", { className: "cms-faded", children: t("variants.draft") })] }), _jsx("td", { children: variant.sku || "—" }), _jsx("td", { children: typeof variant.price === "number" ? variant.price : t("variants.productsPrice") }), _jsx("td", { children: typeof variant.stock === "number" ? variant.stock : t("variants.notCounted") })] }, variant.id))) })] })), link("new") && _jsxs("p", { className: "cms-text-sm", children: [_jsx("a", { className: "cms-link", href: link("new"), children: t("variants.add") }), t("variants.addAfter")] })] }));
|
|
53
|
+
}
|
|
54
|
+
function Panels(props) {
|
|
55
|
+
if (props.collection.slug === "shop-orders")
|
|
56
|
+
return _jsx(OrderPanel, { ...props });
|
|
57
|
+
if (props.collection.slug === "shop-products")
|
|
58
|
+
return _jsx(VariantsPanel, { ...props });
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
export default defineAdminClient({
|
|
62
|
+
recordActions: [
|
|
63
|
+
{
|
|
64
|
+
id: "shop-ship",
|
|
65
|
+
label: "Mark shipped",
|
|
66
|
+
permission: "ext.shop:fulfill",
|
|
67
|
+
collections: ["shop-orders"],
|
|
68
|
+
run: async ({ record, refresh }) => {
|
|
69
|
+
if (record.state !== "paid")
|
|
70
|
+
return window.alert(word("order.onlyPaid"));
|
|
71
|
+
const tracking = window.prompt(word("order.tracking"));
|
|
72
|
+
if (tracking === null)
|
|
73
|
+
return;
|
|
74
|
+
const problem = await setState(Number(record.id), "shipped", tracking.trim() || undefined);
|
|
75
|
+
if (problem)
|
|
76
|
+
window.alert(problem);
|
|
77
|
+
refresh();
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "shop-deliver",
|
|
82
|
+
label: "Mark delivered",
|
|
83
|
+
permission: "ext.shop:fulfill",
|
|
84
|
+
collections: ["shop-orders"],
|
|
85
|
+
run: async ({ record, refresh }) => {
|
|
86
|
+
if (record.state !== "paid" && record.state !== "shipped")
|
|
87
|
+
return window.alert(word("order.onlyPaidOrShipped"));
|
|
88
|
+
const problem = await setState(Number(record.id), "delivered");
|
|
89
|
+
if (problem)
|
|
90
|
+
window.alert(problem);
|
|
91
|
+
refresh();
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
recordPanels: [{ id: "shop-panels", component: Panels }],
|
|
96
|
+
});
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ORDERS, PRODUCTS, VARIANTS, CATEGORIES, ZONES } from "./schema";
|
|
2
|
+
export interface ShopOptions {
|
|
3
|
+
/** The public site's origin, such as https://example.com, for links in emails. */
|
|
4
|
+
siteUrl: string;
|
|
5
|
+
/** What prices are in, set on first install. After that, change it on the Shop page and on Orders' total field. */
|
|
6
|
+
currency?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Turns the CMS into an online shop that takes payment through the Payments plugin. See docs/plugins/shop.md. */
|
|
9
|
+
export declare function shop(options: ShopOptions): import("tansy/plugin").CmsPlugin;
|