@processpuzzle/base-entity 0.3.3 → 0.3.5

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@processpuzzle/base-entity",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Zsolt Zsuffa",
7
- "email": "zsolt.zsuffa@gmailmcom"
7
+ "email": "zsolt.zsuffa@gmail.com"
8
8
  },
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -16,16 +16,16 @@
16
16
  },
17
17
  "homepage": "https://github.com/ZsZs/processpuzzle#readme",
18
18
  "peerDependencies": {
19
- "@angular/cdk": "^20.2.10",
20
- "@angular/common": "~20.3.9",
21
- "@angular/core": "~20.3.9",
22
- "@angular/forms": "~20.3.9",
23
- "@angular/material": "^20.2.10",
24
- "@angular/platform-browser": "~20.3.9",
25
- "@angular/router": "~20.3.9",
19
+ "@angular/cdk": "^21.2.2",
20
+ "@angular/common": "~21.2.3",
21
+ "@angular/core": "~21.2.3",
22
+ "@angular/forms": "~21.2.3",
23
+ "@angular/material": "^21.2.2",
24
+ "@angular/platform-browser": "~21.2.3",
25
+ "@angular/router": "~21.2.3",
26
26
  "@angular/fire": "^20.0.1",
27
- "@ngrx/operators": "^20.1.0",
28
- "@ngrx/signals": "^20.1.0",
27
+ "@ngrx/operators": "^21.0.1",
28
+ "@ngrx/signals": "^21.0.1",
29
29
  "@processpuzzle/util": "^0.2.4",
30
30
  "build-url-ts": "^6.2.0",
31
31
  "rxjs": "~7.8.2",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "sideEffects": false,
38
38
  "module": "fesm2022/processpuzzle-base-entity.mjs",
39
- "typings": "index.d.ts",
39
+ "typings": "types/processpuzzle-base-entity.d.ts",
40
40
  "exports": {
41
41
  "./package.json": {
42
42
  "default": "./package.json"
43
43
  },
44
44
  ".": {
45
- "types": "./index.d.ts",
45
+ "types": "./types/processpuzzle-base-entity.d.ts",
46
46
  "default": "./fesm2022/processpuzzle-base-entity.mjs"
47
47
  }
48
48
  }
@@ -1,19 +1,19 @@
1
- import { Routes, Router } from '@angular/router';
2
- import * as _ngrx_signals from '@ngrx/signals';
3
1
  import * as i0 from '@angular/core';
4
- import { OnDestroy, OnInit, ViewContainerRef, Signal, AfterViewInit, InjectionToken, ProviderToken } from '@angular/core';
2
+ import { OnDestroy, OnInit, InjectionToken, ViewContainerRef, Signal, AfterViewInit, ProviderToken } from '@angular/core';
5
3
  import { MatSnackBar } from '@angular/material/snack-bar';
4
+ import * as _ngrx_signals from '@ngrx/signals';
5
+ import { Observable } from 'rxjs';
6
+ import { HttpClient, HttpHeaders } from '@angular/common/http';
7
+ import { WhereFilterOp, Firestore } from '@angular/fire/firestore';
6
8
  import { FormGroup } from '@angular/forms';
7
9
  import { MatTableDataSource } from '@angular/material/table';
8
10
  import { MatSort } from '@angular/material/sort';
11
+ import * as _angular_material_paginator from '@angular/material/paginator';
9
12
  import { MatPaginator } from '@angular/material/paginator';
13
+ import { Router, Routes } from '@angular/router';
10
14
  import { SelectionModel } from '@angular/cdk/collections';
11
- import { WhereFilterOp, Firestore } from '@angular/fire/firestore';
12
- import { Observable } from 'rxjs';
13
- import { HttpClient, HttpHeaders } from '@angular/common/http';
14
15
  import * as _processpuzzle_base_entity from '@processpuzzle/base-entity';
15
16
  import * as _ngrx_signals_rxjs_interop from '@ngrx/signals/rxjs-interop';
16
- import * as _angular_material_paginator_d from '@angular/material/paginator.d';
17
17
  import * as _firebase_firestore from '@firebase/firestore';
18
18
 
19
19
  declare enum FormControlType {
@@ -38,22 +38,6 @@ declare abstract class AbstractAttrDescriptor {
38
38
  protected constructor(attrName: string, formControlType: FormControlType);
39
39
  }
40
40
 
41
- declare const BASE_ENTITY_ROUTES: Routes;
42
-
43
- declare function BaseEntityContainerStore(): _ngrx_signals.SignalStoreFeature<_ngrx_signals.EmptyFeatureResult, {
44
- state: {
45
- filterKey: string | undefined;
46
- };
47
- props: {};
48
- methods: {
49
- doFilter: (filterKey: string) => void;
50
- };
51
- }>;
52
-
53
- interface BaseEntity {
54
- readonly id: string;
55
- }
56
-
57
41
  interface BaseEntityDescriptor {
58
42
  store: any;
59
43
  attrDescriptors: AbstractAttrDescriptor[];
@@ -73,6 +57,90 @@ declare class BaseEntityContainerComponent implements OnDestroy, OnInit {
73
57
  static ɵcmp: i0.ɵɵComponentDeclaration<BaseEntityContainerComponent, "base-entity-container", never, { "baseEntityListOptions": { "alias": "baseEntityListOptions"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
74
58
  }
75
59
 
60
+ declare function BaseEntityContainerStore(): _ngrx_signals.SignalStoreFeature<_ngrx_signals.EmptyFeatureResult, {
61
+ state: {
62
+ filterKey: string | undefined;
63
+ };
64
+ props: {};
65
+ methods: {
66
+ doFilter: (filterKey: string) => void;
67
+ };
68
+ }>;
69
+
70
+ interface BaseEntity {
71
+ readonly id: string;
72
+ }
73
+
74
+ interface BaseEntityMapper<Entity extends BaseEntity> {
75
+ fromDto(dto: any, index?: number): Entity;
76
+ toDto(entity: Entity): any;
77
+ }
78
+
79
+ interface OrderByCondition<Entity extends BaseEntity> {
80
+ field: keyof Entity;
81
+ order?: OrderByDirection;
82
+ }
83
+ interface FilterCondition {
84
+ property: string;
85
+ operator: WhereFilterOp;
86
+ value: string;
87
+ }
88
+ declare enum OrderByDirection {
89
+ ASC = "asc",
90
+ DESC = "desc"
91
+ }
92
+ interface OrderBy {
93
+ property: string;
94
+ direction: string;
95
+ }
96
+ interface BaseEntityQueryCondition {
97
+ path?: string;
98
+ hash?: string;
99
+ page?: number;
100
+ pageSize?: number;
101
+ pathParams?: Map<string, string>;
102
+ filters?: FilterCondition[];
103
+ orderBys?: OrderBy[];
104
+ }
105
+ interface BaseEntityLoadResponse<Entity extends BaseEntity> {
106
+ page: number | undefined;
107
+ pageSize: number | undefined;
108
+ totalPageCount: number | undefined;
109
+ content: Entity[];
110
+ }
111
+
112
+ declare const BASE_ENTITY_SERVICE: InjectionToken<BaseEntityService<any>>;
113
+ interface BaseEntityService<Entity extends BaseEntity> {
114
+ add(entity: Entity, id?: number): Observable<Entity>;
115
+ delete(id: string): Observable<unknown>;
116
+ deleteAll(): Observable<unknown>;
117
+ findAll(page?: number, pageSize?: number): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
118
+ findById(id: string): Observable<Entity | void>;
119
+ findByQuery(condition: BaseEntityQueryCondition): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
120
+ update(entity: Entity): Observable<Entity>;
121
+ }
122
+
123
+ declare abstract class BaseEntityRestService<Entity extends BaseEntity> implements BaseEntityService<Entity> {
124
+ protected entityMapper: BaseEntityMapper<Entity>;
125
+ protected urlProperty: string;
126
+ protected resourceUrl: string;
127
+ private readonly runtimeConfiguration;
128
+ private readonly baseUrl;
129
+ protected httpClient: HttpClient;
130
+ protected headers: HttpHeaders;
131
+ protected constructor(entityMapper: BaseEntityMapper<Entity>, urlProperty: string, resourceUrl: string);
132
+ delete(id: string): Observable<unknown>;
133
+ deleteAll(): Observable<any>;
134
+ findAll(page?: number): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
135
+ findByQuery(queryCondition: BaseEntityQueryCondition): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
136
+ findById(id: string): Observable<void | Entity>;
137
+ add(entity: Entity, id?: number): Observable<Entity>;
138
+ update(entity: Entity): Observable<Entity>;
139
+ protected buildFullUrl(resourceUri: string, queryCondition: BaseEntityQueryCondition): string | undefined;
140
+ private mapPagedResponse;
141
+ private mapSimpleResponse;
142
+ }
143
+
76
144
  declare class BaseEntityAttrDescriptor extends AbstractAttrDescriptor {
77
145
  description?: string;
78
146
  styleClass?: string | undefined;
@@ -158,76 +226,6 @@ declare class BaseEntityListComponent<Entity extends BaseEntity> implements Afte
158
226
  static ɵcmp: i0.ɵɵComponentDeclaration<BaseEntityListComponent<any>, "base-list", never, {}, {}, never, never, true, never>;
159
227
  }
160
228
 
161
- interface OrderByCondition<Entity extends BaseEntity> {
162
- field: keyof Entity;
163
- order?: OrderByDirection;
164
- }
165
- interface FilterCondition {
166
- property: string;
167
- operator: WhereFilterOp;
168
- value: string;
169
- }
170
- declare enum OrderByDirection {
171
- ASC = "asc",
172
- DESC = "desc"
173
- }
174
- interface OrderBy {
175
- property: string;
176
- direction: string;
177
- }
178
- interface BaseEntityQueryCondition {
179
- path?: string;
180
- hash?: string;
181
- page?: number;
182
- pageSize?: number;
183
- pathParams?: Map<string, string>;
184
- filters?: FilterCondition[];
185
- orderBys?: OrderBy[];
186
- }
187
- interface BaseEntityLoadResponse<Entity extends BaseEntity> {
188
- page: number | undefined;
189
- pageSize: number | undefined;
190
- totalPageCount: number | undefined;
191
- content: Entity[];
192
- }
193
-
194
- interface BaseEntityMapper<Entity extends BaseEntity> {
195
- fromDto(dto: any, index?: number): Entity;
196
- toDto(entity: Entity): any;
197
- }
198
-
199
- declare const BASE_ENTITY_SERVICE: InjectionToken<BaseEntityService<any>>;
200
- interface BaseEntityService<Entity extends BaseEntity> {
201
- add(entity: Entity, id?: number): Observable<Entity>;
202
- delete(id: string): Observable<unknown>;
203
- deleteAll(): Observable<unknown>;
204
- findAll(page?: number, pageSize?: number): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
205
- findById(id: string): Observable<Entity | void>;
206
- findByQuery(condition: BaseEntityQueryCondition): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
207
- update(entity: Entity): Observable<Entity>;
208
- }
209
-
210
- declare abstract class BaseEntityRestService<Entity extends BaseEntity> implements BaseEntityService<Entity> {
211
- protected entityMapper: BaseEntityMapper<Entity>;
212
- protected urlProperty: string;
213
- protected resourceUrl: string;
214
- private readonly runtimeConfiguration;
215
- private readonly baseUrl;
216
- protected httpClient: HttpClient;
217
- protected headers: HttpHeaders;
218
- protected constructor(entityMapper: BaseEntityMapper<Entity>, urlProperty: string, resourceUrl: string);
219
- delete(id: string): Observable<unknown>;
220
- deleteAll(): Observable<any>;
221
- findAll(page?: number): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
222
- findByQuery(queryCondition: BaseEntityQueryCondition): Observable<BaseEntityLoadResponse<Entity> | Entity[] | Entity>;
223
- findById(id: string): Observable<void | Entity>;
224
- add(entity: Entity, id?: number): Observable<Entity>;
225
- update(entity: Entity): Observable<Entity>;
226
- protected buildFullUrl(resourceUri: string, queryCondition: BaseEntityQueryCondition): string | undefined;
227
- private mapPagedResponse;
228
- private mapSimpleResponse;
229
- }
230
-
231
229
  declare function BaseEntityTabsStore(): _ngrx_signals.SignalStoreFeature<_ngrx_signals.EmptyFeatureResult, {
232
230
  state: {
233
231
  activeTabs: string[];
@@ -256,7 +254,7 @@ declare function BaseEntityStore<Entity extends BaseEntity>(entityType: new () =
256
254
  };
257
255
  props: {
258
256
  countOfEntities: i0.Signal<number>;
259
- matTableDataSource: i0.Signal<MatTableDataSource<Entity, _angular_material_paginator_d.MatPaginator>>;
257
+ matTableDataSource: i0.Signal<MatTableDataSource<Entity, _angular_material_paginator.MatPaginator>>;
260
258
  };
261
259
  methods: {
262
260
  clearCurrentEntity: () => void;
@@ -376,5 +374,7 @@ declare function Id(): PropertyDecorator;
376
374
  */
377
375
  declare function getEntityIds(instance: any): string[];
378
376
 
377
+ declare const BASE_ENTITY_ROUTES: Routes;
378
+
379
379
  export { AbstractAttrDescriptor, BASE_ENTITY_ROUTES, BASE_ENTITY_SERVICE, BASE_ENTITY_STORE, BASE_LIST_DESCRIPTORS, BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityFirestoreService, BaseEntityFormComponent, BaseEntityListComponent, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseFormNavigatorStore, Entity, FlexDirection, FlexboxDescriptor, FormControlType, Id, OrderByDirection, RouteSegments, getEntityIds, getEntityOptions };
380
380
  export type { BaseEntity, BaseEntityDescriptor, BaseEntityLoadResponse, BaseEntityMapper, BaseEntityQueryCondition, EntityOptions, FilterCondition, NavigationState, OrderByCondition };