@opexa/portal-sdk 0.59.132 → 0.59.134

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.
@@ -4202,6 +4202,11 @@ var AccountService = class {
4202
4202
  }
4203
4203
  async registerMemberAccountViaMobile(variables) {
4204
4204
  const { reCAPTCHAResponse, domain, testPass, ...others } = variables;
4205
+ const { branch, branchCode, ...input } = others.input;
4206
+ others.input = {
4207
+ ...input,
4208
+ ...branch?.trim() ? { branch } : { branchCode }
4209
+ };
4205
4210
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION, others, {
4206
4211
  headers: {
4207
4212
  ...reCAPTCHAResponse && {
@@ -4643,6 +4648,11 @@ var AccountService = class {
4643
4648
  }
4644
4649
  async registerMemberAccountByMobileNumber__next(variables) {
4645
4650
  const { reCAPTCHAResponse, domain, testPass, fingerprint, ...others } = variables;
4651
+ const { branch, branchCode, ...input } = others.input;
4652
+ others.input = {
4653
+ ...input,
4654
+ ...branch?.trim() ? { branch } : { branchCode }
4655
+ };
4646
4656
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION__NEXT, others, {
4647
4657
  headers: {
4648
4658
  ...reCAPTCHAResponse && {
@@ -4834,6 +4844,18 @@ var AccountService = class {
4834
4844
  };
4835
4845
  }
4836
4846
  };
4847
+
4848
+ // src/utils/call-if-fn.ts
4849
+ function isFunction(value) {
4850
+ return typeof value === "function";
4851
+ }
4852
+ function callIfFn(value, ...args) {
4853
+ if (isFunction(value)) {
4854
+ return value(...args);
4855
+ } else {
4856
+ return value;
4857
+ }
4858
+ }
4837
4859
  var thumbmark_instance;
4838
4860
  async function getFingerPrint() {
4839
4861
  if (typeof window === "undefined") return null;
@@ -4912,7 +4934,7 @@ var AuthService = class {
4912
4934
  return await this.graphqlClient.request(GENERATE_OUTBOUND_SINGLE_SIGN_ON_REDIRECT_URL_MUTATION, variables);
4913
4935
  }
4914
4936
  get headers() {
4915
- const headers = new Headers(this.options.headers);
4937
+ const headers = new Headers(callIfFn(this.options).headers);
4916
4938
  headers.append("Accept", "application/json, text/plain");
4917
4939
  headers.append("Content-Type", "application/json");
4918
4940
  return headers;
@@ -5245,18 +5267,6 @@ var AuthService = class {
5245
5267
  }
5246
5268
  };
5247
5269
 
5248
- // src/utils/call-if-fn.ts
5249
- function isFunction(value) {
5250
- return typeof value === "function";
5251
- }
5252
- function callIfFn(value, ...args) {
5253
- if (isFunction(value)) {
5254
- return value(...args);
5255
- } else {
5256
- return value;
5257
- }
5258
- }
5259
-
5260
5270
  // src/services/cms-portal.service.ts
5261
5271
  var CmsPortalService = class {
5262
5272
  config;
@@ -5444,16 +5454,16 @@ var CmsPortalService = class {
5444
5454
  async getJson(path, params) {
5445
5455
  const config = callIfFn(this.config);
5446
5456
  const fetch_ = config.fetch ?? fetch;
5457
+ const headers = new Headers(config.headers);
5458
+ headers.set("Accept", "application/json");
5459
+ headers.set("Content-Type", "application/json");
5460
+ headers.set("Site-ID", config.site);
5461
+ headers.set("Platform-ID", config.platform);
5447
5462
  const req = new Request(
5448
5463
  `${config.url}${path}?${params?.toString() ?? ""}`,
5449
5464
  {
5450
5465
  method: "GET",
5451
- headers: {
5452
- Accept: "application/json",
5453
- "Content-Type": "application/json",
5454
- "Site-ID": config.site,
5455
- "Platform-ID": config.platform
5456
- }
5466
+ headers
5457
5467
  }
5458
5468
  );
5459
5469
  try {