@alipay/ams-checkout 0.0.1730107332-dev.32 → 0.0.1730107332-dev.34

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 (41) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.js +18 -10
  3. package/esm/config/index.js +3 -3
  4. package/esm/core/component/ckp/index.js +3 -2
  5. package/esm/core/component/element/components/address.d.ts +19 -0
  6. package/esm/core/component/element/components/address.js +68 -0
  7. package/esm/core/component/element/components/auth.d.ts +17 -0
  8. package/esm/core/component/element/components/auth.js +60 -0
  9. package/esm/core/component/element/components/payment.d.ts +19 -0
  10. package/esm/core/component/element/components/payment.js +74 -0
  11. package/esm/core/component/element/index.d.ts +47 -0
  12. package/esm/core/component/element/index.js +816 -0
  13. package/esm/core/component/element/mock.d.ts +4 -0
  14. package/esm/core/component/element/mock.js +491 -0
  15. package/esm/core/component/element/type.d.ts +184 -0
  16. package/esm/core/component/element/type.js +35 -0
  17. package/esm/core/component/element/utils.d.ts +13 -0
  18. package/esm/core/component/element/utils.js +6 -0
  19. package/esm/foundation/core/index.d.ts +1 -1
  20. package/esm/foundation/core/index.js +5 -5
  21. package/esm/foundation/index.d.ts +1 -0
  22. package/esm/foundation/service/container/index.js +1 -0
  23. package/esm/foundation/service/event-center.d.ts +2 -0
  24. package/esm/foundation/service/event-center.js +36 -2
  25. package/esm/foundation/service/security/index.js +20 -4
  26. package/esm/index.d.ts +5 -1
  27. package/esm/index.js +16 -1
  28. package/esm/plugin/component/cashierApp.d.ts +3 -1
  29. package/esm/plugin/component/cashierApp.js +12 -5
  30. package/esm/plugin/component/channel.d.ts +2 -2
  31. package/esm/plugin/component/component.inline.style.d.ts +1 -1
  32. package/esm/plugin/component/component.inline.style.js +6 -4
  33. package/esm/plugin/component/index.d.ts +1 -0
  34. package/esm/plugin/component/index.js +106 -55
  35. package/esm/service/element.d.ts +4 -0
  36. package/esm/service/element.js +51 -0
  37. package/esm/service/index.d.ts +1 -0
  38. package/esm/service/index.js +2 -0
  39. package/esm/types/index.d.ts +194 -17
  40. package/esm/types/index.js +44 -4
  41. package/package.json +2 -1
@@ -5,6 +5,7 @@
5
5
  * 1. 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; and
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
+ export * from '../core/component/element/type';
8
9
  export type onChange = () => onCnageResult;
