@waffo/pancake-ts 0.1.5 → 0.1.9
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 +38 -6
- package/README.md +203 -336
- package/dist/index.cjs +166 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +333 -68
- package/dist/index.d.ts +333 -68
- package/dist/index.js +166 -55
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +786 -0
- package/docs/graphql-guide.md +664 -0
- package/docs/webhook-guide.md +456 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,14 +4,46 @@ All notable changes to `@waffo/pancake-ts` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.1.9] - 2026-04-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Checkout convenience methods** — `client.checkout.authenticated.create()` and `client.checkout.anonymous.create()` wrap the full checkout flow into a single call. Authenticated mode issues a session token, creates a checkout session, and returns a URL with the token appended as a URL fragment. Anonymous mode creates a session directly.
|
|
12
|
+
- **Types** — `AuthenticatedCheckoutParams`, `AuthenticatedCheckoutResult`, `AnonymousCheckoutParams`
|
|
13
|
+
- **Resources** — `CheckoutAnonymousResource`, `CheckoutAuthenticatedResource` (accessed via `client.checkout.anonymous` / `client.checkout.authenticated`)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Base URL** — Default API endpoint changed from `waffo-pancake-auth-service.vercel.app` to `api.waffo.ai`
|
|
18
|
+
- **Package** — `docs/` directory now included in npm package (`files` field)
|
|
19
|
+
- **Docs** — `docs/api-reference.md` synced with endpoint docs: fixed `storeId` required status, added `BillingDetail` conditional field rules, fixed price amount format (display string, not integer), added subscription product group UUID note
|
|
20
|
+
- **Docs** — `docs/graphql-guide.md` rewritten: corrected query names (`onetimeOrders` / `subscriptionOrders`), added product version queries, exchange rate query, webhook/email delivery log queries, 9 analytics queries (`orderStatistics`, `paymentStatistics`, `productStatistics`, `trendAnalysis`, `distributionAnalysis`, `customerAnalysis`, `taxAnalysis`, `subscriptionAnalysis`, `refundTicketAnalysis`), updated count query list and filter examples
|
|
21
|
+
- **Docs** — `docs/webhook-guide.md` fixed `amount` / `taxAmount` type from `number` to `string` (display format), added retry mechanism section with delivery status table
|
|
22
|
+
- **README** — Reorganized by use-case priority (checkout → webhooks → GraphQL → programmatic management), added checkout mode comparison and recommendation rationale
|
|
23
|
+
|
|
24
|
+
## [0.1.8] - 2026-03-20
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **Types** — `UpdateStoreParams` adds optional `supportEmail` and `website` fields (`string | null`) with JSDoc
|
|
29
|
+
- **Types** — `ErrorLayer` enum adds `Ticket = "ticket"` value
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **Resources** — All resource method calls now use explicit generic type parameters (`http.post<T>()`) for improved type safety
|
|
34
|
+
- **README** — Corrected Node requirement to "Node >= 20" and build output to "ESM + CJS"
|
|
35
|
+
|
|
7
36
|
## [0.1.7] - 2026-03-20
|
|
8
37
|
|
|
9
38
|
### Added
|
|
10
39
|
|
|
11
|
-
- **Custom webhook public key** — `WaffoPancakeConfig` accepts
|
|
12
|
-
-
|
|
13
|
-
- **`
|
|
14
|
-
-
|
|
40
|
+
- **Custom webhook public key** — `WaffoPancakeConfig.webhookPublicKey` accepts `string` (shared) or `{ test?, prod? }` (per-environment) to override built-in keys.
|
|
41
|
+
- **Multi-level key resolution** — Webhook public key is resolved per environment: `options.publicKey` (per-call) → config key → `WAFFO_WEBHOOK_{TEST|PROD}_PUBLIC_KEY` env var → `WAFFO_WEBHOOK_PUBLIC_KEY` env var → built-in hardcoded key.
|
|
42
|
+
- **`client.webhooks.verify()`** — New resource namespace on the client instance. Injects config-level keys into the resolution chain automatically; supports per-call override via `options.publicKey`.
|
|
43
|
+
- **`VerifyWebhookOptions.publicKey`** — Per-call override for the standalone `verifyWebhook()` function (highest priority, skips all resolution).
|
|
44
|
+
- **`VerifyWebhookOptions.publicKeys`** — Config-level key(s) for the resolution chain (typically injected by `client.webhooks.verify()`).
|
|
45
|
+
- **`WebhookPublicKeys` type** — `string | { test?: string; prod?: string }`, exported from the package.
|
|
46
|
+
- **Public key normalization** — `normalizePublicKey()` handles the same flexible input formats as `normalizePrivateKey`: literal `\n` from environment variables, Windows `\r\n` line endings, raw base64 without PEM headers, single-line base64, and PKCS#1 (`BEGIN RSA PUBLIC KEY`) format. Applied automatically at every level of the resolution chain.
|
|
15
47
|
|
|
16
48
|
## [0.1.6] - 2026-03-18
|
|
17
49
|
|
|
@@ -26,7 +58,7 @@ Remove `taxIncluded` from all `PriceInfo` / `Prices` objects:
|
|
|
26
58
|
|
|
27
59
|
```diff
|
|
28
60
|
const { product } = await client.onetimeProducts.create({
|
|
29
|
-
storeId: "
|
|
61
|
+
storeId: "STO_xxx",
|
|
30
62
|
name: "My Product",
|
|
31
63
|
prices: {
|
|
32
64
|
- USD: { amount: 2900, taxIncluded: false, taxCategory: "digital_goods" },
|
|
@@ -39,7 +71,7 @@ Remove `isPublic` from `stores.update()` calls:
|
|
|
39
71
|
|
|
40
72
|
```diff
|
|
41
73
|
const { store } = await client.stores.update({
|
|
42
|
-
id: "
|
|
74
|
+
id: "STO_xxx",
|
|
43
75
|
- isPublic: true,
|
|
44
76
|
name: "Updated Name",
|
|
45
77
|
});
|