taon 19.0.49 → 19.0.51

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.
Files changed (119) hide show
  1. package/README.md +160 -160
  2. package/bin/start.js +279 -279
  3. package/bin/taon +6 -6
  4. package/bin/taon-debug +5 -5
  5. package/bin/taon-debug-brk +5 -5
  6. package/browser/README.md +24 -24
  7. package/browser/fesm2022/taon.mjs +60 -9
  8. package/browser/fesm2022/taon.mjs.map +1 -1
  9. package/browser/lib/endpoint-context.d.ts +6 -0
  10. package/browser/lib/models.d.ts +19 -0
  11. package/browser/package.json +1 -1
  12. package/env.d.ts +3 -0
  13. package/environments/angular-node-app/env.angular-node-app.__.d.ts +3 -0
  14. package/environments/angular-node-app/env.angular-node-app.dev.d.ts +3 -0
  15. package/environments/angular-node-app/env.angular-node-app.localhost.d.ts +3 -0
  16. package/environments/angular-node-app/env.angular-node-app.prod.d.ts +3 -0
  17. package/environments/angular-node-app/env.angular-node-app.stage.d.ts +3 -0
  18. package/environments/docs-webapp/env.docs-webapp.__.d.ts +3 -0
  19. package/environments/electron-app/env.electron-app.__.d.ts +3 -0
  20. package/environments/electron-app/env.electron-app.prod.d.ts +3 -0
  21. package/environments/mobile-app/env.mobile-app.__.d.ts +3 -0
  22. package/environments/mobile-app/env.mobile-app.prod.d.ts +3 -0
  23. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.__.d.ts +3 -0
  24. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.prod.d.ts +3 -0
  25. package/environments/vscode-plugin/env.vscode-plugin.__.d.ts +6 -0
  26. package/environments/vscode-plugin/env.vscode-plugin.prod.d.ts +4 -0
  27. package/lib/build-info._auto-generated_.d.ts +16 -1
  28. package/lib/build-info._auto-generated_.js +16 -1
  29. package/lib/build-info._auto-generated_.js.map +1 -1
  30. package/lib/create-context.js +15 -0
  31. package/lib/create-context.js.map +1 -1
  32. package/lib/endpoint-context.d.ts +6 -0
  33. package/lib/endpoint-context.js +37 -7
  34. package/lib/endpoint-context.js.map +1 -1
  35. package/lib/env/env.angular-node-app.d.ts +1 -0
  36. package/lib/env/env.angular-node-app.js +3 -2
  37. package/lib/env/env.angular-node-app.js.map +1 -1
  38. package/lib/env/env.docs-webapp.d.ts +1 -0
  39. package/lib/env/env.docs-webapp.js +3 -2
  40. package/lib/env/env.docs-webapp.js.map +1 -1
  41. package/lib/env/env.electron-app.d.ts +1 -0
  42. package/lib/env/env.electron-app.js +3 -2
  43. package/lib/env/env.electron-app.js.map +1 -1
  44. package/lib/env/env.mobile-app.d.ts +1 -0
  45. package/lib/env/env.mobile-app.js +3 -2
  46. package/lib/env/env.mobile-app.js.map +1 -1
  47. package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -0
  48. package/lib/env/env.npm-lib-and-cli-tool.js +3 -2
  49. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  50. package/lib/env/env.vscode-plugin.d.ts +1 -0
  51. package/lib/env/env.vscode-plugin.js +3 -2
  52. package/lib/env/env.vscode-plugin.js.map +1 -1
  53. package/lib/models.d.ts +19 -0
  54. package/lib/models.js +3 -0
  55. package/lib/models.js.map +1 -1
  56. package/lib/realtime/realtime-client.js +9 -0
  57. package/lib/realtime/realtime-client.js.map +1 -1
  58. package/lib/realtime/realtime-server.js +1 -4
  59. package/lib/realtime/realtime-server.js.map +1 -1
  60. package/lib/ui/directives/index.d.ts +3 -0
  61. package/lib/ui/directives/index.js +5 -0
  62. package/lib/ui/directives/index.js.map +1 -0
  63. package/lib/ui/directives/safe.pipe.d.ts +7 -0
  64. package/lib/ui/directives/taon-inject-html.directive.d.ts +6 -0
  65. package/lib/ui/directives/taon-long-press.directive.d.ts +22 -0
  66. package/lib/ui/directives/view-mode.d.ts +5 -0
  67. package/lib/ui/directives/view-mode.js +10 -0
  68. package/lib/ui/directives/view-mode.js.map +1 -0
  69. package/lib/ui/index.js +2 -2
  70. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  71. package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +43 -0
  72. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.d.ts +5 -0
  73. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js +3 -0
  74. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -0
  75. package/lib/ui/taon-full-material.module.d.ts +5 -0
  76. package/lib/ui/taon-github-fork-me-corner/index.d.ts +2 -0
  77. package/lib/ui/taon-github-fork-me-corner/index.js +5 -0
  78. package/lib/ui/taon-github-fork-me-corner/index.js.map +1 -0
  79. package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.component.d.ts +3 -0
  80. package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.module.d.ts +2 -0
  81. package/lib/ui/taon-github-fork-me-ribbon/index.d.ts +2 -0
  82. package/lib/ui/taon-github-fork-me-ribbon/index.js +5 -0
  83. package/lib/ui/taon-github-fork-me-ribbon/index.js.map +1 -0
  84. package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.component.d.ts +3 -0
  85. package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.module.d.ts +2 -0
  86. package/lib/ui/taon-notifications/index.d.ts +4 -0
  87. package/lib/ui/taon-notifications/index.js +24 -0
  88. package/lib/ui/taon-notifications/index.js.map +1 -0
  89. package/lib/ui/taon-notifications/taon-notifications.component.d.ts +9 -0
  90. package/lib/ui/taon-notifications/taon-notifications.models.d.ts +6 -0
  91. package/lib/ui/taon-notifications/taon-notifications.models.js +5 -0
  92. package/lib/ui/taon-notifications/taon-notifications.models.js.map +1 -0
  93. package/lib/ui/taon-notifications/taon-notifications.module.d.ts +2 -0
  94. package/lib/ui/taon-notifications/taon-notifications.service.d.ts +11 -0
  95. package/lib/ui/taon-progress-bar/index.d.ts +2 -0
  96. package/lib/ui/taon-progress-bar/index.js +5 -0
  97. package/lib/ui/taon-progress-bar/index.js.map +1 -0
  98. package/lib/ui/taon-progress-bar/taon-progress-bar.component.d.ts +13 -0
  99. package/lib/ui/taon-progress-bar/taon-progress-bar.module.d.ts +2 -0
  100. package/lib/ui/taon-session-passcode/index.d.ts +1 -0
  101. package/lib/ui/taon-session-passcode/index.js +5 -0
  102. package/lib/ui/taon-session-passcode/index.js.map +1 -0
  103. package/lib/ui/taon-session-passcode/taon-session-passcode.component.d.ts +35 -0
  104. package/lib/ui/taon-table/index.d.ts +2 -0
  105. package/lib/ui/taon-table/index.js +5 -0
  106. package/lib/ui/taon-table/index.js.map +1 -0
  107. package/lib/ui/taon-table/taon-table.component.d.ts +34 -0
  108. package/lib/ui/taon-table/taon-table.module.d.ts +2 -0
  109. package/lib/ui/taon.models.d.ts +11 -0
  110. package/lib/ui/taon.models.js +3 -0
  111. package/lib/ui/taon.models.js.map +1 -0
  112. package/package.json +1 -1
  113. package/tmp-environment.json +32 -0
  114. package/websql/README.md +24 -24
  115. package/websql/fesm2022/taon.mjs +63 -9
  116. package/websql/fesm2022/taon.mjs.map +1 -1
  117. package/websql/lib/endpoint-context.d.ts +6 -0
  118. package/websql/lib/models.d.ts +19 -0
  119. package/websql/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ import { OnInit, TemplateRef, EventEmitter, ElementRef, OnDestroy } from '@angular/core';
