shred-api-client 1.1.0 → 1.1.1

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.
@@ -13,6 +13,13 @@ class UserAPI {
13
13
  const endpointData = User_schema_1.UserEndpoints.GetUserInfo;
14
14
  const data = await this.clientHTTP.makeRequest(endpointData.uri, endpointData.method, null, context, true //Use legacy api (old endpoints)
15
15
  );
16
+ if (!data.registered) {
17
+ //Login by 3rd party and don't have register yet
18
+ const enableEndpointData = User_schema_1.UserEndpoints.EnableUser;
19
+ const user = await this.clientHTTP.makeRequest(enableEndpointData.uri, enableEndpointData.method, null, context, true //Use legacy api (old endpoints)
20
+ );
21
+ return user;
22
+ }
16
23
  return data;
17
24
  }
18
25
  }
@@ -9,6 +9,10 @@ declare const UserEndpoints: {
9
9
  uri: string;
10
10
  method: string;
11
11
  };
12
+ EnableUser: {
13
+ uri: string;
14
+ method: string;
15
+ };
12
16
  };
13
17
  type Preferences = {
14
18
  primaryColor?: string;
@@ -6,5 +6,9 @@ const UserEndpoints = {
6
6
  uri: "/api/user/info",
7
7
  method: "GET",
8
8
  },
9
+ EnableUser: {
10
+ uri: "/api/user/register",
11
+ method: "POST",
12
+ },
9
13
  };
10
14
  exports.UserEndpoints = UserEndpoints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "build": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s . -o ./dist",
13
- "build:watch": "tsc -w"
13
+ "build:watch": "tsc -w --project tsconfig.json && tscpaths -p tsconfig.json -s . -o ./dist"
14
14
  },
15
15
  "author": "Marcus Cartágenes",
16
16
  "license": "ISC",