feat(browser): add POST /open with session restore and reader mode
- restores cookies and localStorage from DB before page navigation
- readerMode flag extracts plain text via @mozilla/readability (Firefox reader engine)
- add localStorage default '{}' on session entity for clean schema migrations
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsOptional, IsString, IsUrl } from 'class-validator';
|
||||
|
||||
export class OpenDto {
|
||||
@ApiProperty({
|
||||
description: 'Session name previously created by POST /login',
|
||||
example: 'test-session-1',
|
||||
})
|
||||
@IsString()
|
||||
sessionName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'URL to open with the authenticated session',
|
||||
example: 'https://cabinet-liquio-diia-stg.kitsoft.ua/messages',
|
||||
})
|
||||
@IsUrl({ require_tld: true, require_protocol: true })
|
||||
url: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: 'When true, return a plain-text reader-mode summary instead of raw HTML',
|
||||
default: false,
|
||||
})
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
readerMode?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user