@doswiftly/storefront-operations 21.0.1 → 22.0.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/AGENTS.md +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/fragments.graphql +1 -2
- package/llms-full.txt +2 -3
- package/operations.json +3 -3
- package/package.json +1 -1
- package/schema.graphql +5 -3
package/AGENTS.md
CHANGED
|
@@ -27,7 +27,7 @@ consumer's `codegen.ts` references this package's `.graphql` files as
|
|
|
27
27
|
live in the consumer's repo.
|
|
28
28
|
|
|
29
29
|
<!-- AUTOGEN:STATS:BEGIN — auto-regenerated, do not edit by hand -->
|
|
30
|
-
- **Schema version**:
|
|
30
|
+
- **Schema version**: 22.0.0
|
|
31
31
|
- **Queries**: 52
|
|
32
32
|
- **Mutations**: 44
|
|
33
33
|
- **Fragments**: 105
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 22.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 49139e2: Remove the `pendingPoints` field from `LoyaltyPointsSummary` (GraphQL schema, the `LoyaltyPointsSummary` fragment and the generated types). The field was never populated — it always returned `0` — because purchase points are credited directly when the payment is captured, so there is no "pending" state to report.
|
|
8
|
+
|
|
9
|
+
**Migration:** if your storefront reads `points.pendingPoints` (or selects `pendingPoints` in a custom query or fragment), remove that usage and re-run your codegen. No replacement field is needed — `currentPoints` has always been the spendable balance.
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 49139e2: Referral program signup support — the loyalty referral program now works end-to-end:
|
|
14
|
+
- `customerSignup` accepts an optional `referralCode` in its input. When the shop's referral program is active, a valid code grants the configured bonus points to the new customer and, after their first paid order, rewards the referrer. An invalid, expired or own code is silently ignored — the signup always succeeds.
|
|
15
|
+
- New referral capture helpers in the SDK: `useReferralCapture()` / `captureReferralCode()` persist the `?ref=CODE` parameter from a referral landing link into the readable `referral-code` cookie (30 days by default), and `readReferralCodeCookie()` / `clearReferralCodeCookie()` read and clear it at signup time. A server-side `readReferralCodeCookie()` is available from `@doswiftly/storefront-sdk/react/server` for SSR-rendered signup forms. Core constants and the URL extractor (`REFERRAL_COOKIE_NAME`, `REFERRAL_COOKIE_MAX_AGE`, `extractReferralCodeFromUrl`) are exported from the framework-agnostic core entry.
|
|
16
|
+
|
|
17
|
+
The cookie lifetime is the _landing → signup_ window and is intentionally independent of the shop's referral validity setting, which starts at signup and is enforced by the API.
|
|
18
|
+
|
|
3
19
|
## 21.0.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -573,7 +573,7 @@ full executable body of each operation.
|
|
|
573
573
|
| --- | --- | --- |
|
|
574
574
|
| `LoyaltyPageInfo` | `LoyaltyPageInfo` | Page metadata for the loyalty transactions connection (separate type from generic `PageInfo` for legacy reasons; identical shape). |
|
|
575
575
|
| `LoyaltyTier` | `LoyaltyTier` | Loyalty tier definition — name, type enum (`BRONZE` / `SILVER` / `GOLD` / `PLATINUM` / `DIAMOND`), entry threshold (`minPoints` and/or `minAnnualSpend`), points multiplier, custom benefits list. Returned by `loyaltyTiers` and embedded in member tier data. |
|
|
576
|
-
| `LoyaltyPointsSummary` | `LoyaltyPointsSummary` | Customer's points breakdown — total earned, currently spendable,
|
|
576
|
+
| `LoyaltyPointsSummary` | `LoyaltyPointsSummary` | Customer's points breakdown — total earned, currently spendable, redeemed lifetime, expired lifetime, expiring soon, and the next expiry date. Spread inside `LoyaltyMember`. |
|
|
577
577
|
| `TierProgress` | `TierProgress` | Customer's progress toward the next tier — current tier, next tier, points + spend remaining, percent progress. Use to render the "X points to GOLD" tracker. |
|
|
578
578
|
| `LoyaltyMember` | `LoyaltyMember` | Customer's loyalty membership — points summary, current tier, tier progress, annual spend, last activity. Returned by `loyaltyMember` (null if not enrolled). |
|
|
579
579
|
| `LoyaltyTransaction` | `LoyaltyTransaction` | One row in the loyalty points history — type (`EARN_PURCHASE` / `EARN_SIGNUP` / `EARN_REFERRAL` / `EARN_REVIEW` / `EARN_BIRTHDAY` / `EARN_BONUS` / `REDEEM` / `EXPIRE` / `ADJUST` / `REFUND_REVERSAL`), points delta, balance after, source order, expiry. Spread on the loyalty dashboard transaction list. |
|
package/fragments.graphql
CHANGED
|
@@ -1173,11 +1173,10 @@ fragment LoyaltyTier on LoyaltyTier {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
-
# Customer's points breakdown — total earned, currently spendable,
|
|
1176
|
+
# Customer's points breakdown — total earned, currently spendable, redeemed lifetime, expired lifetime, expiring soon, and the next expiry date. Spread inside `LoyaltyMember`.
|
|
1177
1177
|
fragment LoyaltyPointsSummary on LoyaltyPointsSummary {
|
|
1178
1178
|
totalPoints
|
|
1179
1179
|
currentPoints
|
|
1180
|
-
pendingPoints
|
|
1181
1180
|
redeemedPoints
|
|
1182
1181
|
expiredPoints
|
|
1183
1182
|
expiringPoints
|
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DoSwiftly Storefront Operations — Full Reference
|
|
2
2
|
|
|
3
|
-
> Schema version: **
|
|
3
|
+
> Schema version: **22.0.0**
|
|
4
4
|
> 52 queries · 44 mutations · 105 fragments
|
|
5
5
|
|
|
6
6
|
Auto-generated from `.graphql` source files. Do not edit by hand — this file is
|
|
@@ -4311,14 +4311,13 @@ fragment LoyaltyTier on LoyaltyTier {
|
|
|
4311
4311
|
|
|
4312
4312
|
**Section**: Loyalty Program
|
|
4313
4313
|
|
|
4314
|
-
**Description**: Customer's points breakdown — total earned, currently spendable,
|
|
4314
|
+
**Description**: Customer's points breakdown — total earned, currently spendable, redeemed lifetime, expired lifetime, expiring soon, and the next expiry date. Spread inside `LoyaltyMember`.
|
|
4315
4315
|
|
|
4316
4316
|
**GraphQL**:
|
|
4317
4317
|
```graphql
|
|
4318
4318
|
fragment LoyaltyPointsSummary on LoyaltyPointsSummary {
|
|
4319
4319
|
totalPoints
|
|
4320
4320
|
currentPoints
|
|
4321
|
-
pendingPoints
|
|
4322
4321
|
redeemedPoints
|
|
4323
4322
|
expiredPoints
|
|
4324
4323
|
expiringPoints
|
package/operations.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "
|
|
2
|
+
"schemaVersion": "22.0.0",
|
|
3
3
|
"queries": [
|
|
4
4
|
{
|
|
5
5
|
"name": "Shop",
|
|
@@ -2777,10 +2777,10 @@
|
|
|
2777
2777
|
"name": "LoyaltyPointsSummary",
|
|
2778
2778
|
"kind": "fragment",
|
|
2779
2779
|
"section": "Loyalty Program",
|
|
2780
|
-
"description": "Customer's points breakdown — total earned, currently spendable,
|
|
2780
|
+
"description": "Customer's points breakdown — total earned, currently spendable, redeemed lifetime, expired lifetime, expiring soon, and the next expiry date. Spread inside `LoyaltyMember`.",
|
|
2781
2781
|
"variables": [],
|
|
2782
2782
|
"fragmentRefs": [],
|
|
2783
|
-
"body": "fragment LoyaltyPointsSummary on LoyaltyPointsSummary {\n totalPoints\n currentPoints\n
|
|
2783
|
+
"body": "fragment LoyaltyPointsSummary on LoyaltyPointsSummary {\n totalPoints\n currentPoints\n redeemedPoints\n expiredPoints\n expiringPoints\n nextExpiryDate\n}",
|
|
2784
2784
|
"onType": "LoyaltyPointsSummary"
|
|
2785
2785
|
},
|
|
2786
2786
|
{
|
package/package.json
CHANGED
package/schema.graphql
CHANGED
|
@@ -2799,6 +2799,11 @@ input CustomerCreateInput {
|
|
|
2799
2799
|
|
|
2800
2800
|
"""Phone number (free-form)."""
|
|
2801
2801
|
phone: String
|
|
2802
|
+
|
|
2803
|
+
"""
|
|
2804
|
+
Referral code of an existing customer, usually taken from a referral link's `ref` URL parameter (codes are case-insensitive). Optional — an invalid, malformed, expired or own code is silently ignored and the signup still succeeds; only a value longer than 50 characters is rejected. When the shop's referral program is active, a valid code grants the configured bonus points to the new customer and, after their first paid order, rewards the referrer.
|
|
2805
|
+
"""
|
|
2806
|
+
referralCode: String
|
|
2802
2807
|
}
|
|
2803
2808
|
|
|
2804
2809
|
"""Customer group for B2B pricing"""
|
|
@@ -3771,9 +3776,6 @@ type LoyaltyPointsSummary {
|
|
|
3771
3776
|
"""Next expiry date (ISO 8601)"""
|
|
3772
3777
|
nextExpiryDate: DateTime
|
|
3773
3778
|
|
|
3774
|
-
"""Points pending (from incomplete orders)"""
|
|
3775
|
-
pendingPoints: Int!
|
|
3776
|
-
|
|
3777
3779
|
"""Points redeemed"""
|
|
3778
3780
|
redeemedPoints: Int!
|
|
3779
3781
|
|