ggez-banking-sdk 0.0.5 → 0.0.8

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.
@@ -33,7 +33,7 @@ declare const Data: () => {
33
33
  phone: {
34
34
  id: number;
35
35
  type: number;
36
- country_code: number;
36
+ country_code: string;
37
37
  number: string;
38
38
  is_primary: number;
39
39
  verification_status: number;
@@ -140,7 +140,7 @@ declare const Data: () => {
140
140
  phone: {
141
141
  id: number;
142
142
  type: number;
143
- country_code: number;
143
+ country_code: string;
144
144
  number: string;
145
145
  is_primary: number;
146
146
  verification_status: number;
@@ -90,7 +90,7 @@ const Data = () => {
90
90
  {
91
91
  id: 0,
92
92
  type: 1,
93
- country_code: values.country,
93
+ country_code: values.mobileNumberCountry,
94
94
  number: values.mobileNumber,
95
95
  is_primary: 1,
96
96
  verification_status: 1,
@@ -139,10 +139,12 @@ const Data = () => {
139
139
  user_agent: client.getUserAgent(),
140
140
  },
141
141
  },
142
- ], custom_field: {
143
- referral_code: values.referralCode,
144
- type: values.referralCodeType,
145
- }, geo_coordinates: values.geoCoordinates });
142
+ ], custom_field: values.referralCode && values.referralCodeType
143
+ ? {
144
+ referral_code: values.referralCode,
145
+ type: values.referralCodeType,
146
+ }
147
+ : null, geo_coordinates: values.geoCoordinates });
146
148
  return data;
147
149
  };
148
150
  const dataSignUpWithGoogle = (values) => {
@@ -171,7 +173,7 @@ const Data = () => {
171
173
  {
172
174
  id: 0,
173
175
  type: 1,
174
- country_code: values.country,
176
+ country_code: values.mobileNumberCountry,
175
177
  number: values.mobileNumber,
176
178
  is_primary: 1,
177
179
  verification_status: 1,
@@ -225,10 +227,12 @@ const Data = () => {
225
227
  user_agent: client.getUserAgent(),
226
228
  },
227
229
  },
228
- ], custom_field: {
229
- referral_code: values.referralCode,
230
- type: values.referralCodeType,
231
- }, geo_coordinates: values.geoCoordinates, client_time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}` });
230
+ ], custom_field: values.referralCode && values.referralCodeType
231
+ ? {
232
+ referral_code: values.referralCode,
233
+ type: values.referralCodeType,
234
+ }
235
+ : null, geo_coordinates: values.geoCoordinates, client_time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}` });
232
236
  return data;
233
237
  };
234
238
  const dataDevice = () => {
@@ -20,6 +20,7 @@ export interface SignUpInterface {
20
20
  referralCode: string;
21
21
  referralCodeType: string;
22
22
  geoCoordinates?: IGeoCoordinates;
23
+ mobileNumberCountry: string;
23
24
  }
24
25
  export interface LoginRequestInterface {
25
26
  email: string;
@@ -55,6 +56,7 @@ export interface SignUpWithGoogleInterface {
55
56
  referralCode: string;
56
57
  referralCodeType: string;
57
58
  geoCoordinates?: IGeoCoordinates;
59
+ mobileNumberCountry: string;
58
60
  }
59
61
  export interface LoginWithGoogleInterface {
60
62
  token: string;
@@ -1 +1,2 @@
1
1
  export declare function getCountryName(code: number): string;
2
+ export declare function getCountryCodeByISO_A2(ISO_A2: string): number;
@@ -4,12 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getCountryName = getCountryName;
7
+ exports.getCountryCodeByISO_A2 = getCountryCodeByISO_A2;
7
8
  const countries_1 = __importDefault(require("../content/countries"));
8
9
  function getCountryName(code) {
9
10
  var _a;
10
11
  if (typeof code == "string") {
11
12
  code = Number(code);
12
13
  }
13
- const country = countries_1.default.filter((country) => country.Code === code)[0];
14
+ const country = countries_1.default.find((country) => {
15
+ if (country.Code === code) {
16
+ return country;
17
+ }
18
+ });
14
19
  return (_a = country === null || country === void 0 ? void 0 : country.Name) !== null && _a !== void 0 ? _a : "";
15
20
  }
21
+ function getCountryCodeByISO_A2(ISO_A2) {
22
+ var _a;
23
+ const country = countries_1.default.find((country) => {
24
+ if (country.ISO_A2 === ISO_A2) {
25
+ return country;
26
+ }
27
+ });
28
+ return (_a = country === null || country === void 0 ? void 0 : country.Code) !== null && _a !== void 0 ? _a : 0;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",