@shop-on/theme-server 0.9.0 → 0.11.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/dist/account-state.js +1 -2
- package/dist/account.d.ts +1 -3
- package/dist/account.js +1 -3
- package/dist/activity.d.ts +1 -3
- package/dist/activity.js +1 -2
- package/dist/analytics-proxy.d.ts +8 -14
- package/dist/analytics-proxy.js +111 -28
- package/dist/analytics-script-proxy.d.ts +1 -5
- package/dist/analytics-script-proxy.js +4 -14
- package/dist/api-contract/src/addresses.js +32 -0
- package/dist/api-contract/src/areas.js +49 -0
- package/dist/api-contract/src/custom-data.d.ts +31 -0
- package/dist/api-contract/src/custom-data.js +303 -0
- package/dist/api-contract/src/ids.js +110 -0
- package/dist/api-contract/src/image.js +65 -0
- package/dist/api-contract/src/limits.js +44 -0
- package/dist/api-contract/src/media.js +13 -0
- package/dist/api-contract/src/pickup.js +11 -0
- package/dist/api-contract/src/recommendations.js +4 -0
- package/dist/api-contract/src/shops.js +27 -0
- package/dist/api-contract/src/storefront/analytics.d.ts +100 -0
- package/dist/api-contract/src/storefront/analytics.js +138 -0
- package/dist/api-contract/src/storefront/areas.d.ts +2 -0
- package/dist/api-contract/src/storefront/cart.d.ts +132 -0
- package/dist/api-contract/src/storefront/cart.js +248 -0
- package/dist/api-contract/src/storefront/catalog.d.ts +3 -0
- package/dist/api-contract/src/storefront/checkout-analytics.d.ts +2 -0
- package/dist/api-contract/src/storefront/checkout.d.ts +2 -0
- package/dist/api-contract/src/storefront/checkout.js +624 -0
- package/dist/api-contract/src/storefront/client.d.ts +3 -0
- package/dist/api-contract/src/storefront/client.js +6 -0
- package/dist/api-contract/src/storefront/content.d.ts +3 -0
- package/dist/api-contract/src/storefront/custom-data.d.ts +2 -0
- package/dist/api-contract/src/storefront/custom-data.js +27 -0
- package/dist/api-contract/src/storefront/customer.d.ts +2 -0
- package/dist/api-contract/src/storefront/customer.js +261 -0
- package/dist/api-contract/src/storefront/downloads.d.ts +2 -0
- package/dist/api-contract/src/storefront/draft-order-invoice.d.ts +2 -0
- package/dist/api-contract/src/storefront/forms.d.ts +2 -0
- package/dist/api-contract/src/storefront/forms.js +82 -0
- package/dist/api-contract/src/storefront/index.d.ts +20956 -0
- package/dist/api-contract/src/storefront/orders.d.ts +2 -0
- package/dist/api-contract/src/storefront/policies.d.ts +2 -0
- package/dist/api-contract/src/storefront/procedure.d.ts +2 -0
- package/dist/api-contract/src/storefront/procedure.js +29 -0
- package/dist/api-contract/src/storefront/reviews.d.ts +20 -0
- package/dist/api-contract/src/storefront/search.d.ts +3 -0
- package/dist/api-contract/src/storefront/seo.d.ts +2 -0
- package/dist/api-contract/src/storefront/seo.js +132 -0
- package/dist/api-contract/src/storefront/shop.d.ts +2 -0
- package/dist/api-contract/src/storefront/shop.js +101 -0
- package/dist/api-contract/src/taxonomy.js +5 -0
- package/dist/api-contract/src/text.js +15 -0
- package/dist/api-contract/src/theme-documents.js +13 -0
- package/dist/api-contract/src/theme-translations.d.ts +14 -0
- package/dist/api-contract/src/theme-translations.js +30 -0
- package/dist/api-contract/src/video.js +19 -0
- package/dist/availability.d.ts +6 -3
- package/dist/availability.js +11 -5
- package/dist/blog.d.ts +53 -59
- package/dist/blog.js +197 -497
- package/dist/cache.d.ts +5 -6
- package/dist/cache.js +1 -2
- package/dist/canonical-host.d.ts +4 -6
- package/dist/canonical-host.js +5 -6
- package/dist/card.js +159 -0
- package/dist/cart-customer.d.ts +1 -3
- package/dist/cart-customer.js +64 -105
- package/dist/cart-mutations.d.ts +43 -77
- package/dist/cart-mutations.js +106 -232
- package/dist/cart-recommendations.d.ts +1 -3
- package/dist/cart-recommendations.js +1 -2
- package/dist/cart-session.d.ts +1 -3
- package/dist/cart-session.js +1 -2
- package/dist/cart.d.ts +63 -224
- package/dist/cart.js +70 -197
- package/dist/checkout.d.ts +13 -17
- package/dist/checkout.js +75 -101
- package/dist/coalesce.js +57 -0
- package/dist/collection.d.ts +89 -298
- package/dist/collection.js +210 -656
- package/dist/contact.d.ts +20 -10
- package/dist/contact.js +36 -30
- package/dist/content-version.d.ts +37 -21
- package/dist/content-version.js +64 -42
- package/dist/contract-kit/src/client.d.ts +12 -0
- package/dist/contract-kit/src/client.js +156 -0
- package/dist/contract-kit/src/errors.d.ts +1 -0
- package/dist/contract-kit/src/errors.js +81 -0
- package/dist/contract-kit/src/ids.d.ts +1 -0
- package/dist/contract-kit/src/ids.js +118 -0
- package/dist/contract-kit/src/index.d.ts +7 -0
- package/dist/contract-kit/src/money.d.ts +1 -0
- package/dist/contract-kit/src/money.js +10 -0
- package/dist/contract-kit/src/pagination.d.ts +1 -0
- package/dist/contract-kit/src/procedure.d.ts +69 -0
- package/dist/contract-kit/src/procedure.js +16 -0
- package/dist/contract-kit/src/realtime.d.ts +1 -0
- package/dist/cookie-secret.js +1 -2
- package/dist/csrf.js +1 -2
- package/dist/customer-handoff.d.ts +1 -3
- package/dist/customer-handoff.js +10 -25
- package/dist/customer-session.d.ts +1 -3
- package/dist/customer-session.js +1 -2
- package/dist/customer.d.ts +2 -3
- package/dist/customer.js +27 -44
- package/dist/files.d.ts +49 -10
- package/dist/files.js +106 -89
- package/dist/fonts.d.ts +3 -5
- package/dist/fonts.js +16 -35
- package/dist/html.d.ts +1 -3
- package/dist/html.js +1 -2
- package/dist/liquid.d.ts +4 -10
- package/dist/liquid.js +25 -32
- package/dist/listing.js +79 -0
- package/dist/marketing-cookies.d.ts +1 -3
- package/dist/marketing-cookies.js +1 -2
- package/dist/menu.d.ts +46 -155
- package/dist/menu.js +51 -61
- package/dist/metafields.d.ts +9 -5
- package/dist/metafields.js +10 -38
- package/dist/metaobject.d.ts +10 -5
- package/dist/metaobject.js +43 -66
- package/dist/money.d.ts +7 -0
- package/dist/money.js +18 -0
- package/dist/newsletter.d.ts +19 -10
- package/dist/newsletter.js +31 -25
- package/dist/page.d.ts +13 -17
- package/dist/page.js +49 -105
- package/dist/password-session.d.ts +1 -3
- package/dist/password-session.js +1 -2
- package/dist/password.d.ts +25 -18
- package/dist/password.js +41 -59
- package/dist/policy.d.ts +7 -7
- package/dist/policy.js +19 -55
- package/dist/product.d.ts +42 -67
- package/dist/product.js +144 -644
- package/dist/read-ahead.d.ts +18 -0
- package/dist/read-ahead.js +32 -0
- package/dist/recommendations.d.ts +6 -12
- package/dist/recommendations.js +36 -60
- package/dist/review.d.ts +134 -94
- package/dist/review.js +257 -469
- package/dist/search.d.ts +59 -64
- package/dist/search.js +170 -469
- package/dist/seo-context.d.ts +1 -3
- package/dist/seo-context.js +4 -5
- package/dist/seo-documents.d.ts +50 -0
- package/dist/seo-documents.js +149 -0
- package/dist/shop-seo.d.ts +3 -5
- package/dist/shop-seo.js +7 -26
- package/dist/shop.d.ts +38 -42
- package/dist/shop.js +37 -51
- package/dist/store-availability.d.ts +12 -14
- package/dist/store-availability.js +18 -56
- package/dist/storefront.js +199 -0
- package/dist/structured-data.d.ts +3 -28
- package/dist/structured-data.js +19 -49
- package/dist/trace.js +1 -2
- package/dist/translations.d.ts +26 -31
- package/dist/translations.js +55 -28
- package/package.json +16 -14
- package/dist/graphql-env.d.ts +0 -22778
- package/dist/graphql.d.ts +0 -64
- package/dist/graphql.js +0 -344
- package/dist/schema.storefront.graphql +0 -10483
- package/dist/seo-proxy.d.ts +0 -11
- package/dist/seo-proxy.js +0 -26
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { audienceProcedure } from "../../../contract-kit/src/procedure.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
// ../api-contract/src/storefront/procedure.ts
|
|
4
|
+
/** Who may call `shop.get`: answered whatever the shop's status, so the storefront can say why it is down. */
|
|
5
|
+
const storefrontBase = audienceProcedure();
|
|
6
|
+
/**
|
|
7
|
+
* The shop is closed by its owner or suspended by Lite (`shop.get` says
|
|
8
|
+
* which): every storefront read but `shop.get` answers it, and the
|
|
9
|
+
* storefront shows its unavailable page. A password-locked shop is not
|
|
10
|
+
* unavailable: the gate is the storefront's to keep (`shop.get`'s
|
|
11
|
+
* `passwordProtection`), so its reads answer.
|
|
12
|
+
*/
|
|
13
|
+
const SHOP_UNAVAILABLE = {
|
|
14
|
+
status: 503,
|
|
15
|
+
data: z.object({ status: z.enum(["closed", "suspended"]) })
|
|
16
|
+
};
|
|
17
|
+
/** A read of the shop's storefront content: refused while the shop is unavailable. */
|
|
18
|
+
const storefrontProcedure = storefrontBase.errors({ SHOP_UNAVAILABLE });
|
|
19
|
+
/**
|
|
20
|
+
* A buyer's form whose Turnstile token Cloudflare did not pass, or could
|
|
21
|
+
* not be asked about. Asked for only while `shop.get` answers a
|
|
22
|
+
* `turnstileSitekey`: the token is then the widget's, checked before
|
|
23
|
+
* anything else the form says.
|
|
24
|
+
*/
|
|
25
|
+
const TURNSTILE_FAILED = {
|
|
26
|
+
status: 403,
|
|
27
|
+
data: z.object({})
|
|
28
|
+
};
|
|
29
|
+
export { SHOP_UNAVAILABLE, TURNSTILE_FAILED, storefrontBase, storefrontProcedure };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "../../../contract-kit/src/index.js";
|
|
2
|
+
import "zod";
|
|
3
|
+
/** Why an answer to a review question was refused (legacy AttributeValidator's codes). */
|
|
4
|
+
export declare const REVIEW_ANSWER_REFUSALS: readonly [
|
|
5
|
+
/** No question of the shop that applies to the product has this id. */
|
|
6
|
+
"unknown",
|
|
7
|
+
/** Not one of the choice's keys, or not a step `"1"` to `"5"` of the scale. */
|
|
8
|
+
"invalid_value",
|
|
9
|
+
/** A required question left unanswered. */
|
|
10
|
+
"missing_required"];
|
|
11
|
+
/** Why a photo sent with a review was refused. */
|
|
12
|
+
export declare const REVIEW_PHOTO_REFUSALS: readonly [
|
|
13
|
+
/** No photo of this shop waiting for a review has this id: unknown, already on a review, or reserved over an hour ago. */
|
|
14
|
+
"not_found",
|
|
15
|
+
/** Its bytes were not PUT (yet). */
|
|
16
|
+
"not_uploaded",
|
|
17
|
+
/** Its bytes are not a JPEG, PNG or WebP image. */
|
|
18
|
+
"unsupported_type",
|
|
19
|
+
/** Its bytes are not the size or type declared, do not decode, or are over 50 megapixels. */
|
|
20
|
+
"unreadable"];
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { mntNonNegative, rate } from "../../../contract-kit/src/money.js";
|
|
2
|
+
import { imageSchema } from "../image.js";
|
|
3
|
+
import { SITEMAP_KINDS, SITEMAP_PAGE_MAX } from "../limits.js";
|
|
4
|
+
import { STOREFRONT_LOCALES } from "../shops.js";
|
|
5
|
+
import { storefrontProcedure } from "./procedure.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
// ../api-contract/src/storefront/seo.ts
|
|
8
|
+
/**
|
|
9
|
+
* What robots.txt disallows for every crawler (legacy
|
|
10
|
+
* Shop::Seo::RobotsTxt::DISALLOWED_PATHS): the buyer's own surfaces, nothing
|
|
11
|
+
* worth crawling. `/search` and `?preview=` are not here on purpose: they are
|
|
12
|
+
* `noindex`, and a crawler never fetches a disallowed URL, so it would never
|
|
13
|
+
* read the noindex.
|
|
14
|
+
*/
|
|
15
|
+
const ROBOTS_DISALLOWED_PATHS = [
|
|
16
|
+
"/cart",
|
|
17
|
+
"/checkout",
|
|
18
|
+
"/account",
|
|
19
|
+
"/password",
|
|
20
|
+
"/analytics"
|
|
21
|
+
];
|
|
22
|
+
const storefrontSeo = z.object({
|
|
23
|
+
/** The home page's title; null: the shop's name. */
|
|
24
|
+
title: z.string().nullable(),
|
|
25
|
+
/** The home page's meta description; null: none. */
|
|
26
|
+
description: z.string().nullable(),
|
|
27
|
+
/** Google Search Console's token, for `<meta name="google-site-verification">`. */
|
|
28
|
+
googleSiteVerification: z.string().nullable(),
|
|
29
|
+
/** Bing Webmaster Tools' token, for `<meta name="msvalidate.01">`. */
|
|
30
|
+
bingSiteVerification: z.string().nullable(),
|
|
31
|
+
/** The og:image and twitter:image of a page without its own; null: none, or its file is not a ready image. */
|
|
32
|
+
socialImage: imageSchema.nullable()
|
|
33
|
+
});
|
|
34
|
+
/** Who pays to send a return back (schema.org's return fees). */
|
|
35
|
+
const RETURN_SHIPPING_COSTS = [
|
|
36
|
+
"free",
|
|
37
|
+
"customerProvided",
|
|
38
|
+
"flatRate"
|
|
39
|
+
];
|
|
40
|
+
/** The shop's return terms as schema.org's MerchantReturnPolicy reads them. */
|
|
41
|
+
const storefrontReturnPolicy = z.object({
|
|
42
|
+
/** Days after delivery a buyer may return an item; null: no limit. */
|
|
43
|
+
returnWindowDays: z.int().positive().nullable(),
|
|
44
|
+
/** The restocking fee as a rate (100 000 is 100 %); null: none. */
|
|
45
|
+
restockingFeeRate: rate.nullable(),
|
|
46
|
+
returnShippingCost: z.enum(RETURN_SHIPPING_COSTS),
|
|
47
|
+
/** What a return's shipping costs the buyer, in möngö: only when `returnShippingCost` is `flatRate`. */
|
|
48
|
+
flatRateAmount: mntNonNegative.nullable()
|
|
49
|
+
});
|
|
50
|
+
const storefrontStructuredData = z.object({
|
|
51
|
+
/** ISO 3166-1 alpha-2 of the country of the shop's business address; null without one. */
|
|
52
|
+
countryCode: z.string().length(2).nullable(),
|
|
53
|
+
/** The shop's wordmark logo (its branding); null: none, or not a ready image. */
|
|
54
|
+
logo: imageSchema.nullable(),
|
|
55
|
+
/** The refund policy's storefront path (`/policies/refund-policy`); null while the shop has not written one. */
|
|
56
|
+
refundPolicyUrl: z.string().nullable(),
|
|
57
|
+
/**
|
|
58
|
+
* The terms the merchant saved; null until they do (the defaults an
|
|
59
|
+
* unconfigured shop prefills returns with are no promise to publish).
|
|
60
|
+
*/
|
|
61
|
+
returnPolicy: storefrontReturnPolicy.nullable()
|
|
62
|
+
});
|
|
63
|
+
storefrontProcedure.meta({
|
|
64
|
+
permission: "storefront.read",
|
|
65
|
+
rateLimit: "storefront"
|
|
66
|
+
}).route({
|
|
67
|
+
summary: "Get the shop's SEO",
|
|
68
|
+
description: "The home page's title and meta description, the search-console verification tokens and the default share image, as the shop saved them: all null when it never did."
|
|
69
|
+
}).input(z.object({})).output(storefrontSeo);
|
|
70
|
+
storefrontProcedure.meta({
|
|
71
|
+
permission: "storefront.read",
|
|
72
|
+
rateLimit: "storefront"
|
|
73
|
+
}).route({
|
|
74
|
+
summary: "Get the shop's structured-data facts",
|
|
75
|
+
description: "What the storefront's schema.org Organization and MerchantReturnPolicy say of the shop: its country, logo, refund policy's path and return terms. The same in every language."
|
|
76
|
+
}).input(z.object({})).output(storefrontStructuredData);
|
|
77
|
+
const storefrontRobots = z.object({
|
|
78
|
+
/** The coming-soon gate is on: robots.txt disallows everything and names no sitemap. */
|
|
79
|
+
locked: z.boolean(),
|
|
80
|
+
/** The shop's canonical storefront origin, no trailing slash: its active primary domain's (https on a custom one), else `{handle}.{storefront base}`. */
|
|
81
|
+
origin: z.string(),
|
|
82
|
+
/** The merchant's own lines (checked when saved: comments and user-agent, allow, disallow, crawl-delay); null when locked or none. */
|
|
83
|
+
append: z.string().nullable()
|
|
84
|
+
});
|
|
85
|
+
const storefrontSitemapIndex = z.object({
|
|
86
|
+
/** As `seo.robots`' `origin`. */
|
|
87
|
+
origin: z.string(),
|
|
88
|
+
/** The kinds with an entry, in `SITEMAP_KINDS`' order (`static` always, first), each with its number of files. */
|
|
89
|
+
files: z.array(z.object({
|
|
90
|
+
kind: z.enum(SITEMAP_KINDS),
|
|
91
|
+
pages: z.int().positive()
|
|
92
|
+
}))
|
|
93
|
+
});
|
|
94
|
+
const storefrontSitemapEntry = z.object({
|
|
95
|
+
/** The resource's storefront path without a language prefix (`storefrontPath`): `/products/shirt`. */
|
|
96
|
+
path: z.string(),
|
|
97
|
+
/** When the resource last changed (ISO 8601, UTC); null for the home page and the catalogue. */
|
|
98
|
+
updatedAt: z.iso.datetime().nullable()
|
|
99
|
+
});
|
|
100
|
+
const storefrontSitemapFile = z.object({
|
|
101
|
+
/** As `seo.robots`' `origin`. */
|
|
102
|
+
origin: z.string(),
|
|
103
|
+
/** The shop's primary language first, then its other published languages by code: each entry is a URL in each. */
|
|
104
|
+
locales: z.array(z.enum(STOREFRONT_LOCALES)),
|
|
105
|
+
/** At most `SITEMAP_PAGE_SIZE`, in creation order: a new resource lands in the last file, the earlier ones stay as they were. */
|
|
106
|
+
entries: z.array(storefrontSitemapEntry)
|
|
107
|
+
});
|
|
108
|
+
storefrontProcedure.meta({
|
|
109
|
+
permission: "storefront.read",
|
|
110
|
+
rateLimit: "storefront"
|
|
111
|
+
}).route({
|
|
112
|
+
summary: "Get the shop's robots.txt facts",
|
|
113
|
+
description: "What the storefront's robots.txt is written from: whether the coming-soon gate is on, the shop's canonical origin (the sitemap's), and the merchant's own lines (null while locked)."
|
|
114
|
+
}).input(z.object({})).output(storefrontRobots);
|
|
115
|
+
storefrontProcedure.meta({
|
|
116
|
+
permission: "storefront.read",
|
|
117
|
+
rateLimit: "storefront-sitemap"
|
|
118
|
+
}).route({
|
|
119
|
+
summary: "Get the shop's sitemap index",
|
|
120
|
+
description: "The sitemap's files: each kind with an entry and how many files of `SITEMAP_PAGE_SIZE` it takes, `static` always first. NOT_FOUND while the coming-soon gate is on: a locked shop publishes no list of its URLs."
|
|
121
|
+
}).input(z.object({})).output(storefrontSitemapIndex);
|
|
122
|
+
storefrontProcedure.meta({
|
|
123
|
+
permission: "storefront.read",
|
|
124
|
+
rateLimit: "storefront-sitemap"
|
|
125
|
+
}).route({
|
|
126
|
+
summary: "Get a sitemap file",
|
|
127
|
+
description: "One file of a kind: what a buyer may see now, in creation order, `SITEMAP_PAGE_SIZE` a file, each with its path and when it last changed, and the languages each is a URL in. NOT_FOUND past the kind's last file, and while the coming-soon gate is on."
|
|
128
|
+
}).input(z.object({
|
|
129
|
+
kind: z.enum(SITEMAP_KINDS),
|
|
130
|
+
page: z.int().min(1).max(SITEMAP_PAGE_MAX)
|
|
131
|
+
})).output(storefrontSitemapFile);
|
|
132
|
+
export { RETURN_SHIPPING_COSTS, ROBOTS_DISALLOWED_PATHS, storefrontReturnPolicy, storefrontRobots, storefrontSeo, storefrontSitemapEntry, storefrontSitemapFile, storefrontSitemapIndex, storefrontStructuredData };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { noInput } from "../../../contract-kit/src/procedure.js";
|
|
2
|
+
import { liteId } from "../ids.js";
|
|
3
|
+
import { imageSchema } from "../image.js";
|
|
4
|
+
import { SHOP_STATUSES, STOREFRONT_LOCALES } from "../shops.js";
|
|
5
|
+
import { storefrontBase } from "./procedure.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
// ../api-contract/src/storefront/shop.ts
|
|
8
|
+
const storefrontShop = z.object({
|
|
9
|
+
id: liteId("shop"),
|
|
10
|
+
handle: z.string(),
|
|
11
|
+
name: z.string(),
|
|
12
|
+
/** `closed` (by its owner) and `suspended` (by Lite): the storefront shows its unavailable page, and every other read answers SHOP_UNAVAILABLE. */
|
|
13
|
+
status: z.enum(SHOP_STATUSES),
|
|
14
|
+
/** Every amount the storefront reads is integer möngö of this currency. */
|
|
15
|
+
currency: z.literal("MNT"),
|
|
16
|
+
timezone: z.string(),
|
|
17
|
+
primaryLocale: z.enum(STOREFRONT_LOCALES),
|
|
18
|
+
/** The primary first, then each additional language in the order it was added; an unpublished one is the merchant's to preview, not the buyer's to pick. */
|
|
19
|
+
locales: z.array(z.object({
|
|
20
|
+
locale: z.enum(STOREFRONT_LOCALES),
|
|
21
|
+
published: z.boolean()
|
|
22
|
+
})),
|
|
23
|
+
/** The canonical host every other host redirects to: an active custom domain or platform alias; null: `{handle}.{storefront base}`. */
|
|
24
|
+
primaryDomain: z.object({ hostname: z.string() }).nullable(),
|
|
25
|
+
/** The shop's canonical storefront address (legacy `Shop#storefront_url`): its primary domain's, else `{handle}.{storefront base}`; `http` on a platform host of a localhost base, else `https`. */
|
|
26
|
+
storefrontUrl: z.url(),
|
|
27
|
+
/** The coming-soon gate, which the storefront keeps: while `enabled`, a buyer without an unlock of this `version` sees the password page. */
|
|
28
|
+
passwordProtection: z.object({
|
|
29
|
+
enabled: z.boolean(),
|
|
30
|
+
/** When the password was last set: stamped into the buyer's unlock, so a new password ends every unlock. Null when none was ever set. */
|
|
31
|
+
version: z.iso.datetime().nullable(),
|
|
32
|
+
/** While enabled, `?key=<bypassToken>` on any storefront URL unlocks it (the admin's "View shop" links); it changes with the password. Never send it to a browser. */
|
|
33
|
+
bypassToken: z.string().nullable()
|
|
34
|
+
}),
|
|
35
|
+
/** Whether listed prices contain VAT ("tax included" under a price); false when the shop charges none. */
|
|
36
|
+
taxesIncluded: z.boolean(),
|
|
37
|
+
/** Whether it issues eBarimt receipts (its fiscal engine is on): the checkout asks who the receipt is for (a person, or an organization's register) only then. */
|
|
38
|
+
issuesFiscalReceipts: z.boolean(),
|
|
39
|
+
/** The Cloudflare Turnstile widget key the storefront's public forms render; null when none is configured. */
|
|
40
|
+
turnstileSitekey: z.string().nullable(),
|
|
41
|
+
/** The shop's section of the central account app: the header's account link. */
|
|
42
|
+
accountUrl: z.url(),
|
|
43
|
+
/** The shop's section of the central checkout app: a cart's checkout starts at `<checkoutUrl>/begin`. */
|
|
44
|
+
checkoutUrl: z.url(),
|
|
45
|
+
/** The providers Cody Pay offers its buyers, for the footer's payment icons and the checkout's marks: `logoUrl` the mark Cody Pay serves, null for a provider without one. Empty when the shop takes no payment through Cody Pay, or Cody Pay cannot say. */
|
|
46
|
+
paymentMethods: z.array(z.object({
|
|
47
|
+
key: z.string(),
|
|
48
|
+
label: z.string(),
|
|
49
|
+
logoUrl: z.url().nullable()
|
|
50
|
+
}))
|
|
51
|
+
});
|
|
52
|
+
storefrontBase.meta({
|
|
53
|
+
permission: "storefront.read",
|
|
54
|
+
rateLimit: "storefront"
|
|
55
|
+
}).route({
|
|
56
|
+
summary: "Get the shop",
|
|
57
|
+
description: "The shop the storefront key belongs to: its name, status, currency, timezone, languages, canonical host, coming-soon gate, price captions, whether it issues eBarimt receipts, account and checkout URLs and payment methods. Answered whatever its status, so a closed or suspended store can show why."
|
|
58
|
+
}).input(noInput).output(storefrontShop);
|
|
59
|
+
/**
|
|
60
|
+
* The response header every storefront answer carries once its key named
|
|
61
|
+
* the shop, an error's included (SHOP_UNAVAILABLE, NOT_FOUND, a refused
|
|
62
|
+
* input): the shop's content version, as `shop.contentVersion` answers it.
|
|
63
|
+
* Exposed to browsers by CORS.
|
|
64
|
+
*/
|
|
65
|
+
const CONTENT_VERSION_HEADER = "x-content-version";
|
|
66
|
+
storefrontBase.meta({
|
|
67
|
+
permission: "storefront.read",
|
|
68
|
+
rateLimit: "storefront"
|
|
69
|
+
}).route({
|
|
70
|
+
summary: "Get the shop's content version",
|
|
71
|
+
description: `A token that changes whenever something the shop's storefront shows has changed (a product, collection, page, menu, file, setting or moderated review), in the transaction that changed it. Compare it for equality only: any difference, lower included (a restored database), means drop what was cached under the old one. Every storefront answer also carries it in the \`${CONTENT_VERSION_HEADER}\` header. Answered whatever the shop's status.`
|
|
72
|
+
}).input(noInput).output(z.object({ version: z.string().regex(/^\d+$/) }));
|
|
73
|
+
/** Corner rounding on the checkout and account apps: none 0, small 0.25rem, base 0.5rem, large 0.75rem. */
|
|
74
|
+
const CORNER_RADII = [
|
|
75
|
+
"none",
|
|
76
|
+
"small",
|
|
77
|
+
"base",
|
|
78
|
+
"large"
|
|
79
|
+
];
|
|
80
|
+
/** The shop's look on the central checkout and account apps (docs/branding.md). */
|
|
81
|
+
const storefrontBranding = z.object({
|
|
82
|
+
/** Null until the merchant saves a look: the apps' defaults. */
|
|
83
|
+
branding: z.object({
|
|
84
|
+
/** `#rrggbb`; null keeps the default. */
|
|
85
|
+
brandColor: z.string().nullable(),
|
|
86
|
+
accentColor: z.string().nullable(),
|
|
87
|
+
backgroundColor: z.string().nullable(),
|
|
88
|
+
textColor: z.string().nullable(),
|
|
89
|
+
cornerRadius: z.enum(CORNER_RADII),
|
|
90
|
+
/** Null until uploaded and processed. */
|
|
91
|
+
logo: imageSchema.nullable(),
|
|
92
|
+
squareLogo: imageSchema.nullable()
|
|
93
|
+
}).nullable() });
|
|
94
|
+
storefrontBase.meta({
|
|
95
|
+
permission: "storefront.read",
|
|
96
|
+
rateLimit: "storefront"
|
|
97
|
+
}).route({
|
|
98
|
+
summary: "Get the shop's look on the buyer apps",
|
|
99
|
+
description: "The colours, corner rounding and logos the central account and checkout apps draw the shop in. Answered whatever the shop's status."
|
|
100
|
+
}).input(noInput).output(storefrontBranding);
|
|
101
|
+
export { CONTENT_VERSION_HEADER, CORNER_RADII, storefrontBranding, storefrontShop };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GIFT_CARD_CODE_PATTERN } from "./limits.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
// ../api-contract/src/text.ts
|
|
4
|
+
/**
|
|
5
|
+
* An email someone typed: trimmed and lower-cased before it is checked
|
|
6
|
+
* (legacy's `strip.downcase`, then its format), as the database stores
|
|
7
|
+
* one. `z.email().trim()` would check first and refuse a padded address.
|
|
8
|
+
* One string schema, so a rate class may count per it.
|
|
9
|
+
*/
|
|
10
|
+
const typedEmail = z.string().trim().toLowerCase().check(z.email()).max(254);
|
|
11
|
+
/** A phone number in E.164 (`+97699112233`), as the schema's `shops.phone` domain holds it. */
|
|
12
|
+
const e164Phone = z.string().regex(/^\+[1-9][0-9]{6,14}$/);
|
|
13
|
+
/** A gift card's code as typed: trimmed and upper-cased, then held to the pattern. */
|
|
14
|
+
const giftCardCode = z.string().trim().transform((code) => code.toUpperCase()).pipe(z.string().regex(GIFT_CARD_CODE_PATTERN));
|
|
15
|
+
export { e164Phone, giftCardCode, typedEmail };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
z.string().regex(/^[a-z0-9_-]{4,32}$/);
|
|
3
|
+
/**
|
|
4
|
+
* A template id (`index`, `product.alt`) or a section group's key
|
|
5
|
+
* (`header`) as `storefront.theme_revision_entries.name` takes it: lowercase,
|
|
6
|
+
* one dot at most, 100 characters. Stricter than theme-contract's
|
|
7
|
+
* `invalidTemplateId` (no capitals, no second dot), so every name it passes
|
|
8
|
+
* is a safe file name on the orchestrator's disk too.
|
|
9
|
+
*/
|
|
10
|
+
const THEME_DOCUMENT_NAME = /^[a-z0-9_-]+(\.[a-z0-9_-]+)?$/;
|
|
11
|
+
/** A template id or a section group's key: THEME_DOCUMENT_NAME, 100 characters at most. */
|
|
12
|
+
const themeDocumentName = z.string().max(100).regex(THEME_DOCUMENT_NAME);
|
|
13
|
+
export { THEME_DOCUMENT_NAME, themeDocumentName };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Which of an install's texts: its strings, its settings, one template's or one section group's. */
|
|
3
|
+
export declare const themeTranslationScope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"strings">;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"settings">;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"template">;
|
|
9
|
+
handle: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"sectionGroup">;
|
|
12
|
+
handle: z.ZodString;
|
|
13
|
+
}, z.core.$strip>], "type">;
|
|
14
|
+
export type ThemeTranslationScope = z.infer<typeof themeTranslationScope>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { themeDocumentName } from "./theme-documents.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
// ../api-contract/src/theme-translations.ts
|
|
4
|
+
const TRANSLATION_FORMATS = ["plain", "html"];
|
|
5
|
+
/** Path segments a theme's overlay never walks (they reach an object's prototype): refused in a key. */
|
|
6
|
+
const UNSAFE_KEY_SEGMENTS = [
|
|
7
|
+
"__proto__",
|
|
8
|
+
"constructor",
|
|
9
|
+
"prototype"
|
|
10
|
+
];
|
|
11
|
+
/** Which of an install's texts: its strings, its settings, one template's or one section group's. */
|
|
12
|
+
const themeTranslationScope = z.discriminatedUnion("type", [
|
|
13
|
+
z.object({ type: z.literal("strings") }),
|
|
14
|
+
z.object({ type: z.literal("settings") }),
|
|
15
|
+
z.object({
|
|
16
|
+
type: z.literal("template"),
|
|
17
|
+
handle: themeDocumentName
|
|
18
|
+
}),
|
|
19
|
+
z.object({
|
|
20
|
+
type: z.literal("sectionGroup"),
|
|
21
|
+
handle: themeDocumentName
|
|
22
|
+
})
|
|
23
|
+
]);
|
|
24
|
+
z.string().min(1).max(500).regex(/^\P{Cc}+$/u, "No control characters").refine((key) => key.split(".").every((segment) => segment !== "" && !UNSAFE_KEY_SEGMENTS.includes(segment)), "A dot path of non-empty segments, none of them __proto__, constructor or prototype");
|
|
25
|
+
z.object({
|
|
26
|
+
key: z.string(),
|
|
27
|
+
value: z.string(),
|
|
28
|
+
format: z.enum(TRANSLATION_FORMATS)
|
|
29
|
+
});
|
|
30
|
+
export { TRANSLATION_FORMATS, UNSAFE_KEY_SEGMENTS, themeTranslationScope };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { liteId } from "./ids.js";
|
|
2
|
+
import { imageSchema } from "./image.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
// ../api-contract/src/video.ts
|
|
5
|
+
const videoSchema = z.object({
|
|
6
|
+
id: liteId("file"),
|
|
7
|
+
/** The MP4. */
|
|
8
|
+
url: z.string(),
|
|
9
|
+
/** The HLS master playlist. */
|
|
10
|
+
hlsUrl: z.string(),
|
|
11
|
+
/** Pixels as displayed (rotation applied), of the MP4. */
|
|
12
|
+
width: z.int().positive(),
|
|
13
|
+
height: z.int().positive(),
|
|
14
|
+
durationMs: z.int().positive(),
|
|
15
|
+
alt: z.string().nullable(),
|
|
16
|
+
/** The first frame, with the video's alt. */
|
|
17
|
+
poster: imageSchema
|
|
18
|
+
});
|
|
19
|
+
export { videoSchema };
|
package/dist/availability.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
//#region src/availability.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Request middleware: every theme registers it in `src/start.ts` after
|
|
4
3
|
* `storefrontActivityMiddleware`, which answers `/health` before it. A closed
|
|
5
4
|
* or suspended store (see docs/shop-lifecycle.md) serves one uncacheable,
|
|
6
5
|
* unindexed 503 page in place of every route; the shop record is the
|
|
7
6
|
* memoised one the root loader reads, so this costs no extra request.
|
|
7
|
+
*
|
|
8
|
+
* That record can be up to a minute older than the close. Every other read
|
|
9
|
+
* checks the status itself and answers SHOP_UNAVAILABLE from the moment the
|
|
10
|
+
* close commits, so a request that met one is answered with the same page,
|
|
11
|
+
* whatever its loader made of the refusal.
|
|
8
12
|
*/
|
|
9
|
-
export declare const storefrontAvailabilityMiddleware: import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, undefined>;
|
|
10
|
-
//#endregion
|
|
13
|
+
export declare const storefrontAvailabilityMiddleware: import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, undefined>;
|
package/dist/availability.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { fetchShopInfo } from "./shop.js";
|
|
2
1
|
import { escapeHtmlAttr } from "./html.js";
|
|
2
|
+
import { fetchShopInfo } from "./shop.js";
|
|
3
|
+
import { shopUnavailableThisRequest } from "./storefront.js";
|
|
3
4
|
import { createMiddleware } from "@tanstack/react-start";
|
|
4
|
-
|
|
5
|
+
// src/availability.ts
|
|
5
6
|
/**
|
|
6
7
|
* Request middleware: every theme registers it in `src/start.ts` after
|
|
7
8
|
* `storefrontActivityMiddleware`, which answers `/health` before it. A closed
|
|
8
9
|
* or suspended store (see docs/shop-lifecycle.md) serves one uncacheable,
|
|
9
10
|
* unindexed 503 page in place of every route; the shop record is the
|
|
10
11
|
* memoised one the root loader reads, so this costs no extra request.
|
|
12
|
+
*
|
|
13
|
+
* That record can be up to a minute older than the close. Every other read
|
|
14
|
+
* checks the status itself and answers SHOP_UNAVAILABLE from the moment the
|
|
15
|
+
* close commits, so a request that met one is answered with the same page,
|
|
16
|
+
* whatever its loader made of the refusal.
|
|
11
17
|
*/
|
|
12
18
|
const storefrontAvailabilityMiddleware = createMiddleware().server(async ({ next }) => {
|
|
13
19
|
let shop;
|
|
@@ -16,8 +22,9 @@ const storefrontAvailabilityMiddleware = createMiddleware().server(async ({ next
|
|
|
16
22
|
} catch {
|
|
17
23
|
return next();
|
|
18
24
|
}
|
|
19
|
-
if (
|
|
20
|
-
|
|
25
|
+
if (shop.status !== "active") return unavailableResponse(shop.name);
|
|
26
|
+
const result = await next();
|
|
27
|
+
return shopUnavailableThisRequest() ? unavailableResponse(shop.name) : result;
|
|
21
28
|
});
|
|
22
29
|
function unavailableResponse(shopName) {
|
|
23
30
|
const name = escapeHtmlAttr(shopName);
|
|
@@ -55,5 +62,4 @@ p{margin:4px 0;color:var(--muted)}
|
|
|
55
62
|
}
|
|
56
63
|
});
|
|
57
64
|
}
|
|
58
|
-
//#endregion
|
|
59
65
|
export { storefrontAvailabilityMiddleware };
|
package/dist/blog.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ImageFileInfo } from "./files.js";
|
|
2
2
|
import { MetafieldMap } from "./metafields.js";
|
|
3
|
-
//#region src/blog.d.ts
|
|
4
3
|
export type ArticleAuthor = {
|
|
5
4
|
name: string;
|
|
6
5
|
};
|
|
@@ -8,12 +7,16 @@ export type ArticleCardData = {
|
|
|
8
7
|
handle: string;
|
|
9
8
|
blogHandle: string;
|
|
10
9
|
title: string;
|
|
10
|
+
/** The summary as plain text, cut at a word within the read's excerpt
|
|
11
|
+
* length; null without a summary. */
|
|
11
12
|
summary: string | null;
|
|
13
|
+
/** The summary's text, else the body's opening, cut the same way: what a
|
|
14
|
+
* card shows when it falls back to the body. */
|
|
15
|
+
excerpt: string;
|
|
12
16
|
image: ImageFileInfo | null;
|
|
13
17
|
tags: string[];
|
|
14
18
|
author: ArticleAuthor | null;
|
|
15
|
-
publishedAt: string
|
|
16
|
-
bodyExcerpt?: string;
|
|
19
|
+
publishedAt: string;
|
|
17
20
|
};
|
|
18
21
|
export type ArticleData = ArticleCardData & {
|
|
19
22
|
bodyHtml: string;
|
|
@@ -26,7 +29,6 @@ export type ArticleData = ArticleCardData & {
|
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
31
|
export type BlogMeta = {
|
|
29
|
-
id: string;
|
|
30
32
|
handle: string;
|
|
31
33
|
title: string;
|
|
32
34
|
};
|
|
@@ -39,81 +41,74 @@ export type BlogData = {
|
|
|
39
41
|
export type BlogPageData = BlogData & {
|
|
40
42
|
tags: string[];
|
|
41
43
|
total_count: number;
|
|
42
|
-
page_info: {
|
|
43
|
-
end_cursor: string | null;
|
|
44
|
-
has_next_page: boolean;
|
|
45
|
-
};
|
|
46
44
|
};
|
|
47
|
-
/**
|
|
48
|
-
* blog or
|
|
49
|
-
|
|
45
|
+
/** A blog with its newest `first` articles, for a blog setting (featured
|
|
46
|
+
* blog, blog cards). Null for a missing blog or a failed read; pickers
|
|
47
|
+
* degrade silently. */
|
|
48
|
+
export declare function fetchBlog(data: {
|
|
50
49
|
handle: string;
|
|
51
50
|
first: number;
|
|
52
51
|
locale?: string;
|
|
53
|
-
})
|
|
52
|
+
}): Promise<BlogData | null>;
|
|
54
53
|
type FetchBlogPageInput = {
|
|
55
54
|
handle: string;
|
|
56
55
|
first?: number;
|
|
57
|
-
|
|
56
|
+
/** 1-based, as a listing's `?page=N`. */
|
|
57
|
+
page?: number;
|
|
58
58
|
tag?: string;
|
|
59
59
|
locale?: string;
|
|
60
60
|
imageWidth?: number;
|
|
61
61
|
excerptLength?: number;
|
|
62
|
-
withBodyExcerpt?: boolean;
|
|
63
62
|
};
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* blog
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export declare
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
|
|
63
|
+
/** A blog's listing page: the blog, its tags, and page `page` of its
|
|
64
|
+
* (tag-filtered) articles. Uncached because page + tag permutations would
|
|
65
|
+
* blow the TTL cache; the blog itself rides the cached record. Null for a
|
|
66
|
+
* missing blog so the route can map to `notFound()`. */
|
|
67
|
+
export declare function fetchBlogPage(data: FetchBlogPageInput): Promise<BlogPageData | null>;
|
|
68
|
+
/** Lean blog lookup for breadcrumbs / contextual labels, off the blog record. */
|
|
69
|
+
export declare function fetchBlogMeta(handle: string, locale?: string): Promise<BlogMeta | null>;
|
|
70
|
+
/** The blog's storefront metafields keyed `"namespace.key"`: the
|
|
71
|
+
* `blog_metafield` dynamic source, off the blog record. `{}` on a miss or a
|
|
72
|
+
* failure, so the literal renders. */
|
|
73
|
+
export declare function fetchBlogMetafields(handle: string, locale?: string): Promise<MetafieldMap>;
|
|
74
|
+
/** One article as its page renders it, by `ref`: an article id (an `article`
|
|
75
|
+
* setting's value) or `<blog-handle>/<article-handle>`. Null for a missing
|
|
76
|
+
* article or a failed read, so a resolver drops the entry. */
|
|
77
|
+
export declare function fetchArticleByRef(ref: string, locale?: string): Promise<ArticleData | null>;
|
|
78
|
+
/** The article route's read, by `(blogHandle, handle)`. */
|
|
79
|
+
export declare function fetchArticle(params: {
|
|
74
80
|
blogHandle: string;
|
|
75
81
|
handle: string;
|
|
76
82
|
locale?: string;
|
|
77
|
-
})
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
excerptLength?: number;
|
|
86
|
-
withBodyExcerpt?: boolean;
|
|
87
|
-
locale?: string;
|
|
88
|
-
}) => Promise<ArticleCardData | null>;
|
|
89
|
-
/** Lean blog lookup for breadcrumbs / contextual labels. Skips articles. */
|
|
90
|
-
export declare const fetchBlogMeta: (h: string, locale?: string | undefined) => Promise<BlogMeta | null>;
|
|
91
|
-
/** The posts either side of one in its blog, by publish date. Named by age
|
|
92
|
-
* rather than previous / next because the two conventions disagree: Liquid's
|
|
93
|
-
* `blog.previous_article` is the NEWER post and `next_article` the older.
|
|
94
|
-
* Null at either end, for a post with no publish date, and on a failed read.
|
|
95
|
-
* `imageWidth`, `excerptLength` and `withBodyExcerpt` size the cards as
|
|
96
|
-
* `fetchBlogPage`'s do. */
|
|
97
|
-
export declare const fetchAdjacentArticles: (params: {
|
|
98
|
-
blogId: string;
|
|
83
|
+
}): Promise<ArticleData | null>;
|
|
84
|
+
/** The posts either side of one in its blog, by publish date, off the same
|
|
85
|
+
* read as the article. Named by age rather than previous / next because the
|
|
86
|
+
* two conventions disagree: Liquid's `blog.previous_article` is the NEWER
|
|
87
|
+
* post and `next_article` the older. Null at either end and on a failed read.
|
|
88
|
+
* `imageWidth` sizes the cards as `fetchBlogPage`'s do. */
|
|
89
|
+
export declare function fetchAdjacentArticles(params: {
|
|
90
|
+
blogHandle: string;
|
|
99
91
|
handle: string;
|
|
100
|
-
publishedAt: string | null;
|
|
101
92
|
locale?: string;
|
|
102
93
|
imageWidth?: number;
|
|
103
|
-
|
|
104
|
-
withBodyExcerpt?: boolean;
|
|
105
|
-
}) => Promise<{
|
|
94
|
+
}): Promise<{
|
|
106
95
|
newer: ArticleCardData | null;
|
|
107
96
|
older: ArticleCardData | null;
|
|
108
97
|
}>;
|
|
109
|
-
/** The
|
|
110
|
-
*
|
|
111
|
-
* on a miss or a failure, so the literal renders. */
|
|
112
|
-
export declare
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
|
|
98
|
+
/** The article's storefront metafields: the `article_metafield` dynamic
|
|
99
|
+
* source, off the same read as the article. `ref` is what every article read
|
|
100
|
+
* takes. `{}` on a miss or a failure, so the literal renders. */
|
|
101
|
+
export declare function fetchArticleMetafields(ref: string, locale?: string): Promise<MetafieldMap>;
|
|
102
|
+
/** One picked article as a card, sized as `fetchBlogPage` sizes a listing's
|
|
103
|
+
* cards: for a picker whose article renders as a card, not a page. `ref` is
|
|
104
|
+
* what the `article` setting stores. Null for a missing article, a ref that
|
|
105
|
+
* names none, or a failed read, so the card falls back rather than the page. */
|
|
106
|
+
export declare function fetchArticleCard(params: {
|
|
107
|
+
ref: string;
|
|
108
|
+
imageWidth?: number;
|
|
109
|
+
excerptLength?: number;
|
|
110
|
+
locale?: string;
|
|
111
|
+
}): Promise<ArticleCardData | null>;
|
|
117
112
|
/** The route blog as the theme loader's dynamic sources read it
|
|
118
113
|
* (`DynamicSourceBlog` in `@shop-on/theme-loader`): the title off the blog read
|
|
119
114
|
* the theme already made, and a lazy provider the loader calls only when a
|
|
@@ -131,5 +126,4 @@ export declare function routeArticleSource(article: Pick<ArticleData, "blogHandl
|
|
|
131
126
|
title: string;
|
|
132
127
|
getMetafields: () => Promise<MetafieldMap>;
|
|
133
128
|
};
|
|
134
|
-
//#endregion
|
|
135
129
|
export {};
|