@punks/backend-entity-manager 0.0.88 → 0.0.89
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 +4 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/export.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/app/foos/foo.actions.d.ts +8 -0
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/controller.d.ts → cjs/types/platforms/nest/__test__/server/app/foos/foo.controller.d.ts} +3 -4
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/converter.d.ts → cjs/types/platforms/nest/__test__/server/app/foos/foo.converter.d.ts} +1 -1
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/dto.d.ts → cjs/types/platforms/nest/__test__/server/app/foos/foo.dto.d.ts} +2 -2
- package/dist/cjs/types/platforms/nest/__test__/server/app/foos/foo.module.d.ts +2 -0
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/entities/foo.entity.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/entities.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/repositories/foo.repository.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/repositories.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.adapter.d.ts +7 -0
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/manager.d.ts → cjs/types/platforms/nest/__test__/server/entities/foos/foo.manager.d.ts} +3 -3
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.module.d.ts +2 -0
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/query.d.ts → cjs/types/platforms/nest/__test__/server/entities/foos/foo.query.d.ts} +1 -1
- package/dist/{esm/types/platforms/nest/__test__/server/entities/foo/serializer.d.ts → cjs/types/platforms/nest/__test__/server/entities/foos/foo.serializer.d.ts} +1 -3
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +42 -0
- package/dist/esm/index.js +4 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/export.d.ts +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/app/foos/foo.actions.d.ts +8 -0
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/controller.d.ts → esm/types/platforms/nest/__test__/server/app/foos/foo.controller.d.ts} +3 -4
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/converter.d.ts → esm/types/platforms/nest/__test__/server/app/foos/foo.converter.d.ts} +1 -1
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/dto.d.ts → esm/types/platforms/nest/__test__/server/app/foos/foo.dto.d.ts} +2 -2
- package/dist/esm/types/platforms/nest/__test__/server/app/foos/foo.module.d.ts +2 -0
- package/dist/esm/types/platforms/nest/__test__/server/database/core/entities/foo.entity.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/entities.d.ts +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/repositories/foo.repository.d.ts +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/repositories.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.adapter.d.ts +7 -0
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/manager.d.ts → esm/types/platforms/nest/__test__/server/entities/foos/foo.manager.d.ts} +3 -3
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.module.d.ts +2 -0
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/query.d.ts → esm/types/platforms/nest/__test__/server/entities/foos/foo.query.d.ts} +1 -1
- package/dist/{cjs/types/platforms/nest/__test__/server/entities/foo/serializer.d.ts → esm/types/platforms/nest/__test__/server/entities/foos/foo.serializer.d.ts} +1 -3
- package/dist/esm/types/platforms/nest/__test__/server/entities/foos/foo.types.d.ts +42 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foo/actions.d.ts +0 -8
- package/dist/cjs/types/platforms/nest/__test__/server/entities/foo/index.d.ts +0 -9
- package/dist/esm/types/platforms/nest/__test__/server/entities/foo/actions.d.ts +0 -8
- package/dist/esm/types/platforms/nest/__test__/server/entities/foo/index.d.ts +0 -9
- /package/dist/cjs/types/platforms/nest/__test__/server/entities/{foo/authentication.d.ts → foos/foo.authentication.d.ts} +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/entities/{foo/models.d.ts → foos/foo.models.d.ts} +0 -0
- /package/dist/cjs/types/platforms/nest/__test__/server/entities/{foo/seeder.d.ts → foos/foo.seeder.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/entities/{foo/authentication.d.ts → foos/foo.authentication.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/entities/{foo/models.d.ts → foos/foo.models.d.ts} +0 -0
- /package/dist/esm/types/platforms/nest/__test__/server/entities/{foo/seeder.d.ts → foos/foo.seeder.d.ts} +0 -0
|
@@ -15,7 +15,7 @@ export type EntitiesExportResult = {
|
|
|
15
15
|
downloadUrl: string;
|
|
16
16
|
};
|
|
17
17
|
export type EntitiesExportInput<TEntitySearchParameters extends IEntitySearchParameters<TSorting, TCursor>, TSorting extends SortingType, TCursor> = {
|
|
18
|
-
|
|
18
|
+
filter?: TEntitySearchParameters;
|
|
19
19
|
options: EntitiesExportOptions;
|
|
20
20
|
};
|
|
21
21
|
export type EntityExportBucketSettings = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntityManagerRegistry, NestEntityActions } from "../../../..";
|
|
2
|
+
import { FooCreateDto, FooDto, FooListItemDto, FooUpdateDto } from "./foo.dto";
|
|
3
|
+
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
4
|
+
import { FooCursor, FooEntityId, FooFacets, FooSorting } from "../../entities/foos/foo.models";
|
|
5
|
+
import { FooDeleteParameters, FooSearchParameters } from "../../entities/foos/foo.types";
|
|
6
|
+
export declare class FooActions extends NestEntityActions<FooEntity, FooEntityId, FooCreateDto, FooUpdateDto, FooDto, FooListItemDto, FooDeleteParameters, FooSearchParameters, FooSorting, FooCursor, FooFacets> {
|
|
7
|
+
constructor(registry: EntityManagerRegistry);
|
|
8
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/// <reference types="multer" />
|
|
2
2
|
import { StreamableFile } from "@nestjs/common";
|
|
3
3
|
import type { Response } from "express";
|
|
4
|
-
import {
|
|
5
|
-
import { FooCreateDto, FooDto, FooExportRequest, FooExportResponse, FooImportRequest,
|
|
4
|
+
import { FooActions } from "./foo.actions";
|
|
5
|
+
import { FooCreateDto, FooDto, FooExportRequest, FooExportResponse, FooImportRequest, FooSampleDownloadRequest, FooSearchRequest, FooSearchResponse, FooUpdateDto } from "./foo.dto";
|
|
6
6
|
export declare class FooController {
|
|
7
7
|
private readonly actions;
|
|
8
|
-
constructor(actions:
|
|
8
|
+
constructor(actions: FooActions);
|
|
9
9
|
item(id: string): Promise<FooDto | undefined>;
|
|
10
10
|
create(data: FooCreateDto): Promise<FooDto>;
|
|
11
11
|
update(id: string, item: FooUpdateDto): Promise<FooDto>;
|
|
12
12
|
delete(id: string): Promise<void>;
|
|
13
|
-
items(): Promise<FooListItemDto[]>;
|
|
14
13
|
search(request: FooSearchRequest): Promise<FooSearchResponse>;
|
|
15
14
|
import(file: Express.Multer.File, request: FooImportRequest): Promise<void>;
|
|
16
15
|
export(request: FooExportRequest): Promise<FooExportResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEntityConverter } from "../../../../../../abstractions";
|
|
2
2
|
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
3
|
-
import { FooCreateDto, FooDto, FooListItemDto, FooUpdateDto } from "./dto";
|
|
3
|
+
import { FooCreateDto, FooDto, FooListItemDto, FooUpdateDto } from "./foo.dto";
|
|
4
4
|
export declare class FooConverter implements IEntityConverter<FooEntity, FooDto, FooListItemDto, FooCreateDto, FooUpdateDto> {
|
|
5
5
|
toListItemDto(entity: FooEntity): FooListItemDto;
|
|
6
6
|
toEntityDto(entity: FooEntity): FooDto;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FooSearchParameters, FooSearchResults } from "./models";
|
|
2
1
|
import { EntitySerializationFormat } from "../../../../../../abstractions";
|
|
2
|
+
import { FooSearchParameters, FooSearchResults } from "../../entities/foos/foo.types";
|
|
3
3
|
export declare class FooProfile {
|
|
4
4
|
name: string;
|
|
5
|
-
age
|
|
5
|
+
age?: number;
|
|
6
6
|
}
|
|
7
7
|
export declare class FooDto {
|
|
8
8
|
id: string;
|
|
@@ -9,4 +9,4 @@ import { AppUserGroupEntity } from "./entities/appUserGroup.entity";
|
|
|
9
9
|
import { AppUserGroupMemberEntity } from "./entities/appUserGroupMember.entity";
|
|
10
10
|
import { AppUserProfileEntity } from "./entities/appUserProfile.entity";
|
|
11
11
|
import { AppUserRoleEntity } from "./entities/appUserRole.entity";
|
|
12
|
-
export declare const CoreDatabaseEntities: (typeof
|
|
12
|
+
export declare const CoreDatabaseEntities: (typeof AppUserProfileEntity | typeof AppRoleEntity | typeof AppUserRoleEntity | typeof AppUserEntity | typeof AppUserGroupEntity | typeof AppOrganizationEntity | typeof AppUserGroupMemberEntity | typeof AppTenantEntity | typeof AppCompanyEntity | typeof AppDivisionEntity | typeof FooEntity)[];
|
package/dist/cjs/types/platforms/nest/__test__/server/database/core/repositories/foo.repository.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Repository } from "typeorm";
|
|
2
2
|
import { FooEntity } from "../entities/foo.entity";
|
|
3
3
|
import { NestTypeOrmRepository } from "../../../../../integrations";
|
|
4
|
-
import { FooEntityId } from "../../../entities/foo
|
|
4
|
+
import { FooEntityId } from "../../../entities/foos/foo.models";
|
|
5
5
|
export declare class FooRepository extends NestTypeOrmRepository<FooEntity, FooEntityId> {
|
|
6
6
|
constructor(repository: Repository<FooEntity>);
|
|
7
7
|
}
|
|
@@ -8,4 +8,5 @@ import { AppUserGroupRepository } from "./repositories/appUserGroup.repository";
|
|
|
8
8
|
import { AppUserGroupMemberRepository } from "./repositories/appUserGroupMember.repository";
|
|
9
9
|
import { AppUserProfileRepository } from "./repositories/appUserProfile.repository";
|
|
10
10
|
import { AppUserRoleRepository } from "./repositories/appUserRole.repository";
|
|
11
|
-
|
|
11
|
+
import { FooRepository } from "./repositories/foo.repository";
|
|
12
|
+
export declare const CoreDatabaseRepositories: (typeof AppCompanyRepository | typeof AppDivisionRepository | typeof AppOrganizationRepository | typeof AppRoleRepository | typeof AppTenantRepository | typeof AppUserRepository | typeof AppUserGroupRepository | typeof AppUserGroupMemberRepository | typeof AppUserProfileRepository | typeof AppUserRoleRepository | typeof FooRepository)[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeepPartial, IEntityAdapter } from "../../../../../..";
|
|
2
|
+
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
3
|
+
import { FooCreateData, FooUpdateData } from "./foo.models";
|
|
4
|
+
export declare class FooAdapter implements IEntityAdapter<FooEntity, FooCreateData, FooUpdateData> {
|
|
5
|
+
createDataToEntity(data: FooCreateData): DeepPartial<FooEntity>;
|
|
6
|
+
updateDataToEntity(data: FooUpdateData): DeepPartial<FooEntity>;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NestEntityManager } from "
|
|
2
|
-
import {
|
|
1
|
+
import { NestEntityManager, EntityManagerRegistry } from "../../../../../..";
|
|
2
|
+
import { FooCreateData, FooCursor, FooEntityId, FooFacets, FooSorting, FooUpdateData } from "./foo.models";
|
|
3
|
+
import { FooSearchParameters, FooDeleteParameters } from "./foo.types";
|
|
3
4
|
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
4
|
-
import { FooCreateData, FooCursor, FooDeleteParameters, FooEntityId, FooFacets, FooSearchParameters, FooSorting, FooUpdateData } from "./models";
|
|
5
5
|
export declare class FooEntityManager extends NestEntityManager<FooEntity, FooEntityId, FooCreateData, FooUpdateData, FooDeleteParameters, FooSearchParameters, FooSorting, FooCursor, FooFacets> {
|
|
6
6
|
constructor(registry: EntityManagerRegistry);
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FindOptionsWhere } from "typeorm";
|
|
2
2
|
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
3
|
-
import { FooFacets, FooSearchParameters, FooSorting } from "./models";
|
|
3
|
+
import { FooFacets, FooSearchParameters, FooSorting } from "./foo.models";
|
|
4
4
|
import { NestTypeOrmQueryBuilder } from "../../../../integrations/typeorm";
|
|
5
5
|
import { EntityManagerRegistry } from "../../../../ioc/registry";
|
|
6
6
|
import { IAuthenticationContext } from "../../../../../../abstractions";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { EntityManagerRegistry, EntitySerializerSheetDefinition, NestEntitySerializer } from "../../../../../..";
|
|
1
2
|
import { FooEntity } from "../../database/core/entities/foo.entity";
|
|
2
|
-
import { NestEntitySerializer } from "../../../../base";
|
|
3
|
-
import { EntitySerializerSheetDefinition } from "../../../../../../abstractions/serializer";
|
|
4
|
-
import { EntityManagerRegistry } from "../../../../ioc/registry";
|
|
5
3
|
export declare class FooSerializer extends NestEntitySerializer<FooEntity> {
|
|
6
4
|
constructor(registry: EntityManagerRegistry);
|
|
7
5
|
protected getDefinition(): EntitySerializerSheetDefinition<FooEntity>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IEntitiesDeleteParameters, IEntitiesSearchResults, IEntitiesSearchResultsPaging, IEntitySearchParameters, ISearchOptions, ISearchRequestPaging, ISearchSorting, ISearchSortingField, SortDirection } from "../../../../../..";
|
|
2
|
+
import { FooSorting, FooCursor, FooSearchFilters, FooFacets } from "./foo.models";
|
|
3
|
+
export declare class FooSearchSortingField implements ISearchSortingField<FooSorting> {
|
|
4
|
+
field: FooSorting;
|
|
5
|
+
direction: SortDirection;
|
|
6
|
+
}
|
|
7
|
+
export declare class FooQuerySorting implements ISearchSorting<FooSorting> {
|
|
8
|
+
fields: FooSearchSortingField[];
|
|
9
|
+
}
|
|
10
|
+
export declare class FooQueryPaging implements ISearchRequestPaging<FooCursor> {
|
|
11
|
+
cursor?: FooCursor;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class FooSearchOptions implements ISearchOptions {
|
|
15
|
+
includeFacets?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class FooSearchParameters implements IEntitySearchParameters<FooSorting, FooCursor> {
|
|
18
|
+
filters?: FooSearchFilters;
|
|
19
|
+
sorting?: FooQuerySorting;
|
|
20
|
+
paging?: FooQueryPaging;
|
|
21
|
+
options?: FooSearchOptions;
|
|
22
|
+
}
|
|
23
|
+
export declare class FooSearchResultsPaging implements IEntitiesSearchResultsPaging<FooCursor> {
|
|
24
|
+
pageIndex: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
totPageItems: number;
|
|
27
|
+
totPages: number;
|
|
28
|
+
totItems: number;
|
|
29
|
+
nextPageCursor?: FooCursor;
|
|
30
|
+
currentPageCursor?: FooCursor;
|
|
31
|
+
prevPageCursor?: FooCursor;
|
|
32
|
+
}
|
|
33
|
+
export declare class FooSearchResults<TResult> implements IEntitiesSearchResults<FooSearchParameters, TResult, FooSorting, FooCursor, FooFacets> {
|
|
34
|
+
request: FooSearchParameters;
|
|
35
|
+
facets?: FooFacets;
|
|
36
|
+
paging?: FooSearchResultsPaging;
|
|
37
|
+
items: TResult[];
|
|
38
|
+
}
|
|
39
|
+
export declare class FooDeleteParameters implements IEntitiesDeleteParameters<FooSorting> {
|
|
40
|
+
filters?: FooSearchFilters;
|
|
41
|
+
sorting?: FooQuerySorting;
|
|
42
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -9,11 +9,11 @@ import { STATIC_CONTEXT } from '@nestjs/core/injector/constants';
|
|
|
9
9
|
import { MetadataScanner } from '@nestjs/core/metadata-scanner';
|
|
10
10
|
import { JwtService, JwtModule } from '@nestjs/jwt';
|
|
11
11
|
import { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';
|
|
12
|
-
import require$$2, { createReadStream } from 'fs';
|
|
13
12
|
import { In } from 'typeorm';
|
|
14
13
|
import { ListObjectsCommand, PutObjectCommand, GetObjectCommand, DeleteObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
|
15
14
|
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
16
15
|
import { SendEmailCommand, SESClient } from '@aws-sdk/client-ses';
|
|
16
|
+
import require$$2 from 'fs';
|
|
17
17
|
import { MailService } from '@sendgrid/mail';
|
|
18
18
|
|
|
19
19
|
var BucketItemType;
|
|
@@ -887,7 +887,7 @@ class EntitiesExportCommand {
|
|
|
887
887
|
this.settings = settings;
|
|
888
888
|
}
|
|
889
889
|
async execute(input) {
|
|
890
|
-
const exportEntities = await this.getExportEntities(input.
|
|
890
|
+
const exportEntities = await this.getExportEntities(input.filter);
|
|
891
891
|
const outputFile = await this.buildExportFile(exportEntities.items, input.options.format);
|
|
892
892
|
const downloadUrl = await this.uploadExportFile(outputFile);
|
|
893
893
|
return {
|
|
@@ -21269,12 +21269,11 @@ MultiTenancyModule = __decorate([
|
|
|
21269
21269
|
], MultiTenancyModule);
|
|
21270
21270
|
|
|
21271
21271
|
const createExpressFileResponse = (res, file) => {
|
|
21272
|
-
const stream = createReadStream(file.content);
|
|
21273
21272
|
res.set({
|
|
21274
21273
|
"Content-Type": file.contentType,
|
|
21275
21274
|
"Content-Disposition": `attachment; filename="${file.name}"`,
|
|
21276
21275
|
});
|
|
21277
|
-
return new StreamableFile(
|
|
21276
|
+
return new StreamableFile(file.content);
|
|
21278
21277
|
};
|
|
21279
21278
|
|
|
21280
21279
|
class QueryBuilderBase {
|
|
@@ -21889,7 +21888,7 @@ let InMemoryBucketProvider = class InMemoryBucketProvider {
|
|
|
21889
21888
|
// Generate a public URL for the file based on the input parameters
|
|
21890
21889
|
const fileKey = `${input.bucket}/${input.filePath}`;
|
|
21891
21890
|
// Mock the public URL creation
|
|
21892
|
-
const publicUrl =
|
|
21891
|
+
const publicUrl = `${fileKey}`;
|
|
21893
21892
|
return publicUrl;
|
|
21894
21893
|
}
|
|
21895
21894
|
async fileUpload(input) {
|