shred-api-client 1.9.18 → 1.9.19

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.
@@ -14,7 +14,7 @@ declare class UserAPI implements UserAPISchema {
14
14
  update(context: Context, update: Partial<Update>): Promise<boolean>;
15
15
  getBindedUsers(context: Context): Promise<User[]>;
16
16
  setup(context: Context): Promise<boolean>;
17
- authenticate(context: Context, system: System): Promise<string>;
17
+ authenticate(email: string, password: string, system: System): Promise<string>;
18
18
  createUser(email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null): Promise<any>;
19
19
  getUserInfo(context: Context): Promise<User>;
20
20
  }
@@ -55,10 +55,10 @@ class UserAPI {
55
55
  const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, context);
56
56
  return data.success;
57
57
  }
58
- async authenticate(context, system) {
58
+ async authenticate(email, password, system) {
59
59
  const endpointData = User_schema_1.UserEndpoints.Authenticate;
60
- const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, { system }, context);
61
- return data.isValid;
60
+ const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, { system, email, password });
61
+ return data.token;
62
62
  }
63
63
  async createUser(email, name, password, passwordConfirmation, profession, invitationCode) {
64
64
  const endpointData = User_schema_1.UserEndpoints.CreateUser;
@@ -7,7 +7,7 @@ interface UserAPISchema {
7
7
  confirmCode: (email: string, code: number, keepCode?: boolean) => Promise<boolean>;
8
8
  changePassword: (email: string, pass: string, passConfirm: string, code: number) => Promise<boolean>;
9
9
  changeEmail: (ctx: Context, email: string, code: number) => Promise<boolean>;
10
- authenticate: (context: Context, system: System) => Promise<string>;
10
+ authenticate: (email: string, password: string, system: System) => Promise<string>;
11
11
  update: (context: Context, update: Partial<Update>) => Promise<boolean>;
12
12
  setup: (context: Context) => Promise<boolean>;
13
13
  getBindedUsers: (ctx: Context) => Promise<User[]>;
@@ -39,7 +39,7 @@ const UserEndpoints = {
39
39
  method: "POST",
40
40
  },
41
41
  Authenticate: {
42
- uri: "/accounts/authenticate",
42
+ uri: "/accounts/public/login",
43
43
  method: "POST",
44
44
  },
45
45
  CreateUser: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.9.18",
3
+ "version": "1.9.19",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",