@punks/backend-entity-manager 0.0.62 → 0.0.64
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/dist/cjs/index.js +87 -31
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/index.d.ts +1 -1
- package/dist/cjs/types/abstractions/queries.d.ts +4 -1
- package/dist/cjs/types/platforms/nest/dto/facets.d.ts +22 -0
- package/dist/cjs/types/platforms/nest/dto/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/index.d.ts +1 -0
- package/dist/esm/index.js +82 -32
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/index.d.ts +1 -1
- package/dist/esm/types/abstractions/queries.d.ts +4 -1
- package/dist/esm/types/platforms/nest/dto/facets.d.ts +22 -0
- package/dist/esm/types/platforms/nest/dto/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/index.d.ts +1 -0
- package/dist/index.d.ts +27 -2
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export * from "./filters";
|
|
|
13
13
|
export * from "./localization";
|
|
14
14
|
export { IEntityManager } from "./manager";
|
|
15
15
|
export { IEntityMapper } from "./mappers";
|
|
16
|
-
export { IEntitiesSearchQuery, IEntityGetQuery, IEntitiesQueryBuilder, IEntityFacet, IEntityFacets, } from "./queries";
|
|
16
|
+
export { IEntitiesSearchQuery, IEntityGetQuery, IEntitiesQueryBuilder, IEntityFacet, IEntityFacets, IEntityFacetItem, } from "./queries";
|
|
17
17
|
export { IReplicasConfiguration, ReplicationMode, ReplicaOptions, ReplicaConfiguration, IEntityReplicaDeleteManager, IEntityReplicaSyncManager, } from "./replication";
|
|
18
18
|
export { IEntityRepository } from "./repository";
|
|
19
19
|
export * from "./searchParameters";
|
|
@@ -2,10 +2,13 @@ import { IEntitiesSearchResults } from "../models";
|
|
|
2
2
|
import { IAuthenticationContext } from "./authentication";
|
|
3
3
|
import { SortingType } from "./common";
|
|
4
4
|
import { IEntitySearchParameters } from "./searchParameters";
|
|
5
|
-
export interface
|
|
5
|
+
export interface IEntityFacetItem<T> {
|
|
6
6
|
value: T;
|
|
7
7
|
name?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface IEntityFacet<T> {
|
|
10
|
+
items: IEntityFacetItem<T>[];
|
|
11
|
+
}
|
|
9
12
|
export interface IEntityFacets {
|
|
10
13
|
}
|
|
11
14
|
export interface IEntitiesSearchQuery<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets> {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IEntityFacet, IEntityFacetItem } from "../../../abstractions";
|
|
2
|
+
export declare class NumericFacetItem implements IEntityFacetItem<number> {
|
|
3
|
+
value: number;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class NumericFacet implements IEntityFacet<number> {
|
|
7
|
+
items: NumericFacetItem[];
|
|
8
|
+
}
|
|
9
|
+
export declare class BooleanFacetItem implements IEntityFacetItem<boolean> {
|
|
10
|
+
value: boolean;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class BooleanFacet implements IEntityFacet<boolean> {
|
|
14
|
+
items: BooleanFacetItem[];
|
|
15
|
+
}
|
|
16
|
+
export declare class StringFacetItem implements IEntityFacetItem<string> {
|
|
17
|
+
value: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class StringFacet implements IEntityFacet<string> {
|
|
21
|
+
items: StringFacetItem[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BooleanFacet, BooleanFacetItem, NumericFacet, NumericFacetItem, StringFacet, StringFacetItem, } from "./facets";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Log, sort, byField, toDict, newUuid as newUuid$1, removeUndefinedProps } from '@punks/backend-core';
|
|
2
2
|
import { applyDecorators, Injectable, SetMetadata, Global, Module, Scope, Logger, HttpStatus, HttpException } from '@nestjs/common';
|
|
3
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
4
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
4
5
|
import { hash } from 'bcrypt';
|
|
5
6
|
import { PATH_METADATA } from '@nestjs/common/constants';
|
|
@@ -217,6 +218,86 @@ const WpEventsTracker = (props = {}) => applyDecorators(Injectable(), SetMetadat
|
|
|
217
218
|
...props,
|
|
218
219
|
}));
|
|
219
220
|
|
|
221
|
+
/******************************************************************************
|
|
222
|
+
Copyright (c) Microsoft Corporation.
|
|
223
|
+
|
|
224
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
225
|
+
purpose with or without fee is hereby granted.
|
|
226
|
+
|
|
227
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
228
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
229
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
230
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
231
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
232
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
233
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
234
|
+
***************************************************************************** */
|
|
235
|
+
|
|
236
|
+
function __decorate(decorators, target, key, desc) {
|
|
237
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
238
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
239
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
240
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function __metadata(metadataKey, metadataValue) {
|
|
244
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
248
|
+
var e = new Error(message);
|
|
249
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
class NumericFacetItem {
|
|
253
|
+
}
|
|
254
|
+
__decorate([
|
|
255
|
+
ApiProperty(),
|
|
256
|
+
__metadata("design:type", Number)
|
|
257
|
+
], NumericFacetItem.prototype, "value", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
ApiProperty({ nullable: true }),
|
|
260
|
+
__metadata("design:type", String)
|
|
261
|
+
], NumericFacetItem.prototype, "name", void 0);
|
|
262
|
+
class NumericFacet {
|
|
263
|
+
}
|
|
264
|
+
__decorate([
|
|
265
|
+
ApiProperty({ type: [NumericFacetItem] }),
|
|
266
|
+
__metadata("design:type", Array)
|
|
267
|
+
], NumericFacet.prototype, "items", void 0);
|
|
268
|
+
class BooleanFacetItem {
|
|
269
|
+
}
|
|
270
|
+
__decorate([
|
|
271
|
+
ApiProperty(),
|
|
272
|
+
__metadata("design:type", Boolean)
|
|
273
|
+
], BooleanFacetItem.prototype, "value", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
ApiProperty({ nullable: true }),
|
|
276
|
+
__metadata("design:type", String)
|
|
277
|
+
], BooleanFacetItem.prototype, "name", void 0);
|
|
278
|
+
class BooleanFacet {
|
|
279
|
+
}
|
|
280
|
+
__decorate([
|
|
281
|
+
ApiProperty({ type: [BooleanFacetItem] }),
|
|
282
|
+
__metadata("design:type", Array)
|
|
283
|
+
], BooleanFacet.prototype, "items", void 0);
|
|
284
|
+
class StringFacetItem {
|
|
285
|
+
}
|
|
286
|
+
__decorate([
|
|
287
|
+
ApiProperty(),
|
|
288
|
+
__metadata("design:type", String)
|
|
289
|
+
], StringFacetItem.prototype, "value", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
ApiProperty({ nullable: true }),
|
|
292
|
+
__metadata("design:type", String)
|
|
293
|
+
], StringFacetItem.prototype, "name", void 0);
|
|
294
|
+
class StringFacet {
|
|
295
|
+
}
|
|
296
|
+
__decorate([
|
|
297
|
+
ApiProperty({ type: [StringFacetItem] }),
|
|
298
|
+
__metadata("design:type", Array)
|
|
299
|
+
], StringFacet.prototype, "items", void 0);
|
|
300
|
+
|
|
220
301
|
const AuthenticationExtensionSymbols = {
|
|
221
302
|
UserService: Symbol.for("WP.EXT:AUTHENTICATION.USER_SERVICE"),
|
|
222
303
|
};
|
|
@@ -257,37 +338,6 @@ const AuthenticationEvents = {
|
|
|
257
338
|
UserPasswordResetCompleted: `${AUTHENTICATION_EVENTS_NAMESPACE}:user.passwordResetCompleted`,
|
|
258
339
|
};
|
|
259
340
|
|
|
260
|
-
/******************************************************************************
|
|
261
|
-
Copyright (c) Microsoft Corporation.
|
|
262
|
-
|
|
263
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
264
|
-
purpose with or without fee is hereby granted.
|
|
265
|
-
|
|
266
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
267
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
268
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
269
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
270
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
271
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
272
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
273
|
-
***************************************************************************** */
|
|
274
|
-
|
|
275
|
-
function __decorate(decorators, target, key, desc) {
|
|
276
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
277
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
278
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
279
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
function __metadata(metadataKey, metadataValue) {
|
|
283
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
287
|
-
var e = new Error(message);
|
|
288
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
289
|
-
};
|
|
290
|
-
|
|
291
341
|
const asyncLocalStorage = new AsyncLocalStorage();
|
|
292
342
|
|
|
293
343
|
let AppSessionService = class AppSessionService {
|
|
@@ -25365,5 +25415,5 @@ AppSessionMiddleware = __decorate([
|
|
|
25365
25415
|
Injectable()
|
|
25366
25416
|
], AppSessionMiddleware);
|
|
25367
25417
|
|
|
25368
|
-
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EventsService, InvalidCredentialsError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PlatformEvents, QueryBuilderBase, ReplicationMode, SendgridEmailModule, SendgridEmailTemplate, SortDirection, TrackingService, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEventsTracker, WpSendgridEmailTemplate, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
|
|
25418
|
+
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSessionMiddleware, AppSessionService, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsEmailModule, AwsSesEmailTemplate, BooleanFacet, BooleanFacetItem, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EventsService, InvalidCredentialsError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, NumericFacet, NumericFacetItem, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PlatformEvents, QueryBuilderBase, ReplicationMode, SendgridEmailModule, SendgridEmailTemplate, SortDirection, StringFacet, StringFacetItem, TrackingService, UserRegistrationError, WpAppInitializer, WpAwsSesEmailTemplate, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEventsTracker, WpSendgridEmailTemplate, WpUserService, getLocalizedText, newUuid, renderHandlebarsTemplate };
|
|
25369
25419
|
//# sourceMappingURL=index.js.map
|