@grapadigital/shared-schemas 1.0.47 → 1.0.49

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.
@@ -70,7 +70,6 @@ export declare class Content {
70
70
  _id?: Types.ObjectId;
71
71
  caption: string;
72
72
  link: string;
73
- mediaUrl: string;
74
73
  type: 'reel' | 'carousel' | 'image' | 'story' | 'video';
75
74
  tagType: 'withTag' | 'withoutTag' | 'brandExposure';
76
75
  socialnetwork: 'instagram' | 'tiktok' | 'youtube';
@@ -81,10 +80,10 @@ export declare class Content {
81
80
  isCollab: boolean;
82
81
  isBoosted: boolean;
83
82
  hasAffiliateLink: boolean;
84
- collabs: Types.ObjectId[] | Profile[];
85
- metrics?: Metrics;
83
+ collabs?: Types.ObjectId[] | Profile[];
84
+ metrics: Metrics;
86
85
  estimates: Estimates;
87
- googleSheetRow: string;
86
+ googleSheetRow?: string;
88
87
  createdAt?: Date;
89
88
  updatedAt?: Date;
90
89
  }
@@ -76,19 +76,19 @@ let Estimates = class Estimates {
76
76
  ;
77
77
  };
78
78
  __decorate([
79
- (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
79
+ (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
80
80
  __metadata("design:type", Object)
81
81
  ], Estimates.prototype, "impressionCount", void 0);
82
82
  __decorate([
83
- (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
83
+ (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
84
84
  __metadata("design:type", Object)
85
85
  ], Estimates.prototype, "reachCount", void 0);
86
86
  __decorate([
87
- (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
87
+ (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
88
88
  __metadata("design:type", Object)
89
89
  ], Estimates.prototype, "engagementCount", void 0);
90
90
  __decorate([
91
- (0, mongoose_1.Prop)({ type: Number, required: false, default: null }),
91
+ (0, mongoose_1.Prop)({ type: Number, required: true, default: null }),
92
92
  __metadata("design:type", Object)
93
93
  ], Estimates.prototype, "engagementRate", void 0);
94
94
  Estimates = __decorate([
@@ -103,71 +103,72 @@ __decorate([
103
103
  __metadata("design:type", mongoose_2.Types.ObjectId)
104
104
  ], Content.prototype, "_id", void 0);
105
105
  __decorate([
106
- (0, mongoose_1.Prop)(),
106
+ (0, mongoose_1.Prop)({ types: String, required: true, default: '' }),
107
107
  __metadata("design:type", String)
108
108
  ], Content.prototype, "caption", void 0);
109
109
  __decorate([
110
- (0, mongoose_1.Prop)(),
110
+ (0, mongoose_1.Prop)({ types: String, required: true }),
111
111
  __metadata("design:type", String)
112
112
  ], Content.prototype, "link", void 0);
113
113
  __decorate([
114
- (0, mongoose_1.Prop)(),
115
- __metadata("design:type", String)
116
- ], Content.prototype, "mediaUrl", void 0);
117
- __decorate([
118
- (0, mongoose_1.Prop)({ type: String, enum: ['reel', 'image', 'carousel', 'story', 'video'] }),
114
+ (0, mongoose_1.Prop)({ type: String, enum: ['reel', 'image', 'carousel', 'story', 'video'], required: true }),
119
115
  __metadata("design:type", String)
120
116
  ], Content.prototype, "type", void 0);
121
117
  __decorate([
122
- (0, mongoose_1.Prop)({ type: String, enum: ['withTag', 'withoutTag', 'brandExposure'] }),
118
+ (0, mongoose_1.Prop)({ type: String, enum: ['withTag', 'withoutTag', 'brandExposure'], required: true }),
123
119
  __metadata("design:type", String)
124
120
  ], Content.prototype, "tagType", void 0);
125
121
  __decorate([
126
- (0, mongoose_1.Prop)({ type: String, enum: ['instagram', 'tiktok', 'youtube'] }),
122
+ (0, mongoose_1.Prop)({ type: String, enum: ['instagram', 'tiktok', 'youtube'], required: true }),
127
123
  __metadata("design:type", String)
128
124
  ], Content.prototype, "socialnetwork", void 0);
129
125
  __decorate([
130
- (0, mongoose_1.Prop)({ type: String, enum: ['approved', 'repproved', 'deleted'] }),
126
+ (0, mongoose_1.Prop)({
127
+ type: String,
128
+ enum: ['approved', 'repproved', 'deleted'],
129
+ required: true,
130
+ default: 'approved'
131
+ }),
131
132
  __metadata("design:type", String)
132
133
  ], Content.prototype, "status", void 0);
133
134
  __decorate([
134
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile' }),
135
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: true }),
135
136
  __metadata("design:type", Object)
136
137
  ], Content.prototype, "profile", void 0);
137
138
  __decorate([
138
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action' }),
139
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Action', required: true }),
139
140
  __metadata("design:type", Object)
140
141
  ], Content.prototype, "action", void 0);
141
142
  __decorate([
142
- (0, mongoose_1.Prop)(),
143
+ (0, mongoose_1.Prop)({ types: Date, required: true }),
143
144
  __metadata("design:type", Date)
144
145
  ], Content.prototype, "postedAt", void 0);
145
146
  __decorate([
146
- (0, mongoose_1.Prop)(),
147
+ (0, mongoose_1.Prop)({ types: Boolean, required: true, default: false }),
147
148
  __metadata("design:type", Boolean)
148
149
  ], Content.prototype, "isCollab", void 0);
149
150
  __decorate([
150
- (0, mongoose_1.Prop)(),
151
+ (0, mongoose_1.Prop)({ types: Boolean, required: true, default: false }),
151
152
  __metadata("design:type", Boolean)
152
153
  ], Content.prototype, "isBoosted", void 0);
153
154
  __decorate([
154
- (0, mongoose_1.Prop)(),
155
+ (0, mongoose_1.Prop)({ types: String, required: true, default: false }),
155
156
  __metadata("design:type", Boolean)
156
157
  ], Content.prototype, "hasAffiliateLink", void 0);
157
158
  __decorate([
158
- (0, mongoose_1.Prop)([{ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile' }]),
159
+ (0, mongoose_1.Prop)([{ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: false }]),
159
160
  __metadata("design:type", Array)
160
161
  ], Content.prototype, "collabs", void 0);
161
162
  __decorate([
162
- (0, mongoose_1.Prop)({ type: exports.MetricsSchema, required: false }),
163
+ (0, mongoose_1.Prop)({ type: exports.MetricsSchema, required: true }),
163
164
  __metadata("design:type", Metrics)
164
165
  ], Content.prototype, "metrics", void 0);
165
166
  __decorate([
166
- (0, mongoose_1.Prop)({ type: exports.MetricsSchema }),
167
+ (0, mongoose_1.Prop)({ type: exports.MetricsSchema, required: true }),
167
168
  __metadata("design:type", Estimates)
168
169
  ], Content.prototype, "estimates", void 0);
169
170
  __decorate([
170
- (0, mongoose_1.Prop)(),
171
+ (0, mongoose_1.Prop)({ type: String, required: false }),
171
172
  __metadata("design:type", String)
172
173
  ], Content.prototype, "googleSheetRow", void 0);
173
174
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grapadigital/shared-schemas",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Shared Mongoose Schemas",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,16 +52,16 @@ export const MetricsSchema = SchemaFactory.createForClass(Metrics);
52
52
 
53
53
  @Schema({ _id: false })
54
54
  export class Estimates {
55
- @Prop({ type: Number, required: false, default: null })
55
+ @Prop({ type: Number, required: true, default: null })
56
56
  impressionCount?: number | null;
57
57
 
58
- @Prop({ type: Number, required: false, default: null })
58
+ @Prop({ type: Number, required: true, default: null })
59
59
  reachCount?: number | null;
60
60
 
61
- @Prop({ type: Number, required: false, default: null })
61
+ @Prop({ type: Number, required: true, default: null })
62
62
  engagementCount?: number | null;
63
63
 
64
- @Prop({ type: Number, required: false, default: null })
64
+ @Prop({ type: Number, required: true, default: null })
65
65
  engagementRate?: number | null;
66
66
  ;
67
67
  }
@@ -73,56 +73,58 @@ export class Content {
73
73
  @Prop({ type: MongooseSchema.Types.ObjectId, auto: true, required: false })
74
74
  _id?: Types.ObjectId;
75
75
 
76
- @Prop()
76
+ @Prop({ types: String, required: true, default: ''})
77
77
  caption: string;
78
78
 
79
- @Prop()
79
+ @Prop({ types: String, required: true })
80
80
  link: string;
81
81
 
82
- @Prop()
83
- mediaUrl: string;
84
-
85
- @Prop({ type: String, enum: ['reel', 'image', 'carousel', 'story', 'video'] })
82
+ @Prop({ type: String, enum: ['reel', 'image', 'carousel', 'story', 'video'], required: true })
86
83
  type: 'reel' | 'carousel' | 'image' | 'story' | 'video';
87
84
 
88
- @Prop({ type: String, enum: ['withTag', 'withoutTag', 'brandExposure'] })
85
+ @Prop({ type: String, enum: ['withTag', 'withoutTag', 'brandExposure'], required: true })
89
86
  tagType: 'withTag' | 'withoutTag' | 'brandExposure';
90
87
 
91
- @Prop({ type: String, enum: ['instagram', 'tiktok', 'youtube'] })
88
+ @Prop({ type: String, enum: ['instagram', 'tiktok', 'youtube'], required: true })
92
89
  socialnetwork: 'instagram' | 'tiktok' | 'youtube';
93
90
 
94
- @Prop({ type: String, enum: ['approved', 'repproved', 'deleted'] })
91
+ @Prop({
92
+ type: String,
93
+ enum: ['approved', 'repproved', 'deleted'],
94
+ required: true,
95
+ default: 'approved'
96
+ })
95
97
  status: 'approved' | 'repproved' | 'deleted';
96
98
 
97
- @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Profile' })
99
+ @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Profile', required: true })
98
100
  profile: Types.ObjectId | Profile;
99
101
 
100
- @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Action' })
102
+ @Prop({ type: MongooseSchema.Types.ObjectId, ref: 'Action', required: true })
101
103
  action: Types.ObjectId | Action;
102
104
 
103
- @Prop()
105
+ @Prop({ types: Date, required: true })
104
106
  postedAt: Date;
105
107
 
106
- @Prop()
108
+ @Prop({ types: Boolean, required: true, default: false })
107
109
  isCollab: boolean;
108
110
 
109
- @Prop()
111
+ @Prop({ types: Boolean, required: true, default: false })
110
112
  isBoosted: boolean;
111
113
 
112
- @Prop()
114
+ @Prop({ types: String, required: true, default: false })
113
115
  hasAffiliateLink: boolean;
114
116
 
115
- @Prop([{ type: MongooseSchema.Types.ObjectId, ref: 'Profile' }])
116
- collabs: Types.ObjectId[] | Profile[];
117
+ @Prop([{ type: MongooseSchema.Types.ObjectId, ref: 'Profile', required: false }])
118
+ collabs?: Types.ObjectId[] | Profile[];
117
119
 
118
- @Prop({ type: MetricsSchema, required: false })
119
- metrics?: Metrics;
120
+ @Prop({ type: MetricsSchema, required: true })
121
+ metrics: Metrics;
120
122
 
121
- @Prop({ type: MetricsSchema })
123
+ @Prop({ type: MetricsSchema, required: true })
122
124
  estimates: Estimates;
123
125
 
124
- @Prop()
125
- googleSheetRow: string;
126
+ @Prop({ type: String, required: false })
127
+ googleSheetRow?: string;
126
128
 
127
129
  @Prop({ default: Date.now, required: false })
128
130
  createdAt?: Date;