dl-commons 0.0.2-testing.5 → 0.0.2-testing.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dl-commons",
3
3
  "type": "commonjs",
4
- "version": "0.0.2-testing.5",
4
+ "version": "0.0.2-testing.6",
5
5
  "description": "distance learning commons",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -5,10 +5,10 @@ import { FileLogInitType, S3FileState } from '../../enums/s3.enum';
5
5
 
6
6
  @Schema({ _id: false })
7
7
  export class S3 implements IS3 {
8
- @Prop({ type: String, required: false })
8
+ @Prop({ type: String, required: true })
9
9
  key: string;
10
10
 
11
- @Prop({ type: String, required: false })
11
+ @Prop({ type: String, required: true })
12
12
  bucket: string;
13
13
 
14
14
  @Prop({ type: String, required: false })
@@ -24,12 +24,12 @@ export class LogInitiator implements ILogInitiator {
24
24
  name: string;
25
25
  }
26
26
 
27
- @Schema({ _id: false })
27
+ @Schema()
28
28
  export class FileLog implements IFileLog {
29
- @Prop({ type: Date, required: false })
29
+ @Prop({ type: Date, required: true })
30
30
  createdAt: Date;
31
31
 
32
- @Prop({ type: String, enum: S3FileState, required: false })
32
+ @Prop({ type: String, enum: S3FileState, required: true })
33
33
  value: S3FileState;
34
34
 
35
35
  @Prop({ type: LogInitiator, required: false })
@@ -53,16 +53,16 @@ export class FileMeta implements IFileMeta {
53
53
 
54
54
  @Schema({ _id: false })
55
55
  export class FileState implements IFileState {
56
- @Prop({ type: String, enum: S3FileState, required: false })
56
+ @Prop({ type: String, enum: S3FileState, required: true })
57
57
  value: S3FileState;
58
58
 
59
- @Prop({ type: [FileLog], required: false })
59
+ @Prop({ type: [FileLog], required: true, default: [] })
60
60
  log: FileLog[];
61
61
  }
62
62
 
63
63
  @Schema({ _id: false })
64
64
  export class FileRecord implements IFileRecord {
65
- @Prop({ type: Date, required: false })
65
+ @Prop({ type: Date, required: true })
66
66
  createdAt: Date;
67
67
 
68
68
  @Prop({ type: Date, required: false })
@@ -74,19 +74,19 @@ export class S3File implements IS3File {
74
74
  @Prop({ type: SchemaTypes.ObjectId, required: true })
75
75
  id: mongo.ObjectId;
76
76
 
77
- @Prop({ type: FileMeta, required: false })
77
+ @Prop({ type: FileMeta, required: true, default: null })
78
78
  fileMeta: FileMeta;
79
79
 
80
- @Prop({ type: FileState, required: false })
80
+ @Prop({ type: FileState, required: true, default: null })
81
81
  state: FileState;
82
82
 
83
- @Prop({ type: S3, required: false })
83
+ @Prop({ type: S3, required: true, default: null })
84
84
  s3: S3;
85
85
 
86
- @Prop({ type: FileRecord, required: false })
86
+ @Prop({ type: FileRecord, required: true })
87
87
  record: FileRecord;
88
88
 
89
- @Prop({ required: false, type: String })
89
+ @Prop({ type: String, required: true })
90
90
  owner: string;
91
91
  }
92
92