@waffo/pancake-ts 0.3.0 → 0.3.1
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 +10 -4
- package/dist/index.cjs +23 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -9
- package/dist/index.d.ts +23 -9
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +33 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ 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.3.1] - 2026-04-09
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Product update simplified** — `update()` only modifies provided fields; omitted fields are preserved. `name`, `prices`, and `billingPeriod` (subscription) are now optional.
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
- **GraphQL type difference warning** — Added warnings in `graphql-guide.md`, `api-reference.md`, and external docs (EN/ZH/JA) clarifying that SDK TypeScript types reflect the REST API shape and differ from GraphQL schema types. Users should always use introspection for GraphQL queries.
|
|
16
|
+
|
|
7
17
|
## [0.3.0] - 2026-04-09
|
|
8
18
|
|
|
9
19
|
### Breaking Changes
|
|
@@ -20,10 +30,6 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), version
|
|
|
20
30
|
|
|
21
31
|
- **`checkout.authenticated.create()`** — Now sends `productId` (instead of `storeId`) to `issue-session-token` endpoint for parallel session token + checkout session creation.
|
|
22
32
|
|
|
23
|
-
### Documentation
|
|
24
|
-
|
|
25
|
-
- **GraphQL type difference warning** — Added warnings in `graphql-guide.md`, `api-reference.md`, and external docs (EN/ZH/JA) clarifying that SDK TypeScript types reflect the REST API shape and differ from GraphQL schema types (e.g. `prices` is `Record<string, PriceInfo>` in REST but `[CurrencyPrice!]!` in GraphQL). Users should always use introspection for GraphQL queries.
|
|
26
|
-
|
|
27
33
|
## [0.2.2] - 2026-04-03
|
|
28
34
|
|
|
29
35
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -693,20 +693,27 @@ var OnetimeProductsResource = class {
|
|
|
693
693
|
/**
|
|
694
694
|
* Update a one-time product. Creates a new version; skips if unchanged.
|
|
695
695
|
*
|
|
696
|
-
* @param params - Product update parameters (
|
|
696
|
+
* @param params - Product update parameters (only `id` is required)
|
|
697
697
|
* @returns Updated product detail
|
|
698
698
|
*
|
|
699
699
|
* @example
|
|
700
|
+
* // Update only the name
|
|
700
701
|
* const { product } = await client.onetimeProducts.update({
|
|
701
702
|
* id: "PROD_xxx",
|
|
702
703
|
* name: "E-Book v2",
|
|
704
|
+
* });
|
|
705
|
+
*
|
|
706
|
+
* @example
|
|
707
|
+
* // Update prices while preserving other fields
|
|
708
|
+
* const { product } = await client.onetimeProducts.update({
|
|
709
|
+
* id: "PROD_xxx",
|
|
703
710
|
* prices: { USD: { amount: "39.00", taxCategory: "digital_goods" } },
|
|
704
711
|
* });
|
|
705
712
|
*/
|
|
706
713
|
async update(params) {
|
|
707
714
|
validateShortId("id", params.id, "PROD");
|
|
708
|
-
validateRequired("name", params.name);
|
|
709
|
-
validatePrices("prices", params.prices);
|
|
715
|
+
if (params.name !== void 0) validateRequired("name", params.name);
|
|
716
|
+
if (params.prices) validatePrices("prices", params.prices);
|
|
710
717
|
return this.http.post("/v1/actions/onetime-product/update-product", params);
|
|
711
718
|
}
|
|
712
719
|
/**
|
|
@@ -975,22 +982,29 @@ var SubscriptionProductsResource = class {
|
|
|
975
982
|
/**
|
|
976
983
|
* Update a subscription product. Creates a new version; skips if unchanged.
|
|
977
984
|
*
|
|
978
|
-
* @param params - Product update parameters (
|
|
985
|
+
* @param params - Product update parameters (only `id` is required)
|
|
979
986
|
* @returns Updated product detail
|
|
980
987
|
*
|
|
981
988
|
* @example
|
|
989
|
+
* // Update only the name
|
|
982
990
|
* const { product } = await client.subscriptionProducts.update({
|
|
983
991
|
* id: "PROD_xxx",
|
|
984
992
|
* name: "Pro Plan v2",
|
|
985
|
-
*
|
|
986
|
-
*
|
|
993
|
+
* });
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* // Update prices and billing period
|
|
997
|
+
* const { product } = await client.subscriptionProducts.update({
|
|
998
|
+
* id: "PROD_xxx",
|
|
999
|
+
* billingPeriod: "yearly",
|
|
1000
|
+
* prices: { USD: { amount: "99.00", taxCategory: "saas" } },
|
|
987
1001
|
* });
|
|
988
1002
|
*/
|
|
989
1003
|
async update(params) {
|
|
990
1004
|
validateShortId("id", params.id, "PROD");
|
|
991
|
-
validateRequired("name", params.name);
|
|
992
|
-
validateEnum("billingPeriod", params.billingPeriod, ["weekly", "monthly", "quarterly", "yearly"]);
|
|
993
|
-
validatePrices("prices", params.prices);
|
|
1005
|
+
if (params.name !== void 0) validateRequired("name", params.name);
|
|
1006
|
+
if (params.billingPeriod !== void 0) validateEnum("billingPeriod", params.billingPeriod, ["weekly", "monthly", "quarterly", "yearly"]);
|
|
1007
|
+
if (params.prices) validatePrices("prices", params.prices);
|
|
994
1008
|
return this.http.post("/v1/actions/subscription-product/update-product", params);
|
|
995
1009
|
}
|
|
996
1010
|
/**
|