shred-api-client 1.9.17 → 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;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { ShredAPI } from "./model/Api";
2
- import { Role } from "./model/User.schema";
2
+ import { Role, System } from "./model/User.schema";
3
3
  import { Status as ProjectStatus } from "./model/Project.schema";
4
4
  import Exceptions from "./model/exceptions/";
5
- export { Role };
6
- export { Exceptions };
7
- export { ProjectStatus };
5
+ export { Role, System, Exceptions, ProjectStatus };
8
6
  export default ShredAPI;
9
7
  export * from "./namespace";
package/dist/index.js CHANGED
@@ -17,10 +17,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.ProjectStatus = exports.Exceptions = exports.Role = void 0;
20
+ exports.ProjectStatus = exports.Exceptions = exports.System = exports.Role = void 0;
21
21
  const Api_1 = require("./model/Api");
22
22
  const User_schema_1 = require("./model/User.schema");
23
23
  Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return User_schema_1.Role; } });
24
+ Object.defineProperty(exports, "System", { enumerable: true, get: function () { return User_schema_1.System; } });
24
25
  const Project_schema_1 = require("./model/Project.schema");
25
26
  Object.defineProperty(exports, "ProjectStatus", { enumerable: true, get: function () { return Project_schema_1.Status; } });
26
27
  const exceptions_1 = __importDefault(require("./model/exceptions/"));
@@ -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.17",
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",