@punks/backend-entity-manager 0.0.451 → 0.0.453
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 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/commands.d.ts +1 -1
- package/dist/cjs/types/abstractions/export.d.ts +2 -1
- package/dist/cjs/types/actions/export.d.ts +1 -1
- package/dist/cjs/types/commands/export.d.ts +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/commands.d.ts +1 -1
- package/dist/esm/types/abstractions/export.d.ts +2 -1
- package/dist/esm/types/actions/export.d.ts +1 -1
- package/dist/esm/types/commands/export.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export interface IEntitiesDeleteCommand<TEntity, TEntitiesDeleteParameters exten
|
|
|
36
36
|
execute(params: TEntitiesDeleteParameters): Promise<IEntitiesDeleteResult>;
|
|
37
37
|
}
|
|
38
38
|
export interface IEntitiesExportCommand<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor> {
|
|
39
|
-
execute(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor>): Promise<EntitiesExportResult>;
|
|
39
|
+
execute<TPayload>(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor, TPayload>): Promise<EntitiesExportResult>;
|
|
40
40
|
}
|
|
41
41
|
export interface IEntitiesImportCommand<TEntity> {
|
|
42
42
|
execute(input: EntitiesImportInput<unknown>): Promise<EntitiesImportResult>;
|
|
@@ -14,9 +14,10 @@ export type EntitiesExportResult = {
|
|
|
14
14
|
file: EntitiesExportFile;
|
|
15
15
|
downloadUrl: string;
|
|
16
16
|
};
|
|
17
|
-
export type EntitiesExportInput<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor> = {
|
|
17
|
+
export type EntitiesExportInput<TEntity, TEntitySearchParameters extends IEntitySearchParameters<TEntity, TSorting, TCursor>, TSorting extends SortingType, TCursor, TPayload = unknown> = {
|
|
18
18
|
filter?: TEntitySearchParameters;
|
|
19
19
|
options: EntitiesExportOptions;
|
|
20
|
+
payload?: TPayload;
|
|
20
21
|
};
|
|
21
22
|
export type EntityExportBucketSettings = {
|
|
22
23
|
bucket: string;
|
|
@@ -7,5 +7,5 @@ export declare class EntitiesExportAction<TEntity, TEntitySearchParameters exten
|
|
|
7
7
|
private readonly services;
|
|
8
8
|
private readonly logger;
|
|
9
9
|
constructor(services: EntityServiceLocator<TEntity, unknown>);
|
|
10
|
-
execute(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor>): Promise<import("../abstractions/export").EntitiesExportResult>;
|
|
10
|
+
execute<TPayload>(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor, TPayload>): Promise<import("../abstractions/export").EntitiesExportResult>;
|
|
11
11
|
}
|
|
@@ -8,7 +8,7 @@ export declare class EntitiesExportCommand<TEntity, TEntitySearchParameters exte
|
|
|
8
8
|
private readonly services;
|
|
9
9
|
private readonly settings;
|
|
10
10
|
constructor(services: EntityServiceLocator<TEntity, unknown>, settings: EntitiesImportExportSettings);
|
|
11
|
-
execute(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor>): Promise<EntitiesExportResult>;
|
|
11
|
+
execute<TPayload>(input: EntitiesExportInput<TEntity, TEntitySearchParameters, TSorting, TCursor, TPayload>): Promise<EntitiesExportResult>;
|
|
12
12
|
private buildExportFile;
|
|
13
13
|
private uploadExportFile;
|
|
14
14
|
private buildAbsoluteBucketPath;
|
package/dist/esm/index.js
CHANGED
|
@@ -574,7 +574,9 @@ class EntitiesExportAction {
|
|
|
574
574
|
}
|
|
575
575
|
async execute(input) {
|
|
576
576
|
this.logger.debug("Export action started", { input });
|
|
577
|
-
const result = await this.services
|
|
577
|
+
const result = await this.services
|
|
578
|
+
.resolveExportCommand()
|
|
579
|
+
.execute(input);
|
|
578
580
|
this.logger.debug("Export action completed", { input });
|
|
579
581
|
return result;
|
|
580
582
|
}
|
|
@@ -895,7 +897,7 @@ class EntitiesExportCommand {
|
|
|
895
897
|
}
|
|
896
898
|
async execute(input) {
|
|
897
899
|
const sheetItems = await this.getExportSheetItems(input.filter);
|
|
898
|
-
const outputFile = await this.buildExportFile(sheetItems, input.options.format);
|
|
900
|
+
const outputFile = await this.buildExportFile(sheetItems, input.options.format, input.payload);
|
|
899
901
|
const downloadUrl = await this.uploadExportFile(outputFile);
|
|
900
902
|
return {
|
|
901
903
|
downloadUrl,
|