@opexa/portal-sdk 0.6.0 → 0.7.0

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
@@ -1400,6 +1400,27 @@ var SEND_VERIFICATION_CODE_MUTATION = gql`
1400
1400
  }
1401
1401
  }
1402
1402
  `;
1403
+ var REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION = gql`
1404
+ mutation RegisterMemberAccountByMobileNumber(
1405
+ $input: RegisterMemberAccountByMobileNumberInput!
1406
+ $mobileNumberVerificationCode: String!
1407
+ ) {
1408
+ registerMemberAccountByMobileNumber(
1409
+ input: $input
1410
+ mobileNumberVerificationCode: $mobileNumberVerificationCode
1411
+ ) {
1412
+ ... on MobileNumberNotAvailableError {
1413
+ __typename
1414
+ }
1415
+ ... on InvalidSMSVerificationCodeError {
1416
+ __typename
1417
+ }
1418
+ ... on InvalidPlatformError {
1419
+ __typename
1420
+ }
1421
+ }
1422
+ }
1423
+ `;
1403
1424
  var PLATFORM_QUERY = gql`
1404
1425
  fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {
1405
1426
  minimumAmount
@@ -2340,6 +2361,19 @@ var AccountService = class {
2340
2361
  const res = await this.client.request(POINTS_CLUB_SETTINGS_QUERY);
2341
2362
  return res.ok ? { ok: true, data: res.data.pointsClubSettings } : res;
2342
2363
  }
2364
+ async registerMemberAccountByMobileNumber(variables) {
2365
+ const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION, variables);
2366
+ if (!res.ok) return res;
2367
+ if (res.data.registerMemberAccountByMobileNumber) {
2368
+ return {
2369
+ ok: false,
2370
+ error: createOperationError(res.data.registerMemberAccountByMobileNumber.__typename)
2371
+ };
2372
+ }
2373
+ return {
2374
+ ok: true
2375
+ };
2376
+ }
2343
2377
  };
2344
2378
 
2345
2379
  // src/utils/status-code-to-operation-error.ts
@@ -2395,6 +2429,9 @@ var AuthService = class {
2395
2429
  if (input.type === "CABINET") {
2396
2430
  headers.set("Authorization", `OPEXA-CABINET-TOKEN ${input.token}`);
2397
2431
  }
2432
+ if (input.type === "BIOMETRICS") {
2433
+ headers.set("Authorization", `Biometrics ${input.token}`);
2434
+ }
2398
2435
  if (input.reCAPTCHAResponse) {
2399
2436
  headers.set("google-recaptcha-response", input.reCAPTCHAResponse);
2400
2437
  }
@@ -5429,6 +5466,13 @@ var Sdk = class {
5429
5466
  });
5430
5467
  return res.ok ? { ok: true } : res;
5431
5468
  }
5469
+ case "BIOMETRICS": {
5470
+ const res = await this.sessionManager.create({
5471
+ type: "BIOMETRICS",
5472
+ token: input.token
5473
+ });
5474
+ return res.ok ? { ok: true } : res;
5475
+ }
5432
5476
  default: {
5433
5477
  const res = await this.sessionManager.create(input);
5434
5478
  return res.ok ? { ok: true } : res;
@@ -5736,6 +5780,17 @@ var Sdk = class {
5736
5780
  data: res.data ? this.transformer.transform.wallet(res.data) : null
5737
5781
  };
5738
5782
  }
5783
+ async registerMemberAccountByMobileNumber(input) {
5784
+ return await this.accountService.registerMemberAccountByMobileNumber({
5785
+ input: {
5786
+ id: input.id,
5787
+ mobileNumber: addAreaCode(input.mobileNumber, await this.locale),
5788
+ password: await sha256(input.password),
5789
+ realName: input.realName
5790
+ },
5791
+ mobileNumberVerificationCode: input.mobileNumberVerificationCode
5792
+ });
5793
+ }
5739
5794
  /**/
5740
5795
  /*+----------------------------------------+*/
5741
5796
  /*+ ANNOUNCEMENT +*/