2
+ import { PageEvent } from '@angular/material/paginator';
3
+ import { MtxGridColumn } from '@ng-matero/extensions/grid';
4
+ import { Taon } from 'taon';
5
+ export declare class TaonTableComponent implements OnDestroy, OnInit {
6
+ pageNumber: number;
7
+ pageSize: number;
8
+ allowedColumns: string[];
9
+ expansionTemplate: TemplateRef<any>;
10
+ rows: {
11
+ id: number;
12
+ name: string;
13
+ }[];
14
+ entityCrudController: Taon.Base.CrudController<any>;
15
+ columns: MtxGridColumn[];
16
+ pageSizeOptions: number[];
17
+ hideSearch: boolean;
18
+ expansionChange: EventEmitter<any>;
19
+ addingItem: EventEmitter<void>;
20
+ search?: ElementRef<HTMLElement>;
21
+ private searchInputChange$;
22
+ expandable: boolean;
23
+ showPaginator: boolean;
24
+ isLoading: boolean;
25
+ totalElements: number;
26
+ private sub;
27
+ get entity(): typeof Taon.Base.Entity;
28
+ ngOnInit(): Promise<void>;
29
+ ngOnDestroy(): void;
30
+ getNextPage(e: PageEvent): Promise<void>;
31
+ getData(): Promise<void>;
32
+ expansionRow(e: any): void;
33
+ onTableContextMenu(e: any): void;
34
+ }
@@ -0,0 +1,2 @@
1
+ export declare class TaonTableModule {
2
+ }
@@ -0,0 +1,11 @@
1
+ import { CoreModels } from 'tnp-core';
2
+ export type TaonDisplayMode = 'view' | 'edit';
3
+ export interface TaonUploadedFile {
4
+ data: Buffer;
5
+ encoding: string;
6
+ md5: string;
7
+ mimetype: CoreModels.ContentType;
8
+ mv: (path: any, callback: any) => any;
9
+ name: string;
10
+ truncated: boolean;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=taon.models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taon.models.js","sourceRoot":"","sources":[""],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taon",
3
- "version": "19.0.49",
3
+ "version": "19.0.51",
4
4
  "scripts": {
5
5
  "mkdocs": "python3 -m mkdocs",
6
6
  "taon init": "taon init",
@@ -0,0 +1,32 @@
1
+ {
2
+ "website": {
3
+ "domain": "taon.example.domain.com",
4
+ "title": "Taon"
5
+ },
6
+ "paths": {},
7
+ "config": {},
8
+ "container": {},
9
+ "ports": {},
10
+ "init": {},
11
+ "build": {
12
+ "pwa": {},
13
+ "watch": true
14
+ },
15
+ "loading": {
16
+ "preAngularBootstrap": {},
17
+ "afterAngularBootstrap": {}
18
+ },
19
+ "release": {
20
+ "cli": {},
21
+ "lib": {},
22
+ "targetArtifact": "npm-lib-and-cli-tool"
23
+ },
24
+ "copyToManager": {},
25
+ "buildInfo": {
26
+ "date": "2025-05-28T02:20:56.000Z",
27
+ "hash": "e29fdc7c3ee397f16f6e07b39910dd306b6b1330"
28
+ },
29
+ "currentProjectName": "taon",
30
+ "currentProjectType": "isomorphic-lib",
31
+ "pathsTsconfig": "\"paths\": {\"@lib\":[\"./src/lib\"],\"@lib/*\":[\"./src/lib/*\"],\"taon/src\":[\"./src/lib\"],\"taon/src/*\":[\"./src/lib/*\"]},"
32
+ }
package/websql/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # MyLib
2
-
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
-
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
- > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ # MyLib
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
+ > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -1519,6 +1519,15 @@ class RealtimeClient {
1519
1519
  realtime: this.core.pathFor(Symbols.REALTIME.NAMESPACE(this.core.ctx.contextName)),
1520
1520
  };
1521
1521
  // console.log('[browser] nspPath', nspPath);
1522
+ if (this.core.ctx.config.frontendHost &&
1523
+ this.core.ctx.config.frontendHost !== '') {
1524
+ console.log(`[${this.core.ctx.contextName}] USING FRONTEND HOST ${this.core.ctx.config.frontendHost}`);
1525
+ nspPath.global = new URL(`${this.core.ctx.frontendHostUri.origin}${nspPath.global.pathname}`);
1526
+ nspPath.realtime = new URL(`${this.core.ctx.frontendHostUri.origin}${nspPath.realtime.pathname}`);
1527
+ }
1528
+ else {
1529
+ console.log(`[${this.core.ctx.contextName}] NOT USING FRONTEND HOST`);
1530
+ }
1522
1531
  this.core.ctx.logRealtime &&
1523
1532
  console.info('[CLIENT] NAMESPACE GLOBAL ', nspPath.global.href + ` host: ${this.core.ctx.host}`);
1524
1533
  this.core.ctx.logRealtime &&
@@ -1699,9 +1708,8 @@ class RealtimeServer {
1699
1708
  const nspPathRealtime = this.core.pathFor(Symbols.REALTIME.NAMESPACE(this.core.ctx.contextName));
1700
1709
  //#endregion
1701
1710
  // console.log('[backend] nspPath', nspPath);
1702
- const fronendURL = new URL(this.core.ctx.config.frontendHost.replace(/\/$/, ''));
1703
1711
  const cors = {
1704
- origin: fronendURL.origin, // only origin needs to be set - pathname not needed
1712
+ origin: this.core.ctx.frontendHostUri.origin, // only origin needs to be set - pathname not needed
1705
1713
  methods: this.core.allHttpMethods,
1706
1714
  };
1707
1715
  // console.log('frontendHost', this.core.ctx.config.frontendHost);
@@ -2645,9 +2653,6 @@ class EndpointContext {
2645
2653
  }
2646
2654
  return this.config?.logs === true;
2647
2655
  }
2648
- //#endregion
2649
- //#endregion
2650
- //#region constructor
2651
2656
  constructor(originalConfig, configFn) {
2652
2657
  this.originalConfig = originalConfig;
2653
2658
  this.configFn = configFn;
@@ -2722,6 +2727,13 @@ class EndpointContext {
2722
2727
  //#region fields / entities triggers
2723
2728
  this.entitiesTriggers = {};
2724
2729
  //#endregion
2730
+ //#endregion
2731
+ //#region constructor
2732
+ /**
2733
+ * Inside docker there is not need for https secure server
2734
+ */
2735
+ this.isRunningInsideDocker = false;
2736
+ //#endregion
2725
2737
  //#region methods & getters / clone class
2726
2738
  this.cloneClassWithNewMetadata = ({ BaseClass, className, config, ctx, classType, }) => {
2727
2739
  // Return a new class that extends the base class
@@ -2817,6 +2829,7 @@ class EndpointContext {
2817
2829
  }
2818
2830
  return classes;
2819
2831
  };
2832
+ this.isRunningInsideDocker = UtilsOs.isRunningInDocker();
2820
2833
  }
2821
2834
  //#endregion
2822
2835
  //#region methods & getters / init
@@ -3039,6 +3052,14 @@ class EndpointContext {
3039
3052
  /* */
3040
3053
  /* */
3041
3054
  /* */
3055
+ /* */
3056
+ /* */
3057
+ /* */
3058
+ /* */
3059
+ /* */
3060
+ /* */
3061
+ /* */
3062
+ /* */
3042
3063
  }
3043
3064
  //#endregion
3044
3065
  //#region prepare realtime
@@ -3082,12 +3103,12 @@ class EndpointContext {
3082
3103
  console.log(`
3083
3104
 
3084
3105
 
3085
- IS RUNNING IN DOCKER: ${UtilsOs.isRunningInDocker()}
3106
+ IS RUNNING IN DOCKER: ${this.isRunningInsideDocker}
3086
3107
 
3087
3108
  `);
3088
3109
  //#region @websqlFunc
3089
3110
  let databaseConfig = Models.DatabaseConfig.from({});
3090
- if (UtilsOs.isRunningInDocker()) {
3111
+ if (this.isRunningInsideDocker) {
3091
3112
  if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
3092
3113
  // Helpers.info('Running in docker, using in mysql database');
3093
3114
  // // TODO auto resolve database config in docker
@@ -3556,6 +3577,13 @@ class EndpointContext {
3556
3577
  }
3557
3578
  //#endregion
3558
3579
  //#region methods & getters / uri
3580
+ get frontendHostUri() {
3581
+ const url = this.config?.frontendHost?.startsWith('http')
3582
+ ? this.config.frontendHost
3583
+ : `${globalThis?.location?.protocol || 'http:'}//${this.config?.frontendHost}`;
3584
+ const uri = new URL(url.replace(/\/$/, ''));
3585
+ return uri;
3586
+ }
3559
3587
  get uri() {
3560
3588
  const url = this.host
3561
3589
  ? new URL(this.host)
@@ -3566,6 +3594,9 @@ class EndpointContext {
3566
3594
  }
3567
3595
  //#endregion
3568
3596
  get uriPort() {
3597
+ if (!this.uri?.origin?.includes('localhost')) {
3598
+ return this.config?.hostPortNumber?.toString();
3599
+ }
3569
3600
  return this.uri?.port;
3570
3601
  }
3571
3602
  get uriProtocol() {
@@ -3622,6 +3653,9 @@ class EndpointContext {
3622
3653
  return this.config.contextName;
3623
3654
  }
3624
3655
  //#endregion
3656
+ get activeContext() {
3657
+ return this.config.activeContext || null;
3658
+ }
3625
3659
  get appId() {
3626
3660
  return this.config.appId;
3627
3661
  }
@@ -3728,7 +3762,7 @@ class EndpointContext {
3728
3762
  }
3729
3763
  else {
3730
3764
  if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
3731
- autoSave = !UtilsOs.isRunningInDocker(); // in docker I am using mysql or posgress
3765
+ autoSave = !this.isRunningInsideDocker; // in docker I am using mysql or posgress
3732
3766
  }
3733
3767
  else {
3734
3768
  autoSave = true; // on docker with sqljs I need to save db
@@ -3866,8 +3900,13 @@ class EndpointContext {
3866
3900
  const methodConfig = classConfig.methods[methodName];
3867
3901
  // debugger
3868
3902
  const type = methodConfig.type;
3903
+ // this is quick fix - in docker global path should not be used
3904
+ const globalPathPart = this.isRunningInsideDocker ||
3905
+ !this.frontendHostUri?.origin?.includes('localhost') // fe with domain -> is in docker
3906
+ ? `${this.uriPathnameOrNothingIfRoot.replace(/\/$/, '')}/${apiPrefix}/${this.contextName}`.replace(/\/\//, '/')
3907
+ : '';
3869
3908
  const expressPath = methodConfig.global
3870
- ? `/${methodConfig.path?.replace(/\//, '')}`
3909
+ ? `${globalPathPart}/${methodConfig.path?.replace(/\/$/, '')}`.replace(/\/\//, '/')
3871
3910
  : TaonHelpers.getExpressPath(classConfig, methodConfig);
3872
3911
  // console.log({ expressPath });
3873
3912
  if (Helpers.isNode || Helpers.isWebSQL) {
@@ -4684,6 +4723,11 @@ const createContextTemplate = (configFn) => {
4684
4723
  */
4685
4724
  const createContext = (configFn) => {
4686
4725
  let config = configFn({});
4726
+ // console.log(
4727
+ // `
4728
+ // [Taon] Creating context ${config.contextName}...`,
4729
+ // {config},
4730
+ // );
4687
4731
  const endpointContextRef = new EndpointContext(config, configFn);
4688
4732
  const res = {
4689
4733
  //#region types
@@ -4784,6 +4828,16 @@ const createContext = (configFn) => {
4784
4828
  return await new Promise(async (resolve, reject) => {
4785
4829
  //#region init in set timeout
4786
4830
  setTimeout(async () => {
4831
+ if (UtilsOs.isRunningInDocker()) {
4832
+ const activeContext = config?.activeContext || null;
4833
+ if (_.isString(activeContext) &&
4834
+ activeContext !== '' &&
4835
+ activeContext !== config?.contextName) {
4836
+ console.warn(`[taon] Context ${endpointContextRef.contextName} is not active context, skipping initialization.`);
4837
+ resolve(endpointContextRef);
4838
+ return;
4839
+ }
4840
+ }
4787
4841
  await endpointContextRef.init({
4788
4842
  ...overrideOptions,
4789
4843
  });