dl-commons 0.0.2-testing.31 → 0.0.2-testing.33
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/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/models/enums/attachment-type.enum.d.ts +4 -0
- package/dist/models/enums/attachment-type.enum.js +9 -0
- package/dist/models/enums/attachment-type.enum.js.map +1 -0
- package/dist/models/interfaces/attachment.interface.d.ts +8 -0
- package/dist/models/interfaces/attachment.interface.js +3 -0
- package/dist/models/interfaces/attachment.interface.js.map +1 -0
- package/dist/models/schemas/embedded/attachment.schema.d.ts +20 -0
- package/dist/models/schemas/embedded/attachment.schema.js +36 -0
- package/dist/models/schemas/embedded/attachment.schema.js.map +1 -0
- package/dist/models/schemas/embedded/virtual-address.schema.js +2 -2
- package/dist/models/schemas/embedded/virtual-address.schema.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +8 -8
- package/src/models/enums/{attachement-type.enum.ts → attachment-type.enum.ts} +1 -1
- package/src/models/interfaces/{attachement.interface.ts → attachment.interface.ts} +3 -3
- package/src/models/schemas/embedded/{attachement.schema.ts → attachment.schema.ts} +7 -7
- package/src/models/schemas/embedded/virtual-address.schema.ts +2 -2
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -103,9 +103,9 @@ import {
|
|
|
103
103
|
import { IUserMeta } from './models/interfaces/user-meta.interface';
|
|
104
104
|
import { ICropArea } from './models/interfaces/crop-area.interface';
|
|
105
105
|
import { CropArea, CropAreaDocument, CropAreaSchema } from './models/schemas/embedded/crop-area.schema';
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
106
|
+
import { AttachmentType } from './models/enums/attachment-type.enum';
|
|
107
|
+
import { IAttachment } from './models/interfaces/attachment.interface';
|
|
108
|
+
import { Attachment, AttachmentDocument, AttachmentSchema } from './models/schemas/embedded/attachment.schema';
|
|
109
109
|
import { Picture, PictureSchema, PictureDocument } from './models/schemas/embedded/picture.schema';
|
|
110
110
|
import { IPicture } from './models/interfaces/picture.interface';
|
|
111
111
|
import { IAuthor } from './models/interfaces/author.interface';
|
|
@@ -184,7 +184,7 @@ export {
|
|
|
184
184
|
GroupState,
|
|
185
185
|
S3FileState,
|
|
186
186
|
FileLogInitType,
|
|
187
|
-
|
|
187
|
+
AttachmentType,
|
|
188
188
|
VirtualAddressType,
|
|
189
189
|
LocationType,
|
|
190
190
|
|
|
@@ -227,7 +227,7 @@ export {
|
|
|
227
227
|
IFileLog,
|
|
228
228
|
IUserMeta,
|
|
229
229
|
ICropArea,
|
|
230
|
-
|
|
230
|
+
IAttachment,
|
|
231
231
|
IPicture,
|
|
232
232
|
IAuthor,
|
|
233
233
|
IFileEmbedded,
|
|
@@ -309,9 +309,9 @@ export {
|
|
|
309
309
|
CropArea,
|
|
310
310
|
CropAreaSchema,
|
|
311
311
|
CropAreaDocument,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
Attachment,
|
|
313
|
+
AttachmentSchema,
|
|
314
|
+
AttachmentDocument,
|
|
315
315
|
Picture,
|
|
316
316
|
PictureSchema,
|
|
317
317
|
PictureDocument,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AttachmentType } from '../enums/attachment-type.enum';
|
|
2
2
|
import { IIdentifable } from './identifable.interface';
|
|
3
3
|
import { IFileEmbedded } from './s3.interface';
|
|
4
4
|
|
|
5
|
-
export interface
|
|
6
|
-
type:
|
|
5
|
+
export interface IAttachment extends IIdentifable {
|
|
6
|
+
type: AttachmentType;
|
|
7
7
|
file?: IFileEmbedded | null | undefined;
|
|
8
8
|
link?: string | null | undefined;
|
|
9
9
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
|
|
2
2
|
import { HydratedDocument } from 'mongoose';
|
|
3
|
-
import {
|
|
3
|
+
import { IAttachment } from '../../interfaces/attachment.interface';
|
|
4
4
|
import { Identifable } from '../identifable.schema';
|
|
5
|
-
import {
|
|
5
|
+
import { AttachmentType } from '../../enums/attachment-type.enum';
|
|
6
6
|
import { IFileEmbedded } from '../../interfaces/s3.interface';
|
|
7
7
|
import { FileEmbeddedSchema } from './s3.schema';
|
|
8
8
|
|
|
9
9
|
@Schema({ _id: false })
|
|
10
|
-
export class
|
|
11
|
-
@Prop({ required: true, enum:
|
|
12
|
-
type:
|
|
10
|
+
export class Attachment extends Identifable implements IAttachment {
|
|
11
|
+
@Prop({ required: true, enum: AttachmentType, type: String })
|
|
12
|
+
type: AttachmentType;
|
|
13
13
|
|
|
14
14
|
@Prop({ type: FileEmbeddedSchema, required: false, default: null })
|
|
15
15
|
file: IFileEmbedded;
|
|
@@ -18,5 +18,5 @@ export class Attachement extends Identifable implements IAttachement {
|
|
|
18
18
|
link: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export const
|
|
22
|
-
export type
|
|
21
|
+
export const AttachmentSchema = SchemaFactory.createForClass(Attachment);
|
|
22
|
+
export type AttachmentDocument = HydratedDocument<Attachment>;
|
|
@@ -5,10 +5,10 @@ import { VirtualAddressType } from '../../enums/virtual-address-type.enum';
|
|
|
5
5
|
|
|
6
6
|
@Schema({ _id: false })
|
|
7
7
|
export class VirtualAddress implements IVirtualAddress {
|
|
8
|
-
@Prop({ type: String, enum: VirtualAddressType, required: true, default:
|
|
8
|
+
@Prop({ type: String, enum: VirtualAddressType, required: true, default: VirtualAddressType.Uncategorized })
|
|
9
9
|
type: VirtualAddressType;
|
|
10
10
|
|
|
11
|
-
@Prop({ type: String, required:
|
|
11
|
+
@Prop({ type: String, required: false, default: null })
|
|
12
12
|
link: string;
|
|
13
13
|
}
|
|
14
14
|
|