@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/dist/index.d.cts
CHANGED
|
@@ -452,8 +452,8 @@ interface CreateOnetimeProductParams {
|
|
|
452
452
|
*/
|
|
453
453
|
interface UpdateOnetimeProductParams {
|
|
454
454
|
id: string;
|
|
455
|
-
name
|
|
456
|
-
prices
|
|
455
|
+
name?: string;
|
|
456
|
+
prices?: Prices;
|
|
457
457
|
description?: string;
|
|
458
458
|
media?: MediaItem[];
|
|
459
459
|
successUrl?: string;
|
|
@@ -510,9 +510,9 @@ interface CreateSubscriptionProductParams {
|
|
|
510
510
|
*/
|
|
511
511
|
interface UpdateSubscriptionProductParams {
|
|
512
512
|
id: string;
|
|
513
|
-
name
|
|
514
|
-
billingPeriod
|
|
515
|
-
prices
|
|
513
|
+
name?: string;
|
|
514
|
+
billingPeriod?: BillingPeriod;
|
|
515
|
+
prices?: Prices;
|
|
516
516
|
description?: string;
|
|
517
517
|
media?: MediaItem[];
|
|
518
518
|
successUrl?: string;
|
|
@@ -1312,13 +1312,20 @@ declare class OnetimeProductsResource {
|
|
|
1312
1312
|
/**
|
|
1313
1313
|
* Update a one-time product. Creates a new version; skips if unchanged.
|
|
1314
1314
|
*
|
|
1315
|
-
* @param params - Product update parameters (
|
|
1315
|
+
* @param params - Product update parameters (only `id` is required)
|
|
1316
1316
|
* @returns Updated product detail
|
|
1317
1317
|
*
|
|
1318
1318
|
* @example
|
|
1319
|
+
* // Update only the name
|
|
1319
1320
|
* const { product } = await client.onetimeProducts.update({
|
|
1320
1321
|
* id: "PROD_xxx",
|
|
1321
1322
|
* name: "E-Book v2",
|
|
1323
|
+
* });
|
|
1324
|
+
*
|
|
1325
|
+
* @example
|
|
1326
|
+
* // Update prices while preserving other fields
|
|
1327
|
+
* const { product } = await client.onetimeProducts.update({
|
|
1328
|
+
* id: "PROD_xxx",
|
|
1322
1329
|
* prices: { USD: { amount: "39.00", taxCategory: "digital_goods" } },
|
|
1323
1330
|
* });
|
|
1324
1331
|
*/
|
|
@@ -1554,15 +1561,22 @@ declare class SubscriptionProductsResource {
|
|
|
1554
1561
|
/**
|
|
1555
1562
|
* Update a subscription product. Creates a new version; skips if unchanged.
|
|
1556
1563
|
*
|
|
1557
|
-
* @param params - Product update parameters (
|
|
1564
|
+
* @param params - Product update parameters (only `id` is required)
|
|
1558
1565
|
* @returns Updated product detail
|
|
1559
1566
|
*
|
|
1560
1567
|
* @example
|
|
1568
|
+
* // Update only the name
|
|
1561
1569
|
* const { product } = await client.subscriptionProducts.update({
|
|
1562
1570
|
* id: "PROD_xxx",
|
|
1563
1571
|
* name: "Pro Plan v2",
|
|
1564
|
-
*
|
|
1565
|
-
*
|
|
1572
|
+
* });
|
|
1573
|
+
*
|
|
1574
|
+
* @example
|
|
1575
|
+
* // Update prices and billing period
|
|
1576
|
+
* const { product } = await client.subscriptionProducts.update({
|
|
1577
|
+
* id: "PROD_xxx",
|
|
1578
|
+
* billingPeriod: "yearly",
|
|
1579
|
+
* prices: { USD: { amount: "99.00", taxCategory: "saas" } },
|
|
1566
1580
|
* });
|
|
1567
1581
|
*/
|
|
1568
1582
|
update(params: UpdateSubscriptionProductParams): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -452,8 +452,8 @@ interface CreateOnetimeProductParams {
|
|
|
452
452
|
*/
|
|
453
453
|
interface UpdateOnetimeProductParams {
|
|
454
454
|
id: string;
|
|
455
|
-
name
|
|
456
|
-
prices
|
|
455
|
+
name?: string;
|
|
456
|
+
prices?: Prices;
|
|
457
457
|
description?: string;
|
|
458
458
|
media?: MediaItem[];
|
|
459
459
|
successUrl?: string;
|
|
@@ -510,9 +510,9 @@ interface CreateSubscriptionProductParams {
|
|
|
510
510
|
*/
|
|
511
511
|
interface UpdateSubscriptionProductParams {
|
|
512
512
|
id: string;
|
|
513
|
-
name
|
|
514
|
-
billingPeriod
|
|
515
|
-
prices
|
|
513
|
+
name?: string;
|
|
514
|
+
billingPeriod?: BillingPeriod;
|
|
515
|
+
prices?: Prices;
|
|
516
516
|
description?: string;
|
|
517
517
|
media?: MediaItem[];
|
|
518
518
|
successUrl?: string;
|
|
@@ -1312,13 +1312,20 @@ declare class OnetimeProductsResource {
|
|
|
1312
1312
|
/**
|
|
1313
1313
|
* Update a one-time product. Creates a new version; skips if unchanged.
|
|
1314
1314
|
*
|
|
1315
|
-
* @param params - Product update parameters (
|
|
1315
|
+
* @param params - Product update parameters (only `id` is required)
|
|
1316
1316
|
* @returns Updated product detail
|
|
1317
1317
|
*
|
|
1318
1318
|
* @example
|
|
1319
|
+
* // Update only the name
|
|
1319
1320
|
* const { product } = await client.onetimeProducts.update({
|
|
1320
1321
|
* id: "PROD_xxx",
|
|
1321
1322
|
* name: "E-Book v2",
|
|
1323
|
+
* });
|
|
1324
|
+
*
|
|
1325
|
+
* @example
|
|
1326
|
+
* // Update prices while preserving other fields
|
|
1327
|
+
* const { product } = await client.onetimeProducts.update({
|
|
1328
|
+
* id: "PROD_xxx",
|
|
1322
1329
|
* prices: { USD: { amount: "39.00", taxCategory: "digital_goods" } },
|
|
1323
1330
|
* });
|
|
1324
1331
|
*/
|
|
@@ -1554,15 +1561,22 @@ declare class SubscriptionProductsResource {
|
|
|
1554
1561
|
/**
|
|
1555
1562
|
* Update a subscription product. Creates a new version; skips if unchanged.
|
|
1556
1563
|
*
|
|
1557
|
-
* @param params - Product update parameters (
|
|
1564
|
+
* @param params - Product update parameters (only `id` is required)
|
|
1558
1565
|
* @returns Updated product detail
|
|
1559
1566
|
*
|
|
1560
1567
|
* @example
|
|
1568
|
+
* // Update only the name
|
|
1561
1569
|
* const { product } = await client.subscriptionProducts.update({
|
|
1562
1570
|
* id: "PROD_xxx",
|
|
1563
1571
|
* name: "Pro Plan v2",
|
|
1564
|
-
*
|
|
1565
|
-
*
|
|
1572
|
+
* });
|
|
1573
|
+
*
|
|
1574
|
+
* @example
|
|
1575
|
+
* // Update prices and billing period
|
|
1576
|
+
* const { product } = await client.subscriptionProducts.update({
|
|
1577
|
+
* id: "PROD_xxx",
|
|
1578
|
+
* billingPeriod: "yearly",
|
|
1579
|
+
* prices: { USD: { amount: "99.00", taxCategory: "saas" } },
|
|
1566
1580
|
* });
|
|
1567
1581
|
*/
|
|
1568
1582
|
update(params: UpdateSubscriptionProductParams): Promise<{
|
package/dist/index.js
CHANGED
|
@@ -651,20 +651,27 @@ var OnetimeProductsResource = class {
|
|
|
651
651
|
/**
|
|
652
652
|
* Update a one-time product. Creates a new version; skips if unchanged.
|
|
653
653
|
*
|
|
654
|
-
* @param params - Product update parameters (
|
|
654
|
+
* @param params - Product update parameters (only `id` is required)
|
|
655
655
|
* @returns Updated product detail
|
|
656
656
|
*
|
|
657
657
|
* @example
|
|
658
|
+
* // Update only the name
|
|
658
659
|
* const { product } = await client.onetimeProducts.update({
|
|
659
660
|
* id: "PROD_xxx",
|
|
660
661
|
* name: "E-Book v2",
|
|
662
|
+
* });
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* // Update prices while preserving other fields
|
|
666
|
+
* const { product } = await client.onetimeProducts.update({
|
|
667
|
+
* id: "PROD_xxx",
|
|
661
668
|
* prices: { USD: { amount: "39.00", taxCategory: "digital_goods" } },
|
|
662
669
|
* });
|
|
663
670
|
*/
|
|
664
671
|
async update(params) {
|
|
665
672
|
validateShortId("id", params.id, "PROD");
|
|
666
|
-
validateRequired("name", params.name);
|
|
667
|
-
validatePrices("prices", params.prices);
|
|
673
|
+
if (params.name !== void 0) validateRequired("name", params.name);
|
|
674
|
+
if (params.prices) validatePrices("prices", params.prices);
|
|
668
675
|
return this.http.post("/v1/actions/onetime-product/update-product", params);
|
|
669
676
|
}
|
|
670
677
|
/**
|
|
@@ -933,22 +940,29 @@ var SubscriptionProductsResource = class {
|
|
|
933
940
|
/**
|
|
934
941
|
* Update a subscription product. Creates a new version; skips if unchanged.
|
|
935
942
|
*
|
|
936
|
-
* @param params - Product update parameters (
|
|
943
|
+
* @param params - Product update parameters (only `id` is required)
|
|
937
944
|
* @returns Updated product detail
|
|
938
945
|
*
|
|
939
946
|
* @example
|
|
947
|
+
* // Update only the name
|
|
940
948
|
* const { product } = await client.subscriptionProducts.update({
|
|
941
949
|
* id: "PROD_xxx",
|
|
942
950
|
* name: "Pro Plan v2",
|
|
943
|
-
*
|
|
944
|
-
*
|
|
951
|
+
* });
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* // Update prices and billing period
|
|
955
|
+
* const { product } = await client.subscriptionProducts.update({
|
|
956
|
+
* id: "PROD_xxx",
|
|
957
|
+
* billingPeriod: "yearly",
|
|
958
|
+
* prices: { USD: { amount: "99.00", taxCategory: "saas" } },
|
|
945
959
|
* });
|
|
946
960
|
*/
|
|
947
961
|
async update(params) {
|
|
948
962
|
validateShortId("id", params.id, "PROD");
|
|
949
|
-
validateRequired("name", params.name);
|
|
950
|
-
validateEnum("billingPeriod", params.billingPeriod, ["weekly", "monthly", "quarterly", "yearly"]);
|
|
951
|
-
validatePrices("prices", params.prices);
|
|
963
|
+
if (params.name !== void 0) validateRequired("name", params.name);
|
|
964
|
+
if (params.billingPeriod !== void 0) validateEnum("billingPeriod", params.billingPeriod, ["weekly", "monthly", "quarterly", "yearly"]);
|
|
965
|
+
if (params.prices) validatePrices("prices", params.prices);
|
|
952
966
|
return this.http.post("/v1/actions/subscription-product/update-product", params);
|
|
953
967
|
}
|
|
954
968
|
/**
|