ggez-banking-sdk 0.5.35 → 0.5.37

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.
@@ -64,13 +64,20 @@ class BaseService {
64
64
  };
65
65
  }
66
66
  buildFlagHeaders(flags) {
67
+ if (!flags)
68
+ return {};
67
69
  const headers = {};
68
- if (flags?.showSensitiveData)
69
- headers[HeaderKeys.ShowSensitiveData] = "1";
70
- if (flags?.showCustomField)
71
- headers[HeaderKeys.ShowCustomField] = "1";
72
- if (flags?.showTicket)
73
- headers[HeaderKeys.ShowTicket] = "1";
70
+ const headerMap = {
71
+ showSensitiveData: HeaderKeys.ShowSensitiveData,
72
+ showCustomField: HeaderKeys.ShowCustomField,
73
+ showTicket: HeaderKeys.ShowTicket,
74
+ checkPhoneVerification: HeaderKeys.CheckPhoneVerification,
75
+ };
76
+ for (const [flag, header] of Object.entries(headerMap)) {
77
+ if (flags[flag]) {
78
+ headers[header] = "1";
79
+ }
80
+ }
74
81
  return headers;
75
82
  }
76
83
  }
@@ -104,7 +104,9 @@ class UserService extends BaseService {
104
104
  }
105
105
  async createPhone(payload) {
106
106
  const url = this.resolveURL(`${UserEndpoints.Phone}/${await this.userId()}`);
107
- return this.POST(url, payload);
107
+ return this.POST(url, payload, {
108
+ flags: { checkPhoneVerification: true },
109
+ });
108
110
  }
109
111
  async createDevice(payload) {
110
112
  const url = this.resolveURL(`${UserEndpoints.Device}/${await this.userId()}`);
@@ -111,6 +111,7 @@ declare const HeaderKeys: {
111
111
  readonly ShowTicket: "show_ticket";
112
112
  readonly GenerateJwt: "generate_jwt";
113
113
  readonly AllowControlAllowCredentials: "Allow-Control-Allow-Credentials";
114
+ readonly CheckPhoneVerification: "check_phone_verification";
114
115
  };
115
116
  declare const HTTPMethod: {
116
117
  readonly GET: "GET";
@@ -114,6 +114,7 @@ const HeaderKeys = {
114
114
  ShowTicket: "show_ticket",
115
115
  GenerateJwt: "generate_jwt",
116
116
  AllowControlAllowCredentials: "Allow-Control-Allow-Credentials",
117
+ CheckPhoneVerification: "check_phone_verification",
117
118
  };
118
119
  const HTTPMethod = {
119
120
  GET: "GET",
@@ -51,3 +51,4 @@ export type * from "./virtualCardsContent";
51
51
  export type * from "./withdraw";
52
52
  export type * from "./withdrawMonthlyYearly";
53
53
  export type * from "./supportedCountriesExtended";
54
+ export type * from "./supportedCountryExtendedV2";
@@ -0,0 +1,12 @@
1
+ type SupportedCountryExtendedV2 = {
2
+ country_code: number;
3
+ currency_code: string;
4
+ currency_name: string;
5
+ iso_a2: string;
6
+ iso_a3: string;
7
+ country_name: string;
8
+ phone_code: string;
9
+ is_preferred: boolean;
10
+ supported_currencies: string[];
11
+ };
12
+ export type { SupportedCountryExtendedV2 };
@@ -1,3 +1,4 @@
1
+ import { SupportedCountriesByType } from ".";
1
2
  type Identification = {
2
3
  necessity_type: string;
3
4
  type: string;
@@ -7,5 +8,6 @@ type Identification = {
7
8
  show_type_on_signup_with_code_form: boolean;
8
9
  show_attach_id_on_signup_with_code_form: boolean;
9
10
  show_attach_selfie_on_signup_with_code_form: boolean;
11
+ supported_countries_by_type: SupportedCountriesByType[];
10
12
  };
11
13
  export type { Identification };
@@ -20,6 +20,7 @@ export type * from "./POSMobileSecurity";
20
20
  export type * from "./POSWorkingHour";
21
21
  export type * from "./RESTServiceOptions";
22
22
  export type * from "./salesSignupSettings";
23
+ export type * from "./supportedCountriesByType";
23
24
  export type * from "./userApplication";
24
25
  export type * from "./userApplication";
25
26
  export type * from "./userApplicationFeatures";
@@ -0,0 +1,5 @@
1
+ type SupportedCountriesByType = {
2
+ type: number;
3
+ supported_countries: string[];
4
+ };
5
+ export type { SupportedCountriesByType };
@@ -1,6 +1,6 @@
1
1
  import { BaseResult } from "../../common";
2
2
  import { PasswordSettings, TermsConditions, VerificationRequirements, UserSystemOptions, EcommerceSettings, ServiceSetup } from ".";
3
- import { Bin } from "../bin";
3
+ import { Bin, SupportedCountryExtendedV2 } from "../bin";
4
4
  import { UserApplication } from "./applicationOptions";
5
5
  import { ValidationServicesSettings } from "./validation";
6
6
  type SignupRequirements = BaseResult & {
@@ -17,5 +17,6 @@ type SignupRequirements = BaseResult & {
17
17
  user_application: UserApplication;
18
18
  validation_service_settings: ValidationServicesSettings[];
19
19
  apply_user_verification_requirements_to_organization_users: boolean;
20
+ supported_countries: SupportedCountryExtendedV2[];
20
21
  };
21
22
  export type { SignupRequirements };
@@ -2,5 +2,6 @@ type RequestFlag = {
2
2
  showSensitiveData?: boolean;
3
3
  showCustomField?: boolean;
4
4
  showTicket?: boolean;
5
+ checkPhoneVerification?: boolean;
5
6
  };
6
7
  export type { RequestFlag };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.5.35",
3
+ "version": "0.5.37",
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
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",