edmaxlabs-core 2.5.4 → 2.5.6

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
@@ -332,7 +332,6 @@ var _Authentication = class _Authentication {
332
332
  return;
333
333
  userDocUnsubscribe = userRef.onSnapshot(
334
334
  (snapshot, change) => {
335
- console.log(snapshot);
336
335
  if (change === "delete") {
337
336
  this.saveCredentials(null);
338
337
  onSignOut?.();
@@ -943,7 +942,6 @@ var Batch = class {
943
942
  constructor(app, config) {
944
943
  this.ops = [];
945
944
  this.app = app;
946
- this.config = config;
947
945
  }
948
946
  set(docRef, data) {
949
947
  this.ops.push({
@@ -1029,7 +1027,7 @@ var Batch = class {
1029
1027
  const res = await new HttpsRequest({
1030
1028
  method: "POST" /* POST */,
1031
1029
  endpoint: `${serverURI}/db/batch`,
1032
- headers: { authorization: this.config.token, "x-project": this.config.project },
1030
+ headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
1033
1031
  body: { ops: this.ops }
1034
1032
  }).sendRequest();
1035
1033
  if (res?.error) {
@@ -1266,15 +1264,15 @@ var Realtime = class {
1266
1264
 
1267
1265
  // src/functions/Functions.ts
1268
1266
  var Functions = class {
1269
- constructor(config) {
1270
- this.config = config;
1267
+ constructor(app) {
1268
+ this.app = app;
1271
1269
  }
1272
1270
  async call(functionName, data) {
1273
1271
  try {
1274
1272
  const res = await new HttpsRequest({
1275
1273
  method: "POST" /* POST */,
1276
1274
  endpoint: serverURI + "/functions/call/" + functionName,
1277
- headers: { authorization: this.config.token, "x-project": this.config.project },
1275
+ headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
1278
1276
  body: data
1279
1277
  }).sendRequest();
1280
1278
  return res;
@@ -2288,9 +2286,8 @@ var StorageSnapshot = class _StorageSnapshot {
2288
2286
 
2289
2287
  // src/storage/StorageRef.ts
2290
2288
  var StorageRef = class {
2291
- constructor(app, config) {
2289
+ constructor(app) {
2292
2290
  this.app = app;
2293
- this.config = config;
2294
2291
  }
2295
2292
  async get(id) {
2296
2293
  const res = await new HttpsRequest({
@@ -2334,7 +2331,7 @@ var StorageRef = class {
2334
2331
  const res = await new HttpsRequest({
2335
2332
  method: "POST" /* POST */,
2336
2333
  endpoint: serverURI + "/storage/file/upload",
2337
- headers: { authorization: this.config.token, "x-project": this.config.project },
2334
+ headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
2338
2335
  file: srcFile,
2339
2336
  isMultipart: true
2340
2337
  }).sendRequest();
@@ -2350,8 +2347,8 @@ var StorageRef = class {
2350
2347
  async delete(id) {
2351
2348
  const res = await new HttpsRequest({
2352
2349
  method: "POST" /* POST */,
2353
- endpoint: this.config + "/storage/file/delete",
2354
- headers: { authorization: this.config.token, "x-project": this.config.project },
2350
+ endpoint: serverURI + "/storage/file/delete",
2351
+ headers: { authorization: this.app.getConfig().token, "x-project": this.app.getConfig().project },
2355
2352
  body: {
2356
2353
  file_id: id
2357
2354
  }
@@ -2408,10 +2405,10 @@ var _EdmaxLabs = class _EdmaxLabs {
2408
2405
  return this._db;
2409
2406
  }
2410
2407
  get getFunctions() {
2411
- return new Functions(this._config);
2408
+ return new Functions(this);
2412
2409
  }
2413
2410
  get getStorage() {
2414
- return new StorageRef(this, this._config);
2411
+ return new StorageRef(this);
2415
2412
  }
2416
2413
  get getAuthentication() {
2417
2414
  if (!Authentication.instance) {