9
10
  interface onCnageResult {
10
11
  complete: boolean;
@@ -100,6 +101,10 @@ export interface DeviceIdParameter {
100
101
  export interface IcreateComponent {
101
102
  sessionData: string;
102
103
  paymentSessionData?: string;
104
+ debugProps?: {
105
+ localLink: string;
106
+ };
107
+ appendAliasContainerId?: boolean;
103
108
  notRedirectAfterComplete?: boolean;
104
109
  appearance?: {
105
110
  [x: string]: any;
@@ -658,24 +663,197 @@ export type IAppendParams = {
658
663
  componentSign: ComponentSignEnum;
659
664
  iframeNodesParams: IappendIframeNodesParams;
660
665
  };
661
- export declare enum EventCallbackCode {
662
- Failed = "Failed",
663
- Completed = "Completed"
666
+ export declare enum AccountStatusEnum {
667
+ EFFECTIVE = "EFFECTIVE",
668
+ UNREGISTERED = "UNREGISTERED"
669
+ }
670
+ export type IAccountInfo = {
671
+ email?: string;
672
+ verifyId?: string;
673
+ accountStatus?: AccountStatusEnum;
674
+ oneAccountId?: string;
675
+ needOtp?: boolean;
676
+ errorMsg?: string;
677
+ inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
678
+ resendLeftTimes?: number;
679
+ };
680
+ export interface AccountQueryRequest {
681
+ paymentSessionData: string;
682
+ paymentSessionConfig: any;
683
+ accountInfo: IAccountInfo;
664
684
  }
665
- export interface IElementOptions {
666
- sessionData: string;
667
- environment?: string;
668
- locale?: string;
669
- mode?: string;
670
- onEventCallback?: ({ code, message }: {
671
- code: EventCallbackCode;
672
- message: string;
673
- }) => void;
674
- loading?: {
675
- showLoading: boolean;
676
- onStartLoading?: () => void;
677
- onEndLoading?: () => void;
685
+ export interface ShippingsItem {
686
+ shippingName: {
687
+ firstName: string;
688
+ lastName: string;
689
+ };
690
+ prefer: '1' | '0';
691
+ shippingId: string;
692
+ shippingPhoneNo: string;
693
+ shippingAddress: {
694
+ region: string;
695
+ state: string;
696
+ city: string;
697
+ address1: string;
698
+ address2: string;
699
+ zipCode: string;
700
+ };
701
+ }
702
+ export interface ISubPaymentElementView {
703
+ defaultText: string;
704
+ defaultValue: string;
705
+ elementMandatory: boolean;
706
+ elementRegx?: string;
707
+ elementType: string;
708
+ extendInfo: string;
709
+ paramIllegalText: string;
710
+ paymentElementKey: string;
711
+ title: string;
712
+ validateFunction?: string;
713
+ isPart?: boolean;
714
+ isPartEnd?: boolean;
715
+ }
716
+ export interface IPaymentElement {
717
+ defaultValue: string;
718
+ elementMandatory: boolean;
719
+ elementType: string;
720
+ extendInfo: string;
721
+ paymentElementKey: string;
722
+ subPaymentElementView: ISubPaymentElementView[];
723
+ title: string;
724
+ }
725
+ export declare enum InterActionTypeEnum {
726
+ COLLECT_REDIRECT = "COLLECT_REDIRECT",
727
+ SHOW_CODE = "SHOW_CODE",
728
+ COLLECT_SHOW_CODE = "COLLECT_SHOW_CODE",
729
+ REDIRECT = "REDIRECT"
730
+ }
731
+ export interface IAmount {
732
+ amount?: string;
733
+ currency: string;
734
+ currencyLabel: string;
735
+ formattedAmount?: string;
736
+ formattedAmountWithCurrency?: string;
737
+ value: string;
738
+ }
739
+ export interface IAmountView {
740
+ currency: string;
741
+ currencyDivider: string;
742
+ currencyLabel: string;
743
+ currencySymbolPosition: 'L' | 'R';
744
+ formattedValue: string;
745
+ value: string;
746
+ }
747
+ export interface IPaymentMethod {
748
+ paymentMethodKey?: string;
749
+ antomPage?: string;
750
+ redirectUrl?: string;
751
+ icon?: string;
752
+ iconName?: string;
753
+ logoList?: Array<{
754
+ cardBrand: string;
755
+ logoUrl: string;
756
+ }>;
757
+ paymentMethod?: string;
758
+ paymentMethodName: string;
759
+ paymentMethodType: string;
760
+ category?: string;
761
+ paymentElements?: IPaymentElement[];
762
+ paymentMethodId?: string;
763
+ paymentMethodDetail?: {
764
+ last4?: string;
765
+ requireIssuerAuthentication?: string;
678
766
  };
767
+ interActionType?: InterActionTypeEnum;
768
+ recommend?: boolean;
769
+ expressCheckout?: boolean;
770
+ webRedirectType?: string;
771
+ paymentCurrencyList?: string[];
772
+ paymentAmount?: IAmount;
773
+ paymentAmountView?: IAmountView;
774
+ paymentQuoteId?: string;
775
+ }
776
+ interface Estimate {
777
+ unit: string;
778
+ value: number;
779
+ }
780
+ interface DeliveryEstimate {
781
+ maximum: Estimate;
782
+ minimum: Estimate;
783
+ }
784
+ interface FixedAmount {
785
+ amount: number;
786
+ currency: string;
787
+ }
788
+ interface ShippingRateData {
789
+ displayName: string;
790
+ deliveryEstimate: DeliveryEstimate;
791
+ fixedAmount: FixedAmount;
792
+ }
793
+ export interface ShippingAddress {
794
+ address1: string;
795
+ address2: string;
796
+ city: string;
797
+ region: string;
798
+ state: string;
799
+ zipCode: string;
800
+ }
801
+ export interface IUserName {
802
+ firstName: string;
803
+ middleName?: string;
804
+ lastName: string;
805
+ fullName?: string;
806
+ }
807
+ export type Shippings = ShippingsItem[];
808
+ export type IPaymentMethods = IPaymentMethod[];
809
+ export interface CKPShipping {
810
+ shippingRateId?: string;
811
+ shippingRateData?: ShippingRateData;
812
+ shippingAddress: ShippingAddress;
813
+ shippingFee?: IAmount;
814
+ shippingFeeView?: IAmountView;
815
+ shippingDescription?: string;
816
+ deliveryEstimate?: DeliveryEstimate;
817
+ shippingFeeId?: string;
818
+ shippingName?: IUserName;
819
+ shippingPhoneNo?: string;
820
+ shipToEmail?: string;
821
+ notes?: string;
822
+ }
823
+ export interface AccountQueryResult {
824
+ accountInfo: IAccountInfo;
825
+ actionForm?: ActionForm;
826
+ paymentMethods: IPaymentMethods;
827
+ shippings: Shippings;
828
+ success: boolean;
829
+ errorCode?: string;
830
+ errorMessage?: string;
831
+ errorStatus?: string;
832
+ shippingInfo?: CKPShipping;
833
+ }
834
+ export declare enum ElementPaymentMethod {
835
+ CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
836
+ AUTH_ELEMENT = "AUTH_ELEMENT",
837
+ ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
838
+ PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
839
+ }
840
+ export declare enum ElementPaymentEvent {
841
+ INITIAL_DATA_READY = "initialDataReady",
842
+ CAPTURE_ASSET = "onCaptureAsset",
843
+ SIGN_OUT = "onSignout",
844
+ BLUR = "onBlur",
845
+ VALIDATE = "validate",
846
+ SUBMIT_RISK = "onSubmitRisk",
847
+ AFTER_SUBMIT = "onAfterSubmit",
848
+ SIZE_CHANGE = "onSizeChange",
849
+ LAUNCH = "onLaunch",
850
+ CALLBACK = "callback",
851
+ LOG = "log"
852
+ }
853
+ export declare enum ConnectErrorCode {
854
+ RISK_REJECT = "RISK_REJECT",
855
+ USER_AUTH_VERIFICATION_FAILED = "USER_AUTH_VERIFICATION_FAILED",
856
+ USER_NOT_EXISTS = "USER_NOT_EXISTS"
679
857
  }
680
858
  export interface IoptionsAddressParams {
681
859
  environment?: string;
@@ -687,4 +865,3 @@ export interface IoptionsAddressParams {
687
865
  };
688
866
  product?: string;
689
867
  }
690
- export {};
@@ -6,6 +6,7 @@
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
8
  /* eslint-disable @typescript-eslint/no-explicit-any */
9
+ export * from "../core/component/element/type";
9
10
 
10
11
  /**
11
12
  * SDK options
@@ -209,8 +210,47 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
209
210
  ProductSceneVersion["V2"] = "2.0";
210
211
  return ProductSceneVersion;
211
212
  }({});
212
- export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
213
- EventCallbackCode["Failed"] = "Failed";
214
- EventCallbackCode["Completed"] = "Completed";
215
- return EventCallbackCode;
213
+ export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
214
+ AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
215
+ AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
216
+ return AccountStatusEnum;
217
+ }({});
218
+
219
+ // element 接口start
220
+
221
+ export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
222
+ InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
223
+ InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
224
+ InterActionTypeEnum["COLLECT_SHOW_CODE"] = "COLLECT_SHOW_CODE";
225
+ InterActionTypeEnum["REDIRECT"] = "REDIRECT";
226
+ return InterActionTypeEnum;
227
+ }({});
228
+ // element 接口end
229
+
230
+ export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
231
+ ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
232
+ ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
233
+ ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
234
+ ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
235
+ return ElementPaymentMethod;
236
+ }({});
237
+ export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
238
+ ElementPaymentEvent["INITIAL_DATA_READY"] = "initialDataReady";
239
+ ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
240
+ ElementPaymentEvent["SIGN_OUT"] = "onSignout";
241
+ ElementPaymentEvent["BLUR"] = "onBlur";
242
+ ElementPaymentEvent["VALIDATE"] = "validate";
243
+ ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
244
+ ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
245
+ ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
246
+ ElementPaymentEvent["LAUNCH"] = "onLaunch";
247
+ ElementPaymentEvent["CALLBACK"] = "callback";
248
+ ElementPaymentEvent["LOG"] = "log";
249
+ return ElementPaymentEvent;
250
+ }({});
251
+ export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
252
+ ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
253
+ ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
254
+ ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
255
+ return ConnectErrorCode;
216
256
  }({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1730107332-dev.32",
3
+ "version": "0.0.1730107332-dev.34",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -15,6 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "father build",
18
+ "build:w": "father dev",
18
19
  "dev": "father dev",
19
20
  "ci": "npm run lint",
20
21
  "cov": "jest --coverage",