@opexa/portal-sdk 0.6.0 → 0.8.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;
@@ -5586,6 +5630,18 @@ var Sdk = class {
5586
5630
  });
5587
5631
  return res2.ok ? { ok: true, data: { id } } : res2;
5588
5632
  }
5633
+ if (input.type === "MOBILE_NUMBER_AND_PASSWORD") {
5634
+ const res2 = await this.accountService.registerMemberAccountByMobileNumber({
5635
+ input: {
5636
+ id,
5637
+ mobileNumber: addAreaCode(input.mobileNumber, await this.locale),
5638
+ password: await sha256(input.password),
5639
+ realName: input.realName
5640
+ },
5641
+ mobileNumberVerificationCode: input.verificationCode
5642
+ });
5643
+ return res2.ok ? { ok: true, data: { id } } : res2;
5644
+ }
5589
5645
  if (input.type === "NAME_AND_PASSWORD") {
5590
5646
  const res2 = await this.accountService.registerMemberAccount__next({
5591
5647
  input: {