@faable/auth-sdk 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -7,20 +7,12 @@
7
7
 
8
8
  <p align="center">
9
9
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@faable/auth-sdk">
10
- <img alt="" src="https://img.shields.io/npm/v/@faable/swr-pagination-adapter.svg?style=for-the-badge&labelColor=000000">
10
+ <img alt="" src="https://img.shields.io/npm/v/@faable/auth-sdk.svg?style=for-the-badge&labelColor=000000">
11
11
  </a>
12
12
  </p>
13
13
 
14
14
  ## Install
15
15
 
16
- With Yarn:
17
-
18
- ```bash
19
- yarn add @faablecloud/auth-sdk
20
- ```
21
-
22
- With NPM:
23
-
24
16
  ```bash
25
- npm install @faablecloud/auth-sdk
17
+ npm install @faable/auth-sdk
26
18
  ```
@@ -8,4 +8,5 @@ export declare class FaableAuthApi {
8
8
  getUserMetadata(user_id: string): Promise<{
9
9
  [key: string]: unknown;
10
10
  }>;
11
+ isUserMemberOfTeam(user_id: string, team_id: string): Promise<boolean>;
11
12
  }
@@ -32,5 +32,12 @@ class FaableAuthApi {
32
32
  return (await handleError(this.client.get(`/user/${user_id}`)))
33
33
  .user_metadata;
34
34
  }
35
+ async isUserMemberOfTeam(user_id, team_id) {
36
+ const members_res = await this.client.get(`/team/${team_id}/member/check/${user_id}`, {
37
+ validateStatus: () => true,
38
+ });
39
+ // Check access via status
40
+ return members_res.status == 200;
41
+ }
35
42
  }
36
43
  exports.FaableAuthApi = FaableAuthApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",