@opexa/portal-sdk 0.0.194 → 0.0.196

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
@@ -1134,6 +1134,24 @@ var REGISTER_MEMBER_ACCOUNT_MUTATION = gql`
1134
1134
  }
1135
1135
  }
1136
1136
  `;
1137
+ var REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION = gql`
1138
+ mutation RegisterMemberAccountByName(
1139
+ $input: RegisterMemberAccountByNameInput!
1140
+ $reCAPTCHAResponse: String
1141
+ ) {
1142
+ registerMemberAccountByName(input: $input, reCAPTCHAResponse: $reCAPTCHAResponse) {
1143
+ ... on AccountNameNotAvailableError {
1144
+ __typename
1145
+ }
1146
+ ... on InvalidPlatformError {
1147
+ __typename
1148
+ }
1149
+ ... on InvalidReCAPTCHAResponseError {
1150
+ __typename
1151
+ }
1152
+ }
1153
+ }
1154
+ `;
1137
1155
  var REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION = gql`
1138
1156
  mutation RegisterMemberAccountViaMobile(
1139
1157
  $input: RegisterMemberAccountViaMobileInput!
@@ -1988,6 +2006,19 @@ var AccountService = class {
1988
2006
  ok: true
1989
2007
  };
1990
2008
  }
2009
+ async registerMemberAccountByName(variables) {
2010
+ const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION, variables);
2011
+ if (!res.ok) return res;
2012
+ if (res.data.registerMemberAccountByName) {
2013
+ return {
2014
+ ok: false,
2015
+ error: createOperationError(res.data.registerMemberAccountByName.__typename)
2016
+ };
2017
+ }
2018
+ return {
2019
+ ok: true
2020
+ };
2021
+ }
1991
2022
  async updateMemberAccount(variables) {
1992
2023
  const res = await this.client.request(UPDATE_MEMBER_ACCOUNT_MUTATION, variables);
1993
2024
  if (!res.ok) return res;
@@ -5172,6 +5203,9 @@ var Sdk = class {
5172
5203
  });
5173
5204
  return res.ok ? { ok: true, data: { id } } : res;
5174
5205
  }
5206
+ /**
5207
+ * @deprecated use `registerMemberAccountByName`
5208
+ */
5175
5209
  async createAccount__next(input) {
5176
5210
  const id = input.id ?? objectId.ObjectId.generate(ObjectType.Account).toString();
5177
5211
  if (input.type === "MOBILE_NUMBER") {
@@ -5201,6 +5235,18 @@ var Sdk = class {
5201
5235
  });
5202
5236
  return res.ok ? { ok: true, data: { id } } : res;
5203
5237
  }
5238
+ async registerMemberAccountByName(input) {
5239
+ const id = input.id ?? objectId.ObjectId.generate(ObjectType.Account).toString();
5240
+ const res = await this.accountService.registerMemberAccountByName({
5241
+ input: {
5242
+ id,
5243
+ name: input.name,
5244
+ password: await sha256(input.password)
5245
+ },
5246
+ reCAPTCHAResponse: input.reCAPTCHAResponse
5247
+ });
5248
+ return res.ok ? { ok: true, data: { id } } : res;
5249
+ }
5204
5250
  async registerMayaAccount(input) {
5205
5251
  return await this.accountService.registerMayaMemberAccount({
5206
5252
  input: {