File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright CERN and copyright holders of ALICE O2. This software is
4+ * distributed under the terms of the GNU General Public License v3 (GPL
5+ * Version 3), copied verbatim in the file "COPYING".
6+ *
7+ * See http://alice-o2.web.cern.ch/license for full licensing information.
8+ *
9+ * In applying this license CERN does not waive the privileges and immunities
10+ * granted to it by virtue of its status as an Intergovernmental Organization
11+ * or submit itself to any jurisdiction.
12+ */
13+
14+ const Joi = require ( '@hapi/joi' ) ;
15+ const FileDto = require ( './FileDto' ) ;
16+
17+ const BodyDto = Joi . object ( {
18+ filename : Joi . string ( )
19+ . required ( )
20+ . min ( 3 ) ,
21+ log : Joi . number ( )
22+ . required ( ) ,
23+ } ) ;
24+
25+ const FilesDto = Joi . array ( ) . items ( FileDto ) ;
26+
27+ const QueryDto = Joi . object ( {
28+ token : Joi . string ( ) ,
29+ } ) ;
30+
31+ const CreateAttachmentDto = Joi . object ( {
32+ query : QueryDto ,
33+ body : BodyDto ,
34+ file : FileDto ,
35+ files : FilesDto ,
36+ params : Joi . object ( { } ) ,
37+ } ) . xor ( 'file' , 'files' ) ;
38+
39+ module . exports = CreateAttachmentDto ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright CERN and copyright holders of ALICE O2. This software is
4+ * distributed under the terms of the GNU General Public License v3 (GPL
5+ * Version 3), copied verbatim in the file "COPYING".
6+ *
7+ * See http://alice-o2.web.cern.ch/license for full licensing information.
8+ *
9+ * In applying this license CERN does not waive the privileges and immunities
10+ * granted to it by virtue of its status as an Intergovernmental Organization
11+ * or submit itself to any jurisdiction.
12+ */
13+
14+ const Joi = require ( '@hapi/joi' ) ;
15+ const FileDto = require ( './FileDto' ) ;
16+
17+ const ParamsDto = Joi . object ( {
18+ logId : Joi . number ( ) . required ( ) ,
19+ } ) ;
20+
21+ const BodyDto = Joi . object ( {
22+ filename : Joi . string ( )
23+ . required ( )
24+ . min ( 3 ) ,
25+ } ) ;
26+
27+ const FilesDto = Joi . array ( ) . items ( FileDto ) ;
28+
29+ const QueryDto = Joi . object ( {
30+ token : Joi . string ( ) ,
31+ } ) ;
32+
33+ const CreateAttachmentDto = Joi . object ( {
34+ query : QueryDto ,
35+ body : BodyDto ,
36+ file : FileDto ,
37+ files : FilesDto ,
38+ params : ParamsDto ,
39+ } ) . xor ( 'file' , 'files' ) ;
40+
41+ module . exports = CreateAttachmentDto ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright CERN and copyright holders of ALICE O2. This software is
4+ * distributed under the terms of the GNU General Public License v3 (GPL
5+ * Version 3), copied verbatim in the file "COPYING".
6+ *
7+ * See http://alice-o2.web.cern.ch/license for full licensing information.
8+ *
9+ * In applying this license CERN does not waive the privileges and immunities
10+ * granted to it by virtue of its status as an Intergovernmental Organization
11+ * or submit itself to any jurisdiction.
12+ */
13+
14+ const Joi = require ( '@hapi/joi' ) ;
15+
16+ const FileDto = Joi . object ( {
17+ mimetype : Joi . string ( ) . required ( ) ,
18+ filename : Joi . string ( ) . required ( ) . min ( 3 ) ,
19+ fieldname : Joi . string ( ) . required ( ) . min ( 3 ) ,
20+ originalname : Joi . string ( ) . required ( ) . min ( 3 ) ,
21+ encoding : Joi . string ( ) . required ( ) ,
22+ size : Joi . number ( ) . required ( ) ,
23+ destination : Joi . string ( ) ,
24+ path : Joi . string ( ) . required ( ) ,
25+ } ) ;
26+
27+ module . exports = FileDto ;
Original file line number Diff line number Diff line change 1111 * or submit itself to any jurisdiction.
1212 */
1313
14+ const CreateAttachmentDto = require ( './CreateAttachmentDto' ) ;
15+ const CreateLogAttachmentDto = require ( './CreateLogAttachmentDto' ) ;
1416const CreateLogDto = require ( './CreateLogDto' ) ;
1517const CreateSubsystemDto = require ( './CreateSubsystemDto' ) ;
1618const CreateTagDto = require ( './CreateTagDto' ) ;
@@ -24,6 +26,8 @@ const GetTagDto = require('./GetTagDto');
2426const PaginationDto = require ( './PaginationDto' ) ;
2527
2628module . exports = {
29+ CreateAttachmentDto,
30+ CreateLogAttachmentDto,
2731 CreateLogDto,
2832 CreateSubsystemDto,
2933 CreateTagDto,
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright CERN and copyright holders of ALICE O2. This software is
4+ * distributed under the terms of the GNU General Public License v3 (GPL
5+ * Version 3), copied verbatim in the file "COPYING".
6+ *
7+ * See http://alice-o2.web.cern.ch/license for full licensing information.
8+ *
9+ * In applying this license CERN does not waive the privileges and immunities
10+ * granted to it by virtue of its status as an Intergovernmental Organization
11+ * or submit itself to any jurisdiction.
12+ */
13+
14+ /**
15+ * Attachment
16+ */
17+ class Attachment {
18+ /**
19+ * Creates a new `Attachment` instance.
20+ */
21+ constructor ( ) {
22+ this . filename = undefined ;
23+ this . size = - 1 ;
24+ this . mimeType = undefined ;
25+ this . originalName = undefined ;
26+ this . path = undefined ;
27+ this . encoding = undefined ;
28+ this . logId = - 1 ;
29+ this . createdAt = undefined ;
30+ this . updatedAt = undefined ;
31+ }
32+ }
33+
34+ module . exports = Attachment ;
Original file line number Diff line number Diff line change 1212 */
1313
1414const log = require ( './log' ) ;
15+ const Attachment = require ( './Attachment' ) ;
1516
1617module . exports = {
1718 log,
19+ Attachment,
1820} ;
You can’t perform that action at this time.
0 commit comments