taon 21.0.92 → 21.0.99
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/VERIFIED-BUILD-DATA.jsonc +3 -3
- package/bin/taon +5 -5
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +4 -4
- package/browser/fesm2022/taon-browser.mjs +284 -8
- package/browser/fesm2022/taon-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/taon-browser.d.ts +27 -13
- package/browser-prod/fesm2022/taon-browser-prod.mjs +284 -8
- package/browser-prod/fesm2022/taon-browser-prod.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/browser-prod/types/taon-browser-prod.d.ts +28 -14
- package/browser-prod.split-namespaces.json +0 -2
- package/icon-menu-taon.svg +15 -15
- package/lib/base-classes/base-angular-service.js +6 -2
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-file-upload.middleware.js +1 -1
- package/lib/base-classes/base-file-upload.middleware.js.map +1 -1
- package/lib/base-classes/base-injector.d.ts +1 -0
- package/lib/base-classes/base-injector.js +8 -0
- package/lib/base-classes/base-injector.js.map +1 -1
- package/lib/base-classes/base-kv-repository.d.ts +27 -0
- package/lib/base-classes/base-kv-repository.js +156 -0
- package/lib/base-classes/base-kv-repository.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/endpoint-context.d.ts +4 -2
- package/lib/endpoint-context.js +95 -32
- package/lib/endpoint-context.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +1 -11
- package/lib/models.js.map +1 -1
- package/lib/orm/columns.d.ts +4 -0
- package/lib/orm/columns.js +11 -1
- package/lib/orm/columns.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib-prod/base-classes/base-angular-service.js +6 -2
- package/lib-prod/base-classes/base-angular-service.js.map +1 -1
- package/lib-prod/base-classes/base-file-upload.middleware.js +1 -1
- package/lib-prod/base-classes/base-file-upload.middleware.js.map +1 -1
- package/lib-prod/base-classes/base-injector.d.ts +1 -0
- package/lib-prod/base-classes/base-injector.js +8 -0
- package/lib-prod/base-classes/base-injector.js.map +1 -1
- package/lib-prod/base-classes/base-kv-repository.d.ts +27 -0
- package/lib-prod/base-classes/base-kv-repository.js +147 -0
- package/lib-prod/base-classes/base-kv-repository.js.map +1 -0
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/context-db-migrations.js.map +1 -1
- package/lib-prod/endpoint-context.d.ts +5 -3
- package/lib-prod/endpoint-context.js +96 -33
- package/lib-prod/endpoint-context.js.map +1 -1
- package/lib-prod/index.d.ts +1 -0
- package/lib-prod/index.js +1 -0
- package/lib-prod/index.js.map +1 -1
- package/lib-prod/models.d.ts +1 -11
- package/lib-prod/models.js.map +1 -1
- package/lib-prod/orm/columns.d.ts +4 -0
- package/lib-prod/orm/columns.js +9 -0
- package/lib-prod/orm/columns.js.map +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/ui/index.d.ts +1 -1
- package/lib-prod/ui/index.js +1 -1
- package/lib-prod/ui/taon-admin-mode-configuration/index.d.ts +1 -1
- package/lib-prod/ui/taon-admin-mode-configuration/index.js +1 -1
- package/lib-prod.split-namespaces.json +0 -2
- package/package.json +1 -1
- package/websql/fesm2022/taon-websql.mjs +290 -20
- package/websql/fesm2022/taon-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/taon-websql.d.ts +27 -13
- package/websql-prod/fesm2022/taon-websql-prod.mjs +290 -20
- package/websql-prod/fesm2022/taon-websql-prod.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
- package/websql-prod/types/taon-websql-prod.d.ts +28 -14
- package/websql-prod.split-namespaces.json +0 -2
package/websql/package.json
CHANGED
|
@@ -320,6 +320,7 @@ declare class TaonBaseInjector {
|
|
|
320
320
|
*/
|
|
321
321
|
injectRepo<T>(entityForCrud: new (...args: any[]) => T): TaonBaseRepository<T>;
|
|
322
322
|
injectCustomRepository<T extends TaonBaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
323
|
+
injectKvRepository<T extends TaonBaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
323
324
|
/**
|
|
324
325
|
* aliast to this.injectRepository()
|
|
325
326
|
*/
|
|
@@ -453,16 +454,6 @@ declare namespace Models {
|
|
|
453
454
|
static from(databasePartialConfig: Partial<Omit<DatabaseConfig, 'synchronize' | 'dropSchema' | 'databaseConfigTypeORM'>>): DatabaseConfig;
|
|
454
455
|
get databaseConfigTypeORM(): DatabaseConfigTypeOrm;
|
|
455
456
|
}
|
|
456
|
-
type ISession = {
|
|
457
|
-
secret?: string;
|
|
458
|
-
saveUninitialized?: boolean;
|
|
459
|
-
/**
|
|
460
|
-
* max age of session
|
|
461
|
-
*/
|
|
462
|
-
cookieMaxAge?: number;
|
|
463
|
-
secure?: boolean;
|
|
464
|
-
resave?: boolean;
|
|
465
|
-
};
|
|
466
457
|
type ConnectionOptionsLogs = {
|
|
467
458
|
http?: boolean;
|
|
468
459
|
realtime?: boolean;
|
|
@@ -550,7 +541,7 @@ declare namespace Models {
|
|
|
550
541
|
/**
|
|
551
542
|
* Config for express session
|
|
552
543
|
*/
|
|
553
|
-
session?:
|
|
544
|
+
session?: boolean;
|
|
554
545
|
/**
|
|
555
546
|
* taon is not going to write .rest files to cwd()
|
|
556
547
|
*/
|
|
@@ -938,7 +929,6 @@ declare class EndpointContext {
|
|
|
938
929
|
readonly onlyMigrationRun?: boolean;
|
|
939
930
|
readonly onlyMigrationRevertToTimestamp?: number;
|
|
940
931
|
get isRunOrRevertOnlyMigrationAppStart(): boolean;
|
|
941
|
-
session?: Models.ISession;
|
|
942
932
|
connection: DataSource;
|
|
943
933
|
private entitiesTriggers;
|
|
944
934
|
private _realtime;
|
|
@@ -974,6 +964,9 @@ declare class EndpointContext {
|
|
|
974
964
|
onlyMigrationRevertToTimestamp?: number;
|
|
975
965
|
}): Promise<void>;
|
|
976
966
|
private getAutoGeneratedConfig;
|
|
967
|
+
get sqlLiteDbLocation(): string;
|
|
968
|
+
get electronDbLocation(): string;
|
|
969
|
+
get kvDbJsonLocation(): string;
|
|
977
970
|
startServer(): Promise<void>;
|
|
978
971
|
displayRoutes(app: any): void;
|
|
979
972
|
get modeAllowsDatabaseCreation(): boolean;
|
|
@@ -1635,6 +1628,23 @@ declare abstract class TaonBaseCrudController<Entity, UPLOAD_FILE_QUERY_PARAMS =
|
|
|
1635
1628
|
bulkCreate(items: Entity): Models.Http.Response<Entity[]>;
|
|
1636
1629
|
}
|
|
1637
1630
|
|
|
1631
|
+
/**
|
|
1632
|
+
* Please override property entityClassFn with entity class.
|
|
1633
|
+
*/
|
|
1634
|
+
declare abstract class TaonBaseKvRepository<KV extends Record<string, any> = Record<string, any>> extends TaonBaseCustomRepository {
|
|
1635
|
+
private normalizeKey;
|
|
1636
|
+
private expirationPath;
|
|
1637
|
+
private getExpirationTimestamp;
|
|
1638
|
+
private isExpired;
|
|
1639
|
+
private cleanupIfExpired;
|
|
1640
|
+
set<K extends keyof KV>(key: K, value: KV[K]): Promise<void>;
|
|
1641
|
+
get<K extends keyof KV>(key: K): Promise<KV[K] | undefined>;
|
|
1642
|
+
delete<K extends keyof KV>(key: K): Promise<void>;
|
|
1643
|
+
has<K extends keyof KV>(key: K): Promise<boolean>;
|
|
1644
|
+
expire<K extends keyof KV>(key: K, ttlSeconds: number): Promise<void>;
|
|
1645
|
+
ttl<K extends keyof KV>(key: K): Promise<number | undefined>;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1638
1648
|
/**
|
|
1639
1649
|
* Configurable file upload middleware (multer based)
|
|
1640
1650
|
*/
|
|
@@ -1897,6 +1907,10 @@ declare const String20Column: <T = string>(defaultValue?: T) => PropertyDecorato
|
|
|
1897
1907
|
* 45 characters varchar
|
|
1898
1908
|
*/
|
|
1899
1909
|
declare const String45Column: <T = string>(defaultValue?: T) => PropertyDecorator;
|
|
1910
|
+
/**
|
|
1911
|
+
* 50 characters varchar
|
|
1912
|
+
*/
|
|
1913
|
+
declare const String50Column: <T = string>(defaultValue?: T) => PropertyDecorator;
|
|
1900
1914
|
/**
|
|
1901
1915
|
* 500 characters varchar
|
|
1902
1916
|
*/
|
|
@@ -2202,5 +2216,5 @@ declare const TAON_FLATTEN_MAPPING: {
|
|
|
2202
2216
|
};
|
|
2203
2217
|
};
|
|
2204
2218
|
|
|
2205
|
-
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeModels, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, StringColumn, Symbols, TAON_CONTEXT, TAON_FLATTEN_MAPPING, Taon, TaonAdmin, TaonAdminPanelMode, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Validators, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
|
|
2219
|
+
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeModels, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, String50Column, StringColumn, Symbols, TAON_CONTEXT, TAON_FLATTEN_MAPPING, Taon, TaonAdmin, TaonAdminPanelMode, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseKvRepository, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Validators, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
|
|
2206
2220
|
export type { AbstractEntityOmitKeys, FormlyArrayTransformFn, FormlyEntityType, FormlyInputType, MigrationStatus, MulterFileUploadResponse, TaonAdditionalMiddlewareMethodInfo, TaonAdminTab, TaonContext, TaonEntityKeysToOmit, TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
import { ___NS__merge, ___NS__cloneDeep, ___NS__camelCase, ___NS__isUndefined, ___NS__isArray, ___NS__isFunction, ___NS__isNull, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__OrignalClassKey, ___NS__isObject, ___NS__isRegExp, ___NS__isBuffer, ___NS__isArrayBuffer, ___NS__isDate, ___NS__isString, Utils__NS__uniqArray, ___NS__uniq, UtilsMigrations__NS__isValidTimestamp, Helpers__NS__throwError, UtilsMigrations__NS__getTimestampFromClassName, ___NS__times, ___NS__first, Helpers__NS__logInfo, UtilsOs__NS__isWebSQL, UtilsOs__NS__isElectron, Helpers__NS__error, UtilsOs__NS__isRunningInDocker, ___NS__isBoolean, ___NS__isNil, ___NS__set, Helpers__NS__info, Helpers__NS__warn, ___NS__slice, ___NS__last, UtilsOs__NS__isNode, UtilsOs__NS__isBrowser, ___NS__startCase, crossPlatformPath, Helpers__NS__isBlob, Helpers__NS__runSyncOrAsync, config, CoreModels__NS__SPECIAL_APP_READY_MESSAGE, UtilsOs__NS__isRunningInCliMode, Helpers__NS__log, ___NS__isNumber, ___NS__lowerFirst, UtilsTerminal__NS__waitMilliseconds, CoreModels__NS__TaonHttpErrorCustomProp } from 'tnp-core/websql-prod';
|
|
2
|
+
import { ___NS__merge, ___NS__cloneDeep, ___NS__camelCase, ___NS__isUndefined, ___NS__isArray, ___NS__isFunction, ___NS__isNull, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__OrignalClassKey, ___NS__isObject, ___NS__isRegExp, ___NS__isBuffer, ___NS__isArrayBuffer, ___NS__isDate, ___NS__isString, Utils__NS__uniqArray, ___NS__uniq, UtilsMigrations__NS__isValidTimestamp, Helpers__NS__throwError, UtilsMigrations__NS__getTimestampFromClassName, ___NS__times, ___NS__first, Helpers__NS__logInfo, UtilsOs__NS__isWebSQL, UtilsOs__NS__isElectron, Helpers__NS__error, UtilsOs__NS__isRunningInDocker, ___NS__isBoolean, ___NS__isNil, ___NS__set, Helpers__NS__info, Helpers__NS__exists, path, Helpers__NS__mkdirp, Helpers__NS__warn, Helpers__NS__writeJson, ___NS__slice, ___NS__last, UtilsOs__NS__isNode, UtilsOs__NS__isBrowser, ___NS__startCase, crossPlatformPath, Helpers__NS__isBlob, Helpers__NS__runSyncOrAsync, config, CoreModels__NS__SPECIAL_APP_READY_MESSAGE, UtilsOs__NS__isRunningInCliMode, Helpers__NS__log, ___NS__isNumber, ___NS__lowerFirst, UtilsTerminal__NS__waitMilliseconds, CoreModels__NS__TaonHttpErrorCustomProp } from 'tnp-core/websql-prod';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import { JSON10 } from 'json10/websql-prod';
|
|
5
5
|
import { walk } from 'lodash-walk-object/websql-prod';
|
|
@@ -2855,11 +2855,11 @@ class EndpointContext {
|
|
|
2855
2855
|
//#endregion
|
|
2856
2856
|
//#region resolve session
|
|
2857
2857
|
if (this.config.session) {
|
|
2858
|
-
this.session = ___NS__cloneDeep(this.config.session);
|
|
2859
|
-
const oneHour = 1000 * 60 * 60 * 1; // 24;
|
|
2860
|
-
if (!this.session.cookieMaxAge) {
|
|
2861
|
-
|
|
2862
|
-
}
|
|
2858
|
+
// this.session = ___NS__cloneDeep(this.config.session);
|
|
2859
|
+
// const oneHour = 1000 * 60 * 60 * 1; // 24;
|
|
2860
|
+
// if (!this.session.cookieMaxAge) {
|
|
2861
|
+
// this.session.cookieMaxAge = oneHour;
|
|
2862
|
+
// }
|
|
2863
2863
|
// serever and browser cookie authentication
|
|
2864
2864
|
axios.defaults.withCredentials = true;
|
|
2865
2865
|
}
|
|
@@ -3049,7 +3049,6 @@ class EndpointContext {
|
|
|
3049
3049
|
`);
|
|
3050
3050
|
//#region @websqlFunc
|
|
3051
3051
|
let databaseConfig = Models__NS__DatabaseConfig.from({});
|
|
3052
|
-
const tcpUdpDatabaseSqliteRelativeFileLocation = `${Models__NS__DatabasesFolder}/db-${this.contextName}.sqlite`;
|
|
3053
3052
|
if (this.isRunningInsideDocker) {
|
|
3054
3053
|
if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
|
|
3055
3054
|
// Helpers__NS__info('Running in docker, using in mysql database');
|
|
@@ -3078,8 +3077,11 @@ class EndpointContext {
|
|
|
3078
3077
|
/* */
|
|
3079
3078
|
/* */
|
|
3080
3079
|
/* */
|
|
3080
|
+
if (!Helpers__NS__exists(path.dirname(this.sqlLiteDbLocation))) {
|
|
3081
|
+
Helpers__NS__mkdirp(path.dirname(this.sqlLiteDbLocation));
|
|
3082
|
+
}
|
|
3081
3083
|
databaseConfig = databaseConfig = Models__NS__DatabaseConfig.from({
|
|
3082
|
-
location:
|
|
3084
|
+
location: this.sqlLiteDbLocation,
|
|
3083
3085
|
type: 'sqljs',
|
|
3084
3086
|
useLocalForage: false,
|
|
3085
3087
|
recreateMode: 'PRESERVE_DATA+MIGRATIONS',
|
|
@@ -3114,11 +3116,6 @@ class EndpointContext {
|
|
|
3114
3116
|
/* */
|
|
3115
3117
|
/* */
|
|
3116
3118
|
/* */
|
|
3117
|
-
/* */
|
|
3118
|
-
/* */
|
|
3119
|
-
/* */
|
|
3120
|
-
/* */
|
|
3121
|
-
/* */
|
|
3122
3119
|
databaseConfig = Models__NS__DatabaseConfig.from({
|
|
3123
3120
|
location: UtilsOs__NS__isElectron
|
|
3124
3121
|
? dbLocationInOs
|
|
@@ -3151,9 +3148,12 @@ class EndpointContext {
|
|
|
3151
3148
|
//#endregion
|
|
3152
3149
|
//#region resolve database config for mode backend-frontend(tcp+udp)
|
|
3153
3150
|
case 'backend-frontend(tcp+udp)':
|
|
3151
|
+
if (!Helpers__NS__exists(path.dirname(this.sqlLiteDbLocation))) {
|
|
3152
|
+
Helpers__NS__mkdirp(path.dirname(this.sqlLiteDbLocation));
|
|
3153
|
+
}
|
|
3154
3154
|
databaseConfig = Models__NS__DatabaseConfig.from({
|
|
3155
3155
|
database: `context-db-${this.contextName}`,
|
|
3156
|
-
location:
|
|
3156
|
+
location: this.sqlLiteDbLocation,
|
|
3157
3157
|
type: 'sqljs',
|
|
3158
3158
|
recreateMode: 'DROP_DB+MIGRATIONS',
|
|
3159
3159
|
logging: this.logDb,
|
|
@@ -3167,6 +3167,59 @@ class EndpointContext {
|
|
|
3167
3167
|
//#endregion
|
|
3168
3168
|
}
|
|
3169
3169
|
//#endregion
|
|
3170
|
+
get sqlLiteDbLocation() {
|
|
3171
|
+
/* */
|
|
3172
|
+
/* */
|
|
3173
|
+
/* */
|
|
3174
|
+
/* */
|
|
3175
|
+
/* */
|
|
3176
|
+
/* */
|
|
3177
|
+
/* */
|
|
3178
|
+
/* */
|
|
3179
|
+
/* */
|
|
3180
|
+
/* */
|
|
3181
|
+
/* */
|
|
3182
|
+
/* */
|
|
3183
|
+
/* */
|
|
3184
|
+
/* */
|
|
3185
|
+
/* */
|
|
3186
|
+
return (void 0);
|
|
3187
|
+
}
|
|
3188
|
+
get electronDbLocation() {
|
|
3189
|
+
/* */
|
|
3190
|
+
/* */
|
|
3191
|
+
/* */
|
|
3192
|
+
/* */
|
|
3193
|
+
/* */
|
|
3194
|
+
/* */
|
|
3195
|
+
/* */
|
|
3196
|
+
/* */
|
|
3197
|
+
/* */
|
|
3198
|
+
/* */
|
|
3199
|
+
/* */
|
|
3200
|
+
/* */
|
|
3201
|
+
/* */
|
|
3202
|
+
/* */
|
|
3203
|
+
return (void 0);
|
|
3204
|
+
}
|
|
3205
|
+
get kvDbJsonLocation() {
|
|
3206
|
+
/* */
|
|
3207
|
+
/* */
|
|
3208
|
+
/* */
|
|
3209
|
+
/* */
|
|
3210
|
+
/* */
|
|
3211
|
+
/* */
|
|
3212
|
+
/* */
|
|
3213
|
+
/* */
|
|
3214
|
+
/* */
|
|
3215
|
+
/* */
|
|
3216
|
+
/* */
|
|
3217
|
+
/* */
|
|
3218
|
+
/* */
|
|
3219
|
+
/* */
|
|
3220
|
+
/* */
|
|
3221
|
+
return (void 0);
|
|
3222
|
+
}
|
|
3170
3223
|
//#region methods & getters / start server
|
|
3171
3224
|
async startServer() {
|
|
3172
3225
|
/* */
|
|
@@ -3310,6 +3363,11 @@ class EndpointContext {
|
|
|
3310
3363
|
entityName = (entity && ClassHelpers__NS__getName(entity)) || '';
|
|
3311
3364
|
// console.log(`entityName `, entityName);
|
|
3312
3365
|
// }
|
|
3366
|
+
/* */
|
|
3367
|
+
/* */
|
|
3368
|
+
/* */
|
|
3369
|
+
/* */
|
|
3370
|
+
/* */
|
|
3313
3371
|
if (!options.contextClassInstance[this.localInstaceObjSymbol]) {
|
|
3314
3372
|
options.contextClassInstance[this.localInstaceObjSymbol] = {};
|
|
3315
3373
|
}
|
|
@@ -3738,6 +3796,10 @@ class EndpointContext {
|
|
|
3738
3796
|
if (this.isRemoteHost || !this.databaseConfig) {
|
|
3739
3797
|
return;
|
|
3740
3798
|
}
|
|
3799
|
+
if (!Helpers__NS__exists(path.dirname(this.kvDbJsonLocation))) {
|
|
3800
|
+
Helpers__NS__mkdirp(path.dirname(this.kvDbJsonLocation));
|
|
3801
|
+
Helpers__NS__writeJson(this.kvDbJsonLocation, {});
|
|
3802
|
+
}
|
|
3741
3803
|
const entities = this.getClassFunByArr(Models__NS__ClassType.ENTITY).map(entityFn => {
|
|
3742
3804
|
return ClassHelpers__NS__getOrginalClass(entityFn);
|
|
3743
3805
|
});
|
|
@@ -3754,6 +3816,13 @@ class EndpointContext {
|
|
|
3754
3816
|
autoSave = true; // on docker with sqljs I need to save db
|
|
3755
3817
|
}
|
|
3756
3818
|
}
|
|
3819
|
+
const dropSchema = this.isRunOrRevertOnlyMigrationAppStart
|
|
3820
|
+
? false
|
|
3821
|
+
: this.databaseConfig.dropSchema;
|
|
3822
|
+
this.logFramework && console.log(`DROP SCHEMA: ${dropSchema}`);
|
|
3823
|
+
if (dropSchema) {
|
|
3824
|
+
Helpers__NS__writeJson(this.kvDbJsonLocation, {});
|
|
3825
|
+
}
|
|
3757
3826
|
const dataSourceDbConfig = ___NS__isObject(this.databaseConfig)
|
|
3758
3827
|
? {
|
|
3759
3828
|
type: this.databaseConfig.type,
|
|
@@ -3770,9 +3839,7 @@ class EndpointContext {
|
|
|
3770
3839
|
? false
|
|
3771
3840
|
: this.databaseConfig.synchronize,
|
|
3772
3841
|
autoSave,
|
|
3773
|
-
dropSchema
|
|
3774
|
-
? false
|
|
3775
|
-
: this.databaseConfig.dropSchema,
|
|
3842
|
+
dropSchema,
|
|
3776
3843
|
logging: !!this.databaseConfig.logging,
|
|
3777
3844
|
location: this.databaseConfig.location,
|
|
3778
3845
|
}
|
|
@@ -4219,6 +4286,10 @@ class EndpointContext {
|
|
|
4219
4286
|
/* */
|
|
4220
4287
|
/* */
|
|
4221
4288
|
/* */
|
|
4289
|
+
/* */
|
|
4290
|
+
/* */
|
|
4291
|
+
/* */
|
|
4292
|
+
/* */
|
|
4222
4293
|
}
|
|
4223
4294
|
//#endregion
|
|
4224
4295
|
//#region methods & getters / init methods node
|
|
@@ -5587,6 +5658,15 @@ const String45Column = (defaultValue = null) => Column({
|
|
|
5587
5658
|
nullable: ___NS__isNil(defaultValue),
|
|
5588
5659
|
default: defaultValue,
|
|
5589
5660
|
});
|
|
5661
|
+
/**
|
|
5662
|
+
* 50 characters varchar
|
|
5663
|
+
*/
|
|
5664
|
+
const String50Column = (defaultValue = null) => Column({
|
|
5665
|
+
type: 'varchar',
|
|
5666
|
+
length: 50,
|
|
5667
|
+
nullable: ___NS__isNil(defaultValue),
|
|
5668
|
+
default: defaultValue,
|
|
5669
|
+
});
|
|
5590
5670
|
/**
|
|
5591
5671
|
* 500 characters varchar
|
|
5592
5672
|
*/
|
|
@@ -5822,8 +5902,12 @@ class TaonBaseAngularService {
|
|
|
5822
5902
|
? overrideCurrentContext
|
|
5823
5903
|
: this.currentContext;
|
|
5824
5904
|
//#endregion
|
|
5825
|
-
if (!currentContext) {
|
|
5826
|
-
throw new Error(
|
|
5905
|
+
if (!currentContext || !currentContext.__refSync.inited) {
|
|
5906
|
+
throw new Error(`
|
|
5907
|
+
Context not available. Make sure to .initialize()
|
|
5908
|
+
the context before injecting controllers.
|
|
5909
|
+
|
|
5910
|
+
`);
|
|
5827
5911
|
}
|
|
5828
5912
|
return currentContext ? currentContext.getClass(ctor) : void 0;
|
|
5829
5913
|
});
|
|
@@ -5901,6 +5985,14 @@ class TaonBaseInjector {
|
|
|
5901
5985
|
return repoProxy;
|
|
5902
5986
|
}
|
|
5903
5987
|
//#endregion
|
|
5988
|
+
//#region inject / custom repository
|
|
5989
|
+
injectKvRepository(cutomRepositoryClass) {
|
|
5990
|
+
const repoProxy = this.__inject(cutomRepositoryClass, {
|
|
5991
|
+
localInstance: false,
|
|
5992
|
+
});
|
|
5993
|
+
return repoProxy;
|
|
5994
|
+
}
|
|
5995
|
+
//#endregion
|
|
5904
5996
|
//#region inject / custom repo
|
|
5905
5997
|
/**
|
|
5906
5998
|
* aliast to this.injectRepository()
|
|
@@ -6041,6 +6133,8 @@ class TaonBaseInjector {
|
|
|
6041
6133
|
class TaonBaseMiddleware extends TaonBaseInjector {
|
|
6042
6134
|
}
|
|
6043
6135
|
|
|
6136
|
+
//#region imports
|
|
6137
|
+
/* */
|
|
6044
6138
|
//#endregion
|
|
6045
6139
|
/**
|
|
6046
6140
|
* Configurable file upload middleware (multer based)
|
|
@@ -7363,6 +7457,182 @@ TaonBaseCrudController = __decorate([
|
|
|
7363
7457
|
TaonController({ className: 'TaonBaseCrudController' })
|
|
7364
7458
|
], TaonBaseCrudController);
|
|
7365
7459
|
|
|
7460
|
+
/**
|
|
7461
|
+
* Please override property entityClassFn with entity class.
|
|
7462
|
+
*/
|
|
7463
|
+
let TaonBaseKvRepository = class TaonBaseKvRepository extends TaonBaseCustomRepository {
|
|
7464
|
+
//#region lowdb for development
|
|
7465
|
+
/* */
|
|
7466
|
+
/* */
|
|
7467
|
+
/* */
|
|
7468
|
+
/* */
|
|
7469
|
+
/* */
|
|
7470
|
+
/* */
|
|
7471
|
+
/* */
|
|
7472
|
+
/* */
|
|
7473
|
+
/* */
|
|
7474
|
+
/* */
|
|
7475
|
+
/* */
|
|
7476
|
+
/* */
|
|
7477
|
+
/* */
|
|
7478
|
+
/* */
|
|
7479
|
+
/* */
|
|
7480
|
+
/* */
|
|
7481
|
+
/* */
|
|
7482
|
+
/* */
|
|
7483
|
+
/* */
|
|
7484
|
+
/* */
|
|
7485
|
+
/* */
|
|
7486
|
+
/* */
|
|
7487
|
+
/* */
|
|
7488
|
+
/* */
|
|
7489
|
+
/* */
|
|
7490
|
+
/* */
|
|
7491
|
+
/* */
|
|
7492
|
+
/* */
|
|
7493
|
+
/* */
|
|
7494
|
+
/* */
|
|
7495
|
+
/* */
|
|
7496
|
+
/* */
|
|
7497
|
+
/* */
|
|
7498
|
+
/* */
|
|
7499
|
+
/* */
|
|
7500
|
+
/* */
|
|
7501
|
+
/* */
|
|
7502
|
+
/* */
|
|
7503
|
+
/* */
|
|
7504
|
+
//#endregion
|
|
7505
|
+
//#region private helpers
|
|
7506
|
+
normalizeKey(key) {
|
|
7507
|
+
return `${String(key)}`;
|
|
7508
|
+
}
|
|
7509
|
+
expirationPath(key) {
|
|
7510
|
+
return `__kvMeta.expirations.${this.normalizeKey(key)}`;
|
|
7511
|
+
}
|
|
7512
|
+
async getExpirationTimestamp(key) {
|
|
7513
|
+
/* */
|
|
7514
|
+
/* */
|
|
7515
|
+
/* */
|
|
7516
|
+
/* */
|
|
7517
|
+
return (void 0);
|
|
7518
|
+
}
|
|
7519
|
+
async isExpired(key) {
|
|
7520
|
+
/* */
|
|
7521
|
+
/* */
|
|
7522
|
+
/* */
|
|
7523
|
+
/* */
|
|
7524
|
+
/* */
|
|
7525
|
+
/* */
|
|
7526
|
+
/* */
|
|
7527
|
+
/* */
|
|
7528
|
+
return (void 0);
|
|
7529
|
+
}
|
|
7530
|
+
async cleanupIfExpired(key) {
|
|
7531
|
+
/* */
|
|
7532
|
+
/* */
|
|
7533
|
+
/* */
|
|
7534
|
+
/* */
|
|
7535
|
+
/* */
|
|
7536
|
+
/* */
|
|
7537
|
+
/* */
|
|
7538
|
+
/* */
|
|
7539
|
+
/* */
|
|
7540
|
+
/* */
|
|
7541
|
+
/* */
|
|
7542
|
+
/* */
|
|
7543
|
+
/* */
|
|
7544
|
+
return (void 0);
|
|
7545
|
+
}
|
|
7546
|
+
//#endregion
|
|
7547
|
+
async set(key, value) {
|
|
7548
|
+
/* */
|
|
7549
|
+
/* */
|
|
7550
|
+
/* */
|
|
7551
|
+
/* */
|
|
7552
|
+
/* */
|
|
7553
|
+
/* */
|
|
7554
|
+
/* */
|
|
7555
|
+
/* */
|
|
7556
|
+
return (void 0);
|
|
7557
|
+
}
|
|
7558
|
+
async get(key) {
|
|
7559
|
+
/* */
|
|
7560
|
+
/* */
|
|
7561
|
+
/* */
|
|
7562
|
+
/* */
|
|
7563
|
+
/* */
|
|
7564
|
+
/* */
|
|
7565
|
+
/* */
|
|
7566
|
+
/* */
|
|
7567
|
+
return (void 0);
|
|
7568
|
+
}
|
|
7569
|
+
async delete(key) {
|
|
7570
|
+
/* */
|
|
7571
|
+
/* */
|
|
7572
|
+
/* */
|
|
7573
|
+
/* */
|
|
7574
|
+
/* */
|
|
7575
|
+
return (void 0);
|
|
7576
|
+
}
|
|
7577
|
+
async has(key) {
|
|
7578
|
+
/* */
|
|
7579
|
+
/* */
|
|
7580
|
+
/* */
|
|
7581
|
+
/* */
|
|
7582
|
+
/* */
|
|
7583
|
+
/* */
|
|
7584
|
+
/* */
|
|
7585
|
+
/* */
|
|
7586
|
+
return (void 0);
|
|
7587
|
+
}
|
|
7588
|
+
async expire(key, ttlSeconds) {
|
|
7589
|
+
/* */
|
|
7590
|
+
/* */
|
|
7591
|
+
/* */
|
|
7592
|
+
/* */
|
|
7593
|
+
/* */
|
|
7594
|
+
/* */
|
|
7595
|
+
/* */
|
|
7596
|
+
/* */
|
|
7597
|
+
/* */
|
|
7598
|
+
/* */
|
|
7599
|
+
/* */
|
|
7600
|
+
return (void 0);
|
|
7601
|
+
}
|
|
7602
|
+
async ttl(key) {
|
|
7603
|
+
/* */
|
|
7604
|
+
/* */
|
|
7605
|
+
/* */
|
|
7606
|
+
/* */
|
|
7607
|
+
/* */
|
|
7608
|
+
/* */
|
|
7609
|
+
/* */
|
|
7610
|
+
/* */
|
|
7611
|
+
/* */
|
|
7612
|
+
/* */
|
|
7613
|
+
/* */
|
|
7614
|
+
/* */
|
|
7615
|
+
/* */
|
|
7616
|
+
/* */
|
|
7617
|
+
/* */
|
|
7618
|
+
/* */
|
|
7619
|
+
/* */
|
|
7620
|
+
/* */
|
|
7621
|
+
/* */
|
|
7622
|
+
/* */
|
|
7623
|
+
/* */
|
|
7624
|
+
/* */
|
|
7625
|
+
/* */
|
|
7626
|
+
/* */
|
|
7627
|
+
/* */
|
|
7628
|
+
/* */
|
|
7629
|
+
return (void 0);
|
|
7630
|
+
}
|
|
7631
|
+
};
|
|
7632
|
+
TaonBaseKvRepository = __decorate([
|
|
7633
|
+
TaonRepository({ className: 'TaonBaseKvRepository' })
|
|
7634
|
+
], TaonBaseKvRepository);
|
|
7635
|
+
|
|
7366
7636
|
class TaonBaseMigration extends TaonBaseInjector {
|
|
7367
7637
|
/**
|
|
7368
7638
|
* by default is READY to run
|
|
@@ -8192,5 +8462,5 @@ const TAON_FLATTEN_MAPPING = {
|
|
|
8192
8462
|
* Generated bundle index. Do not edit.
|
|
8193
8463
|
*/
|
|
8194
8464
|
|
|
8195
|
-
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers__NS__asyncHandler, ClassHelpers__NS__ensureClassConfig, ClassHelpers__NS__ensureMethodConfig, ClassHelpers__NS__getClassConfig, ClassHelpers__NS__getClassFnFromObject, ClassHelpers__NS__getControllerConfigs, ClassHelpers__NS__getFullInternalName, ClassHelpers__NS__getMethodsNames, ClassHelpers__NS__getName, ClassHelpers__NS__getOrginalClass, ClassHelpers__NS__getUniqueKey, ClassHelpers__NS__hasParentClassWithName, ClassHelpers__NS__isContextClassObject, ClassHelpers__NS__setName, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models__NS__ClassType, Models__NS__ClassTypeKey, Models__NS__DatabaseConfig, Models__NS__DatabaseConfigTypeOrm, Models__NS__DatabasesFolder, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, StringColumn, Symbols__NS__REALTIME, Symbols__NS__classMethodsNames, Symbols__NS__ctxInClassOrClassObj, Symbols__NS__fullClassNameStaticProperty, Symbols__NS__metadata, Symbols__NS__old, Symbols__NS__orignalClassClonesObj, TAON_CONTEXT, TAON_FLATTEN_MAPPING, TaonAdmin, TaonAdminPanelMode, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers__NS__defaultType, TaonHelpers__NS__fillUpTo, TaonHelpers__NS__firstStringOrElemFromArray, TaonHelpers__NS__getExpressPath, TaonHelpers__NS__ipcKeyNameRequest, TaonHelpers__NS__ipcKeyNameResponse, TaonHelpers__NS__isGoodPath, TaonHelpers__NS__isPlainFileOrFolder, TaonHelpers__NS__parseJSONwithStringJSONs, TaonHelpers__NS__tryTransformParam, TaonHelpers__NS__websqlMocks, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Taon__NS__createContext, Taon__NS__createContextTemplate, Taon__NS__error, Taon__NS__getResponseValue, Taon__NS__init, Taon__NS__inject, Taon__NS__isBrowser, Taon__NS__isElectron, Taon__NS__isNode, Taon__NS__isWebSQL, Taon__NS__removeLoader, Validators__NS__checkIfMethodsWithReponseTYpeAlowed, Validators__NS__classNameVlidation, Validators__NS__preventUndefinedModel, Validators__NS__validateClassFunctions, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
|
|
8465
|
+
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers__NS__asyncHandler, ClassHelpers__NS__ensureClassConfig, ClassHelpers__NS__ensureMethodConfig, ClassHelpers__NS__getClassConfig, ClassHelpers__NS__getClassFnFromObject, ClassHelpers__NS__getControllerConfigs, ClassHelpers__NS__getFullInternalName, ClassHelpers__NS__getMethodsNames, ClassHelpers__NS__getName, ClassHelpers__NS__getOrginalClass, ClassHelpers__NS__getUniqueKey, ClassHelpers__NS__hasParentClassWithName, ClassHelpers__NS__isContextClassObject, ClassHelpers__NS__setName, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models__NS__ClassType, Models__NS__ClassTypeKey, Models__NS__DatabaseConfig, Models__NS__DatabaseConfigTypeOrm, Models__NS__DatabasesFolder, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, String50Column, StringColumn, Symbols__NS__REALTIME, Symbols__NS__classMethodsNames, Symbols__NS__ctxInClassOrClassObj, Symbols__NS__fullClassNameStaticProperty, Symbols__NS__metadata, Symbols__NS__old, Symbols__NS__orignalClassClonesObj, TAON_CONTEXT, TAON_FLATTEN_MAPPING, TaonAdmin, TaonAdminPanelMode, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseKvRepository, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers__NS__defaultType, TaonHelpers__NS__fillUpTo, TaonHelpers__NS__firstStringOrElemFromArray, TaonHelpers__NS__getExpressPath, TaonHelpers__NS__ipcKeyNameRequest, TaonHelpers__NS__ipcKeyNameResponse, TaonHelpers__NS__isGoodPath, TaonHelpers__NS__isPlainFileOrFolder, TaonHelpers__NS__parseJSONwithStringJSONs, TaonHelpers__NS__tryTransformParam, TaonHelpers__NS__websqlMocks, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Taon__NS__createContext, Taon__NS__createContextTemplate, Taon__NS__error, Taon__NS__getResponseValue, Taon__NS__init, Taon__NS__inject, Taon__NS__isBrowser, Taon__NS__isElectron, Taon__NS__isNode, Taon__NS__isWebSQL, Taon__NS__removeLoader, Validators__NS__checkIfMethodsWithReponseTYpeAlowed, Validators__NS__classNameVlidation, Validators__NS__preventUndefinedModel, Validators__NS__validateClassFunctions, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
|
|
8196
8466
|
//# sourceMappingURL=taon-websql-prod.mjs.map
|