taon 19.0.39 → 19.0.46
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/README.md +160 -160
- package/bin/start.js +279 -279
- package/bin/taon +6 -6
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +5 -5
- package/browser/README.md +24 -24
- package/browser/fesm2022/taon.mjs +113 -31
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/context-db-migrations.d.ts +1 -1
- package/browser/lib/create-context.d.ts +9 -0
- package/browser/lib/endpoint-context.d.ts +4 -0
- package/browser/package.json +1 -1
- package/cli.js.map +1 -1
- package/index.js.map +1 -1
- package/lib/base-classes/base-abstract-entity.js.map +1 -1
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-class.js.map +1 -1
- package/lib/base-classes/base-context.js.map +1 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-crud-controller.js.map +1 -1
- package/lib/base-classes/base-custom-repository.js.map +1 -1
- package/lib/base-classes/base-entity.js.map +1 -1
- package/lib/base-classes/base-injector.js.map +1 -1
- package/lib/base-classes/base-migration.js.map +1 -1
- package/lib/base-classes/base-provider.js.map +1 -1
- package/lib/base-classes/base-repository.js.map +1 -1
- package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
- package/lib/base-classes/base.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/context-db-migrations.js.map +1 -1
- package/lib/create-context.d.ts +9 -0
- package/lib/create-context.js +10 -2
- package/lib/create-context.js.map +1 -1
- package/lib/decorators/classes/controller-decorator.js.map +1 -1
- package/lib/decorators/classes/entity-decorator.js.map +1 -1
- package/lib/decorators/classes/migration-decorator.js.map +1 -1
- package/lib/decorators/classes/provider-decorator.js.map +1 -1
- package/lib/decorators/classes/repository-decorator.js.map +1 -1
- package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
- package/lib/decorators/http/http-decorators.js.map +1 -1
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/decorators/http/http-params-decorators.js.map +1 -1
- package/lib/dependency-injection/di-container.js.map +1 -1
- package/lib/endpoint-context.d.ts +4 -0
- package/lib/endpoint-context.js +205 -121
- package/lib/endpoint-context.js.map +1 -1
- package/lib/entity-process.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +6 -0
- package/lib/env/env.angular-node-app.js +8 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +6 -0
- package/lib/env/env.docs-webapp.js +8 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +6 -0
- package/lib/env/env.electron-app.js +8 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +6 -0
- package/lib/env/env.mobile-app.js +8 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +6 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +8 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +6 -0
- package/lib/env/env.vscode-plugin.js +8 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/env/index.js.map +1 -1
- package/lib/formly/formly-group-wrapper-component.js.map +1 -1
- package/lib/formly/formly-repeat-component.js.map +1 -1
- package/lib/formly/formly.models.js.map +1 -1
- package/lib/formly/fromly.js.map +1 -1
- package/lib/formly/type-from-entity.js.map +1 -1
- package/lib/get-response-value.js.map +1 -1
- package/lib/helpers/class-helpers.js.map +1 -1
- package/lib/helpers/taon-helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/inject.js.map +1 -1
- package/lib/models.js.map +1 -1
- package/lib/orm.js.map +1 -1
- package/lib/realtime/realtime-client.js.map +1 -1
- package/lib/realtime/realtime-core.js.map +1 -1
- package/lib/realtime/realtime-server.js.map +1 -1
- package/lib/realtime/realtime-strategy/index.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy.js.map +1 -1
- package/lib/realtime/realtime-subs-manager.js.map +1 -1
- package/lib/realtime/realtime.models.js.map +1 -1
- package/lib/symbols.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js.map +1 -1
- package/lib/validators.js.map +1 -1
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/old-app .js.map +1 -1
- package/package.json +2 -1
- package/playground.js.map +1 -1
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs +135 -62
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/create-context.d.ts +9 -0
- package/websql/lib/endpoint-context.d.ts +4 -0
- package/websql/package.json +1 -1
- package/browser/lib/env.d.ts +0 -3
- package/lib/env.d.ts +0 -2
- package/lib/env.js +0 -7
- package/lib/env.js.map +0 -1
- package/lib/storage.d.ts +0 -1
- package/lib/storage.js +0 -6
- package/lib/storage.js.map +0 -1
- package/websql/lib/env.d.ts +0 -3
|
@@ -13,7 +13,6 @@ import axios from 'axios';
|
|
|
13
13
|
import { JSON10 } from 'json10/browser';
|
|
14
14
|
import { Observable, from, Subject } from 'rxjs';
|
|
15
15
|
import { io } from 'socket.io-client';
|
|
16
|
-
import { Stor } from 'taon-storage/browser';
|
|
17
16
|
|
|
18
17
|
var Symbols;
|
|
19
18
|
(function (Symbols) {
|
|
@@ -1367,8 +1366,6 @@ class DITaonContainer {
|
|
|
1367
1366
|
}
|
|
1368
1367
|
}
|
|
1369
1368
|
|
|
1370
|
-
const ENV$1 = Helpers.isBrowser ? window['ENV'] : global['ENV'];
|
|
1371
|
-
|
|
1372
1369
|
const getResponseValue = (response, options) => {
|
|
1373
1370
|
/* */
|
|
1374
1371
|
/* */
|
|
@@ -2701,6 +2698,11 @@ class EndpointContext {
|
|
|
2701
2698
|
constructor(originalConfig, configFn) {
|
|
2702
2699
|
this.originalConfig = originalConfig;
|
|
2703
2700
|
this.configFn = configFn;
|
|
2701
|
+
//#region static
|
|
2702
|
+
/**
|
|
2703
|
+
* JUST FOR TESTING PURPOSES
|
|
2704
|
+
*/
|
|
2705
|
+
this.USE_MARIADB_MYSQL_IN_DOCKER = false;
|
|
2704
2706
|
//#endregion
|
|
2705
2707
|
// public static findForTraget(classFnOrObject: any): EndpointContext {
|
|
2706
2708
|
// const obj = ClassHelpers.getClassFnFromObject(classFnOrObject) || {};
|
|
@@ -2871,7 +2873,7 @@ class EndpointContext {
|
|
|
2871
2873
|
this.onlyMigrationRun = onlyMigrationRun;
|
|
2872
2874
|
// @ts-ignore
|
|
2873
2875
|
this.onlyMigrationRevertToTimestamp = onlyMigrationRevertToTimestamp;
|
|
2874
|
-
this.config = this.configFn(
|
|
2876
|
+
this.config = this.configFn({});
|
|
2875
2877
|
if (_.isObject(this.config.database)) {
|
|
2876
2878
|
this.config.database = Models.DatabaseConfig.from(this.config.database).databaseConfigTypeORM;
|
|
2877
2879
|
}
|
|
@@ -2934,10 +2936,34 @@ class EndpointContext {
|
|
|
2934
2936
|
//#endregion
|
|
2935
2937
|
//#region resolve database config
|
|
2936
2938
|
if (this.config.database === true) {
|
|
2939
|
+
this.logFramework &&
|
|
2940
|
+
console.log(`
|
|
2941
|
+
|
|
2942
|
+
ASSIGNING AUTO GENERATED DATABASE CONFIG
|
|
2943
|
+
|
|
2944
|
+
`);
|
|
2937
2945
|
this.databaseConfig = this.getAutoGeneratedConfig();
|
|
2938
2946
|
}
|
|
2939
2947
|
else if (_.isObject(this.config.database)) {
|
|
2940
|
-
this.
|
|
2948
|
+
this.logFramework &&
|
|
2949
|
+
console.log(`
|
|
2950
|
+
|
|
2951
|
+
OVERRIDE DATABASE CONFIG FROM CONFIGURATION
|
|
2952
|
+
|
|
2953
|
+
`);
|
|
2954
|
+
this.databaseConfig = this.getAutoGeneratedConfig();
|
|
2955
|
+
walk.Object(this.config.database, (value, lodashPath) => {
|
|
2956
|
+
if (_.isNil(value) || _.isFunction(value) || _.isObject(value)) {
|
|
2957
|
+
// skipping
|
|
2958
|
+
}
|
|
2959
|
+
else {
|
|
2960
|
+
this.logFramework &&
|
|
2961
|
+
console.info(`Overriding database config: ${lodashPath}=${value}`);
|
|
2962
|
+
_.set(this.databaseConfig, lodashPath, value);
|
|
2963
|
+
}
|
|
2964
|
+
}, {
|
|
2965
|
+
walkGetters: false,
|
|
2966
|
+
});
|
|
2941
2967
|
}
|
|
2942
2968
|
//#endregion
|
|
2943
2969
|
//#region resolve session
|
|
@@ -3088,6 +3114,54 @@ class EndpointContext {
|
|
|
3088
3114
|
//#endregion
|
|
3089
3115
|
//#region methods & getters / get auto generated config
|
|
3090
3116
|
getAutoGeneratedConfig() {
|
|
3117
|
+
this.logFramework &&
|
|
3118
|
+
console.log(`
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
IS RUNNING IN DOCKER: ${UtilsOs.isRunningInDocker()}
|
|
3122
|
+
|
|
3123
|
+
`);
|
|
3124
|
+
/* */
|
|
3125
|
+
/* */
|
|
3126
|
+
/* */
|
|
3127
|
+
/* */
|
|
3128
|
+
/* */
|
|
3129
|
+
/* */
|
|
3130
|
+
/* */
|
|
3131
|
+
/* */
|
|
3132
|
+
/* */
|
|
3133
|
+
/* */
|
|
3134
|
+
/* */
|
|
3135
|
+
/* */
|
|
3136
|
+
/* */
|
|
3137
|
+
/* */
|
|
3138
|
+
/* */
|
|
3139
|
+
/* */
|
|
3140
|
+
/* */
|
|
3141
|
+
/* */
|
|
3142
|
+
/* */
|
|
3143
|
+
/* */
|
|
3144
|
+
/* */
|
|
3145
|
+
/* */
|
|
3146
|
+
/* */
|
|
3147
|
+
/* */
|
|
3148
|
+
/* */
|
|
3149
|
+
/* */
|
|
3150
|
+
/* */
|
|
3151
|
+
/* */
|
|
3152
|
+
/* */
|
|
3153
|
+
/* */
|
|
3154
|
+
/* */
|
|
3155
|
+
/* */
|
|
3156
|
+
/* */
|
|
3157
|
+
/* */
|
|
3158
|
+
/* */
|
|
3159
|
+
/* */
|
|
3160
|
+
/* */
|
|
3161
|
+
/* */
|
|
3162
|
+
/* */
|
|
3163
|
+
/* */
|
|
3164
|
+
/* */
|
|
3091
3165
|
/* */
|
|
3092
3166
|
/* */
|
|
3093
3167
|
/* */
|
|
@@ -3204,6 +3278,7 @@ class EndpointContext {
|
|
|
3204
3278
|
/* */
|
|
3205
3279
|
/* */
|
|
3206
3280
|
/* */
|
|
3281
|
+
/* */
|
|
3207
3282
|
return (void 0);
|
|
3208
3283
|
}
|
|
3209
3284
|
//#endregion
|
|
@@ -3744,6 +3819,22 @@ class EndpointContext {
|
|
|
3744
3819
|
/* */
|
|
3745
3820
|
/* */
|
|
3746
3821
|
/* */
|
|
3822
|
+
/* */
|
|
3823
|
+
/* */
|
|
3824
|
+
/* */
|
|
3825
|
+
/* */
|
|
3826
|
+
/* */
|
|
3827
|
+
/* */
|
|
3828
|
+
/* */
|
|
3829
|
+
/* */
|
|
3830
|
+
/* */
|
|
3831
|
+
/* */
|
|
3832
|
+
/* */
|
|
3833
|
+
/* */
|
|
3834
|
+
/* */
|
|
3835
|
+
/* */
|
|
3836
|
+
/* */
|
|
3837
|
+
/* */
|
|
3747
3838
|
return (void 0);
|
|
3748
3839
|
}
|
|
3749
3840
|
//#endregion
|
|
@@ -4305,14 +4396,8 @@ class EndpointContext {
|
|
|
4305
4396
|
this.logHttp && console.log(`${type?.toUpperCase()} ${expressPath} `);
|
|
4306
4397
|
// console.log('INITING', methodConfig); // TODO inject in static
|
|
4307
4398
|
//#region resolve storage
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
storage = window;
|
|
4311
|
-
}
|
|
4312
|
-
/* */
|
|
4313
|
-
/* */
|
|
4314
|
-
/* */
|
|
4315
|
-
/* */
|
|
4399
|
+
// TODO not a good idea
|
|
4400
|
+
const storage = globalThis;
|
|
4316
4401
|
//#endregion
|
|
4317
4402
|
const orgMethods = target.prototype[methodConfig.methodName];
|
|
4318
4403
|
//#region handle electron ipc request
|
|
@@ -4498,6 +4583,9 @@ class EndpointContext {
|
|
|
4498
4583
|
/* */
|
|
4499
4584
|
/* */
|
|
4500
4585
|
/* */
|
|
4586
|
+
/* */
|
|
4587
|
+
/* */
|
|
4588
|
+
/* */
|
|
4501
4589
|
//#endregion
|
|
4502
4590
|
//#region handle normal request
|
|
4503
4591
|
target.prototype[methodConfig.methodName] = function (...args) {
|
|
@@ -4647,8 +4735,9 @@ instead
|
|
|
4647
4735
|
}
|
|
4648
4736
|
}
|
|
4649
4737
|
|
|
4738
|
+
//#region import
|
|
4650
4739
|
//#endregion
|
|
4651
|
-
const ENV =
|
|
4740
|
+
const ENV = globalThis['ENV'];
|
|
4652
4741
|
// @Injectable({ providedIn: 'root' }) TODO make it angular service
|
|
4653
4742
|
class TaonAdminService {
|
|
4654
4743
|
static get Instance() {
|
|
@@ -4691,32 +4780,25 @@ class TaonAdminService {
|
|
|
4691
4780
|
}
|
|
4692
4781
|
logout() { }
|
|
4693
4782
|
}
|
|
4694
|
-
__decorate([
|
|
4695
|
-
(Stor.property.in.localstorage.for(TaonAdminService).withDefaultValue(false)),
|
|
4696
|
-
__metadata("design:type", Boolean)
|
|
4697
|
-
], TaonAdminService.prototype, "adminPanelIsOpen", void 0);
|
|
4698
|
-
__decorate([
|
|
4699
|
-
(Stor.property.in.localstorage.for(TaonAdminService).withDefaultValue(false)),
|
|
4700
|
-
__metadata("design:type", Boolean)
|
|
4701
|
-
], TaonAdminService.prototype, "draggablePopupMode", void 0);
|
|
4702
|
-
__decorate([
|
|
4703
|
-
(Stor.property.in.localstorage.for(TaonAdminService).withDefaultValue(false)),
|
|
4704
|
-
__metadata("design:type", Boolean)
|
|
4705
|
-
], TaonAdminService.prototype, "draggablePopupModeFullScreen", void 0);
|
|
4706
|
-
__decorate([
|
|
4707
|
-
(Stor.property.in.localstorage.for(TaonAdminService).withDefaultValue(false)),
|
|
4708
|
-
__metadata("design:type", Boolean)
|
|
4709
|
-
], TaonAdminService.prototype, "keepWebsqlDbDataAfterReload", void 0);
|
|
4710
4783
|
|
|
4711
4784
|
//#region imports
|
|
4712
4785
|
//#endregion
|
|
4786
|
+
/**
|
|
4787
|
+
* @returns function that returns context function.
|
|
4788
|
+
* Context function can be used to dynamically
|
|
4789
|
+
* create context with specific configuration.
|
|
4790
|
+
*/
|
|
4713
4791
|
const createContextTemplate = (configFn) => {
|
|
4714
4792
|
return () => {
|
|
4715
4793
|
return createContext(configFn);
|
|
4716
4794
|
};
|
|
4717
4795
|
};
|
|
4796
|
+
/**
|
|
4797
|
+
* REQURIED PROPERTY:
|
|
4798
|
+
* - contextName
|
|
4799
|
+
*/
|
|
4718
4800
|
const createContext = (configFn) => {
|
|
4719
|
-
let config = configFn(
|
|
4801
|
+
let config = configFn({});
|
|
4720
4802
|
const endpointContextRef = new EndpointContext(config, configFn);
|
|
4721
4803
|
const res = {
|
|
4722
4804
|
//#region types
|