taon 21.0.16 → 21.0.18
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-browser.mjs +72 -35
- package/browser/fesm2022/taon-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/taon-browser.d.ts +16 -6
- package/lib/base-classes/base-angular-service.d.ts +9 -0
- package/lib/base-classes/base-angular-service.js +20 -0
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-electron-service.d.ts +0 -0
- package/lib/base-classes/base-electron-service.js +50 -0
- package/lib/base-classes/base-electron-service.js.map +1 -0
- package/lib/base-classes/base-repository.d.ts +1 -0
- package/lib/base-classes/base-repository.js +27 -8
- package/lib/base-classes/base-repository.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/endpoint-context.d.ts +0 -4
- package/lib/endpoint-context.js +8 -18
- package/lib/endpoint-context.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +2 -3
- package/lib/env/env.angular-node-app.js +4 -5
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +2 -3
- package/lib/env/env.docs-webapp.js +4 -5
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +2 -3
- package/lib/env/env.electron-app.js +4 -5
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +2 -3
- package/lib/env/env.mobile-app.js +4 -5
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +2 -3
- package/lib/env/env.npm-lib-and-cli-tool.js +4 -5
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +2 -3
- package/lib/env/env.vscode-plugin.js +4 -5
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/index._auto-generated_.js +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +18 -5
- package/lib/index.js.map +1 -1
- package/lib/realtime/realtime-subs-manager.js +1 -10
- package/lib/realtime/realtime-subs-manager.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +1 -1
- package/websql/fesm2022/taon-websql.mjs +78 -43
- package/websql/fesm2022/taon-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/taon-websql.d.ts +16 -6
|
@@ -7,12 +7,13 @@ import { walk } from 'lodash-walk-object/browser';
|
|
|
7
7
|
import { RestResponseWrapper, Models as Models$1, Resource, RestHeaders, Mapping, HttpResponseError } from 'ng2-rest/browser';
|
|
8
8
|
import { Observable, from, Subject } from 'rxjs';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { InjectionToken, inject as inject$1, Injectable, ViewContainerRef, ViewChild, Component } from '@angular/core';
|
|
10
|
+
import { InjectionToken, inject as inject$1, PLATFORM_ID, Injectable, ViewContainerRef, ViewChild, Component } from '@angular/core';
|
|
11
11
|
import { Table, OrignalClassKey, Column } from 'taon-typeorm/browser';
|
|
12
12
|
export { AfterInsert, AfterLoad, AfterRecover, AfterRemove, AfterSoftRemove, AfterUpdate, BeforeInsert, BeforeRecover, BeforeRemove, BeforeSoftRemove, BeforeUpdate, Column, Connection, CreateDateColumn, Column as CustomColumn, DeleteDateColumn, Generated, Generated as GeneratedColumn, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, Repository, TreeChildren, TreeParent, UpdateDateColumn, VersionColumn, VirtualColumn } from 'taon-typeorm/browser';
|
|
13
13
|
import { SYMBOL, CLASS } from 'typescript-class-helpers/browser';
|
|
14
14
|
import * as JSON5 from 'json5';
|
|
15
15
|
import { io } from 'socket.io-client';
|
|
16
|
+
import { isPlatformServer, isPlatformBrowser } from '@angular/common';
|
|
16
17
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
17
18
|
import * as i1 from '@ngx-formly/core';
|
|
18
19
|
import { FieldWrapper, FieldArrayType } from '@ngx-formly/core';
|
|
@@ -1312,20 +1313,11 @@ class RealtimeSubsManager {
|
|
|
1312
1313
|
//#region methods & getters / update
|
|
1313
1314
|
update(data) {
|
|
1314
1315
|
// log.data(`realtime update!!!!! observers=${this.observers?.length} `)
|
|
1315
|
-
const ngZone = this.options.core.ctx.ngZone;
|
|
1316
1316
|
// console.log('updating', data);
|
|
1317
|
-
// console.log('ngzone', ngZone);
|
|
1318
1317
|
this.observers.forEach(observer => {
|
|
1319
1318
|
// console.log(`observer closed: ${observer.closed}`,observer);
|
|
1320
1319
|
if (!observer.closed) {
|
|
1321
|
-
|
|
1322
|
-
ngZone.run(() => {
|
|
1323
|
-
observer.next(data);
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
else {
|
|
1327
|
-
observer.next(data);
|
|
1328
|
-
}
|
|
1320
|
+
observer.next(data);
|
|
1329
1321
|
}
|
|
1330
1322
|
});
|
|
1331
1323
|
}
|
|
@@ -2541,15 +2533,10 @@ class RealtimeCore {
|
|
|
2541
2533
|
}
|
|
2542
2534
|
}
|
|
2543
2535
|
|
|
2536
|
+
/* */
|
|
2537
|
+
/* */
|
|
2544
2538
|
//#endregion
|
|
2545
2539
|
class EndpointContext {
|
|
2546
|
-
//#endregion
|
|
2547
|
-
//#region @browser
|
|
2548
|
-
static initNgZone(ngZone) {
|
|
2549
|
-
//#region @browser
|
|
2550
|
-
this.ngZone = ngZone;
|
|
2551
|
-
//#endregion
|
|
2552
|
-
}
|
|
2553
2540
|
//#endregion
|
|
2554
2541
|
//#region fields / typeorm repositories
|
|
2555
2542
|
/* */
|
|
@@ -2617,8 +2604,6 @@ class EndpointContext {
|
|
|
2617
2604
|
this.originalConfig = originalConfig;
|
|
2618
2605
|
this.configFn = configFn;
|
|
2619
2606
|
this.cloneOptions = cloneOptions;
|
|
2620
|
-
//#endregion
|
|
2621
|
-
//#endregion
|
|
2622
2607
|
//#region fields
|
|
2623
2608
|
//#region fields / use mariadb mysql in docker
|
|
2624
2609
|
/**
|
|
@@ -3033,6 +3018,14 @@ class EndpointContext {
|
|
|
3033
3018
|
//#region prepare realtime
|
|
3034
3019
|
if (!this.config.abstract) {
|
|
3035
3020
|
this.disabledRealtime = this.config.disabledRealtime;
|
|
3021
|
+
if (!this.host) {
|
|
3022
|
+
throw `
|
|
3023
|
+
|
|
3024
|
+
host is required for context initialization..
|
|
3025
|
+
(Or maybe you forgot mark ${this.config.contextName} context as abstract?)
|
|
3026
|
+
|
|
3027
|
+
`;
|
|
3028
|
+
}
|
|
3036
3029
|
/* */
|
|
3037
3030
|
/* */
|
|
3038
3031
|
/* */
|
|
@@ -3208,14 +3201,6 @@ class EndpointContext {
|
|
|
3208
3201
|
return (void 0);
|
|
3209
3202
|
}
|
|
3210
3203
|
//#endregion
|
|
3211
|
-
//#region methods & getters / ng zone
|
|
3212
|
-
get ngZone() {
|
|
3213
|
-
//#region @browser
|
|
3214
|
-
return EndpointContext.ngZone;
|
|
3215
|
-
//#endregion
|
|
3216
|
-
return;
|
|
3217
|
-
}
|
|
3218
|
-
//#endregion
|
|
3219
3204
|
//#region methods & getters / start server
|
|
3220
3205
|
async startServer() {
|
|
3221
3206
|
/* */
|
|
@@ -5722,6 +5707,7 @@ class TaonBaseAngularService {
|
|
|
5722
5707
|
//#endregion
|
|
5723
5708
|
constructor() {
|
|
5724
5709
|
//#region @browser
|
|
5710
|
+
this.platformId = inject$1(PLATFORM_ID);
|
|
5725
5711
|
this.currentContext = inject$1(TAON_CONTEXT);
|
|
5726
5712
|
//#region @browser
|
|
5727
5713
|
this.CURRENT_HOST_BACKEND_PORT = inject$1(CURRENT_HOST_BACKEND_PORT, {
|
|
@@ -5732,6 +5718,24 @@ class TaonBaseAngularService {
|
|
|
5732
5718
|
});
|
|
5733
5719
|
// #endregion
|
|
5734
5720
|
}
|
|
5721
|
+
/**
|
|
5722
|
+
* Returns true if the application is running in SSR (server-side rendering) mode only.
|
|
5723
|
+
*/
|
|
5724
|
+
get isSsrPlatform() {
|
|
5725
|
+
//#region @browser
|
|
5726
|
+
return isPlatformServer(this.platformId);
|
|
5727
|
+
//#endregion
|
|
5728
|
+
return false;
|
|
5729
|
+
}
|
|
5730
|
+
/**
|
|
5731
|
+
* Returns true if the application is running in browser-only mode.
|
|
5732
|
+
*/
|
|
5733
|
+
get isBrowserPlatform() {
|
|
5734
|
+
//#region @browser
|
|
5735
|
+
return isPlatformBrowser(this.platformId);
|
|
5736
|
+
//#endregion
|
|
5737
|
+
return false;
|
|
5738
|
+
}
|
|
5735
5739
|
/**
|
|
5736
5740
|
* @deprecated
|
|
5737
5741
|
* Returns the host URL for the backend service
|
|
@@ -6067,12 +6071,12 @@ TaonBaseCustomRepository = __decorate([
|
|
|
6067
6071
|
|
|
6068
6072
|
//#endregion
|
|
6069
6073
|
const INDEX_KEYS_NO_FOR_UPDATE = ['id'];
|
|
6070
|
-
const REPOS_CACHE = Symbol('repository cache inside instance');
|
|
6071
6074
|
let TaonBaseRepository = class TaonBaseRepository extends TaonBaseCustomRepository {
|
|
6072
6075
|
constructor(
|
|
6073
6076
|
// Injected through TaonBaseCrudController
|
|
6074
6077
|
__entityClassResolveFn) {
|
|
6075
6078
|
super();
|
|
6079
|
+
this.REPOS_CACHE_KEY = Symbol('repository cache inside instance');
|
|
6076
6080
|
this.allowedTypesToUpdate = ['simple-json', 'simple-array', 'json'];
|
|
6077
6081
|
// @ts-ignore
|
|
6078
6082
|
this.entityClassResolveFn = __entityClassResolveFn;
|
|
@@ -6109,6 +6113,25 @@ let TaonBaseRepository = class TaonBaseRepository extends TaonBaseCustomReposito
|
|
|
6109
6113
|
//#endregion
|
|
6110
6114
|
//#region repository
|
|
6111
6115
|
get repository() {
|
|
6116
|
+
/* */
|
|
6117
|
+
/* */
|
|
6118
|
+
/* */
|
|
6119
|
+
/* */
|
|
6120
|
+
/* */
|
|
6121
|
+
/* */
|
|
6122
|
+
/* */
|
|
6123
|
+
/* */
|
|
6124
|
+
/* */
|
|
6125
|
+
/* */
|
|
6126
|
+
/* */
|
|
6127
|
+
/* */
|
|
6128
|
+
/* */
|
|
6129
|
+
/* */
|
|
6130
|
+
/* */
|
|
6131
|
+
/* */
|
|
6132
|
+
/* */
|
|
6133
|
+
/* */
|
|
6134
|
+
/* */
|
|
6112
6135
|
/* */
|
|
6113
6136
|
/* */
|
|
6114
6137
|
/* */
|
|
@@ -6296,6 +6319,7 @@ let TaonBaseRepository = class TaonBaseRepository extends TaonBaseCustomReposito
|
|
|
6296
6319
|
/* */
|
|
6297
6320
|
/* */
|
|
6298
6321
|
/* */
|
|
6322
|
+
/* */
|
|
6299
6323
|
return (void 0);
|
|
6300
6324
|
}
|
|
6301
6325
|
/**
|
|
@@ -6349,6 +6373,7 @@ let TaonBaseRepository = class TaonBaseRepository extends TaonBaseCustomReposito
|
|
|
6349
6373
|
* Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
|
|
6350
6374
|
*/
|
|
6351
6375
|
insert(entity) {
|
|
6376
|
+
// debugger;
|
|
6352
6377
|
return this.repo.insert(entity);
|
|
6353
6378
|
}
|
|
6354
6379
|
//#endregion
|
|
@@ -7993,6 +8018,23 @@ class TaonProviderOptions extends DecoratorAbstractOpt {
|
|
|
7993
8018
|
// TODO export all things
|
|
7994
8019
|
var Taon;
|
|
7995
8020
|
(function (Taon) {
|
|
8021
|
+
/**
|
|
8022
|
+
* Remove global taon loader from env.ts [loading.preAngularBootstrap]
|
|
8023
|
+
*/
|
|
8024
|
+
Taon.removeLoader = (afterMS = 0) => {
|
|
8025
|
+
return new Promise((resolve) => {
|
|
8026
|
+
setTimeout(() => {
|
|
8027
|
+
globalThis?.window?.document
|
|
8028
|
+
?.getElementById('taonpreloadertoremove')
|
|
8029
|
+
?.remove();
|
|
8030
|
+
const body = globalThis?.window?.document?.body;
|
|
8031
|
+
if (body && body.style) {
|
|
8032
|
+
body.style.backgroundColor = '';
|
|
8033
|
+
}
|
|
8034
|
+
resolve();
|
|
8035
|
+
}, afterMS);
|
|
8036
|
+
});
|
|
8037
|
+
};
|
|
7996
8038
|
Taon.error = (opt) => {
|
|
7997
8039
|
throw () => {
|
|
7998
8040
|
if (typeof opt === 'string') {
|
|
@@ -8023,11 +8065,6 @@ var Taon;
|
|
|
8023
8065
|
Taon.createContext = createContext;
|
|
8024
8066
|
Taon.createContextTemplate = createContextTemplate;
|
|
8025
8067
|
Taon.inject = inject;
|
|
8026
|
-
//#region @browser
|
|
8027
|
-
Taon.initNgZone = (ngZone) => {
|
|
8028
|
-
EndpointContext.initNgZone(ngZone);
|
|
8029
|
-
};
|
|
8030
|
-
//#endregion
|
|
8031
8068
|
Taon.symbols = Symbols;
|
|
8032
8069
|
/**
|
|
8033
8070
|
* @deprecated
|
|
@@ -8162,7 +8199,7 @@ const TAON_FLATTEN_MAPPING = {
|
|
|
8162
8199
|
// Optional: if your old code had Stor.proper... (typo)
|
|
8163
8200
|
'Stor.proper.in.localstorage': 'StorPropertyInLocalStorage',
|
|
8164
8201
|
'Stor.proper.in.indexedb': 'StorPropertyInIndexedDb',
|
|
8165
|
-
}
|
|
8202
|
+
},
|
|
8166
8203
|
};
|
|
8167
8204
|
//#endregion
|
|
8168
8205
|
|