@duvdu-v1/duvdu 1.1.186 → 1.1.188

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.
@@ -21,7 +21,8 @@ const uploadProjectMedia = (folder) => (0, multer_1.default)({
21
21
  file.mimetype.startsWith('video') ||
22
22
  file.mimetype === 'application/pdf' ||
23
23
  file.mimetype === 'audio/mpeg' ||
24
- file.mimetype === 'audio/wav')
24
+ file.mimetype === 'audio/wav' ||
25
+ file.mimetype === 'audio/x-wav')
25
26
  return callback(null, true);
26
27
  return callback(new bad_request_error_1.BadRequestError('invalid file format'));
27
28
  },
@@ -28,6 +28,10 @@ interface Ireaction {
28
28
  type: string;
29
29
  user: Types.ObjectId | Iuser;
30
30
  }
31
+ export interface IWatcher {
32
+ user: Types.ObjectId | Iuser;
33
+ watched: boolean;
34
+ }
31
35
  export interface ImessageDoc {
32
36
  sender: Types.ObjectId | Iuser;
33
37
  receiver: Types.ObjectId | Iuser;
@@ -39,8 +43,8 @@ export interface ImessageDoc {
39
43
  }
40
44
  ];
41
45
  reactions: Ireaction[];
42
- watched: boolean;
43
46
  updated: boolean;
47
+ watchers: IWatcher[];
44
48
  }
45
49
  export declare const Message: import("mongoose").Model<ImessageDoc, {}, {}, {}, import("mongoose").Document<unknown, {}, ImessageDoc> & ImessageDoc & {
46
50
  _id: Types.ObjectId;
@@ -7,6 +7,10 @@ const reactionSchema = new mongoose_1.Schema({
7
7
  type: { type: String, required: true },
8
8
  user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, required: true },
9
9
  });
10
+ const watcherSchema = new mongoose_1.Schema({
11
+ user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, required: true },
12
+ watched: { type: Boolean, default: false },
13
+ });
10
14
  exports.Message = (0, mongoose_1.model)(model_names_1.MODELS.messages, new mongoose_1.Schema({
11
15
  sender: {
12
16
  type: mongoose_1.Schema.Types.ObjectId,
@@ -23,6 +27,7 @@ exports.Message = (0, mongoose_1.model)(model_names_1.MODELS.messages, new mongo
23
27
  default: null,
24
28
  },
25
29
  reactions: [reactionSchema],
30
+ watchers: [watcherSchema],
26
31
  media: [
27
32
  {
28
33
  type: {
@@ -35,10 +40,6 @@ exports.Message = (0, mongoose_1.model)(model_names_1.MODELS.messages, new mongo
35
40
  },
36
41
  },
37
42
  ],
38
- watched: {
39
- type: Boolean,
40
- default: false,
41
- },
42
43
  updated: {
43
44
  type: Boolean,
44
45
  default: false,
@@ -21,5 +21,5 @@ exports.Producer = (0, mongoose_1.model)(model_names_1.MODELS.producer, new mong
21
21
  minBudget: { type: Number, default: null },
22
22
  maxBudget: { type: Number, default: null },
23
23
  searchKeywords: [String],
24
- platforms: [{ type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.producerPlatforms }]
24
+ platforms: [{ type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.producerPlatforms }],
25
25
  }, { timestamps: true, collection: model_names_1.MODELS.producer }));
@@ -5,10 +5,14 @@ const mongoose_1 = require("mongoose");
5
5
  const model_names_1 = require("../types/model-names");
6
6
  exports.ProducerPlatform = (0, mongoose_1.model)(model_names_1.MODELS.producerPlatforms, new mongoose_1.Schema({
7
7
  name: { ar: { type: String, default: null }, en: { type: String, default: null } },
8
- image: String
9
- }, { timestamps: true, collection: model_names_1.MODELS.producerPlatforms, toJSON: {
8
+ image: String,
9
+ }, {
10
+ timestamps: true,
11
+ collection: model_names_1.MODELS.producerPlatforms,
12
+ toJSON: {
10
13
  transform(doc, ret) {
11
14
  if (ret.image)
12
15
  ret.image = process.env.BUCKET_HOST + '/' + ret.image;
13
- }
14
- }, }));
16
+ },
17
+ },
18
+ }));
@@ -92,5 +92,5 @@ exports.TeamContract = (0, mongoose_1.model)('team_contracts', new mongoose_1.Sc
92
92
  cycle: { type: String, default: cycles_1.CYCLES.teamProject },
93
93
  paymentAmount: { type: Number, default: 0 },
94
94
  attachments: [String],
95
- totalCheckoutAt: Date
95
+ totalCheckoutAt: Date,
96
96
  }, { timestamps: true, collection: 'team_contracts' }));
@@ -86,4 +86,5 @@ export declare const permissions: {
86
86
  setting: PERMISSIONS[];
87
87
  producer: PERMISSIONS[];
88
88
  dashboard: PERMISSIONS[];
89
+ producerPlatform: PERMISSIONS[];
89
90
  };
@@ -168,4 +168,9 @@ exports.permissions = {
168
168
  ],
169
169
  producer: [PERMISSIONS.getProducerAnalysis],
170
170
  dashboard: [PERMISSIONS.accessDashboard],
171
+ producerPlatform: [
172
+ PERMISSIONS.getProducerAnalysis,
173
+ PERMISSIONS.createPlatform,
174
+ PERMISSIONS.updatePlatform,
175
+ ],
171
176
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.186",
3
+ "version": "1.1.188",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [