fresh-squeezy 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/README.md +8 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ The official [`@lemonsqueezy/lemonsqueezy.js`](https://github.com/lmsqueezy/lemo
25
25
 
26
26
  Most teams already use the official SDK or plain `fetch` for API calls. They don't need another wrapper — they need **fewer silent misconfigurations**. `fresh-squeezy` is intentionally thin:
27
27
 
28
- - 4 validators (`connection`, `store`, `product`, `webhook`) that return the same `ValidationResult` shape every time
28
+ - 7 validators (`connection`, `store`, `product`, `webhook`, `discount`, `licenseKey`, `subscriptionPlan`) that return the same `ValidationResult` shape every time
29
29
  - `doctor()` composes them into one report
30
30
  - A raw `request()` escape hatch so you never hit a wall when the platform adds something we haven't wrapped yet
31
31
  - Static, reviewed support manifest — no live scraping in runtime code
@@ -47,6 +47,9 @@ This project is MIT-licensed and deliberately scoped to stay small. The goal is
47
47
  | `store` | Wrong store ID, store owned by a different account |
48
48
  | `product` | Unpublished product, product on the wrong store, missing or all-draft variants, missing buy URL |
49
49
  | `webhook` | Webhook URL not registered, missing recommended events (order lifecycle, subscription lifecycle, refunds), missing optional newer events |
50
+ | `discount` | Draft discounts, expired or not-yet-active windows, invalid amounts (≤0 or >100%), store ownership mismatch |
51
+ | `licenseKey` | Disabled keys, expired keys, keys at activation limit, store ownership mismatch |
52
+ | `subscriptionPlan` | Non-subscription variants, invalid billing intervals, zero-price plans, inconsistent trial settings, draft variants, store ownership mismatch |
50
53
 
51
54
  Every validator returns the same `ValidationResult` — stable public contract, switchable by `issue.code`.
52
55
 
@@ -178,7 +181,10 @@ client.validateConnection()
178
181
  client.validateStore(id)
179
182
  client.validateProduct({ productId, expectedStoreId? })
180
183
  client.validateWebhook({ storeId, url })
181
- client.doctor({ storeId?, productId?, webhookUrl? })
184
+ client.validateDiscount({ storeId, discountId })
185
+ client.validateLicenseKey({ storeId, licenseKeyId })
186
+ client.validateSubscriptionPlan({ storeId, variantId })
187
+ client.doctor({ storeId?, productId?, webhookUrl?, discountId?, licenseKeyId?, variantId? })
182
188
  ```
183
189
 
184
190
  ### `ValidationResult<T>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fresh-squeezy",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Validator-first Lemon Squeezy setup toolkit. Verify your integration before it hits production.",
5
5
  "keywords": [
6
6
  "lemon-squeezy",