@opexa/portal-sdk 0.56.1 → 0.56.2

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/dist/index.cjs CHANGED
@@ -1809,6 +1809,27 @@ var REGISTER_MEMBER_ACCOUNT_MUTATION__NEXT = gql`
1809
1809
  }
1810
1810
  }
1811
1811
  `;
1812
+ var REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION__NEXT = gql`
1813
+ mutation RegisterMemberAccountByMobileNumber($input: _RegisterMemberAccountByMobileNumberInput!) {
1814
+ registerMemberAccountByMobileNumber: _registerMemberAccountByMobileNumber(input: $input) {
1815
+ ... on MobileNumberNotAvailableError {
1816
+ __typename
1817
+ }
1818
+ ... on EmailAddressNotAvailableError {
1819
+ __typename
1820
+ }
1821
+ ... on InvalidMobileNumberVerificationCodeError {
1822
+ __typename
1823
+ }
1824
+ ... on InvalidAgentCodeError {
1825
+ __typename
1826
+ }
1827
+ ... on InvalidPlatformError {
1828
+ __typename
1829
+ }
1830
+ }
1831
+ }
1832
+ `;
1812
1833
  var REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION = gql`
1813
1834
  mutation RegisterMayaMemberAccount($input: RegisterMayaMemberAccountInput!) {
1814
1835
  registerMayaMemberAccount(input: $input) {
@@ -3205,9 +3226,7 @@ var SUBMIT_MEMBER_VERIFICATION_REQUEST_PERSONAL_DETAILS_MUTATION = gql`
3205
3226
  `;
3206
3227
  var MEMBER_VERIFICATION_REQUEST_AUTOMATIC_APPROVAL_ENABLED_QUERY = gql`
3207
3228
  query MemberVerificationRequestAutomaticApprovalEnabled {
3208
- platform {
3209
- memberVerificationRequestAutomaticApprovalEnabled
3210
- }
3229
+ memberVerificationRequestAutomaticApprovalEnabled
3211
3230
  }
3212
3231
  `;
3213
3232
 
@@ -3687,6 +3706,34 @@ var AccountService = class {
3687
3706
  ok: true
3688
3707
  };
3689
3708
  }
3709
+ async registerMemberAccountByMobileNumber__next(variables) {
3710
+ const { reCAPTCHAResponse, domain, testPass, ...others } = variables;
3711
+ const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION__NEXT, others, {
3712
+ headers: {
3713
+ ...reCAPTCHAResponse && {
3714
+ "Google-Recaptcha-Response": reCAPTCHAResponse
3715
+ },
3716
+ ...testPass && {
3717
+ "Test-Pass": "true"
3718
+ },
3719
+ ...domain && {
3720
+ Domain: domain
3721
+ }
3722
+ }
3723
+ });
3724
+ if (!res.ok) return res;
3725
+ if (res.data.registerMemberAccountByMobileNumber) {
3726
+ return {
3727
+ ok: false,
3728
+ error: createOperationError(
3729
+ res.data.registerMemberAccountByMobileNumber.__typename
3730
+ )
3731
+ };
3732
+ }
3733
+ return {
3734
+ ok: true
3735
+ };
3736
+ }
3690
3737
  async googleClientId() {
3691
3738
  const res = await this.client.request(
3692
3739
  GOOGLE_CLIEND_ID_QUERY
@@ -4040,11 +4087,11 @@ var AuthService = class {
4040
4087
  };
4041
4088
  }
4042
4089
  }
4043
- async createSingleUseToken(accessToken) {
4090
+ async createSingleUseToken(accessToken, ttl) {
4044
4091
  const headers = new Headers(this.headers);
4045
4092
  headers.append("Authorization", `Bearer ${accessToken}`);
4046
4093
  try {
4047
- const res = await fetch(`${this.url}/token?ttl=30d`, {
4094
+ const res = await fetch(`${this.url}/token?ttl=${ttl ?? "30d"}`, {
4048
4095
  method: "POST",
4049
4096
  headers
4050
4097
  });
@@ -9061,6 +9108,22 @@ var Sdk = class {
9061
9108
  });
9062
9109
  return res2.ok ? { ok: true, data: { id } } : res2;
9063
9110
  }
9111
+ if (input.type === "MOBILE_NUMBER[NEXT]") {
9112
+ const res2 = await this.accountService.registerMemberAccountByMobileNumber__next({
9113
+ input: {
9114
+ id,
9115
+ mobileNumber: addAreaCode(input.mobileNumber, await this.locale),
9116
+ emailAddress: input.emailAddress,
9117
+ branchCode: input.branchCode
9118
+ },
9119
+ testPass: input.testPass,
9120
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9121
+ ...this.webDomain && {
9122
+ domain: this.webDomain
9123
+ }
9124
+ });
9125
+ return res2.ok ? { ok: true, data: { id } } : res2;
9126
+ }
9064
9127
  const res = await this.accountService.registerMemberAccountByName({
9065
9128
  input: {
9066
9129
  id,