taon 19.0.7 → 19.0.8

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 (64) hide show
  1. package/browser/fesm2022/taon.mjs +35 -23
  2. package/browser/fesm2022/taon.mjs.map +1 -1
  3. package/browser/lib/base-classes/base-custom-repository.d.ts +4 -0
  4. package/browser/lib/base-classes/base-entity.d.ts +9 -0
  5. package/browser/lib/base-classes/base-injector.d.ts +3 -2
  6. package/browser/lib/base-classes/base-repository.d.ts +25 -9
  7. package/browser/lib/base-classes/base.d.ts +2 -0
  8. package/browser/lib/index.d.ts +1 -0
  9. package/browser/package.json +1 -1
  10. package/client/fesm2022/taon.mjs +35 -23
  11. package/client/fesm2022/taon.mjs.map +1 -1
  12. package/client/lib/base-classes/base-custom-repository.d.ts +4 -0
  13. package/client/lib/base-classes/base-entity.d.ts +9 -0
  14. package/client/lib/base-classes/base-injector.d.ts +3 -2
  15. package/client/lib/base-classes/base-repository.d.ts +25 -9
  16. package/client/lib/base-classes/base.d.ts +2 -0
  17. package/client/lib/index.d.ts +1 -0
  18. package/client/package.json +1 -1
  19. package/lib/base-classes/base-custom-repository.d.ts +3 -0
  20. package/lib/base-classes/base-custom-repository.js +19 -0
  21. package/lib/base-classes/base-custom-repository.js.map +1 -0
  22. package/lib/base-classes/base-entity.d.ts +10 -1
  23. package/lib/base-classes/base-entity.js +13 -2
  24. package/lib/base-classes/base-entity.js.map +1 -1
  25. package/lib/base-classes/base-injector.d.ts +3 -2
  26. package/lib/base-classes/base-injector.js.map +1 -1
  27. package/lib/base-classes/base-repository.d.ts +25 -9
  28. package/lib/base-classes/base-repository.js +15 -21
  29. package/lib/base-classes/base-repository.js.map +1 -1
  30. package/lib/base-classes/base.d.ts +2 -0
  31. package/lib/base-classes/base.js +2 -0
  32. package/lib/base-classes/base.js.map +1 -1
  33. package/lib/build-info._auto-generated_.d.ts +1 -1
  34. package/lib/build-info._auto-generated_.js +1 -1
  35. package/lib/index.d.ts +1 -0
  36. package/lib/index.js +3 -1
  37. package/lib/index.js.map +1 -1
  38. package/lib/realtime/realtime-strategy/realtime-abstract-mock.d.ts +10 -0
  39. package/lib/realtime/realtime-strategy/realtime-abstract-mock.js +214 -0
  40. package/lib/realtime/realtime-strategy/realtime-abstract-mock.js.map +1 -0
  41. package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.js +2 -2
  42. package/lib/ui/directives/index.js +2 -2
  43. package/lib/ui/index.js +2 -2
  44. package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +2 -2
  45. package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +2 -2
  46. package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +2 -2
  47. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  48. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  49. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  50. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  51. package/lib/ui/taon-progress-bar/index.js +2 -2
  52. package/lib/ui/taon-session-passcode/index.js +2 -2
  53. package/lib/ui/taon-table/index.js +2 -2
  54. package/package.json +1 -1
  55. package/tmp-environment.json +3 -3
  56. package/websql/fesm2022/taon.mjs +35 -21
  57. package/websql/fesm2022/taon.mjs.map +1 -1
  58. package/websql/lib/base-classes/base-custom-repository.d.ts +4 -0
  59. package/websql/lib/base-classes/base-entity.d.ts +9 -0
  60. package/websql/lib/base-classes/base-injector.d.ts +3 -2
  61. package/websql/lib/base-classes/base-repository.d.ts +25 -9
  62. package/websql/lib/base-classes/base.d.ts +2 -0
  63. package/websql/lib/index.d.ts +1 -0
  64. package/websql/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ import { BaseInjector } from './base-injector';
3
+ export declare abstract class BaseCustomRepository extends BaseInjector {
4
+ }
@@ -1,8 +1,17 @@
1
1
  // @ts-nocheck
