@bigcommerce/checkout-sdk 1.271.1 → 1.272.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/checkout-button.d.ts +3 -62
  3. package/dist/checkout-button.js +1 -1
  4. package/dist/checkout-button.js.map +1 -1
  5. package/dist/checkout-button.umd.js +1 -1
  6. package/dist/checkout-button.umd.js.map +1 -1
  7. package/dist/checkout-sdk.d.ts +17 -180
  8. package/dist/checkout-sdk.js +1 -1
  9. package/dist/checkout-sdk.js.map +1 -1
  10. package/dist/checkout-sdk.umd.js +1 -1
  11. package/dist/checkout-sdk.umd.js.map +1 -1
  12. package/docs/README.md +3 -58
  13. package/docs/classes/CheckoutButtonInitializer.md +2 -2
  14. package/docs/classes/CheckoutService.md +6 -6
  15. package/docs/interfaces/{CheckoutButtonInitializeOptions_4.md → CheckoutButtonInitializeOptions.md} +30 -30
  16. package/docs/interfaces/CheckoutButtonOptions.md +5 -5
  17. package/docs/interfaces/{CustomerInitializeOptions_4.md → CustomerInitializeOptions.md} +27 -27
  18. package/docs/interfaces/CustomerRequestOptions.md +39 -2
  19. package/docs/interfaces/ExecutePaymentMethodCheckoutOptions.md +4 -4
  20. package/docs/interfaces/{PaymentInitializeOptions_4.md → PaymentInitializeOptions.md} +46 -46
  21. package/docs/interfaces/PaymentRequestOptions.md +4 -4
  22. package/docs/interfaces/RequestOptions.md +3 -3
  23. package/docs/interfaces/SpamProtectionOptions.md +1 -1
  24. package/package.json +1 -1
  25. package/docs/interfaces/ApplePayButtonInitializeOptions_2.md +0 -38
  26. package/docs/interfaces/ApplePayCustomerInitializeOptions_2.md +0 -77
  27. package/docs/interfaces/ApplePayPaymentInitializeOptions_2.md +0 -40
  28. package/docs/interfaces/CheckoutButtonInitializeOptions_3.md +0 -68
  29. package/docs/interfaces/CheckoutButtonOptions_2.md +0 -55
  30. package/docs/interfaces/CustomerInitializeOptions_3.md +0 -29
  31. package/docs/interfaces/CustomerRequestOptions_2.md +0 -60
  32. package/docs/interfaces/PaymentInitializeOptions_3.md +0 -74
  33. package/docs/interfaces/PaymentRequestOptions_2.md +0 -67
  34. package/docs/interfaces/RequestOptions_2.md +0 -44
  35. package/docs/interfaces/WithApplePayButtonInitializeOptions.md +0 -15
  36. package/docs/interfaces/WithApplePayCustomerInitializeOptions.md +0 -15
  37. package/docs/interfaces/WithApplePayPaymentInitializeOptions.md +0 -15
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.272.0](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.271.3...v1.272.0) (2022-08-02)
6
+
7
+
8
+ ### Features
9
+
10
+ * **checkout:** CHECKOUT-6781 Generate new enum from existing enums ([779f3f5](https://github.com/bigcommerce/checkout-sdk-js/commit/779f3f5f891b55a05b0d3550f456cde1aa075098))
11
+
12
+
13
+ ### Code Refactoring
14
+
15
+ * **payment:** CHECKOUT-6781 Remove unnecessary exports ([40990c2](https://github.com/bigcommerce/checkout-sdk-js/commit/40990c205559327155dfec4ca9d6aa0e72005587))
16
+
17
+ ### [1.271.3](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.271.2...v1.271.3) (2022-07-28)
18
+
19
+ ### [1.271.2](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.271.1...v1.271.2) (2022-07-28)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **checkout:** CHECKOUT-6781 Revert type exports ([#1526](https://github.com/bigcommerce/checkout-sdk-js/issues/1526)) ([6ea0c76](https://github.com/bigcommerce/checkout-sdk-js/commit/6ea0c7663ed4cf821d7a56963d522fef4facbd05))
25
+
5
26
  ### [1.271.1](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.271.0...v1.271.1) (2022-07-28)
6
27
 
7
28
 
@@ -129,23 +129,6 @@ declare interface ApplePayButtonInitializeOptions {
129
129
  onPaymentAuthorize(): void;
130
130
  }
131
131
 
132
- /**
133
- * A set of options that are required to initialize ApplePay in cart.
134
- *
135
- * When ApplePay is initialized, an ApplePay button will be inserted into the
136
- * DOM. When a customer clicks on it, it will trigger Apple sheet.
137
- */
138
- declare interface ApplePayButtonInitializeOptions_2 {
139
- /**
140
- * The class name of the ApplePay button style.
141
- */
142
- buttonClassName?: string;
143
- /**
144
- * A callback that gets called when a payment is successfully completed.
145
- */
146
- onPaymentAuthorize(): void;
147
- }
148
-
149
132
  declare interface BraintreeError extends Error {
150
133
  type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
151
134
  code: string;
@@ -242,24 +225,12 @@ declare class CheckoutButtonErrorSelector {
242
225
  getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
243
226
  }
244
227
 
245
- declare type CheckoutButtonInitializeOptions = CheckoutButtonInitializeOptions_2 & CheckoutButtonInitializeOptions_4;
246
-
247
- declare type CheckoutButtonInitializeOptions_2 = CheckoutButtonInitializeOptions_3 & WithApplePayButtonInitializeOptions;
248
-
249
- declare interface CheckoutButtonInitializeOptions_3 extends CheckoutButtonOptions {
250
- /**
251
- * The ID of a container which the checkout button should be inserted.
252
- */
253
- containerId: string;
254
- [key: string]: unknown;
255
- }
256
-
257
- declare interface CheckoutButtonInitializeOptions_4 extends CheckoutButtonOptions_2 {
228
+ declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions {
258
229
  /**
259
230
  * The options that are required to initialize the ApplePay payment method.
260
231
  * They can be omitted unless you need to support ApplePay in cart.
261
232
  */
262
- applepay?: ApplePayButtonInitializeOptions_2;
233
+ applepay?: ApplePayButtonInitializeOptions;
263
234
  /**
264
235
  * The options that are required to facilitate AmazonPayV2. They can be
265
236
  * omitted unless you need to support AmazonPayV2.
@@ -433,7 +404,7 @@ declare class CheckoutButtonInitializer {
433
404
  * @param options - Options for deinitializing the checkout button.
434
405
  * @returns A promise that resolves to the current state.
435
406
  */
436
- deinitializeButton(options: CheckoutButtonOptions_2): Promise<CheckoutButtonSelectors>;
407
+ deinitializeButton(options: CheckoutButtonOptions): Promise<CheckoutButtonSelectors>;
437
408
  }
438
409
 
439
410
  declare interface CheckoutButtonInitializerOptions {
@@ -467,16 +438,6 @@ declare enum CheckoutButtonMethodType {
467
438
  * The set of options for configuring the checkout button.
468
439
  */
469
440
  declare interface CheckoutButtonOptions extends RequestOptions {
470
- /**
471
- * The identifier of the payment method.
472
- */
473
- methodId: string;
474
- }
475
-
476
- /**
477
- * The set of options for configuring the checkout button.
478
- */
479
- declare interface CheckoutButtonOptions_2 extends RequestOptions_2 {
480
441
  /**
481
442
  * The identifier of the payment method.
482
443
  */
@@ -648,22 +609,6 @@ declare interface RequestOptions<TParams = {}> {
648
609
  params?: TParams;
649
610
  }
650
611
 
651
- /**
652
- * A set of options for configuring an asynchronous request.
653
- */
654
- declare interface RequestOptions_2<TParams = {}> {
655
- /**
656
- * Provide this option if you want to cancel or time out the request. If the
657
- * timeout object completes before the request, the request will be
658
- * cancelled.
659
- */
660
- timeout?: Timeout;
661
- /**
662
- * The parameters of the request, if required.
663
- */
664
- params?: TParams;
665
- }
666
-
667
612
  /**
668
613
  * This error type should not be constructed directly. It is a base class for
669
614
  * all custom errors thrown in this library.
@@ -700,10 +645,6 @@ declare enum StyleButtonShape {
700
645
  rect = "rect"
701
646
  }
702
647
 
703
- declare interface WithApplePayButtonInitializeOptions {
704
- applepay?: ApplePayButtonInitializeOptions;
705
- }
706
-
707
648
  /**
708
649
  * Creates an instance of `CheckoutButtonInitializer`.
709
650
  *