tnp 13.1.170 → 13.1.172
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/app.js +3 -3
- package/cli.js +592 -190
- package/lib/project/abstract/project/lib-project-standalone.backend.js +3 -0
- package/lib/project/features/files-recreation/files-templates/index.js +3 -3
- package/lib/project/features/npm-packages/npm-packages-helpers.backend.js +3 -0
- package/package.json +2 -2
- package/package.json_tnp.json5 +1 -1
- package/tmp-environment.json +8 -8
package/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
exports.
|
|
3
|
+
exports.dummy1678258427752 = void 0;
|
|
4
|
+
function dummy1678258427752() { }
|
|
5
|
+
exports.dummy1678258427752 = dummy1678258427752;
|
|
6
6
|
//# sourceMappingURL=app.js.map
|
package/cli.js
CHANGED
|
@@ -283267,7 +283267,6 @@ var BaseCRUD = /** @class */ (function () {
|
|
|
283267
283267
|
//#endregion
|
|
283268
283268
|
BaseCRUD.prototype.init = function () {
|
|
283269
283269
|
//#region @websql
|
|
283270
|
-
// debugger
|
|
283271
283270
|
var context = framework_context_1.FrameworkContext.findForTraget(this);
|
|
283272
283271
|
this.connection = context.connection;
|
|
283273
283272
|
if ((tnp_core_1.Helpers.isNode
|
|
@@ -284270,13 +284269,11 @@ function metaReq(method, path, target, propertyKey, descriptor, realtimeUpdate)
|
|
|
284270
284269
|
if (realtimeUpdate === void 0) { realtimeUpdate = false; }
|
|
284271
284270
|
var config = typescript_class_helpers_1.CLASS.getConfig(target.constructor);
|
|
284272
284271
|
// if (config.vChildren.length > 0) {
|
|
284273
|
-
// debugger
|
|
284274
284272
|
// }
|
|
284275
284273
|
config.methods[propertyKey] = (!config.methods[propertyKey] ? new models_1.Models.Rest.MethodConfig() : config.methods[propertyKey]);
|
|
284276
284274
|
var methodConfig = config.methods[propertyKey];
|
|
284277
284275
|
methodConfig.methodName = propertyKey;
|
|
284278
284276
|
methodConfig.type = method;
|
|
284279
|
-
// debugger
|
|
284280
284277
|
if (!path) {
|
|
284281
284278
|
var paramsPathConcatedPath = '';
|
|
284282
284279
|
for (var key in methodConfig.parameters) {
|
|
@@ -284561,6 +284558,7 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284561
284558
|
function FrameworkContextNodeApp(context) {
|
|
284562
284559
|
var _this = _super.call(this) || this;
|
|
284563
284560
|
_this.context = context;
|
|
284561
|
+
_this.entitiesTriggers = {};
|
|
284564
284562
|
_this.activeRoutes = [];
|
|
284565
284563
|
return _this;
|
|
284566
284564
|
}
|
|
@@ -284585,21 +284583,159 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284585
284583
|
return [4 /*yield*/, this.connection.initialize()];
|
|
284586
284584
|
case 3:
|
|
284587
284585
|
_a.sent();
|
|
284586
|
+
console.log('this.connection.isInitialized', this.connection.isInitialized);
|
|
284588
284587
|
return [3 /*break*/, 5];
|
|
284589
284588
|
case 4:
|
|
284590
284589
|
error_1 = _a.sent();
|
|
284591
284590
|
tnp_core_1.Helpers.error(error_1, false, true);
|
|
284591
|
+
process.exit(1);
|
|
284592
284592
|
return [3 /*break*/, 5];
|
|
284593
284593
|
case 5:
|
|
284594
|
-
|
|
284594
|
+
if (!this.connection.isInitialized) {
|
|
284595
|
+
console.log(this.connection);
|
|
284596
|
+
tnp_core_1.Helpers.error('Something wrong with connection init', false, true);
|
|
284597
|
+
}
|
|
284598
|
+
tnp_core_1.Helpers.info("PREPARING TYPEORM CONNECTION DONE. initialize=".concat(this.connection.isInitialized));
|
|
284595
284599
|
return [2 /*return*/];
|
|
284596
284600
|
}
|
|
284597
284601
|
});
|
|
284598
284602
|
});
|
|
284599
284603
|
};
|
|
284604
|
+
FrameworkContextNodeApp.prototype.initSubscribers = function () {
|
|
284605
|
+
var _this = this;
|
|
284606
|
+
//#region @websql
|
|
284607
|
+
var entities = this.context.entitiesClasses;
|
|
284608
|
+
var _loop_1 = function (index) {
|
|
284609
|
+
var Entity = entities[index];
|
|
284610
|
+
var className = typescript_class_helpers_1.CLASS.getName(Entity);
|
|
284611
|
+
this_1.entitiesTriggers[className] = tnp_core_1._.debounce(function () {
|
|
284612
|
+
_this.context.node.realtime.TrigggerEntityTableChanges(Entity);
|
|
284613
|
+
}, 1000);
|
|
284614
|
+
var notifyFn = function (nameOfEvent, entityData) {
|
|
284615
|
+
// console.log('trigger table event: ',nameOfEvent)
|
|
284616
|
+
_this.entitiesTriggers[className]();
|
|
284617
|
+
};
|
|
284618
|
+
//#region sub
|
|
284619
|
+
var sub = {
|
|
284620
|
+
listenTo: function () {
|
|
284621
|
+
return Entity;
|
|
284622
|
+
},
|
|
284623
|
+
/**
|
|
284624
|
+
* Called after entity is loaded.
|
|
284625
|
+
*/
|
|
284626
|
+
afterLoad: function (entity) {
|
|
284627
|
+
// notifyFn(`AFTER ENTITY LOADED: `, entity)
|
|
284628
|
+
}
|
|
284629
|
+
/**
|
|
284630
|
+
* Called before post insertion.
|
|
284631
|
+
*/ ,
|
|
284632
|
+
beforeInsert: function (event) {
|
|
284633
|
+
notifyFn("BEFORE POST INSERTED: ", event.entity);
|
|
284634
|
+
}
|
|
284635
|
+
/**
|
|
284636
|
+
* Called after entity insertion.
|
|
284637
|
+
*/ ,
|
|
284638
|
+
afterInsert: function (event) {
|
|
284639
|
+
notifyFn("AFTER ENTITY INSERTED: ", event.entity);
|
|
284640
|
+
}
|
|
284641
|
+
/**
|
|
284642
|
+
* Called before entity update.
|
|
284643
|
+
*/ ,
|
|
284644
|
+
beforeUpdate: function (event) {
|
|
284645
|
+
notifyFn("BEFORE ENTITY UPDATED: ", event.entity);
|
|
284646
|
+
}
|
|
284647
|
+
/**
|
|
284648
|
+
* Called after entity update.
|
|
284649
|
+
*/ ,
|
|
284650
|
+
afterUpdate: function (event) {
|
|
284651
|
+
notifyFn("AFTER ENTITY UPDATED: ", event.entity);
|
|
284652
|
+
}
|
|
284653
|
+
/**
|
|
284654
|
+
* Called before entity removal.
|
|
284655
|
+
*/ ,
|
|
284656
|
+
beforeRemove: function (event) {
|
|
284657
|
+
notifyFn("BEFORE ENTITY WITH ID ".concat(event.entityId, " REMOVED: "), event.entity);
|
|
284658
|
+
}
|
|
284659
|
+
/**
|
|
284660
|
+
* Called after entity removal.
|
|
284661
|
+
*/ ,
|
|
284662
|
+
afterRemove: function (event) {
|
|
284663
|
+
notifyFn("AFTER ENTITY WITH ID ".concat(event.entityId, " REMOVED: "), event.entity);
|
|
284664
|
+
}
|
|
284665
|
+
/**
|
|
284666
|
+
* Called before entity removal.
|
|
284667
|
+
*/ ,
|
|
284668
|
+
beforeSoftRemove: function (event) {
|
|
284669
|
+
notifyFn("BEFORE ENTITY WITH ID ".concat(event.entityId, " SOFT REMOVED: "), event.entity);
|
|
284670
|
+
}
|
|
284671
|
+
/**
|
|
284672
|
+
* Called after entity removal.
|
|
284673
|
+
*/ ,
|
|
284674
|
+
afterSoftRemove: function (event) {
|
|
284675
|
+
notifyFn("AFTER ENTITY WITH ID ".concat(event.entityId, " SOFT REMOVED: "), event.entity);
|
|
284676
|
+
}
|
|
284677
|
+
/**
|
|
284678
|
+
* Called before entity recovery.
|
|
284679
|
+
*/ ,
|
|
284680
|
+
beforeRecover: function (event) {
|
|
284681
|
+
notifyFn("BEFORE ENTITY WITH ID ".concat(event.entityId, " RECOVERED: "), event.entity);
|
|
284682
|
+
}
|
|
284683
|
+
/**
|
|
284684
|
+
* Called after entity recovery.
|
|
284685
|
+
*/ ,
|
|
284686
|
+
afterRecover: function (event) {
|
|
284687
|
+
notifyFn("AFTER ENTITY WITH ID ".concat(event.entityId, " RECOVERED: "), event.entity);
|
|
284688
|
+
}
|
|
284689
|
+
/**
|
|
284690
|
+
* Called before transaction start.
|
|
284691
|
+
*/ ,
|
|
284692
|
+
beforeTransactionStart: function (event) {
|
|
284693
|
+
notifyFn("BEFORE TRANSACTION STARTED: ", event);
|
|
284694
|
+
}
|
|
284695
|
+
/**
|
|
284696
|
+
* Called after transaction start.
|
|
284697
|
+
*/ ,
|
|
284698
|
+
afterTransactionStart: function (event) {
|
|
284699
|
+
notifyFn("AFTER TRANSACTION STARTED: ", event);
|
|
284700
|
+
}
|
|
284701
|
+
/**
|
|
284702
|
+
* Called before transaction commit.
|
|
284703
|
+
*/ ,
|
|
284704
|
+
beforeTransactionCommit: function (event) {
|
|
284705
|
+
notifyFn("BEFORE TRANSACTION COMMITTED: ", event);
|
|
284706
|
+
}
|
|
284707
|
+
/**
|
|
284708
|
+
* Called after transaction commit.
|
|
284709
|
+
*/ ,
|
|
284710
|
+
afterTransactionCommit: function (event) {
|
|
284711
|
+
notifyFn("AFTER TRANSACTION COMMITTED: ", event);
|
|
284712
|
+
}
|
|
284713
|
+
/**
|
|
284714
|
+
* Called before transaction rollback.
|
|
284715
|
+
*/ ,
|
|
284716
|
+
beforeTransactionRollback: function (event) {
|
|
284717
|
+
notifyFn("BEFORE TRANSACTION ROLLBACK: ", event);
|
|
284718
|
+
}
|
|
284719
|
+
/**
|
|
284720
|
+
* Called after transaction rollback.
|
|
284721
|
+
*/ ,
|
|
284722
|
+
afterTransactionRollback: function (event) {
|
|
284723
|
+
notifyFn("AFTER TRANSACTION ROLLBACK: ", event);
|
|
284724
|
+
}
|
|
284725
|
+
};
|
|
284726
|
+
//#endregion
|
|
284727
|
+
// @ts-ignore
|
|
284728
|
+
this_1.context.connection.subscribers.push(sub);
|
|
284729
|
+
};
|
|
284730
|
+
var this_1 = this;
|
|
284731
|
+
for (var index = 0; index < entities.length; index++) {
|
|
284732
|
+
_loop_1(index);
|
|
284733
|
+
}
|
|
284734
|
+
//#endregion
|
|
284735
|
+
};
|
|
284600
284736
|
FrameworkContextNodeApp.prototype.init = function () {
|
|
284601
284737
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
284602
|
-
var h, contexts,
|
|
284738
|
+
var h, contexts, instancesOfControllers, index, controllerInstance;
|
|
284603
284739
|
var _this = this;
|
|
284604
284740
|
return tslib_1.__generator(this, function (_a) {
|
|
284605
284741
|
switch (_a.label) {
|
|
@@ -284625,10 +284761,13 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284625
284761
|
return [4 /*yield*/, this.initConnection()];
|
|
284626
284762
|
case 2:
|
|
284627
284763
|
//#endregion
|
|
284764
|
+
_a.sent();
|
|
284765
|
+
return [4 /*yield*/, this.initSubscribers()];
|
|
284766
|
+
case 3:
|
|
284628
284767
|
_a.sent();
|
|
284629
284768
|
this.initDecoratorsFunctions();
|
|
284630
284769
|
return [4 /*yield*/, Promise.resolve().then(function () { return __nccwpck_require__(37674); })];
|
|
284631
|
-
case
|
|
284770
|
+
case 4:
|
|
284632
284771
|
contexts = (_a.sent()).FrameworkContext.contexts;
|
|
284633
284772
|
//#region @websql
|
|
284634
284773
|
this.writeActiveRoutes(contexts);
|
|
@@ -284640,14 +284779,9 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284640
284779
|
//#endregion
|
|
284641
284780
|
// @ts-ignore
|
|
284642
284781
|
this.realtime = new realtime_1.RealtimeNodejs(this.context);
|
|
284643
|
-
localStorageKey = ('firedev.initExampleDbData.inited');
|
|
284644
|
-
dropSchema = this.context.config.dropSchema;
|
|
284645
284782
|
instancesOfControllers = this.context
|
|
284646
284783
|
.allControllersInstances
|
|
284647
284784
|
.filter(function (f) { return tnp_core_1._.isFunction(f.initExampleDbData); });
|
|
284648
|
-
if (!!dropSchema) return [3 /*break*/, 4];
|
|
284649
|
-
return [3 /*break*/, 8];
|
|
284650
|
-
case 4:
|
|
284651
284785
|
index = 0;
|
|
284652
284786
|
_a.label = 5;
|
|
284653
284787
|
case 5:
|
|
@@ -284689,7 +284823,7 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284689
284823
|
if (isWorker === void 0) { isWorker = false; }
|
|
284690
284824
|
//#region @websql
|
|
284691
284825
|
var routes = [];
|
|
284692
|
-
var
|
|
284826
|
+
var _loop_2 = function (index) {
|
|
284693
284827
|
var context = contexts[index];
|
|
284694
284828
|
var troutes = context.node.activeRoutes.map(function (_a) {
|
|
284695
284829
|
var method = _a.method, routePath = _a.routePath;
|
|
@@ -284719,7 +284853,7 @@ var FrameworkContextNodeApp = /** @class */ (function (_super) {
|
|
|
284719
284853
|
}
|
|
284720
284854
|
};
|
|
284721
284855
|
for (var index = 0; index < contexts.length; index++) {
|
|
284722
|
-
|
|
284856
|
+
_loop_2(index);
|
|
284723
284857
|
}
|
|
284724
284858
|
var fileName = tnp_core_2.path.join(
|
|
284725
284859
|
//#region @backend
|
|
@@ -285285,7 +285419,7 @@ function Controller(options) {
|
|
|
285285
285419
|
// if (Helpers.isBrowser && _.isFunction(rep)) {
|
|
285286
285420
|
// target = rep;
|
|
285287
285421
|
// }
|
|
285288
|
-
//
|
|
285422
|
+
//
|
|
285289
285423
|
if (autoinit) {
|
|
285290
285424
|
// console.log(`AUTOINTI!!!!! Options for ${target.name}, partnt ${target['__proto__'].name}`, options)
|
|
285291
285425
|
(0, decorators_endpoint_class_1.__ENDPOINT)(target)(target);
|
|
@@ -285609,7 +285743,7 @@ function start(options) {
|
|
|
285609
285743
|
return new Promise(function (resolve, reject) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
285610
285744
|
var _a, host, _b, controllers, _c, entities, disabledRealtime, allowedHosts, session,
|
|
285611
285745
|
//#region @websql
|
|
285612
|
-
mode, config, InitDataPriority, _d, publicAssets, _e, middlewares, oneHour, context;
|
|
285746
|
+
mode, config, InitDataPriority, _d, publicAssets, _e, middlewares, oneHour, c, context;
|
|
285613
285747
|
return tslib_1.__generator(this, function (_f) {
|
|
285614
285748
|
switch (_f.label) {
|
|
285615
285749
|
case 0:
|
|
@@ -285642,6 +285776,12 @@ function start(options) {
|
|
|
285642
285776
|
axios_1.default.defaults.withCredentials = true;
|
|
285643
285777
|
}
|
|
285644
285778
|
}
|
|
285779
|
+
//#region @websql
|
|
285780
|
+
if (config) {
|
|
285781
|
+
c = config;
|
|
285782
|
+
c.dropSchema = true;
|
|
285783
|
+
c.synchronize = true;
|
|
285784
|
+
}
|
|
285645
285785
|
context = new framework_context_1.FrameworkContext({
|
|
285646
285786
|
host: host,
|
|
285647
285787
|
controllers: controllers,
|
|
@@ -286477,7 +286617,7 @@ function initMethodBrowser(target, type, methodConfig, expressPath) {
|
|
|
286477
286617
|
/* */
|
|
286478
286618
|
/* */
|
|
286479
286619
|
/* */
|
|
286480
|
-
//
|
|
286620
|
+
// FRONTEND PATHES
|
|
286481
286621
|
// console.log(`FRONTEND ${target.name} method on ${expressPath}`)
|
|
286482
286622
|
target.prototype[methodConfig.methodName] = function () {
|
|
286483
286623
|
// console.log('FRONTEND expressPath', expressPath)
|
|
@@ -286514,7 +286654,6 @@ function initMethodBrowser(target, type, methodConfig, expressPath) {
|
|
|
286514
286654
|
break;
|
|
286515
286655
|
}
|
|
286516
286656
|
}
|
|
286517
|
-
// debugger
|
|
286518
286657
|
if (currentParam.paramType === 'Path') {
|
|
286519
286658
|
pathPrams[currentParam.paramName] = param;
|
|
286520
286659
|
}
|
|
@@ -286569,7 +286708,6 @@ function initMethodBrowser(target, type, methodConfig, expressPath) {
|
|
|
286569
286708
|
}
|
|
286570
286709
|
}
|
|
286571
286710
|
});
|
|
286572
|
-
// debugger;
|
|
286573
286711
|
if (typeof item === 'object') {
|
|
286574
286712
|
var circuralFromItem_1 = [];
|
|
286575
286713
|
item = helpers_1.MorphiHelpers.JSON.parse(helpers_1.MorphiHelpers.JSON.stringify(item, void 0, void 0, function (circs) {
|
|
@@ -286913,6 +287051,267 @@ var Models;
|
|
|
286913
287051
|
|
|
286914
287052
|
/***/ }),
|
|
286915
287053
|
|
|
287054
|
+
/***/ 21262:
|
|
287055
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
287056
|
+
|
|
287057
|
+
"use strict";
|
|
287058
|
+
|
|
287059
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
287060
|
+
exports.mockIoClient = exports.BroadcastApiIoMockClient = void 0;
|
|
287061
|
+
var tslib_1 = __nccwpck_require__(93011);
|
|
287062
|
+
var ng2_logger_1 = __nccwpck_require__(85053);
|
|
287063
|
+
var typescript_class_helpers_1 = __nccwpck_require__(52468);
|
|
287064
|
+
var broadcast_channel_dummy_1 = __nccwpck_require__(66652);
|
|
287065
|
+
var log = ng2_logger_1.Log.create('[CLIENT] broadcast api mock', ng2_logger_1.Level.__NOTHING);
|
|
287066
|
+
var BroadcastApiIoMockClient = /** @class */ (function () {
|
|
287067
|
+
function BroadcastApiIoMockClient(originUrl, options) {
|
|
287068
|
+
this.allowedToListenRooms = [];
|
|
287069
|
+
this._url = new URL(originUrl);
|
|
287070
|
+
this.nsp = this._url.pathname;
|
|
287071
|
+
}
|
|
287072
|
+
BroadcastApiIoMockClient_1 = BroadcastApiIoMockClient;
|
|
287073
|
+
BroadcastApiIoMockClient._instaceKey = function (origin, pathname) {
|
|
287074
|
+
// return `${origin}${pathname}`; // TODO quick fix
|
|
287075
|
+
return origin;
|
|
287076
|
+
};
|
|
287077
|
+
BroadcastApiIoMockClient._isntanceBy = function (origin, options) {
|
|
287078
|
+
var key = BroadcastApiIoMockClient_1._instaceKey(origin, '' // options?.path
|
|
287079
|
+
);
|
|
287080
|
+
if (!BroadcastApiIoMockClient_1._instances[key]) {
|
|
287081
|
+
BroadcastApiIoMockClient_1._instances[key] = new BroadcastApiIoMockClient_1(origin, options);
|
|
287082
|
+
}
|
|
287083
|
+
return BroadcastApiIoMockClient_1._instances[key];
|
|
287084
|
+
};
|
|
287085
|
+
BroadcastApiIoMockClient.connect = function (origin, options) {
|
|
287086
|
+
return BroadcastApiIoMockClient_1._isntanceBy(origin, options);
|
|
287087
|
+
};
|
|
287088
|
+
BroadcastApiIoMockClient.prototype.on = function (roomNameAsEvent, callback) {
|
|
287089
|
+
var _this = this;
|
|
287090
|
+
if (roomNameAsEvent === 'connect') {
|
|
287091
|
+
setTimeout(function () {
|
|
287092
|
+
callback();
|
|
287093
|
+
});
|
|
287094
|
+
return;
|
|
287095
|
+
}
|
|
287096
|
+
var room = broadcast_channel_dummy_1.IsomorphicBroadCastChannel.for(roomNameAsEvent, this._url.href);
|
|
287097
|
+
room.onmessage = function (messageEvent) {
|
|
287098
|
+
if (_this.allowedToListenRooms.includes(roomNameAsEvent)) {
|
|
287099
|
+
// log.i('PUSHING' + JSON.stringify({ data: messageEvent?.data }))
|
|
287100
|
+
callback(messageEvent === null || messageEvent === void 0 ? void 0 : messageEvent.data);
|
|
287101
|
+
}
|
|
287102
|
+
else {
|
|
287103
|
+
// log.i('NOT PUSHING')
|
|
287104
|
+
}
|
|
287105
|
+
};
|
|
287106
|
+
};
|
|
287107
|
+
BroadcastApiIoMockClient.prototype.emit = function (roomNameForSubOrUnsub, data) {
|
|
287108
|
+
var room = broadcast_channel_dummy_1.IsomorphicBroadCastChannel.for(roomNameForSubOrUnsub, this._url.href);
|
|
287109
|
+
// log.i('emit data', data)
|
|
287110
|
+
room.postMessage(data);
|
|
287111
|
+
};
|
|
287112
|
+
var BroadcastApiIoMockClient_1;
|
|
287113
|
+
BroadcastApiIoMockClient._instances = {};
|
|
287114
|
+
BroadcastApiIoMockClient = BroadcastApiIoMockClient_1 = tslib_1.__decorate([
|
|
287115
|
+
typescript_class_helpers_1.CLASS.NAME('BroadcastApiIoMockClient'),
|
|
287116
|
+
tslib_1.__metadata("design:paramtypes", [String, Object])
|
|
287117
|
+
], BroadcastApiIoMockClient);
|
|
287118
|
+
return BroadcastApiIoMockClient;
|
|
287119
|
+
}());
|
|
287120
|
+
exports.BroadcastApiIoMockClient = BroadcastApiIoMockClient;
|
|
287121
|
+
exports.mockIoClient = BroadcastApiIoMockClient;
|
|
287122
|
+
//# sourceMappingURL=broadcast-api-io-mock-client.js.map
|
|
287123
|
+
|
|
287124
|
+
/***/ }),
|
|
287125
|
+
|
|
287126
|
+
/***/ 34356:
|
|
287127
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
287128
|
+
|
|
287129
|
+
"use strict";
|
|
287130
|
+
|
|
287131
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
287132
|
+
exports.mockIoServer = exports.BroadcastApiIoMockServer = exports.BroadcastApiIoMockServerSocket = void 0;
|
|
287133
|
+
//#region import
|
|
287134
|
+
var ng2_logger_1 = __nccwpck_require__(85053);
|
|
287135
|
+
var typescript_class_helpers_1 = __nccwpck_require__(52468);
|
|
287136
|
+
var symbols_1 = __nccwpck_require__(91804);
|
|
287137
|
+
var broadcast_channel_dummy_1 = __nccwpck_require__(66652);
|
|
287138
|
+
//#endregion
|
|
287139
|
+
var log = ng2_logger_1.Log.create('[SERVER] broadcast api mock', ng2_logger_1.Level.__NOTHING);
|
|
287140
|
+
//#region server - namespace
|
|
287141
|
+
var BroadcastApiIoMockServerSocket = /** @class */ (function () {
|
|
287142
|
+
function BroadcastApiIoMockServerSocket(server) {
|
|
287143
|
+
this.server = server;
|
|
287144
|
+
}
|
|
287145
|
+
Object.defineProperty(BroadcastApiIoMockServerSocket.prototype, "currentClient", {
|
|
287146
|
+
get: function () {
|
|
287147
|
+
var BroadcastApiIoMockClientClass = typescript_class_helpers_1.CLASS.getBy('BroadcastApiIoMockClient');
|
|
287148
|
+
var ins = BroadcastApiIoMockClientClass._isntanceBy(this.server._url.origin, { path: this.server._url.pathname });
|
|
287149
|
+
return ins;
|
|
287150
|
+
},
|
|
287151
|
+
enumerable: false,
|
|
287152
|
+
configurable: true
|
|
287153
|
+
});
|
|
287154
|
+
Object.defineProperty(BroadcastApiIoMockServerSocket.prototype, "nsp", {
|
|
287155
|
+
get: function () {
|
|
287156
|
+
return {
|
|
287157
|
+
get name() {
|
|
287158
|
+
return '/'; /// I am actuall not using namespaces
|
|
287159
|
+
}
|
|
287160
|
+
};
|
|
287161
|
+
},
|
|
287162
|
+
enumerable: false,
|
|
287163
|
+
configurable: true
|
|
287164
|
+
});
|
|
287165
|
+
/**
|
|
287166
|
+
* Backend gets notyfications from client
|
|
287167
|
+
*/
|
|
287168
|
+
BroadcastApiIoMockServerSocket.prototype.on = function (roomNameToListen, callback) {
|
|
287169
|
+
if ([
|
|
287170
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.CUSTOM,
|
|
287171
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_UPDATE_EVENTS,
|
|
287172
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS,
|
|
287173
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.CUSTOM,
|
|
287174
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_UPDATE_EVENTS,
|
|
287175
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS,
|
|
287176
|
+
].includes(roomNameToListen)) {
|
|
287177
|
+
var room = broadcast_channel_dummy_1.IsomorphicBroadCastChannel.for(roomNameToListen, this.server._url.href);
|
|
287178
|
+
room.onmessage = function (e) {
|
|
287179
|
+
callback(e.data);
|
|
287180
|
+
};
|
|
287181
|
+
}
|
|
287182
|
+
};
|
|
287183
|
+
BroadcastApiIoMockServerSocket.prototype.join = function (roomName) {
|
|
287184
|
+
this.currentClient.allowedToListenRooms.push(roomName);
|
|
287185
|
+
};
|
|
287186
|
+
BroadcastApiIoMockServerSocket.prototype.leave = function (roomName) {
|
|
287187
|
+
var roomToClose = broadcast_channel_dummy_1.IsomorphicBroadCastChannel.for(roomName, this.server._url.href);
|
|
287188
|
+
if (roomToClose) {
|
|
287189
|
+
roomToClose.close();
|
|
287190
|
+
this.currentClient.allowedToListenRooms = this.currentClient.allowedToListenRooms
|
|
287191
|
+
.filter(function (allowedRoomTolisten) { return allowedRoomTolisten !== roomName; });
|
|
287192
|
+
}
|
|
287193
|
+
};
|
|
287194
|
+
return BroadcastApiIoMockServerSocket;
|
|
287195
|
+
}());
|
|
287196
|
+
exports.BroadcastApiIoMockServerSocket = BroadcastApiIoMockServerSocket;
|
|
287197
|
+
//#endregion
|
|
287198
|
+
//#region server
|
|
287199
|
+
var BroadcastApiIoMockServer = /** @class */ (function () {
|
|
287200
|
+
function BroadcastApiIoMockServer(httpServer, options) {
|
|
287201
|
+
/* */
|
|
287202
|
+
/* */
|
|
287203
|
+
/* */
|
|
287204
|
+
/* */
|
|
287205
|
+
}
|
|
287206
|
+
BroadcastApiIoMockServer.prototype.path = function () {
|
|
287207
|
+
return this._url.pathname;
|
|
287208
|
+
};
|
|
287209
|
+
BroadcastApiIoMockServer.prototype.on = function (action, callback) {
|
|
287210
|
+
var _this = this;
|
|
287211
|
+
setTimeout(function () {
|
|
287212
|
+
callback(_this.socket);
|
|
287213
|
+
});
|
|
287214
|
+
};
|
|
287215
|
+
BroadcastApiIoMockServer.prototype.in = function (roomName) {
|
|
287216
|
+
var _this = this;
|
|
287217
|
+
return {
|
|
287218
|
+
// eventName=roomName
|
|
287219
|
+
emit: function (eventName, data) {
|
|
287220
|
+
var room = broadcast_channel_dummy_1.IsomorphicBroadCastChannel.for(roomName, _this._url.href);
|
|
287221
|
+
room.postMessage(data);
|
|
287222
|
+
}
|
|
287223
|
+
};
|
|
287224
|
+
};
|
|
287225
|
+
return BroadcastApiIoMockServer;
|
|
287226
|
+
}());
|
|
287227
|
+
exports.BroadcastApiIoMockServer = BroadcastApiIoMockServer;
|
|
287228
|
+
//#endregion
|
|
287229
|
+
//#region io
|
|
287230
|
+
var mockIoServer = function (httpServer, options) {
|
|
287231
|
+
return new BroadcastApiIoMockServer(httpServer, options);
|
|
287232
|
+
};
|
|
287233
|
+
exports.mockIoServer = mockIoServer;
|
|
287234
|
+
//#endregion
|
|
287235
|
+
//# sourceMappingURL=broadcast-api-io-mock-server.js.map
|
|
287236
|
+
|
|
287237
|
+
/***/ }),
|
|
287238
|
+
|
|
287239
|
+
/***/ 66652:
|
|
287240
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
287241
|
+
|
|
287242
|
+
"use strict";
|
|
287243
|
+
|
|
287244
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
287245
|
+
exports.IsomorphicBroadCastChannel = void 0;
|
|
287246
|
+
var ng2_logger_1 = __nccwpck_require__(85053);
|
|
287247
|
+
var rxjs_1 = __nccwpck_require__(16666);
|
|
287248
|
+
//#region @backend
|
|
287249
|
+
var url_1 = __nccwpck_require__(57310);
|
|
287250
|
+
//#endregion
|
|
287251
|
+
var log = ng2_logger_1.Log.create('[CLIENT/SERVER] broadcast dummy channel', ng2_logger_1.Level.__NOTHING);
|
|
287252
|
+
var IsomorphicBroadCastChannel = /** @class */ (function () {
|
|
287253
|
+
function IsomorphicBroadCastChannel(serverHref, eventName) {
|
|
287254
|
+
var _this = this;
|
|
287255
|
+
this.serverHref = serverHref;
|
|
287256
|
+
this.eventName = eventName;
|
|
287257
|
+
this.callbacks = [];
|
|
287258
|
+
this.sub = new rxjs_1.Subject();
|
|
287259
|
+
// log.info(`Creating room for event: ${eventName} on server href: ${serverHref}`);
|
|
287260
|
+
this.subscribtion = this.sub.subscribe(function (data) {
|
|
287261
|
+
// log.info(`NEW SUBSCRIBE DATA ${eventName} / ${serverHref}`, {
|
|
287262
|
+
// calbacksCount: this.callbacks.length,
|
|
287263
|
+
// rooms: IsomorphicBroadCastChannel.hosts,
|
|
287264
|
+
// });
|
|
287265
|
+
_this.callbacks.forEach(function (callback) {
|
|
287266
|
+
// log.info(`Trigger callback ${eventName} / ${serverHref}`);
|
|
287267
|
+
// console.log({ callback })
|
|
287268
|
+
callback({
|
|
287269
|
+
data: data
|
|
287270
|
+
});
|
|
287271
|
+
});
|
|
287272
|
+
});
|
|
287273
|
+
}
|
|
287274
|
+
IsomorphicBroadCastChannel.for = function (eventName, serverHref) {
|
|
287275
|
+
var url = new url_1.URL(serverHref);
|
|
287276
|
+
// TODO QUICK FIX
|
|
287277
|
+
serverHref = url.origin;
|
|
287278
|
+
if (!IsomorphicBroadCastChannel.hosts[serverHref]) {
|
|
287279
|
+
IsomorphicBroadCastChannel.hosts[serverHref] = {
|
|
287280
|
+
events: {}
|
|
287281
|
+
};
|
|
287282
|
+
}
|
|
287283
|
+
if (!IsomorphicBroadCastChannel.hosts[serverHref].events[eventName]) {
|
|
287284
|
+
IsomorphicBroadCastChannel.hosts[serverHref].events[eventName] = new IsomorphicBroadCastChannel(serverHref, eventName);
|
|
287285
|
+
}
|
|
287286
|
+
var event = IsomorphicBroadCastChannel.hosts[serverHref].events[eventName];
|
|
287287
|
+
return event;
|
|
287288
|
+
};
|
|
287289
|
+
Object.defineProperty(IsomorphicBroadCastChannel.prototype, "onmessage", {
|
|
287290
|
+
set: function (callback) {
|
|
287291
|
+
this.callbacks.push(callback);
|
|
287292
|
+
},
|
|
287293
|
+
enumerable: false,
|
|
287294
|
+
configurable: true
|
|
287295
|
+
});
|
|
287296
|
+
IsomorphicBroadCastChannel.prototype.postMessage = function (data) {
|
|
287297
|
+
var _this = this;
|
|
287298
|
+
setTimeout(function () {
|
|
287299
|
+
_this.sub.next(data);
|
|
287300
|
+
});
|
|
287301
|
+
};
|
|
287302
|
+
IsomorphicBroadCastChannel.prototype.close = function () {
|
|
287303
|
+
// log.info('closing');
|
|
287304
|
+
this.subscribtion.unsubscribe();
|
|
287305
|
+
delete IsomorphicBroadCastChannel.hosts[this.serverHref].events[this.eventName];
|
|
287306
|
+
};
|
|
287307
|
+
IsomorphicBroadCastChannel.hosts = {};
|
|
287308
|
+
return IsomorphicBroadCastChannel;
|
|
287309
|
+
}());
|
|
287310
|
+
exports.IsomorphicBroadCastChannel = IsomorphicBroadCastChannel;
|
|
287311
|
+
//# sourceMappingURL=broadcast-channel-dummy.js.map
|
|
287312
|
+
|
|
287313
|
+
/***/ }),
|
|
287314
|
+
|
|
286916
287315
|
/***/ 83066:
|
|
286917
287316
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
286918
287317
|
|
|
@@ -286944,55 +287343,62 @@ var framework_context_1 = __nccwpck_require__(37674);
|
|
|
286944
287343
|
var symbols_1 = __nccwpck_require__(91804);
|
|
286945
287344
|
var realtime_1 = __nccwpck_require__(26806);
|
|
286946
287345
|
var tnp_core_1 = __nccwpck_require__(76776);
|
|
286947
|
-
var
|
|
287346
|
+
var ioClientIo = __nccwpck_require__(62889);
|
|
286948
287347
|
var typescript_class_helpers_1 = __nccwpck_require__(52468);
|
|
286949
287348
|
var rxjs_1 = __nccwpck_require__(16666);
|
|
286950
287349
|
var realtime_subs_manager_1 = __nccwpck_require__(79283);
|
|
287350
|
+
//#region @websql
|
|
287351
|
+
var broadcast_api_io_mock_client_1 = __nccwpck_require__(21262);
|
|
287352
|
+
//#endregion
|
|
286951
287353
|
var log = ng2_logger_1.Log.create('REALTIME RXJS', ng2_logger_1.Level.__NOTHING);
|
|
286952
287354
|
var RealtimeBrowserRxjs = /** @class */ (function () {
|
|
286953
287355
|
//#region constructor
|
|
286954
287356
|
function RealtimeBrowserRxjs(context) {
|
|
286955
287357
|
this.context = context;
|
|
286956
|
-
if (tnp_core_1.Helpers.isWebSQL) {
|
|
286957
|
-
console.log('WEBSQL BROWSER/BROWSER broadcast api communicaiton initing...');
|
|
286958
|
-
}
|
|
286959
|
-
else {
|
|
286960
|
-
this.initStandardSocketCommunication(context);
|
|
286961
|
-
}
|
|
286962
|
-
}
|
|
286963
|
-
//#endregion
|
|
286964
|
-
//#region init standard socket communucatuib
|
|
286965
|
-
RealtimeBrowserRxjs.prototype.initStandardSocketCommunication = function (context) {
|
|
286966
287358
|
var base = realtime_1.RealtimeBase.by(context);
|
|
286967
287359
|
// Helpers.log('INITING SOCKETS')
|
|
286968
|
-
if (!context.disabledRealtime
|
|
287360
|
+
if (!context.disabledRealtime) {
|
|
287361
|
+
var io
|
|
287362
|
+
//#region @websql
|
|
287363
|
+
= (ioClientIo === null || ioClientIo === void 0 ? void 0 : ioClientIo.default) ? ioClientIo.default : ioClientIo;
|
|
287364
|
+
if (tnp_core_1.Helpers.isWebSQL) {
|
|
287365
|
+
// @ts-ignore
|
|
287366
|
+
io = broadcast_api_io_mock_client_1.mockIoClient;
|
|
287367
|
+
}
|
|
286969
287368
|
var nspPath = {
|
|
286970
287369
|
global: base.pathFor(),
|
|
286971
287370
|
realtime: base.pathFor(symbols_1.SYMBOL.REALTIME.NAMESPACE)
|
|
286972
287371
|
};
|
|
286973
|
-
log.i('NAMESPACE GLOBAL ', nspPath.global.href + " host: ".concat(context.host));
|
|
286974
|
-
log.i('NAMESPACE REALTIME', nspPath.realtime.href + " host: ".concat(context.host));
|
|
287372
|
+
log.i('[CLIENT] NAMESPACE GLOBAL ', nspPath.global.href + " host: ".concat(context.host));
|
|
287373
|
+
log.i('[CLIENT] NAMESPACE REALTIME', nspPath.realtime.href + " host: ".concat(context.host));
|
|
286975
287374
|
var global_1 = io.connect(nspPath.global.origin, {
|
|
286976
287375
|
path: nspPath.global.pathname
|
|
286977
287376
|
});
|
|
286978
|
-
base.
|
|
287377
|
+
base.FE = global_1;
|
|
286979
287378
|
global_1.on('connect', function () {
|
|
286980
|
-
log.i("conented to GLOBAL namespace ".concat(global_1.nsp, " of host: ").concat(context.host));
|
|
287379
|
+
log.i("[CLIENT] conented to GLOBAL namespace ".concat(global_1.nsp, " of host: ").concat(context.host));
|
|
286981
287380
|
});
|
|
286982
|
-
log.i('IT SHOULD CONNECT TO GLOBAL')
|
|
287381
|
+
// log.i('[CLIENT] IT SHOULD CONNECT TO GLOBAL')
|
|
286983
287382
|
var realtime_2 = io.connect(nspPath.realtime.origin, {
|
|
286984
287383
|
path: nspPath.realtime.pathname
|
|
286985
287384
|
});
|
|
286986
|
-
base.
|
|
287385
|
+
base.FE_REALTIME = realtime_2;
|
|
286987
287386
|
realtime_2.on('connect', function () {
|
|
286988
|
-
log.i("conented to REALTIME namespace ".concat(realtime_2.nsp, " host: ").concat(context.host));
|
|
287387
|
+
log.i("[CLIENT] conented to REALTIME namespace ".concat(realtime_2.nsp, " host: ").concat(context.host));
|
|
286989
287388
|
});
|
|
286990
|
-
log.i('IT SHOULD CONNECT TO REALTIME')
|
|
287389
|
+
// log.i('IT SHOULD CONNECT TO REALTIME')
|
|
286991
287390
|
}
|
|
286992
287391
|
// Helpers.log('INITING SOCKETS DONE')
|
|
286993
|
-
}
|
|
287392
|
+
}
|
|
286994
287393
|
//#endregion
|
|
286995
287394
|
//#region listen changes entity
|
|
287395
|
+
/**
|
|
287396
|
+
* Changes trigger on backend needs to be done manually.. example code:
|
|
287397
|
+
*
|
|
287398
|
+
* ...
|
|
287399
|
+
* Firedev.Realtime.Server.TrigggerEntityChanges(myEntityInstance);
|
|
287400
|
+
* ...
|
|
287401
|
+
*/
|
|
286996
287402
|
RealtimeBrowserRxjs.listenChangesEntity = function (entityClassFn, idOrUniqValue, options) {
|
|
286997
287403
|
options = options || {};
|
|
286998
287404
|
//#region parameters validation
|
|
@@ -287011,39 +287417,34 @@ var RealtimeBrowserRxjs = /** @class */ (function () {
|
|
|
287011
287417
|
: framework_context_1.FrameworkContext.findForTraget(entityClassFn);
|
|
287012
287418
|
if (context.disabledRealtime) {
|
|
287013
287419
|
tnp_core_1.Helpers.error("[Firedev][realtime rxjs] remove firedev config flag:\n\n ...\n disabledRealtime: true\n ...\n\nto use socket realtime connection;\n ");
|
|
287014
|
-
|
|
287015
|
-
|
|
287016
|
-
var base = realtime_1.RealtimeBase.by(context);
|
|
287017
|
-
var realtime = base.socketNamespace.FE_REALTIME;
|
|
287018
|
-
var subPath = void 0;
|
|
287019
|
-
var roomName = void 0;
|
|
287020
|
-
if (customEvent) {
|
|
287021
|
-
roomName = symbols_1.SYMBOL.REALTIME.ROOM_NAME.CUSTOM(customEvent);
|
|
287022
|
-
subPath = symbols_1.SYMBOL.REALTIME.EVENT.CUSTOM(customEvent);
|
|
287023
|
-
}
|
|
287024
|
-
else {
|
|
287025
|
-
subPath = tnp_core_1._.isString(property)
|
|
287026
|
-
? symbols_1.SYMBOL.REALTIME.EVENT.ENTITY_PROPTERY_UPDATE_BY_ID(className, property, idOrUniqValue)
|
|
287027
|
-
: symbols_1.SYMBOL.REALTIME.EVENT.ENTITY_UPDATE_BY_ID(className, idOrUniqValue);
|
|
287028
|
-
roomName = tnp_core_1._.isString(property) ?
|
|
287029
|
-
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY_PROPERTY(className, property, idOrUniqValue) :
|
|
287030
|
-
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY(className, idOrUniqValue);
|
|
287031
|
-
}
|
|
287032
|
-
var roomSubOptions = {
|
|
287033
|
-
context: context,
|
|
287034
|
-
property: property,
|
|
287035
|
-
roomName: roomName,
|
|
287036
|
-
subPath: subPath,
|
|
287037
|
-
customEvent: customEvent,
|
|
287420
|
+
return function () {
|
|
287421
|
+
// empty nothing to do
|
|
287038
287422
|
};
|
|
287039
|
-
//#endregion
|
|
287040
|
-
var inst_1 = realtime_subs_manager_1.RealtimeSubsManager.from(roomSubOptions);
|
|
287041
|
-
observer.remove(function () {
|
|
287042
|
-
inst_1.remove(observer);
|
|
287043
|
-
});
|
|
287044
|
-
inst_1.add(observer);
|
|
287045
|
-
inst_1.startListenIfNotStarted(realtime);
|
|
287046
287423
|
}
|
|
287424
|
+
var base = realtime_1.RealtimeBase.by(context);
|
|
287425
|
+
var realtime = base.FE_REALTIME;
|
|
287426
|
+
var roomName;
|
|
287427
|
+
if (customEvent) {
|
|
287428
|
+
roomName = symbols_1.SYMBOL.REALTIME.ROOM_NAME.CUSTOM(customEvent);
|
|
287429
|
+
}
|
|
287430
|
+
else {
|
|
287431
|
+
roomName = tnp_core_1._.isString(property) ?
|
|
287432
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY_PROPERTY(className, property, idOrUniqValue) :
|
|
287433
|
+
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY(className, idOrUniqValue);
|
|
287434
|
+
}
|
|
287435
|
+
var roomSubOptions = {
|
|
287436
|
+
context: context,
|
|
287437
|
+
property: property,
|
|
287438
|
+
roomName: roomName,
|
|
287439
|
+
customEvent: customEvent,
|
|
287440
|
+
};
|
|
287441
|
+
//#endregion
|
|
287442
|
+
var inst = realtime_subs_manager_1.RealtimeSubsManager.from(roomSubOptions);
|
|
287443
|
+
inst.add(observer);
|
|
287444
|
+
inst.startListenIfNotStarted(realtime);
|
|
287445
|
+
return function () {
|
|
287446
|
+
inst.remove(observer);
|
|
287447
|
+
};
|
|
287047
287448
|
});
|
|
287048
287449
|
};
|
|
287049
287450
|
//#endregion
|
|
@@ -287056,6 +287457,15 @@ var RealtimeBrowserRxjs = /** @class */ (function () {
|
|
|
287056
287457
|
};
|
|
287057
287458
|
//#endregion
|
|
287058
287459
|
//#region listen change entity object
|
|
287460
|
+
/**
|
|
287461
|
+
* Changes trigger on backend needs to be done manually.. example code:
|
|
287462
|
+
*
|
|
287463
|
+
* ...
|
|
287464
|
+
* Firedev.Realtime.Server.TrigggerEntityChanges(myEntityInstance);
|
|
287465
|
+
* // or
|
|
287466
|
+
* Firedev.Realtime.Server.TrigggerEntityPropertyChanges(myEntityInstance,{ property: 'geolocationX' });
|
|
287467
|
+
* ...
|
|
287468
|
+
*/
|
|
287059
287469
|
RealtimeBrowserRxjs.listenChangesEntityObj = function (entity, options) {
|
|
287060
287470
|
var classFn = typescript_class_helpers_1.CLASS.getFromObject(entity);
|
|
287061
287471
|
var config = typescript_class_helpers_1.CLASS.getConfig(classFn);
|
|
@@ -287086,88 +287496,100 @@ exports.RealtimeBrowserRxjs = RealtimeBrowserRxjs;
|
|
|
287086
287496
|
|
|
287087
287497
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
287088
287498
|
exports.RealtimeNodejs = void 0;
|
|
287089
|
-
//#region
|
|
287090
|
-
var tnp_core_1 = __nccwpck_require__(76776);
|
|
287499
|
+
//#region imports
|
|
287091
287500
|
//#region @backend
|
|
287092
|
-
var
|
|
287501
|
+
var ioSocketIo = __nccwpck_require__(86540);
|
|
287093
287502
|
//#endregion
|
|
287503
|
+
var tnp_core_1 = __nccwpck_require__(76776);
|
|
287094
287504
|
var symbols_1 = __nccwpck_require__(91804);
|
|
287095
287505
|
var ng2_logger_1 = __nccwpck_require__(85053);
|
|
287096
287506
|
var tnp_core_2 = __nccwpck_require__(76776);
|
|
287097
287507
|
var realtime_1 = __nccwpck_require__(26806);
|
|
287098
287508
|
var typescript_class_helpers_1 = __nccwpck_require__(52468);
|
|
287099
287509
|
var framework_context_1 = __nccwpck_require__(37674);
|
|
287510
|
+
var broadcast_api_io_mock_server_1 = __nccwpck_require__(34356);
|
|
287511
|
+
//#endregion
|
|
287512
|
+
//#region consts
|
|
287100
287513
|
var log = ng2_logger_1.Log.create('RealtimeNodejs', ng2_logger_1.Level.__NOTHING);
|
|
287101
287514
|
var SOCKET_EVENT_DEBOUNCE = 500;
|
|
287515
|
+
//#endregion
|
|
287102
287516
|
var RealtimeNodejs = /** @class */ (function () {
|
|
287103
287517
|
//#region constructor
|
|
287104
287518
|
function RealtimeNodejs(context) {
|
|
287105
287519
|
this.context = context;
|
|
287106
|
-
|
|
287107
|
-
console.log('WEBSQL BROWSER/BACKEND broadcast api communicaiton initing...');
|
|
287108
|
-
}
|
|
287109
|
-
else {
|
|
287110
|
-
this.initStandardSocketCommunicaitno(context);
|
|
287111
|
-
}
|
|
287112
|
-
}
|
|
287113
|
-
//#endregion
|
|
287114
|
-
//#region init standard socket communication
|
|
287115
|
-
RealtimeNodejs.prototype.initStandardSocketCommunicaitno = function (context) {
|
|
287116
|
-
//#region @backend
|
|
287520
|
+
//#region @websql
|
|
287117
287521
|
var base = realtime_1.RealtimeBase.by(context);
|
|
287118
287522
|
if (!context.disabledRealtime) {
|
|
287523
|
+
// @ts-ignore;
|
|
287524
|
+
var io = ioSocketIo;
|
|
287525
|
+
// #endregion
|
|
287526
|
+
if (tnp_core_2.Helpers.isWebSQL) {
|
|
287527
|
+
// @ts-ignore
|
|
287528
|
+
io = broadcast_api_io_mock_server_1.mockIoServer;
|
|
287529
|
+
}
|
|
287119
287530
|
var nspPath = {
|
|
287120
287531
|
global: base.pathFor(),
|
|
287121
287532
|
realtime: base.pathFor(symbols_1.SYMBOL.REALTIME.NAMESPACE)
|
|
287122
287533
|
};
|
|
287123
|
-
base.
|
|
287124
|
-
path: nspPath.global.pathname
|
|
287534
|
+
base.BE = io(context.node.httpServer, {
|
|
287535
|
+
path: nspPath.global.pathname,
|
|
287536
|
+
/* */
|
|
287537
|
+
/* */
|
|
287125
287538
|
});
|
|
287126
|
-
var ioGlobalNsp = base.
|
|
287539
|
+
var ioGlobalNsp = base.BE;
|
|
287127
287540
|
ioGlobalNsp.on('connection', function (clientSocket) {
|
|
287128
287541
|
log.i("client conected to namespace \"".concat(clientSocket.nsp.name, "\", host: ").concat(context.host));
|
|
287129
287542
|
});
|
|
287130
287543
|
log.i("CREATE GLOBAL NAMESPACE: '".concat(ioGlobalNsp.path(), "' , path: '").concat(nspPath.global.pathname, "'"));
|
|
287131
287544
|
var ioRealtimeNsp = io(context.node.httpServer, {
|
|
287132
|
-
path: nspPath.realtime.pathname
|
|
287545
|
+
path: nspPath.realtime.pathname,
|
|
287546
|
+
/* */
|
|
287547
|
+
/* */
|
|
287133
287548
|
});
|
|
287134
287549
|
log.i("CREATE REALTIME NAMESPACE: '".concat(ioRealtimeNsp.path(), "' , path: '").concat(nspPath.realtime.pathname, "' "));
|
|
287135
|
-
base.
|
|
287136
|
-
ioRealtimeNsp.on('connection', function (
|
|
287137
|
-
log.i("client conected to namespace \"".concat(
|
|
287138
|
-
|
|
287139
|
-
log.i("Joining room ".concat(
|
|
287140
|
-
|
|
287550
|
+
base.BE_REALTIME = ioRealtimeNsp;
|
|
287551
|
+
ioRealtimeNsp.on('connection', function (backendSocketForClient) {
|
|
287552
|
+
log.i("client conected to namespace \"".concat(backendSocketForClient.nsp.name, "\", host: ").concat(context.host));
|
|
287553
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.CUSTOM, function (roomName) {
|
|
287554
|
+
log.i("Joining room ".concat(roomName, " in namespace REALTIME") + " host: ".concat(context.host));
|
|
287555
|
+
backendSocketForClient.join(roomName);
|
|
287556
|
+
});
|
|
287557
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_UPDATE_EVENTS, function (roomName) {
|
|
287558
|
+
log.i("Joining room ".concat(roomName, " in namespace REALTIME") + " host: ".concat(context.host));
|
|
287559
|
+
backendSocketForClient.join(roomName);
|
|
287141
287560
|
});
|
|
287142
|
-
|
|
287143
|
-
log.i("Joining room ".concat(
|
|
287144
|
-
|
|
287561
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS, function (roomName) {
|
|
287562
|
+
log.i("Joining room ".concat(roomName, " in namespace REALTIME ") + " host: ".concat(context.host));
|
|
287563
|
+
backendSocketForClient.join(roomName);
|
|
287145
287564
|
});
|
|
287146
|
-
|
|
287147
|
-
log.i("Leaving room ".concat(
|
|
287148
|
-
|
|
287565
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.CUSTOM, function (roomName) {
|
|
287566
|
+
log.i("Leaving room ".concat(roomName, " in namespace REALTIME") + " host: ".concat(context.host));
|
|
287567
|
+
backendSocketForClient.leave(roomName);
|
|
287149
287568
|
});
|
|
287150
|
-
|
|
287151
|
-
log.i("Leaving room ".concat(
|
|
287152
|
-
|
|
287569
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_UPDATE_EVENTS, function (roomName) {
|
|
287570
|
+
log.i("Leaving room ".concat(roomName, " in namespace REALTIME ") + " host: ".concat(context.host));
|
|
287571
|
+
backendSocketForClient.leave(roomName);
|
|
287572
|
+
});
|
|
287573
|
+
backendSocketForClient.on(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS, function (roomName) {
|
|
287574
|
+
log.i("Leaving room ".concat(roomName, " in namespace REALTIME ") + " host: ".concat(context.host));
|
|
287575
|
+
backendSocketForClient.leave(roomName);
|
|
287153
287576
|
});
|
|
287154
287577
|
});
|
|
287155
287578
|
}
|
|
287156
287579
|
//#endregion
|
|
287157
|
-
}
|
|
287580
|
+
}
|
|
287158
287581
|
//#endregion
|
|
287159
287582
|
//#region trigger entity changes
|
|
287160
287583
|
RealtimeNodejs.__TrigggerEntityChanges = function (context, entityObjOrClass, property, valueOfUniquPropery, customEvent, customEventData) {
|
|
287161
|
-
|
|
287584
|
+
log.i('__triger entity changes');
|
|
287585
|
+
//#region @websql
|
|
287162
287586
|
var base = realtime_1.RealtimeBase.by(context);
|
|
287163
|
-
var
|
|
287164
|
-
var eventName;
|
|
287587
|
+
var roomName;
|
|
287165
287588
|
if (context.disabledRealtime) {
|
|
287166
287589
|
return;
|
|
287167
287590
|
}
|
|
287168
287591
|
if (customEvent) {
|
|
287169
|
-
|
|
287170
|
-
eventName = symbols_1.SYMBOL.REALTIME.EVENT.CUSTOM(customEvent);
|
|
287592
|
+
roomName = symbols_1.SYMBOL.REALTIME.ROOM_NAME.CUSTOM(customEvent);
|
|
287171
287593
|
}
|
|
287172
287594
|
else {
|
|
287173
287595
|
var entityFn = entityObjOrClass;
|
|
@@ -287184,22 +287606,21 @@ var RealtimeNodejs = /** @class */ (function () {
|
|
|
287184
287606
|
tnp_core_2.Helpers.error("[Firedev][Realtime] Entity without iD ! ".concat(config.className, " "), true, true);
|
|
287185
287607
|
return;
|
|
287186
287608
|
}
|
|
287187
|
-
|
|
287609
|
+
roomName = tnp_core_1._.isString(property) ?
|
|
287188
287610
|
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY_PROPERTY(config.className, property, valueOfUniquPropery) :
|
|
287189
287611
|
symbols_1.SYMBOL.REALTIME.ROOM_NAME.UPDATE_ENTITY(config.className, valueOfUniquPropery);
|
|
287190
|
-
eventName = tnp_core_1._.isString(property) ?
|
|
287191
|
-
symbols_1.SYMBOL.REALTIME.EVENT.ENTITY_PROPTERY_UPDATE_BY_ID(config.className, property, valueOfUniquPropery) :
|
|
287192
|
-
symbols_1.SYMBOL.REALTIME.EVENT.ENTITY_UPDATE_BY_ID(config.className, valueOfUniquPropery);
|
|
287193
287612
|
}
|
|
287194
287613
|
var job = function () {
|
|
287195
|
-
|
|
287614
|
+
// console.log(`Trigger realtime: ${roomName}`)
|
|
287615
|
+
base.BE_REALTIME.in(roomName).emit(roomName, // roomName == eventName in room na
|
|
287616
|
+
customEventData ? customEventData : '');
|
|
287196
287617
|
};
|
|
287197
|
-
if (!tnp_core_1._.isFunction(RealtimeNodejs.jobs[
|
|
287198
|
-
RealtimeNodejs.jobs[
|
|
287618
|
+
if (!tnp_core_1._.isFunction(RealtimeNodejs.jobs[roomName])) {
|
|
287619
|
+
RealtimeNodejs.jobs[roomName] = tnp_core_1._.debounce(function () {
|
|
287199
287620
|
job();
|
|
287200
287621
|
}, SOCKET_EVENT_DEBOUNCE);
|
|
287201
287622
|
}
|
|
287202
|
-
RealtimeNodejs.jobs[
|
|
287623
|
+
RealtimeNodejs.jobs[roomName]();
|
|
287203
287624
|
//#endregion
|
|
287204
287625
|
};
|
|
287205
287626
|
RealtimeNodejs.TrigggerEntityChanges = function (entityObjOrClass, idToTrigger) {
|
|
@@ -287221,6 +287642,7 @@ var RealtimeNodejs = /** @class */ (function () {
|
|
|
287221
287642
|
var className = tnp_core_1._.isFunction(entityObjOrClass)
|
|
287222
287643
|
? typescript_class_helpers_1.CLASS.getName(entityObjOrClass)
|
|
287223
287644
|
: typescript_class_helpers_1.CLASS.getNameFromObject(entityObjOrClass);
|
|
287645
|
+
// @ts-ignore
|
|
287224
287646
|
tnp_core_2.Helpers.warn("[Firedev][TrigggerEntityPropertyChanges][property=".concat(property, "] Entity \"").concat(className, "' is not realtime"));
|
|
287225
287647
|
return;
|
|
287226
287648
|
}
|
|
@@ -287253,6 +287675,9 @@ var RealtimeNodejs = /** @class */ (function () {
|
|
|
287253
287675
|
}
|
|
287254
287676
|
RealtimeNodejs.__TrigggerEntityChanges(context, entityClass, void 0, void 0, symbols_1.SYMBOL.REALTIME.TABLE_CHANGE(className));
|
|
287255
287677
|
};
|
|
287678
|
+
RealtimeNodejs.prototype.TrigggerEntityTableChanges = function (entityClass) {
|
|
287679
|
+
RealtimeNodejs.TrigggerEntityTableChanges(entityClass);
|
|
287680
|
+
};
|
|
287256
287681
|
RealtimeNodejs.jobs = {};
|
|
287257
287682
|
return RealtimeNodejs;
|
|
287258
287683
|
}());
|
|
@@ -287272,7 +287697,11 @@ exports.RealtimeSubsManager = void 0;
|
|
|
287272
287697
|
var _ = __nccwpck_require__(38471);
|
|
287273
287698
|
var ng2_logger_1 = __nccwpck_require__(85053);
|
|
287274
287699
|
var symbols_1 = __nccwpck_require__(91804);
|
|
287700
|
+
// import type { BroadcastApiIoMockServer } from './broadcast-api-io-mock-server';
|
|
287275
287701
|
var realtime_1 = __nccwpck_require__(26806);
|
|
287702
|
+
//#region @backend
|
|
287703
|
+
var url_1 = __nccwpck_require__(57310);
|
|
287704
|
+
//#endregion
|
|
287276
287705
|
var log = ng2_logger_1.Log.create('REALTIME SUBS MANAGER', ng2_logger_1.Level.__NOTHING);
|
|
287277
287706
|
var RealtimeSubsManager = /** @class */ (function () {
|
|
287278
287707
|
function RealtimeSubsManager(options) {
|
|
@@ -287281,7 +287710,8 @@ var RealtimeSubsManager = /** @class */ (function () {
|
|
|
287281
287710
|
this.observers = [];
|
|
287282
287711
|
}
|
|
287283
287712
|
RealtimeSubsManager.idFrm = function (options) {
|
|
287284
|
-
|
|
287713
|
+
var url = new url_1.URL(options.context.host);
|
|
287714
|
+
return "".concat(url.origin, "|").concat(options.roomName, "|").concat(options.property, "|").concat(options.customEvent);
|
|
287285
287715
|
};
|
|
287286
287716
|
RealtimeSubsManager.from = function (options) {
|
|
287287
287717
|
var pathToInstance = RealtimeSubsManager.idFrm(options);
|
|
@@ -287292,6 +287722,7 @@ var RealtimeSubsManager = /** @class */ (function () {
|
|
|
287292
287722
|
};
|
|
287293
287723
|
RealtimeSubsManager.prototype.startListenIfNotStarted = function (realtime) {
|
|
287294
287724
|
var _this = this;
|
|
287725
|
+
var _a;
|
|
287295
287726
|
if (this.options.context.disabledRealtime) {
|
|
287296
287727
|
console.warn("[Firedev][startListenIfNotStarted] socket are disabled");
|
|
287297
287728
|
return;
|
|
@@ -287301,48 +287732,55 @@ var RealtimeSubsManager = /** @class */ (function () {
|
|
|
287301
287732
|
return;
|
|
287302
287733
|
}
|
|
287303
287734
|
if (!this.isListening) {
|
|
287304
|
-
log.i(
|
|
287735
|
+
log.i("subscribe to ".concat((_a = this.options) === null || _a === void 0 ? void 0 : _a.roomName), this.options);
|
|
287305
287736
|
this.isListening = true;
|
|
287306
|
-
if (this.options.customEvent) {
|
|
287307
|
-
realtime.emit(symbols_1.SYMBOL.REALTIME.
|
|
287737
|
+
if (this.options.customEvent) { // this means: send to current client custom event notification
|
|
287738
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.CUSTOM, this.options.roomName);
|
|
287308
287739
|
}
|
|
287309
287740
|
else {
|
|
287310
287741
|
if (_.isString(this.options.property)) {
|
|
287311
|
-
|
|
287742
|
+
// this means: send to current client entity property events updates
|
|
287743
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS, this.options.roomName);
|
|
287312
287744
|
}
|
|
287313
287745
|
else {
|
|
287314
|
-
|
|
287746
|
+
// this means: send to current client entity update events
|
|
287747
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.SUBSCRIBE.ENTITY_UPDATE_EVENTS, this.options.roomName);
|
|
287315
287748
|
}
|
|
287316
287749
|
}
|
|
287317
|
-
|
|
287750
|
+
// subPath -> SYMBOL - (customevnet|entityupdatebyid){..}{..}
|
|
287751
|
+
realtime.on(this.options.roomName, function (data) {
|
|
287318
287752
|
_this.update(data);
|
|
287319
287753
|
});
|
|
287320
287754
|
}
|
|
287321
287755
|
};
|
|
287322
287756
|
RealtimeSubsManager.prototype.add = function (observer) {
|
|
287757
|
+
// log.info('Add observer')
|
|
287323
287758
|
this.observers.push(observer);
|
|
287324
287759
|
};
|
|
287325
287760
|
RealtimeSubsManager.prototype.remove = function (observer) {
|
|
287761
|
+
// log.info('Remove observer')
|
|
287326
287762
|
this.observers = this.observers.filter(function (obs) { return obs !== observer; });
|
|
287327
287763
|
if (this.observers.length === 0) {
|
|
287764
|
+
// log.info('Emit unsubscribe to server SERVER')
|
|
287328
287765
|
this.isListening = false;
|
|
287329
287766
|
var _a = this.options, context = _a.context, customEvent = _a.customEvent, roomName = _a.roomName, property = _a.property;
|
|
287330
287767
|
var base = realtime_1.RealtimeBase.by(context);
|
|
287331
|
-
var realtime = base.
|
|
287768
|
+
var realtime = base.FE_REALTIME;
|
|
287332
287769
|
if (customEvent) {
|
|
287333
|
-
realtime.emit(symbols_1.SYMBOL.REALTIME.
|
|
287770
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.CUSTOM, roomName);
|
|
287334
287771
|
}
|
|
287335
287772
|
else {
|
|
287336
287773
|
if (_.isString(property)) {
|
|
287337
|
-
realtime.emit(symbols_1.SYMBOL.REALTIME.
|
|
287774
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_PROPERTY_UPDATE_EVENTS, roomName);
|
|
287338
287775
|
}
|
|
287339
287776
|
else {
|
|
287340
|
-
realtime.emit(symbols_1.SYMBOL.REALTIME.
|
|
287777
|
+
realtime.emit(symbols_1.SYMBOL.REALTIME.ROOM_NAME.UNSUBSCRIBE.ENTITY_UPDATE_EVENTS, roomName);
|
|
287341
287778
|
}
|
|
287342
287779
|
}
|
|
287343
287780
|
}
|
|
287344
287781
|
};
|
|
287345
287782
|
RealtimeSubsManager.prototype.update = function (data) {
|
|
287783
|
+
// log.data(`realtime update!!!!! observers=${this.observers?.length} `)
|
|
287346
287784
|
var ngZone = this.options.context.ngZone;
|
|
287347
287785
|
// console.log('updating', data);
|
|
287348
287786
|
// console.log('ngzone', ngZone);
|
|
@@ -287376,6 +287814,7 @@ exports.RealtimeSubsManager = RealtimeSubsManager;
|
|
|
287376
287814
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
287377
287815
|
exports.RealtimeBase = void 0;
|
|
287378
287816
|
var RealtimeBase = /** @class */ (function () {
|
|
287817
|
+
//#endregion
|
|
287379
287818
|
function RealtimeBase(context) {
|
|
287380
287819
|
this.context = context;
|
|
287381
287820
|
}
|
|
@@ -287391,42 +287830,6 @@ var RealtimeBase = /** @class */ (function () {
|
|
|
287391
287830
|
return this.instances[indexContext];
|
|
287392
287831
|
}
|
|
287393
287832
|
};
|
|
287394
|
-
Object.defineProperty(RealtimeBase.prototype, "socketNamespace", {
|
|
287395
|
-
//#endregion
|
|
287396
|
-
get: function () {
|
|
287397
|
-
var self = this;
|
|
287398
|
-
return {
|
|
287399
|
-
set FE(v) {
|
|
287400
|
-
self.socketFrontEnd = v;
|
|
287401
|
-
},
|
|
287402
|
-
get FE() {
|
|
287403
|
-
return self.socketFrontEnd;
|
|
287404
|
-
},
|
|
287405
|
-
set FE_REALTIME(v) {
|
|
287406
|
-
self.socketFrontEndRealtime = v;
|
|
287407
|
-
},
|
|
287408
|
-
get FE_REALTIME() {
|
|
287409
|
-
return self.socketFrontEndRealtime;
|
|
287410
|
-
},
|
|
287411
|
-
//#region @websql
|
|
287412
|
-
set BE(v) {
|
|
287413
|
-
self.socketNamespaceBE = v;
|
|
287414
|
-
},
|
|
287415
|
-
get BE() {
|
|
287416
|
-
return self.socketNamespaceBE;
|
|
287417
|
-
},
|
|
287418
|
-
set BE_REALTIME(v) {
|
|
287419
|
-
self.socketNamespaceBERealtime = v;
|
|
287420
|
-
},
|
|
287421
|
-
get BE_REALTIME() {
|
|
287422
|
-
return self.socketNamespaceBERealtime;
|
|
287423
|
-
}
|
|
287424
|
-
//#endregion
|
|
287425
|
-
};
|
|
287426
|
-
},
|
|
287427
|
-
enumerable: false,
|
|
287428
|
-
configurable: true
|
|
287429
|
-
});
|
|
287430
287833
|
RealtimeBase.prototype.pathFor = function (namespace) {
|
|
287431
287834
|
var uri = this.context.uri;
|
|
287432
287835
|
var nsp = namespace ? namespace : '';
|
|
@@ -287461,29 +287864,12 @@ exports.SYMBOL = {
|
|
|
287461
287864
|
TABLE_CHANGE: function (tableName) {
|
|
287462
287865
|
return "listentablename".concat(tableName);
|
|
287463
287866
|
},
|
|
287464
|
-
|
|
287465
|
-
|
|
287466
|
-
|
|
287467
|
-
|
|
287468
|
-
|
|
287469
|
-
|
|
287470
|
-
UNSUBSCRIBE: {
|
|
287471
|
-
CUSTOM: 'unsubscribeCustomRoomEvent',
|
|
287472
|
-
ENTITY_UPDATE_EVENTS: 'unsubscribeEntityEvents',
|
|
287473
|
-
ENTITY_PROPERTY_UPDATE_EVENTS: 'unsubscribeEntityPropertyEvents',
|
|
287474
|
-
}
|
|
287475
|
-
},
|
|
287476
|
-
EVENT: {
|
|
287477
|
-
CUSTOM: function (customEvent) {
|
|
287478
|
-
return "customevnet".concat(customEvent);
|
|
287479
|
-
},
|
|
287480
|
-
ENTITY_UPDATE_BY_ID: function (className, entityId) {
|
|
287481
|
-
return "entityupdatebyid".concat(tnp_core_1._.camelCase(className)).concat(entityId).toLowerCase();
|
|
287482
|
-
},
|
|
287483
|
-
ENTITY_PROPTERY_UPDATE_BY_ID: function (className, property, entityId) {
|
|
287484
|
-
return "entityupdatebyid".concat(tnp_core_1._.camelCase(className)).concat(tnp_core_1._.camelCase(property)).concat(entityId).toLowerCase();
|
|
287485
|
-
},
|
|
287486
|
-
},
|
|
287867
|
+
/**
|
|
287868
|
+
* for backendSocket.in(ROOM_NAME).emit(EVENT)
|
|
287869
|
+
*
|
|
287870
|
+
* Room names are uniqe..
|
|
287871
|
+
* here I am limiting number of event for clients.
|
|
287872
|
+
*/
|
|
287487
287873
|
ROOM_NAME: {
|
|
287488
287874
|
CUSTOM: function (customEvent) {
|
|
287489
287875
|
return "roomcustomevnet".concat(customEvent);
|
|
@@ -287493,6 +287879,16 @@ exports.SYMBOL = {
|
|
|
287493
287879
|
},
|
|
287494
287880
|
UPDATE_ENTITY_PROPERTY: function (className, property, entityId) {
|
|
287495
287881
|
return "room".concat(tnp_core_1._.camelCase(className)).concat(tnp_core_1._.camelCase(property)).concat(entityId).toLowerCase();
|
|
287882
|
+
},
|
|
287883
|
+
SUBSCRIBE: {
|
|
287884
|
+
CUSTOM: 'roomSubscribeCustomRoomEvent',
|
|
287885
|
+
ENTITY_UPDATE_EVENTS: 'roomSubscribeEntityEvents',
|
|
287886
|
+
ENTITY_PROPERTY_UPDATE_EVENTS: 'roomSubscribeEntityPropertyEvents',
|
|
287887
|
+
},
|
|
287888
|
+
UNSUBSCRIBE: {
|
|
287889
|
+
CUSTOM: 'roomUnsubscribeCustomRoomEvent',
|
|
287890
|
+
ENTITY_UPDATE_EVENTS: 'roomUnsubscribeEntityEvents',
|
|
287891
|
+
ENTITY_PROPERTY_UPDATE_EVENTS: 'roomUnsubscribeEntityPropertyEvents',
|
|
287496
287892
|
}
|
|
287497
287893
|
}
|
|
287498
287894
|
},
|
|
@@ -362083,7 +362479,7 @@ var CLI = /** @class */ (function () {
|
|
|
362083
362479
|
}
|
|
362084
362480
|
CLI.installEnvironment = function (globalDependencies) {
|
|
362085
362481
|
if (globalDependencies === void 0) { globalDependencies = tnp_config_1.config.required; }
|
|
362086
|
-
tnp_core_1.Helpers.info("[firedev-cli] INSTALLING GLOBAL ENVIRONMENT FOR FIREDEV...");
|
|
362482
|
+
tnp_core_1.Helpers.info("[firedev-cli] INSTALLING GLOBAL ENVIRONMENT FOR FIREDEV... it will take a few minutes");
|
|
362087
362483
|
var missingNpm = [];
|
|
362088
362484
|
globalDependencies.npm.forEach(function (pkg) {
|
|
362089
362485
|
if (!commandExistsSync(pkg.name)) {
|
|
@@ -362099,9 +362495,9 @@ var CLI = /** @class */ (function () {
|
|
|
362099
362495
|
.join(' ');
|
|
362100
362496
|
tnp_core_1.Helpers.info('Installing missing dependencies...');
|
|
362101
362497
|
var cmd = "npm install -g ".concat(toInstall);
|
|
362102
|
-
tnp_core_1.Helpers.run(cmd).sync();
|
|
362498
|
+
tnp_core_1.Helpers.run(cmd, { output: (tnp_config_1.config.frameworkName === 'tnp'), biggerBuffer: true }).sync();
|
|
362103
362499
|
}
|
|
362104
|
-
tnp_core_1.Helpers.info("[firedev-cli] INSTALLING GLOBAL ENVIRONMENT FOR FIREDEV...done");
|
|
362500
|
+
tnp_core_1.Helpers.info("[firedev-cli] INSTALLING GLOBAL ENVIRONMENT FOR FIREDEV...done)");
|
|
362105
362501
|
};
|
|
362106
362502
|
/**
|
|
362107
362503
|
* Check if global system tools are available for isomorphic app development
|
|
@@ -556083,6 +556479,9 @@ var LibProjectStandalone = /** @class */ (function (_super) {
|
|
|
556083
556479
|
/* */
|
|
556084
556480
|
/* */
|
|
556085
556481
|
/* */
|
|
556482
|
+
/* */
|
|
556483
|
+
/* */
|
|
556484
|
+
/* */
|
|
556086
556485
|
};
|
|
556087
556486
|
/**
|
|
556088
556487
|
* Return how many projects has changed
|
|
@@ -570558,6 +570957,9 @@ function resolvePacakgesFromArgs(args) {
|
|
|
570558
570957
|
exports.resolvePacakgesFromArgs = resolvePacakgesFromArgs;
|
|
570559
570958
|
function executeCommand(command, project) {
|
|
570560
570959
|
tnp_helpers_1.Helpers.info("\n\n ".concat(command, " in folder:\n ").concat(project.location, "\n\n "));
|
|
570960
|
+
if (tnp_config_1.config.frameworkName === 'firedev' && project.isContainerCoreProject) {
|
|
570961
|
+
tnp_helpers_1.Helpers.info('This may take a long time... more than 1GB to download from npm...');
|
|
570962
|
+
}
|
|
570561
570963
|
project.run(command, { output: (tnp_config_1.config.frameworkName === 'tnp'), biggerBuffer: true }).sync();
|
|
570562
570964
|
tnp_helpers_1.Helpers.writeFile([project.node_modules.path, '.install-date'], (0, tnp_core_3.moment)(new Date()).format('L LTS'));
|
|
570563
570965
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
exports.
|
|
3
|
+
exports.dummy1678258427956 = void 0;
|
|
4
|
+
function dummy1678258427956() { }
|
|
5
|
+
exports.dummy1678258427956 = dummy1678258427956;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -45,6 +45,9 @@ function resolvePacakgesFromArgs(args) {
|
|
|
45
45
|
exports.resolvePacakgesFromArgs = resolvePacakgesFromArgs;
|
|
46
46
|
function executeCommand(command, project) {
|
|
47
47
|
tnp_helpers_1.Helpers.info("\n\n ".concat(command, " in folder:\n ").concat(project.location, "\n\n "));
|
|
48
|
+
if (tnp_config_1.config.frameworkName === 'firedev' && project.isContainerCoreProject) {
|
|
49
|
+
tnp_helpers_1.Helpers.info('This may take a long time... more than 1GB to download from npm...');
|
|
50
|
+
}
|
|
48
51
|
project.run(command, { output: (tnp_config_1.config.frameworkName === 'tnp'), biggerBuffer: true }).sync();
|
|
49
52
|
tnp_helpers_1.Helpers.writeFile([project.node_modules.path, '.install-date'], (0, tnp_core_3.moment)(new Date()).format('L LTS'));
|
|
50
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tnp",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.172",
|
|
4
4
|
"bin": {
|
|
5
5
|
"tnp": "bin/tnp",
|
|
6
6
|
"tnp-debug": "bin/tnp-debug",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"ora": "3.4.0"
|
|
11
11
|
},
|
|
12
|
-
"lastBuildTagHash": "
|
|
12
|
+
"lastBuildTagHash": "8b0506db8a9053036393f0875fc390b3639698f8",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"activate": "npm i --force && firedev dedupe && npx tsc && firedev link && tnp bd"
|
|
15
15
|
},
|
package/package.json_tnp.json5
CHANGED
package/tmp-environment.json
CHANGED
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"tnp-ui": "13.1.27",
|
|
224
224
|
"firedev-ui": "13.0.1",
|
|
225
225
|
"tnp-core": "13.1.61",
|
|
226
|
-
"tnp-cli": "13.1.
|
|
226
|
+
"tnp-cli": "13.1.44",
|
|
227
227
|
"tnp-tools": "0.0.58",
|
|
228
228
|
"any-project-cli": "13.1.18",
|
|
229
229
|
"@types/node": "10.12.30",
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
"private": false
|
|
565
565
|
},
|
|
566
566
|
"name": "tnp",
|
|
567
|
-
"version": "13.1.
|
|
567
|
+
"version": "13.1.172",
|
|
568
568
|
"bin": {
|
|
569
569
|
"tnp": "bin/tnp",
|
|
570
570
|
"tnp-debug": "bin/tnp-debug",
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
"progress": "2.0.3",
|
|
578
578
|
"tnp-db": "~13.1.8"
|
|
579
579
|
},
|
|
580
|
-
"lastBuildTagHash": "
|
|
580
|
+
"lastBuildTagHash": "8b0506db8a9053036393f0875fc390b3639698f8",
|
|
581
581
|
"scripts": {
|
|
582
582
|
"activate": "npm i --force && firedev dedupe && npx tsc && firedev link && tnp bd"
|
|
583
583
|
},
|
|
@@ -787,7 +787,7 @@
|
|
|
787
787
|
"sudo-block": "3.0.0",
|
|
788
788
|
"systeminformation": "3.45.7",
|
|
789
789
|
"task.js": "0.1.5",
|
|
790
|
-
"tnp-cli": "~13.1.
|
|
790
|
+
"tnp-cli": "~13.1.44",
|
|
791
791
|
"tnp-config": "~13.1.55",
|
|
792
792
|
"tnp-core": "~13.1.61",
|
|
793
793
|
"tnp-helpers": "~13.1.16",
|
|
@@ -810,9 +810,9 @@
|
|
|
810
810
|
}
|
|
811
811
|
},
|
|
812
812
|
"build": {
|
|
813
|
-
"number":
|
|
814
|
-
"date": "2023-03-
|
|
815
|
-
"hash": "
|
|
813
|
+
"number": 2728,
|
|
814
|
+
"date": "2023-03-08T06:24:37.000Z",
|
|
815
|
+
"hash": "6c2fa7cca08dffe0483cba77957a38b682933788",
|
|
816
816
|
"options": {}
|
|
817
817
|
},
|
|
818
818
|
"currentProjectName": "tnp",
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
"currentProjectLaunchConfiguration": "{\"version\":\"0.2.0\",\"configurations\":[{\"type\":\"node\",\"request\":\"launch\",\"name\":\"Launch Server standalone\",\"program\":\"${workspaceFolder}/run.js\",\"args\":[\"--ENVoverride=%7B%0A%20%20%20%20%22clientProjectName%22%3A%20%22tnp%22%0A%7D\"],\"runtimeArgs\":[\"--nolazy\",\"-r\",\"ts-node/register\",\"--experimental-worker\"]},{\"name\":\"Debugger with ng serve\",\"type\":\"chrome\",\"request\":\"launch\",\"preLaunchTask\":\"Ng Serve\",\"postDebugTask\":\"terminateall\",\"sourceMaps\":true,\"webRoot\":\"${workspaceFolder}\",\"sourceMapPathOverrides\":{\"webpack:/*\":\"${webRoot}/*\",\"/./*\":\"${webRoot}/*\",\"/tmp-src/*\":\"${webRoot}/*\",\"/*\":\"*\",\"/./~/*\":\"${webRoot}/node_modules/*\"}},{\"type\":\"node\",\"request\":\"attach\",\"name\":\"Attach to global cli tool\",\"port\":9229,\"skipFiles\":[\"<node_internals>/**\"]}],\"compounds\":[{\"name\":\"Debug backend/frontend\",\"configurations\":[\"Launch Server standalone\",\"Debugger with ng serve\"]}]}",
|
|
821
821
|
"currentProjectTasksConfiguration": "{\"version\":\"2.0.0\",\"tasks\":[{\"label\":\"terminateall\",\"command\":\"echo ${input:terminate}\",\"type\":\"shell\",\"problemMatcher\":[]},{\"label\":\"Ng Serve\",\"type\":\"shell\",\"command\":\"tnp build\",\"isBackground\":true,\"presentation\":{\"reveal\":\"always\"},\"group\":{\"kind\":\"build\",\"isDefault\":true},\"problemMatcher\":{\"owner\":\"typescript\",\"source\":\"ts\",\"applyTo\":\"closedDocuments\",\"fileLocation\":[\"relative\",\"${cwd}\"],\"pattern\":\"$tsc\",\"background\":{\"activeOnStart\":true,\"beginsPattern\":{\"regexp\":\"(.*?)\"},\"endsPattern\":{\"regexp\":\"Compiled |Failed to compile.\"}}}}],\"inputs\":[{\"id\":\"terminate\",\"type\":\"command\",\"command\":\"workbench.action.tasks.terminate\",\"args\":\"terminateAll\"}]}",
|
|
822
822
|
"currentProjectType": "isomorphic-lib",
|
|
823
|
-
"currentFrameworkVersion": "13.1.
|
|
823
|
+
"currentFrameworkVersion": "13.1.172",
|
|
824
824
|
"currentProjectIsStrictSite": false,
|
|
825
825
|
"currentProjectIsDependencySite": false,
|
|
826
826
|
"currentProjectIsStatic": false,
|