@rechargeapps/storefront-client 0.29.1 → 0.29.2
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/LICENSE +7 -0
- package/dist/index.d.ts +73 -73
- package/dist/umd/recharge-client.min.js +1 -5
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2023 Recharge Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** HEXA, RGBA, HSLA */
|
|
2
|
-
|
|
2
|
+
type ColorString = string;
|
|
3
3
|
/** HTML String */
|
|
4
|
-
|
|
4
|
+
type HTMLString = string;
|
|
5
5
|
/** ISO 8601 date time, YYYY-MM-DDTHH:MM:SS+00:00 */
|
|
6
|
-
|
|
6
|
+
type IsoDateString = string;
|
|
7
7
|
interface Property {
|
|
8
8
|
name: string;
|
|
9
9
|
value: string;
|
|
@@ -119,14 +119,14 @@ interface AnalyticsData {
|
|
|
119
119
|
}[];
|
|
120
120
|
}
|
|
121
121
|
/** preferred values are 'day', 'week', 'month' other values are available for backwards compatibility */
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
type IntervalUnit = 'day' | 'week' | 'month' | 'days' | 'Days' | 'weeks' | 'Weeks' | 'months' | 'Months';
|
|
123
|
+
type SubType<T, TRequired extends keyof T = keyof T, TOptional extends keyof T = keyof T> = Required<Pick<T, TRequired>> & Partial<Pick<T, TOptional>>;
|
|
124
|
+
type BooleanString = 'true' | 'false';
|
|
125
|
+
type BooleanNumbers = 0 | 1;
|
|
126
|
+
type BooleanStringNumbers = '0' | '1';
|
|
127
|
+
type BooleanLike = boolean | BooleanNumbers | BooleanStringNumbers | BooleanString;
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
type MetafieldOwnerResource = 'customer' | 'subscription' | 'order' | 'charge';
|
|
130
130
|
interface Metafield {
|
|
131
131
|
/** Unique numeric identifier for the metafield. */
|
|
132
132
|
id: number;
|
|
@@ -149,15 +149,15 @@ interface Metafield {
|
|
|
149
149
|
/** The type of the value parameter. */
|
|
150
150
|
value_type: 'string' | 'integer' | 'json_string';
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
type MetafieldRequiredCreateProps = 'key' | 'namespace' | 'owner_id' | 'owner_resource' | 'value' | 'value_type';
|
|
153
|
+
type MetafieldOptionalCreateProps = 'description';
|
|
154
154
|
interface MetafieldCreateProps {
|
|
155
155
|
/** Instructs to add the Onetime to the next charge scheduled under this Address. */
|
|
156
156
|
add_to_next_charge?: boolean;
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
type CreateMetafieldRequest = SubType<Metafield, MetafieldRequiredCreateProps, MetafieldOptionalCreateProps> & MetafieldCreateProps;
|
|
159
|
+
type MetafieldOptionalUpdateProps = 'description' | 'owner_id' | 'owner_resource' | 'value' | 'value_type';
|
|
160
|
+
type UpdateMetafieldRequest = Partial<Pick<Metafield, MetafieldOptionalUpdateProps>>;
|
|
161
161
|
|
|
162
162
|
interface PaymentDetails {
|
|
163
163
|
/** Payment_method brand or company powering it. valid for CREDIT_CARD only. */
|
|
@@ -177,9 +177,9 @@ interface PaymentDetails {
|
|
|
177
177
|
/** Type of funding for the Payment Method. */
|
|
178
178
|
funding_type?: string;
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT' | 'IDEAL' | 'SHOP_PAY' | 'PAYPAL_EXPRESS' | 'SOFORT' | 'GIROPAY';
|
|
181
|
+
type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie' | 'adyen' | 'shopify_app_subscription_billing';
|
|
182
|
+
type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
|
|
183
183
|
interface PaymentMethod {
|
|
184
184
|
/** The unique payment method id for a customer. */
|
|
185
185
|
id: number;
|
|
@@ -226,14 +226,14 @@ interface PaymentMethodsResponse {
|
|
|
226
226
|
previous_cursor: null | string;
|
|
227
227
|
payment_methods: PaymentMethod[];
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
type PaymentMethodOptionalUpdateProps = 'billing_address' | 'default';
|
|
230
|
+
type UpdatePaymentMethodRequest = Partial<Pick<PaymentMethod, PaymentMethodOptionalUpdateProps>>;
|
|
231
|
+
type PaymentMethodIncludes = 'addresses';
|
|
232
232
|
interface GetPaymentMethodOptions {
|
|
233
233
|
include?: PaymentMethodIncludes[];
|
|
234
234
|
}
|
|
235
235
|
/** no sorting options for payment_methods, always by id-desc */
|
|
236
|
-
|
|
236
|
+
type PaymentMethodSortBy = null;
|
|
237
237
|
interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
|
|
238
238
|
/** Return the payment_methods linked to the given processor_name. */
|
|
239
239
|
processor_name?: ProcessorName;
|
|
@@ -245,7 +245,7 @@ interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
|
|
|
245
245
|
include?: PaymentMethodIncludes[];
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
249
249
|
interface Subscription {
|
|
250
250
|
/** Unique numeric identifier for the subscription. */
|
|
251
251
|
id: number;
|
|
@@ -339,11 +339,11 @@ interface SubscriptionsResponse {
|
|
|
339
339
|
previous_cursor: null | string;
|
|
340
340
|
subscriptions: Subscription[];
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
type SubscriptionIncludes = 'address' | 'customer' | 'metafields';
|
|
343
343
|
interface GetSubscriptionOptions {
|
|
344
344
|
include?: SubscriptionIncludes[];
|
|
345
345
|
}
|
|
346
|
-
|
|
346
|
+
type SubscriptionSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
347
347
|
interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
|
|
348
348
|
/** Return the subscriptions linked to the given address_id. */
|
|
349
349
|
address_id?: string;
|
|
@@ -366,11 +366,11 @@ interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
|
|
|
366
366
|
/** Include related data options */
|
|
367
367
|
include?: SubscriptionIncludes[];
|
|
368
368
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
369
|
+
type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
|
|
370
|
+
type SubscriptionOptionalCreateProps = 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'external_product_id' | 'properties' | 'status';
|
|
371
|
+
type CreateSubscriptionRequest = SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps>;
|
|
372
|
+
type SubscriptionOptionalUpdateProps = 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity';
|
|
373
|
+
type UpdateSubscriptionRequest = Partial<Pick<Subscription, SubscriptionOptionalUpdateProps>>;
|
|
374
374
|
interface BasicSubscriptionParams {
|
|
375
375
|
/** Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response. */
|
|
376
376
|
commit?: boolean;
|
|
@@ -435,7 +435,7 @@ interface Subscription_2021_01 {
|
|
|
435
435
|
status: 'ACTIVE' | 'CANCELLED' | 'EXPIRED';
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
|
|
438
|
+
type CustomerIncludes = 'addresses' | 'metafields' | 'payment_methods' | 'subscriptions';
|
|
439
439
|
interface GetCustomerOptions {
|
|
440
440
|
include?: CustomerIncludes[];
|
|
441
441
|
}
|
|
@@ -476,14 +476,14 @@ interface Customer {
|
|
|
476
476
|
subscriptions?: Subscription[];
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
type CustomerOptionalUpdateProps = 'email' | 'first_name' | 'last_name' | 'external_customer_id';
|
|
480
|
+
type UpdateCustomerRequest = Partial<Pick<Customer, CustomerOptionalUpdateProps>>;
|
|
481
481
|
interface CustomerDeliveryScheduleParams {
|
|
482
482
|
delivery_count_future?: number;
|
|
483
483
|
future_internal?: number;
|
|
484
484
|
date_max?: IsoDateString;
|
|
485
485
|
}
|
|
486
|
-
|
|
486
|
+
type DeliveryLineItem = Omit<LineItem, 'external_inventory_policy' | 'grams' | 'handle' | 'purchase_item_id' | 'purchase_item_type' | 'sku' | 'tax_due' | 'tax_lines' | 'taxable_amount' | 'taxable' | 'title' | 'total_price' | 'unit_price_includes_tax'> & {
|
|
487
487
|
/** Value is set to true if it is not a onetime or a prepaid item */
|
|
488
488
|
is_skippable: boolean;
|
|
489
489
|
/** Value is set to true if the order is skipped. */
|
|
@@ -499,7 +499,7 @@ declare type DeliveryLineItem = Omit<LineItem, 'external_inventory_policy' | 'gr
|
|
|
499
499
|
/** The subtotal price (sum of all line items * their quantity) of the order less discounts. */
|
|
500
500
|
subtotal_price: string;
|
|
501
501
|
};
|
|
502
|
-
|
|
502
|
+
type DeliveryPaymentMethod = Omit<PaymentMethod, 'created_at' | 'customer_id' | 'default' | 'payment_type' | 'processor_customer_token' | 'processor_name' | 'processor_payment_method_token' | 'status_reason' | 'status' | 'updated_at'> & {
|
|
503
503
|
payment_details: PaymentDetails;
|
|
504
504
|
billing_address: AssociatedAddress;
|
|
505
505
|
};
|
|
@@ -553,8 +553,8 @@ interface ShippingLine {
|
|
|
553
553
|
/** An array of tax lines associated with the shipping_line. */
|
|
554
554
|
tax_lines: TaxLine[];
|
|
555
555
|
}
|
|
556
|
-
|
|
557
|
-
|
|
556
|
+
type OrderStatus = 'success' | 'error' | 'queued' | 'cancelled' | 'pending_charge_status';
|
|
557
|
+
type OrderType = 'checkout' | 'recurring';
|
|
558
558
|
interface Order {
|
|
559
559
|
/** The unique numeric identifier for the order. */
|
|
560
560
|
id: number;
|
|
@@ -649,13 +649,13 @@ interface Order {
|
|
|
649
649
|
metafields?: Metafield[];
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
|
-
|
|
652
|
+
type OrderIncludes = 'customer' | 'metafields';
|
|
653
653
|
interface OrdersResponse {
|
|
654
654
|
next_cursor: null | string;
|
|
655
655
|
previous_cursor: null | string;
|
|
656
656
|
orders: Order[];
|
|
657
657
|
}
|
|
658
|
-
|
|
658
|
+
type OrderSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'processed_at-asc' | 'processed_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
|
|
659
659
|
interface OrderListParams extends ListParams<OrderSortBy> {
|
|
660
660
|
/** Filter orders by address. */
|
|
661
661
|
address_id?: string;
|
|
@@ -689,7 +689,7 @@ interface OrderListParams extends ListParams<OrderSortBy> {
|
|
|
689
689
|
include?: OrderIncludes[];
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
|
|
692
|
+
type ChargeStatus = 'success' | 'error' | 'queued' | 'skipped' | 'refunded' | 'partially_refunded' | 'pending_manual_payment' | 'pending';
|
|
693
693
|
interface Charge {
|
|
694
694
|
/** The unique numeric identifier for the Charge. */
|
|
695
695
|
id: number;
|
|
@@ -788,11 +788,11 @@ interface ChargeListResponse {
|
|
|
788
788
|
previous_cursor: null | string;
|
|
789
789
|
charges: Charge[];
|
|
790
790
|
}
|
|
791
|
-
|
|
791
|
+
type ChargeIncludes = 'customer' | 'metafields' | 'payment_methods';
|
|
792
792
|
interface GetChargeOptions {
|
|
793
793
|
include?: ChargeIncludes[];
|
|
794
794
|
}
|
|
795
|
-
|
|
795
|
+
type ChargeSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
|
|
796
796
|
interface ChargeListParams extends ListParams<ChargeSortBy> {
|
|
797
797
|
/** Filter Charges by Address. */
|
|
798
798
|
address_id?: string;
|
|
@@ -877,7 +877,7 @@ interface CreateAddressRequest {
|
|
|
877
877
|
/** The zip or postal code associated with the address. */
|
|
878
878
|
zip: string;
|
|
879
879
|
}
|
|
880
|
-
|
|
880
|
+
type UpdateAddressRequest = Omit<Partial<CreateAddressRequest>, 'presentment_currency' | 'customer_id' | 'discounts'> & {
|
|
881
881
|
discounts?: {
|
|
882
882
|
code: string;
|
|
883
883
|
}[];
|
|
@@ -970,11 +970,11 @@ interface AddressListResponse {
|
|
|
970
970
|
previous_cursor: null | string;
|
|
971
971
|
addresses: Address[];
|
|
972
972
|
}
|
|
973
|
-
|
|
973
|
+
type AddressIncludes = 'customer' | 'payment_methods' | 'subscriptions';
|
|
974
974
|
interface GetAddressOptions {
|
|
975
975
|
include?: AddressIncludes[];
|
|
976
976
|
}
|
|
977
|
-
|
|
977
|
+
type AddressSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
978
978
|
interface AddressListParams extends ListParams<AddressSortBy> {
|
|
979
979
|
/** Returns addresses that have the provided discount_id. */
|
|
980
980
|
discount_id?: string;
|
|
@@ -1045,8 +1045,8 @@ declare function skipCharge(session: Session, id: number | string): Promise<Char
|
|
|
1045
1045
|
declare function unskipCharge(session: Session, id: number | string): Promise<Charge>;
|
|
1046
1046
|
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
1047
1047
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1048
|
+
type Method = 'get' | 'post' | 'put' | 'delete';
|
|
1049
|
+
type Request = <T>(method: Method, url: string, options?: RequestOptions) => Promise<T>;
|
|
1050
1050
|
interface GetRequestOptions {
|
|
1051
1051
|
id?: string | number;
|
|
1052
1052
|
query?: unknown;
|
|
@@ -1061,11 +1061,11 @@ interface CustomHeaders {
|
|
|
1061
1061
|
['X-Recharge-App']?: 'storefront-client';
|
|
1062
1062
|
}
|
|
1063
1063
|
/** We only support headers with an object syntax */
|
|
1064
|
-
|
|
1064
|
+
type RequestHeaders = Record<string, string> & CustomHeaders;
|
|
1065
1065
|
interface RequestOptionsHeaders {
|
|
1066
1066
|
headers?: RequestHeaders;
|
|
1067
1067
|
}
|
|
1068
|
-
|
|
1068
|
+
type RequestOptions = GetRequestOptions & CRUDRequestOptions & RequestOptionsHeaders;
|
|
1069
1069
|
|
|
1070
1070
|
interface LoginResponse {
|
|
1071
1071
|
api_token: string;
|
|
@@ -1145,18 +1145,18 @@ interface BundleSelection {
|
|
|
1145
1145
|
/** The date and time at which the BundleSelection was most recently updated. */
|
|
1146
1146
|
updated_at: IsoDateString;
|
|
1147
1147
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1148
|
+
type BundleSelectionItemRequiredCreateProps = 'collection_id' | 'collection_source' | 'external_product_id' | 'external_variant_id' | 'quantity';
|
|
1149
|
+
type CreateBundleSelectionRequest = {
|
|
1150
1150
|
purchase_item_id: number;
|
|
1151
1151
|
items: Pick<BundleSelectionItem, BundleSelectionItemRequiredCreateProps>[];
|
|
1152
1152
|
};
|
|
1153
|
-
|
|
1153
|
+
type UpdateBundleSelectionRequest = CreateBundleSelectionRequest;
|
|
1154
1154
|
interface BundleSelectionsResponse {
|
|
1155
1155
|
next_cursor: null | string;
|
|
1156
1156
|
previous_cursor: null | string;
|
|
1157
1157
|
bundle_selections: BundleSelection[];
|
|
1158
1158
|
}
|
|
1159
|
-
|
|
1159
|
+
type BundleSelectionsSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1160
1160
|
interface BundleSelectionListParams extends ListParams<BundleSelectionsSortBy> {
|
|
1161
1161
|
/** Filter BundleSelections by Subscription or Onetime ID. */
|
|
1162
1162
|
purchase_item_ids?: string[];
|
|
@@ -1164,9 +1164,9 @@ interface BundleSelectionListParams extends ListParams<BundleSelectionsSortBy> {
|
|
|
1164
1164
|
bundle_variant_ids?: string[];
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1167
|
+
type FirstOption = 'onetime' | 'autodeliver';
|
|
1168
|
+
type PriceAdjustmentsType = 'percentage';
|
|
1169
|
+
type StorefrontPurchaseOption = 'subscription_and_onetime' | 'subscription_only' | 'onetime_only' | 'inactive';
|
|
1170
1170
|
interface BundleTranslations {
|
|
1171
1171
|
cpb_add: string;
|
|
1172
1172
|
cpb_add_items_to_continue: string;
|
|
@@ -1250,8 +1250,8 @@ interface Translations {
|
|
|
1250
1250
|
month: string;
|
|
1251
1251
|
months: string;
|
|
1252
1252
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1253
|
+
type WidgetTemplateType = 'radio' | 'checkbox' | 'button_group' | 'radio_group';
|
|
1254
|
+
type WidgetIconColor = '#191D48' | 'white' | 'black' | '#ffffff';
|
|
1255
1255
|
/****************** 2020-12 **********************/
|
|
1256
1256
|
interface CDNProductResource {
|
|
1257
1257
|
product: CDNProductRaw;
|
|
@@ -1391,7 +1391,7 @@ interface CDNBaseWidgetSettings {
|
|
|
1391
1391
|
widget_icon: WidgetIconColor;
|
|
1392
1392
|
widget_template_type: WidgetTemplateType;
|
|
1393
1393
|
}
|
|
1394
|
-
|
|
1394
|
+
type CDNExcludedWidgetSettings = 'display_on' | 'first_option';
|
|
1395
1395
|
interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidgetSettings> {
|
|
1396
1396
|
/** @deprecated */
|
|
1397
1397
|
autoInject: boolean;
|
|
@@ -1403,7 +1403,7 @@ interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidge
|
|
|
1403
1403
|
valid_pages: string[];
|
|
1404
1404
|
is_subscription_first: boolean;
|
|
1405
1405
|
}
|
|
1406
|
-
|
|
1406
|
+
type CDNWidgetSettingsRaw = {
|
|
1407
1407
|
[key in keyof CDNBaseWidgetSettings]: string;
|
|
1408
1408
|
};
|
|
1409
1409
|
interface CDNWidgetSettingsResource {
|
|
@@ -1514,7 +1514,7 @@ interface CDNBundleSettings {
|
|
|
1514
1514
|
}
|
|
1515
1515
|
|
|
1516
1516
|
/** @internal */
|
|
1517
|
-
|
|
1517
|
+
type MembershipStatus = 'active' | 'inactive';
|
|
1518
1518
|
/** @internal */
|
|
1519
1519
|
interface Membership {
|
|
1520
1520
|
id: string;
|
|
@@ -1540,11 +1540,11 @@ interface MembershipListResponse {
|
|
|
1540
1540
|
memberships: Membership[];
|
|
1541
1541
|
}
|
|
1542
1542
|
/** @internal */
|
|
1543
|
-
|
|
1543
|
+
type MembershipsSortBy = 'id-asc' | 'id-desc';
|
|
1544
1544
|
/** @internal */
|
|
1545
|
-
|
|
1545
|
+
type membershipIncludes = 'customer' | 'subscriptions';
|
|
1546
1546
|
/** @internal */
|
|
1547
|
-
|
|
1547
|
+
type MembershipIncludes = `${membershipIncludes}` | `${membershipIncludes},${membershipIncludes}`;
|
|
1548
1548
|
/** @internal */
|
|
1549
1549
|
interface MembershipListParams extends ListParams<MembershipsSortBy> {
|
|
1550
1550
|
include?: MembershipIncludes;
|
|
@@ -1616,21 +1616,21 @@ interface Onetime {
|
|
|
1616
1616
|
/** Presentment currency */
|
|
1617
1617
|
presentment_currency: string | null;
|
|
1618
1618
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1619
|
+
type OnetimeRequiredCreateProps = 'address_id' | 'external_variant_id' | 'next_charge_scheduled_at' | 'price' | 'product_title' | 'quantity';
|
|
1620
|
+
type OnetimeOptionalCreateProps = 'external_product_id' | 'properties' | 'sku';
|
|
1621
1621
|
interface OnetimeCreateProps {
|
|
1622
1622
|
/** Instructs to add the Onetime to the next charge scheduled under this Address. */
|
|
1623
1623
|
add_to_next_charge?: boolean;
|
|
1624
1624
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1625
|
+
type CreateOnetimeRequest = SubType<Onetime, OnetimeRequiredCreateProps, OnetimeOptionalCreateProps> & OnetimeCreateProps;
|
|
1626
|
+
type OnetimeOptionalUpdateProps = 'next_charge_scheduled_at' | 'properties' | 'quantity' | 'external_variant_id' | 'sku';
|
|
1627
|
+
type UpdateOnetimeRequest = Partial<Pick<Onetime, OnetimeOptionalUpdateProps>>;
|
|
1628
1628
|
interface OnetimesResponse {
|
|
1629
1629
|
next_cursor: null | string;
|
|
1630
1630
|
previous_cursor: null | string;
|
|
1631
1631
|
onetimes: Onetime[];
|
|
1632
1632
|
}
|
|
1633
|
-
|
|
1633
|
+
type OnetimesSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1634
1634
|
interface OnetimeListParams extends ListParams<OnetimesSortBy> {
|
|
1635
1635
|
/** Return the onetimes linked to the given address_id. */
|
|
1636
1636
|
address_id?: string;
|
|
@@ -1653,7 +1653,7 @@ interface OnetimeListParams extends ListParams<OnetimesSortBy> {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
1655
|
/** @internal */
|
|
1656
|
-
|
|
1656
|
+
type StorefrontEnvironment = 'stage' | 'prod';
|
|
1657
1657
|
/** @internal */
|
|
1658
1658
|
interface StorefrontOptions {
|
|
1659
1659
|
storeIdentifier: string;
|
|
@@ -1708,7 +1708,7 @@ interface SubscriptionPreferences {
|
|
|
1708
1708
|
order_day_of_week: null | number;
|
|
1709
1709
|
order_interval_frequency: number;
|
|
1710
1710
|
}
|
|
1711
|
-
|
|
1711
|
+
type PlanType = 'subscription' | 'prepaid' | 'onetime';
|
|
1712
1712
|
interface Plan {
|
|
1713
1713
|
/** Unique numeric identifier for the Plan. */
|
|
1714
1714
|
id: number;
|
|
@@ -1740,7 +1740,7 @@ interface PlansResponse {
|
|
|
1740
1740
|
previous_cursor: null | string;
|
|
1741
1741
|
plans: Plan[];
|
|
1742
1742
|
}
|
|
1743
|
-
|
|
1743
|
+
type PlanSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1744
1744
|
interface PlanListParams extends ListParams<PlanSortBy> {
|
|
1745
1745
|
/** Return the Plans linked to the Product record in Recharge with the indicated external_product_id */
|
|
1746
1746
|
external_product_id?: string;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* recharge-client-0.29.1.min.js
|
|
3
|
-
* Copyright (c) Recharge
|
|
4
|
-
*/
|
|
5
|
-
|
|
1
|
+
// recharge-client-0.29.2.min.js | MIT License | © Recharge Inc.
|
|
6
2
|
(function(ne,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.recharge=Ke())})(this,function(){"use strict";var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function tf(r){return r&&DataView.prototype.isPrototypeOf(r)}if(k.arrayBuffer)var nf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],af=ArrayBuffer.isView||function(r){return r&&nf.indexOf(Object.prototype.toString.call(r))>-1};function Ze(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function kt(r){return typeof r!="string"&&(r=String(r)),r}function qt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return k.iterable&&(e[Symbol.iterator]=function(){return e}),e}function D(r){this.map={},r instanceof D?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}D.prototype.append=function(r,e){r=Ze(r),e=kt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},D.prototype.delete=function(r){delete this.map[Ze(r)]},D.prototype.get=function(r){return r=Ze(r),this.has(r)?this.map[r]:null},D.prototype.has=function(r){return this.map.hasOwnProperty(Ze(r))},D.prototype.set=function(r,e){this.map[Ze(r)]=kt(e)},D.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},D.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),qt(r)},D.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),qt(r)},D.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),qt(r)},k.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function Gt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function Oi(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function of(r){var e=new FileReader,t=Oi(e);return e.readAsArrayBuffer(r),t}function uf(r){var e=new FileReader,t=Oi(e);return e.readAsText(r),t}function sf(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function Si(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Ii(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:k.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:k.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():k.arrayBuffer&&k.blob&&tf(r)?(this._bodyArrayBuffer=Si(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):k.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||af(r))?this._bodyArrayBuffer=Si(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},k.blob&&(this.blob=function(){var r=Gt(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=Gt(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(of)}),this.text=function(){var r=Gt(this);if(r)return r;if(this._bodyBlob)return uf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(sf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k.formData&&(this.formData=function(){return this.text().then(lf)}),this.json=function(){return this.text().then(JSON.parse)},this}var ff=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function cf(r){var e=r.toUpperCase();return ff.indexOf(e)>-1?e:r}function _e(r,e){if(!(this instanceof _e))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof _e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new D(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new D(e.headers)),this.method=cf(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}_e.prototype.clone=function(){return new _e(this,{body:this._bodyInit})};function lf(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function pf(r){var e=new D,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
7
3
|
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}Ii.call(_e.prototype);function Y(r,e){if(!(this instanceof Y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new D(e.headers),this.url=e.url||"",this._initBody(r)}Ii.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var hf=[301,302,303,307,308];Y.redirect=function(r,e){if(hf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:e,headers:{location:r}})};var me=L.DOMException;try{new me}catch{me=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},me.prototype=Object.create(Error.prototype),me.prototype.constructor=me}function Pi(r,e){return new Promise(function(t,n){var i=new _e(r,e);if(i.signal&&i.signal.aborted)return n(new me("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:pf(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new Y(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new me("Aborted","AbortError"))},0)};function s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Pi.polyfill=!0,L.fetch||(L.fetch=Pi,L.Headers=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);var df=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Ti=typeof Symbol<"u"&&Symbol,yf=df,vf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yf()},gf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,_f=Object.prototype.toString,mf="[object Function]",wf=function(e){var t=this;if(typeof t!="function"||_f.call(t)!==mf)throw new TypeError(gf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},bf=wf,Vt=Function.prototype.bind||bf,$f=Vt,Af=$f.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Ef=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=vf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},Of=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Ef,"%TypedArray%":Of,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Sf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[e]=t,t},Ri={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Je=Vt,xr=Af,If=Je.call(Function.call,Array.prototype.concat),Pf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Tf=Je.call(Function.call,RegExp.prototype.exec),xf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rf=/\\(\\)?/g,Ff=function(e){var t=Rr(e,0,1),n=Rr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return Fi(e,xf,function(a,o,s,f){i[i.length]=s?Fi(f,Rf,"$1"):o||a}),i},Mf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Sf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Xt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Tf(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ff(e),i=n.length>0?n[0]:"",a=Mf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Pf(n,If([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Df=Bi(Di("String.prototype.indexOf")),Bf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Df(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Nf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function Uf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Nf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Cf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function Lf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Cf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(Lf(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),a.push(i),a.join("")}function Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function Ci(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var jf={}.toString,Li=Array.isArray||function(r){return jf.call(r)=="[object Array]"};/*!
|
|
8
4
|
* The buffer module from node.js, for the browser.
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rechargeapps/storefront-client",
|
|
3
3
|
"description": "Storefront client for Recharge",
|
|
4
|
-
"version": "0.29.
|
|
5
|
-
"
|
|
4
|
+
"version": "0.29.2",
|
|
5
|
+
"author": "Recharge Inc.",
|
|
6
|
+
"license": "MIT",
|
|
6
7
|
"main": "dist/cjs/index.js",
|
|
7
8
|
"module": "dist/esm/index.js",
|
|
8
9
|
"types": "dist/index.d.ts",
|