@punks/backend-entity-manager 0.0.196 → 0.0.198
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 +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/authentication.d.ts +9 -2
- package/dist/cjs/types/integrations/repository/typeorm/permissionsChecker.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/authentication/entityAuthorizationMiddleware.d.ts +2 -0
- package/dist/cjs/types/providers/services.d.ts +2 -2
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/authentication.d.ts +9 -2
- package/dist/esm/types/integrations/repository/typeorm/permissionsChecker.d.ts +2 -1
- package/dist/esm/types/platforms/nest/authentication/entityAuthorizationMiddleware.d.ts +2 -0
- package/dist/esm/types/providers/services.d.ts +2 -2
- package/dist/index.d.ts +1638 -1630
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="express-serve-static-core" />
|
|
3
|
-
/// <reference types="multer" />
|
|
4
2
|
/// <reference types="qs" />
|
|
5
3
|
/// <reference types="express" />
|
|
4
|
+
/// <reference types="express-serve-static-core" />
|
|
5
|
+
/// <reference types="multer" />
|
|
6
6
|
import * as _punks_backend_core from '@punks/backend-core';
|
|
7
7
|
import { Repository, ObjectLiteral, FindOneOptions, FindManyOptions, FindOptionsRelations, ObjectId, FindOptionsWhere, FindOperator, FindOptionsOrder } from 'typeorm';
|
|
8
8
|
import * as _nestjs_common from '@nestjs/common';
|
|
@@ -502,124 +502,19 @@ interface IEntityUpdateCommandAdapter<TEntity, TEntityUpdateData> {
|
|
|
502
502
|
interface IEntityAdapter<TEntity, TEntityCreateData, TEntityUpdateData> extends IEntityCreateCommandAdapter<TEntity, TEntityCreateData>, IEntityUpdateCommandAdapter<TEntity, TEntityUpdateData> {
|
|
503
503
|
}
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
interface IAuthenticationUserPermission {
|
|
509
|
-
uid: string;
|
|
510
|
-
}
|
|
511
|
-
interface IAuthenticationOrganizationalUnit {
|
|
512
|
-
id: string;
|
|
513
|
-
uid: string;
|
|
514
|
-
}
|
|
515
|
-
interface IAuthenticationContext<TUserContextData> {
|
|
516
|
-
isAuthenticated: boolean;
|
|
517
|
-
isAnonymous: boolean;
|
|
518
|
-
userId?: string;
|
|
519
|
-
userContext?: TUserContextData;
|
|
520
|
-
userRoles?: IAuthenticationUserRole[];
|
|
521
|
-
userPermissions?: IAuthenticationUserPermission[];
|
|
522
|
-
userOrganizationalUnits?: IAuthenticationOrganizationalUnit[];
|
|
523
|
-
}
|
|
524
|
-
interface IAuthenticationContextProvider<TUserContext> {
|
|
525
|
-
getContext(): Promise<IAuthenticationContext<TUserContext>>;
|
|
526
|
-
}
|
|
527
|
-
interface IAuthenticationMiddleware<TAuthenticationContext, TOutput> {
|
|
528
|
-
processContext(context: IAuthenticationContext<TAuthenticationContext>): Promise<TOutput>;
|
|
529
|
-
getPriority(): number;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
type BucketFolderListInput = {
|
|
533
|
-
bucket: string;
|
|
534
|
-
maxResults?: number;
|
|
535
|
-
path?: string;
|
|
536
|
-
};
|
|
537
|
-
declare enum BucketItemType {
|
|
538
|
-
File = "file",
|
|
539
|
-
Folder = "folder"
|
|
540
|
-
}
|
|
541
|
-
type BucketContentItem = {
|
|
542
|
-
type: BucketItemType;
|
|
543
|
-
name: string;
|
|
544
|
-
path: string;
|
|
545
|
-
};
|
|
546
|
-
type BucketFolderContentResult = {
|
|
547
|
-
items: BucketContentItem[];
|
|
548
|
-
};
|
|
549
|
-
type BucketFolderListResult = {};
|
|
550
|
-
type BucketFolderCreateInput = {
|
|
551
|
-
bucket: string;
|
|
552
|
-
path: string;
|
|
553
|
-
};
|
|
554
|
-
type BucketFolderEnsureInput = {
|
|
555
|
-
bucket: string;
|
|
556
|
-
path: string;
|
|
557
|
-
};
|
|
558
|
-
type BucketFolderExistsInput = {
|
|
559
|
-
bucket: string;
|
|
560
|
-
path: string;
|
|
561
|
-
};
|
|
562
|
-
type BucketFileDownloadInput = {
|
|
563
|
-
bucket: string;
|
|
564
|
-
filePath: string;
|
|
565
|
-
};
|
|
566
|
-
type BucketFilePublicUrlCreateInput = {
|
|
567
|
-
bucket: string;
|
|
568
|
-
filePath: string;
|
|
569
|
-
expirationMinutes: number;
|
|
570
|
-
};
|
|
571
|
-
type BucketFileUploadInput = {
|
|
572
|
-
bucket: string;
|
|
573
|
-
filePath: string;
|
|
574
|
-
content: Buffer;
|
|
575
|
-
contentType?: string;
|
|
576
|
-
};
|
|
577
|
-
interface BucketFileDeleteInput {
|
|
578
|
-
bucket: string;
|
|
579
|
-
filePath: string;
|
|
580
|
-
}
|
|
581
|
-
interface IBucketProvider {
|
|
582
|
-
folderList(input: BucketFolderListInput): Promise<BucketFolderListResult>;
|
|
583
|
-
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
584
|
-
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
585
|
-
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
586
|
-
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
587
|
-
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
588
|
-
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
505
|
+
declare class PermissionsChecker<TUserContext> {
|
|
506
|
+
hasAny(context: IAuthenticationContext<TUserContext>, permissions: string[]): boolean;
|
|
507
|
+
hasAll(context: IAuthenticationContext<TUserContext>, permissions: string[]): boolean;
|
|
589
508
|
}
|
|
590
509
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
createdOn: Date;
|
|
600
|
-
updatedOn: Date;
|
|
601
|
-
};
|
|
602
|
-
type CacheEntryDetail = CacheEntryInfo & {
|
|
603
|
-
data: any;
|
|
604
|
-
};
|
|
605
|
-
interface ICacheInstance {
|
|
606
|
-
getInstanceName(): string;
|
|
607
|
-
getEntries(): Promise<CacheEntryInfo[]>;
|
|
608
|
-
getEntry(key: string): Promise<CacheEntryDetail | undefined>;
|
|
609
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
610
|
-
set<T>(key: string, input: {
|
|
611
|
-
value: T;
|
|
612
|
-
ttl: CacheTtl;
|
|
613
|
-
}): Promise<void>;
|
|
614
|
-
retrieve<T>(key: string, input: {
|
|
615
|
-
ttl: CacheTtl;
|
|
616
|
-
valueFactory: () => Promise<T>;
|
|
617
|
-
}): Promise<T>;
|
|
618
|
-
delete(key: string): Promise<void>;
|
|
619
|
-
clear(): Promise<void>;
|
|
620
|
-
}
|
|
621
|
-
interface ICache {
|
|
622
|
-
getInstance(instanceName: string): Promise<ICacheInstance>;
|
|
510
|
+
declare abstract class NestEntityAuthorizationMiddleware<TEntity, TAuthenticationContext extends IAuthenticationContext<TUserContext>, TUserContext> implements IEntityAuthorizationMiddleware<TEntity, TAuthenticationContext, TUserContext> {
|
|
511
|
+
protected permissions: PermissionsChecker<TUserContext>;
|
|
512
|
+
abstract canSearch(context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
513
|
+
abstract canRead(entity: Partial<TEntity>, context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
514
|
+
abstract canCreate(entity: Partial<TEntity>, context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
515
|
+
abstract canUpdate(entity: Partial<TEntity>, context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
516
|
+
abstract canDelete(entity: Partial<TEntity>, context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
517
|
+
abstract canDeleteItems(context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
623
518
|
}
|
|
624
519
|
|
|
625
520
|
interface IAuthorizationResult {
|
|
@@ -634,37 +529,6 @@ interface IEntityAuthorizationMiddleware<TEntity, TAuthenticationContext extends
|
|
|
634
529
|
canDeleteItems(context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
635
530
|
}
|
|
636
531
|
|
|
637
|
-
interface IResolveServiceOptions {
|
|
638
|
-
optional?: boolean;
|
|
639
|
-
}
|
|
640
|
-
interface IServiceLocator {
|
|
641
|
-
register<T extends ClassType>(name: string, service: Type<T>): void;
|
|
642
|
-
registerEntityService<T>(serviceName: string, entityName: string, service: T): void;
|
|
643
|
-
registerEntityServiceType<T>(serviceType: Type<T>, entityName: string, service: T): void;
|
|
644
|
-
resolve<T extends ClassType>(name: string, options?: IResolveServiceOptions): T;
|
|
645
|
-
resolveEntityService<T>(serviceName: string, entityName: string, options?: IResolveServiceOptions): T;
|
|
646
|
-
resolveEntityServiceType<T>(serviceType: Type<T>, entityName: string, options?: IResolveServiceOptions): T;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
declare class ServiceLocator implements IServiceLocator {
|
|
650
|
-
private services;
|
|
651
|
-
private multipleServices;
|
|
652
|
-
all(): {
|
|
653
|
-
[key: string]: any;
|
|
654
|
-
};
|
|
655
|
-
register<T>(name: string, service: T): void;
|
|
656
|
-
registerMultiple<T>(serviceName: string, instanceName: string, service: T): void;
|
|
657
|
-
registerEntityService<T>(serviceName: string, entityName: string, service: T): void;
|
|
658
|
-
registerEntityServiceType<T>(serviceType: Type<T>, entityName: string, service: T): void;
|
|
659
|
-
resolve<T>(name: string, options?: IResolveServiceOptions): T;
|
|
660
|
-
resolveMultiple<T>(serviceName: string, options?: IResolveServiceOptions): T[];
|
|
661
|
-
resolveMultipleNamed<T>(serviceName: string, instanceName: string, options?: IResolveServiceOptions): T;
|
|
662
|
-
resolveEntityService<T>(serviceName: string, entityName: string, options?: IResolveServiceOptions): T;
|
|
663
|
-
resolveEntityServiceType<T>(serviceType: Type<T>, entityName: string, options?: IResolveServiceOptions): T;
|
|
664
|
-
private buildServiceTypeName;
|
|
665
|
-
private buildServiceName;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
532
|
interface IEntityMapper<TEntity, TMappedEntity> {
|
|
669
533
|
mapEntity(entity: TEntity): Promise<TMappedEntity>;
|
|
670
534
|
}
|
|
@@ -841,6 +705,37 @@ type IEntityConfiguration = {
|
|
|
841
705
|
versioning?: EntityVersioningOptions$1;
|
|
842
706
|
};
|
|
843
707
|
|
|
708
|
+
interface IResolveServiceOptions {
|
|
709
|
+
optional?: boolean;
|
|
710
|
+
}
|
|
711
|
+
interface IServiceLocator {
|
|
712
|
+
register<T extends ClassType>(name: string, service: Type<T>): void;
|
|
713
|
+
registerEntityService<T>(serviceName: string, entityName: string, service: T): void;
|
|
714
|
+
registerEntityServiceType<T>(serviceType: Type<T>, entityName: string, service: T): void;
|
|
715
|
+
resolve<T extends ClassType>(name: string, options?: IResolveServiceOptions): T;
|
|
716
|
+
resolveEntityService<T>(serviceName: string, entityName: string, options?: IResolveServiceOptions): T;
|
|
717
|
+
resolveEntityServiceType<T>(serviceType: Type<T>, entityName: string, options?: IResolveServiceOptions): T;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
declare class ServiceLocator implements IServiceLocator {
|
|
721
|
+
private services;
|
|
722
|
+
private multipleServices;
|
|
723
|
+
all(): {
|
|
724
|
+
[key: string]: any;
|
|
725
|
+
};
|
|
726
|
+
register<T>(name: string, service: T): void;
|
|
727
|
+
registerMultiple<T>(serviceName: string, instanceName: string, service: T): void;
|
|
728
|
+
registerEntityService<T>(serviceName: string, entityName: string, service: T): void;
|
|
729
|
+
registerEntityServiceType<T>(serviceType: Type<T>, entityName: string, service: T): void;
|
|
730
|
+
resolve<T>(name: string, options?: IResolveServiceOptions): T;
|
|
731
|
+
resolveMultiple<T>(serviceName: string, options?: IResolveServiceOptions): T[];
|
|
732
|
+
resolveMultipleNamed<T>(serviceName: string, instanceName: string, options?: IResolveServiceOptions): T;
|
|
733
|
+
resolveEntityService<T>(serviceName: string, entityName: string, options?: IResolveServiceOptions): T;
|
|
734
|
+
resolveEntityServiceType<T>(serviceType: Type<T>, entityName: string, options?: IResolveServiceOptions): T;
|
|
735
|
+
private buildServiceTypeName;
|
|
736
|
+
private buildServiceName;
|
|
737
|
+
}
|
|
738
|
+
|
|
844
739
|
declare class EntityServiceLocator<TEntity, TEntityId> {
|
|
845
740
|
private readonly services;
|
|
846
741
|
private readonly entityName;
|
|
@@ -914,8 +809,8 @@ declare class EntitiesServiceLocator {
|
|
|
914
809
|
registerCacheInstance<TCacheInstance extends ICacheInstance>(name: string, instance: TCacheInstance): this;
|
|
915
810
|
resolveBucketProviders<TBucketProvider extends IFileProvider>(): TBucketProvider[];
|
|
916
811
|
registerBucketProvider<TBucketProvider extends IBucketProvider>(name: string, instance: TBucketProvider): this;
|
|
917
|
-
resolveAuthenticationMiddlewares<TAuthenticationMiddleware extends IAuthenticationMiddleware<
|
|
918
|
-
registerAuthenticationMiddleware<TAuthenticationMiddleware extends IAuthenticationMiddleware<
|
|
812
|
+
resolveAuthenticationMiddlewares<TAuthenticationMiddleware extends IAuthenticationMiddleware<any, unknown>>(): TAuthenticationMiddleware[];
|
|
813
|
+
registerAuthenticationMiddleware<TAuthenticationMiddleware extends IAuthenticationMiddleware<any, unknown>>(name: string, instance: TAuthenticationMiddleware): this;
|
|
919
814
|
resolveFileProvider<TFileProvider extends IFileProvider>(providerId: string): TFileProvider;
|
|
920
815
|
registerFileProvider<TFileProvider extends IFileProvider>(name: string, instance: TFileProvider): this;
|
|
921
816
|
resolveFilesReferenceRepositoryProviders<TFilesReferenceRepo extends IFilesReferenceRepository>(): TFilesReferenceRepo;
|
|
@@ -1022,1768 +917,1881 @@ declare class EntitiesServiceLocator {
|
|
|
1022
917
|
registerQueryBuilder<TEntity, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets, TUserContext>(entityName: string, instance: IEntitiesQueryBuilder<TEntity, TEntityId, TEntitySearchParameters, TSorting, TCursor, TFacets, TUserContext>): void;
|
|
1023
918
|
}
|
|
1024
919
|
|
|
1025
|
-
interface
|
|
1026
|
-
|
|
920
|
+
interface EntityAuthMiddlewareProps {
|
|
921
|
+
entityName: string;
|
|
1027
922
|
}
|
|
923
|
+
declare const WpEntityAuthMiddleware: (entityName: string, props?: Omit<EntityAuthMiddlewareProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1028
924
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
};
|
|
1033
|
-
interface IEntityManagerServiceRoot {
|
|
1034
|
-
locator: ServiceLocator;
|
|
1035
|
-
getEntitiesServicesLocator(): EntitiesServiceLocator;
|
|
1036
|
-
getEntityServicesLocator<TEntity, TEntityId>(entityName: string): EntityServiceLocator<TEntity, TEntityId>;
|
|
1037
|
-
addAuthentication<TAuthenticationContextProvider extends IAuthenticationContextProvider<TUserContext>, TUserContext>({ provider, }: {
|
|
1038
|
-
provider: TAuthenticationContextProvider;
|
|
1039
|
-
}): void;
|
|
1040
|
-
registerEntity<TEntity, TEntityId, TRepository extends IEntityRepository<TEntity, TEntityId, unknown, unknown, unknown, unknown>>(entity: IEntityConfiguration, repository: TRepository): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
925
|
+
interface GlobalAuthenticationMiddlewareProps {
|
|
926
|
+
name: string;
|
|
927
|
+
weight?: number;
|
|
1041
928
|
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
addSnapshotService<TEntitySnapshotService extends IEntitySnapshotService<TEntityId, unknown>>(service: TEntitySnapshotService): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
1047
|
-
addConverter<TEntityDto, TListItemDto, TEntityCreateInput, TEntityUpdateInput, TEntityConverter extends IEntityConverter<TEntity, TEntityDto, TListItemDto, TEntityCreateInput, TEntityUpdateInput>>(converter: TEntityConverter): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
1048
|
-
addAdapter<TEntityCreateData, TEntityUpdateData, TEntityAdapter extends IEntityAdapter<TEntity, TEntityCreateData, TEntityUpdateData>>(adapter: TEntityAdapter): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
1049
|
-
addAuthorization<TEntityAuthorizationMiddleware extends IEntityAuthorizationMiddleware<TEntity, TAuthenticationContext, TUserContext>, TAuthenticationContext extends IAuthenticationContext<TUserContext>, TUserContext>({ middleware, }: {
|
|
1050
|
-
middleware: TEntityAuthorizationMiddleware;
|
|
1051
|
-
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
1052
|
-
withReplica<TRepository extends IEntityRepository<TEntity, TEntityId, unknown, unknown, unknown, unknown>>({ name, options, repository, }: {
|
|
1053
|
-
name: string;
|
|
1054
|
-
options: ReplicaOptions;
|
|
1055
|
-
repository: TRepository;
|
|
1056
|
-
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
1057
|
-
withSynchronization<TMappedType, TMapper extends IEntityMapper<TEntity, TMappedType>, TEntityConnector extends IEntityConnector<TEntity, TMappedType>>({ name, options, connector, mapper, }: {
|
|
1058
|
-
name: string;
|
|
1059
|
-
options: ConnectorOptions;
|
|
1060
|
-
connector: TEntityConnector;
|
|
1061
|
-
mapper: TMapper;
|
|
1062
|
-
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
929
|
+
declare const WpGlobalAuthenticationMiddleware: (name: string, props?: Omit<GlobalAuthenticationMiddlewareProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
930
|
+
|
|
931
|
+
interface BucketProviderProps {
|
|
932
|
+
providerId: string;
|
|
1063
933
|
}
|
|
934
|
+
declare const WpBucketProvider: (providerId: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1064
935
|
|
|
1065
|
-
interface
|
|
1066
|
-
|
|
1067
|
-
getTemplateData(payload: TAugmentedPayload): Promise<TTemplateData>;
|
|
936
|
+
interface CacheInstanceProps {
|
|
937
|
+
instanceName: string;
|
|
1068
938
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
type TemplatedEmailInput<TPayload> = {
|
|
1074
|
-
from?: string;
|
|
1075
|
-
to?: string[];
|
|
1076
|
-
cc?: string[];
|
|
1077
|
-
bcc?: string[];
|
|
1078
|
-
subjectTemplate?: string;
|
|
1079
|
-
templateId: string;
|
|
1080
|
-
languageCode: string;
|
|
1081
|
-
payload: TPayload;
|
|
1082
|
-
};
|
|
1083
|
-
interface HtmlEmailInput<TPayload> {
|
|
1084
|
-
replyTo?: string;
|
|
1085
|
-
from?: string;
|
|
1086
|
-
to?: string[];
|
|
1087
|
-
cc?: string[];
|
|
1088
|
-
bcc?: string[];
|
|
1089
|
-
subjectTemplate: string;
|
|
1090
|
-
bodyTemplate: string;
|
|
1091
|
-
payload: TPayload;
|
|
1092
|
-
}
|
|
1093
|
-
interface IEmailProvider<TTemplateData> {
|
|
1094
|
-
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
1095
|
-
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
1096
|
-
}
|
|
1097
|
-
interface IEmailLogger {
|
|
1098
|
-
logTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
1099
|
-
logHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
939
|
+
declare const WpCacheInstance: (instanceName: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
940
|
+
|
|
941
|
+
interface EntityActionsProps {
|
|
942
|
+
entityName: string;
|
|
1100
943
|
}
|
|
944
|
+
declare const WpEntityActions: (entityName: string, props?: Omit<EntityActionsProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1101
945
|
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
declare enum EntityOperationType {
|
|
1106
|
-
Create = 0,
|
|
1107
|
-
Update = 1,
|
|
1108
|
-
Delete = 2,
|
|
1109
|
-
Read = 3,
|
|
1110
|
-
Search = 4,
|
|
1111
|
-
Find = 5
|
|
1112
|
-
}
|
|
1113
|
-
declare abstract class EntityManagerUnauthorizedException extends EntityManagerException {
|
|
1114
|
-
constructor(message: string);
|
|
1115
|
-
}
|
|
1116
|
-
declare class EntityOperationUnauthorizedException<TEntity> extends EntityManagerUnauthorizedException {
|
|
1117
|
-
private readonly operation;
|
|
1118
|
-
private readonly entity?;
|
|
1119
|
-
constructor(operationType: EntityOperationType, entityName: string, entity?: DeepPartial<TEntity>);
|
|
1120
|
-
get getEntity(): DeepPartial<TEntity> | undefined;
|
|
1121
|
-
get getOperation(): EntityOperationType;
|
|
1122
|
-
}
|
|
1123
|
-
declare class EntityNotFoundException<TEntityId> extends EntityManagerException {
|
|
1124
|
-
private readonly entityId;
|
|
1125
|
-
constructor(id?: TEntityId);
|
|
1126
|
-
getEntityId(): TEntityId | undefined;
|
|
1127
|
-
}
|
|
1128
|
-
declare class MultipleEntitiesFoundException extends EntityManagerException {
|
|
1129
|
-
constructor();
|
|
946
|
+
interface EntityAdapterProps {
|
|
947
|
+
entityName: string;
|
|
1130
948
|
}
|
|
1131
|
-
declare
|
|
1132
|
-
|
|
949
|
+
declare const WpEntityAdapter: (entityName: string, props?: Omit<EntityAdapterProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
950
|
+
|
|
951
|
+
interface EntityConnectorProps {
|
|
952
|
+
entityName: string;
|
|
1133
953
|
}
|
|
1134
|
-
declare
|
|
1135
|
-
|
|
954
|
+
declare const WpEntityConnector: (entityName: string, props?: Omit<EntityConnectorProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
955
|
+
|
|
956
|
+
interface EntityConverterProps {
|
|
957
|
+
entityName: string;
|
|
1136
958
|
}
|
|
959
|
+
declare const WpEntityConverter: (entityName: string, props?: Omit<EntityConverterProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1137
960
|
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
contentType: string;
|
|
1141
|
-
fileName: string;
|
|
1142
|
-
folderPath: string;
|
|
1143
|
-
metadata?: Record<string, any>;
|
|
1144
|
-
};
|
|
1145
|
-
type FileDownloadUrl = {
|
|
1146
|
-
downloadUrl: string;
|
|
1147
|
-
contentType: string;
|
|
1148
|
-
fileName: string;
|
|
1149
|
-
};
|
|
1150
|
-
type FileReference = {
|
|
1151
|
-
fileId: string;
|
|
1152
|
-
reference: string;
|
|
1153
|
-
providerId: string;
|
|
1154
|
-
};
|
|
1155
|
-
interface IFileManager {
|
|
1156
|
-
uploadFile(file: FileData): Promise<FileReference>;
|
|
1157
|
-
getFileContent(fileId: string): Promise<FileData>;
|
|
1158
|
-
getFileDownloadUrl(fileId: string): Promise<FileDownloadUrl>;
|
|
961
|
+
interface EmailTemplateProps {
|
|
962
|
+
templateId: string;
|
|
1159
963
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
964
|
+
declare const WpEmailTemplate: (templateId: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
965
|
+
interface EmailProviderProps {
|
|
1162
966
|
providerId: string;
|
|
1163
|
-
metadata?: Record<string, any>;
|
|
1164
|
-
fileName: string;
|
|
1165
|
-
filePath: string;
|
|
1166
|
-
fileSize: number;
|
|
1167
|
-
contentType: string;
|
|
1168
|
-
};
|
|
1169
|
-
type FileReferenceRecord = FilesReferenceData & {
|
|
1170
|
-
fileId: string;
|
|
1171
|
-
createdOn: Date;
|
|
1172
|
-
updatedOn: Date;
|
|
1173
|
-
};
|
|
1174
|
-
interface IFilesReferenceRepository {
|
|
1175
|
-
getReference(fileId: string): Promise<FileReferenceRecord>;
|
|
1176
|
-
createReference(file: FilesReferenceData): Promise<FileReferenceRecord>;
|
|
1177
|
-
updateReference(fileId: string, file: FilesReferenceData): Promise<FileReferenceRecord>;
|
|
1178
|
-
deleteReference(fileId: string): Promise<void>;
|
|
1179
967
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
};
|
|
1183
|
-
type FileProviderUploadData = {
|
|
1184
|
-
fileName: string;
|
|
1185
|
-
content: Buffer;
|
|
1186
|
-
contentType: string;
|
|
1187
|
-
};
|
|
1188
|
-
type FileProviderDownloadData = {
|
|
1189
|
-
content: Buffer;
|
|
1190
|
-
};
|
|
1191
|
-
type FileProviderDownloadUrl = {
|
|
1192
|
-
downloadUrl: string;
|
|
1193
|
-
};
|
|
1194
|
-
interface IFileProvider {
|
|
1195
|
-
getProviderId(): string;
|
|
1196
|
-
uploadFile(file: FileProviderUploadData): Promise<FileProviderReference>;
|
|
1197
|
-
deleteFile(reference: FileProviderReference): Promise<void>;
|
|
1198
|
-
downloadFile(reference: FileProviderReference): Promise<FileProviderDownloadData>;
|
|
1199
|
-
getFileProviderDownloadUrl(reference: FileProviderReference): Promise<FileProviderDownloadUrl>;
|
|
968
|
+
declare const WpEmailProvider: (providerId: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
969
|
+
interface EmailLoggerProps {
|
|
1200
970
|
}
|
|
971
|
+
declare const WpEmailLogger: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1201
972
|
|
|
1202
|
-
type
|
|
1203
|
-
|
|
1204
|
-
type LocalizedMap<T> = {
|
|
1205
|
-
[key: string]: T;
|
|
973
|
+
type EntityVersioningOptions = {
|
|
974
|
+
enabled: boolean;
|
|
1206
975
|
};
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
type: string;
|
|
1211
|
-
payload?: TPayload;
|
|
1212
|
-
userId?: string;
|
|
1213
|
-
userName?: string;
|
|
1214
|
-
timestamp: Date;
|
|
1215
|
-
}
|
|
1216
|
-
interface IEventsTracker<TEventLog extends IEventLog<unknown>> {
|
|
1217
|
-
track(log: TEventLog): Promise<void>;
|
|
976
|
+
interface EntityProps {
|
|
977
|
+
name: string;
|
|
978
|
+
versioning?: EntityVersioningOptions;
|
|
1218
979
|
}
|
|
980
|
+
declare const WpEntity: (name: string, props?: Omit<EntityProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1219
981
|
|
|
1220
|
-
interface
|
|
1221
|
-
|
|
1222
|
-
data: () => Partial<TEntity>;
|
|
982
|
+
interface FileProviderProps {
|
|
983
|
+
providerId: string;
|
|
1223
984
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
get priority(): number | undefined;
|
|
985
|
+
declare const WpFileProvider: (providerId: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
986
|
+
interface FileReferenceRepositoryProps {
|
|
1227
987
|
}
|
|
988
|
+
declare const WpFileReferenceRepository: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1228
989
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
execute(): Promise<void>;
|
|
1232
|
-
protected abstract getEntries(): Promise<IEntitySeedEntry<TEntity, TFindCondition>[]>;
|
|
1233
|
-
protected abstract exists(condition: TFindCondition): Promise<boolean>;
|
|
1234
|
-
protected abstract create(entity: Partial<TEntity>): Promise<void>;
|
|
1235
|
-
abstract get priority(): number | undefined;
|
|
990
|
+
interface AppInitializerProps {
|
|
991
|
+
priority?: number;
|
|
1236
992
|
}
|
|
993
|
+
declare const WpAppInitializer: (props?: AppInitializerProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1237
994
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
private readonly logger;
|
|
1241
|
-
protected readonly entityName: string;
|
|
1242
|
-
constructor(services: EntityServiceLocator<TEntity, TEntityId>);
|
|
1243
|
-
export(filters?: TEntitySearchParameters): Promise<TSheetItem[]>;
|
|
1244
|
-
import(items: TSheetItem[], payload?: TPayload): Promise<void>;
|
|
1245
|
-
parse(data: Buffer, format: EntitySerializationFormat): Promise<ImportEntry<TSheetItem, TEntityId>[]>;
|
|
1246
|
-
private parseCsv;
|
|
1247
|
-
private parseXlsx;
|
|
1248
|
-
private convertSheetRecord;
|
|
1249
|
-
private parseColumnValue;
|
|
1250
|
-
createSample(format: EntitySerializationFormat): Promise<EntityExportFile>;
|
|
1251
|
-
private buildSampleFile;
|
|
1252
|
-
serialize(data: TSheetItem[], format: EntitySerializationFormat): Promise<EntityExportFile>;
|
|
1253
|
-
protected abstract getDefinition(context: TContext): Promise<EntitySerializerSheetDefinition<TSheetItem>>;
|
|
1254
|
-
protected abstract loadEntities(filters?: TEntitySearchParameters): Promise<TEntity[]>;
|
|
1255
|
-
protected abstract convertToSheetItems(entities: TEntity[]): Promise<TSheetItem[]>;
|
|
1256
|
-
protected abstract importItem(item: TSheetItem, context: TContext, payload?: TPayload): Promise<EntityReference<TEntityId>>;
|
|
1257
|
-
protected getContext(): Promise<TContext>;
|
|
1258
|
-
private buildExportFile;
|
|
1259
|
-
private getColumnValue;
|
|
1260
|
-
private buildExportFileName;
|
|
995
|
+
interface EntityRepositoryProps {
|
|
996
|
+
entityName: string;
|
|
1261
997
|
}
|
|
998
|
+
declare const WpEntityRepository: (entityName: string, props?: Omit<EntityRepositoryProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1262
999
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
constructor(entityName: string);
|
|
1266
|
-
abstract getSnapshot(id: TEntityId): Promise<TEntitySnapshot>;
|
|
1000
|
+
interface EntityManagerProps {
|
|
1001
|
+
entityName: string;
|
|
1267
1002
|
}
|
|
1003
|
+
declare const WpEntityManager: (entityName: string, props?: Omit<EntityManagerProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1268
1004
|
|
|
1269
|
-
|
|
1005
|
+
interface EntityQueryBuilderProps {
|
|
1006
|
+
entityName: string;
|
|
1007
|
+
}
|
|
1008
|
+
declare const WpEntityQueryBuilder: (entityName: string, props?: Omit<EntityQueryBuilderProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1270
1009
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
}) => EntitiesImportInput<TPayload>;
|
|
1010
|
+
interface PipelineTemplateProps {
|
|
1011
|
+
name: string;
|
|
1012
|
+
}
|
|
1013
|
+
declare const WpPipeline: (name: string, props?: Omit<PipelineTemplateProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1276
1014
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
};
|
|
1015
|
+
interface EntitySeederProps {
|
|
1016
|
+
entityName: string;
|
|
1017
|
+
priority?: number;
|
|
1018
|
+
}
|
|
1019
|
+
declare const WpEntitySeeder: (entityName: string, props?: Omit<EntitySeederProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1283
1020
|
|
|
1284
|
-
interface
|
|
1285
|
-
|
|
1286
|
-
to?: string[];
|
|
1287
|
-
cc?: string[];
|
|
1288
|
-
bcc?: string[];
|
|
1289
|
-
subject?: string;
|
|
1290
|
-
body?: string;
|
|
1291
|
-
payload?: any;
|
|
1292
|
-
request?: any;
|
|
1021
|
+
interface EntitySerializerProps {
|
|
1022
|
+
entityName: string;
|
|
1293
1023
|
}
|
|
1024
|
+
declare const WpEntitySerializer: (entityName: string, props?: Omit<EntitySerializerProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1294
1025
|
|
|
1295
|
-
interface
|
|
1296
|
-
|
|
1297
|
-
instance: string;
|
|
1298
|
-
key: string;
|
|
1299
|
-
data: any;
|
|
1300
|
-
createdOn: Date;
|
|
1301
|
-
updatedOn: Date;
|
|
1302
|
-
expirationTime: Date;
|
|
1026
|
+
interface EntitySnapshotServiceProps {
|
|
1027
|
+
entityName: string;
|
|
1303
1028
|
}
|
|
1029
|
+
declare const WpEntitySnapshotService: (entityName: string, props?: Omit<EntitySnapshotServiceProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1304
1030
|
|
|
1305
|
-
declare
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1031
|
+
declare const EntityManagerSymbols: {
|
|
1032
|
+
GlobalAuthenticationMiddleware: symbol;
|
|
1033
|
+
AppInitializer: symbol;
|
|
1034
|
+
EventsTracker: symbol;
|
|
1035
|
+
Entity: symbol;
|
|
1036
|
+
EntityActions: symbol;
|
|
1037
|
+
EntityAdapter: symbol;
|
|
1038
|
+
EntityAuthMiddleware: symbol;
|
|
1039
|
+
EntityRepository: symbol;
|
|
1040
|
+
EntityConnector: symbol;
|
|
1041
|
+
EntityConverter: symbol;
|
|
1042
|
+
EntitySerializer: symbol;
|
|
1043
|
+
EntitySnapshotService: symbol;
|
|
1044
|
+
EntityManager: symbol;
|
|
1045
|
+
EntityQueryBuilder: symbol;
|
|
1046
|
+
EntitySeeder: symbol;
|
|
1047
|
+
EntityVersioningProvider: symbol;
|
|
1048
|
+
EmailProvider: symbol;
|
|
1049
|
+
EmailTemplate: symbol;
|
|
1050
|
+
EmailLogger: symbol;
|
|
1051
|
+
BucketProvider: symbol;
|
|
1052
|
+
FileProvider: symbol;
|
|
1053
|
+
FileReferenceRepository: symbol;
|
|
1054
|
+
PipelineTemplate: symbol;
|
|
1055
|
+
CacheInstance: symbol;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
interface EventsTrackerProps {
|
|
1059
|
+
disabled?: boolean;
|
|
1324
1060
|
}
|
|
1061
|
+
declare const WpEventsTracker: (props?: EventsTrackerProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1325
1062
|
|
|
1326
|
-
|
|
1327
|
-
|
|
1063
|
+
interface EntityVersioningProviderProps {
|
|
1064
|
+
disabled?: boolean;
|
|
1328
1065
|
}
|
|
1066
|
+
declare const WpEntityVersioningProvider: (props?: EntityVersioningProviderProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1329
1067
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1068
|
+
interface DiscoveredModule<T = object> {
|
|
1069
|
+
name: string;
|
|
1070
|
+
instance: T;
|
|
1071
|
+
injectType?: Function | Type$1<any>;
|
|
1072
|
+
dependencyType: Type$1<T>;
|
|
1333
1073
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1074
|
+
interface DiscoveredClass extends DiscoveredModule {
|
|
1075
|
+
parentModule?: DiscoveredModule;
|
|
1076
|
+
}
|
|
1077
|
+
interface DiscoveredMethod {
|
|
1078
|
+
handler: (...args: any[]) => any;
|
|
1079
|
+
methodName: string;
|
|
1080
|
+
parentClass: DiscoveredClass;
|
|
1081
|
+
}
|
|
1082
|
+
interface DiscoveredMethodWithMeta<T> {
|
|
1083
|
+
discoveredMethod: DiscoveredMethod;
|
|
1084
|
+
meta: T;
|
|
1085
|
+
}
|
|
1086
|
+
interface DiscoveredClassWithMeta<T> {
|
|
1087
|
+
discoveredClass: DiscoveredClass;
|
|
1088
|
+
meta: T;
|
|
1089
|
+
}
|
|
1090
|
+
type MetaKey = string | number | symbol;
|
|
1091
|
+
type Filter<T> = (item: T) => boolean;
|
|
1092
|
+
declare class ModulesContainerProvider {
|
|
1093
|
+
private modulesContainer;
|
|
1094
|
+
setModulesContainer(modulesContainer: ModulesContainer): void;
|
|
1095
|
+
getModules(): [string, Module][];
|
|
1096
|
+
}
|
|
1097
|
+
declare class CustomDiscoveryService {
|
|
1098
|
+
private readonly modulesContainer;
|
|
1099
|
+
private readonly metadataScanner;
|
|
1100
|
+
private discoveredControllers?;
|
|
1101
|
+
private discoveredProviders?;
|
|
1102
|
+
constructor(modulesContainer: ModulesContainerProvider, metadataScanner: MetadataScanner);
|
|
1103
|
+
/**
|
|
1104
|
+
* Discovers all providers in a Nest App that match a filter
|
|
1105
|
+
* @param filter
|
|
1106
|
+
*/
|
|
1107
|
+
providers(filter: Filter<DiscoveredClass>): Promise<DiscoveredClass[]>;
|
|
1108
|
+
/**
|
|
1109
|
+
* Discovers all controller methods that either directly have a certain meta key attached to them
|
|
1110
|
+
* or belong to a controller that has the same meta key attached to them
|
|
1111
|
+
* @param metaKey The meta key to scan for
|
|
1112
|
+
* @param metaFilter An optional filter for the contents of the meta object
|
|
1113
|
+
*/
|
|
1114
|
+
methodsAndControllerMethodsWithMetaAtKey<T>(metaKey: MetaKey, metaFilter?: Filter<T>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Discovers all providers in an App that have meta at a specific key and returns the provider(s) and associated meta
|
|
1117
|
+
* @param metaKey The metakey to scan for
|
|
1118
|
+
*/
|
|
1119
|
+
providersWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T>[]>;
|
|
1120
|
+
providerWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T> | undefined>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Discovers all controllers in a Nest App that match a filter
|
|
1123
|
+
* @param filter
|
|
1124
|
+
*/
|
|
1125
|
+
controllers(filter: Filter<DiscoveredClass>): Promise<DiscoveredClass[]>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Discovers all controllers in an App that have meta at a specific key and returns the controller(s) and associated meta
|
|
1128
|
+
* @param metaKey The metakey to scan for
|
|
1129
|
+
*/
|
|
1130
|
+
controllersWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T>[]>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Discovers all method handlers matching a particular metakey from a Provider or Controller
|
|
1133
|
+
* @param component
|
|
1134
|
+
* @param metaKey
|
|
1135
|
+
*/
|
|
1136
|
+
classMethodsWithMetaAtKey<T>(component: DiscoveredClass, metaKey: MetaKey): DiscoveredMethodWithMeta<T>[];
|
|
1137
|
+
/**
|
|
1138
|
+
* Discovers all the methods that exist on providers in a Nest App that contain metadata under a specific key
|
|
1139
|
+
* @param metaKey The metakey to scan for
|
|
1140
|
+
* @param providerFilter A predicate used to limit the providers being scanned. Defaults to all providers in the app module
|
|
1141
|
+
*/
|
|
1142
|
+
providerMethodsWithMetaAtKey<T>(metaKey: MetaKey, providerFilter?: Filter<DiscoveredClass>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Discovers all the methods that exist on controllers in a Nest App that contain metadata under a specific key
|
|
1145
|
+
* @param metaKey The metakey to scan for
|
|
1146
|
+
* @param controllerFilter A predicate used to limit the controllers being scanned. Defaults to all providers in the app module
|
|
1147
|
+
*/
|
|
1148
|
+
controllerMethodsWithMetaAtKey<T>(metaKey: MetaKey, controllerFilter?: Filter<DiscoveredClass>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1149
|
+
private toDiscoveredClass;
|
|
1150
|
+
private extractMethodMetaAtKey;
|
|
1151
|
+
private discover;
|
|
1152
|
+
private getModuleEntries;
|
|
1349
1153
|
}
|
|
1350
1154
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1155
|
+
declare class EntityManagerRegistry {
|
|
1156
|
+
private readonly container;
|
|
1157
|
+
getContainer(): IEntityManagerServiceRoot;
|
|
1158
|
+
registerGlobalServices({ eventEmitter, }: {
|
|
1159
|
+
eventEmitter?: IEventEmitter;
|
|
1160
|
+
}): Promise<void>;
|
|
1161
|
+
registerDiscoveredEntity(app: INestApplicationContext, { adapter, entityName, entity, converter, queryBuilder, repository, authMiddleware, serializer, snapshotService, settings, }: {
|
|
1162
|
+
entityName: string;
|
|
1163
|
+
entity: DiscoveredClassWithMeta<EntityProps>;
|
|
1164
|
+
repository: DiscoveredClassWithMeta<EntityRepositoryProps>;
|
|
1165
|
+
converter: DiscoveredClassWithMeta<EntityConverterProps>;
|
|
1166
|
+
adapter: DiscoveredClassWithMeta<EntityAdapterProps>;
|
|
1167
|
+
queryBuilder: DiscoveredClassWithMeta<EntityQueryBuilderProps>;
|
|
1168
|
+
serializer: DiscoveredClassWithMeta<EntitySerializerProps>;
|
|
1169
|
+
snapshotService?: DiscoveredClassWithMeta<EntitySnapshotServiceProps>;
|
|
1170
|
+
authMiddleware?: DiscoveredClassWithMeta<EntityAuthMiddlewareProps>;
|
|
1171
|
+
settings: EntityManagerSettings;
|
|
1172
|
+
}): Promise<void>;
|
|
1173
|
+
resolveEntityServicesCollection<TEntity>(entityName: string): EntityServiceLocator<TEntity, unknown>;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
declare abstract class NestEntityActions<TEntity, TEntityId, TEntityCreateDto, TEntityUpdateDto, TEntityDto, TEntityListItemDto, TEntitiesDeleteParameters extends IEntitiesDeleteParameters<TSorting>, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets> {
|
|
1177
|
+
protected readonly services: EntityServiceLocator<TEntity, unknown>;
|
|
1178
|
+
private actionsInstance;
|
|
1179
|
+
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
1180
|
+
protected get converter(): IEntityConverter<TEntity, TEntityDto, TEntityListItemDto, TEntityCreateDto, TEntityUpdateDto> | undefined;
|
|
1181
|
+
get manager(): IEntityActions<TEntity, TEntityId, TEntityCreateDto, TEntityUpdateDto, TEntityDto, TEntityListItemDto, TEntitiesDeleteParameters, TEntitySearchParameters, TSorting, TCursor, TFacets>;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
declare abstract class NestEntityManager<TEntity, TEntityId, TEntityCreateData, TEntityUpdateData, TEntitiesDeleteParameters extends IEntitiesDeleteParameters<TSorting>, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets> {
|
|
1185
|
+
protected readonly services: EntityServiceLocator<TEntity, unknown>;
|
|
1186
|
+
private managerInstance;
|
|
1187
|
+
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
1188
|
+
get manager(): IEntityManager<TEntity, TEntityId, TEntityCreateData, TEntityUpdateData, TEntitiesDeleteParameters, TEntitySearchParameters, TSorting, TCursor, TFacets>;
|
|
1189
|
+
getRepository<TRepository extends IEntityRepository<TEntity, TEntityId, unknown, unknown, unknown, unknown>>(): TRepository;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
declare abstract class EntitySerializer<TEntity, TEntityId, TEntitySearchParameters, TSheetItem, TContext, TPayload = unknown> implements IEntitySerializer<TEntity, TEntityId, TEntitySearchParameters, TSheetItem> {
|
|
1193
|
+
protected readonly services: EntityServiceLocator<TEntity, TEntityId>;
|
|
1355
1194
|
private readonly logger;
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1195
|
+
protected readonly entityName: string;
|
|
1196
|
+
constructor(services: EntityServiceLocator<TEntity, TEntityId>);
|
|
1197
|
+
export(filters?: TEntitySearchParameters): Promise<TSheetItem[]>;
|
|
1198
|
+
import(items: TSheetItem[], payload?: TPayload): Promise<void>;
|
|
1199
|
+
parse(data: Buffer, format: EntitySerializationFormat): Promise<ImportEntry<TSheetItem, TEntityId>[]>;
|
|
1200
|
+
private parseCsv;
|
|
1201
|
+
private parseXlsx;
|
|
1202
|
+
private convertSheetRecord;
|
|
1203
|
+
private parseColumnValue;
|
|
1204
|
+
createSample(format: EntitySerializationFormat): Promise<EntityExportFile>;
|
|
1205
|
+
private buildSampleFile;
|
|
1206
|
+
serialize(data: TSheetItem[], format: EntitySerializationFormat): Promise<EntityExportFile>;
|
|
1207
|
+
protected abstract getDefinition(context: TContext): Promise<EntitySerializerSheetDefinition<TSheetItem>>;
|
|
1208
|
+
protected abstract loadEntities(filters?: TEntitySearchParameters): Promise<TEntity[]>;
|
|
1209
|
+
protected abstract convertToSheetItems(entities: TEntity[]): Promise<TSheetItem[]>;
|
|
1210
|
+
protected abstract importItem(item: TSheetItem, context: TContext, payload?: TPayload): Promise<EntityReference<TEntityId>>;
|
|
1211
|
+
protected getContext(): Promise<TContext>;
|
|
1212
|
+
private buildExportFile;
|
|
1213
|
+
private getColumnValue;
|
|
1214
|
+
private buildExportFileName;
|
|
1375
1215
|
}
|
|
1376
1216
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1217
|
+
declare abstract class NestEntitySerializer<TEntity, TEntityId, TEntityCreateData, TEntityUpdateData, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TSheetItem, TContext, TPayload = unknown> extends EntitySerializer<TEntity, TEntityId, TEntitySearchParameters, TSheetItem, TContext, TPayload> {
|
|
1218
|
+
private readonly registry;
|
|
1219
|
+
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
1220
|
+
protected get manager(): IEntityManager<TEntity, TEntityId, TEntityCreateData, TEntityUpdateData, any, TEntitySearchParameters, TSorting, TCursor, any>;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
declare abstract class EntitySnapshotService<TEntityId, TEntitySnapshot> implements IEntitySnapshotService<TEntityId, TEntitySnapshot> {
|
|
1224
|
+
protected readonly entityName: string;
|
|
1225
|
+
constructor(entityName: string);
|
|
1226
|
+
abstract getSnapshot(id: TEntityId): Promise<TEntitySnapshot>;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
declare abstract class NestEntitySnapshotService<TEntity, TEntityId, TEntityRepository, TEntitySnapshot> extends EntitySnapshotService<TEntityId, TEntitySnapshot> {
|
|
1230
|
+
protected readonly services: EntityServiceLocator<TEntity, unknown>;
|
|
1231
|
+
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
1232
|
+
get repository(): TEntityRepository;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
interface IAuthService {
|
|
1236
|
+
}
|
|
1237
|
+
interface IAuthRole {
|
|
1238
|
+
id: string;
|
|
1239
|
+
uid: string;
|
|
1240
|
+
name: string;
|
|
1241
|
+
}
|
|
1242
|
+
interface IAuthPermission {
|
|
1243
|
+
id: string;
|
|
1244
|
+
uid: string;
|
|
1245
|
+
name: string;
|
|
1246
|
+
}
|
|
1247
|
+
interface IAuthOrganizationalUnit {
|
|
1248
|
+
id: string;
|
|
1249
|
+
uid: string;
|
|
1250
|
+
name: string;
|
|
1251
|
+
}
|
|
1252
|
+
interface IAuthUserProfile {
|
|
1253
|
+
firstName: string;
|
|
1254
|
+
lastName: string;
|
|
1255
|
+
}
|
|
1256
|
+
interface IAuthUserTenant {
|
|
1257
|
+
id: string;
|
|
1258
|
+
uid: string;
|
|
1259
|
+
name: string;
|
|
1260
|
+
}
|
|
1261
|
+
interface IAuthUserOrganization {
|
|
1262
|
+
id: string;
|
|
1263
|
+
uid: string;
|
|
1264
|
+
name: string;
|
|
1265
|
+
tenant: IAuthUserTenant;
|
|
1266
|
+
}
|
|
1267
|
+
interface IAuthUser {
|
|
1268
|
+
id: string;
|
|
1269
|
+
passwordHash: string;
|
|
1270
|
+
passwordUpdateTimestamp?: Date;
|
|
1271
|
+
temporaryPassword: boolean;
|
|
1272
|
+
userName: string;
|
|
1273
|
+
email: string;
|
|
1274
|
+
verified: boolean;
|
|
1275
|
+
verifiedTimestamp?: Date;
|
|
1276
|
+
disabled: boolean;
|
|
1277
|
+
profile: IAuthUserProfile;
|
|
1278
|
+
organization?: IAuthUserOrganization;
|
|
1279
|
+
}
|
|
1280
|
+
interface IAuthUserContext {
|
|
1281
|
+
organizationUid?: string;
|
|
1282
|
+
}
|
|
1283
|
+
interface IAuthUserTokenData<TContext extends IAuthUserContext> {
|
|
1284
|
+
userId: string;
|
|
1285
|
+
email: string;
|
|
1286
|
+
context?: TContext;
|
|
1287
|
+
}
|
|
1288
|
+
interface IAuthUserService<TUser extends IAuthUser, TUserContext extends IAuthUserContext, TUserRegistrationInfo> {
|
|
1289
|
+
getById(id: string): Promise<TUser>;
|
|
1290
|
+
getByEmail(email: string, context?: TUserContext): Promise<TUser>;
|
|
1291
|
+
getByUserName(userName: string, context?: TUserContext): Promise<TUser>;
|
|
1292
|
+
update(id: string, data: Partial<TUser>): Promise<void>;
|
|
1293
|
+
delete(id: string): Promise<void>;
|
|
1294
|
+
create(email: string, userName: string, data: TUserRegistrationInfo, context?: TUserContext): Promise<TUser>;
|
|
1295
|
+
}
|
|
1296
|
+
interface IAuthRoleService<TRole extends IAuthRole, TPermission extends IAuthPermission> {
|
|
1297
|
+
create(data: Partial<TRole>): Promise<TRole>;
|
|
1298
|
+
update(id: string, data: Partial<TRole>): Promise<void>;
|
|
1299
|
+
ensure(uid: string, data: Partial<Omit<TRole, "uid">>): Promise<TRole>;
|
|
1300
|
+
delete(id: string): Promise<void>;
|
|
1301
|
+
getById(id: string): Promise<TRole | undefined>;
|
|
1302
|
+
getByUid(uid: string): Promise<TRole | undefined>;
|
|
1303
|
+
addPermission(uid: string, permissionUid: string): Promise<void>;
|
|
1304
|
+
removePermission(uid: string, permissionUid: string): Promise<void>;
|
|
1305
|
+
getPermissions(uid: string): Promise<TPermission[]>;
|
|
1306
|
+
}
|
|
1307
|
+
interface IAuthPermissionService<TPermission extends IAuthPermission> {
|
|
1308
|
+
create(data: Partial<TPermission>): Promise<TPermission>;
|
|
1309
|
+
update(id: string, data: Partial<TPermission>): Promise<void>;
|
|
1310
|
+
ensure(uid: string, data: Partial<Omit<TPermission, "uid">>): Promise<TPermission>;
|
|
1311
|
+
delete(id: string): Promise<void>;
|
|
1312
|
+
getById(id: string): Promise<TPermission | undefined>;
|
|
1313
|
+
getByUid(uid: string): Promise<TPermission | undefined>;
|
|
1314
|
+
}
|
|
1315
|
+
interface IAuthUserRolesService<TUser extends IAuthUser, TRole extends IAuthRole, TPermission extends IAuthPermission, TOrganizationalUnit extends IAuthOrganizationalUnit> {
|
|
1316
|
+
getRoleUsers(roleId: string): Promise<TUser[]>;
|
|
1317
|
+
getUserRoles(userId: string): Promise<TRole[]>;
|
|
1318
|
+
getUserPermissions(userId: string): Promise<TPermission[]>;
|
|
1319
|
+
getUserOrganizationalUnits(userId: string): Promise<TOrganizationalUnit[]>;
|
|
1320
|
+
addUserToRole(userId: string, roleId: string): Promise<void>;
|
|
1321
|
+
addUserToRoleByUid(userId: string, roleUid: string): Promise<void>;
|
|
1322
|
+
removeUserFromRole(userId: string, roleId: string): Promise<void>;
|
|
1323
|
+
removeUserFromRoleByUid(userId: string, roleUid: string): Promise<void>;
|
|
1324
|
+
clearUserRoles(userId: string): Promise<void>;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
type CurrentUserData = {
|
|
1328
|
+
user: IAuthUser;
|
|
1329
|
+
roles: IAuthRole[];
|
|
1330
|
+
permissions: IAuthPermission[];
|
|
1331
|
+
organizationalUnits: IAuthOrganizationalUnit[];
|
|
1384
1332
|
};
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
notLike?: string;
|
|
1333
|
+
declare const CurrentUser: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
1334
|
+
|
|
1335
|
+
interface AuthenticationModuleSettings {
|
|
1336
|
+
passwordSalt: string;
|
|
1337
|
+
jwtSecret: string;
|
|
1338
|
+
}
|
|
1339
|
+
type UserPasswordResetTokenPayload = {
|
|
1340
|
+
userId: string;
|
|
1341
|
+
email: string;
|
|
1342
|
+
timestamp: number;
|
|
1396
1343
|
};
|
|
1397
|
-
type
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1344
|
+
type EmailVerifyTokenPayload = {
|
|
1345
|
+
userId: string;
|
|
1346
|
+
email: string;
|
|
1347
|
+
timestamp: number;
|
|
1348
|
+
};
|
|
1349
|
+
declare enum UserRegistrationError {
|
|
1350
|
+
UserAlreadyExists = "userAlreadyExists"
|
|
1351
|
+
}
|
|
1352
|
+
type AppRole = {
|
|
1353
|
+
uid: string;
|
|
1354
|
+
name: string;
|
|
1355
|
+
};
|
|
1356
|
+
type AppPermission = {
|
|
1357
|
+
uid: string;
|
|
1358
|
+
name: string;
|
|
1359
|
+
};
|
|
1360
|
+
type RolesGuardOptions = {
|
|
1361
|
+
exact?: boolean;
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
declare const Public: () => _nestjs_common.CustomDecorator<string>;
|
|
1365
|
+
declare const Authenticated: () => _nestjs_common.CustomDecorator<string>;
|
|
1366
|
+
declare const Permissions: (...permissions: string[]) => _nestjs_common.CustomDecorator<string>;
|
|
1367
|
+
declare const Roles: (...roles: string[]) => _nestjs_common.CustomDecorator<string>;
|
|
1368
|
+
declare const MemberOf: (...groups: string[]) => _nestjs_common.CustomDecorator<string>;
|
|
1369
|
+
declare const buildRolesGuard: ({ mainRole, secondaryRoles, }: {
|
|
1370
|
+
mainRole: AppRole;
|
|
1371
|
+
secondaryRoles?: AppRole[] | undefined;
|
|
1372
|
+
}, options?: RolesGuardOptions) => _nestjs_common.CustomDecorator<string>;
|
|
1373
|
+
declare const buildPermissionsGuard: ({ permissions, }: {
|
|
1374
|
+
permissions: AppPermission[];
|
|
1375
|
+
}) => _nestjs_common.CustomDecorator<string>;
|
|
1376
|
+
|
|
1377
|
+
declare const WpPermissionsService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1378
|
+
|
|
1379
|
+
declare const AuthenticationExtensionSymbols: {
|
|
1380
|
+
UserService: symbol;
|
|
1381
|
+
RolesService: symbol;
|
|
1382
|
+
PermissionsService: symbol;
|
|
1383
|
+
UserRolesService: symbol;
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
declare const WpRolesService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1387
|
+
|
|
1388
|
+
declare const WpUserService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1389
|
+
|
|
1390
|
+
declare const WpUserRolesService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1391
|
+
|
|
1392
|
+
declare const AuthenticationEmailTemplates: {
|
|
1393
|
+
Registration: string;
|
|
1394
|
+
PasswordReset: string;
|
|
1395
|
+
EmailVerify: string;
|
|
1396
|
+
};
|
|
1397
|
+
type RegistrationEmailPayload = {
|
|
1398
|
+
firstName: string;
|
|
1399
|
+
lastName: string;
|
|
1400
|
+
callbackUrl: string;
|
|
1402
1401
|
};
|
|
1403
|
-
type
|
|
1404
|
-
|
|
1405
|
-
|
|
1402
|
+
type EmailVerifyEmailPayload = {
|
|
1403
|
+
firstName: string;
|
|
1404
|
+
lastName: string;
|
|
1405
|
+
callbackUrl: string;
|
|
1406
1406
|
};
|
|
1407
|
-
type
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
gte?: Date;
|
|
1412
|
-
lt?: Date;
|
|
1413
|
-
lte?: Date;
|
|
1407
|
+
type PasswordResetEmailPayload = {
|
|
1408
|
+
firstName: string;
|
|
1409
|
+
lastName: string;
|
|
1410
|
+
callbackUrl: string;
|
|
1414
1411
|
};
|
|
1415
1412
|
|
|
1416
|
-
declare class
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1413
|
+
declare class AuthenticationError extends Error {
|
|
1414
|
+
constructor(message: string);
|
|
1415
|
+
}
|
|
1416
|
+
declare class InvalidCredentialsError extends AuthenticationError {
|
|
1417
|
+
constructor(message: string);
|
|
1418
|
+
}
|
|
1419
|
+
declare class OperationTokenMismatchError extends AuthenticationError {
|
|
1420
|
+
constructor(message: string);
|
|
1422
1421
|
}
|
|
1423
1422
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1423
|
+
declare const AUTHENTICATION_EVENTS_NAMESPACE = "authentication";
|
|
1424
|
+
declare const AuthenticationEvents: {
|
|
1425
|
+
UserLogin: string;
|
|
1426
|
+
UserRegistrationStarted: string;
|
|
1427
|
+
UserRegistrationCompleted: string;
|
|
1428
|
+
UserPasswordResetStarted: string;
|
|
1429
|
+
UserPasswordResetCompleted: string;
|
|
1430
1430
|
};
|
|
1431
|
-
type StringFacetsType = FacetType<string>;
|
|
1432
|
-
type NumberFacetsType = FacetType<number>;
|
|
1433
|
-
type BooleanFacetsType = FacetType<boolean>;
|
|
1434
1431
|
|
|
1435
|
-
type
|
|
1436
|
-
|
|
1437
|
-
|
|
1432
|
+
type UserProfile = {
|
|
1433
|
+
firstName: string;
|
|
1434
|
+
lastName: string;
|
|
1435
|
+
};
|
|
1436
|
+
type UserLoginEventPayload = {
|
|
1437
|
+
userId: string;
|
|
1438
|
+
email: string;
|
|
1439
|
+
profile: UserProfile;
|
|
1440
|
+
};
|
|
1441
|
+
type UserRegistrationStartedEventPayload = {
|
|
1442
|
+
email: string;
|
|
1443
|
+
profile: UserProfile;
|
|
1444
|
+
};
|
|
1445
|
+
type UserRegistrationCompletedEventPayload = {
|
|
1446
|
+
userId: string;
|
|
1447
|
+
email: string;
|
|
1448
|
+
profile: UserProfile;
|
|
1449
|
+
};
|
|
1450
|
+
type UserPasswordResetStartedEventPayload = {
|
|
1451
|
+
email: string;
|
|
1452
|
+
};
|
|
1453
|
+
type UserPasswordResetCompletedEventPayload = {
|
|
1454
|
+
userId: string;
|
|
1455
|
+
email: string;
|
|
1456
|
+
profile: UserProfile;
|
|
1457
|
+
};
|
|
1438
1458
|
|
|
1439
|
-
declare class
|
|
1440
|
-
|
|
1459
|
+
declare class AuthGuard implements CanActivate {
|
|
1460
|
+
private reflector;
|
|
1461
|
+
private readonly logger;
|
|
1462
|
+
constructor(reflector: Reflector);
|
|
1463
|
+
canActivate(context: ExecutionContext): boolean;
|
|
1464
|
+
private isRoleMatching;
|
|
1465
|
+
private isPermissionMatching;
|
|
1466
|
+
private getIsForAllAuthenticated;
|
|
1467
|
+
private getIsPublic;
|
|
1468
|
+
private getAllowedRoles;
|
|
1469
|
+
private getAllowedPermissions;
|
|
1470
|
+
private getCurrentAuth;
|
|
1471
|
+
private getMetadata;
|
|
1472
|
+
private getContextInfo;
|
|
1441
1473
|
}
|
|
1442
1474
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
};
|
|
1446
|
-
declare abstract class TypeOrmQueryBuilder<TEntity extends ObjectLiteral, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, number>, TSorting extends SortingType, TFacets extends IEntityFacets, TUserContext> extends QueryBuilderBase<TEntity, TEntityId, TEntitySearchParameters, TSorting, number, TFacets, TUserContext> {
|
|
1447
|
-
private readonly services;
|
|
1448
|
-
private repository;
|
|
1449
|
-
protected clause: QueryClauseBuilder;
|
|
1450
|
-
protected permissions: PermissionsChecker<TUserContext>;
|
|
1451
|
-
constructor(services: EntityServiceLocator<TEntity, unknown>);
|
|
1452
|
-
get(id: TEntityId, context?: IAuthenticationContext<TUserContext>): Promise<TEntity | undefined>;
|
|
1453
|
-
exists(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<boolean>;
|
|
1454
|
-
count(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<number>;
|
|
1455
|
-
delete(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<IEntitiesDeleteResult>;
|
|
1456
|
-
find(request: {
|
|
1457
|
-
filters?: TEntitySearchParameters["filters"];
|
|
1458
|
-
sorting?: TEntitySearchParameters["sorting"];
|
|
1459
|
-
}, context?: IAuthenticationContext<TUserContext>): Promise<TEntity>;
|
|
1460
|
-
search(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<IEntitiesSearchResults<TEntity, TEntitySearchParameters, TEntity, TSorting, number, TFacets>>;
|
|
1461
|
-
protected getFieldDistinctValues<T>(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined): Promise<T[]>;
|
|
1462
|
-
protected findPagedQueryResults(request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined): Promise<TEntity[]>;
|
|
1463
|
-
protected getRelationsToLoad(request: TEntitySearchParameters | undefined, context: IAuthenticationContext<TUserContext> | undefined, operation: QueryBuilderOperation): FindOptionsRelations<TEntity> | undefined;
|
|
1464
|
-
protected buildPagingParameters(request: TEntitySearchParameters): {
|
|
1465
|
-
skip: number | undefined;
|
|
1466
|
-
take: number | undefined;
|
|
1467
|
-
};
|
|
1468
|
-
protected countQueryResults(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<number>;
|
|
1469
|
-
protected abstract buildSortingClause(request: TEntitySearchParameters): FindOptionsOrder<TEntity>;
|
|
1470
|
-
protected abstract buildWhereClause(request: TEntitySearchParameters): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
1471
|
-
protected buildTextSearchClause(request: TEntitySearchParameters): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
1472
|
-
protected abstract buildContextFilter(context?: IAuthenticationContext<TUserContext>): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
1473
|
-
protected abstract calculateFacets(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<TFacets>;
|
|
1474
|
-
protected calculateChildrenMap(items: TEntity[]): Promise<ChildrenMap>;
|
|
1475
|
-
protected queryChildrenMap<TField extends keyof TEntity>({ nodeIds, idField, parentField, }: {
|
|
1476
|
-
nodeIds: string[];
|
|
1477
|
-
idField: TField;
|
|
1478
|
-
parentField: TField;
|
|
1479
|
-
}): Promise<ChildrenMap>;
|
|
1480
|
-
protected calculateFacet<TField extends keyof TEntity, TValue>(field: TField, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<FacetType<TValue>>;
|
|
1481
|
-
protected calculateStringFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<StringFacetsType>;
|
|
1482
|
-
protected calculateNumericFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<NumberFacetsType>;
|
|
1483
|
-
protected calculateBooleanFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<BooleanFacetsType>;
|
|
1484
|
-
protected getRepository(): TypeOrmRepository<TEntity, unknown>;
|
|
1485
|
-
private buildSearchRelations;
|
|
1486
|
-
private buildWhere;
|
|
1487
|
-
private mergeWhereClauses;
|
|
1488
|
-
private mergeWheres;
|
|
1475
|
+
declare enum UserCreationError {
|
|
1476
|
+
UserAlreadyExists = "userAlreadyExists"
|
|
1489
1477
|
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
abstract canDelete(entity: Partial<TEntity>, context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
1497
|
-
abstract canDeleteItems(context: TAuthenticationContext): Promise<IAuthorizationResult>;
|
|
1478
|
+
interface UserCreationInput<TUserRegistrationInfo, TUserContext extends IAuthUserContext> {
|
|
1479
|
+
email: string;
|
|
1480
|
+
userName: string;
|
|
1481
|
+
password: string;
|
|
1482
|
+
registrationInfo: TUserRegistrationInfo;
|
|
1483
|
+
context?: TUserContext;
|
|
1498
1484
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1485
|
+
interface UserCreationResult {
|
|
1486
|
+
success: boolean;
|
|
1487
|
+
error?: UserCreationError;
|
|
1488
|
+
userId?: string;
|
|
1502
1489
|
}
|
|
1503
|
-
declare const WpEntityAuthMiddleware: (entityName: string, props?: Omit<EntityAuthMiddlewareProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1504
1490
|
|
|
1505
|
-
interface
|
|
1506
|
-
|
|
1507
|
-
weight?: number;
|
|
1491
|
+
interface UserDisableInput {
|
|
1492
|
+
userId: string;
|
|
1508
1493
|
}
|
|
1509
|
-
declare const WpGlobalAuthenticationMiddleware: (name: string, props?: Omit<GlobalAuthenticationMiddlewareProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1510
1494
|
|
|
1511
|
-
interface
|
|
1512
|
-
|
|
1495
|
+
interface UserDeleteInput {
|
|
1496
|
+
userId: string;
|
|
1513
1497
|
}
|
|
1514
|
-
declare const WpBucketProvider: (providerId: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1515
1498
|
|
|
1516
|
-
interface
|
|
1517
|
-
|
|
1499
|
+
interface UserEnableInput {
|
|
1500
|
+
userId: string;
|
|
1518
1501
|
}
|
|
1519
|
-
declare const WpCacheInstance: (instanceName: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1520
1502
|
|
|
1521
|
-
interface
|
|
1522
|
-
|
|
1503
|
+
interface UserLoginInput<TUserContext extends IAuthUserContext> {
|
|
1504
|
+
userName: string;
|
|
1505
|
+
password: string;
|
|
1506
|
+
context?: TUserContext;
|
|
1523
1507
|
}
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
entityName: string;
|
|
1508
|
+
interface UserLoginResult {
|
|
1509
|
+
token?: string;
|
|
1510
|
+
success: boolean;
|
|
1528
1511
|
}
|
|
1529
|
-
declare const WpEntityAdapter: (entityName: string, props?: Omit<EntityAdapterProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1530
1512
|
|
|
1531
|
-
interface
|
|
1532
|
-
|
|
1513
|
+
interface UserPasswordChangeInput {
|
|
1514
|
+
userId: string;
|
|
1515
|
+
newPassword: string;
|
|
1516
|
+
temporary: boolean;
|
|
1533
1517
|
}
|
|
1534
|
-
declare const WpEntityConnector: (entityName: string, props?: Omit<EntityConnectorProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1535
1518
|
|
|
1536
|
-
interface
|
|
1537
|
-
|
|
1519
|
+
interface UserPasswordResetCompleteInput {
|
|
1520
|
+
token: string;
|
|
1521
|
+
newPassword: string;
|
|
1522
|
+
temporary?: boolean;
|
|
1538
1523
|
}
|
|
1539
|
-
declare const WpEntityConverter: (entityName: string, props?: Omit<EntityConverterProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1540
1524
|
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
interface
|
|
1546
|
-
|
|
1525
|
+
type UserPasswordResetRequestCallbackTemplate = {
|
|
1526
|
+
urlTemplate: string;
|
|
1527
|
+
tokenPlaceholder: string;
|
|
1528
|
+
};
|
|
1529
|
+
interface UserPasswordResetRequestInput<TUserContext extends IAuthUserContext> {
|
|
1530
|
+
email: string;
|
|
1531
|
+
callback: UserPasswordResetRequestCallbackTemplate;
|
|
1532
|
+
languageCode: string;
|
|
1533
|
+
context?: TUserContext;
|
|
1547
1534
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1535
|
+
interface UserPasswordResetRequestResult {
|
|
1536
|
+
success: boolean;
|
|
1550
1537
|
}
|
|
1551
|
-
declare const WpEmailLogger: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1552
1538
|
|
|
1553
|
-
type
|
|
1554
|
-
|
|
1539
|
+
type UserRegisterCallbackTemplate = {
|
|
1540
|
+
urlTemplate: string;
|
|
1541
|
+
tokenPlaceholder: string;
|
|
1555
1542
|
};
|
|
1556
|
-
interface
|
|
1557
|
-
|
|
1558
|
-
|
|
1543
|
+
interface UserRegistrationInput<TUserRegistrationInfo, TUserContext extends IAuthUserContext> {
|
|
1544
|
+
email: string;
|
|
1545
|
+
userName: string;
|
|
1546
|
+
password: string;
|
|
1547
|
+
registrationInfo: TUserRegistrationInfo;
|
|
1548
|
+
callback: UserRegisterCallbackTemplate;
|
|
1549
|
+
languageCode: string;
|
|
1550
|
+
context?: TUserContext;
|
|
1551
|
+
}
|
|
1552
|
+
interface UserRegistrationResult {
|
|
1553
|
+
success: boolean;
|
|
1554
|
+
error?: UserRegistrationError;
|
|
1555
|
+
userId?: string;
|
|
1559
1556
|
}
|
|
1560
|
-
declare const WpEntity: (name: string, props?: Omit<EntityProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1561
1557
|
|
|
1562
|
-
interface
|
|
1563
|
-
|
|
1558
|
+
interface UserTokenVerifyResult<TUserContext extends IAuthUserContext> {
|
|
1559
|
+
isValid: boolean;
|
|
1560
|
+
data: IAuthUserTokenData<TUserContext>;
|
|
1564
1561
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1562
|
+
interface UserTokenVerifyInput {
|
|
1563
|
+
token: string;
|
|
1567
1564
|
}
|
|
1568
|
-
declare const WpFileReferenceRepository: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1569
1565
|
|
|
1570
|
-
interface
|
|
1571
|
-
|
|
1566
|
+
interface UserVerifyCompleteInput {
|
|
1567
|
+
token: string;
|
|
1572
1568
|
}
|
|
1573
|
-
declare const WpAppInitializer: (props?: AppInitializerProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1574
1569
|
|
|
1575
|
-
interface
|
|
1576
|
-
|
|
1570
|
+
interface UserVerifyRequestInput<TUserContext extends IAuthUserContext> {
|
|
1571
|
+
email: string;
|
|
1572
|
+
callback: UserVerifyRequestCallbackTemplate;
|
|
1573
|
+
languageCode: string;
|
|
1574
|
+
context?: TUserContext;
|
|
1577
1575
|
}
|
|
1578
|
-
|
|
1576
|
+
interface UserVerifyRequestResult {
|
|
1577
|
+
success: boolean;
|
|
1578
|
+
}
|
|
1579
|
+
type UserVerifyRequestCallbackTemplate = {
|
|
1580
|
+
urlTemplate: string;
|
|
1581
|
+
tokenPlaceholder: string;
|
|
1582
|
+
};
|
|
1579
1583
|
|
|
1580
|
-
|
|
1581
|
-
|
|
1584
|
+
declare class AppSessionService {
|
|
1585
|
+
getValue<T>(key: string): T;
|
|
1586
|
+
setValue<T>(key: string, value: T): void;
|
|
1587
|
+
clearValue(key: string): void;
|
|
1588
|
+
getRequest(): express.Request<express_serve_static_core.ParamsDictionary, any, any, qs.ParsedQs, Record<string, any>>;
|
|
1589
|
+
retrieveRequest(): express.Request<express_serve_static_core.ParamsDictionary, any, any, qs.ParsedQs, Record<string, any>> | undefined;
|
|
1590
|
+
private retrieveSession;
|
|
1591
|
+
private getSession;
|
|
1582
1592
|
}
|
|
1583
|
-
declare const WpEntityManager: (entityName: string, props?: Omit<EntityManagerProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1584
1593
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1594
|
+
declare class AppHashingService {
|
|
1595
|
+
hash(value: string, salt: string): Promise<string>;
|
|
1596
|
+
compare(hash: string, value: string, salt: string): Promise<boolean>;
|
|
1587
1597
|
}
|
|
1588
|
-
declare const WpEntityQueryBuilder: (entityName: string, props?: Omit<EntityQueryBuilderProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1589
1598
|
|
|
1590
|
-
|
|
1591
|
-
|
|
1599
|
+
declare class EntityManagerService {
|
|
1600
|
+
private readonly registry;
|
|
1601
|
+
constructor(registry: EntityManagerRegistry);
|
|
1602
|
+
getManager<TEntity>(entityName: string): IEntityManager<TEntity, unknown, unknown, unknown, any, any, any, unknown, any>;
|
|
1603
|
+
getActions<TEntity>(entityName: string): IEntityActions<TEntity, unknown, unknown, unknown, unknown, unknown, any, any, any, unknown, any>;
|
|
1604
|
+
getRepository<TEntity>(entityName: string): IEntityRepository<TEntity, unknown, unknown, unknown, unknown, unknown>;
|
|
1592
1605
|
}
|
|
1593
|
-
declare const WpPipeline: (name: string, props?: Omit<PipelineTemplateProps, "name">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1594
1606
|
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1607
|
+
declare class EmailService {
|
|
1608
|
+
private readonly registry;
|
|
1609
|
+
constructor(registry: EntityManagerRegistry);
|
|
1610
|
+
sendTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
1611
|
+
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
1612
|
+
private getTemplate;
|
|
1613
|
+
private get templates();
|
|
1614
|
+
private get provider();
|
|
1615
|
+
private get logger();
|
|
1598
1616
|
}
|
|
1599
|
-
declare const WpEntitySeeder: (entityName: string, props?: Omit<EntitySeederProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1600
1617
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1618
|
+
declare class CacheService {
|
|
1619
|
+
private readonly registry;
|
|
1620
|
+
constructor(registry: EntityManagerRegistry);
|
|
1621
|
+
getInstance(instanceName: string): ICacheInstance;
|
|
1622
|
+
getInstances(): ICacheInstance[];
|
|
1603
1623
|
}
|
|
1604
|
-
declare const WpEntitySerializer: (entityName: string, props?: Omit<EntitySerializerProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1605
1624
|
|
|
1606
|
-
|
|
1607
|
-
|
|
1625
|
+
declare class FilesService implements IFileManager {
|
|
1626
|
+
private readonly registry;
|
|
1627
|
+
constructor(registry: EntityManagerRegistry);
|
|
1628
|
+
uploadFile(file: FileData): Promise<FileReference>;
|
|
1629
|
+
getFileContent(fileId: string): Promise<FileData>;
|
|
1630
|
+
getFileDownloadUrl(fileId: string): Promise<FileDownloadUrl>;
|
|
1631
|
+
private getFileProvider;
|
|
1632
|
+
private get defaultFileProvider();
|
|
1633
|
+
private get referencesRepo();
|
|
1608
1634
|
}
|
|
1609
|
-
declare const WpEntitySnapshotService: (entityName: string, props?: Omit<EntitySnapshotServiceProps, "entityName">) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1610
1635
|
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
EntityActions: symbol;
|
|
1617
|
-
EntityAdapter: symbol;
|
|
1618
|
-
EntityAuthMiddleware: symbol;
|
|
1619
|
-
EntityRepository: symbol;
|
|
1620
|
-
EntityConnector: symbol;
|
|
1621
|
-
EntityConverter: symbol;
|
|
1622
|
-
EntitySerializer: symbol;
|
|
1623
|
-
EntitySnapshotService: symbol;
|
|
1624
|
-
EntityManager: symbol;
|
|
1625
|
-
EntityQueryBuilder: symbol;
|
|
1626
|
-
EntitySeeder: symbol;
|
|
1627
|
-
EntityVersioningProvider: symbol;
|
|
1628
|
-
EmailProvider: symbol;
|
|
1629
|
-
EmailTemplate: symbol;
|
|
1630
|
-
EmailLogger: symbol;
|
|
1631
|
-
BucketProvider: symbol;
|
|
1632
|
-
FileProvider: symbol;
|
|
1633
|
-
FileReferenceRepository: symbol;
|
|
1634
|
-
PipelineTemplate: symbol;
|
|
1635
|
-
CacheInstance: symbol;
|
|
1636
|
+
type IEventData<TEventPayload> = {
|
|
1637
|
+
payload?: TEventPayload;
|
|
1638
|
+
userId?: string;
|
|
1639
|
+
userName?: string;
|
|
1640
|
+
timestamp?: Date;
|
|
1636
1641
|
};
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1642
|
+
declare class EventsService {
|
|
1643
|
+
private readonly registry;
|
|
1644
|
+
constructor(registry: EntityManagerRegistry);
|
|
1645
|
+
emitEvent<TEventPayload>(eventName: string, eventData: IEventData<TEventPayload>): Promise<void>;
|
|
1646
|
+
private buildPayload;
|
|
1647
|
+
private get eventEmitter();
|
|
1640
1648
|
}
|
|
1641
|
-
declare const WpEventsTracker: (props?: EventsTrackerProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1642
1649
|
|
|
1643
|
-
|
|
1644
|
-
|
|
1650
|
+
declare class TrackingService {
|
|
1651
|
+
private readonly registry;
|
|
1652
|
+
constructor(registry: EntityManagerRegistry);
|
|
1653
|
+
trackEvent<T>(event: IEventLog<T>): Promise<void>;
|
|
1654
|
+
private get tracker();
|
|
1645
1655
|
}
|
|
1646
|
-
declare const WpEntityVersioningProvider: (props?: EntityVersioningProviderProps) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1647
1656
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
}
|
|
1662
|
-
interface DiscoveredMethodWithMeta<T> {
|
|
1663
|
-
discoveredMethod: DiscoveredMethod;
|
|
1664
|
-
meta: T;
|
|
1657
|
+
declare class AuthenticationServicesResolver {
|
|
1658
|
+
private usersService;
|
|
1659
|
+
private rolesService;
|
|
1660
|
+
private permissionsService;
|
|
1661
|
+
private usersRolesService;
|
|
1662
|
+
registerUsersService(usersService: IAuthUserService<any, any, any>): void;
|
|
1663
|
+
registerRoleService(rolesService: IAuthRoleService<any, any>): void;
|
|
1664
|
+
registerPermissionsService(permissionsService: IAuthPermissionService<any>): void;
|
|
1665
|
+
registerUserRolesService(userRolesService: IAuthUserRolesService<any, any, any, any>): void;
|
|
1666
|
+
getUsersService<TUser extends IAuthUser, TUserRegistrationInfo>(): IAuthUserService<TUser, any, TUserRegistrationInfo>;
|
|
1667
|
+
getRoleService<TRole extends IAuthRole, TPermission extends IAuthPermission>(): IAuthRoleService<TRole, TPermission>;
|
|
1668
|
+
getPermissionService<TPermission extends IAuthPermission>(): IAuthPermissionService<TPermission>;
|
|
1669
|
+
getUserRoleService<TUser extends IAuthUser, TRole extends IAuthRole, TPermission extends IAuthPermission, TAuthOrganizationalUnit extends IAuthOrganizationalUnit>(): IAuthUserRolesService<TUser, TRole, TPermission, TAuthOrganizationalUnit>;
|
|
1665
1670
|
}
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1671
|
+
|
|
1672
|
+
declare class JwtProvider {
|
|
1673
|
+
private readonly jwtService;
|
|
1674
|
+
constructor(jwtService: JwtService);
|
|
1675
|
+
sign<T extends object>(payload: T): Promise<string>;
|
|
1676
|
+
parse<T extends object>(token: string): Promise<T>;
|
|
1677
|
+
verify<T extends object>(token: string): Promise<T>;
|
|
1669
1678
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1679
|
+
|
|
1680
|
+
declare class PasswordHashingProvider {
|
|
1681
|
+
private readonly hashing;
|
|
1682
|
+
constructor(hashing: AppHashingService);
|
|
1683
|
+
hashPassword(input: {
|
|
1684
|
+
password: string;
|
|
1685
|
+
userId: string;
|
|
1686
|
+
}): Promise<string>;
|
|
1687
|
+
verifyPassword(input: {
|
|
1688
|
+
password: string;
|
|
1689
|
+
userId: string;
|
|
1690
|
+
hash: string;
|
|
1691
|
+
}): Promise<{
|
|
1692
|
+
isMatching: boolean;
|
|
1693
|
+
}>;
|
|
1694
|
+
private buildUserSalt;
|
|
1676
1695
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
private readonly
|
|
1680
|
-
private
|
|
1681
|
-
private
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
* @param metaKey The meta key to scan for
|
|
1692
|
-
* @param metaFilter An optional filter for the contents of the meta object
|
|
1693
|
-
*/
|
|
1694
|
-
methodsAndControllerMethodsWithMetaAtKey<T>(metaKey: MetaKey, metaFilter?: Filter<T>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1695
|
-
/**
|
|
1696
|
-
* Discovers all providers in an App that have meta at a specific key and returns the provider(s) and associated meta
|
|
1697
|
-
* @param metaKey The metakey to scan for
|
|
1698
|
-
*/
|
|
1699
|
-
providersWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T>[]>;
|
|
1700
|
-
providerWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T> | undefined>;
|
|
1701
|
-
/**
|
|
1702
|
-
* Discovers all controllers in a Nest App that match a filter
|
|
1703
|
-
* @param filter
|
|
1704
|
-
*/
|
|
1705
|
-
controllers(filter: Filter<DiscoveredClass>): Promise<DiscoveredClass[]>;
|
|
1706
|
-
/**
|
|
1707
|
-
* Discovers all controllers in an App that have meta at a specific key and returns the controller(s) and associated meta
|
|
1708
|
-
* @param metaKey The metakey to scan for
|
|
1709
|
-
*/
|
|
1710
|
-
controllersWithMetaAtKey<T>(metaKey: MetaKey): Promise<DiscoveredClassWithMeta<T>[]>;
|
|
1711
|
-
/**
|
|
1712
|
-
* Discovers all method handlers matching a particular metakey from a Provider or Controller
|
|
1713
|
-
* @param component
|
|
1714
|
-
* @param metaKey
|
|
1715
|
-
*/
|
|
1716
|
-
classMethodsWithMetaAtKey<T>(component: DiscoveredClass, metaKey: MetaKey): DiscoveredMethodWithMeta<T>[];
|
|
1717
|
-
/**
|
|
1718
|
-
* Discovers all the methods that exist on providers in a Nest App that contain metadata under a specific key
|
|
1719
|
-
* @param metaKey The metakey to scan for
|
|
1720
|
-
* @param providerFilter A predicate used to limit the providers being scanned. Defaults to all providers in the app module
|
|
1721
|
-
*/
|
|
1722
|
-
providerMethodsWithMetaAtKey<T>(metaKey: MetaKey, providerFilter?: Filter<DiscoveredClass>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1723
|
-
/**
|
|
1724
|
-
* Discovers all the methods that exist on controllers in a Nest App that contain metadata under a specific key
|
|
1725
|
-
* @param metaKey The metakey to scan for
|
|
1726
|
-
* @param controllerFilter A predicate used to limit the controllers being scanned. Defaults to all providers in the app module
|
|
1727
|
-
*/
|
|
1728
|
-
controllerMethodsWithMetaAtKey<T>(metaKey: MetaKey, controllerFilter?: Filter<DiscoveredClass>): Promise<DiscoveredMethodWithMeta<T>[]>;
|
|
1729
|
-
private toDiscoveredClass;
|
|
1730
|
-
private extractMethodMetaAtKey;
|
|
1731
|
-
private discover;
|
|
1732
|
-
private getModuleEntries;
|
|
1696
|
+
|
|
1697
|
+
declare class UserRegistrationHandler {
|
|
1698
|
+
private readonly services;
|
|
1699
|
+
private readonly passwordHashingProvider;
|
|
1700
|
+
private readonly emailService;
|
|
1701
|
+
private readonly jwtProvider;
|
|
1702
|
+
private readonly logger;
|
|
1703
|
+
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider, emailService: EmailService, jwtProvider: JwtProvider);
|
|
1704
|
+
execute<TUserRegistrationInfo, TContext extends IAuthUserContext>(input: UserRegistrationInput<TUserRegistrationInfo, TContext>): Promise<UserRegistrationResult>;
|
|
1705
|
+
private createPasswordHash;
|
|
1706
|
+
private sendRegistrationEmail;
|
|
1707
|
+
private generateEmailVerifyToken;
|
|
1708
|
+
private createUser;
|
|
1709
|
+
private resolveUser;
|
|
1733
1710
|
}
|
|
1734
1711
|
|
|
1735
|
-
declare class
|
|
1736
|
-
private readonly
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
eventEmitter?: IEventEmitter;
|
|
1740
|
-
}): Promise<void>;
|
|
1741
|
-
registerDiscoveredEntity(app: INestApplicationContext, { adapter, entityName, entity, converter, queryBuilder, repository, authMiddleware, serializer, snapshotService, settings, }: {
|
|
1742
|
-
entityName: string;
|
|
1743
|
-
entity: DiscoveredClassWithMeta<EntityProps>;
|
|
1744
|
-
repository: DiscoveredClassWithMeta<EntityRepositoryProps>;
|
|
1745
|
-
converter: DiscoveredClassWithMeta<EntityConverterProps>;
|
|
1746
|
-
adapter: DiscoveredClassWithMeta<EntityAdapterProps>;
|
|
1747
|
-
queryBuilder: DiscoveredClassWithMeta<EntityQueryBuilderProps>;
|
|
1748
|
-
serializer: DiscoveredClassWithMeta<EntitySerializerProps>;
|
|
1749
|
-
snapshotService?: DiscoveredClassWithMeta<EntitySnapshotServiceProps>;
|
|
1750
|
-
authMiddleware?: DiscoveredClassWithMeta<EntityAuthMiddlewareProps>;
|
|
1751
|
-
settings: EntityManagerSettings;
|
|
1752
|
-
}): Promise<void>;
|
|
1753
|
-
resolveEntityServicesCollection<TEntity>(entityName: string): EntityServiceLocator<TEntity, unknown>;
|
|
1712
|
+
declare class UserDisableHandler {
|
|
1713
|
+
private readonly services;
|
|
1714
|
+
constructor(services: AuthenticationServicesResolver);
|
|
1715
|
+
execute(input: UserDisableInput): Promise<void>;
|
|
1754
1716
|
}
|
|
1755
1717
|
|
|
1756
|
-
declare
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
protected get converter(): IEntityConverter<TEntity, TEntityDto, TEntityListItemDto, TEntityCreateDto, TEntityUpdateDto> | undefined;
|
|
1761
|
-
get manager(): IEntityActions<TEntity, TEntityId, TEntityCreateDto, TEntityUpdateDto, TEntityDto, TEntityListItemDto, TEntitiesDeleteParameters, TEntitySearchParameters, TSorting, TCursor, TFacets>;
|
|
1718
|
+
declare class UserEnableHandler {
|
|
1719
|
+
private readonly services;
|
|
1720
|
+
constructor(services: AuthenticationServicesResolver);
|
|
1721
|
+
execute(input: UserEnableInput): Promise<void>;
|
|
1762
1722
|
}
|
|
1763
1723
|
|
|
1764
|
-
declare
|
|
1765
|
-
|
|
1766
|
-
private
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1724
|
+
declare class UserLoginHandler {
|
|
1725
|
+
private readonly services;
|
|
1726
|
+
private readonly passwordHashingProvider;
|
|
1727
|
+
private readonly jwtProvider;
|
|
1728
|
+
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider, jwtProvider: JwtProvider);
|
|
1729
|
+
execute<TUserContext extends IAuthUserContext>(input: UserLoginInput<TUserContext>): Promise<UserLoginResult>;
|
|
1730
|
+
private generateUserJwtToken;
|
|
1731
|
+
private resolveUser;
|
|
1770
1732
|
}
|
|
1771
1733
|
|
|
1772
|
-
declare
|
|
1773
|
-
private readonly
|
|
1774
|
-
|
|
1775
|
-
|
|
1734
|
+
declare class UserPasswordChangeHandler {
|
|
1735
|
+
private readonly services;
|
|
1736
|
+
private readonly passwordHashingProvider;
|
|
1737
|
+
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider);
|
|
1738
|
+
execute(input: UserPasswordChangeInput): Promise<void>;
|
|
1776
1739
|
}
|
|
1777
1740
|
|
|
1778
|
-
declare
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1741
|
+
declare class UserPasswordResetCompleteHandler {
|
|
1742
|
+
private readonly services;
|
|
1743
|
+
private readonly passwordHashingProvider;
|
|
1744
|
+
private readonly jwtProvider;
|
|
1745
|
+
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider, jwtProvider: JwtProvider);
|
|
1746
|
+
execute(input: UserPasswordResetCompleteInput): Promise<void>;
|
|
1747
|
+
private decodeToken;
|
|
1748
|
+
private validateUser;
|
|
1749
|
+
private getUser;
|
|
1782
1750
|
}
|
|
1783
1751
|
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1752
|
+
declare class UserPasswordResetRequestHandler {
|
|
1753
|
+
private readonly services;
|
|
1754
|
+
private readonly emailService;
|
|
1755
|
+
private readonly jwtProvider;
|
|
1756
|
+
constructor(services: AuthenticationServicesResolver, emailService: EmailService, jwtProvider: JwtProvider);
|
|
1757
|
+
execute<TUserContext extends IAuthUserContext>(input: UserPasswordResetRequestInput<TUserContext>): Promise<UserPasswordResetRequestResult>;
|
|
1758
|
+
private sendPasswordResetEmail;
|
|
1759
|
+
private generatePasswordResetToken;
|
|
1760
|
+
private resolveUser;
|
|
1790
1761
|
}
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1762
|
+
|
|
1763
|
+
declare class UserVerifyCompleteHandler {
|
|
1764
|
+
private readonly services;
|
|
1765
|
+
private readonly jwtProvider;
|
|
1766
|
+
constructor(services: AuthenticationServicesResolver, jwtProvider: JwtProvider);
|
|
1767
|
+
execute(input: UserVerifyCompleteInput): Promise<void>;
|
|
1768
|
+
private decodeToken;
|
|
1769
|
+
private validateUser;
|
|
1770
|
+
private getUser;
|
|
1795
1771
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1772
|
+
|
|
1773
|
+
declare class UserTokenVerifyHandler {
|
|
1774
|
+
private readonly jwtProvider;
|
|
1775
|
+
constructor(jwtProvider: JwtProvider);
|
|
1776
|
+
execute<TUserContext extends IAuthUserContext>(input: UserTokenVerifyInput): Promise<UserTokenVerifyResult<TUserContext>>;
|
|
1777
|
+
private decodeUserJwtToken;
|
|
1800
1778
|
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1779
|
+
|
|
1780
|
+
declare class UserVerifyRequestHandler {
|
|
1781
|
+
private readonly services;
|
|
1782
|
+
private readonly emailService;
|
|
1783
|
+
private readonly jwtProvider;
|
|
1784
|
+
constructor(services: AuthenticationServicesResolver, emailService: EmailService, jwtProvider: JwtProvider);
|
|
1785
|
+
execute<TUserContext extends IAuthUserContext>(input: UserVerifyRequestInput<TUserContext>): Promise<UserVerifyRequestResult>;
|
|
1786
|
+
private sendEmailVerifyEmail;
|
|
1787
|
+
private generateEmailVerifyToken;
|
|
1788
|
+
private resolveUser;
|
|
1804
1789
|
}
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1790
|
+
|
|
1791
|
+
declare class UserCreationHandler {
|
|
1792
|
+
private readonly services;
|
|
1793
|
+
private readonly passwordHashingProvider;
|
|
1794
|
+
private readonly logger;
|
|
1795
|
+
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider);
|
|
1796
|
+
execute<TUserRegistrationInfo, TContext extends IAuthUserContext>(input: UserCreationInput<TUserRegistrationInfo, TContext>): Promise<UserCreationResult>;
|
|
1797
|
+
private createPasswordHash;
|
|
1798
|
+
private createUser;
|
|
1799
|
+
private resolveUser;
|
|
1809
1800
|
}
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1801
|
+
|
|
1802
|
+
declare class UserDeleteHandler {
|
|
1803
|
+
private readonly services;
|
|
1804
|
+
constructor(services: AuthenticationServicesResolver);
|
|
1805
|
+
execute(input: UserDeleteInput): Promise<void>;
|
|
1815
1806
|
}
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
passwordHash: string;
|
|
1819
|
-
passwordUpdateTimestamp?: Date;
|
|
1820
|
-
temporaryPassword: boolean;
|
|
1807
|
+
|
|
1808
|
+
interface UserImpersonateInput<TUserContext extends IAuthUserContext> {
|
|
1821
1809
|
userName: string;
|
|
1822
|
-
|
|
1823
|
-
verified: boolean;
|
|
1824
|
-
verifiedTimestamp?: Date;
|
|
1825
|
-
disabled: boolean;
|
|
1826
|
-
profile: IAuthUserProfile;
|
|
1827
|
-
organization?: IAuthUserOrganization;
|
|
1828
|
-
}
|
|
1829
|
-
interface IAuthUserContext {
|
|
1830
|
-
organizationUid?: string;
|
|
1831
|
-
}
|
|
1832
|
-
interface IAuthUserTokenData<TContext extends IAuthUserContext> {
|
|
1833
|
-
userId: string;
|
|
1834
|
-
email: string;
|
|
1835
|
-
context?: TContext;
|
|
1810
|
+
context?: TUserContext;
|
|
1836
1811
|
}
|
|
1837
|
-
interface
|
|
1838
|
-
|
|
1839
|
-
getByEmail(email: string, context?: TUserContext): Promise<TUser>;
|
|
1840
|
-
getByUserName(userName: string, context?: TUserContext): Promise<TUser>;
|
|
1841
|
-
update(id: string, data: Partial<TUser>): Promise<void>;
|
|
1842
|
-
delete(id: string): Promise<void>;
|
|
1843
|
-
create(email: string, userName: string, data: TUserRegistrationInfo, context?: TUserContext): Promise<TUser>;
|
|
1812
|
+
interface UserImpersonateResult {
|
|
1813
|
+
token: string;
|
|
1844
1814
|
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
removePermission(uid: string, permissionUid: string): Promise<void>;
|
|
1854
|
-
getPermissions(uid: string): Promise<TPermission[]>;
|
|
1815
|
+
|
|
1816
|
+
declare class UserImpersonateHandler {
|
|
1817
|
+
private readonly services;
|
|
1818
|
+
private readonly jwtProvider;
|
|
1819
|
+
constructor(services: AuthenticationServicesResolver, jwtProvider: JwtProvider);
|
|
1820
|
+
execute<TUserContext extends IAuthUserContext>(input: UserImpersonateInput<TUserContext>): Promise<UserImpersonateResult>;
|
|
1821
|
+
private generateUserJwtToken;
|
|
1822
|
+
private resolveUser;
|
|
1855
1823
|
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1824
|
+
|
|
1825
|
+
declare class AuthenticationService implements IAuthService {
|
|
1826
|
+
private readonly userCreationHandler;
|
|
1827
|
+
private readonly userDisableHandler;
|
|
1828
|
+
private readonly userDeleteHandler;
|
|
1829
|
+
private readonly userEnableHandler;
|
|
1830
|
+
private readonly userImpersonateHandler;
|
|
1831
|
+
private readonly userLoginHandler;
|
|
1832
|
+
private readonly userPasswordChangeHandler;
|
|
1833
|
+
private readonly userPasswordResetFinalizeHandler;
|
|
1834
|
+
private readonly userPasswordResetRequestHandler;
|
|
1835
|
+
private readonly userRegistrationHandler;
|
|
1836
|
+
private readonly userTokenVerifyHandler;
|
|
1837
|
+
private readonly userVerifyRequestHandler;
|
|
1838
|
+
private readonly userVerifyCompleteHandler;
|
|
1839
|
+
private readonly resolver;
|
|
1840
|
+
constructor(userCreationHandler: UserCreationHandler, userDisableHandler: UserDisableHandler, userDeleteHandler: UserDeleteHandler, userEnableHandler: UserEnableHandler, userImpersonateHandler: UserImpersonateHandler, userLoginHandler: UserLoginHandler, userPasswordChangeHandler: UserPasswordChangeHandler, userPasswordResetFinalizeHandler: UserPasswordResetCompleteHandler, userPasswordResetRequestHandler: UserPasswordResetRequestHandler, userRegistrationHandler: UserRegistrationHandler, userTokenVerifyHandler: UserTokenVerifyHandler, userVerifyRequestHandler: UserVerifyRequestHandler, userVerifyCompleteHandler: UserVerifyCompleteHandler, resolver: AuthenticationServicesResolver);
|
|
1841
|
+
userCreate<TUserRegistrationInfo, TUserContext extends IAuthUserContext>(input: UserCreationInput<TUserRegistrationInfo, TUserContext>): Promise<UserCreationResult>;
|
|
1842
|
+
userDisable(input: UserDisableInput): Promise<void>;
|
|
1843
|
+
userDelete(input: UserDeleteInput): Promise<void>;
|
|
1844
|
+
userEnable(input: UserEnableInput): Promise<void>;
|
|
1845
|
+
userImpersonate<TUserContext extends IAuthUserContext>(input: UserImpersonateInput<TUserContext>): Promise<UserImpersonateResult>;
|
|
1846
|
+
userLogin<TUserContext extends IAuthUserContext>(input: UserLoginInput<TUserContext>): Promise<UserLoginResult>;
|
|
1847
|
+
userPasswordChange(input: UserPasswordChangeInput): Promise<void>;
|
|
1848
|
+
userPasswordResetFinalize(input: UserPasswordResetCompleteInput): Promise<void>;
|
|
1849
|
+
userPasswordResetRequest<TUserContext extends IAuthUserContext>(input: UserPasswordResetRequestInput<TUserContext>): Promise<UserPasswordResetRequestResult>;
|
|
1850
|
+
userRegister<TUserRegistrationInfo, TUserContext extends IAuthUserContext>(input: UserRegistrationInput<TUserRegistrationInfo, TUserContext>): Promise<UserRegistrationResult>;
|
|
1851
|
+
userVerifyRequest<TUserContext extends IAuthUserContext>(input: UserVerifyRequestInput<TUserContext>): Promise<UserVerifyRequestResult>;
|
|
1852
|
+
userVerifyComplete(input: UserVerifyCompleteInput): Promise<void>;
|
|
1853
|
+
userTokenVerify<TUserContext extends IAuthUserContext>(input: UserTokenVerifyInput): Promise<UserTokenVerifyResult<TUserContext>>;
|
|
1854
|
+
get usersService(): IAuthUserService<IAuthUser, any, unknown>;
|
|
1855
|
+
get rolesService(): IAuthRoleService<IAuthRole, IAuthPermission>;
|
|
1856
|
+
get userRolesService(): IAuthUserRolesService<IAuthUser, IAuthRole, IAuthPermission, IAuthOrganizationalUnit>;
|
|
1863
1857
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
getUserOrganizationalUnits(userId: string): Promise<TOrganizationalUnit[]>;
|
|
1869
|
-
addUserToRole(userId: string, roleId: string): Promise<void>;
|
|
1870
|
-
addUserToRoleByUid(userId: string, roleUid: string): Promise<void>;
|
|
1871
|
-
removeUserFromRole(userId: string, roleId: string): Promise<void>;
|
|
1872
|
-
removeUserFromRoleByUid(userId: string, roleUid: string): Promise<void>;
|
|
1873
|
-
clearUserRoles(userId: string): Promise<void>;
|
|
1858
|
+
|
|
1859
|
+
declare class AuthenticationModule implements NestModule {
|
|
1860
|
+
static forRoot(input: AuthenticationModuleSettings): DynamicModule;
|
|
1861
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
1874
1862
|
}
|
|
1875
1863
|
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
organizationalUnits: IAuthOrganizationalUnit[];
|
|
1881
|
-
};
|
|
1882
|
-
declare const CurrentUser: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
1883
|
-
|
|
1884
|
-
interface AuthenticationModuleSettings {
|
|
1885
|
-
passwordSalt: string;
|
|
1886
|
-
jwtSecret: string;
|
|
1864
|
+
interface IAppDirectory {
|
|
1865
|
+
id: string;
|
|
1866
|
+
uid: string;
|
|
1867
|
+
name: string;
|
|
1887
1868
|
}
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
};
|
|
1893
|
-
type EmailVerifyTokenPayload = {
|
|
1894
|
-
userId: string;
|
|
1895
|
-
email: string;
|
|
1896
|
-
timestamp: number;
|
|
1897
|
-
};
|
|
1898
|
-
declare enum UserRegistrationError {
|
|
1899
|
-
UserAlreadyExists = "userAlreadyExists"
|
|
1869
|
+
interface IAppTenant {
|
|
1870
|
+
id: string;
|
|
1871
|
+
uid: string;
|
|
1872
|
+
name: string;
|
|
1900
1873
|
}
|
|
1901
|
-
|
|
1874
|
+
interface IAppOrganization {
|
|
1875
|
+
id: string;
|
|
1902
1876
|
uid: string;
|
|
1903
1877
|
name: string;
|
|
1904
|
-
|
|
1905
|
-
|
|
1878
|
+
tenant: IAppTenant;
|
|
1879
|
+
}
|
|
1880
|
+
interface IAppCompany {
|
|
1881
|
+
id: string;
|
|
1906
1882
|
uid: string;
|
|
1907
1883
|
name: string;
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
declare const MemberOf: (...groups: string[]) => _nestjs_common.CustomDecorator<string>;
|
|
1918
|
-
declare const buildRolesGuard: ({ mainRole, secondaryRoles, }: {
|
|
1919
|
-
mainRole: AppRole;
|
|
1920
|
-
secondaryRoles?: AppRole[] | undefined;
|
|
1921
|
-
}, options?: RolesGuardOptions) => _nestjs_common.CustomDecorator<string>;
|
|
1922
|
-
declare const buildPermissionsGuard: ({ permissions, }: {
|
|
1923
|
-
permissions: AppPermission[];
|
|
1924
|
-
}) => _nestjs_common.CustomDecorator<string>;
|
|
1925
|
-
|
|
1926
|
-
declare const WpPermissionsService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1927
|
-
|
|
1928
|
-
declare const AuthenticationExtensionSymbols: {
|
|
1929
|
-
UserService: symbol;
|
|
1930
|
-
RolesService: symbol;
|
|
1931
|
-
PermissionsService: symbol;
|
|
1932
|
-
UserRolesService: symbol;
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
|
-
declare const WpRolesService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1936
|
-
|
|
1937
|
-
declare const WpUserService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1938
|
-
|
|
1939
|
-
declare const WpUserRolesService: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
1940
|
-
|
|
1941
|
-
declare const AuthenticationEmailTemplates: {
|
|
1942
|
-
Registration: string;
|
|
1943
|
-
PasswordReset: string;
|
|
1944
|
-
EmailVerify: string;
|
|
1945
|
-
};
|
|
1946
|
-
type RegistrationEmailPayload = {
|
|
1947
|
-
firstName: string;
|
|
1948
|
-
lastName: string;
|
|
1949
|
-
callbackUrl: string;
|
|
1950
|
-
};
|
|
1951
|
-
type EmailVerifyEmailPayload = {
|
|
1952
|
-
firstName: string;
|
|
1953
|
-
lastName: string;
|
|
1954
|
-
callbackUrl: string;
|
|
1955
|
-
};
|
|
1956
|
-
type PasswordResetEmailPayload = {
|
|
1884
|
+
organization: IAppOrganization;
|
|
1885
|
+
}
|
|
1886
|
+
interface IAppDivision {
|
|
1887
|
+
id: string;
|
|
1888
|
+
uid: string;
|
|
1889
|
+
name: string;
|
|
1890
|
+
company: IAppCompany;
|
|
1891
|
+
}
|
|
1892
|
+
interface IAppUserProfile {
|
|
1957
1893
|
firstName: string;
|
|
1958
1894
|
lastName: string;
|
|
1959
|
-
|
|
1960
|
-
|
|
1895
|
+
}
|
|
1896
|
+
interface IAppUser {
|
|
1897
|
+
id: string;
|
|
1898
|
+
uid?: string;
|
|
1899
|
+
userName: string;
|
|
1900
|
+
email: string;
|
|
1901
|
+
verified: boolean;
|
|
1902
|
+
disabled: boolean;
|
|
1903
|
+
profile: IAppUserProfile;
|
|
1904
|
+
tenant: IAppTenant;
|
|
1905
|
+
directory: IAppDirectory;
|
|
1906
|
+
organization?: IAppOrganization;
|
|
1907
|
+
}
|
|
1908
|
+
interface IAppUserGroup {
|
|
1909
|
+
id: string;
|
|
1910
|
+
uid: string;
|
|
1911
|
+
name: string;
|
|
1912
|
+
disabled: boolean;
|
|
1913
|
+
isBuiltIn: boolean;
|
|
1914
|
+
organization?: IAppOrganization;
|
|
1915
|
+
}
|
|
1916
|
+
interface IAppRole {
|
|
1917
|
+
id: string;
|
|
1918
|
+
uid: string;
|
|
1919
|
+
name: string;
|
|
1920
|
+
}
|
|
1961
1921
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1922
|
+
interface IMultiTenantEntity {
|
|
1923
|
+
tenant: IAppTenant;
|
|
1964
1924
|
}
|
|
1965
|
-
|
|
1966
|
-
|
|
1925
|
+
interface IMultiOrganizationEntity {
|
|
1926
|
+
organization: IAppOrganization;
|
|
1967
1927
|
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1928
|
+
interface IMultiCompanyEntity {
|
|
1929
|
+
company: IAppCompany;
|
|
1970
1930
|
}
|
|
1971
1931
|
|
|
1972
|
-
declare
|
|
1973
|
-
|
|
1974
|
-
UserLogin: string;
|
|
1975
|
-
UserRegistrationStarted: string;
|
|
1976
|
-
UserRegistrationCompleted: string;
|
|
1977
|
-
UserPasswordResetStarted: string;
|
|
1978
|
-
UserPasswordResetCompleted: string;
|
|
1979
|
-
};
|
|
1932
|
+
declare class MultiTenancyModule {
|
|
1933
|
+
}
|
|
1980
1934
|
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
userId: string;
|
|
1987
|
-
email: string;
|
|
1988
|
-
profile: UserProfile;
|
|
1989
|
-
};
|
|
1990
|
-
type UserRegistrationStartedEventPayload = {
|
|
1991
|
-
email: string;
|
|
1992
|
-
profile: UserProfile;
|
|
1993
|
-
};
|
|
1994
|
-
type UserRegistrationCompletedEventPayload = {
|
|
1995
|
-
userId: string;
|
|
1996
|
-
email: string;
|
|
1997
|
-
profile: UserProfile;
|
|
1998
|
-
};
|
|
1999
|
-
type UserPasswordResetStartedEventPayload = {
|
|
2000
|
-
email: string;
|
|
2001
|
-
};
|
|
2002
|
-
type UserPasswordResetCompletedEventPayload = {
|
|
2003
|
-
userId: string;
|
|
2004
|
-
email: string;
|
|
2005
|
-
profile: UserProfile;
|
|
2006
|
-
};
|
|
1935
|
+
declare const createExpressFileResponse: (res: Response, file: {
|
|
1936
|
+
content: Buffer;
|
|
1937
|
+
contentType: string;
|
|
1938
|
+
name: string;
|
|
1939
|
+
}) => StreamableFile;
|
|
2007
1940
|
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
private getIsPublic;
|
|
2017
|
-
private getAllowedRoles;
|
|
2018
|
-
private getAllowedPermissions;
|
|
2019
|
-
private getCurrentAuth;
|
|
2020
|
-
private getMetadata;
|
|
2021
|
-
private getContextInfo;
|
|
1941
|
+
interface ICacheDatabaseItem {
|
|
1942
|
+
id: string;
|
|
1943
|
+
instance: string;
|
|
1944
|
+
key: string;
|
|
1945
|
+
data: any;
|
|
1946
|
+
createdOn: Date;
|
|
1947
|
+
updatedOn: Date;
|
|
1948
|
+
expirationTime: Date;
|
|
2022
1949
|
}
|
|
2023
1950
|
|
|
2024
|
-
declare
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
1951
|
+
declare abstract class TypeormCacheInstance<TEntity extends ICacheDatabaseItem> implements ICacheInstance {
|
|
1952
|
+
protected readonly instanceName: string;
|
|
1953
|
+
private readonly logger;
|
|
1954
|
+
constructor(instanceName: string);
|
|
1955
|
+
getInstanceName(): string;
|
|
1956
|
+
getEntries(): Promise<CacheEntryInfo[]>;
|
|
1957
|
+
getEntry(key: string): Promise<CacheEntryDetail | undefined>;
|
|
1958
|
+
retrieve<T>(key: string, input: {
|
|
1959
|
+
ttl: CacheTtl;
|
|
1960
|
+
valueFactory: () => Promise<T>;
|
|
1961
|
+
}): Promise<T>;
|
|
1962
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
1963
|
+
set<T>(key: string, { ttl, value }: {
|
|
1964
|
+
value: T;
|
|
1965
|
+
ttl: CacheTtl;
|
|
1966
|
+
}): Promise<void>;
|
|
1967
|
+
delete(key: string): Promise<void>;
|
|
1968
|
+
clear(): Promise<void>;
|
|
1969
|
+
protected abstract getRepository(): Repository<TEntity>;
|
|
2038
1970
|
}
|
|
2039
1971
|
|
|
2040
|
-
|
|
2041
|
-
|
|
1972
|
+
declare class PipelineController implements IPipelinesController {
|
|
1973
|
+
createInstance<TInput, TOutput, TContext>(definition: PipelineDefinition<TInput, TOutput, TContext>, input: TInput, context: TContext): Promise<IPipelineInstance<TInput, TOutput, TContext>>;
|
|
2042
1974
|
}
|
|
2043
1975
|
|
|
2044
|
-
|
|
2045
|
-
|
|
1976
|
+
declare enum QueryBuilderOperation {
|
|
1977
|
+
Search = "search",
|
|
1978
|
+
Get = "get"
|
|
2046
1979
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
1980
|
+
declare abstract class QueryBuilderBase<TEntity, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets, TUserContext> implements IEntitiesQueryBuilder<TEntity, TEntityId, TEntitySearchParameters, TSorting, TCursor, TFacets, TUserContext> {
|
|
1981
|
+
abstract get(id: TEntityId, context?: IAuthenticationContext<TUserContext> | undefined): Promise<TEntity | undefined>;
|
|
1982
|
+
abstract exists(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<boolean>;
|
|
1983
|
+
abstract count(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<number>;
|
|
1984
|
+
abstract delete(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<IEntitiesDeleteResult>;
|
|
1985
|
+
abstract search(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<IEntitiesSearchResults<TEntity, TEntitySearchParameters, TEntity, TSorting, TCursor, TFacets>>;
|
|
1986
|
+
abstract find(request: {
|
|
1987
|
+
filters?: TEntitySearchParameters["filters"];
|
|
1988
|
+
sorting?: TEntitySearchParameters["sorting"];
|
|
1989
|
+
}, context?: IAuthenticationContext<TUserContext>): Promise<TEntity>;
|
|
1990
|
+
protected getIndexBasedPagingResult({ paging, totResults, currentPageResults, }: {
|
|
1991
|
+
paging?: ISearchRequestPaging<number>;
|
|
1992
|
+
totResults: number;
|
|
1993
|
+
currentPageResults: number;
|
|
1994
|
+
}): IEntitiesSearchResultsPaging<number> | undefined;
|
|
2050
1995
|
}
|
|
2051
1996
|
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
1997
|
+
type UpdateCriteria<TEntity extends ObjectLiteral> = string | string[] | number | number[] | Date | Date[] | ObjectId | ObjectId[] | FindOptionsWhere<TEntity>;
|
|
1998
|
+
type DeleteCriteria<TEntity extends ObjectLiteral> = string | string[] | number | number[] | Date | Date[] | ObjectId | ObjectId[] | FindOptionsWhere<TEntity>;
|
|
1999
|
+
declare class TypeOrmRepository<TEntity extends ObjectLiteral, TEntityId> implements IEntityRepository<TEntity, TEntityId, FindOneOptions<TEntity>, FindManyOptions<TEntity>, UpdateCriteria<TEntity>, DeleteCriteria<TEntity>> {
|
|
2000
|
+
protected readonly innerRepository: Repository<TEntity>;
|
|
2001
|
+
private readonly logger;
|
|
2002
|
+
constructor(innerRepository: Repository<TEntity>);
|
|
2003
|
+
getInnerRepository(): Repository<TEntity>;
|
|
2004
|
+
distinct<TField extends keyof TEntity, TValue>(field: TField, condition: FindManyOptions<TEntity>): Promise<any[]>;
|
|
2005
|
+
exists(id: TEntityId): Promise<boolean>;
|
|
2006
|
+
existsBy(condition: FindOneOptions<TEntity>): Promise<boolean>;
|
|
2007
|
+
get(id: TEntityId, options?: {
|
|
2008
|
+
relations?: FindOptionsRelations<TEntity>;
|
|
2009
|
+
}): Promise<TEntity | undefined>;
|
|
2010
|
+
getBy(condition: FindOneOptions<TEntity>): Promise<TEntity | undefined>;
|
|
2011
|
+
all(): Promise<TEntity[]>;
|
|
2012
|
+
count(condition: FindManyOptions<TEntity>): Promise<number>;
|
|
2013
|
+
find(condition: FindManyOptions<TEntity>): Promise<TEntity[]>;
|
|
2014
|
+
findById(id: TEntityId[]): Promise<TEntity[]>;
|
|
2015
|
+
delete(id: TEntityId): Promise<void>;
|
|
2016
|
+
deleteBy(condition: DeleteCriteria<TEntity>): Promise<IEntitiesDeleteResult>;
|
|
2017
|
+
create(entity: Partial<TEntity>): Promise<TEntity>;
|
|
2018
|
+
update(id: TEntityId, entity: Partial<TEntity>): Promise<TEntity>;
|
|
2019
|
+
updateBy(entity: Partial<TEntity>, condition: UpdateCriteria<TEntity>): Promise<TEntity[]>;
|
|
2020
|
+
upsert(id: TEntityId, entity: Partial<TEntity>): Promise<TEntity>;
|
|
2060
2021
|
}
|
|
2061
2022
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2023
|
+
type NumericFilter = {
|
|
2024
|
+
in?: number[];
|
|
2025
|
+
eq?: number;
|
|
2026
|
+
gt?: number;
|
|
2027
|
+
gte?: number;
|
|
2028
|
+
lt?: number;
|
|
2029
|
+
lte?: number;
|
|
2030
|
+
};
|
|
2031
|
+
type StringFilter = {
|
|
2032
|
+
gt?: string;
|
|
2033
|
+
gte?: string;
|
|
2034
|
+
lt?: string;
|
|
2035
|
+
lte?: string;
|
|
2036
|
+
in?: string[];
|
|
2037
|
+
eq?: string;
|
|
2038
|
+
like?: string;
|
|
2039
|
+
ne?: string;
|
|
2040
|
+
notIn?: string[];
|
|
2041
|
+
notLike?: string;
|
|
2042
|
+
};
|
|
2043
|
+
type EnumFilter<T> = {
|
|
2044
|
+
in?: T[];
|
|
2045
|
+
eq?: T;
|
|
2046
|
+
ne?: T;
|
|
2047
|
+
notIn?: T[];
|
|
2048
|
+
};
|
|
2049
|
+
type BooleanFilter = {
|
|
2050
|
+
eq?: boolean;
|
|
2051
|
+
ne?: boolean;
|
|
2052
|
+
};
|
|
2053
|
+
type DateFilter = {
|
|
2054
|
+
in?: Date[];
|
|
2055
|
+
eq?: Date;
|
|
2056
|
+
gt?: Date;
|
|
2057
|
+
gte?: Date;
|
|
2058
|
+
lt?: Date;
|
|
2059
|
+
lte?: Date;
|
|
2060
|
+
};
|
|
2067
2061
|
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2062
|
+
declare class QueryClauseBuilder {
|
|
2063
|
+
enumFilter<T>(filter: EnumFilter<T>): FindOperator<T>;
|
|
2064
|
+
stringFilter(filter: StringFilter): FindOperator<string>;
|
|
2065
|
+
numericFilter(filter: NumericFilter): FindOperator<number>;
|
|
2066
|
+
dateFilter(filter: DateFilter): FindOperator<Date>;
|
|
2067
|
+
boolFilter(filter: BooleanFilter): FindOperator<boolean>;
|
|
2072
2068
|
}
|
|
2073
2069
|
|
|
2074
|
-
type
|
|
2075
|
-
|
|
2076
|
-
|
|
2070
|
+
type FacetValueType<T> = {
|
|
2071
|
+
value: T;
|
|
2072
|
+
count: number;
|
|
2077
2073
|
};
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
interface UserPasswordResetRequestResult {
|
|
2085
|
-
success: boolean;
|
|
2086
|
-
}
|
|
2074
|
+
type FacetType<T> = {
|
|
2075
|
+
values: FacetValueType<T>[];
|
|
2076
|
+
};
|
|
2077
|
+
type StringFacetsType = FacetType<string>;
|
|
2078
|
+
type NumberFacetsType = FacetType<number>;
|
|
2079
|
+
type BooleanFacetsType = FacetType<boolean>;
|
|
2087
2080
|
|
|
2088
|
-
type
|
|
2089
|
-
|
|
2090
|
-
|
|
2081
|
+
type ChildrenMap = Record<string, {
|
|
2082
|
+
count: number;
|
|
2083
|
+
}>;
|
|
2084
|
+
|
|
2085
|
+
type FacetRelations = {
|
|
2086
|
+
columns: string[];
|
|
2091
2087
|
};
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
context?: TUserContext
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2088
|
+
declare abstract class TypeOrmQueryBuilder<TEntity extends ObjectLiteral, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, number>, TSorting extends SortingType, TFacets extends IEntityFacets, TUserContext> extends QueryBuilderBase<TEntity, TEntityId, TEntitySearchParameters, TSorting, number, TFacets, TUserContext> {
|
|
2089
|
+
private readonly services;
|
|
2090
|
+
private repository;
|
|
2091
|
+
protected clause: QueryClauseBuilder;
|
|
2092
|
+
protected permissions: PermissionsChecker<TUserContext>;
|
|
2093
|
+
constructor(services: EntityServiceLocator<TEntity, unknown>);
|
|
2094
|
+
get(id: TEntityId, context?: IAuthenticationContext<TUserContext>): Promise<TEntity | undefined>;
|
|
2095
|
+
exists(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<boolean>;
|
|
2096
|
+
count(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<number>;
|
|
2097
|
+
delete(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<IEntitiesDeleteResult>;
|
|
2098
|
+
find(request: {
|
|
2099
|
+
filters?: TEntitySearchParameters["filters"];
|
|
2100
|
+
sorting?: TEntitySearchParameters["sorting"];
|
|
2101
|
+
}, context?: IAuthenticationContext<TUserContext>): Promise<TEntity>;
|
|
2102
|
+
search(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<IEntitiesSearchResults<TEntity, TEntitySearchParameters, TEntity, TSorting, number, TFacets>>;
|
|
2103
|
+
protected getFieldDistinctValues<T>(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined): Promise<T[]>;
|
|
2104
|
+
protected findPagedQueryResults(request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined): Promise<TEntity[]>;
|
|
2105
|
+
protected getRelationsToLoad(request: TEntitySearchParameters | undefined, context: IAuthenticationContext<TUserContext> | undefined, operation: QueryBuilderOperation): FindOptionsRelations<TEntity> | undefined;
|
|
2106
|
+
protected buildPagingParameters(request: TEntitySearchParameters): {
|
|
2107
|
+
skip: number | undefined;
|
|
2108
|
+
take: number | undefined;
|
|
2109
|
+
};
|
|
2110
|
+
protected countQueryResults(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<number>;
|
|
2111
|
+
protected abstract buildSortingClause(request: TEntitySearchParameters): FindOptionsOrder<TEntity>;
|
|
2112
|
+
protected abstract buildWhereClause(request: TEntitySearchParameters): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
2113
|
+
protected buildTextSearchClause(request: TEntitySearchParameters): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
2114
|
+
protected abstract buildContextFilter(context?: IAuthenticationContext<TUserContext>): FindOptionsWhere<TEntity>[] | FindOptionsWhere<TEntity>;
|
|
2115
|
+
protected abstract calculateFacets(request: TEntitySearchParameters, context?: IAuthenticationContext<TUserContext>): Promise<TFacets>;
|
|
2116
|
+
protected calculateChildrenMap(items: TEntity[]): Promise<ChildrenMap>;
|
|
2117
|
+
protected queryChildrenMap<TField extends keyof TEntity>({ nodeIds, idField, parentField, }: {
|
|
2118
|
+
nodeIds: string[];
|
|
2119
|
+
idField: TField;
|
|
2120
|
+
parentField: TField;
|
|
2121
|
+
}): Promise<ChildrenMap>;
|
|
2122
|
+
protected calculateFacet<TField extends keyof TEntity, TValue>(field: TField, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<FacetType<TValue>>;
|
|
2123
|
+
protected calculateStringFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<StringFacetsType>;
|
|
2124
|
+
protected calculateNumericFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<NumberFacetsType>;
|
|
2125
|
+
protected calculateBooleanFieldFacets(field: keyof TEntity, request: TEntitySearchParameters, context: IAuthenticationContext<TUserContext> | undefined, relations?: FacetRelations): Promise<BooleanFacetsType>;
|
|
2126
|
+
protected getRepository(): TypeOrmRepository<TEntity, unknown>;
|
|
2127
|
+
private buildSearchRelations;
|
|
2128
|
+
private buildWhere;
|
|
2129
|
+
private mergeWhereClauses;
|
|
2130
|
+
private mergeWheres;
|
|
2105
2131
|
}
|
|
2106
2132
|
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
data: IAuthUserTokenData<TUserContext>;
|
|
2110
|
-
}
|
|
2111
|
-
interface UserTokenVerifyInput {
|
|
2112
|
-
token: string;
|
|
2133
|
+
declare abstract class NestTypeOrmQueryBuilder<TEntity extends ObjectLiteral, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, number>, TSorting extends SortingType, TFacets extends IEntityFacets, TUserContext> extends TypeOrmQueryBuilder<TEntity, TEntityId, TEntitySearchParameters, TSorting, TFacets, TUserContext> {
|
|
2134
|
+
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
2113
2135
|
}
|
|
2114
2136
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2137
|
+
declare class NestTypeOrmRepository<TEntity extends ObjectLiteral, TEntityId> extends TypeOrmRepository<TEntity, TEntityId> {
|
|
2138
|
+
constructor(repository: Repository<TEntity>);
|
|
2117
2139
|
}
|
|
2118
2140
|
|
|
2119
|
-
interface
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
languageCode: string;
|
|
2123
|
-
context?: TUserContext;
|
|
2141
|
+
interface IEntitySeedEntry<TEntity, TFindCondition> {
|
|
2142
|
+
identifier: TFindCondition;
|
|
2143
|
+
data: () => Partial<TEntity>;
|
|
2124
2144
|
}
|
|
2125
|
-
interface
|
|
2126
|
-
|
|
2145
|
+
interface IEntitySeeder {
|
|
2146
|
+
execute(): Promise<void>;
|
|
2147
|
+
get priority(): number | undefined;
|
|
2127
2148
|
}
|
|
2128
|
-
type UserVerifyRequestCallbackTemplate = {
|
|
2129
|
-
urlTemplate: string;
|
|
2130
|
-
tokenPlaceholder: string;
|
|
2131
|
-
};
|
|
2132
2149
|
|
|
2133
|
-
declare class
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
private getSession;
|
|
2150
|
+
declare abstract class EntitySeeder<TEntity, TFindCondition> implements IEntitySeeder {
|
|
2151
|
+
protected readonly logger: _punks_backend_core.ILogger;
|
|
2152
|
+
execute(): Promise<void>;
|
|
2153
|
+
protected abstract getEntries(): Promise<IEntitySeedEntry<TEntity, TFindCondition>[]>;
|
|
2154
|
+
protected abstract exists(condition: TFindCondition): Promise<boolean>;
|
|
2155
|
+
protected abstract create(entity: Partial<TEntity>): Promise<void>;
|
|
2156
|
+
abstract get priority(): number | undefined;
|
|
2141
2157
|
}
|
|
2142
2158
|
|
|
2143
|
-
declare class
|
|
2144
|
-
|
|
2145
|
-
|
|
2159
|
+
declare abstract class TypeOrmEntitySeeder<TEntity extends ObjectLiteral> extends EntitySeeder<TEntity, FindOneOptions<TEntity>> {
|
|
2160
|
+
protected exists(condition: FindOneOptions<TEntity>): Promise<boolean>;
|
|
2161
|
+
protected create(entity: TEntity): Promise<void>;
|
|
2162
|
+
protected abstract getRepository(): Repository<TEntity>;
|
|
2146
2163
|
}
|
|
2147
2164
|
|
|
2148
|
-
declare class
|
|
2165
|
+
declare abstract class NestTypeOrmEntitySeeder<TEntity extends ObjectLiteral> extends TypeOrmEntitySeeder<TEntity> {
|
|
2149
2166
|
private readonly registry;
|
|
2167
|
+
protected readonly metadata: EntitySeederProps;
|
|
2150
2168
|
constructor(registry: EntityManagerRegistry);
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
getRepository<TEntity>(entityName: string): IEntityRepository<TEntity, unknown, unknown, unknown, unknown, unknown>;
|
|
2169
|
+
get priority(): number | undefined;
|
|
2170
|
+
protected getRepository(): Repository<TEntity>;
|
|
2154
2171
|
}
|
|
2155
2172
|
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2173
|
+
interface RuntimeErrorInformation {
|
|
2174
|
+
exception: any;
|
|
2175
|
+
request: any;
|
|
2176
|
+
response: any;
|
|
2177
|
+
}
|
|
2178
|
+
declare abstract class AppExceptionsFilterBase implements ExceptionFilter {
|
|
2179
|
+
catch(exception: unknown, host: ArgumentsHost): void;
|
|
2180
|
+
protected getExceptionType(exception: any): any;
|
|
2181
|
+
protected getExceptionStack(exception: any): any;
|
|
2182
|
+
protected getExceptionMessage(exception: any): any;
|
|
2183
|
+
protected getErrorStatusCode(exception: any): number;
|
|
2184
|
+
protected abstract logError(info: RuntimeErrorInformation): Promise<void>;
|
|
2185
|
+
protected abstract getCustomErrorStatusCode(exception: any): number | undefined;
|
|
2165
2186
|
}
|
|
2166
2187
|
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
constructor(registry: EntityManagerRegistry);
|
|
2170
|
-
getInstance(instanceName: string): ICacheInstance;
|
|
2171
|
-
getInstances(): ICacheInstance[];
|
|
2188
|
+
interface IPipelineStepOperationOptionsBuilder<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext> {
|
|
2189
|
+
withRollback(definition: RollbackOperationDefinition<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext>): IPipelineStepOperationOptionsBuilder<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext>;
|
|
2172
2190
|
}
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
private get referencesRepo();
|
|
2191
|
+
interface IPipelineStepOperationBuilder<TStepInput, TStepOutput, TPipelineInput, TContext> {
|
|
2192
|
+
addOperation(operation: OperationDefinition<TStepInput, TStepOutput, TStepInput, TPipelineInput, TContext>): IPipelineStepOperationOptionsBuilder<TStepInput, TStepOutput, TStepInput, TPipelineInput, TContext>;
|
|
2193
|
+
}
|
|
2194
|
+
interface IPipelineStepBuilder<TStepInput, TStepOutput, TPipelineInput, TContext> {
|
|
2195
|
+
addStep<TNextStepOutput>(builder: (step: IPipelineStepOperationBuilder<TStepOutput, TNextStepOutput, TPipelineInput, TContext>) => void): IPipelineStepBuilder<TStepOutput, TNextStepOutput, TPipelineInput, TContext>;
|
|
2196
|
+
complete(): PipelineDefinition<TPipelineInput, TStepOutput, TContext>;
|
|
2197
|
+
}
|
|
2198
|
+
interface IPipelineTemplateBuilder<TPipelineInput, TContext> {
|
|
2199
|
+
addStep<TStepOutput>(builder: (step: IPipelineStepOperationBuilder<TPipelineInput, TStepOutput, TPipelineInput, TContext>) => void): IPipelineStepBuilder<TPipelineInput, TStepOutput, TPipelineInput, TContext>;
|
|
2183
2200
|
}
|
|
2184
2201
|
|
|
2185
|
-
|
|
2186
|
-
payload?: TEventPayload;
|
|
2187
|
-
userId?: string;
|
|
2188
|
-
userName?: string;
|
|
2189
|
-
timestamp?: Date;
|
|
2190
|
-
};
|
|
2191
|
-
declare class EventsService {
|
|
2202
|
+
declare class PipelinesBuilder {
|
|
2192
2203
|
private readonly registry;
|
|
2193
2204
|
constructor(registry: EntityManagerRegistry);
|
|
2194
|
-
|
|
2195
|
-
private buildPayload;
|
|
2196
|
-
private get eventEmitter();
|
|
2205
|
+
createTemplate<TInput, TContext>(): IPipelineTemplateBuilder<TInput, TContext>;
|
|
2197
2206
|
}
|
|
2198
2207
|
|
|
2199
|
-
declare class
|
|
2208
|
+
declare class PipelinesRunner {
|
|
2200
2209
|
private readonly registry;
|
|
2201
2210
|
constructor(registry: EntityManagerRegistry);
|
|
2202
|
-
|
|
2203
|
-
|
|
2211
|
+
invokePipeline<TPipelineInput, TPipelineOutput, TContext>(definition: PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>, data: {
|
|
2212
|
+
input: TPipelineInput;
|
|
2213
|
+
context: TContext;
|
|
2214
|
+
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
2215
|
+
private get controller();
|
|
2204
2216
|
}
|
|
2205
2217
|
|
|
2206
|
-
declare class
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
private usersRolesService;
|
|
2211
|
-
registerUsersService(usersService: IAuthUserService<any, any, any>): void;
|
|
2212
|
-
registerRoleService(rolesService: IAuthRoleService<any, any>): void;
|
|
2213
|
-
registerPermissionsService(permissionsService: IAuthPermissionService<any>): void;
|
|
2214
|
-
registerUserRolesService(userRolesService: IAuthUserRolesService<any, any, any, any>): void;
|
|
2215
|
-
getUsersService<TUser extends IAuthUser, TUserRegistrationInfo>(): IAuthUserService<TUser, any, TUserRegistrationInfo>;
|
|
2216
|
-
getRoleService<TRole extends IAuthRole, TPermission extends IAuthPermission>(): IAuthRoleService<TRole, TPermission>;
|
|
2217
|
-
getPermissionService<TPermission extends IAuthPermission>(): IAuthPermissionService<TPermission>;
|
|
2218
|
-
getUserRoleService<TUser extends IAuthUser, TRole extends IAuthRole, TPermission extends IAuthPermission, TAuthOrganizationalUnit extends IAuthOrganizationalUnit>(): IAuthUserRolesService<TUser, TRole, TPermission, TAuthOrganizationalUnit>;
|
|
2218
|
+
declare class PipelineUtils<TPipelineInput, TPipelineOutput, TContext> {
|
|
2219
|
+
getStep: (step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
2220
|
+
getStepInput: <TStepInput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
2221
|
+
getStepOutput: <TStepOutput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
2219
2222
|
}
|
|
2220
2223
|
|
|
2221
|
-
declare class
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2224
|
+
declare abstract class NestPipelineTemplate<TPipelineInput, TPipelineOutput, TContext> {
|
|
2225
|
+
protected readonly logger: _punks_backend_core.ILogger;
|
|
2226
|
+
protected readonly utils: PipelineUtils<TPipelineInput, TPipelineOutput, TContext>;
|
|
2227
|
+
private cachedDefinition;
|
|
2228
|
+
protected abstract buildTemplate(builder: IPipelineTemplateBuilder<TPipelineInput, TContext>): PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>;
|
|
2229
|
+
protected isAuthorized(context: TContext): boolean;
|
|
2230
|
+
invoke(input: TPipelineInput): Promise<TPipelineOutput>;
|
|
2231
|
+
execute(data: {
|
|
2232
|
+
input: TPipelineInput;
|
|
2233
|
+
context: TContext;
|
|
2234
|
+
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
2235
|
+
private getDefinition;
|
|
2236
|
+
private buildDefinition;
|
|
2237
|
+
private getContext;
|
|
2238
|
+
private get controller();
|
|
2239
|
+
private get registry();
|
|
2240
|
+
protected get metadata(): PipelineTemplateProps;
|
|
2227
2241
|
}
|
|
2228
2242
|
|
|
2229
|
-
declare class
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
userId: string;
|
|
2235
|
-
}): Promise<string>;
|
|
2236
|
-
verifyPassword(input: {
|
|
2237
|
-
password: string;
|
|
2238
|
-
userId: string;
|
|
2239
|
-
hash: string;
|
|
2240
|
-
}): Promise<{
|
|
2241
|
-
isMatching: boolean;
|
|
2242
|
-
}>;
|
|
2243
|
-
private buildUserSalt;
|
|
2243
|
+
declare class PipelineInvocationError extends Error {
|
|
2244
|
+
readonly errorType: PipelineErrorType;
|
|
2245
|
+
readonly innerError: Error | undefined;
|
|
2246
|
+
readonly rawResult: PipelineResult<unknown, unknown>;
|
|
2247
|
+
constructor(errorType: PipelineErrorType, innerError: Error | undefined, rawResult: PipelineResult<unknown, unknown>, message?: string);
|
|
2244
2248
|
}
|
|
2245
2249
|
|
|
2246
|
-
declare class
|
|
2247
|
-
|
|
2248
|
-
private readonly passwordHashingProvider;
|
|
2249
|
-
private readonly emailService;
|
|
2250
|
-
private readonly jwtProvider;
|
|
2251
|
-
private readonly logger;
|
|
2252
|
-
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider, emailService: EmailService, jwtProvider: JwtProvider);
|
|
2253
|
-
execute<TUserRegistrationInfo, TContext extends IAuthUserContext>(input: UserRegistrationInput<TUserRegistrationInfo, TContext>): Promise<UserRegistrationResult>;
|
|
2254
|
-
private createPasswordHash;
|
|
2255
|
-
private sendRegistrationEmail;
|
|
2256
|
-
private generateEmailVerifyToken;
|
|
2257
|
-
private createUser;
|
|
2258
|
-
private resolveUser;
|
|
2250
|
+
declare class AwsS3BucketError extends Error {
|
|
2251
|
+
constructor(message: string);
|
|
2259
2252
|
}
|
|
2260
2253
|
|
|
2261
|
-
declare class
|
|
2262
|
-
private
|
|
2263
|
-
constructor(
|
|
2264
|
-
|
|
2254
|
+
declare class AppInMemorySettings<T> {
|
|
2255
|
+
private _instance;
|
|
2256
|
+
constructor();
|
|
2257
|
+
initialize(value: T): void;
|
|
2258
|
+
get value(): T;
|
|
2265
2259
|
}
|
|
2266
2260
|
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2261
|
+
type AwsBucketPaths = {
|
|
2262
|
+
filesUpload: string;
|
|
2263
|
+
};
|
|
2264
|
+
type AwsBucketSettings = {
|
|
2265
|
+
awsAccessKeyId?: string;
|
|
2266
|
+
awsSecretAccessKey?: string;
|
|
2267
|
+
region?: string;
|
|
2268
|
+
defaultBucket: string;
|
|
2269
|
+
publicLinksExpirationMinutes: number;
|
|
2270
|
+
paths: AwsBucketPaths;
|
|
2271
|
+
};
|
|
2272
2272
|
|
|
2273
|
-
declare class
|
|
2274
|
-
|
|
2275
|
-
private readonly passwordHashingProvider;
|
|
2276
|
-
private readonly jwtProvider;
|
|
2277
|
-
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider, jwtProvider: JwtProvider);
|
|
2278
|
-
execute<TUserContext extends IAuthUserContext>(input: UserLoginInput<TUserContext>): Promise<UserLoginResult>;
|
|
2279
|
-
private generateUserJwtToken;
|
|
2280
|
-
private resolveUser;
|
|
2273
|
+
declare class AwsBucketModule {
|
|
2274
|
+
static forRoot(input: AwsBucketSettings): DynamicModule;
|
|
2281
2275
|
}
|
|
2282
2276
|
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2277
|
+
type BucketFolderListInput = {
|
|
2278
|
+
bucket: string;
|
|
2279
|
+
maxResults?: number;
|
|
2280
|
+
path?: string;
|
|
2281
|
+
};
|
|
2282
|
+
declare enum BucketItemType {
|
|
2283
|
+
File = "file",
|
|
2284
|
+
Folder = "folder"
|
|
2288
2285
|
}
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2286
|
+
type BucketContentItem = {
|
|
2287
|
+
type: BucketItemType;
|
|
2288
|
+
name: string;
|
|
2289
|
+
path: string;
|
|
2290
|
+
};
|
|
2291
|
+
type BucketFolderContentResult = {
|
|
2292
|
+
items: BucketContentItem[];
|
|
2293
|
+
};
|
|
2294
|
+
type BucketFolderListResult = {};
|
|
2295
|
+
type BucketFolderCreateInput = {
|
|
2296
|
+
bucket: string;
|
|
2297
|
+
path: string;
|
|
2298
|
+
};
|
|
2299
|
+
type BucketFolderEnsureInput = {
|
|
2300
|
+
bucket: string;
|
|
2301
|
+
path: string;
|
|
2302
|
+
};
|
|
2303
|
+
type BucketFolderExistsInput = {
|
|
2304
|
+
bucket: string;
|
|
2305
|
+
path: string;
|
|
2306
|
+
};
|
|
2307
|
+
type BucketFileDownloadInput = {
|
|
2308
|
+
bucket: string;
|
|
2309
|
+
filePath: string;
|
|
2310
|
+
};
|
|
2311
|
+
type BucketFilePublicUrlCreateInput = {
|
|
2312
|
+
bucket: string;
|
|
2313
|
+
filePath: string;
|
|
2314
|
+
expirationMinutes: number;
|
|
2315
|
+
};
|
|
2316
|
+
type BucketFileUploadInput = {
|
|
2317
|
+
bucket: string;
|
|
2318
|
+
filePath: string;
|
|
2319
|
+
content: Buffer;
|
|
2320
|
+
contentType?: string;
|
|
2321
|
+
};
|
|
2322
|
+
interface BucketFileDeleteInput {
|
|
2323
|
+
bucket: string;
|
|
2324
|
+
filePath: string;
|
|
2299
2325
|
}
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
private generatePasswordResetToken;
|
|
2309
|
-
private resolveUser;
|
|
2326
|
+
interface IBucketProvider {
|
|
2327
|
+
folderList(input: BucketFolderListInput): Promise<BucketFolderListResult>;
|
|
2328
|
+
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
2329
|
+
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
2330
|
+
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
2331
|
+
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
2332
|
+
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
2333
|
+
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
2310
2334
|
}
|
|
2311
2335
|
|
|
2312
|
-
declare class
|
|
2313
|
-
private readonly
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2336
|
+
declare class AwsS3BucketProvider implements IBucketProvider {
|
|
2337
|
+
private readonly client;
|
|
2338
|
+
constructor();
|
|
2339
|
+
folderList(input: BucketFolderListInput): Promise<BucketFolderListResult>;
|
|
2340
|
+
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
2341
|
+
folderCreate(input: BucketFolderEnsureInput): Promise<void>;
|
|
2342
|
+
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
2343
|
+
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
2344
|
+
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
2345
|
+
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
2346
|
+
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
2320
2347
|
}
|
|
2321
2348
|
|
|
2322
|
-
declare class
|
|
2323
|
-
private
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2349
|
+
declare class InMemoryBucketProvider implements IBucketProvider {
|
|
2350
|
+
private inMemoryStorage;
|
|
2351
|
+
private inMemoryFolders;
|
|
2352
|
+
folderList(input: BucketFolderListInput): Promise<BucketFolderListResult>;
|
|
2353
|
+
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
2354
|
+
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
2355
|
+
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
2356
|
+
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
2357
|
+
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
2358
|
+
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
2327
2359
|
}
|
|
2328
2360
|
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
}
|
|
2361
|
+
type AwsSesEmailTemplateData = {
|
|
2362
|
+
subjectTemplate: string;
|
|
2363
|
+
htmlTemplate: string;
|
|
2364
|
+
from?: string;
|
|
2365
|
+
to?: string[];
|
|
2366
|
+
cc?: string[];
|
|
2367
|
+
bcc?: string[];
|
|
2368
|
+
replyTo?: string;
|
|
2369
|
+
};
|
|
2339
2370
|
|
|
2340
|
-
declare class
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
private readonly logger;
|
|
2344
|
-
constructor(services: AuthenticationServicesResolver, passwordHashingProvider: PasswordHashingProvider);
|
|
2345
|
-
execute<TUserRegistrationInfo, TContext extends IAuthUserContext>(input: UserCreationInput<TUserRegistrationInfo, TContext>): Promise<UserCreationResult>;
|
|
2346
|
-
private createPasswordHash;
|
|
2347
|
-
private createUser;
|
|
2348
|
-
private resolveUser;
|
|
2371
|
+
declare abstract class AwsSesEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<AwsSesEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
2372
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
2373
|
+
getTemplateData(payload: TAugmentedPayload): Promise<AwsSesEmailTemplateData>;
|
|
2349
2374
|
}
|
|
2350
2375
|
|
|
2351
|
-
declare
|
|
2352
|
-
private readonly services;
|
|
2353
|
-
constructor(services: AuthenticationServicesResolver);
|
|
2354
|
-
execute(input: UserDeleteInput): Promise<void>;
|
|
2355
|
-
}
|
|
2376
|
+
declare const WpAwsSesEmailTemplate: (templateId: string, sendgridTemplateData: AwsSesEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
2356
2377
|
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2378
|
+
type AwsSesSettings = {
|
|
2379
|
+
awsAccessKeyId?: string;
|
|
2380
|
+
awsSecretAccessKey?: string;
|
|
2381
|
+
region?: string;
|
|
2382
|
+
defaultSender: string;
|
|
2383
|
+
defaultCc?: string[];
|
|
2384
|
+
defaultBcc?: string[];
|
|
2385
|
+
};
|
|
2364
2386
|
|
|
2365
|
-
declare class
|
|
2366
|
-
|
|
2367
|
-
private readonly jwtProvider;
|
|
2368
|
-
constructor(services: AuthenticationServicesResolver, jwtProvider: JwtProvider);
|
|
2369
|
-
execute<TUserContext extends IAuthUserContext>(input: UserImpersonateInput<TUserContext>): Promise<UserImpersonateResult>;
|
|
2370
|
-
private generateUserJwtToken;
|
|
2371
|
-
private resolveUser;
|
|
2387
|
+
declare class AwsEmailModule {
|
|
2388
|
+
static forRoot(input: AwsSesSettings): DynamicModule;
|
|
2372
2389
|
}
|
|
2373
2390
|
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
userImpersonate<TUserContext extends IAuthUserContext>(input: UserImpersonateInput<TUserContext>): Promise<UserImpersonateResult>;
|
|
2395
|
-
userLogin<TUserContext extends IAuthUserContext>(input: UserLoginInput<TUserContext>): Promise<UserLoginResult>;
|
|
2396
|
-
userPasswordChange(input: UserPasswordChangeInput): Promise<void>;
|
|
2397
|
-
userPasswordResetFinalize(input: UserPasswordResetCompleteInput): Promise<void>;
|
|
2398
|
-
userPasswordResetRequest<TUserContext extends IAuthUserContext>(input: UserPasswordResetRequestInput<TUserContext>): Promise<UserPasswordResetRequestResult>;
|
|
2399
|
-
userRegister<TUserRegistrationInfo, TUserContext extends IAuthUserContext>(input: UserRegistrationInput<TUserRegistrationInfo, TUserContext>): Promise<UserRegistrationResult>;
|
|
2400
|
-
userVerifyRequest<TUserContext extends IAuthUserContext>(input: UserVerifyRequestInput<TUserContext>): Promise<UserVerifyRequestResult>;
|
|
2401
|
-
userVerifyComplete(input: UserVerifyCompleteInput): Promise<void>;
|
|
2402
|
-
userTokenVerify<TUserContext extends IAuthUserContext>(input: UserTokenVerifyInput): Promise<UserTokenVerifyResult<TUserContext>>;
|
|
2403
|
-
get usersService(): IAuthUserService<IAuthUser, any, unknown>;
|
|
2404
|
-
get rolesService(): IAuthRoleService<IAuthRole, IAuthPermission>;
|
|
2405
|
-
get userRolesService(): IAuthUserRolesService<IAuthUser, IAuthRole, IAuthPermission, IAuthOrganizationalUnit>;
|
|
2391
|
+
type SendgridTemplateType = "template" | "html";
|
|
2392
|
+
type SendgridTemplateBaseData = {
|
|
2393
|
+
from?: string;
|
|
2394
|
+
to?: string[];
|
|
2395
|
+
cc?: string[];
|
|
2396
|
+
bcc?: string[];
|
|
2397
|
+
replyTo?: string;
|
|
2398
|
+
};
|
|
2399
|
+
type SendgridEmailTemplateData = SendgridTemplateBaseData & ({
|
|
2400
|
+
type: "template";
|
|
2401
|
+
sendgridTemplateId: string;
|
|
2402
|
+
} | {
|
|
2403
|
+
type: "html";
|
|
2404
|
+
subjectTemplate: string | LocalizedTexts;
|
|
2405
|
+
bodyTemplate: string | LocalizedTexts;
|
|
2406
|
+
});
|
|
2407
|
+
|
|
2408
|
+
declare abstract class SendgridEmailTemplate<TPayload, TAugmentedPayload = TPayload> implements IEmailTemplate<SendgridEmailTemplateData, TPayload, TAugmentedPayload> {
|
|
2409
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
2410
|
+
getTemplateData(payload: TAugmentedPayload): Promise<SendgridEmailTemplateData>;
|
|
2406
2411
|
}
|
|
2407
2412
|
|
|
2408
|
-
declare
|
|
2409
|
-
|
|
2410
|
-
|
|
2413
|
+
declare const WpSendgridEmailTemplate: (templateId: string, sendgridTemplateData: SendgridEmailTemplateData) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<Y> | undefined) => void;
|
|
2414
|
+
|
|
2415
|
+
type SendgridSettings = {
|
|
2416
|
+
apiKey: string;
|
|
2417
|
+
defaultSender: string;
|
|
2418
|
+
defaultReplyTo?: string;
|
|
2419
|
+
defaultCc?: string[];
|
|
2420
|
+
defaultBcc?: string[];
|
|
2421
|
+
loggingEnabled?: boolean;
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2424
|
+
declare class SendgridEmailModule {
|
|
2425
|
+
static forRoot(input: SendgridSettings): DynamicModule;
|
|
2411
2426
|
}
|
|
2412
2427
|
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2428
|
+
type SentEmail = {
|
|
2429
|
+
input: TemplatedEmailInput<unknown>;
|
|
2430
|
+
template: IEmailTemplate<void, unknown, unknown>;
|
|
2431
|
+
type: "templated";
|
|
2432
|
+
} | {
|
|
2433
|
+
input: HtmlEmailInput<unknown>;
|
|
2434
|
+
type: "html";
|
|
2435
|
+
};
|
|
2436
|
+
declare class InMemoryEmailProvider implements IEmailProvider<void> {
|
|
2437
|
+
private readonly sentEmails;
|
|
2438
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<void, TPayload, TAugmentedPayload>): Promise<void>;
|
|
2439
|
+
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
2440
|
+
getSentEmails(): SentEmail[];
|
|
2417
2441
|
}
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2442
|
+
|
|
2443
|
+
declare class NestEventEmitter implements IEventEmitter {
|
|
2444
|
+
private eventEmitter;
|
|
2445
|
+
constructor(eventEmitter: EventEmitter2);
|
|
2446
|
+
emit(event: string, ...args: any[]): Promise<void>;
|
|
2422
2447
|
}
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2448
|
+
|
|
2449
|
+
interface EntityManagerStaticProviders {
|
|
2450
|
+
modulesContainer: ModulesContainer$1;
|
|
2451
|
+
authenticationProvider?: IAuthenticationContextProvider<unknown>;
|
|
2452
|
+
settings: EntityManagerSettings;
|
|
2428
2453
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2454
|
+
declare class EntityManagerInitializer {
|
|
2455
|
+
private readonly discover;
|
|
2456
|
+
private readonly registry;
|
|
2457
|
+
private readonly eventEmitter;
|
|
2458
|
+
private readonly logger;
|
|
2459
|
+
constructor(discover: CustomDiscoveryService, registry: EntityManagerRegistry, eventEmitter: NestEventEmitter);
|
|
2460
|
+
initialize(app: INestApplicationContext, staticProviders: EntityManagerStaticProviders): Promise<void>;
|
|
2461
|
+
private registerAuthentication;
|
|
2462
|
+
private registerEntities;
|
|
2463
|
+
private executeInitializers;
|
|
2464
|
+
private executeSeeders;
|
|
2465
|
+
private registerFileProviders;
|
|
2466
|
+
private registerGlobalAuthenticationMiddlewares;
|
|
2467
|
+
private registerBucketProviders;
|
|
2468
|
+
private registerCacheInstances;
|
|
2469
|
+
private registerFilesReferenceRepositoryProviders;
|
|
2470
|
+
private registerEventTrackingProviders;
|
|
2471
|
+
private registerEmailLogger;
|
|
2472
|
+
private registerVersioningProviders;
|
|
2473
|
+
private registerEmailProviders;
|
|
2474
|
+
private registerEmailTemplates;
|
|
2475
|
+
private registerPipelinesServices;
|
|
2476
|
+
private initializeProviders;
|
|
2477
|
+
private discoverEntities;
|
|
2478
|
+
private discoverRepositories;
|
|
2479
|
+
private discoverVersioningProviders;
|
|
2480
|
+
private discoverQueryBuilders;
|
|
2481
|
+
private discoverConverters;
|
|
2482
|
+
private discoverSerializers;
|
|
2483
|
+
private discoverSnapshotService;
|
|
2484
|
+
private discoverAdapters;
|
|
2485
|
+
private discoverAuthMiddlewares;
|
|
2486
|
+
private discoverGlobalAuthenticationMiddlewares;
|
|
2487
|
+
private discoverAppInitializers;
|
|
2488
|
+
private discoverEntitySeeders;
|
|
2489
|
+
private discoverEmailTemplates;
|
|
2490
|
+
private discoverEmailProviders;
|
|
2491
|
+
private discoverEventTrackingProviders;
|
|
2492
|
+
private discoverEmailLogger;
|
|
2493
|
+
private discoverBucketProviders;
|
|
2494
|
+
private discoverCacheInstances;
|
|
2495
|
+
private discoverFileProviders;
|
|
2496
|
+
private discoverFilesReferenceRepositoryProviders;
|
|
2434
2497
|
}
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
name: string;
|
|
2439
|
-
company: IAppCompany;
|
|
2498
|
+
|
|
2499
|
+
declare class AppSessionMiddleware implements NestMiddleware {
|
|
2500
|
+
use(req: Request, res: Response, next: NextFunction): void;
|
|
2440
2501
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2502
|
+
|
|
2503
|
+
declare class EntityManagerModule implements OnModuleInit {
|
|
2504
|
+
private readonly registry;
|
|
2505
|
+
constructor(registry: EntityManagerRegistry);
|
|
2506
|
+
onModuleInit(): void;
|
|
2444
2507
|
}
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
uid
|
|
2448
|
-
userName: string;
|
|
2449
|
-
email: string;
|
|
2450
|
-
verified: boolean;
|
|
2451
|
-
disabled: boolean;
|
|
2452
|
-
profile: IAppUserProfile;
|
|
2453
|
-
tenant: IAppTenant;
|
|
2454
|
-
directory: IAppDirectory;
|
|
2455
|
-
organization?: IAppOrganization;
|
|
2508
|
+
|
|
2509
|
+
interface IAuthenticationUserRole {
|
|
2510
|
+
uid: string;
|
|
2456
2511
|
}
|
|
2457
|
-
interface
|
|
2458
|
-
id: string;
|
|
2512
|
+
interface IAuthenticationUserPermission {
|
|
2459
2513
|
uid: string;
|
|
2460
|
-
name: string;
|
|
2461
|
-
disabled: boolean;
|
|
2462
|
-
isBuiltIn: boolean;
|
|
2463
|
-
organization?: IAppOrganization;
|
|
2464
2514
|
}
|
|
2465
|
-
interface
|
|
2515
|
+
interface IAuthenticationOrganizationalUnit {
|
|
2466
2516
|
id: string;
|
|
2467
2517
|
uid: string;
|
|
2468
|
-
name: string;
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
interface IMultiTenantEntity {
|
|
2472
|
-
tenant: IAppTenant;
|
|
2473
2518
|
}
|
|
2474
|
-
interface
|
|
2475
|
-
|
|
2519
|
+
interface IAuthenticationContext<TUserContextData> {
|
|
2520
|
+
isAuthenticated: boolean;
|
|
2521
|
+
isAnonymous: boolean;
|
|
2522
|
+
userId?: string;
|
|
2523
|
+
userContext?: TUserContextData;
|
|
2524
|
+
userRoles?: IAuthenticationUserRole[];
|
|
2525
|
+
userPermissions?: IAuthenticationUserPermission[];
|
|
2526
|
+
userOrganizationalUnits?: IAuthenticationOrganizationalUnit[];
|
|
2476
2527
|
}
|
|
2477
|
-
interface
|
|
2478
|
-
|
|
2528
|
+
interface IAuthenticationContextProvider<TUserContext> {
|
|
2529
|
+
getContext(): Promise<IAuthenticationContext<TUserContext>>;
|
|
2479
2530
|
}
|
|
2480
|
-
|
|
2481
|
-
|
|
2531
|
+
interface IAuthenticationData {
|
|
2532
|
+
user: IAuthUser;
|
|
2533
|
+
roles: IAuthenticationUserRole[];
|
|
2534
|
+
permissions: IAuthenticationUserPermission[];
|
|
2535
|
+
organizationalUnits: IAuthenticationOrganizationalUnit[];
|
|
2482
2536
|
}
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
contentType: string;
|
|
2487
|
-
name: string;
|
|
2488
|
-
}) => StreamableFile;
|
|
2489
|
-
|
|
2490
|
-
declare abstract class NestTypeOrmQueryBuilder<TEntity extends ObjectLiteral, TEntityId, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, number>, TSorting extends SortingType, TFacets extends IEntityFacets, TUserContext> extends TypeOrmQueryBuilder<TEntity, TEntityId, TEntitySearchParameters, TSorting, TFacets, TUserContext> {
|
|
2491
|
-
constructor(entityName: string, registry: EntityManagerRegistry);
|
|
2537
|
+
interface IAuthenticationMiddleware<TAuthenticationData extends IAuthenticationData, TOutput> {
|
|
2538
|
+
processContext(data: TAuthenticationData): Promise<TOutput>;
|
|
2539
|
+
getPriority(): number;
|
|
2492
2540
|
}
|
|
2493
2541
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2542
|
+
type CacheTtl = {
|
|
2543
|
+
value: number;
|
|
2544
|
+
unit: "years" | "months" | "days" | "hours" | "minutes" | "seconds";
|
|
2545
|
+
};
|
|
2546
|
+
type CacheEntryInfo = {
|
|
2547
|
+
instanceName: string;
|
|
2548
|
+
key: string;
|
|
2549
|
+
expiration: Date;
|
|
2550
|
+
createdOn: Date;
|
|
2551
|
+
updatedOn: Date;
|
|
2552
|
+
};
|
|
2553
|
+
type CacheEntryDetail = CacheEntryInfo & {
|
|
2554
|
+
data: any;
|
|
2555
|
+
};
|
|
2556
|
+
interface ICacheInstance {
|
|
2557
|
+
getInstanceName(): string;
|
|
2558
|
+
getEntries(): Promise<CacheEntryInfo[]>;
|
|
2559
|
+
getEntry(key: string): Promise<CacheEntryDetail | undefined>;
|
|
2560
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
2561
|
+
set<T>(key: string, input: {
|
|
2562
|
+
value: T;
|
|
2563
|
+
ttl: CacheTtl;
|
|
2564
|
+
}): Promise<void>;
|
|
2565
|
+
retrieve<T>(key: string, input: {
|
|
2566
|
+
ttl: CacheTtl;
|
|
2567
|
+
valueFactory: () => Promise<T>;
|
|
2568
|
+
}): Promise<T>;
|
|
2569
|
+
delete(key: string): Promise<void>;
|
|
2570
|
+
clear(): Promise<void>;
|
|
2496
2571
|
}
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
protected exists(condition: FindOneOptions<TEntity>): Promise<boolean>;
|
|
2500
|
-
protected create(entity: TEntity): Promise<void>;
|
|
2501
|
-
protected abstract getRepository(): Repository<TEntity>;
|
|
2572
|
+
interface ICache {
|
|
2573
|
+
getInstance(instanceName: string): Promise<ICacheInstance>;
|
|
2502
2574
|
}
|
|
2503
2575
|
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
protected readonly metadata: EntitySeederProps;
|
|
2507
|
-
constructor(registry: EntityManagerRegistry);
|
|
2508
|
-
get priority(): number | undefined;
|
|
2509
|
-
protected getRepository(): Repository<TEntity>;
|
|
2576
|
+
interface IEntitySnapshotService<TEntityId, TEntitySnapshot> {
|
|
2577
|
+
getSnapshot(id: TEntityId): Promise<TEntitySnapshot>;
|
|
2510
2578
|
}
|
|
2511
2579
|
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2580
|
+
type EntitiesMapOperationsInput<TEntitiesQueryBuilder> = {
|
|
2581
|
+
queryBuilder: TEntitiesQueryBuilder;
|
|
2582
|
+
settings: EntityManagerSettings;
|
|
2583
|
+
};
|
|
2584
|
+
interface IEntityManagerServiceRoot {
|
|
2585
|
+
locator: ServiceLocator;
|
|
2586
|
+
getEntitiesServicesLocator(): EntitiesServiceLocator;
|
|
2587
|
+
getEntityServicesLocator<TEntity, TEntityId>(entityName: string): EntityServiceLocator<TEntity, TEntityId>;
|
|
2588
|
+
addAuthentication<TAuthenticationContextProvider extends IAuthenticationContextProvider<TUserContext>, TUserContext>({ provider, }: {
|
|
2589
|
+
provider: TAuthenticationContextProvider;
|
|
2590
|
+
}): void;
|
|
2591
|
+
registerEntity<TEntity, TEntityId, TRepository extends IEntityRepository<TEntity, TEntityId, unknown, unknown, unknown, unknown>>(entity: IEntityConfiguration, repository: TRepository): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2516
2592
|
}
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2593
|
+
interface IEntityManagerServiceCollection<TEntity, TEntityId> {
|
|
2594
|
+
getServiceLocator(): EntityServiceLocator<TEntity, TEntityId>;
|
|
2595
|
+
mapCrudOperations<TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TFacets extends IEntityFacets, TEntitiesQueryBuilder extends IEntitiesQueryBuilder<TEntity, unknown, TEntitySearchParameters, TSorting, TCursor, TFacets, unknown>>(input: EntitiesMapOperationsInput<TEntitiesQueryBuilder>): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2596
|
+
addSerializer<TEntitySerializer extends IEntitySerializer<TEntity, TEntityId, unknown, unknown>>(serializer: TEntitySerializer): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2597
|
+
addSnapshotService<TEntitySnapshotService extends IEntitySnapshotService<TEntityId, unknown>>(service: TEntitySnapshotService): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2598
|
+
addConverter<TEntityDto, TListItemDto, TEntityCreateInput, TEntityUpdateInput, TEntityConverter extends IEntityConverter<TEntity, TEntityDto, TListItemDto, TEntityCreateInput, TEntityUpdateInput>>(converter: TEntityConverter): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2599
|
+
addAdapter<TEntityCreateData, TEntityUpdateData, TEntityAdapter extends IEntityAdapter<TEntity, TEntityCreateData, TEntityUpdateData>>(adapter: TEntityAdapter): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2600
|
+
addAuthorization<TEntityAuthorizationMiddleware extends IEntityAuthorizationMiddleware<TEntity, TAuthenticationContext, TUserContext>, TAuthenticationContext extends IAuthenticationContext<TUserContext>, TUserContext>({ middleware, }: {
|
|
2601
|
+
middleware: TEntityAuthorizationMiddleware;
|
|
2602
|
+
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2603
|
+
withReplica<TRepository extends IEntityRepository<TEntity, TEntityId, unknown, unknown, unknown, unknown>>({ name, options, repository, }: {
|
|
2604
|
+
name: string;
|
|
2605
|
+
options: ReplicaOptions;
|
|
2606
|
+
repository: TRepository;
|
|
2607
|
+
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2608
|
+
withSynchronization<TMappedType, TMapper extends IEntityMapper<TEntity, TMappedType>, TEntityConnector extends IEntityConnector<TEntity, TMappedType>>({ name, options, connector, mapper, }: {
|
|
2609
|
+
name: string;
|
|
2610
|
+
options: ConnectorOptions;
|
|
2611
|
+
connector: TEntityConnector;
|
|
2612
|
+
mapper: TMapper;
|
|
2613
|
+
}): IEntityManagerServiceCollection<TEntity, TEntityId>;
|
|
2525
2614
|
}
|
|
2526
2615
|
|
|
2527
|
-
interface
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
interface IPipelineStepOperationBuilder<TStepInput, TStepOutput, TPipelineInput, TContext> {
|
|
2531
|
-
addOperation(operation: OperationDefinition<TStepInput, TStepOutput, TStepInput, TPipelineInput, TContext>): IPipelineStepOperationOptionsBuilder<TStepInput, TStepOutput, TStepInput, TPipelineInput, TContext>;
|
|
2532
|
-
}
|
|
2533
|
-
interface IPipelineStepBuilder<TStepInput, TStepOutput, TPipelineInput, TContext> {
|
|
2534
|
-
addStep<TNextStepOutput>(builder: (step: IPipelineStepOperationBuilder<TStepOutput, TNextStepOutput, TPipelineInput, TContext>) => void): IPipelineStepBuilder<TStepOutput, TNextStepOutput, TPipelineInput, TContext>;
|
|
2535
|
-
complete(): PipelineDefinition<TPipelineInput, TStepOutput, TContext>;
|
|
2616
|
+
interface IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload = TPayload> {
|
|
2617
|
+
processPayload(payload: TPayload): Promise<TAugmentedPayload>;
|
|
2618
|
+
getTemplateData(payload: TAugmentedPayload): Promise<TTemplateData>;
|
|
2536
2619
|
}
|
|
2537
|
-
interface
|
|
2538
|
-
|
|
2620
|
+
interface IEmailTemplatesCollection {
|
|
2621
|
+
registerTemplate(id: string, template: IEmailTemplate<unknown, unknown, unknown>): void;
|
|
2622
|
+
getTemplate<TTemplateData, TPayload, TAugmentedPayload = TPayload>(id: string): IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload>;
|
|
2539
2623
|
}
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2624
|
+
type TemplatedEmailInput<TPayload> = {
|
|
2625
|
+
from?: string;
|
|
2626
|
+
to?: string[];
|
|
2627
|
+
cc?: string[];
|
|
2628
|
+
bcc?: string[];
|
|
2629
|
+
subjectTemplate?: string;
|
|
2630
|
+
templateId: string;
|
|
2631
|
+
languageCode: string;
|
|
2632
|
+
payload: TPayload;
|
|
2633
|
+
};
|
|
2634
|
+
interface HtmlEmailInput<TPayload> {
|
|
2635
|
+
replyTo?: string;
|
|
2636
|
+
from?: string;
|
|
2637
|
+
to?: string[];
|
|
2638
|
+
cc?: string[];
|
|
2639
|
+
bcc?: string[];
|
|
2640
|
+
subjectTemplate: string;
|
|
2641
|
+
bodyTemplate: string;
|
|
2642
|
+
payload: TPayload;
|
|
2545
2643
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
constructor(registry: EntityManagerRegistry);
|
|
2550
|
-
invokePipeline<TPipelineInput, TPipelineOutput, TContext>(definition: PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>, data: {
|
|
2551
|
-
input: TPipelineInput;
|
|
2552
|
-
context: TContext;
|
|
2553
|
-
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
2554
|
-
private get controller();
|
|
2644
|
+
interface IEmailProvider<TTemplateData> {
|
|
2645
|
+
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<TTemplateData, TPayload, TAugmentedPayload>): Promise<void>;
|
|
2646
|
+
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
2555
2647
|
}
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
getStepInput: <TStepInput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
2560
|
-
getStepOutput: <TStepOutput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
2648
|
+
interface IEmailLogger {
|
|
2649
|
+
logTemplatedEmail<TPayload>(input: TemplatedEmailInput<TPayload>): Promise<void>;
|
|
2650
|
+
logHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
2561
2651
|
}
|
|
2562
2652
|
|
|
2563
|
-
declare
|
|
2564
|
-
|
|
2565
|
-
protected readonly utils: PipelineUtils<TPipelineInput, TPipelineOutput, TContext>;
|
|
2566
|
-
private cachedDefinition;
|
|
2567
|
-
protected abstract buildTemplate(builder: IPipelineTemplateBuilder<TPipelineInput, TContext>): PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>;
|
|
2568
|
-
protected isAuthorized(context: TContext): boolean;
|
|
2569
|
-
invoke(input: TPipelineInput): Promise<TPipelineOutput>;
|
|
2570
|
-
execute(data: {
|
|
2571
|
-
input: TPipelineInput;
|
|
2572
|
-
context: TContext;
|
|
2573
|
-
}): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
2574
|
-
private getDefinition;
|
|
2575
|
-
private buildDefinition;
|
|
2576
|
-
private getContext;
|
|
2577
|
-
private get controller();
|
|
2578
|
-
private get registry();
|
|
2579
|
-
protected get metadata(): PipelineTemplateProps;
|
|
2653
|
+
declare class EntityManagerException extends Error {
|
|
2654
|
+
constructor(message: string);
|
|
2580
2655
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2656
|
+
declare enum EntityOperationType {
|
|
2657
|
+
Create = 0,
|
|
2658
|
+
Update = 1,
|
|
2659
|
+
Delete = 2,
|
|
2660
|
+
Read = 3,
|
|
2661
|
+
Search = 4,
|
|
2662
|
+
Find = 5
|
|
2587
2663
|
}
|
|
2588
|
-
|
|
2589
|
-
declare class AwsS3BucketError extends Error {
|
|
2664
|
+
declare abstract class EntityManagerUnauthorizedException extends EntityManagerException {
|
|
2590
2665
|
constructor(message: string);
|
|
2591
2666
|
}
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
private
|
|
2595
|
-
constructor();
|
|
2596
|
-
|
|
2597
|
-
get
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
type AwsBucketPaths = {
|
|
2601
|
-
filesUpload: string;
|
|
2602
|
-
};
|
|
2603
|
-
type AwsBucketSettings = {
|
|
2604
|
-
awsAccessKeyId?: string;
|
|
2605
|
-
awsSecretAccessKey?: string;
|
|
2606
|
-
region?: string;
|
|
2607
|
-
defaultBucket: string;
|
|
2608
|
-
publicLinksExpirationMinutes: number;
|
|
2609
|
-
paths: AwsBucketPaths;
|
|
2610
|
-
};
|
|
2611
|
-
|
|
2612
|
-
declare class AwsBucketModule {
|
|
2613
|
-
static forRoot(input: AwsBucketSettings): DynamicModule;
|
|
2667
|
+
declare class EntityOperationUnauthorizedException<TEntity> extends EntityManagerUnauthorizedException {
|
|
2668
|
+
private readonly operation;
|
|
2669
|
+
private readonly entity?;
|
|
2670
|
+
constructor(operationType: EntityOperationType, entityName: string, entity?: DeepPartial<TEntity>);
|
|
2671
|
+
get getEntity(): DeepPartial<TEntity> | undefined;
|
|
2672
|
+
get getOperation(): EntityOperationType;
|
|
2614
2673
|
}
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2674
|
+
declare class EntityNotFoundException<TEntityId> extends EntityManagerException {
|
|
2675
|
+
private readonly entityId;
|
|
2676
|
+
constructor(id?: TEntityId);
|
|
2677
|
+
getEntityId(): TEntityId | undefined;
|
|
2678
|
+
}
|
|
2679
|
+
declare class MultipleEntitiesFoundException extends EntityManagerException {
|
|
2618
2680
|
constructor();
|
|
2619
|
-
folderList(input: BucketFolderListInput): Promise<BucketFolderListResult>;
|
|
2620
|
-
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
2621
|
-
folderCreate(input: BucketFolderEnsureInput): Promise<void>;
|
|
2622
|
-
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
2623
|
-
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
2624
|
-
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
2625
|
-
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
2626
|
-
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
2627
2681
|
}
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
folderEnsure(input: BucketFolderEnsureInput): Promise<void>;
|
|
2634
|
-
folderExists(input: BucketFolderExistsInput): Promise<boolean>;
|
|
2635
|
-
fileDownload(input: BucketFileDownloadInput): Promise<Buffer>;
|
|
2636
|
-
filePublicUrlCreate(input: BucketFilePublicUrlCreateInput): Promise<string>;
|
|
2637
|
-
fileUpload(input: BucketFileUploadInput): Promise<void>;
|
|
2638
|
-
fileDelete(input: BucketFileDeleteInput): Promise<void>;
|
|
2682
|
+
declare class EntityManagerConfigurationError extends EntityManagerException {
|
|
2683
|
+
constructor(message: string);
|
|
2684
|
+
}
|
|
2685
|
+
declare class MissingEntityIdError extends EntityManagerException {
|
|
2686
|
+
constructor();
|
|
2639
2687
|
}
|
|
2640
2688
|
|
|
2641
|
-
type
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
bcc?: string[];
|
|
2648
|
-
replyTo?: string;
|
|
2689
|
+
type FileData = {
|
|
2690
|
+
content: Buffer;
|
|
2691
|
+
contentType: string;
|
|
2692
|
+
fileName: string;
|
|
2693
|
+
folderPath: string;
|
|
2694
|
+
metadata?: Record<string, any>;
|
|
2649
2695
|
};
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2696
|
+
type FileDownloadUrl = {
|
|
2697
|
+
downloadUrl: string;
|
|
2698
|
+
contentType: string;
|
|
2699
|
+
fileName: string;
|
|
2700
|
+
};
|
|
2701
|
+
type FileReference = {
|
|
2702
|
+
fileId: string;
|
|
2703
|
+
reference: string;
|
|
2704
|
+
providerId: string;
|
|
2705
|
+
};
|
|
2706
|
+
interface IFileManager {
|
|
2707
|
+
uploadFile(file: FileData): Promise<FileReference>;
|
|
2708
|
+
getFileContent(fileId: string): Promise<FileData>;
|
|
2709
|
+
getFileDownloadUrl(fileId: string): Promise<FileDownloadUrl>;
|
|
2654
2710
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
defaultCc?: string[];
|
|
2664
|
-
defaultBcc?: string[];
|
|
2711
|
+
type FilesReferenceData = {
|
|
2712
|
+
reference: string;
|
|
2713
|
+
providerId: string;
|
|
2714
|
+
metadata?: Record<string, any>;
|
|
2715
|
+
fileName: string;
|
|
2716
|
+
filePath: string;
|
|
2717
|
+
fileSize: number;
|
|
2718
|
+
contentType: string;
|
|
2665
2719
|
};
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2720
|
+
type FileReferenceRecord = FilesReferenceData & {
|
|
2721
|
+
fileId: string;
|
|
2722
|
+
createdOn: Date;
|
|
2723
|
+
updatedOn: Date;
|
|
2724
|
+
};
|
|
2725
|
+
interface IFilesReferenceRepository {
|
|
2726
|
+
getReference(fileId: string): Promise<FileReferenceRecord>;
|
|
2727
|
+
createReference(file: FilesReferenceData): Promise<FileReferenceRecord>;
|
|
2728
|
+
updateReference(fileId: string, file: FilesReferenceData): Promise<FileReferenceRecord>;
|
|
2729
|
+
deleteReference(fileId: string): Promise<void>;
|
|
2669
2730
|
}
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
type SendgridTemplateBaseData = {
|
|
2673
|
-
from?: string;
|
|
2674
|
-
to?: string[];
|
|
2675
|
-
cc?: string[];
|
|
2676
|
-
bcc?: string[];
|
|
2677
|
-
replyTo?: string;
|
|
2731
|
+
type FileProviderReference = {
|
|
2732
|
+
reference: string;
|
|
2678
2733
|
};
|
|
2679
|
-
type
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2734
|
+
type FileProviderUploadData = {
|
|
2735
|
+
fileName: string;
|
|
2736
|
+
content: Buffer;
|
|
2737
|
+
contentType: string;
|
|
2738
|
+
};
|
|
2739
|
+
type FileProviderDownloadData = {
|
|
2740
|
+
content: Buffer;
|
|
2741
|
+
};
|
|
2742
|
+
type FileProviderDownloadUrl = {
|
|
2743
|
+
downloadUrl: string;
|
|
2744
|
+
};
|
|
2745
|
+
interface IFileProvider {
|
|
2746
|
+
getProviderId(): string;
|
|
2747
|
+
uploadFile(file: FileProviderUploadData): Promise<FileProviderReference>;
|
|
2748
|
+
deleteFile(reference: FileProviderReference): Promise<void>;
|
|
2749
|
+
downloadFile(reference: FileProviderReference): Promise<FileProviderDownloadData>;
|
|
2750
|
+
getFileProviderDownloadUrl(reference: FileProviderReference): Promise<FileProviderDownloadUrl>;
|
|
2691
2751
|
}
|
|
2692
2752
|
|
|
2693
|
-
|
|
2753
|
+
type FilterExpression<TEntity> = (entity: TEntity) => boolean;
|
|
2694
2754
|
|
|
2695
|
-
type
|
|
2696
|
-
|
|
2697
|
-
defaultSender: string;
|
|
2698
|
-
defaultReplyTo?: string;
|
|
2699
|
-
defaultCc?: string[];
|
|
2700
|
-
defaultBcc?: string[];
|
|
2701
|
-
loggingEnabled?: boolean;
|
|
2755
|
+
type LocalizedMap<T> = {
|
|
2756
|
+
[key: string]: T;
|
|
2702
2757
|
};
|
|
2758
|
+
type LocalizedTexts = LocalizedMap<string>;
|
|
2703
2759
|
|
|
2704
|
-
|
|
2705
|
-
|
|
2760
|
+
interface IEventLog<TPayload> {
|
|
2761
|
+
type: string;
|
|
2762
|
+
payload?: TPayload;
|
|
2763
|
+
userId?: string;
|
|
2764
|
+
userName?: string;
|
|
2765
|
+
timestamp: Date;
|
|
2706
2766
|
}
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
input: TemplatedEmailInput<unknown>;
|
|
2710
|
-
template: IEmailTemplate<void, unknown, unknown>;
|
|
2711
|
-
type: "templated";
|
|
2712
|
-
} | {
|
|
2713
|
-
input: HtmlEmailInput<unknown>;
|
|
2714
|
-
type: "html";
|
|
2715
|
-
};
|
|
2716
|
-
declare class InMemoryEmailProvider implements IEmailProvider<void> {
|
|
2717
|
-
private readonly sentEmails;
|
|
2718
|
-
sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<void, TPayload, TAugmentedPayload>): Promise<void>;
|
|
2719
|
-
sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
|
|
2720
|
-
getSentEmails(): SentEmail[];
|
|
2767
|
+
interface IEventsTracker<TEventLog extends IEventLog<unknown>> {
|
|
2768
|
+
track(log: TEventLog): Promise<void>;
|
|
2721
2769
|
}
|
|
2722
2770
|
|
|
2723
|
-
declare
|
|
2724
|
-
private eventEmitter;
|
|
2725
|
-
constructor(eventEmitter: EventEmitter2);
|
|
2726
|
-
emit(event: string, ...args: any[]): Promise<void>;
|
|
2727
|
-
}
|
|
2771
|
+
declare const createContainer: () => IEntityManagerServiceRoot;
|
|
2728
2772
|
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
}
|
|
2734
|
-
declare class EntityManagerInitializer {
|
|
2735
|
-
private readonly discover;
|
|
2736
|
-
private readonly registry;
|
|
2737
|
-
private readonly eventEmitter;
|
|
2738
|
-
private readonly logger;
|
|
2739
|
-
constructor(discover: CustomDiscoveryService, registry: EntityManagerRegistry, eventEmitter: NestEventEmitter);
|
|
2740
|
-
initialize(app: INestApplicationContext, staticProviders: EntityManagerStaticProviders): Promise<void>;
|
|
2741
|
-
private registerAuthentication;
|
|
2742
|
-
private registerEntities;
|
|
2743
|
-
private executeInitializers;
|
|
2744
|
-
private executeSeeders;
|
|
2745
|
-
private registerFileProviders;
|
|
2746
|
-
private registerGlobalAuthenticationMiddlewares;
|
|
2747
|
-
private registerBucketProviders;
|
|
2748
|
-
private registerCacheInstances;
|
|
2749
|
-
private registerFilesReferenceRepositoryProviders;
|
|
2750
|
-
private registerEventTrackingProviders;
|
|
2751
|
-
private registerEmailLogger;
|
|
2752
|
-
private registerVersioningProviders;
|
|
2753
|
-
private registerEmailProviders;
|
|
2754
|
-
private registerEmailTemplates;
|
|
2755
|
-
private registerPipelinesServices;
|
|
2756
|
-
private initializeProviders;
|
|
2757
|
-
private discoverEntities;
|
|
2758
|
-
private discoverRepositories;
|
|
2759
|
-
private discoverVersioningProviders;
|
|
2760
|
-
private discoverQueryBuilders;
|
|
2761
|
-
private discoverConverters;
|
|
2762
|
-
private discoverSerializers;
|
|
2763
|
-
private discoverSnapshotService;
|
|
2764
|
-
private discoverAdapters;
|
|
2765
|
-
private discoverAuthMiddlewares;
|
|
2766
|
-
private discoverGlobalAuthenticationMiddlewares;
|
|
2767
|
-
private discoverAppInitializers;
|
|
2768
|
-
private discoverEntitySeeders;
|
|
2769
|
-
private discoverEmailTemplates;
|
|
2770
|
-
private discoverEmailProviders;
|
|
2771
|
-
private discoverEventTrackingProviders;
|
|
2772
|
-
private discoverEmailLogger;
|
|
2773
|
-
private discoverBucketProviders;
|
|
2774
|
-
private discoverCacheInstances;
|
|
2775
|
-
private discoverFileProviders;
|
|
2776
|
-
private discoverFilesReferenceRepositoryProviders;
|
|
2777
|
-
}
|
|
2773
|
+
declare const toEntitiesImportInput: <TPayload>(request: {
|
|
2774
|
+
format: EntitySerializationFormat;
|
|
2775
|
+
file: Express.Multer.File;
|
|
2776
|
+
payload?: TPayload | undefined;
|
|
2777
|
+
}) => EntitiesImportInput<TPayload>;
|
|
2778
2778
|
|
|
2779
|
-
declare
|
|
2780
|
-
|
|
2781
|
-
|
|
2779
|
+
declare const PLATFORM_EVENT_NAMESPACE = "platform";
|
|
2780
|
+
declare const PlatformEvents: {
|
|
2781
|
+
Messaging: {
|
|
2782
|
+
EmailSent: string;
|
|
2783
|
+
};
|
|
2784
|
+
};
|
|
2782
2785
|
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2786
|
+
interface MessagingEmailSentPayload {
|
|
2787
|
+
from?: string;
|
|
2788
|
+
to?: string[];
|
|
2789
|
+
cc?: string[];
|
|
2790
|
+
bcc?: string[];
|
|
2791
|
+
subject?: string;
|
|
2792
|
+
body?: string;
|
|
2793
|
+
payload?: any;
|
|
2794
|
+
request?: any;
|
|
2787
2795
|
}
|
|
2788
2796
|
|
|
2789
2797
|
declare const getLocalizedText: (item: string | LocalizedTexts, languageId: string, defaultLanguageId?: string) => string;
|
|
@@ -2795,4 +2803,4 @@ declare const renderHandlebarsTemplate: <TContext extends object>(input: {
|
|
|
2795
2803
|
|
|
2796
2804
|
declare const newUuid: () => string;
|
|
2797
2805
|
|
|
2798
|
-
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppPermission, AppRole, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationModuleSettings, AuthenticationService, AwsBucketModule, AwsBucketSettings, AwsEmailModule, AwsS3BucketError as AwsS2BucketError, AwsS3BucketProvider, AwsSesEmailTemplate, AwsSesEmailTemplateData, AwsSesSettings, BucketContentItem, BucketFileDeleteInput, BucketFileDownloadInput, BucketFilePublicUrlCreateInput, BucketFileUploadInput, BucketFolderContentResult, BucketFolderCreateInput, BucketFolderEnsureInput, BucketFolderExistsInput, BucketFolderListInput, BucketFolderListResult, BucketItemType, BucketProviderProps, CacheEntryDetail, CacheEntryInfo, CacheInstanceProps, CacheService, CacheTtl, ClassType, CurrentUser, CurrentUserData, DeepPartial, EmailLoggerProps, EmailProviderProps, EmailService, EmailTemplateProps, EmailVerifyEmailPayload, EmailVerifyTokenPayload, EntitiesExportFile, EntitiesExportInput, EntitiesExportOptions, EntitiesExportResult, EntitiesImportExportSettings, EntitiesImportInput, EntitiesImportResult, EntitiesImportStatistics, EntitiesSampleDownloadOptions, EntitiesSampleDownloadResult, EntityActionsProps, EntityAdapterProps, EntityAuthMiddlewareProps, EntityConnectorProps, EntityConverterProps, EntityExportBucketSettings, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerProps, EntityManagerRegistry, EntityManagerService, EntityManagerSettings, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntityProps, EntityQueryBuilderProps, EntityReference, EntityRepositoryProps, EntitySeeder, EntitySeederProps, EntitySerializationFormat, EntitySerializer, EntitySerializerColumnDefinition, EntitySerializerProps, EntitySerializerSheetDefinition, EntitySnapshotService, EntitySnapshotServiceProps, EntityVersionInput, EntityVersionOperation, EntityVersioningProviderProps, EnumType, EventsService, EventsTrackerProps, FileData, FileDownloadUrl, FileProviderDownloadData, FileProviderDownloadUrl, FileProviderProps, FileProviderReference, FileProviderUploadData, FileReference, FileReferenceRecord, FileReferenceRepositoryProps, FilesReferenceData, FilesService, FilterExpression, GlobalAuthenticationMiddlewareProps, HtmlEmailInput, IAppCompany, IAppDirectory, IAppDivision, IAppOrganization, IAppRole, IAppTenant, IAppUser, IAppUserGroup, IAppUserProfile, IAuthOrganizationalUnit, IAuthPermission, IAuthPermissionService, IAuthRole, IAuthRoleService, IAuthService, IAuthUser, IAuthUserContext, IAuthUserOrganization, IAuthUserProfile, IAuthUserRolesService, IAuthUserService, IAuthUserTenant, IAuthUserTokenData, IAuthenticationContext, IAuthenticationContextProvider, IAuthenticationMiddleware, IAuthenticationOrganizationalUnit, IAuthenticationUserPermission, IAuthenticationUserRole, IAuthorizationResult, IBucketProvider, ICache, ICacheDatabaseItem, ICacheInstance, IEmailLogger, IEmailProvider, IEmailTemplate, IEmailTemplatesCollection, IEntitiesCountAction, IEntitiesCountQuery, IEntitiesDeleteAction, IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesDeleteResult$1 as IEntitiesDeleteResult, IEntitiesExportAction, IEntitiesExportCommand, IEntitiesImportAction, IEntitiesImportCommand, IEntitiesQueryBuilder, IEntitiesSampleDownloadAction, IEntitiesSampleDownloadCommand, IEntitiesSearchAction, IEntitiesSearchQuery, IEntitiesSearchResults, IEntitiesSearchResultsPaging, IEntityActions, IEntityAdapter, IEntityAuthorizationMiddleware, IEntityConverter, IEntityCreateAction, IEntityCreateCommand, IEntityDeleteAction, IEntityDeleteCommand, IEntityEventsManager, IEntityExistsAction, IEntityExistsQuery, IEntityFacet, IEntityFacetValue, IEntityFacets, IEntityGetAction, IEntityGetQuery, IEntityManager, IEntityManagerServiceCollection, IEntityManagerServiceRoot, IEntityMapper, IEntityReplicaDeleteManager, IEntityReplicaSyncManager, IEntityRepository, IEntitySearchParameters, IEntitySearchResults, IEntitySerializer, IEntitySnapshotService, IEntityUpdateAction, IEntityUpdateCommand, IEntityUpsertAction, IEntityUpsertCommand, IEntityVersionCommand, IEntityVersioningProvider, IEntityVersioningResults, IEntityVersionsCursor, IEntityVersionsFilters, IEntityVersionsReference, IEntityVersionsResultsPaging, IEntityVersionsSearchAction, IEntityVersionsSearchInput, IEntityVersionsSearchParameters, IEntityVersionsSearchQuery, IEntityVersionsSearchResults, IEntityVersionsSorting, IEventLog, IEventsTracker, IFileManager, IFileProvider, IFilesReferenceRepository, IFullTextQuery, IMultiCompanyEntity, IMultiOrganizationEntity, IMultiTenantEntity, IPipelineStepBuilder, IPipelineStepOperationBuilder, IPipelineStepOperationOptionsBuilder, IPipelineTemplateBuilder, IReplicasConfiguration, ISearchFilters, ISearchOptions, ISearchQueryRelations, ISearchQueryRelationsProperty, ISearchRequestPaging, ISearchResultsPaging, ISearchSorting, ISearchSortingField, ITraverseFilters, InMemoryBucketProvider, InMemoryEmailProvider, InvalidCredentialsError, LocalizedMap, LocalizedTexts, MemberOf, MessagingEmailSentPayload, MissingEntityIdError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestEntitySerializer, NestEntitySnapshotService, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, NonNullable$1 as NonNullable, OperationDefinition, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PasswordResetEmailPayload, Permissions, PipelineCompletedStepState, PipelineController, PipelineCurrentStepState, PipelineDefinition, PipelineErrorType, PipelineInvocationError, PipelineOperationError, PipelineOperationResult, PipelineOperationResultType, PipelineOperationRollbackResult, PipelineOperationRollbackResultType, PipelineResult, PipelineResultType, PipelineStatus, PipelineStep, PipelineStepErrorType, PipelineStepOperation, PipelineStepResult, PipelineStepResultType, PipelineStepRollbackResult, PipelineStepRollbackResultType, PipelineStepState, PipelineTemplateProps, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, QueryBuilderOperation, RegistrationEmailPayload, ReplicaConfiguration, ReplicaOptions, ReplicationMode, Roles, RolesGuardOptions, RollbackOperationDefinition, RuntimeErrorInformation, SendgridEmailModule, SendgridEmailTemplate, SendgridEmailTemplateData, SendgridSettings, SendgridTemplateBaseData, SendgridTemplateType, SortDirection, SortingType, TemplatedEmailInput, TrackingService, TypeOrmQueryBuilder, TypeOrmRepository, TypeormCacheInstance, UserCreationError, UserCreationInput, UserCreationResult, UserDeleteInput, UserDisableInput, UserEnableInput, UserLoginEventPayload, UserLoginInput, UserLoginResult, UserPasswordChangeInput, UserPasswordResetCompleteInput, UserPasswordResetCompletedEventPayload, UserPasswordResetRequestCallbackTemplate, UserPasswordResetRequestInput, UserPasswordResetRequestResult, UserPasswordResetStartedEventPayload, UserPasswordResetTokenPayload, UserProfile, UserRegisterCallbackTemplate, UserRegistrationCompletedEventPayload, UserRegistrationError, UserRegistrationInput, UserRegistrationResult, UserRegistrationStartedEventPayload, UserTokenVerifyInput, UserTokenVerifyResult, UserVerifyCompleteInput, UserVerifyRequestCallbackTemplate, UserVerifyRequestInput, UserVerifyRequestResult as UserVerifyResetRequestResult, WpAppInitializer, WpAwsSesEmailTemplate, WpBucketProvider, WpCacheInstance, WpEmailLogger, WpEmailProvider, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEntitySerializer, WpEntitySnapshotService, WpEntityVersioningProvider, WpEventsTracker, WpFileProvider, WpFileReferenceRepository, WpGlobalAuthenticationMiddleware, WpPermissionsService, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, buildPermissionsGuard, buildRolesGuard, createContainer, createExpressFileResponse, getLocalizedText, newUuid, renderHandlebarsTemplate, toEntitiesImportInput };
|
|
2806
|
+
export { AUTHENTICATION_EVENTS_NAMESPACE, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppPermission, AppRole, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationModuleSettings, AuthenticationService, AwsBucketModule, AwsBucketSettings, AwsEmailModule, AwsS3BucketError as AwsS2BucketError, AwsS3BucketProvider, AwsSesEmailTemplate, AwsSesEmailTemplateData, AwsSesSettings, BucketContentItem, BucketFileDeleteInput, BucketFileDownloadInput, BucketFilePublicUrlCreateInput, BucketFileUploadInput, BucketFolderContentResult, BucketFolderCreateInput, BucketFolderEnsureInput, BucketFolderExistsInput, BucketFolderListInput, BucketFolderListResult, BucketItemType, BucketProviderProps, CacheEntryDetail, CacheEntryInfo, CacheInstanceProps, CacheService, CacheTtl, ClassType, CurrentUser, CurrentUserData, DeepPartial, EmailLoggerProps, EmailProviderProps, EmailService, EmailTemplateProps, EmailVerifyEmailPayload, EmailVerifyTokenPayload, EntitiesExportFile, EntitiesExportInput, EntitiesExportOptions, EntitiesExportResult, EntitiesImportExportSettings, EntitiesImportInput, EntitiesImportResult, EntitiesImportStatistics, EntitiesSampleDownloadOptions, EntitiesSampleDownloadResult, EntityActionsProps, EntityAdapterProps, EntityAuthMiddlewareProps, EntityConnectorProps, EntityConverterProps, EntityExportBucketSettings, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerProps, EntityManagerRegistry, EntityManagerService, EntityManagerSettings, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntityProps, EntityQueryBuilderProps, EntityReference, EntityRepositoryProps, EntitySeeder, EntitySeederProps, EntitySerializationFormat, EntitySerializer, EntitySerializerColumnDefinition, EntitySerializerProps, EntitySerializerSheetDefinition, EntitySnapshotService, EntitySnapshotServiceProps, EntityVersionInput, EntityVersionOperation, EntityVersioningProviderProps, EnumType, EventsService, EventsTrackerProps, FileData, FileDownloadUrl, FileProviderDownloadData, FileProviderDownloadUrl, FileProviderProps, FileProviderReference, FileProviderUploadData, FileReference, FileReferenceRecord, FileReferenceRepositoryProps, FilesReferenceData, FilesService, FilterExpression, GlobalAuthenticationMiddlewareProps, HtmlEmailInput, IAppCompany, IAppDirectory, IAppDivision, IAppOrganization, IAppRole, IAppTenant, IAppUser, IAppUserGroup, IAppUserProfile, IAuthOrganizationalUnit, IAuthPermission, IAuthPermissionService, IAuthRole, IAuthRoleService, IAuthService, IAuthUser, IAuthUserContext, IAuthUserOrganization, IAuthUserProfile, IAuthUserRolesService, IAuthUserService, IAuthUserTenant, IAuthUserTokenData, IAuthenticationContext, IAuthenticationContextProvider, IAuthenticationData, IAuthenticationMiddleware, IAuthenticationOrganizationalUnit, IAuthenticationUserPermission, IAuthenticationUserRole, IAuthorizationResult, IBucketProvider, ICache, ICacheDatabaseItem, ICacheInstance, IEmailLogger, IEmailProvider, IEmailTemplate, IEmailTemplatesCollection, IEntitiesCountAction, IEntitiesCountQuery, IEntitiesDeleteAction, IEntitiesDeleteCommand, IEntitiesDeleteParameters, IEntitiesDeleteResult$1 as IEntitiesDeleteResult, IEntitiesExportAction, IEntitiesExportCommand, IEntitiesImportAction, IEntitiesImportCommand, IEntitiesQueryBuilder, IEntitiesSampleDownloadAction, IEntitiesSampleDownloadCommand, IEntitiesSearchAction, IEntitiesSearchQuery, IEntitiesSearchResults, IEntitiesSearchResultsPaging, IEntityActions, IEntityAdapter, IEntityAuthorizationMiddleware, IEntityConverter, IEntityCreateAction, IEntityCreateCommand, IEntityDeleteAction, IEntityDeleteCommand, IEntityEventsManager, IEntityExistsAction, IEntityExistsQuery, IEntityFacet, IEntityFacetValue, IEntityFacets, IEntityGetAction, IEntityGetQuery, IEntityManager, IEntityManagerServiceCollection, IEntityManagerServiceRoot, IEntityMapper, IEntityReplicaDeleteManager, IEntityReplicaSyncManager, IEntityRepository, IEntitySearchParameters, IEntitySearchResults, IEntitySerializer, IEntitySnapshotService, IEntityUpdateAction, IEntityUpdateCommand, IEntityUpsertAction, IEntityUpsertCommand, IEntityVersionCommand, IEntityVersioningProvider, IEntityVersioningResults, IEntityVersionsCursor, IEntityVersionsFilters, IEntityVersionsReference, IEntityVersionsResultsPaging, IEntityVersionsSearchAction, IEntityVersionsSearchInput, IEntityVersionsSearchParameters, IEntityVersionsSearchQuery, IEntityVersionsSearchResults, IEntityVersionsSorting, IEventLog, IEventsTracker, IFileManager, IFileProvider, IFilesReferenceRepository, IFullTextQuery, IMultiCompanyEntity, IMultiOrganizationEntity, IMultiTenantEntity, IPipelineStepBuilder, IPipelineStepOperationBuilder, IPipelineStepOperationOptionsBuilder, IPipelineTemplateBuilder, IReplicasConfiguration, ISearchFilters, ISearchOptions, ISearchQueryRelations, ISearchQueryRelationsProperty, ISearchRequestPaging, ISearchResultsPaging, ISearchSorting, ISearchSortingField, ITraverseFilters, InMemoryBucketProvider, InMemoryEmailProvider, InvalidCredentialsError, LocalizedMap, LocalizedTexts, MemberOf, MessagingEmailSentPayload, MissingEntityIdError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestEntitySerializer, NestEntitySnapshotService, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, NonNullable$1 as NonNullable, OperationDefinition, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, PasswordResetEmailPayload, Permissions, PipelineCompletedStepState, PipelineController, PipelineCurrentStepState, PipelineDefinition, PipelineErrorType, PipelineInvocationError, PipelineOperationError, PipelineOperationResult, PipelineOperationResultType, PipelineOperationRollbackResult, PipelineOperationRollbackResultType, PipelineResult, PipelineResultType, PipelineStatus, PipelineStep, PipelineStepErrorType, PipelineStepOperation, PipelineStepResult, PipelineStepResultType, PipelineStepRollbackResult, PipelineStepRollbackResultType, PipelineStepState, PipelineTemplateProps, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, QueryBuilderOperation, RegistrationEmailPayload, ReplicaConfiguration, ReplicaOptions, ReplicationMode, Roles, RolesGuardOptions, RollbackOperationDefinition, RuntimeErrorInformation, SendgridEmailModule, SendgridEmailTemplate, SendgridEmailTemplateData, SendgridSettings, SendgridTemplateBaseData, SendgridTemplateType, SortDirection, SortingType, TemplatedEmailInput, TrackingService, TypeOrmQueryBuilder, TypeOrmRepository, TypeormCacheInstance, UserCreationError, UserCreationInput, UserCreationResult, UserDeleteInput, UserDisableInput, UserEnableInput, UserLoginEventPayload, UserLoginInput, UserLoginResult, UserPasswordChangeInput, UserPasswordResetCompleteInput, UserPasswordResetCompletedEventPayload, UserPasswordResetRequestCallbackTemplate, UserPasswordResetRequestInput, UserPasswordResetRequestResult, UserPasswordResetStartedEventPayload, UserPasswordResetTokenPayload, UserProfile, UserRegisterCallbackTemplate, UserRegistrationCompletedEventPayload, UserRegistrationError, UserRegistrationInput, UserRegistrationResult, UserRegistrationStartedEventPayload, UserTokenVerifyInput, UserTokenVerifyResult, UserVerifyCompleteInput, UserVerifyRequestCallbackTemplate, UserVerifyRequestInput, UserVerifyRequestResult as UserVerifyResetRequestResult, WpAppInitializer, WpAwsSesEmailTemplate, WpBucketProvider, WpCacheInstance, WpEmailLogger, WpEmailProvider, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEntitySerializer, WpEntitySnapshotService, WpEntityVersioningProvider, WpEventsTracker, WpFileProvider, WpFileReferenceRepository, WpGlobalAuthenticationMiddleware, WpPermissionsService, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, buildPermissionsGuard, buildRolesGuard, createContainer, createExpressFileResponse, getLocalizedText, newUuid, renderHandlebarsTemplate, toEntitiesImportInput };
|