shred-api-client 1.7.4 → 1.7.6
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/api/User.api.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare class UserAPI implements UserAPISchema {
|
|
|
9
9
|
confirmCode(email: string, code: number): Promise<boolean>;
|
|
10
10
|
isEmailAvaliable(email: string): Promise<boolean>;
|
|
11
11
|
authenticate(context: Context, system: System): Promise<string>;
|
|
12
|
-
createUser(email: string, name: string,
|
|
12
|
+
createUser(email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null): Promise<any>;
|
|
13
13
|
getUserInfo(context: Context): Promise<User>;
|
|
14
14
|
}
|
|
15
15
|
export default UserAPI;
|
package/dist/api/User.api.js
CHANGED
|
@@ -30,13 +30,13 @@ class UserAPI {
|
|
|
30
30
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, { system }, context);
|
|
31
31
|
return data.isValid;
|
|
32
32
|
}
|
|
33
|
-
async createUser(email, name,
|
|
33
|
+
async createUser(email, name, password, passwordConfirmation, profession, invitationCode) {
|
|
34
34
|
const endpointData = User_schema_1.UserEndpoints.CreateUser;
|
|
35
35
|
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, {
|
|
36
36
|
email,
|
|
37
37
|
name,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
password,
|
|
39
|
+
passwordConfirmation,
|
|
40
40
|
profession,
|
|
41
41
|
invitationCode,
|
|
42
42
|
}, null);
|
|
@@ -45,13 +45,6 @@ class UserAPI {
|
|
|
45
45
|
async getUserInfo(context) {
|
|
46
46
|
const endpointData = User_schema_1.UserEndpoints.GetUserInfo;
|
|
47
47
|
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, null, context);
|
|
48
|
-
if (!data.registered) {
|
|
49
|
-
//Login by 3rd party and don't have register yet
|
|
50
|
-
const enableEndpointData = User_schema_1.UserEndpoints.EnableUser;
|
|
51
|
-
const user = await this.clientHTTP.makeRequest(this.env, enableEndpointData.uri, enableEndpointData.method, null, context, true //Use legacy api (old endpoints)
|
|
52
|
-
);
|
|
53
|
-
return user;
|
|
54
|
-
}
|
|
55
48
|
return data;
|
|
56
49
|
}
|
|
57
50
|
}
|
|
@@ -5,7 +5,7 @@ interface UserAPISchema {
|
|
|
5
5
|
sendValidationCode: (email: string) => Promise<boolean>;
|
|
6
6
|
confirmCode: (email: string, code: number) => Promise<boolean>;
|
|
7
7
|
authenticate: (context: Context, system: System) => Promise<string>;
|
|
8
|
-
createUser: (email: string, name: string,
|
|
8
|
+
createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
9
9
|
}
|
|
10
10
|
declare const UserEndpoints: {
|
|
11
11
|
GetUserInfo: {
|