diff --git a/src/notifications/notifications.dto.ts b/src/notifications/notifications.dto.ts index 995d586..1044321 100644 --- a/src/notifications/notifications.dto.ts +++ b/src/notifications/notifications.dto.ts @@ -1,4 +1,4 @@ -import { IsBoolean, IsIn, IsOptional, IsString, IsUrl, ValidateNested } from "class-validator"; +import { IsBoolean, IsIn, IsNumber, IsOptional, IsString, IsUrl, ValidateNested } from "class-validator"; import { Type } from "class-transformer"; export class UpdateNotificationPreferencesDto { @@ -30,4 +30,11 @@ export class SavePushSubscriptionDto { @ValidateNested() @Type(() => PushKeysDto) keys!: PushKeysDto; + + // Included by the browser's PushSubscription.toJSON() when the push + // service provides an expiry; not currently used server-side, but must be + // declared or the whitelist validation pipe rejects the whole request. + @IsOptional() + @IsNumber() + expirationTime?: number | null; }