@fill-easy/api 1.0.20 → 1.0.22

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/README.md CHANGED
@@ -1,31 +1,31 @@
1
- # Fill Easy API SDK
2
-
3
- Fill Easy Services API using https://openapi-ts.dev/
4
-
5
- Read full docs here: https://docs.fill-easy.com
6
-
7
- ## Usage
8
-
9
- ```typescript
10
- import { createApiClient } from "@fill-easy/api"
11
-
12
- const client = createApiClient({
13
- baseUrl: "https://sandbox.staging-api.fill-easy.com",
14
- clientId: "...",
15
- clientSecret: "...",
16
- })
17
-
18
- // Fully typed API calls
19
- const { data, error } = await client.POST("/iamsmart/v2/request/auth", {
20
- body: {
21
- redirect: "https://example.com/callback",
22
- source: "Android_Chrome",
23
- },
24
- })
25
-
26
- if (error) {
27
- console.error(error)
28
- } else {
29
- console.log(data)
30
- }
31
- ```
1
+ # Fill Easy API SDK
2
+
3
+ Fill Easy Services API using https://openapi-ts.dev/
4
+
5
+ Read full docs here: https://docs.fill-easy.com
6
+
7
+ ## Usage
8
+
9
+ ```typescript
10
+ import { createApiClient } from "@fill-easy/api"
11
+
12
+ const client = createApiClient({
13
+ baseUrl: "https://sandbox.staging-api.fill-easy.com",
14
+ clientId: "...",
15
+ clientSecret: "...",
16
+ })
17
+
18
+ // Fully typed API calls
19
+ const { data, error } = await client.POST("/iamsmart/v2/request/auth", {
20
+ body: {
21
+ redirect: "https://example.com/callback",
22
+ source: "Android_Chrome",
23
+ },
24
+ })
25
+
26
+ if (error) {
27
+ console.error(error)
28
+ } else {
29
+ console.log(data)
30
+ }
31
+ ```
package/dist/openapi.d.ts CHANGED
@@ -726,6 +726,147 @@ export interface paths {
726
726
  patch?: never;
727
727
  trace?: never;
728
728
  };
