@longvansoftware/storefront-js-client 3.8.1 → 3.8.3

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.
@@ -10,6 +10,7 @@ export declare const UPDATE_PROFILE_MUTATION: import("graphql").DocumentNode;
10
10
  export declare const LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION: import("graphql").DocumentNode;
11
11
  export declare const CREATE_USER_DETAIL_MUTATION: import("graphql").DocumentNode;
12
12
  export declare const CREATE_USER_DETAIL_MUTATION_V2: import("graphql").DocumentNode;
13
+ export declare const CREATE_USER_DETAIL_MUTATION_V3: import("graphql").DocumentNode;
13
14
  export declare const CREATE_ORG_MUTATION: import("graphql").DocumentNode;
14
15
  export declare const ADD_ROLE_USER_MUTATION: import("graphql").DocumentNode;
15
16
  export declare const CREATE_USER_LOGIN_MUTATION: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RESET_PASSWORD = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION_V2 = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.CREATE_PASSWORD_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
3
+ exports.RESET_PASSWORD = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION_V3 = exports.CREATE_USER_DETAIL_MUTATION_V2 = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.CREATE_PASSWORD_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.LOGIN_MUTATION = (0, graphql_tag_1.gql) `
6
6
  mutation Login($loginRequest: LoginRequest!) {
@@ -187,9 +187,44 @@ exports.CREATE_USER_DETAIL_MUTATION_V2 = (0, graphql_tag_1.gql) `
187
187
  }
188
188
  }
189
189
  `;
190
+ exports.CREATE_USER_DETAIL_MUTATION_V3 = (0, graphql_tag_1.gql) `
191
+ mutation CreateUserDetail(
192
+ $userLoginId: String
193
+ $orgId: String
194
+ $phone: String
195
+ $name: String
196
+ ) {
197
+ createUserDetail(userLoginId: $userLoginId, orgId: $orgId, phone: $phone) {
198
+ partyId
199
+ orgId
200
+ fullName
201
+ email
202
+ phone
203
+ address
204
+ identityNumber
205
+ gender
206
+ birthDate
207
+ avatarUrl
208
+ accessToken
209
+ username
210
+ readyV2
211
+ orgPermissionsMap
212
+ orgPositionsMap
213
+ orgRolesMap
214
+ }
215
+ }
216
+ `;
190
217
  exports.CREATE_ORG_MUTATION = (0, graphql_tag_1.gql) `
191
- mutation CreateOrg($orgName: String!) {
192
- createOrg(orgName: $orgName) {
218
+ mutation CreateOrg(
219
+ $orgName: String!
220
+ $providerId: String!
221
+ $groupTenantId: String!
222
+ ) {
223
+ createOrg(
224
+ orgName: $orgName
225
+ providerId: $providerId
226
+ groupTenantId: $groupTenantId
227
+ ) {
193
228
  id
194
229
  partyId
195
230
  codeId
@@ -38,6 +38,7 @@ export declare class AuthService extends Service {
38
38
  linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
39
39
  createUserDetail(userLoginId: string): Promise<any>;
40
40
  createUserDetailV2(userLoginId: string, phone: string): Promise<any>;
41
+ createUserDetailV3(userLoginId: string, phone: string, name: string): Promise<any>;
41
42
  sendSmsVerifyCode(username: string): Promise<any>;
42
43
  verifyCode(username: string, code: string): Promise<any>;
43
44
  resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
@@ -58,7 +59,7 @@ export declare class AuthService extends Service {
58
59
  * @returns A promise that resolves to the result of the createOrg mutation.
59
60
  * @throws Will throw an error if the GraphQL mutation fails.
60
61
  */
61
- createOrg(orgName: string): Promise<any>;
62
+ createOrg(orgName: string, providerId: string, groupTenantId: string): Promise<any>;
62
63
  /**
63
64
  * Adds a role to a user in an organization.
64
65
  *
@@ -191,14 +191,24 @@ class AuthService extends serviceSDK_1.Service {
191
191
  }
192
192
  });
193
193
  }
194
- // mutation VerifyCode {
195
- // sendSmsVerifyCode(orgId: "FYP", username: "0971879660") {
196
- // id
197
- // code
198
- // username
199
- // timeExpired
200
- // }
201
- // }
194
+ createUserDetailV3(userLoginId, phone, name) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ const variables = {
197
+ userLoginId,
198
+ orgId: this.orgId,
199
+ phone,
200
+ name
201
+ };
202
+ try {
203
+ const response = yield this.graphqlMutation(mutations_1.CREATE_USER_DETAIL_MUTATION_V2, variables);
204
+ return response.createUserDetail;
205
+ }
206
+ catch (error) {
207
+ console.log(`Error in createUserDetail: ${error}`);
208
+ throw error;
209
+ }
210
+ });
211
+ }
202
212
  sendSmsVerifyCode(username) {
203
213
  return __awaiter(this, void 0, void 0, function* () {
204
214
  const query = mutations_1.SEND_SMS_VERIFY_CODE_MUTATION;
@@ -326,10 +336,12 @@ class AuthService extends serviceSDK_1.Service {
326
336
  * @returns A promise that resolves to the result of the createOrg mutation.
327
337
  * @throws Will throw an error if the GraphQL mutation fails.
328
338
  */
329
- createOrg(orgName) {
339
+ createOrg(orgName, providerId, groupTenantId) {
330
340
  return __awaiter(this, void 0, void 0, function* () {
331
341
  const variables = {
332
342
  orgName,
343
+ providerId,
344
+ groupTenantId,
333
345
  };
334
346
  try {
335
347
  const response = yield this.graphqlMutation(mutations_1.CREATE_ORG_MUTATION, variables);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.8.1",
3
+ "version": "3.8.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [