taon 19.0.7 → 19.0.9

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 (57) hide show
  1. package/browser/fesm2022/taon.mjs +88 -76
  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 +88 -76
  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/ui/directives/index.js +2 -2
  39. package/lib/ui/index.js +2 -2
  40. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  41. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  42. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  43. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  44. package/lib/ui/taon-progress-bar/index.js +2 -2
  45. package/lib/ui/taon-session-passcode/index.js +2 -2
  46. package/lib/ui/taon-table/index.js +2 -2
  47. package/package.json +1 -1
  48. package/tmp-environment.json +3 -3
  49. package/websql/fesm2022/taon.mjs +88 -74
  50. package/websql/fesm2022/taon.mjs.map +1 -1
  51. package/websql/lib/base-classes/base-custom-repository.d.ts +4 -0
  52. package/websql/lib/base-classes/base-entity.d.ts +9 -0
  53. package/websql/lib/base-classes/base-injector.d.ts +3 -2
  54. package/websql/lib/base-classes/base-repository.d.ts +25 -9
  55. package/websql/lib/base-classes/base.d.ts +2 -0
  56. package/websql/lib/index.d.ts +1 -0
  57. 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/websql';
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/websql';
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/websql';
2
+ import { type DeepPartial, type FindManyOptions, type FindOneOptions, type FindOptionsWhere, type InsertResult, type Repository, type SaveOptions, type UpdateResult } from 'taon-typeorm/websql';
3
+ import type { QueryDeepPartialEntity } from 'taon-typeorm/websql';
4
+ import type { UpsertOptions } from 'taon-typeorm/websql';
5
+ import type { DataSource as DataSourceType, QueryRunner, SelectQueryBuilder } from 'taon-typeorm/websql';
6
6
  import { MySqlQuerySource } from 'taon-type-sql/websql';
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[]>;
@@ -227,6 +238,11 @@ export declare abstract class BaseRepository<Entity extends {
227
238
  * Raw query execution is supported only by relational databases (MongoDB is not supported).
228
239
  */
229
240
  query(query: string, parameters?: any[]): Promise<any>;
241
+ /**
242
+ * Executes a raw SQL query and returns a raw database results.
243
+ * Raw query execution is supported only by relational databases (MongoDB is not supported).
244
+ */
245
+ createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<Entity>;
230
246
  /**
231
247
  * Clears all the data from the given table/collection (truncates/drops it).
232
248
  *
@@ -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/websql",
3
- "version": "19.0.7",
3
+ "version": "19.0.9",
4
4
  "module": "fesm2022/taon.mjs",
5
5
  "typings": "index.d.ts",
6
6
  "exports": {