@rechargeapps/storefront-client 1.81.0 → 1.82.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/dist/cjs/api/auth.js +1 -1
- package/dist/cjs/api/bundleData.js +1 -1
- package/dist/cjs/utils/request.js +1 -1
- package/dist/esm/api/auth.js +1 -1
- package/dist/esm/api/bundleData.js +1 -1
- package/dist/esm/utils/request.js +1 -1
- package/dist/index.d.ts +106 -89
- package/dist/umd/recharge-client.min.js +10 -10
- package/package.json +1 -1
package/dist/cjs/api/auth.js
CHANGED
|
@@ -181,7 +181,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
|
|
|
181
181
|
...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
|
|
182
182
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
183
183
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
184
|
-
"X-Recharge-Sdk-Version": "1.
|
|
184
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
185
185
|
...headers ? headers : {}
|
|
186
186
|
};
|
|
187
187
|
return request.request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
|
|
@@ -15,7 +15,7 @@ async function loadFromOnlineStore(id, country_code) {
|
|
|
15
15
|
const { appName, appVersion } = options.getOptions();
|
|
16
16
|
const headers = {
|
|
17
17
|
"X-Recharge-Sdk-Fn": "loadFromOnlineStore",
|
|
18
|
-
"X-Recharge-Sdk-Version": "1.
|
|
18
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
19
19
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
20
20
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
|
|
21
21
|
};
|
|
@@ -49,7 +49,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
49
49
|
"X-Recharge-Sdk-Fn": session.internalFnCall,
|
|
50
50
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
51
51
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
52
|
-
"X-Recharge-Sdk-Version": "1.
|
|
52
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
53
53
|
"X-Request-Id": session.internalRequestId,
|
|
54
54
|
...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
|
|
55
55
|
...headers ? headers : {}
|
package/dist/esm/api/auth.js
CHANGED
|
@@ -179,7 +179,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
|
|
|
179
179
|
...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
|
|
180
180
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
181
181
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
182
|
-
"X-Recharge-Sdk-Version": "1.
|
|
182
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
183
183
|
...headers ? headers : {}
|
|
184
184
|
};
|
|
185
185
|
return request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
|
|
@@ -13,7 +13,7 @@ async function loadFromOnlineStore(id, country_code) {
|
|
|
13
13
|
const { appName, appVersion } = getOptions();
|
|
14
14
|
const headers = {
|
|
15
15
|
"X-Recharge-Sdk-Fn": "loadFromOnlineStore",
|
|
16
|
-
"X-Recharge-Sdk-Version": "1.
|
|
16
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
17
17
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
18
18
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
|
|
19
19
|
};
|
|
@@ -47,7 +47,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
47
47
|
"X-Recharge-Sdk-Fn": session.internalFnCall,
|
|
48
48
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
49
49
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
50
|
-
"X-Recharge-Sdk-Version": "1.
|
|
50
|
+
"X-Recharge-Sdk-Version": "1.82.0",
|
|
51
51
|
"X-Request-Id": session.internalRequestId,
|
|
52
52
|
...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
|
|
53
53
|
...headers ? headers : {}
|
package/dist/index.d.ts
CHANGED
|
@@ -695,6 +695,94 @@ interface Addon {
|
|
|
695
695
|
type: AddonType;
|
|
696
696
|
}
|
|
697
697
|
|
|
698
|
+
type CreditSummaryIncludes = 'credit_details';
|
|
699
|
+
interface GetCreditSummaryOptions {
|
|
700
|
+
include?: CreditSummaryIncludes[];
|
|
701
|
+
presentment_currency_code?: string;
|
|
702
|
+
}
|
|
703
|
+
type CreditAccountType = 'reward' | 'manual' | 'gift';
|
|
704
|
+
interface PriceSet {
|
|
705
|
+
amount: string;
|
|
706
|
+
currency_code: string;
|
|
707
|
+
}
|
|
708
|
+
interface CurrencyPriceSet {
|
|
709
|
+
store_default_currency: PriceSet;
|
|
710
|
+
presentment_currency: PriceSet;
|
|
711
|
+
}
|
|
712
|
+
interface CreditAccount {
|
|
713
|
+
/** id of the credit account */
|
|
714
|
+
id: number;
|
|
715
|
+
/** Customer the credit account is associated with */
|
|
716
|
+
customer_id: number;
|
|
717
|
+
/** Store the credit account is associated with */
|
|
718
|
+
store_id: number;
|
|
719
|
+
/** Current balance of the credit account */
|
|
720
|
+
available_balance: string;
|
|
721
|
+
/** Starting balance of the credit account */
|
|
722
|
+
initial_balance: string;
|
|
723
|
+
/** When the credit account was created */
|
|
724
|
+
created_at: IsoDateString;
|
|
725
|
+
/** Currency of the credit account */
|
|
726
|
+
currency_code: string;
|
|
727
|
+
/** When the credit account expires */
|
|
728
|
+
expires_at: IsoDateString | null;
|
|
729
|
+
/** Name of the credit account */
|
|
730
|
+
name: string;
|
|
731
|
+
/** Redemption_code associated with credit account */
|
|
732
|
+
redemption_code: string;
|
|
733
|
+
/** The last time the credit account was updated */
|
|
734
|
+
updated_at: IsoDateString;
|
|
735
|
+
api_client_id: number;
|
|
736
|
+
api_client_restricted: boolean;
|
|
737
|
+
/** Type of credit account */
|
|
738
|
+
type: CreditAccountType;
|
|
739
|
+
/** Currency price set of the credit account */
|
|
740
|
+
available_balance_set?: CurrencyPriceSet;
|
|
741
|
+
}
|
|
742
|
+
interface CustomerCreditSummary {
|
|
743
|
+
/** Unique numeric identifier for the Customer. */
|
|
744
|
+
customer_id: number;
|
|
745
|
+
/** The total balance of the customer’s credit accounts. */
|
|
746
|
+
total_available_balance: string;
|
|
747
|
+
/** The currency of the customer’s credit balance. */
|
|
748
|
+
currency_code: string;
|
|
749
|
+
include?: {
|
|
750
|
+
credit_details: CreditAccount[];
|
|
751
|
+
};
|
|
752
|
+
/** Currency price set of the customer's total credit balance */
|
|
753
|
+
total_available_balance_set?: CurrencyPriceSet;
|
|
754
|
+
/** Maximum amount of credits that can be redeemed per charge */
|
|
755
|
+
max_redemption_limit?: number | null;
|
|
756
|
+
/** Currency price set of the customer's max redemption limit */
|
|
757
|
+
max_redemption_limit_set?: CurrencyPriceSet;
|
|
758
|
+
/** Total available balance by credit type */
|
|
759
|
+
total_available_balance_by_credit_type?: {
|
|
760
|
+
[key in CreditAccountType]: number;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
type CreditAccountsSortBy = 'id-desc' | 'id-asc' | 'expires_at-asc' | 'expires_at-desc';
|
|
764
|
+
type CreditAccountIncludes = 'customer';
|
|
765
|
+
interface CreditAccountListParams extends ListParams<CreditAccountsSortBy> {
|
|
766
|
+
/** Filter credit accounts by type. */
|
|
767
|
+
credit_type?: CreditAccountType;
|
|
768
|
+
/** Filter credit accounts by id. */
|
|
769
|
+
ids?: (string | number)[];
|
|
770
|
+
/** Show credit accounts that expire after the given date. */
|
|
771
|
+
expires_at_min?: IsoDateString;
|
|
772
|
+
/** Show credit accounts that expire before the given date. */
|
|
773
|
+
expires_at_max?: IsoDateString;
|
|
774
|
+
/** Include related data options */
|
|
775
|
+
include?: CreditAccountIncludes[];
|
|
776
|
+
}
|
|
777
|
+
interface CreditAccountsResponse {
|
|
778
|
+
next_cursor: null | string;
|
|
779
|
+
previous_cursor: null | string;
|
|
780
|
+
credit_accounts: CreditAccount[];
|
|
781
|
+
}
|
|
782
|
+
interface ApplyCreditOptions {
|
|
783
|
+
recurring?: boolean;
|
|
784
|
+
}
|
|
785
|
+
|
|
698
786
|
/**
|
|
699
787
|
* Types for Recharge tiered discount incentives: rules that apply larger discounts
|
|
700
788
|
* when qualifying subscription or one-time line items meet per-tier quantity or
|
|
@@ -732,6 +820,11 @@ type TierBase = {
|
|
|
732
820
|
discount_value: number | string;
|
|
733
821
|
/** Stable identifier for this tier within the discount configuration. */
|
|
734
822
|
lookup_key: string;
|
|
823
|
+
/**
|
|
824
|
+
* Spend threshold in both store-default and presentment currencies.
|
|
825
|
+
* Only present on spend-based tiers when `presentment_currency_code` is passed.
|
|
826
|
+
*/
|
|
827
|
+
condition_line_price_gte_set?: CurrencyPriceSet;
|
|
735
828
|
};
|
|
736
829
|
/**
|
|
737
830
|
* Each tier uses exactly one threshold:
|
|
@@ -821,6 +914,12 @@ interface TieredDiscountsParams {
|
|
|
821
914
|
cursor?: string;
|
|
822
915
|
/** Maximum number of records to return. */
|
|
823
916
|
limit?: number;
|
|
917
|
+
/**
|
|
918
|
+
* ISO 4217 currency code for the customer's presentment currency.
|
|
919
|
+
* When provided and different from the store currency, spend-based tiers
|
|
920
|
+
* include a `condition_line_price_gte_set` with converted amounts.
|
|
921
|
+
*/
|
|
922
|
+
presentment_currency_code?: string;
|
|
824
923
|
}
|
|
825
924
|
|
|
826
925
|
interface AddonSettings {
|
|
@@ -1419,9 +1518,13 @@ interface CreateSubscriptionRequest extends SubType<Subscription, SubscriptionRe
|
|
|
1419
1518
|
/** subscription plan_id - if included on create request then charge_interval_frequency/order_interval_frequency/order_interval_unit are not required */
|
|
1420
1519
|
plan_id?: Plan['id'];
|
|
1421
1520
|
}
|
|
1422
|
-
interface UpdateSubscriptionRequest extends Partial<Pick<Subscription, 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity'> & {
|
|
1521
|
+
interface UpdateSubscriptionRequest extends Partial<Pick<Subscription, 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity' | 'status'> & {
|
|
1423
1522
|
/** subscription plan_id - if included on update request then charge_interval_frequency/order_interval_frequency/order_interval_unit are not required */
|
|
1424
1523
|
plan_id?: Plan['id'];
|
|
1524
|
+
/** Reason for cancellation. Only accepted when status is 'cancelled'. */
|
|
1525
|
+
cancellation_reason?: string;
|
|
1526
|
+
/** Additional comments for cancellation reason. Only accepted when status is 'cancelled'. */
|
|
1527
|
+
cancellation_reason_comments?: string;
|
|
1425
1528
|
}> {
|
|
1426
1529
|
}
|
|
1427
1530
|
interface BasicSubscriptionParams {
|
|
@@ -1767,6 +1870,8 @@ interface Charge {
|
|
|
1767
1870
|
payment_processor: string;
|
|
1768
1871
|
/** The date and time when the transaction was processed. */
|
|
1769
1872
|
processed_at: IsoDateString;
|
|
1873
|
+
/** The originally scheduled date for the Charge, before any rescheduling. */
|
|
1874
|
+
original_scheduled_at?: IsoDateString | null;
|
|
1770
1875
|
/** The date time of when the Charge is/was scheduled to process. */
|
|
1771
1876
|
scheduled_at: IsoDateString;
|
|
1772
1877
|
/** The shipping Address of the Charge. */
|
|
@@ -3034,94 +3139,6 @@ interface CollectionListParams extends ListParams<CollectionsSortBy> {
|
|
|
3034
3139
|
title?: string;
|
|
3035
3140
|
}
|
|
3036
3141
|
|
|
3037
|
-
type CreditSummaryIncludes = 'credit_details';
|
|
3038
|
-
interface GetCreditSummaryOptions {
|
|
3039
|
-
include?: CreditSummaryIncludes[];
|
|
3040
|
-
presentment_currency_code?: string;
|
|
3041
|
-
}
|
|
3042
|
-
type CreditAccountType = 'reward' | 'manual' | 'gift';
|
|
3043
|
-
interface PriceSet {
|
|
3044
|
-
amount: string;
|
|
3045
|
-
currency_code: string;
|
|
3046
|
-
}
|
|
3047
|
-
interface CurrencyPriceSet {
|
|
3048
|
-
store_default_currency: PriceSet;
|
|
3049
|
-
presentment_currency: PriceSet;
|
|
3050
|
-
}
|
|
3051
|
-
interface CreditAccount {
|
|
3052
|
-
/** id of the credit account */
|
|
3053
|
-
id: number;
|
|
3054
|
-
/** Customer the credit account is associated with */
|
|
3055
|
-
customer_id: number;
|
|
3056
|
-
/** Store the credit account is associated with */
|
|
3057
|
-
store_id: number;
|
|
3058
|
-
/** Current balance of the credit account */
|
|
3059
|
-
available_balance: string;
|
|
3060
|
-
/** Starting balance of the credit account */
|
|
3061
|
-
initial_balance: string;
|
|
3062
|
-
/** When the credit account was created */
|
|
3063
|
-
created_at: IsoDateString;
|
|
3064
|
-
/** Currency of the credit account */
|
|
3065
|
-
currency_code: string;
|
|
3066
|
-
/** When the credit account expires */
|
|
3067
|
-
expires_at: IsoDateString | null;
|
|
3068
|
-
/** Name of the credit account */
|
|
3069
|
-
name: string;
|
|
3070
|
-
/** Redemption_code associated with credit account */
|
|
3071
|
-
redemption_code: string;
|
|
3072
|
-
/** The last time the credit account was updated */
|
|
3073
|
-
updated_at: IsoDateString;
|
|
3074
|
-
api_client_id: number;
|
|
3075
|
-
api_client_restricted: boolean;
|
|
3076
|
-
/** Type of credit account */
|
|
3077
|
-
type: CreditAccountType;
|
|
3078
|
-
/** Currency price set of the credit account */
|
|
3079
|
-
available_balance_set?: CurrencyPriceSet;
|
|
3080
|
-
}
|
|
3081
|
-
interface CustomerCreditSummary {
|
|
3082
|
-
/** Unique numeric identifier for the Customer. */
|
|
3083
|
-
customer_id: number;
|
|
3084
|
-
/** The total balance of the customer’s credit accounts. */
|
|
3085
|
-
total_available_balance: string;
|
|
3086
|
-
/** The currency of the customer’s credit balance. */
|
|
3087
|
-
currency_code: string;
|
|
3088
|
-
include?: {
|
|
3089
|
-
credit_details: CreditAccount[];
|
|
3090
|
-
};
|
|
3091
|
-
/** Currency price set of the customer's total credit balance */
|
|
3092
|
-
total_available_balance_set?: CurrencyPriceSet;
|
|
3093
|
-
/** Maximum amount of credits that can be redeemed per charge */
|
|
3094
|
-
max_redemption_limit?: number | null;
|
|
3095
|
-
/** Currency price set of the customer's max redemption limit */
|
|
3096
|
-
max_redemption_limit_set?: CurrencyPriceSet;
|
|
3097
|
-
/** Total available balance by credit type */
|
|
3098
|
-
total_available_balance_by_credit_type?: {
|
|
3099
|
-
[key in CreditAccountType]: number;
|
|
3100
|
-
};
|
|
3101
|
-
}
|
|
3102
|
-
type CreditAccountsSortBy = 'id-desc' | 'id-asc' | 'expires_at-asc' | 'expires_at-desc';
|
|
3103
|
-
type CreditAccountIncludes = 'customer';
|
|
3104
|
-
interface CreditAccountListParams extends ListParams<CreditAccountsSortBy> {
|
|
3105
|
-
/** Filter credit accounts by type. */
|
|
3106
|
-
credit_type?: CreditAccountType;
|
|
3107
|
-
/** Filter credit accounts by id. */
|
|
3108
|
-
ids?: (string | number)[];
|
|
3109
|
-
/** Show credit accounts that expire after the given date. */
|
|
3110
|
-
expires_at_min?: IsoDateString;
|
|
3111
|
-
/** Show credit accounts that expire before the given date. */
|
|
3112
|
-
expires_at_max?: IsoDateString;
|
|
3113
|
-
/** Include related data options */
|
|
3114
|
-
include?: CreditAccountIncludes[];
|
|
3115
|
-
}
|
|
3116
|
-
interface CreditAccountsResponse {
|
|
3117
|
-
next_cursor: null | string;
|
|
3118
|
-
previous_cursor: null | string;
|
|
3119
|
-
credit_accounts: CreditAccount[];
|
|
3120
|
-
}
|
|
3121
|
-
interface ApplyCreditOptions {
|
|
3122
|
-
recurring?: boolean;
|
|
3123
|
-
}
|
|
3124
|
-
|
|
3125
3142
|
/** @internal */
|
|
3126
3143
|
interface CustomerSurveyReason {
|
|
3127
3144
|
id: number;
|