forked from SciCatProject/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatafile.dto.ts
More file actions
91 lines (82 loc) · 2.03 KB
/
Copy pathdatafile.dto.ts
File metadata and controls
91 lines (82 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { ApiProperty } from "@nestjs/swagger";
import {
IsDateString,
IsNumber,
IsOptional,
IsString,
IsObject,
} from "class-validator";
export class DataFileDto {
@ApiProperty({
type: String,
required: true,
description: "Relative path of the file within the dataset folder.",
})
@IsString()
readonly path: string;
@ApiProperty({
type: Number,
required: true,
description: "Uncompressed file size in bytes.",
})
@IsNumber()
readonly size: number;
@ApiProperty({
type: Date,
required: true,
description:
"Time of file creation on disk, format according to chapter 5.6 internet date/time format in RFC 3339. Local times without timezone/offset info are automatically transformed to UTC using the timezone of the API server.",
})
@IsDateString()
readonly time: Date;
@ApiProperty({
type: String,
required: false,
description:
"Checksum for the file, e.g. its sha-2 hashstring. The hash algorithm should be encoded in the (Orig)Datablock.",
})
@IsString()
@IsOptional()
readonly chk: string;
@ApiProperty({
type: String,
required: false,
description: "User ID name as seen on filesystem.",
})
@IsString()
@IsOptional()
readonly uid: string;
@ApiProperty({
type: String,
required: false,
description: "Group ID name as seen on filesystem.",
})
@IsString()
@IsOptional()
readonly gid: string;
@ApiProperty({
type: String,
required: false,
description: "Posix permission bits.",
})
@IsString()
@IsOptional()
readonly perm: string;
@ApiProperty({
type: String,
required: false,
description: "File type.",
})
@IsString()
@IsOptional()
readonly type: string;
@ApiProperty({
type: Object,
required: false,
description:
"File-specific metadata. The Dataset field scientificMetadata should be preferred for aggregate metadata, as it is searchable and displayed more prominently to users.",
})
@IsObject()
@IsOptional()
readonly metadata: Record<string, unknown>;
}