@bagelink/sdk 0.0.400 → 0.0.407
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 +2 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -0
- package/package.json +1 -1
- package/src/index.ts +2 -1
package/dist/index.cjs
CHANGED
|
@@ -437,6 +437,8 @@ class Bagel {
|
|
|
437
437
|
__publicField(this, "onError");
|
|
438
438
|
__publicField(this, "read_table", null);
|
|
439
439
|
__publicField(this, "auth", new BagelAuth(this));
|
|
440
|
+
if (!this.host)
|
|
441
|
+
throw new Error("you probably need to set VITE_BAGEL_BASE_URL in the .env file");
|
|
440
442
|
this.host = host.replace(/\/$/, "");
|
|
441
443
|
axios.defaults.baseURL = this.host;
|
|
442
444
|
this.onError = onError;
|
package/dist/index.d.cts
CHANGED
|
@@ -49,7 +49,7 @@ declare class BagelAuth {
|
|
|
49
49
|
register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
|
|
50
50
|
}
|
|
51
51
|
declare class Bagel {
|
|
52
|
-
host
|
|
52
|
+
host?: string;
|
|
53
53
|
onError?: (err: any) => void;
|
|
54
54
|
constructor({ host, onError }: Record<string, any>);
|
|
55
55
|
read_table: Tables | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -49,7 +49,7 @@ declare class BagelAuth {
|
|
|
49
49
|
register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
|
|
50
50
|
}
|
|
51
51
|
declare class Bagel {
|
|
52
|
-
host
|
|
52
|
+
host?: string;
|
|
53
53
|
onError?: (err: any) => void;
|
|
54
54
|
constructor({ host, onError }: Record<string, any>);
|
|
55
55
|
read_table: Tables | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare class BagelAuth {
|
|
|
49
49
|
register(user: Record<string, any>, errors: Record<string, any>): Promise<User | null>;
|
|
50
50
|
}
|
|
51
51
|
declare class Bagel {
|
|
52
|
-
host
|
|
52
|
+
host?: string;
|
|
53
53
|
onError?: (err: any) => void;
|
|
54
54
|
constructor({ host, onError }: Record<string, any>);
|
|
55
55
|
read_table: Tables | null;
|
package/dist/index.mjs
CHANGED
|
@@ -431,6 +431,8 @@ class Bagel {
|
|
|
431
431
|
__publicField(this, "onError");
|
|
432
432
|
__publicField(this, "read_table", null);
|
|
433
433
|
__publicField(this, "auth", new BagelAuth(this));
|
|
434
|
+
if (!this.host)
|
|
435
|
+
throw new Error("you probably need to set VITE_BAGEL_BASE_URL in the .env file");
|
|
434
436
|
this.host = host.replace(/\/$/, "");
|
|
435
437
|
axios.defaults.baseURL = this.host;
|
|
436
438
|
this.onError = onError;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -191,12 +191,13 @@ class BagelAuth {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
export class Bagel {
|
|
194
|
-
host
|
|
194
|
+
host?: string;
|
|
195
195
|
|
|
196
196
|
// eslint-disable-next-line no-unused-vars
|
|
197
197
|
onError?: (err: any) => void;
|
|
198
198
|
|
|
199
199
|
constructor({ host, onError }: Record<string, any>) {
|
|
200
|
+
if (!this.host) throw new Error('you probably need to set VITE_BAGEL_BASE_URL in the .env file');
|
|
200
201
|
this.host = host.replace(/\/$/, '');
|
|
201
202
|
axios.defaults.baseURL = this.host;
|
|
202
203
|
this.onError = onError;
|