@faable/auth-sdk 1.0.14 → 1.0.15

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.
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { TeamCreate } from "./types";
2
+ import { TeamCreate, UserCreate, UserUpdate } from "./types";
3
3
  import { FaablePaginator } from "./paginator";
4
4
  export declare class FaableAuthApi {
5
5
  client: AxiosInstance;
@@ -71,6 +71,62 @@ export declare class FaableAuthApi {
71
71
  createdAt: string;
72
72
  updatedAt?: string;
73
73
  }>;
74
+ createUser(data: UserCreate): Promise<{
75
+ id: string;
76
+ name?: string;
77
+ username?: string;
78
+ given_name?: string;
79
+ family_name?: string;
80
+ email?: string;
81
+ email_verified: boolean;
82
+ phone?: string;
83
+ phone_verified: boolean;
84
+ country_iso?: string;
85
+ birth_date?: string;
86
+ locale: string;
87
+ region?: string;
88
+ picture?: string;
89
+ logins_count: number;
90
+ last_ip?: string;
91
+ last_login?: string;
92
+ user_metadata: {
93
+ [key: string]: unknown;
94
+ };
95
+ app_metadata: {
96
+ [key: string]: unknown;
97
+ };
98
+ account: string;
99
+ createdAt: string;
100
+ updatedAt?: string;
101
+ }>;
102
+ updateUser(user_id: string, data: UserUpdate): Promise<{
103
+ id: string;
104
+ name?: string;
105
+ username?: string;
106
+ given_name?: string;
107
+ family_name?: string;
108
+ email?: string;
109
+ email_verified: boolean;
110
+ phone?: string;
111
+ phone_verified: boolean;
112
+ country_iso?: string;
113
+ birth_date?: string;
114
+ locale: string;
115
+ region?: string;
116
+ picture?: string;
117
+ logins_count: number;
118
+ last_ip?: string;
119
+ last_login?: string;
120
+ user_metadata: {
121
+ [key: string]: unknown;
122
+ };
123
+ app_metadata: {
124
+ [key: string]: unknown;
125
+ };
126
+ account: string;
127
+ createdAt: string;
128
+ updatedAt?: string;
129
+ }>;
74
130
  getTeam(team_id: any): Promise<{
75
131
  id: string;
76
132
  name: string;
@@ -41,6 +41,12 @@ class FaableAuthApi {
41
41
  async getUser(user_id) {
42
42
  return await handleError(this.client.get(`/user/${user_id}`));
43
43
  }
44
+ async createUser(data) {
45
+ return await handleError(this.client.post(`/user`, data));
46
+ }
47
+ async updateUser(user_id, data) {
48
+ return await handleError(this.client.post(`/user/${user_id}`, data));
49
+ }
44
50
  async getTeam(team_id) {
45
51
  return await handleError(this.client.get(`/team/${team_id}`));
46
52
  }
@@ -1,5 +1,7 @@
1
1
  import { components } from "./api";
2
2
  export type User = components["schemas"]["User"];
3
+ export type UserCreate = components["schemas"]["UserCreate"];
4
+ export type UserUpdate = components["schemas"]["UserUpdate"];
3
5
  export type Team = components["schemas"]["Team"];
4
6
  export type TeamMember = components["schemas"]["TeamMember"];
5
7
  export type TeamCreate = components["schemas"]["TeamCreate"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,9 @@
13
13
  "axios": "^1.6.2"
14
14
  },
15
15
  "devDependencies": {
16
+ "@ava/typescript": "^5.0.0",
16
17
  "@types/node": "^20.10.5",
18
+ "ava": "^6.1.3",
17
19
  "openapi-typescript": "^6.7.3",
18
20
  "rimraf": "^5.0.5",
19
21
  "semantic-release": "^22.0.12",
package/tsconfig.json CHANGED
@@ -10,5 +10,6 @@
10
10
  "experimentalDecorators": true,
11
11
  "declaration": true
12
12
  },
13
- "include": ["src/**/*"]
13
+ "include": ["src/**/*"],
14
+ "exclude": ["src/**/*.test.ts"]
14
15
  }