@faable/auth-sdk 1.0.7 → 1.0.9

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.
@@ -12,7 +12,7 @@ export declare class FaableAuthApi {
12
12
  }>;
13
13
  listUsers(params?: {
14
14
  email?: string;
15
- }): Promise<{
15
+ }): {
16
16
  all: () => Promise<{
17
17
  id: string;
18
18
  name?: string;
@@ -41,7 +41,7 @@ export declare class FaableAuthApi {
41
41
  createdAt: string;
42
42
  updatedAt?: string;
43
43
  }[]>;
44
- }>;
44
+ };
45
45
  getUser(user_id: any): Promise<{
46
46
  id: string;
47
47
  name?: string;
@@ -85,7 +85,7 @@ export declare class FaableAuthApi {
85
85
  }>;
86
86
  listTeams(params?: {
87
87
  user_id?: string;
88
- }): Promise<{
88
+ }): {
89
89
  all: () => Promise<{
90
90
  id: string;
91
91
  name: string;
@@ -99,6 +99,6 @@ export declare class FaableAuthApi {
99
99
  createdAt: string;
100
100
  updatedAt?: string;
101
101
  }[]>;
102
- }>;
102
+ };
103
103
  isUserMemberOfTeam(user_id: string, team_id: string): Promise<boolean>;
104
104
  }
@@ -35,7 +35,7 @@ class FaableAuthApi {
35
35
  return (await handleError(this.client.get(`/user/${user_id}`)))
36
36
  .user_metadata;
37
37
  }
38
- async listUsers(params = {}) {
38
+ listUsers(params = {}) {
39
39
  return this.paginator.paginate({ url: "/user", params });
40
40
  }
41
41
  async getUser(user_id) {
@@ -44,7 +44,7 @@ class FaableAuthApi {
44
44
  async getTeam(team_id) {
45
45
  return await handleError(this.client.get(`/team/${team_id}`));
46
46
  }
47
- async listTeams(params) {
47
+ listTeams(params) {
48
48
  return this.paginator.paginate({ url: "/user", params });
49
49
  }
50
50
  async isUserMemberOfTeam(user_id, team_id) {
package/dist/paginator.js CHANGED
@@ -14,7 +14,7 @@ class FaablePaginator {
14
14
  do {
15
15
  res = await this.client.request({
16
16
  ...req,
17
- params: { ...req.params, next: res.data.next },
17
+ params: { ...req.params, next: res?.data?.next },
18
18
  });
19
19
  pages.push(res.data);
20
20
  } while (res.data.next);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",