shogun-core 6.9.6 → 6.9.8
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.
|
@@ -95,6 +95,8 @@ var DataBaseHolster = /** @class */ (function () {
|
|
|
95
95
|
var _a;
|
|
96
96
|
/** Cached user instance or `null` if not logged in */
|
|
97
97
|
this.user = null;
|
|
98
|
+
this.prefix = '';
|
|
99
|
+
this.ev = {};
|
|
98
100
|
/** Registered callbacks for auth state changes */
|
|
99
101
|
this.onAuthCallbacks = [];
|
|
100
102
|
/** Whether the database instance has been destroyed */
|
|
@@ -1143,6 +1145,85 @@ var DataBaseHolster = /** @class */ (function () {
|
|
|
1143
1145
|
DataBaseHolster.prototype.emit = function (event, data) {
|
|
1144
1146
|
return this.eventEmitter.emit(event, data);
|
|
1145
1147
|
};
|
|
1148
|
+
// --- Firegun Methods Stubs ---
|
|
1149
|
+
DataBaseHolster.prototype._timeout = function (ms) {
|
|
1150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1151
|
+
return __generator(this, function (_a) {
|
|
1152
|
+
return [2 /*return*/, new Promise(function (resolve) { return setTimeout(resolve, ms); })];
|
|
1153
|
+
});
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
DataBaseHolster.prototype.Off = function (ev) {
|
|
1157
|
+
if (ev === void 0) { ev = 'default'; }
|
|
1158
|
+
console.warn('Off not implemented in DataBaseHolster');
|
|
1159
|
+
};
|
|
1160
|
+
DataBaseHolster.prototype.Listen = function (path, callback, prefix) {
|
|
1161
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1162
|
+
console.warn('Listen not implemented in DataBaseHolster');
|
|
1163
|
+
};
|
|
1164
|
+
DataBaseHolster.prototype.On = function (path, callback, ev, different, prefix) {
|
|
1165
|
+
if (ev === void 0) { ev = 'default'; }
|
|
1166
|
+
if (different === void 0) { different = true; }
|
|
1167
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1168
|
+
console.warn('On not implemented in DataBaseHolster');
|
|
1169
|
+
};
|
|
1170
|
+
DataBaseHolster.prototype.addContentAdressing = function (key, data) {
|
|
1171
|
+
return Promise.reject(new Error('addContentAdressing not implemented in DataBaseHolster'));
|
|
1172
|
+
};
|
|
1173
|
+
DataBaseHolster.prototype.userGet = function (path, repeat, prefix) {
|
|
1174
|
+
if (repeat === void 0) { repeat = 1; }
|
|
1175
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1176
|
+
return Promise.reject(new Error('userGet not implemented in DataBaseHolster'));
|
|
1177
|
+
};
|
|
1178
|
+
DataBaseHolster.prototype.userLoad = function (path, async, repeat, prefix) {
|
|
1179
|
+
if (async === void 0) { async = false; }
|
|
1180
|
+
if (repeat === void 0) { repeat = 1; }
|
|
1181
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1182
|
+
return Promise.reject(new Error('userLoad not implemented in DataBaseHolster'));
|
|
1183
|
+
};
|
|
1184
|
+
DataBaseHolster.prototype.Get = function (path, repeat, prefix) {
|
|
1185
|
+
if (repeat === void 0) { repeat = 1; }
|
|
1186
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1187
|
+
return Promise.reject(new Error('Get not implemented in DataBaseHolster'));
|
|
1188
|
+
};
|
|
1189
|
+
DataBaseHolster.prototype.userPut = function (path, data, async, prefix) {
|
|
1190
|
+
if (async === void 0) { async = false; }
|
|
1191
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1192
|
+
return Promise.reject(new Error('userPut not implemented in DataBaseHolster'));
|
|
1193
|
+
};
|
|
1194
|
+
DataBaseHolster.prototype.Set = function (path, data, async, prefix, opt) {
|
|
1195
|
+
if (async === void 0) { async = false; }
|
|
1196
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1197
|
+
if (opt === void 0) { opt = undefined; }
|
|
1198
|
+
return Promise.reject(new Error('Set not implemented in DataBaseHolster'));
|
|
1199
|
+
};
|
|
1200
|
+
DataBaseHolster.prototype.Put = function (path, data, async, prefix, opt) {
|
|
1201
|
+
if (async === void 0) { async = false; }
|
|
1202
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1203
|
+
if (opt === void 0) { opt = undefined; }
|
|
1204
|
+
return Promise.reject(new Error('Put not implemented in DataBaseHolster'));
|
|
1205
|
+
};
|
|
1206
|
+
DataBaseHolster.prototype.purge = function (path) {
|
|
1207
|
+
return Promise.reject(new Error('purge not implemented in DataBaseHolster'));
|
|
1208
|
+
};
|
|
1209
|
+
DataBaseHolster.prototype.userDel = function (path, putNull) {
|
|
1210
|
+
if (putNull === void 0) { putNull = true; }
|
|
1211
|
+
return Promise.reject(new Error('userDel not implemented in DataBaseHolster'));
|
|
1212
|
+
};
|
|
1213
|
+
DataBaseHolster.prototype.Del = function (path, putNull, cert) {
|
|
1214
|
+
if (putNull === void 0) { putNull = true; }
|
|
1215
|
+
if (cert === void 0) { cert = ''; }
|
|
1216
|
+
return Promise.reject(new Error('Del not implemented in DataBaseHolster'));
|
|
1217
|
+
};
|
|
1218
|
+
DataBaseHolster.prototype.Load = function (path, async, repeat, prefix) {
|
|
1219
|
+
if (async === void 0) { async = false; }
|
|
1220
|
+
if (repeat === void 0) { repeat = 1; }
|
|
1221
|
+
if (prefix === void 0) { prefix = this.prefix; }
|
|
1222
|
+
return Promise.reject(new Error('Load not implemented in DataBaseHolster'));
|
|
1223
|
+
};
|
|
1224
|
+
DataBaseHolster.prototype.generatePublicCert = function () {
|
|
1225
|
+
return Promise.reject(new Error('generatePublicCert not implemented in DataBaseHolster'));
|
|
1226
|
+
};
|
|
1146
1227
|
Object.defineProperty(DataBaseHolster.prototype, "gun", {
|
|
1147
1228
|
/**
|
|
1148
1229
|
* Get the Holster instance (for backward compatibility with gun property).
|