729
+ "/kyc/cn/identity": {
730
+ parameters: {
731
+ query?: never;
732
+ header?: never;
733
+ path?: never;
734
+ cookie?: never;
735
+ };
736
+ get?: never;
737
+ put?: never;
738
+ /**
739
+ * Verify Chinese Citizen Identity
740
+ * @description Verify a Chinese citizen's identity by checking their name and ID number against government records.
741
+ *
742
+ * Choose a verification type based on your requirements:
743
+ * - **two-factor**: Basic verification using name and ID number
744
+ * - **four-factor**: Enhanced verification including ID card validity dates
745
+ * - **image**: Biometric verification with facial photo comparison
746
+ */
747
+ post: operations["kycCnIdentity"];
748
+ delete?: never;
749
+ options?: never;
750
+ head?: never;
751
+ patch?: never;
752
+ trace?: never;
753
+ };
754
+ "/kyc/cn/location": {
755
+ parameters: {
756
+ query?: never;
757
+ header?: never;
758
+ path?: never;
759
+ cookie?: never;
760
+ };
761
+ get?: never;
762
+ put?: never;
763
+ /**
764
+ * Verify Location by Mobile Number
765
+ * @description Verify a person's location or query their city based on mobile phone activity data.
766
+ *
767
+ * **Operations:**
768
+ * - **verify**: Check the distance between a mobile user's location and a specified address
769
+ * - **query**: Retrieve the city where the mobile user has been active (work or residential only)
770
+ *
771
+ * **Location Types:**
772
+ * - `1`: Common location — area with highest mobile activity (verify only)
773
+ * - `2`: Work location — activity during 7:00-19:00 on weekdays (verify and query)
774
+ * - `3`: Residential location — activity during 21:00-07:00 (verify and query)
775
+ */
776
+ post: operations["kycCnLocation"];
777
+ delete?: never;
778
+ options?: never;
779
+ head?: never;
780
+ patch?: never;
781
+ trace?: never;
782
+ };
783
+ "/kyc/cn/operator": {
784
+ parameters: {
785
+ query?: never;
786
+ header?: never;
787
+ path?: never;
788
+ cookie?: never;
789
+ };
790
+ get?: never;
791
+ put?: never;
792
+ /**
793
+ * Verify Mobile Operator Registration
794
+ * @description Verify mobile phone number registration details or check if the number is registered to a specific person.
795
+ *
796
+ * **Verification Types:**
797
+ * - **attribution**: Get the carrier, province, and city for a mobile number
798
+ * - **name-check**: Verify if the mobile number is registered to a specific name
799
+ * - **id-check**: Verify if the mobile number is registered to a specific ID number
800
+ * - **three-factor**: Verify if mobile, name, and ID number all match the same person
801
+ */
802
+ post: operations["kycCnOperator"];
803
+ delete?: never;
804
+ options?: never;
805
+ head?: never;
806
+ patch?: never;
807
+ trace?: never;
808
+ };
809
+ "/kyc/cn/anti-fraud": {
810
+ parameters: {
811
+ query?: never;
812
+ header?: never;
813
+ path?: never;
814
+ cookie?: never;
815
+ };
816
+ get?: never;
817
+ put?: never;
818
+ /**
819
+ * Anti-Fraud Risk Assessment
820
+ * @description Assess fraud and gambling risk based on mobile number or ID number.
821
+ *
822
+ * **Risk Levels:**
823
+ * - `0`: No risk detected
824
+ * - `1`: Low risk
825
+ * - `2`: Medium risk
826
+ * - `3`: High risk
827
+ *
828
+ * **Risk Types:**
829
+ * - `1`: Fraud
830
+ * - `2`: Gambling House (Dealer)
831
+ * - `4`: Gambling Player
832
+ * - `8`: Suspected gambling/fraud runner (money mule)
833
+ */
834
+ post: operations["kycCnAntiFraud"];
835
+ delete?: never;
836
+ options?: never;
837
+ head?: never;
838
+ patch?: never;
839
+ trace?: never;
840
+ };
841
+ "/kyc/cn/police": {
842
+ parameters: {
843
+ query?: never;
844
+ header?: never;
845
+ path?: never;
846
+ cookie?: never;
847
+ };
848
+ get?: never;
849
+ put?: never;
850
+ /**
851
+ * Police Blacklist Check
852
+ * @description Check if a person is on the public security blacklist and retrieve detailed police records.
853
+ *
854
+ * Returns information about:
855
+ * - Criminal offenses
856
+ * - Civil cases
857
+ * - Drug-related records
858
+ * - Fugitive status
859
+ * - Monitoring status
860
+ * - Terrorism-related records
861
+ * - Public order concerns
862
+ */
863
+ post: operations["kycCnPolice"];
864
+ delete?: never;
865
+ options?: never;
866
+ head?: never;
867
+ patch?: never;
868
+ trace?: never;
869
+ };
729
870
  "/cra/request": {
730
871
  parameters: {
731
872
  query?: never;
@@ -2513,6 +2654,511 @@ export interface operations {
2513
2654
  };
2514
2655
  };
2515
2656
  };
