@longvansoftware/storefront-js-client 3.0.2 → 3.0.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.
|
@@ -121,8 +121,8 @@ exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
121
121
|
}
|
|
122
122
|
`;
|
|
123
123
|
exports.CREATE_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
124
|
-
mutation CreateUserDetail($userLoginId: String!, $
|
|
125
|
-
createUserDetail(userLoginId: $userLoginId,
|
|
124
|
+
mutation CreateUserDetail($userLoginId: String!, $orgId: String!) {
|
|
125
|
+
createUserDetail(userLoginId: $userLoginId, orgId: $orgId) {
|
|
126
126
|
partyId
|
|
127
127
|
orgId
|
|
128
128
|
fullName
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
|
-
import { LoginRequest, LoginResponse, RegisterRequest, SendOTPResponse, ValidateOTPResponse, CreateUserLoginResponse, GetAccessTokenByOTPResponse, CreateOrgResponse } from "../../types/auth";
|
|
2
|
+
import { LoginRequest, LoginResponse, RegisterRequest, SendOTPResponse, ValidateOTPResponse, CreateUserLoginResponse, GetAccessTokenByOTPResponse, CreateOrgResponse, CreateUserDetailResponse } from "../../types/auth";
|
|
3
3
|
/**
|
|
4
4
|
* Represents the authentication service.
|
|
5
5
|
*/
|
|
@@ -36,7 +36,15 @@ export declare class AuthService extends Service {
|
|
|
36
36
|
getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
|
|
37
37
|
checkUsernameExisted(username: string): Promise<any>;
|
|
38
38
|
linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Creates user detail for the specified user login ID.
|
|
41
|
+
* Uses the SDK's configured orgId automatically.
|
|
42
|
+
*
|
|
43
|
+
* @param userLoginId - The user login ID to create detail for.
|
|
44
|
+
* @returns A promise that resolves to the created user detail with full profile information.
|
|
45
|
+
* @throws Will throw an error if the GraphQL mutation fails.
|
|
46
|
+
*/
|
|
47
|
+
createUserDetail(userLoginId: string): Promise<CreateUserDetailResponse>;
|
|
40
48
|
sendSmsVerifyCode(username: string): Promise<any>;
|
|
41
49
|
verifyCode(username: string, code: string): Promise<any>;
|
|
42
50
|
resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
@@ -158,11 +158,19 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Creates user detail for the specified user login ID.
|
|
163
|
+
* Uses the SDK's configured orgId automatically.
|
|
164
|
+
*
|
|
165
|
+
* @param userLoginId - The user login ID to create detail for.
|
|
166
|
+
* @returns A promise that resolves to the created user detail with full profile information.
|
|
167
|
+
* @throws Will throw an error if the GraphQL mutation fails.
|
|
168
|
+
*/
|
|
161
169
|
createUserDetail(userLoginId) {
|
|
162
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
171
|
const variables = {
|
|
164
172
|
userLoginId,
|
|
165
|
-
|
|
173
|
+
orgId: this.orgId,
|
|
166
174
|
};
|
|
167
175
|
try {
|
|
168
176
|
const response = yield this.graphqlMutation(mutations_1.CREATE_USER_DETAIL_MUTATION, variables);
|
package/dist/src/types/auth.d.ts
CHANGED
|
@@ -197,3 +197,41 @@ export interface CreateOrgResponse {
|
|
|
197
197
|
/** Prefix */
|
|
198
198
|
prefix: string;
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Response interface for creating user detail
|
|
202
|
+
* Returns the created user detail with full profile information
|
|
203
|
+
*/
|
|
204
|
+
export interface CreateUserDetailResponse {
|
|
205
|
+
/** Party ID */
|
|
206
|
+
partyId: string;
|
|
207
|
+
/** Organization ID */
|
|
208
|
+
orgId: string;
|
|
209
|
+
/** Full name */
|
|
210
|
+
fullName: string;
|
|
211
|
+
/** Email address */
|
|
212
|
+
email: string;
|
|
213
|
+
/** Phone number */
|
|
214
|
+
phone: string;
|
|
215
|
+
/** Address */
|
|
216
|
+
address: string;
|
|
217
|
+
/** Identity number */
|
|
218
|
+
identityNumber: string;
|
|
219
|
+
/** Gender */
|
|
220
|
+
gender: string;
|
|
221
|
+
/** Birth date */
|
|
222
|
+
birthDate: string;
|
|
223
|
+
/** Avatar URL */
|
|
224
|
+
avatarUrl: string;
|
|
225
|
+
/** Access token */
|
|
226
|
+
accessToken: string;
|
|
227
|
+
/** Username */
|
|
228
|
+
username: string;
|
|
229
|
+
/** Ready V2 flag */
|
|
230
|
+
readyV2: boolean;
|
|
231
|
+
/** Organization permissions map */
|
|
232
|
+
orgPermissionsMap: Record<string, any>;
|
|
233
|
+
/** Organization positions map */
|
|
234
|
+
orgPositionsMap: Record<string, any>;
|
|
235
|
+
/** Organization roles map */
|
|
236
|
+
orgRolesMap: Record<string, any>;
|
|
237
|
+
}
|