mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
* add first concept * add reverse share funcionality to frontend * allow creator to limit share expiration * moved reverse share in seperate module * add table to manage reverse shares * delete complete share if reverse share was deleted * optimize function names * add db migration * enable reverse share email notifications * fix config variable descriptions * fix migration for new installations
24 lines
730 B
TypeScript
24 lines
730 B
TypeScript
import { OmitType } from "@nestjs/mapped-types";
|
|
import { Expose, plainToClass, Type } from "class-transformer";
|
|
import { MyShareDTO } from "src/share/dto/myShare.dto";
|
|
import { ReverseShareDTO } from "./reverseShare.dto";
|
|
|
|
export class ReverseShareTokenWithShare extends OmitType(ReverseShareDTO, [
|
|
"shareExpiration",
|
|
] as const) {
|
|
@Expose()
|
|
shareExpiration: Date;
|
|
|
|
@Expose()
|
|
@Type(() => OmitType(MyShareDTO, ["recipients"] as const))
|
|
share: Omit<MyShareDTO, "recipients" | "files" | "from" | "fromList">;
|
|
|
|
fromList(partial: Partial<ReverseShareTokenWithShare>[]) {
|
|
return partial.map((part) =>
|
|
plainToClass(ReverseShareTokenWithShare, part, {
|
|
excludeExtraneousValues: true,
|
|
})
|
|
);
|
|
}
|
|
}
|