2657
+ kycCnIdentity: {
2658
+ parameters: {
2659
+ query?: never;
2660
+ header?: never;
2661
+ path?: never;
2662
+ cookie?: never;
2663
+ };
2664
+ requestBody: {
2665
+ content: {
2666
+ "application/json": {
2667
+ /**
2668
+ * @description The verification method to use:
2669
+ * - `two-factor`: Verify name matches ID number
2670
+ * - `four-factor`: Verify name, ID number, and ID card validity dates
2671
+ * - `image`: Verify name, ID number, and compare facial photo
2672
+ * @example two-factor
2673
+ * @enum {string}
2674
+ */
2675
+ type: "two-factor" | "four-factor" | "image";
2676
+ /**
2677
+ * @description Full legal name as it appears on the ID card (Chinese characters)
2678
+ * @example 李明
2679
+ */
2680
+ name: string;
2681
+ /**
2682
+ * @description 18-digit Chinese Resident Identity Card number
2683
+ * @example 110101199003076515
2684
+ */
2685
+ idNo: string;
2686
+ /**
2687
+ * @description ID card issue date in YYYYMMDD format.
2688
+ * **Required** when `type` is `four-factor`.
2689
+ * @example 20200315
2690
+ */
2691
+ frDate?: string;
2692
+ /**
2693
+ * @description ID card expiry date in YYYYMMDD format, or "长期" for permanent validity.
2694
+ * **Required** when `type` is `four-factor`.
2695
+ * @example 20400315
2696
+ */
2697
+ toDate?: string;
2698
+ /**
2699
+ * @description Base64-encoded facial photograph for biometric comparison.
2700
+ * **Required** when `type` is `image`.
2701
+ * Supported formats: JPEG, PNG. Recommended size: 300x400 pixels minimum.
2702
+ */
2703
+ img?: string;
2704
+ };
2705
+ };
2706
+ };
2707
+ responses: {
2708
+ /** @description Identity verification completed */
2709
+ 200: {
2710
+ headers: {
2711
+ [name: string]: unknown;
2712
+ };
2713
+ content: {
2714
+ "application/json": {
2715
+ /**
2716
+ * @description Whether the verification request was processed successfully
2717
+ * @example true
2718
+ */
2719
+ success: boolean;
2720
+ /**
2721
+ * @description Whether the provided information matches government records.
2722
+ * - `true`: Information matches
2723
+ * - `false`: Information does not match
2724
+ * - `null`: Unable to verify (no records found)
2725
+ * @example true
2726
+ */
2727
+ consistent?: boolean | null;
2728
+ /**
2729
+ * @description Raw verification result code ("1" = match, "-1" = no match)
2730
+ * @example 1
2731
+ */
2732
+ checkResult?: string;
2733
+ /**
2734
+ * @description Human-readable description of the verification result
2735
+ * @example Identity information matches
2736
+ */
2737
+ message: string;
2738
+ };
2739
+ };
2740
+ };
2741
+ /** @description Invalid request parameters */
2742
+ 400: {
2743
+ headers: {
2744
+ [name: string]: unknown;
2745
+ };
2746
+ content?: never;
2747
+ };
2748
+ /** @description Upstream verification service error */
2749
+ 502: {
2750
+ headers: {
2751
+ [name: string]: unknown;
2752
+ };
2753
+ content?: never;
2754
+ };
2755
+ };
2756
+ };
2757
+ kycCnLocation: {
2758
+ parameters: {
2759
+ query?: never;
2760
+ header?: never;
2761
+ path?: never;
2762
+ cookie?: never;
2763
+ };
2764
+ requestBody: {
2765
+ content: {
2766
+ "application/json": {
2767
+ /**
2768
+ * @description Operation type:
2769
+ * - `verify`: Check distance between mobile location and a specified address
2770
+ * - `query`: Get the city where the user is located
2771
+ * @example verify
2772
+ * @enum {string}
2773
+ */
2774
+ operation: "verify" | "query";
2775
+ /**
2776
+ * @description 11-digit Chinese mobile phone number
2777
+ * @example 13912345678
2778
+ */
2779
+ mobile: string;
2780
+ /**
2781
+ * @description Location category to check:
2782
+ * - `1`: Common location (highest activity) - **verify only**
2783
+ * - `2`: Work location (7:00-19:00 weekdays) - verify and query
2784
+ * - `3`: Residential location (21:00-07:00) - verify and query
2785
+ *
2786
+ * **Note:** Query operation only accepts types 2 or 3.
2787
+ * @example 2
2788
+ * @enum {string}
2789
+ */
2790
+ locationType: "1" | "2" | "3";
2791
+ /**
2792
+ * @description City name in Chinese. **Required** when `operation` is `verify`.
2793
+ * @example 北京
2794
+ */
2795
+ city?: string;
2796
+ /**
2797
+ * @description Full street address in Chinese. **Required** when `operation` is `verify`.
2798
+ * @example 朝阳区建国路88号
2799
+ */
2800
+ address?: string;
2801
+ };
2802
+ };
2803
+ };
2804
+ responses: {
2805
+ /** @description Location verification completed */
2806
+ 200: {
2807
+ headers: {
2808
+ [name: string]: unknown;
2809
+ };
2810
+ content: {
2811
+ "application/json": {
2812
+ /**
2813
+ * @description Whether the verification was processed successfully
2814
+ * @example true
2815
+ */
2816
+ success: boolean;
2817
+ /**
2818
+ * @description The location category that was checked
2819
+ * @example 2
2820
+ */
2821
+ locationType?: string;
2822
+ /**
2823
+ * @description Human-readable description of the location category
2824
+ * @example Work location (7:00-19:00 weekdays)
2825
+ */
2826
+ locationTypeDescription?: string;
2827
+ /**
2828
+ * @description Distance range between mobile location and address:
2829
+ * - `1`: ≤3km
2830
+ * - `2`: ≤5km
2831
+ * - `3`: ≤10km
2832
+ * - `4`: ≤20km
2833
+ * - `5`: ≤30km
2834
+ * - `6`: ≤50km
2835
+ * - `7`: >50km
2836
+ * @example 1
2837
+ * @enum {string}
2838
+ */
2839
+ distanceSegment?: "1" | "2" | "3" | "4" | "5" | "6" | "7";
2840
+ /**
2841
+ * @description Human-readable distance range
2842
+ * @example ≤3km
2843
+ */
2844
+ distanceDescription?: string;
2845
+ /** @example Distance between Work location and provided address is ≤3km */
2846
+ message: string;
2847
+ } | {
2848
+ /** @example true */
2849
+ success: boolean;
2850
+ /**
2851
+ * @description The location category ("work" or "residential")
2852
+ * @example work
2853
+ */
2854
+ locationType?: string;
2855
+ /**
2856
+ * @description The city where the user has been active
2857
+ * @example 北京
2858
+ */
2859
+ city?: string;
2860
+ /** @example Recent 3 months work location: 北京 */
2861
+ message: string;
2862
+ };
2863
+ };
2864
+ };
2865
+ /** @description Invalid request parameters */
2866
+ 400: {
2867
+ headers: {
2868
+ [name: string]: unknown;
2869
+ };
2870
+ content?: never;
2871
+ };
2872
+ /** @description Upstream verification service error */
2873
+ 502: {
2874
+ headers: {
2875
+ [name: string]: unknown;
2876
+ };
2877
+ content?: never;
2878
+ };
2879
+ };
2880
+ };
2881
+ kycCnOperator: {
2882
+ parameters: {
2883
+ query?: never;
2884
+ header?: never;
2885
+ path?: never;
2886
+ cookie?: never;
2887
+ };
2888
+ requestBody: {
2889
+ content: {
2890
+ "application/json": {
2891
+ /**
2892
+ * @description Verification type:
2893
+ * - `attribution`: Look up carrier and location info
2894
+ * - `name-check`: Verify mobile is registered to this name
2895
+ * - `id-check`: Verify mobile is registered to this ID number
2896
+ * - `three-factor`: Verify mobile, name, and ID all match
2897
+ * @example three-factor
2898
+ * @enum {string}
2899
+ */
2900
+ type: "attribution" | "name-check" | "id-check" | "three-factor";
2901
+ /**
2902
+ * @description 11-digit Chinese mobile phone number
2903
+ * @example 13912345678
2904
+ */
2905
+ mobile: string;
2906
+ /**
2907
+ * @description Full legal name in Chinese characters.
2908
+ * **Required** when `type` is `name-check` or `three-factor`.
2909
+ * @example 李明
2910
+ */
2911
+ name?: string;
2912
+ /**
2913
+ * @description 18-digit Chinese Resident Identity Card number.
2914
+ * **Required** when `type` is `id-check` or `three-factor`.
2915
+ * @example 110101199003076515
2916
+ */
2917
+ idNo?: string;
2918
+ };
2919
+ };
2920
+ };
2921
+ responses: {
2922
+ /** @description Operator verification completed */
2923
+ 200: {
2924
+ headers: {
2925
+ [name: string]: unknown;
2926
+ };
2927
+ content: {
2928
+ "application/json": {
2929
+ /** @example true */
2930
+ success: boolean;
2931
+ /**
2932
+ * @description Province where the mobile number is registered
2933
+ * @example 北京
2934
+ */
2935
+ province?: string;
2936
+ /**
2937
+ * @description City where the mobile number is registered
2938
+ * @example 北京
2939
+ */
2940
+ city?: string;
2941
+ /**
2942
+ * @description Mobile carrier name
2943
+ * @example 中国移动
2944
+ */
2945
+ operator?: string;
2946
+ /** @example Mobile number belongs to 中国移动 in 北京, 北京 */
2947
+ message: string;
2948
+ } | {
2949
+ /** @example true */
2950
+ success: boolean;
2951
+ /**
2952
+ * @description Whether the mobile registration matches the provided information.
2953
+ * - `true`: Information matches
2954
+ * - `false`: Information does not match
2955
+ * - `null`: Unable to verify
2956
+ * @example true
2957
+ */
2958
+ consistent?: boolean | null;
2959
+ /**
2960
+ * @description Raw verification result ("1" = match, "-1" = no match)
2961
+ * @example 1
2962
+ */
2963
+ checkResult?: string;
2964
+ /** @example Mobile number, name, and ID number all match */
2965
+ message: string;
2966
+ };
2967
+ };
2968
+ };
2969
+ /** @description Invalid request parameters */
2970
+ 400: {
2971
+ headers: {
2972
+ [name: string]: unknown;
2973
+ };
2974
+ content?: never;
2975
+ };
2976
+ /** @description Upstream verification service error */
2977
+ 502: {
2978
+ headers: {
2979
+ [name: string]: unknown;
2980
+ };
2981
+ content?: never;
2982
+ };
2983
+ };
2984
+ };
2985
+ kycCnAntiFraud: {
2986
+ parameters: {
2987
+ query?: never;
2988
+ header?: never;
2989
+ path?: never;
2990
+ cookie?: never;
2991
+ };
2992
+ requestBody: {
2993
+ content: {
2994
+ "application/json": {
2995
+ /**
2996
+ * @description 11-digit Chinese mobile phone number
2997
+ * @example 13912345678
2998
+ */
2999
+ mobile?: string;
3000
+ /**
3001
+ * @description 18-digit Chinese Resident Identity Card number
3002
+ * @example 110101199003076515
3003
+ */
3004
+ idNo?: string;
3005
+ } & (unknown | unknown);
3006
+ };
3007
+ };
3008
+ responses: {
3009
+ /** @description Anti-fraud check completed */
3010
+ 200: {
3011
+ headers: {
3012
+ [name: string]: unknown;
3013
+ };
3014
+ content: {
3015
+ "application/json": {
3016
+ /** @example true */
3017
+ success: boolean;
3018
+ /** @description List of detected risk items */
3019
+ risks: {
3020
+ /**
3021
+ * @description Risk category:
3022
+ * - `1`: Fraud
3023
+ * - `2`: Gambling House (Dealer)
3024
+ * - `4`: Gambling Player
3025
+ * - `8`: Suspected gambling/fraud runner (money mule)
3026
+ */
3027
+ riskType?: string;
3028
+ /** @description Risk level (0=None, 1=Low, 2=Medium, 3=High) */
3029
+ riskLevel?: string;
3030
+ }[];
3031
+ /** @example Anti-fraud check completed */
3032
+ message: string;
3033
+ };
3034
+ };
3035
+ };
3036
+ /** @description Invalid request parameters */
3037
+ 400: {
3038
+ headers: {
3039
+ [name: string]: unknown;
3040
+ };
3041
+ content?: never;
3042
+ };
3043
+ /** @description Upstream verification service error */
3044
+ 502: {
3045
+ headers: {
3046
+ [name: string]: unknown;
3047
+ };
3048
+ content?: never;
3049
+ };
3050
+ };
3051
+ };
3052
+ kycCnPolice: {
3053
+ parameters: {
3054
+ query?: never;
3055
+ header?: never;
3056
+ path?: never;
3057
+ cookie?: never;
3058
+ };
3059
+ requestBody: {
3060
+ content: {
3061
+ "application/json": {
3062
+ /**
3063
+ * @description Full legal name in Chinese characters
3064
+ * @example 李明
3065
+ */
3066
+ name: string;
3067
+ /**
3068
+ * @description 18-digit Chinese Resident Identity Card number
3069
+ * @example 110101199003076515
3070
+ */
3071
+ idNo: string;
3072
+ };
3073
+ };
3074
+ };
3075
+ responses: {
3076
+ /** @description Police check completed */
3077
+ 200: {
3078
+ headers: {
3079
+ [name: string]: unknown;
3080
+ };
3081
+ content: {
3082
+ "application/json": {
3083
+ /** @example true */
3084
+ success: boolean;
3085
+ /**
3086
+ * @description Whether the person is a normal citizen with no risk records.
3087
+ * - `true`: Normal person, no risk events
3088
+ * - `false`: Has risk events on record
3089
+ * - `null`: Unable to verify
3090
+ * @example true
3091
+ */
3092
+ isNormal?: boolean | null;
3093
+ /** @description Detailed breakdown of police records */
3094
+ policeRecords?: {
3095
+ /**
3096
+ * @description "1" = normal person, "0" = has risk events
3097
+ * @example 1
3098
+ */
3099
+ isNormal?: string;
3100
+ /**
3101
+ * @description "1" = criminal offender, "0" = no
3102
+ * @example 0
3103
+ */
3104
+ isCriminal?: string;
3105
+ /**
3106
+ * @description "1" = involved in civil case, "0" = no
3107
+ * @example 0
3108
+ */
3109
+ IsCivilCase?: string;
3110
+ /**
3111
+ * @description "1" = drug related, "0" = no
3112
+ * @example 0
3113
+ */
3114
+ IsDrugRela?: string;
3115
+ /**
3116
+ * @description "1" = drug user, "0" = no
3117
+ * @example 0
3118
+ */
3119
+ IsDrug?: string;
3120
+ /**
3121
+ * @description "1" = fugitive, "0" = no
3122
+ * @example 0
3123
+ */
3124
+ IsEscaped?: string;
3125
+ /**
3126
+ * @description "1" = key monitored person, "0" = no
3127
+ * @example 0
3128
+ */
3129
+ isMonitor?: string;
3130
+ /**
3131
+ * @description "1" = terrorist related, "0" = no
3132
+ * @example 0
3133
+ */
3134
+ isTerrorist?: string;
3135
+ /**
3136
+ * @description "1" = stability related (public order), "0" = no
3137
+ * @example 0
3138
+ */
3139
+ isStability?: string;
3140
+ } | null;
3141
+ /** @example No police records found */
3142
+ message: string;
3143
+ };
3144
+ };
3145
+ };
3146
+ /** @description Invalid request parameters */
3147
+ 400: {
3148
+ headers: {
3149
+ [name: string]: unknown;
3150
+ };
3151
+ content?: never;
3152
+ };
3153
+ /** @description Upstream verification service error */
3154
+ 502: {
3155
+ headers: {
3156
+ [name: string]: unknown;
3157
+ };
3158
+ content?: never;
3159
+ };
3160
+ };
3161
+ };
2516
3162
  craRequest: {
2517
3163
  parameters: {
2518
3164
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fill-easy/api",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for Fill Easy API",
6
6
  "main": "dist/index.js",