@bagelink/sdk 0.0.74 → 0.0.85

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/dist/index.cjs CHANGED
@@ -121,7 +121,7 @@ class BagelAuth {
121
121
  await axios.post(`${this.bagel.host}/auth/cookie/login`, formData, {
122
122
  headers: {
123
123
  "Content-Type": "multipart/form-data",
124
- "withCredentials": true
124
+ withCredentials: true
125
125
  }
126
126
  });
127
127
  return this.validateUser();
@@ -145,7 +145,7 @@ class BagelAuth {
145
145
  async register(user, errors) {
146
146
  try {
147
147
  await axios.post(`${this.bagel.host}/auth/register`, user);
148
- this.login(user);
148
+ return this.login(user);
149
149
  } catch (err) {
150
150
  console.error(err);
151
151
  errors.email = err.response.data.detail;
@@ -156,6 +156,7 @@ class BagelAuth {
156
156
  class Bagel {
157
157
  constructor({ host, onError }) {
158
158
  __publicField(this, "host");
159
+ // eslint-disable-next-line no-unused-vars
159
160
  __publicField(this, "onError");
160
161
  __publicField(this, "read_table", null);
161
162
  __publicField(this, "auth", new BagelAuth(this));
package/dist/index.d.cts CHANGED
@@ -39,7 +39,7 @@ declare class BagelAuth {
39
39
  login(user: User): Promise<User | null>;
40
40
  logout(): Promise<void>;
41
41
  acceptInvite(token: string, user: Record<string, any>): Promise<void>;
42
- register(user: Record<string, any>, errors: Record<string, any>): Promise<void>;
42
+ register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
43
43
  }
44
44
  declare class Bagel {
45
45
  host: string;
package/dist/index.d.mts CHANGED
@@ -39,7 +39,7 @@ declare class BagelAuth {
39
39
  login(user: User): Promise<User | null>;
40
40
  logout(): Promise<void>;
41
41
  acceptInvite(token: string, user: Record<string, any>): Promise<void>;
42
- register(user: Record<string, any>, errors: Record<string, any>): Promise<void>;
42
+ register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
43
43
  }
44
44
  declare class Bagel {
45
45
  host: string;
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ declare class BagelAuth {
39
39
  login(user: User): Promise<User | null>;
40
40
  logout(): Promise<void>;
41
41
  acceptInvite(token: string, user: Record<string, any>): Promise<void>;
42
- register(user: Record<string, any>, errors: Record<string, any>): Promise<void>;
42
+ register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
43
43
  }
44
44
  declare class Bagel {
45
45
  host: string;
package/dist/index.mjs CHANGED
@@ -115,7 +115,7 @@ class BagelAuth {
115
115
  await axios.post(`${this.bagel.host}/auth/cookie/login`, formData, {
116
116
  headers: {
117
117
  "Content-Type": "multipart/form-data",
118
- "withCredentials": true
118
+ withCredentials: true
119
119
  }
120
120
  });
121
121
  return this.validateUser();
@@ -139,7 +139,7 @@ class BagelAuth {
139
139
  async register(user, errors) {
140
140
  try {
141
141
  await axios.post(`${this.bagel.host}/auth/register`, user);
142
- this.login(user);
142
+ return this.login(user);
143
143
  } catch (err) {
144
144
  console.error(err);
145
145
  errors.email = err.response.data.detail;
@@ -150,6 +150,7 @@ class BagelAuth {
150
150
  class Bagel {
151
151
  constructor({ host, onError }) {
152
152
  __publicField(this, "host");
153
+ // eslint-disable-next-line no-unused-vars
153
154
  __publicField(this, "onError");
154
155
  __publicField(this, "read_table", null);
155
156
  __publicField(this, "auth", new BagelAuth(this));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "0.0.74",
4
+ "version": "0.0.85",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",