taon 19.0.26 → 19.0.29
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/browser/fesm2022/taon.mjs +110 -100
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-angular-service.d.ts +1 -0
- package/browser/lib/endpoint-context.d.ts +1 -1
- package/browser/package.json +1 -1
- package/client/fesm2022/taon.mjs +110 -100
- package/client/fesm2022/taon.mjs.map +1 -1
- package/client/lib/base-classes/base-angular-service.d.ts +1 -0
- package/client/lib/endpoint-context.d.ts +1 -1
- package/client/package.json +1 -1
- package/lib/base-classes/base-angular-service.d.ts +1 -0
- package/lib/base-classes/base-angular-service.js +9 -0
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-repository copy.d.ts +255 -0
- package/lib/base-classes/base-repository copy.js +653 -0
- package/lib/base-classes/base-repository copy.js.map +1 -0
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/create-context.js +1 -1
- package/lib/create-context.js.map +1 -1
- package/lib/endpoint-context.d.ts +1 -1
- package/lib/endpoint-context.js +7 -6
- package/lib/endpoint-context.js.map +1 -1
- package/lib/ui/directives/index.js +2 -2
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
- package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
- package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
- package/lib/ui/taon-progress-bar/index.js +2 -2
- package/lib/ui/taon-session-passcode/index.js +2 -2
- package/lib/ui/taon-table/index.js +2 -2
- package/package.json +1 -1
- package/scss/index.scss +1 -1
- package/scss/lib/index.scss +2 -1
- package/scss/lib/ui/taon.scss +1 -1
- package/tmp-environment.json +4 -8
- package/websql/fesm2022/taon.mjs +110 -100
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-angular-service.d.ts +1 -0
- package/websql/lib/endpoint-context.d.ts +1 -1
- package/websql/package.json +1 -1
- package/assets/shared/logo-header-admin-mode.png +0 -0
- package/lib/base-classes/base-subscriber.d.ts +0 -4
- package/lib/base-classes/base-subscriber.js +0 -25
- package/lib/base-classes/base-subscriber.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.d.ts +0 -10
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.js +0 -214
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.d.ts +0 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.js +0 -5
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.d.ts +0 -22
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.js +0 -139
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.d.ts +0 -16
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.js +0 -68
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.d.ts +0 -10
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.js +0 -56
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.d.ts +0 -10
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.js +0 -50
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.d.ts +0 -13
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.js +0 -3
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.d.ts +0 -2
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.js +0 -6
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.d.ts +0 -16
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.js +0 -54
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.d.ts +0 -17
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.js +0 -52
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.d.ts +0 -11
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.js +0 -39
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.d.ts +0 -13
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.js +0 -46
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.js.map +0 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.d.ts +0 -11
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.js +0 -3
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.js.map +0 -1
- package/lib/ui/directives/firedev-inject-html.directive.d.ts +0 -6
- package/lib/ui/directives/firedev-long-press.directive.d.ts +0 -22
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +0 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +0 -5
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js.map +0 -1
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +0 -29
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +0 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.d.ts +0 -1
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +0 -5
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js.map +0 -1
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/taon-db-admin.component.d.ts +0 -8
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +0 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +0 -5
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js.map +0 -1
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +0 -13
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +0 -2
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +0 -5
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js +0 -3
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js.map +0 -1
- package/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +0 -14
- package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +0 -2
- package/lib/ui/toan-full-material.module.d.ts +0 -2
package/websql/fesm2022/taon.mjs
CHANGED
|
@@ -11,7 +11,6 @@ import * as JSON5 from 'json5';
|
|
|
11
11
|
import * as i0 from '@angular/core';
|
|
12
12
|
import { InjectionToken, inject as inject$1, Injectable } from '@angular/core';
|
|
13
13
|
import axios from 'axios';
|
|
14
|
-
import { ipcRenderer } from 'electron';
|
|
15
14
|
import { JSON10 } from 'json10/websql';
|
|
16
15
|
import { Observable, Subject, from } from 'rxjs';
|
|
17
16
|
import { io } from 'socket.io-client';
|
|
@@ -877,6 +876,95 @@ let CURRENT_HOST_BACKEND_PORT;
|
|
|
877
876
|
//#region @browser
|
|
878
877
|
CURRENT_HOST_BACKEND_PORT = new InjectionToken('CURRENT_HOST_BACKEND_PORT');
|
|
879
878
|
|
|
879
|
+
const inject = (entity) => {
|
|
880
|
+
return new Proxy({}, {
|
|
881
|
+
get: (_, propName) => {
|
|
882
|
+
if (propName === 'hasOwnProperty') {
|
|
883
|
+
return () => false;
|
|
884
|
+
}
|
|
885
|
+
const ctor = entity();
|
|
886
|
+
const contextFromClass = ctor[Symbols.ctxInClassOrClassObj];
|
|
887
|
+
const resultContext = contextFromClass;
|
|
888
|
+
if (resultContext) {
|
|
889
|
+
let instance = resultContext.inject(ctor, {
|
|
890
|
+
parentInstanceThatWillGetInjectedStuff: this,
|
|
891
|
+
});
|
|
892
|
+
// console.log('instance', instance);
|
|
893
|
+
if (propName === 'getOriginalPrototype') {
|
|
894
|
+
return () => Object.getPrototypeOf(instance);
|
|
895
|
+
}
|
|
896
|
+
if (propName === 'getOriginalConstructor') {
|
|
897
|
+
return () => instance.constructor;
|
|
898
|
+
}
|
|
899
|
+
const methods = ctor[Symbols.classMethodsNames] || [];
|
|
900
|
+
const isMethods = methods.includes(propName);
|
|
901
|
+
const methodOrProperty = isMethods
|
|
902
|
+
? instance[propName].bind(instance)
|
|
903
|
+
: instance[propName];
|
|
904
|
+
// console.log(
|
|
905
|
+
// `methodOrProperty from proxy ${propName?.toString()} = isMethods:${isMethods}`,
|
|
906
|
+
// methods,
|
|
907
|
+
// );
|
|
908
|
+
return methodOrProperty;
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
});
|
|
912
|
+
};
|
|
913
|
+
// export const injectController = inject;
|
|
914
|
+
// export type SubscriptionEvent<T> = {
|
|
915
|
+
// name: keyof T;
|
|
916
|
+
// data: any;
|
|
917
|
+
// };
|
|
918
|
+
/**
|
|
919
|
+
* TODO
|
|
920
|
+
*/
|
|
921
|
+
// export const injectEntityEvents = <T>(
|
|
922
|
+
// subscriberClassResolveFn: () => new (...args: any[]) => T,
|
|
923
|
+
// eventName?: keyof Omit<EntitySubscriberInterface,'listenTo'> ,
|
|
924
|
+
// ): Observable<SubscriptionEvent<T>> => {
|
|
925
|
+
// const eventsSrc = new Subject<SubscriptionEvent<T>>();
|
|
926
|
+
// const obs = eventsSrc.asObservable();
|
|
927
|
+
// let isFirstSubscription = true;
|
|
928
|
+
// const proxyObservable = new Proxy(obs, {
|
|
929
|
+
// get(target, prop, receiver) {
|
|
930
|
+
// if (prop === 'subscribe') {
|
|
931
|
+
// return (...args: any[]) => {
|
|
932
|
+
// if (isFirstSubscription) {
|
|
933
|
+
// isFirstSubscription = false;
|
|
934
|
+
// const subscriberClassFN: typeof BaseClass =
|
|
935
|
+
// subscriberClassResolveFn() as any;
|
|
936
|
+
// const ctx = subscriberClassFN[
|
|
937
|
+
// Symbols.ctxInClassOrClassObj
|
|
938
|
+
// ] as EndpointContext;
|
|
939
|
+
// if (!ctx) {
|
|
940
|
+
// throw new Error(
|
|
941
|
+
// `You are trying to inject class without context. Use context like this:
|
|
942
|
+
// class MyClassSubscriber extends BaseSubscriber {
|
|
943
|
+
// ${eventName as any}() {
|
|
944
|
+
// \/\/ your code here
|
|
945
|
+
// }
|
|
946
|
+
// }
|
|
947
|
+
// Taon.injectSubscriberEvents( MyContext.getInstance(()=> MyClassSubscriber), '${eventName as any}' )
|
|
948
|
+
// `,
|
|
949
|
+
// );
|
|
950
|
+
// }
|
|
951
|
+
// const subscriberInstance = ctx.getInstanceBy(subscriberClassFN);
|
|
952
|
+
// // subscriberInstance TODO @LAST subscriber event from instance
|
|
953
|
+
// // const entity = subscriberClassFN.prototype.listenTo();
|
|
954
|
+
// console.log('First subscription, you can access arguments here:', {
|
|
955
|
+
// subscriberClassFN,
|
|
956
|
+
// eventName,
|
|
957
|
+
// });
|
|
958
|
+
// }
|
|
959
|
+
// return target.subscribe(...args);
|
|
960
|
+
// };
|
|
961
|
+
// }
|
|
962
|
+
// return Reflect.get(target, prop, receiver);
|
|
963
|
+
// },
|
|
964
|
+
// });
|
|
965
|
+
// return proxyObservable as Observable<SubscriptionEvent<T>>;
|
|
966
|
+
// };
|
|
967
|
+
|
|
880
968
|
/**
|
|
881
969
|
* TODO prevent calling methods when not initialized
|
|
882
970
|
* with init(ctx)
|
|
@@ -888,7 +976,9 @@ class BaseAngularsService {
|
|
|
888
976
|
//#region @browser
|
|
889
977
|
this.currentContext = inject$1(TAON_CONTEXT);
|
|
890
978
|
//#region @browser
|
|
891
|
-
this.CURRENT_HOST_BACKEND_PORT = inject$1(CURRENT_HOST_BACKEND_PORT
|
|
979
|
+
this.CURRENT_HOST_BACKEND_PORT = inject$1(CURRENT_HOST_BACKEND_PORT, {
|
|
980
|
+
optional: true,
|
|
981
|
+
});
|
|
892
982
|
// #endregion
|
|
893
983
|
}
|
|
894
984
|
/**
|
|
@@ -899,10 +989,17 @@ class BaseAngularsService {
|
|
|
899
989
|
get host() {
|
|
900
990
|
return `http://localhost:${this.CURRENT_HOST_BACKEND_PORT}`;
|
|
901
991
|
}
|
|
902
|
-
|
|
903
|
-
|
|
992
|
+
injectController(ctor) {
|
|
993
|
+
let currentContext;
|
|
994
|
+
//#region @browser
|
|
995
|
+
currentContext = this.currentContext;
|
|
996
|
+
//#endregion
|
|
997
|
+
return inject(() => currentContext.getClass(ctor));
|
|
998
|
+
}
|
|
999
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: BaseAngularsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1000
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: BaseAngularsService }); }
|
|
904
1001
|
}
|
|
905
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1002
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: BaseAngularsService, decorators: [{
|
|
906
1003
|
type: Injectable
|
|
907
1004
|
}], ctorParameters: () => [] });
|
|
908
1005
|
|
|
@@ -3561,7 +3658,7 @@ class EndpointContext {
|
|
|
3561
3658
|
}
|
|
3562
3659
|
//#endregion
|
|
3563
3660
|
//#region methods & getters / initialize metadata
|
|
3564
|
-
initControllers() {
|
|
3661
|
+
async initControllers() {
|
|
3565
3662
|
if (this.isRunOrRevertOnlyMigrationAppStart) {
|
|
3566
3663
|
return;
|
|
3567
3664
|
}
|
|
@@ -3612,7 +3709,8 @@ class EndpointContext {
|
|
|
3612
3709
|
/* */
|
|
3613
3710
|
/* */
|
|
3614
3711
|
// console.log('methods', classConfig.methods);
|
|
3615
|
-
Object.keys(classConfig.methods)
|
|
3712
|
+
const methodNames = Object.keys(classConfig.methods);
|
|
3713
|
+
for (const methodName of methodNames) {
|
|
3616
3714
|
const methodConfig = classConfig.methods[methodName];
|
|
3617
3715
|
// debugger
|
|
3618
3716
|
const type = methodConfig.type;
|
|
@@ -3639,9 +3737,9 @@ class EndpointContext {
|
|
|
3639
3737
|
// methodConfig,
|
|
3640
3738
|
// expressPath,
|
|
3641
3739
|
// );
|
|
3642
|
-
this.initClient(controllerClassFn, type, methodConfig, expressPath);
|
|
3740
|
+
await this.initClient(controllerClassFn, type, methodConfig, expressPath);
|
|
3643
3741
|
}
|
|
3644
|
-
}
|
|
3742
|
+
}
|
|
3645
3743
|
/* */
|
|
3646
3744
|
/* */
|
|
3647
3745
|
this.logHttp && console.groupEnd();
|
|
@@ -4093,7 +4191,7 @@ class EndpointContext {
|
|
|
4093
4191
|
/**
|
|
4094
4192
|
* client can be browser or nodejs (when remote host)
|
|
4095
4193
|
*/
|
|
4096
|
-
initClient(
|
|
4194
|
+
async initClient(
|
|
4097
4195
|
//#region parameters
|
|
4098
4196
|
target, type, methodConfig, expressPath) {
|
|
4099
4197
|
const ctx = this;
|
|
@@ -4113,6 +4211,7 @@ class EndpointContext {
|
|
|
4113
4211
|
const orgMethods = target.prototype[methodConfig.methodName];
|
|
4114
4212
|
//#region handle electron ipc request
|
|
4115
4213
|
if (Helpers.isElectron) {
|
|
4214
|
+
const ipcRenderer = window.require('electron').ipcRenderer;
|
|
4116
4215
|
target.prototype[methodConfig.methodName] = function (...args) {
|
|
4117
4216
|
const received = new Promise(async (resolve, reject) => {
|
|
4118
4217
|
const headers = {};
|
|
@@ -4541,7 +4640,7 @@ const createContext = (configFn) => {
|
|
|
4541
4640
|
// endpointContextRef?.connection?.subscribers,
|
|
4542
4641
|
// );
|
|
4543
4642
|
// debugger;
|
|
4544
|
-
endpointContextRef.initControllers();
|
|
4643
|
+
await endpointContextRef.initControllers();
|
|
4545
4644
|
await endpointContextRef.startServer();
|
|
4546
4645
|
//#region @websql
|
|
4547
4646
|
endpointContextRef.writeActiveRoutes();
|
|
@@ -6098,95 +6197,6 @@ var Http;
|
|
|
6098
6197
|
})(Param = Http.Param || (Http.Param = {}));
|
|
6099
6198
|
})(Http || (Http = {}));
|
|
6100
6199
|
|
|
6101
|
-
const inject = (entity) => {
|
|
6102
|
-
return new Proxy({}, {
|
|
6103
|
-
get: (_, propName) => {
|
|
6104
|
-
if (propName === 'hasOwnProperty') {
|
|
6105
|
-
return () => false;
|
|
6106
|
-
}
|
|
6107
|
-
const ctor = entity();
|
|
6108
|
-
const contextFromClass = ctor[Symbols.ctxInClassOrClassObj];
|
|
6109
|
-
const resultContext = contextFromClass;
|
|
6110
|
-
if (resultContext) {
|
|
6111
|
-
let instance = resultContext.inject(ctor, {
|
|
6112
|
-
parentInstanceThatWillGetInjectedStuff: this,
|
|
6113
|
-
});
|
|
6114
|
-
// console.log('instance', instance);
|
|
6115
|
-
if (propName === 'getOriginalPrototype') {
|
|
6116
|
-
return () => Object.getPrototypeOf(instance);
|
|
6117
|
-
}
|
|
6118
|
-
if (propName === 'getOriginalConstructor') {
|
|
6119
|
-
return () => instance.constructor;
|
|
6120
|
-
}
|
|
6121
|
-
const methods = ctor[Symbols.classMethodsNames] || [];
|
|
6122
|
-
const isMethods = methods.includes(propName);
|
|
6123
|
-
const methodOrProperty = isMethods
|
|
6124
|
-
? instance[propName].bind(instance)
|
|
6125
|
-
: instance[propName];
|
|
6126
|
-
// console.log(
|
|
6127
|
-
// `methodOrProperty from proxy ${propName?.toString()} = isMethods:${isMethods}`,
|
|
6128
|
-
// methods,
|
|
6129
|
-
// );
|
|
6130
|
-
return methodOrProperty;
|
|
6131
|
-
}
|
|
6132
|
-
},
|
|
6133
|
-
});
|
|
6134
|
-
};
|
|
6135
|
-
// export const injectController = inject;
|
|
6136
|
-
// export type SubscriptionEvent<T> = {
|
|
6137
|
-
// name: keyof T;
|
|
6138
|
-
// data: any;
|
|
6139
|
-
// };
|
|
6140
|
-
/**
|
|
6141
|
-
* TODO
|
|
6142
|
-
*/
|
|
6143
|
-
// export const injectEntityEvents = <T>(
|
|
6144
|
-
// subscriberClassResolveFn: () => new (...args: any[]) => T,
|
|
6145
|
-
// eventName?: keyof Omit<EntitySubscriberInterface,'listenTo'> ,
|
|
6146
|
-
// ): Observable<SubscriptionEvent<T>> => {
|
|
6147
|
-
// const eventsSrc = new Subject<SubscriptionEvent<T>>();
|
|
6148
|
-
// const obs = eventsSrc.asObservable();
|
|
6149
|
-
// let isFirstSubscription = true;
|
|
6150
|
-
// const proxyObservable = new Proxy(obs, {
|
|
6151
|
-
// get(target, prop, receiver) {
|
|
6152
|
-
// if (prop === 'subscribe') {
|
|
6153
|
-
// return (...args: any[]) => {
|
|
6154
|
-
// if (isFirstSubscription) {
|
|
6155
|
-
// isFirstSubscription = false;
|
|
6156
|
-
// const subscriberClassFN: typeof BaseClass =
|
|
6157
|
-
// subscriberClassResolveFn() as any;
|
|
6158
|
-
// const ctx = subscriberClassFN[
|
|
6159
|
-
// Symbols.ctxInClassOrClassObj
|
|
6160
|
-
// ] as EndpointContext;
|
|
6161
|
-
// if (!ctx) {
|
|
6162
|
-
// throw new Error(
|
|
6163
|
-
// `You are trying to inject class without context. Use context like this:
|
|
6164
|
-
// class MyClassSubscriber extends BaseSubscriber {
|
|
6165
|
-
// ${eventName as any}() {
|
|
6166
|
-
// \/\/ your code here
|
|
6167
|
-
// }
|
|
6168
|
-
// }
|
|
6169
|
-
// Taon.injectSubscriberEvents( MyContext.getInstance(()=> MyClassSubscriber), '${eventName as any}' )
|
|
6170
|
-
// `,
|
|
6171
|
-
// );
|
|
6172
|
-
// }
|
|
6173
|
-
// const subscriberInstance = ctx.getInstanceBy(subscriberClassFN);
|
|
6174
|
-
// // subscriberInstance TODO @LAST subscriber event from instance
|
|
6175
|
-
// // const entity = subscriberClassFN.prototype.listenTo();
|
|
6176
|
-
// console.log('First subscription, you can access arguments here:', {
|
|
6177
|
-
// subscriberClassFN,
|
|
6178
|
-
// eventName,
|
|
6179
|
-
// });
|
|
6180
|
-
// }
|
|
6181
|
-
// return target.subscribe(...args);
|
|
6182
|
-
// };
|
|
6183
|
-
// }
|
|
6184
|
-
// return Reflect.get(target, prop, receiver);
|
|
6185
|
-
// },
|
|
6186
|
-
// });
|
|
6187
|
-
// return proxyObservable as Observable<SubscriptionEvent<T>>;
|
|
6188
|
-
// };
|
|
6189
|
-
|
|
6190
6200
|
// TODO export all things
|
|
6191
6201
|
var Taon;
|
|
6192
6202
|
(function (Taon) {
|