2
+ import { RelationPath } from 'taon-typeorm/browser';
2
3
  import { BaseClass } from './base-class';
3
4
  export declare abstract class BaseEntity<
4
5
  /**
5
6
  * type for cloning
6
7
  */
7
8
  CloneT extends BaseClass = any> extends BaseClass<CloneT> {
9
+ /**
10
+ * simple check if relation is ok
11
+ */
12
+ relation(relationName: RelationPath<CloneT>): string;
13
+ /**
14
+ * simple check if relation is ok
15
+ */
16
+ relations(relationNames: RelationPath<CloneT>[]): string[];
8
17
  }
@@ -1,6 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import { EndpointContext } from '../endpoint-context';
3
3
  import { BaseClass } from './base-class';
4
+ import { BaseCustomRepository } from './base-custom-repository';
4
5
  import type { BaseRepository } from './base-repository';
5
6
  export declare class BaseInjector<CloneT extends BaseClass = any> {
6
7
  /**
@@ -29,11 +30,11 @@ export declare class BaseInjector<CloneT extends BaseClass = any> {
29
30
  * inject crud repo for entity
30
31
  */
31
32
  injectRepo<T>(entityForCrud: new (...args: any[]) => T): BaseRepository<T>;
32
- injectCustomRepository<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
33
+ injectCustomRepository<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
33
34
  /**
34
35
  * aliast to this.injectRepository()
35
36
  */
36
- injectCustomRepo<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
37
+ injectCustomRepo<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
37
38
  /**
38
39
  * example usage:
39
40
  * ...
@@ -1,13 +1,13 @@
1
1
  // @ts-nocheck
2
- import type { FindManyOptions, FindOneOptions, FindOptionsWhere, InsertResult, Repository, SaveOptions, UpdateResult } from 'taon-typeorm/browser';
3
- import type { QueryDeepPartialEntity } from 'taon-typeorm/lib/typeorm/query-builder/QueryPartialEntity';
4
- import type { UpsertOptions } from 'taon-typeorm/lib/typeorm/repository/UpsertOptions';
5
- import type { DataSource as DataSourceType } from 'taon-typeorm/browser';
2
+ import { type DeepPartial, type FindManyOptions, type FindOneOptions, type FindOptionsWhere, type InsertResult, type Repository, type SaveOptions, type UpdateResult } from 'taon-typeorm/browser';
3
+ import type { QueryDeepPartialEntity } from 'taon-typeorm/browser';
4
+ import type { UpsertOptions } from 'taon-typeorm/browser';
5
+ import type { DataSource as DataSourceType, QueryRunner, SelectQueryBuilder } from 'taon-typeorm/browser';
6
6
  import { MySqlQuerySource } from 'taon-type-sql/browser';
7
- import { BaseInjector } from './base-injector';
7
+ import { BaseCustomRepository } from './base-custom-repository';
8
8
  export declare abstract class BaseRepository<Entity extends {
9
9
  id?: any;
10
- }> extends BaseInjector {
10
+ }> extends BaseCustomRepository {
11
11
  abstract entityClassResolveFn: () => any;
12
12
  constructor(__entityClassResolveFn: () => any);
13
13
  private __dbQuery;
@@ -44,9 +44,20 @@ export declare abstract class BaseRepository<Entity extends {
44
44
  * -> it will actuall create new entity in db
45
45
  * in oposite to typeorm create method
46
46
  */
47
- create(item: Entity, options?: SaveOptions & {
48
- reload: false;
49
- }): Promise<Entity>;
47
+ /**
48
+ * Creates a new entity instance.
49
+ */
50
+ create(): Entity;
51
+ /**
52
+ * Creates new entities and copies all entity properties from given objects into their new entities.
53
+ * Note that it copies only properties that are present in entity schema.
54
+ */
55
+ create(entityLikeArray: DeepPartial<Entity>[]): Entity[];
56
+ /**
57
+ * Creates a new entity instance and copies all entity properties from this object into a new entity.
58
+ * Note that it copies only properties that are present in entity schema.
59
+ */
60
+ create(entityLike: DeepPartial<Entity>): Entity;
50
61
  bulkSave(items: Entity[], options?: SaveOptions & {
51
62
  reload: false;
52
63
  }): Promise<Entity[]>;
@@ -225,6 +236,11 @@ export declare abstract class BaseRepository<Entity extends {
225
236
  * Raw query execution is supported only by relational databases (MongoDB is not supported).
226
237
  */
227
238
  query(query: string, parameters?: any[]): Promise<any>;
239
+ /**
240
+ * Executes a raw SQL query and returns a raw database results.
241
+ * Raw query execution is supported only by relational databases (MongoDB is not supported).
242
+ */
243
+ createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<Entity>;
228
244
  /**
229
245
  * Clears all the data from the given table/collection (truncates/drops it).
230
246
  *
@@ -4,6 +4,7 @@ import * as baseService from './base-angular-service';
4
4
  import * as baseClass from './base-class';
5
5
  import * as controller from './base-controller';
6
6
  import * as crudController from './base-crud-controller';
7
+ import * as customRepository from './base-custom-repository';
7
8
  import * as entity from './base-entity';
8
9
  import * as baseMigration from './base-migration';
9
10
  import * as provider from './base-provider';
@@ -18,6 +19,7 @@ export declare namespace Base {
18
19
  export import Provider = provider.BaseProvider;
19
20
  export import Class = baseClass.BaseClass;
20
21
  export import Repository = repository.BaseRepository;
22
+ export import CustomRepository = customRepository.BaseCustomRepository;
21
23
  export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
22
24
  export import Migration = baseMigration.BaseMigration;
23
25
  export import AngularService = baseService.BaseAngularsService;
@@ -16,6 +16,7 @@ import * as allSymbols from './symbols';
16
16
  export * from './ui';
17
17
  export { EndpointContext } from './endpoint-context';
18
18
  export { BaseRepository } from './base-classes/base-repository';
19
+ export { BaseCustomRepository } from './base-classes/base-custom-repository';
19
20
  export { BaseController } from './base-classes/base-controller';
20
21
  export { BaseProvider } from './base-classes/base-provider';
21
22
  export { BaseEntity } from './base-classes/base-entity';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taon/browser",
3
- "version": "19.0.7",
3
+ "version": "19.0.8",
4
4
  "module": "fesm2022/taon.mjs",
5
5
  "typings": "index.d.ts",
6
6
  "exports": {
@@ -761,14 +761,24 @@ class BaseClass {
761
761
  }
762
762
  }
763
763
 
764
- /* */
765
- /* */
766
764
  let EntityDecorator$1 = () => {
767
765
  return (target) => { };
768
766
  };
769
767
  /* */
770
768
  /* */
771
769
  let BaseEntity = class BaseEntity extends BaseClass {
770
+ /**
771
+ * simple check if relation is ok
772
+ */
773
+ relation(relationName) {
774
+ return relationName;
775
+ }
776
+ /**
777
+ * simple check if relation is ok
778
+ */
779
+ relations(relationNames) {
780
+ return relationNames;
781
+ }
772
782
  };
773
783
  BaseEntity = __decorate([
774
784
  EntityDecorator$1()
@@ -4985,10 +4995,17 @@ class BaseInjector {
4985
4995
  }
4986
4996
  }
4987
4997
 
4998
+ //#endregion
4999
+ let BaseCustomRepository = class BaseCustomRepository extends BaseInjector {
5000
+ };
5001
+ BaseCustomRepository = __decorate([
5002
+ TaonRepository({ className: 'BaseCustomRepository' })
5003
+ ], BaseCustomRepository);
5004
+
4988
5005
  //#endregion
4989
5006
  const INDEX_KEYS_NO_FOR_UPDATE = ['id'];
4990
5007
  const REPOS_CACHE = Symbol('repository cache inside instance');
4991
- let BaseRepository = class BaseRepository extends BaseInjector {
5008
+ let BaseRepository = class BaseRepository extends BaseCustomRepository {
4992
5009
  constructor(
4993
5010
  // Injected through BaseCrudController
4994
5011
  __entityClassResolveFn) {
@@ -5103,12 +5120,11 @@ let BaseRepository = class BaseRepository extends BaseInjector {
5103
5120
  return (void 0);
5104
5121
  }
5105
5122
  /**
5106
- * alias to save
5107
- * -> it will actuall create new entity in db
5108
- * in oposite to typeorm create method
5123
+ * Creates a new entity instance or instances.
5124
+ * Can copy properties from the given object into new entities.
5109
5125
  */
5110
- async create(item, options) {
5111
- return this.save(item, options);
5126
+ create(plainEntityLikeOrPlainEntityLikes) {
5127
+ return this.repo.create(plainEntityLikeOrPlainEntityLikes);
5112
5128
  }
5113
5129
  async bulkSave(items, options) {
5114
5130
  /* */
@@ -5126,20 +5142,6 @@ let BaseRepository = class BaseRepository extends BaseInjector {
5126
5142
  return this.bulkSave(items, options);
5127
5143
  }
5128
5144
  //#region old typeorm version
5129
- // /**
5130
- // * Creates a new entity instance.
5131
- // */
5132
- // create(): Entity;
5133
- // /**
5134
- // * Creates new entities and copies all entity properties from given objects into their new entities.
5135
- // * Note that it copies only properties that are present in entity schema.
5136
- // */
5137
- // create(entityLikeArray: Entity[]): Entity[];
5138
- // /**
5139
- // * Creates a new entity instance and copies all entity properties from this object into a new entity.
5140
- // * Note that it copies only properties that are present in entity schema.
5141
- // */
5142
- // create(entityLike: Entity): Entity;
5143
5145
  /**
5144
5146
  * Saves all given entities in the database.
5145
5147
  * If entities do not exist in the database then inserts, otherwise updates.
@@ -5539,6 +5541,15 @@ let BaseRepository = class BaseRepository extends BaseInjector {
5539
5541
  return this.repo.query(query, parameters);
5540
5542
  }
5541
5543
  //#endregion
5544
+ //#region crud operations / typeorm / query
5545
+ /**
5546
+ * Executes a raw SQL query and returns a raw database results.
5547
+ * Raw query execution is supported only by relational databases (MongoDB is not supported).
5548
+ */
5549
+ createQueryBuilder(alias, queryRunner) {
5550
+ return this.repo.createQueryBuilder(alias, queryRunner);
5551
+ }
5552
+ //#endregion
5542
5553
  //#region crud operations / typeorm / clear
5543
5554
  /**
5544
5555
  * Clears all the data from the given table/collection (truncates/drops it).
@@ -6229,6 +6240,7 @@ var Base;
6229
6240
  Base.Provider = BaseProvider;
6230
6241
  Base.Class = BaseClass;
6231
6242
  Base.Repository = BaseRepository;
6243
+ Base.CustomRepository = BaseCustomRepository;
6232
6244
  Base.SubscriberForEntity = BaseSubscriberForEntity;
6233
6245
  Base.Migration = BaseMigration;
6234
6246
  Base.AngularService = BaseAngularsService;
@@ -7569,5 +7581,5 @@ var Taon;
7569
7581
  * Generated bundle index. Do not edit.
7570
7582
  */
7571
7583
 
7572
- export { BaseContext, BaseController, BaseEntity, BaseMigration, BaseProvider, BaseRepository, ClassHelpers, EndpointContext, Models, SafePipe, Taon, TaonAdminModeConfigurationComponent, TaonFullMaterialModule, TaonGithubForkMeCornerComponent, TaonGithubForkMeCornerModule, TaonInjectHTMLDirective, TaonLongPress, TaonNotificationOptions, TaonNotificationsComponent, TaonNotificationsModule, TaonNotificationsService, TaonProgressBarComponent, TaonProgressBarModule, TaonSessionPasscodeComponent, TaonTableComponent, TaonTableModule, createContext, inject };
7584
+ export { BaseContext, BaseController, BaseCustomRepository, BaseEntity, BaseMigration, BaseProvider, BaseRepository, ClassHelpers, EndpointContext, Models, SafePipe, Taon, TaonAdminModeConfigurationComponent, TaonFullMaterialModule, TaonGithubForkMeCornerComponent, TaonGithubForkMeCornerModule, TaonInjectHTMLDirective, TaonLongPress, TaonNotificationOptions, TaonNotificationsComponent, TaonNotificationsModule, TaonNotificationsService, TaonProgressBarComponent, TaonProgressBarModule, TaonSessionPasscodeComponent, TaonTableComponent, TaonTableModule, createContext, inject };
7573
7585
  //# sourceMappingURL=taon.mjs.map