shogun-core 6.4.4 → 6.4.5
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/browser/shogun-core.js +5 -11
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/src/examples/auth-test.js +9 -6
- package/dist/src/gundb/db.js +4 -9
- package/dist/src/managers/CoreInitializer.js +1 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/gundb/db.d.ts +4 -8
- package/package.json +1 -1
|
@@ -123261,13 +123261,11 @@ var DataBase = /** @class */ (function () {
|
|
|
123261
123261
|
/**
|
|
123262
123262
|
* Constructs a new DataBase instance connected to a GunDB instance.
|
|
123263
123263
|
* @param gun The main GunDB instance.
|
|
123264
|
-
* @param appScope The namespace under which data/nodes are stored. Default: "shogun"
|
|
123265
123264
|
* @param core Optionally, the root Gun instance (unused in this context).
|
|
123266
123265
|
* @param sea Optional cryptography (Gun SEA) instance; will be auto-discovered if not provided.
|
|
123267
123266
|
* @throws If gun or gun.user() is not provided.
|
|
123268
123267
|
*/
|
|
123269
|
-
function DataBase(gun,
|
|
123270
|
-
if (appScope === void 0) { appScope = "shogun"; }
|
|
123268
|
+
function DataBase(gun, core, sea) {
|
|
123271
123269
|
var _a;
|
|
123272
123270
|
/** Cached user instance or `null` if not logged in */
|
|
123273
123271
|
this.user = null;
|
|
@@ -123299,17 +123297,14 @@ var DataBase = /** @class */ (function () {
|
|
|
123299
123297
|
}
|
|
123300
123298
|
}
|
|
123301
123299
|
this._rxjs = new RxJS(this.gun);
|
|
123302
|
-
this.node = this.gun.get(appScope);
|
|
123303
123300
|
this.usernamesNode = this.gun.get("usernames");
|
|
123304
123301
|
console.log("[DB] DataBase initialization completed");
|
|
123305
123302
|
}
|
|
123306
123303
|
/**
|
|
123307
|
-
*
|
|
123308
|
-
* @param appScope The new namespace.
|
|
123304
|
+
* Initialize the database instance.
|
|
123309
123305
|
*/
|
|
123310
|
-
DataBase.prototype.initialize = function (
|
|
123311
|
-
|
|
123312
|
-
this.node = this.gun.get(appScope);
|
|
123306
|
+
DataBase.prototype.initialize = function () {
|
|
123307
|
+
// Database is already initialized in constructor
|
|
123313
123308
|
};
|
|
123314
123309
|
/**
|
|
123315
123310
|
* Internal: subscribe to GunDB "auth" events and notify listeners.
|
|
@@ -124267,8 +124262,7 @@ var CoreInitializer = /** @class */ (function () {
|
|
|
124267
124262
|
sea = __webpack_require__.g.Gun.SEA;
|
|
124268
124263
|
}
|
|
124269
124264
|
}
|
|
124270
|
-
this.core.db = new DataBase(this.core._gun,
|
|
124271
|
-
this.core, sea);
|
|
124265
|
+
this.core.db = new DataBase(this.core._gun, this.core, sea);
|
|
124272
124266
|
return true;
|
|
124273
124267
|
}
|
|
124274
124268
|
catch (error) {
|