@cloudcart/storefront-mcp 0.3.4 → 0.3.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefront.d.ts","sourceRoot":"","sources":["../../src/prompts/storefront.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"storefront.d.ts","sourceRoot":"","sources":["../../src/prompts/storefront.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,gBAAgB,QA0drB,CAAC"}
|
|
@@ -36,6 +36,27 @@ requests: you write \`#graphql\` documents, not headers.
|
|
|
36
36
|
|
|
37
37
|
The \`cloudcart-nitrogen\` skill shows the code for each.
|
|
38
38
|
|
|
39
|
+
### Personalisation (Affinity)
|
|
40
|
+
|
|
41
|
+
Nitrogen 2.4.5 and later learn what each visitor leans to — categories,
|
|
42
|
+
brands, sizes, colours, prices — in the visitor's own browser, from the
|
|
43
|
+
storefront's analytics events, and show it: "Recommended for you", their "New",
|
|
44
|
+
categories, brands and filter values in their order, the product page and the
|
|
45
|
+
cards on their size or colour, the cart's suggestions, products on the empty
|
|
46
|
+
cart, an empty search and the missing page. When a storefront lacks it (no
|
|
47
|
+
\`useAffinityProducts\` under \`app/\`), propose it while you plan the pages, not
|
|
48
|
+
as an afterthought: what the visitor will see, where, and what it can bring the
|
|
49
|
+
merchant — larger orders (the cart's suggestions), more sales from the same
|
|
50
|
+
visits, empty pages that sell. Never promise a figure: no uplift has been
|
|
51
|
+
measured. On Nitrogen older than 2.4.5 it needs the move to \`^2.4.5\` first,
|
|
52
|
+
which removes no export.
|
|
53
|
+
|
|
54
|
+
The API sees none of it as a profile. A visitor's lists are ordinary \`products\`
|
|
55
|
+
queries with \`filters\` (\`category\`, \`productVendor\`, \`price\`, \`available\`),
|
|
56
|
+
one alias a list in one document, posted to the storefront's own route — never
|
|
57
|
+
the visitor's interests in a URL — and the pages stay cached for everyone. The
|
|
58
|
+
\`cloudcart-nitrogen-affinity\` skill has the steps.
|
|
59
|
+
|
|
39
60
|
## Authentication
|
|
40
61
|
|
|
41
62
|
The storefront's access token goes in \`X-Storefront-Access-Token\`. It names the
|
|
@@ -134,8 +155,20 @@ a list comes in the store's own order.
|
|
|
134
155
|
|
|
135
156
|
For "you may also like", \`product.relatedProducts\` pages through the merchant's
|
|
136
157
|
linked products, then the product's category; \`product.linkedProducts\` is the
|
|
137
|
-
linked ones alone. \`productRecommendations(productId | productHandle, intent
|
|
138
|
-
gives a short list
|
|
158
|
+
linked ones alone. \`productRecommendations(productId | productHandle, intent,
|
|
159
|
+
first)\` gives a short list (10 unless \`first\` says, at most 50):
|
|
160
|
+
|
|
161
|
+
- bound to a product, and leaving out its linked products: \`SIMILAR\` (nearest
|
|
162
|
+
by the meaning of its text), \`UPSELL\` (the same, priced above it),
|
|
163
|
+
\`ALTERNATIVE\` (in stock, near its price: for a sold-out product) and
|
|
164
|
+
\`ACCESSORY\` (from other categories: what goes with it);
|
|
165
|
+
- by a counter, within the product's categories or across the store:
|
|
166
|
+
\`BEST_SELLING\`, \`TRENDING\`, \`NEW_ARRIVALS\`, \`TOP_RATED\`;
|
|
167
|
+
- the merchant's own: \`RELATED\` and \`COMPLEMENTARY\`.
|
|
168
|
+
|
|
169
|
+
\`fallback: false\` makes a kind with nothing to go on answer an empty list, so a
|
|
170
|
+
block titled for it can hide. \`PERSONALIZED\`, \`CART\` and \`BOUGHT_TOGETHER\`
|
|
171
|
+
are deprecated: a visitor's own lists are \`products\` with filters (below).
|
|
139
172
|
|
|
140
173
|
## Collections
|
|
141
174
|
|
|
@@ -262,7 +295,23 @@ store's up-sell and cross-sell app they do nothing, and the line gets a warning.
|
|
|
262
295
|
|
|
263
296
|
Sign in with \`customerLoginCodeSend\`, then \`customerLoginCodeVerify\`, which
|
|
264
297
|
returns the access token. **There is deliberately no password login and no
|
|
265
|
-
password reset.**
|
|
298
|
+
password reset.** The store's confirmation and password links sign the customer
|
|
299
|
+
in by their code instead: \`customerSignInByLink(kind, code)\`, below.
|
|
300
|
+
|
|
301
|
+
**Sign-in with Google**, while \`shop.googleSignIn\` is not null (the store has
|
|
302
|
+
the Google Connect app and keeps accounts). Google's own prompt ("One Tap") or
|
|
303
|
+
button, opened with \`googleSignIn.clientId\` and a nonce the storefront made for
|
|
304
|
+
the visitor, hands the page an ID token: \`customerSignInWithGoogle(idToken,
|
|
305
|
+
nonce)\` signs in the customer the Google account is connected to in the store,
|
|
306
|
+
else the one with its e-mail (connected then). For an e-mail the store has no
|
|
307
|
+
customer for it creates nothing and answers \`registration\` — Google's e-mail,
|
|
308
|
+
names and a \`hash\` — and \`customerCreateWithGoogle(hash, input)\` registers
|
|
309
|
+
them by the store's rules (its policies too) and signs them in, with no code.
|
|
310
|
+
The ID token's \`picture\` and \`given_name\` are the account's picture and
|
|
311
|
+
first name. The client is CloudCart's: Google shows its prompt and button only
|
|
312
|
+
on a domain that client lists, so a storefront's domain is added by CloudCart's
|
|
313
|
+
support. Nitrogen has the pieces: \`getGoogleSignInSettings\`,
|
|
314
|
+
\`customerAccount.signInWithGoogle\`, \`<GoogleOneTap>\`, \`<GoogleSignInButton>\`.
|
|
266
315
|
|
|
267
316
|
\`customer(customerAccessToken)\` is the account area in one query: \`orders\`,
|
|
268
317
|
\`wishlist\`, \`downloads\`, \`payments\`, \`returns\`, \`addresses\`,
|
|
@@ -291,6 +340,59 @@ a sign-in**, by the reference from the notification email. Returns need the
|
|
|
291
340
|
merchant's returns app; without it they answer \`null\` or a \`NOT_AVAILABLE\`
|
|
292
341
|
error.
|
|
293
342
|
|
|
343
|
+
## The links the store sends
|
|
344
|
+
|
|
345
|
+
The store's e-mails, text messages and pushes link to its own domain, so a
|
|
346
|
+
Nitrogen storefront must have a page for each — a missing one leaves the
|
|
347
|
+
customer on its "not found" page. Each path and what serves it:
|
|
348
|
+
|
|
349
|
+
| Path | The API |
|
|
350
|
+
|---|---|
|
|
351
|
+
| \`/account/order/i/{hash}\`, \`/account/order/{hash}\` | \`orderByHash(hash, kind)\` — a guest's order, with \`invoice\` and \`proforma\` |
|
|
352
|
+
| \`/subscribers/subscriptions/{hash}\` | \`subscriberSubscriptions\`, \`subscriberSubscriptionsUpdate\` |
|
|
353
|
+
| \`/subscribers/verify/{hash}\` | \`subscriberEmailVerify\` |
|
|
354
|
+
| \`/subscribers/cart/{hash}\` | \`cartRestoreForSubscriber\` |
|
|
355
|
+
| \`/restore-abandoned/{code}/{source}/{discount?}\` | \`cartRestoreAbandoned\` |
|
|
356
|
+
| \`/cart/{key}\` | \`cartAddFromLink\` |
|
|
357
|
+
| \`/cart/discount:{code}\`, \`/discount/{code}\` | \`cartDiscountCodesUpdate\` |
|
|
358
|
+
| \`/cart/add/{variant}/{quantity?}\` | \`cartLinesAdd\` |
|
|
359
|
+
| \`/auth/confirm-email/{code}\`, \`/auth/reset-password/{code}\` | \`customerSignInByLink(kind, code)\` — signs in at once |
|
|
360
|
+
| \`/tracking/{waybill}\` | \`parcelTracking(waybill)\` |
|
|
361
|
+
| \`/product_preview/create/s/{hash}\` | \`productReviewInvitation\`, \`productReviewCreateFromInvitation\` |
|
|
362
|
+
| \`/account/subscriptions/{reference}\` | \`customer\`'s subscriptions, \`customerSubscription*\` |
|
|
363
|
+
| \`/download/product/…\` | \`productFileLink\` — signed URLs that expire |
|
|
364
|
+
| \`/withdrawal/{reference}\` | \`returnByReference\` |
|
|
365
|
+
| \`/gift-card/{hash}\`, \`/gift-card/pdf/{hash}\` | \`giftCardByHash(hash)\` — the card, its QR and its PDF's signed URLs |
|
|
366
|
+
| \`/gift-card/r/{hash}\`, \`/gift-card\` | \`giftCardRedeem(customerAccessToken, hash \\| code)\` — into the wallet; a guest signs in first |
|
|
367
|
+
| \`/account/gift-cards\`, \`/account/wallet\` | \`customer\`'s \`giftCards\` and \`wallet\` (\`activity(transactionId)\` for \`?filters[id]=\`), \`customerGiftCardResend\` |
|
|
368
|
+
| \`/account/pages\`, \`/private-page/{handle}\` | \`customer\`'s \`memberPages\` and \`privatePage(handle)\` — the Membership app's paid pages; without access the store's message, status 402 |
|
|
369
|
+
| \`/account/subscriptions\` | \`customer\`'s \`subscriptions\`; the product page offers \`sellingPlanGroups\` and adds with \`sellingPlanId\` |
|
|
370
|
+
| \`/bundles\`, \`/bundles/category/{slug}\` | \`products\`, \`collection.products\` with \`ProductFilter.isBundle\` |
|
|
371
|
+
| \`/contacts/{product}\`, \`/about/{product?}\` | \`contactFormSubmit\` — a question about a product; \`/about\` redirects to the contact page |
|
|
372
|
+
| \`/login\`, \`/register\`, \`/forgotten-password\`, \`/auth/forgotten\`, \`/confirm-email?code=\`, \`/account/withdrawals\` | none — the classic storefront's older addresses, redirected to the sign-in page, the registration, \`/auth/confirm-email/{code}\` and the account's returns |
|
|
373
|
+
|
|
374
|
+
**The account's newer parts.** Buy again: the order's page (signed in, or by
|
|
375
|
+
the e-mail's hash) offers it while \`Order.reorderable\`, and \`cartAddFromOrder\`
|
|
376
|
+
puts the order's products into the buyer's cart by the cart's own rules (a
|
|
377
|
+
wallet or gift card order refused). The wallet's top-up: \`customer.wallet.topUp\`
|
|
378
|
+
while the store sells it, and \`customerWalletTopUp\` answers a \`checkoutUrl\` —
|
|
379
|
+
a key, sent to at once and never logged. The e-mail confirmation: an
|
|
380
|
+
unconfirmed customer (\`Customer.emailConfirmed\`) asks the link again with
|
|
381
|
+
\`customerEmailConfirmationSend\`, shown while
|
|
382
|
+
\`checkoutSettings.registration.unconfirmedAccountsRestricted\`.
|
|
383
|
+
|
|
384
|
+
**A campaign's link.** The store's campaign messages (e-mail, text, Viber, web
|
|
385
|
+
push) add \`cc_campaign\` and \`cc_subscriber\` to their links on the store's
|
|
386
|
+
domain. Send both, as they came, to \`campaignLinkOpen(campaign, subscriber)\`
|
|
387
|
+
— it counts the click — take them out of the address, and keep \`cc_campaign\`
|
|
388
|
+
for seven days as the cart's \`CartAttributionInput.campaignLink\`, so the order
|
|
389
|
+
counts for the campaign. Nitrogen's \`Analytics.Provider\` does all three.
|
|
390
|
+
|
|
391
|
+
A hash, code or key in the path is the customer's key: the page is private,
|
|
392
|
+
never cached, and a link that matches nothing answers \`null\` or an error
|
|
393
|
+
without saying why. The checkout's own links (\`/checkout/…\`) are the
|
|
394
|
+
platform's. The \`cloudcart-nitrogen\` skill has each page's route.
|
|
395
|
+
|
|
294
396
|
---
|
|
295
397
|
|
|
296
398
|
# Content and shop
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefront.js","sourceRoot":"","sources":["../../src/prompts/storefront.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"storefront.js","sourceRoot":"","sources":["../../src/prompts/storefront.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0d/B,CAAC,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED