@grapadigital/shared-schemas 1.0.200 → 1.0.201
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 +2 -0
- package/dist/index.js +2 -0
- package/dist/schemas/lead.schema.d.ts +281 -0
- package/dist/schemas/lead.schema.js +456 -0
- package/dist/schemas/profile-followers-snapshot.schema.d.ts +67 -0
- package/dist/schemas/profile-followers-snapshot.schema.js +65 -0
- package/dist/schemas/profile.schema.d.ts +3 -0
- package/dist/schemas/profile.schema.js +12 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/schemas/lead.schema.ts +354 -0
- package/src/schemas/profile-followers-snapshot.schema.ts +55 -0
- package/src/schemas/profile.schema.ts +10 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LeadModel = exports.LeadSchema = exports.Lead = exports.LeadContentGuidelinesSchema = exports.LeadContentGuidelines = exports.LeadLogisticsSchema = exports.LeadLogistics = exports.LeadCurationSchema = exports.LeadCuration = exports.LeadAudienceSchema = exports.LeadAudience = exports.LeadDeliveryScopeSchema = exports.LeadDeliveryScope = exports.LeadObjectivesSchema = exports.LeadObjectives = exports.LeadStrategicContextSchema = exports.LeadStrategicContext = exports.LeadDeliverablesSchema = exports.LeadDeliverables = exports.LeadCompetitionSchema = exports.LeadCompetition = exports.LeadBudgetSchema = exports.LeadBudget = exports.LeadConfidentialitySchema = exports.LeadConfidentiality = exports.LeadGeneralSchema = exports.LeadGeneral = exports.LEAD_SECTION_KEYS = exports.LEAD_FOLLOWER_TIER_VALUES = exports.LEAD_RIGHT_VALUES = exports.LEAD_CHANNEL_VALUES = exports.LEAD_GOAL_VALUES = exports.LEAD_DELIVERABLE_VALUES = exports.LEAD_PAYMENT_TERM_VALUES = exports.LEAD_PRESENTATION_FORMAT_VALUES = exports.LEAD_STATUS_VALUES = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
// Lead = briefing de campanha preenchido pelo cliente numa página pública (GD-616).
|
|
16
|
+
// O acesso público é sempre pelo accessToken, nunca pelo _id.
|
|
17
|
+
exports.LEAD_STATUS_VALUES = ['draft', 'submitted'];
|
|
18
|
+
exports.LEAD_PRESENTATION_FORMAT_VALUES = ['online', 'in_person', 'email_only'];
|
|
19
|
+
exports.LEAD_PAYMENT_TERM_VALUES = [30, 60, 90, 120];
|
|
20
|
+
exports.LEAD_DELIVERABLE_VALUES = [
|
|
21
|
+
'content_strategy',
|
|
22
|
+
'ppt_presentation',
|
|
23
|
+
'curation_sheet',
|
|
24
|
+
'production_sheet',
|
|
25
|
+
];
|
|
26
|
+
exports.LEAD_GOAL_VALUES = ['awareness', 'consideration', 'intent'];
|
|
27
|
+
exports.LEAD_CHANNEL_VALUES = ['online', 'offline'];
|
|
28
|
+
exports.LEAD_RIGHT_VALUES = [
|
|
29
|
+
'influencer_collab',
|
|
30
|
+
'brand_collab',
|
|
31
|
+
'client_boost',
|
|
32
|
+
'influencer_boost',
|
|
33
|
+
'segment_exclusivity',
|
|
34
|
+
'image_rights',
|
|
35
|
+
'dark_post',
|
|
36
|
+
'offline',
|
|
37
|
+
];
|
|
38
|
+
exports.LEAD_FOLLOWER_TIER_VALUES = ['heroes', 'macros', 'medios', 'micros', 'nanos', 'nda'];
|
|
39
|
+
exports.LEAD_SECTION_KEYS = [
|
|
40
|
+
'general',
|
|
41
|
+
'confidentiality',
|
|
42
|
+
'budget',
|
|
43
|
+
'competition',
|
|
44
|
+
'deliverables',
|
|
45
|
+
'strategicContext',
|
|
46
|
+
'objectives',
|
|
47
|
+
'deliveryScope',
|
|
48
|
+
'audience',
|
|
49
|
+
'curation',
|
|
50
|
+
'logistics',
|
|
51
|
+
'contentGuidelines',
|
|
52
|
+
];
|
|
53
|
+
let LeadGeneral = class LeadGeneral {
|
|
54
|
+
};
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, mongoose_1.Prop)({ trim: true }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], LeadGeneral.prototype, "advertiser", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, mongoose_1.Prop)({ trim: true }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], LeadGeneral.prototype, "brand", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, mongoose_1.Prop)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], LeadGeneral.prototype, "socialProfiles", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, mongoose_1.Prop)({ trim: true }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], LeadGeneral.prototype, "campaignName", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, mongoose_1.Prop)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], LeadGeneral.prototype, "language", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, mongoose_1.Prop)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], LeadGeneral.prototype, "materialsUrl", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, mongoose_1.Prop)(),
|
|
81
|
+
__metadata("design:type", Date)
|
|
82
|
+
], LeadGeneral.prototype, "presentationDate", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, mongoose_1.Prop)(),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], LeadGeneral.prototype, "schedule", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_PRESENTATION_FORMAT_VALUES }),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], LeadGeneral.prototype, "presentationFormat", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, mongoose_1.Prop)({ trim: true }),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], LeadGeneral.prototype, "contactName", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, mongoose_1.Prop)({ trim: true, lowercase: true }),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], LeadGeneral.prototype, "contactEmail", void 0);
|
|
99
|
+
LeadGeneral = __decorate([
|
|
100
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
101
|
+
], LeadGeneral);
|
|
102
|
+
exports.LeadGeneral = LeadGeneral;
|
|
103
|
+
exports.LeadGeneralSchema = mongoose_1.SchemaFactory.createForClass(LeadGeneral);
|
|
104
|
+
let LeadConfidentiality = class LeadConfidentiality {
|
|
105
|
+
};
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, mongoose_1.Prop)(),
|
|
108
|
+
__metadata("design:type", Boolean)
|
|
109
|
+
], LeadConfidentiality.prototype, "hasRestriction", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, mongoose_1.Prop)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], LeadConfidentiality.prototype, "restrictionDetails", void 0);
|
|
114
|
+
LeadConfidentiality = __decorate([
|
|
115
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
116
|
+
], LeadConfidentiality);
|
|
117
|
+
exports.LeadConfidentiality = LeadConfidentiality;
|
|
118
|
+
exports.LeadConfidentialitySchema = mongoose_1.SchemaFactory.createForClass(LeadConfidentiality);
|
|
119
|
+
let LeadBudget = class LeadBudget {
|
|
120
|
+
};
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, mongoose_1.Prop)(),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], LeadBudget.prototype, "totalBudget", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, mongoose_1.Prop)(),
|
|
127
|
+
__metadata("design:type", Number)
|
|
128
|
+
], LeadBudget.prototype, "creatorsBudget", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, mongoose_1.Prop)({ type: Number, enum: exports.LEAD_PAYMENT_TERM_VALUES }),
|
|
131
|
+
__metadata("design:type", Number)
|
|
132
|
+
], LeadBudget.prototype, "paymentTerm", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, mongoose_1.Prop)(),
|
|
135
|
+
__metadata("design:type", Number)
|
|
136
|
+
], LeadBudget.prototype, "campaignDurationMonths", void 0);
|
|
137
|
+
LeadBudget = __decorate([
|
|
138
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
139
|
+
], LeadBudget);
|
|
140
|
+
exports.LeadBudget = LeadBudget;
|
|
141
|
+
exports.LeadBudgetSchema = mongoose_1.SchemaFactory.createForClass(LeadBudget);
|
|
142
|
+
let LeadCompetition = class LeadCompetition {
|
|
143
|
+
};
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, mongoose_1.Prop)(),
|
|
146
|
+
__metadata("design:type", Boolean)
|
|
147
|
+
], LeadCompetition.prototype, "isCompetitive", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, mongoose_1.Prop)(),
|
|
150
|
+
__metadata("design:type", Boolean)
|
|
151
|
+
], LeadCompetition.prototype, "involveAreaLeaders", void 0);
|
|
152
|
+
LeadCompetition = __decorate([
|
|
153
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
154
|
+
], LeadCompetition);
|
|
155
|
+
exports.LeadCompetition = LeadCompetition;
|
|
156
|
+
exports.LeadCompetitionSchema = mongoose_1.SchemaFactory.createForClass(LeadCompetition);
|
|
157
|
+
let LeadDeliverables = class LeadDeliverables {
|
|
158
|
+
};
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_DELIVERABLE_VALUES, default: undefined }),
|
|
161
|
+
__metadata("design:type", Array)
|
|
162
|
+
], LeadDeliverables.prototype, "types", void 0);
|
|
163
|
+
LeadDeliverables = __decorate([
|
|
164
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
165
|
+
], LeadDeliverables);
|
|
166
|
+
exports.LeadDeliverables = LeadDeliverables;
|
|
167
|
+
exports.LeadDeliverablesSchema = mongoose_1.SchemaFactory.createForClass(LeadDeliverables);
|
|
168
|
+
let LeadStrategicContext = class LeadStrategicContext {
|
|
169
|
+
};
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, mongoose_1.Prop)(),
|
|
172
|
+
__metadata("design:type", String)
|
|
173
|
+
], LeadStrategicContext.prototype, "brandScenario", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, mongoose_1.Prop)(),
|
|
176
|
+
__metadata("design:type", String)
|
|
177
|
+
], LeadStrategicContext.prototype, "productInfo", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, mongoose_1.Prop)(),
|
|
180
|
+
__metadata("design:type", String)
|
|
181
|
+
], LeadStrategicContext.prototype, "parentCampaign", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, mongoose_1.Prop)(),
|
|
184
|
+
__metadata("design:type", String)
|
|
185
|
+
], LeadStrategicContext.prototype, "message", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, mongoose_1.Prop)(),
|
|
188
|
+
__metadata("design:type", String)
|
|
189
|
+
], LeadStrategicContext.prototype, "callToAction", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, mongoose_1.Prop)(),
|
|
192
|
+
__metadata("design:type", String)
|
|
193
|
+
], LeadStrategicContext.prototype, "highlights", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, mongoose_1.Prop)(),
|
|
196
|
+
__metadata("design:type", String)
|
|
197
|
+
], LeadStrategicContext.prototype, "centralChallenge", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
(0, mongoose_1.Prop)(),
|
|
200
|
+
__metadata("design:type", String)
|
|
201
|
+
], LeadStrategicContext.prototype, "tone", void 0);
|
|
202
|
+
LeadStrategicContext = __decorate([
|
|
203
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
204
|
+
], LeadStrategicContext);
|
|
205
|
+
exports.LeadStrategicContext = LeadStrategicContext;
|
|
206
|
+
exports.LeadStrategicContextSchema = mongoose_1.SchemaFactory.createForClass(LeadStrategicContext);
|
|
207
|
+
let LeadObjectives = class LeadObjectives {
|
|
208
|
+
};
|
|
209
|
+
__decorate([
|
|
210
|
+
(0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_GOAL_VALUES, default: undefined }),
|
|
211
|
+
__metadata("design:type", Array)
|
|
212
|
+
], LeadObjectives.prototype, "goals", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_GOAL_VALUES }),
|
|
215
|
+
__metadata("design:type", String)
|
|
216
|
+
], LeadObjectives.prototype, "primaryGoal", void 0);
|
|
217
|
+
LeadObjectives = __decorate([
|
|
218
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
219
|
+
], LeadObjectives);
|
|
220
|
+
exports.LeadObjectives = LeadObjectives;
|
|
221
|
+
exports.LeadObjectivesSchema = mongoose_1.SchemaFactory.createForClass(LeadObjectives);
|
|
222
|
+
let LeadDeliveryScope = class LeadDeliveryScope {
|
|
223
|
+
};
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_CHANNEL_VALUES, default: undefined }),
|
|
226
|
+
__metadata("design:type", Array)
|
|
227
|
+
], LeadDeliveryScope.prototype, "channels", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, mongoose_1.Prop)(),
|
|
230
|
+
__metadata("design:type", String)
|
|
231
|
+
], LeadDeliveryScope.prototype, "primaryNetworks", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, mongoose_1.Prop)(),
|
|
234
|
+
__metadata("design:type", String)
|
|
235
|
+
], LeadDeliveryScope.prototype, "secondaryNetworks", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, mongoose_1.Prop)(),
|
|
238
|
+
__metadata("design:type", String)
|
|
239
|
+
], LeadDeliveryScope.prototype, "contentPerNetwork", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_RIGHT_VALUES, default: undefined }),
|
|
242
|
+
__metadata("design:type", Array)
|
|
243
|
+
], LeadDeliveryScope.prototype, "rights", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, mongoose_1.Prop)(),
|
|
246
|
+
__metadata("design:type", Number)
|
|
247
|
+
], LeadDeliveryScope.prototype, "imageRightsMonths", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
(0, mongoose_1.Prop)(),
|
|
250
|
+
__metadata("design:type", String)
|
|
251
|
+
], LeadDeliveryScope.prototype, "offlineFormats", void 0);
|
|
252
|
+
LeadDeliveryScope = __decorate([
|
|
253
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
254
|
+
], LeadDeliveryScope);
|
|
255
|
+
exports.LeadDeliveryScope = LeadDeliveryScope;
|
|
256
|
+
exports.LeadDeliveryScopeSchema = mongoose_1.SchemaFactory.createForClass(LeadDeliveryScope);
|
|
257
|
+
let LeadAudience = class LeadAudience {
|
|
258
|
+
};
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, mongoose_1.Prop)(),
|
|
261
|
+
__metadata("design:type", String)
|
|
262
|
+
], LeadAudience.prototype, "ageRange", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
(0, mongoose_1.Prop)(),
|
|
265
|
+
__metadata("design:type", String)
|
|
266
|
+
], LeadAudience.prototype, "gender", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, mongoose_1.Prop)(),
|
|
269
|
+
__metadata("design:type", String)
|
|
270
|
+
], LeadAudience.prototype, "region", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
(0, mongoose_1.Prop)(),
|
|
273
|
+
__metadata("design:type", String)
|
|
274
|
+
], LeadAudience.prototype, "attitudinalProfile", void 0);
|
|
275
|
+
LeadAudience = __decorate([
|
|
276
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
277
|
+
], LeadAudience);
|
|
278
|
+
exports.LeadAudience = LeadAudience;
|
|
279
|
+
exports.LeadAudienceSchema = mongoose_1.SchemaFactory.createForClass(LeadAudience);
|
|
280
|
+
let LeadCuration = class LeadCuration {
|
|
281
|
+
};
|
|
282
|
+
__decorate([
|
|
283
|
+
(0, mongoose_1.Prop)(),
|
|
284
|
+
__metadata("design:type", String)
|
|
285
|
+
], LeadCuration.prototype, "influencerProfile", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
(0, mongoose_1.Prop)(),
|
|
288
|
+
__metadata("design:type", String)
|
|
289
|
+
], LeadCuration.prototype, "referenceNames", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
(0, mongoose_1.Prop)(),
|
|
292
|
+
__metadata("design:type", String)
|
|
293
|
+
], LeadCuration.prototype, "namesToAvoid", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
(0, mongoose_1.Prop)(),
|
|
296
|
+
__metadata("design:type", Number)
|
|
297
|
+
], LeadCuration.prototype, "approveCount", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
(0, mongoose_1.Prop)(),
|
|
300
|
+
__metadata("design:type", Number)
|
|
301
|
+
], LeadCuration.prototype, "analyzeCount", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
(0, mongoose_1.Prop)({ type: [String], enum: exports.LEAD_FOLLOWER_TIER_VALUES, default: undefined }),
|
|
304
|
+
__metadata("design:type", Array)
|
|
305
|
+
], LeadCuration.prototype, "followerTiers", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
(0, mongoose_1.Prop)(),
|
|
308
|
+
__metadata("design:type", String)
|
|
309
|
+
], LeadCuration.prototype, "competitorBrands", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
(0, mongoose_1.Prop)(),
|
|
312
|
+
__metadata("design:type", String)
|
|
313
|
+
], LeadCuration.prototype, "competitorCheckPeriod", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
(0, mongoose_1.Prop)(),
|
|
316
|
+
__metadata("design:type", String)
|
|
317
|
+
], LeadCuration.prototype, "requirements", void 0);
|
|
318
|
+
LeadCuration = __decorate([
|
|
319
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
320
|
+
], LeadCuration);
|
|
321
|
+
exports.LeadCuration = LeadCuration;
|
|
322
|
+
exports.LeadCurationSchema = mongoose_1.SchemaFactory.createForClass(LeadCuration);
|
|
323
|
+
let LeadLogistics = class LeadLogistics {
|
|
324
|
+
};
|
|
325
|
+
__decorate([
|
|
326
|
+
(0, mongoose_1.Prop)(),
|
|
327
|
+
__metadata("design:type", String)
|
|
328
|
+
], LeadLogistics.prototype, "productShipping", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
(0, mongoose_1.Prop)(),
|
|
331
|
+
__metadata("design:type", String)
|
|
332
|
+
], LeadLogistics.prototype, "eventPresence", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
(0, mongoose_1.Prop)(),
|
|
335
|
+
__metadata("design:type", String)
|
|
336
|
+
], LeadLogistics.prototype, "otherLogistics", void 0);
|
|
337
|
+
LeadLogistics = __decorate([
|
|
338
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
339
|
+
], LeadLogistics);
|
|
340
|
+
exports.LeadLogistics = LeadLogistics;
|
|
341
|
+
exports.LeadLogisticsSchema = mongoose_1.SchemaFactory.createForClass(LeadLogistics);
|
|
342
|
+
let LeadContentGuidelines = class LeadContentGuidelines {
|
|
343
|
+
};
|
|
344
|
+
__decorate([
|
|
345
|
+
(0, mongoose_1.Prop)(),
|
|
346
|
+
__metadata("design:type", String)
|
|
347
|
+
], LeadContentGuidelines.prototype, "productionRequirements", void 0);
|
|
348
|
+
__decorate([
|
|
349
|
+
(0, mongoose_1.Prop)(),
|
|
350
|
+
__metadata("design:type", String)
|
|
351
|
+
], LeadContentGuidelines.prototype, "dos", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
(0, mongoose_1.Prop)(),
|
|
354
|
+
__metadata("design:type", String)
|
|
355
|
+
], LeadContentGuidelines.prototype, "donts", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
(0, mongoose_1.Prop)(),
|
|
358
|
+
__metadata("design:type", String)
|
|
359
|
+
], LeadContentGuidelines.prototype, "mandatoryWords", void 0);
|
|
360
|
+
__decorate([
|
|
361
|
+
(0, mongoose_1.Prop)(),
|
|
362
|
+
__metadata("design:type", String)
|
|
363
|
+
], LeadContentGuidelines.prototype, "forbiddenTopics", void 0);
|
|
364
|
+
__decorate([
|
|
365
|
+
(0, mongoose_1.Prop)(),
|
|
366
|
+
__metadata("design:type", String)
|
|
367
|
+
], LeadContentGuidelines.prototype, "forbiddenWords", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
(0, mongoose_1.Prop)(),
|
|
370
|
+
__metadata("design:type", String)
|
|
371
|
+
], LeadContentGuidelines.prototype, "creatorMessage", void 0);
|
|
372
|
+
__decorate([
|
|
373
|
+
(0, mongoose_1.Prop)(),
|
|
374
|
+
__metadata("design:type", String)
|
|
375
|
+
], LeadContentGuidelines.prototype, "additionalDirections", void 0);
|
|
376
|
+
LeadContentGuidelines = __decorate([
|
|
377
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
378
|
+
], LeadContentGuidelines);
|
|
379
|
+
exports.LeadContentGuidelines = LeadContentGuidelines;
|
|
380
|
+
exports.LeadContentGuidelinesSchema = mongoose_1.SchemaFactory.createForClass(LeadContentGuidelines);
|
|
381
|
+
let Lead = class Lead {
|
|
382
|
+
};
|
|
383
|
+
__decorate([
|
|
384
|
+
(0, mongoose_1.Prop)({ required: true, unique: true, select: false }),
|
|
385
|
+
__metadata("design:type", String)
|
|
386
|
+
], Lead.prototype, "accessToken", void 0);
|
|
387
|
+
__decorate([
|
|
388
|
+
(0, mongoose_1.Prop)({ type: String, enum: exports.LEAD_STATUS_VALUES, default: 'draft', index: true }),
|
|
389
|
+
__metadata("design:type", String)
|
|
390
|
+
], Lead.prototype, "status", void 0);
|
|
391
|
+
__decorate([
|
|
392
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: 'Organization', required: true }),
|
|
393
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
394
|
+
], Lead.prototype, "organization", void 0);
|
|
395
|
+
__decorate([
|
|
396
|
+
(0, mongoose_1.Prop)(),
|
|
397
|
+
__metadata("design:type", Date)
|
|
398
|
+
], Lead.prototype, "submittedAt", void 0);
|
|
399
|
+
__decorate([
|
|
400
|
+
(0, mongoose_1.Prop)({ index: true }),
|
|
401
|
+
__metadata("design:type", Date)
|
|
402
|
+
], Lead.prototype, "lastEditedAt", void 0);
|
|
403
|
+
__decorate([
|
|
404
|
+
(0, mongoose_1.Prop)({ type: exports.LeadGeneralSchema, default: {} }),
|
|
405
|
+
__metadata("design:type", LeadGeneral)
|
|
406
|
+
], Lead.prototype, "general", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
(0, mongoose_1.Prop)({ type: exports.LeadConfidentialitySchema, default: {} }),
|
|
409
|
+
__metadata("design:type", LeadConfidentiality)
|
|
410
|
+
], Lead.prototype, "confidentiality", void 0);
|
|
411
|
+
__decorate([
|
|
412
|
+
(0, mongoose_1.Prop)({ type: exports.LeadBudgetSchema, default: {} }),
|
|
413
|
+
__metadata("design:type", LeadBudget)
|
|
414
|
+
], Lead.prototype, "budget", void 0);
|
|
415
|
+
__decorate([
|
|
416
|
+
(0, mongoose_1.Prop)({ type: exports.LeadCompetitionSchema, default: {} }),
|
|
417
|
+
__metadata("design:type", LeadCompetition)
|
|
418
|
+
], Lead.prototype, "competition", void 0);
|
|
419
|
+
__decorate([
|
|
420
|
+
(0, mongoose_1.Prop)({ type: exports.LeadDeliverablesSchema, default: {} }),
|
|
421
|
+
__metadata("design:type", LeadDeliverables)
|
|
422
|
+
], Lead.prototype, "deliverables", void 0);
|
|
423
|
+
__decorate([
|
|
424
|
+
(0, mongoose_1.Prop)({ type: exports.LeadStrategicContextSchema, default: {} }),
|
|
425
|
+
__metadata("design:type", LeadStrategicContext)
|
|
426
|
+
], Lead.prototype, "strategicContext", void 0);
|
|
427
|
+
__decorate([
|
|
428
|
+
(0, mongoose_1.Prop)({ type: exports.LeadObjectivesSchema, default: {} }),
|
|
429
|
+
__metadata("design:type", LeadObjectives)
|
|
430
|
+
], Lead.prototype, "objectives", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
(0, mongoose_1.Prop)({ type: exports.LeadDeliveryScopeSchema, default: {} }),
|
|
433
|
+
__metadata("design:type", LeadDeliveryScope)
|
|
434
|
+
], Lead.prototype, "deliveryScope", void 0);
|
|
435
|
+
__decorate([
|
|
436
|
+
(0, mongoose_1.Prop)({ type: exports.LeadAudienceSchema, default: {} }),
|
|
437
|
+
__metadata("design:type", LeadAudience)
|
|
438
|
+
], Lead.prototype, "audience", void 0);
|
|
439
|
+
__decorate([
|
|
440
|
+
(0, mongoose_1.Prop)({ type: exports.LeadCurationSchema, default: {} }),
|
|
441
|
+
__metadata("design:type", LeadCuration)
|
|
442
|
+
], Lead.prototype, "curation", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
(0, mongoose_1.Prop)({ type: exports.LeadLogisticsSchema, default: {} }),
|
|
445
|
+
__metadata("design:type", LeadLogistics)
|
|
446
|
+
], Lead.prototype, "logistics", void 0);
|
|
447
|
+
__decorate([
|
|
448
|
+
(0, mongoose_1.Prop)({ type: exports.LeadContentGuidelinesSchema, default: {} }),
|
|
449
|
+
__metadata("design:type", LeadContentGuidelines)
|
|
450
|
+
], Lead.prototype, "contentGuidelines", void 0);
|
|
451
|
+
Lead = __decorate([
|
|
452
|
+
(0, mongoose_1.Schema)({ timestamps: true, collection: 'leads' })
|
|
453
|
+
], Lead);
|
|
454
|
+
exports.Lead = Lead;
|
|
455
|
+
exports.LeadSchema = mongoose_1.SchemaFactory.createForClass(Lead);
|
|
456
|
+
exports.LeadModel = (0, mongoose_2.model)('Lead', exports.LeadSchema);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/session" />
|
|
19
|
+
/// <reference types="mongoose/types/types" />
|
|
20
|
+
/// <reference types="mongoose/types/utility" />
|
|
21
|
+
/// <reference types="mongoose/types/validation" />
|
|
22
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
23
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
+
import { HydratedDocument, Schema as MongooseSchema, Types } from 'mongoose';
|
|
27
|
+
import { Profile } from './profile.schema';
|
|
28
|
+
export type ProfileFollowersSnapshotDocument = HydratedDocument<ProfileFollowersSnapshot>;
|
|
29
|
+
/**
|
|
30
|
+
* Histórico diário de seguidores por perfil, gravado pelo profile-sync-worker
|
|
31
|
+
* a partir do `audience_size` que a Primetag devolve na captura. Um doc por
|
|
32
|
+
* perfil por dia (`date` truncado em UTC): o trigger roda várias vezes ao dia
|
|
33
|
+
* e cada rodada só sobrescreve o valor do dia.
|
|
34
|
+
*/
|
|
35
|
+
export declare class ProfileFollowersSnapshot {
|
|
36
|
+
_id?: Types.ObjectId;
|
|
37
|
+
profile: Types.ObjectId | Profile;
|
|
38
|
+
socialnetwork?: string;
|
|
39
|
+
followers: number;
|
|
40
|
+
date: Date;
|
|
41
|
+
capturedAt: Date;
|
|
42
|
+
source: 'primetag';
|
|
43
|
+
createdAt?: Date;
|
|
44
|
+
updatedAt?: Date;
|
|
45
|
+
}
|
|
46
|
+
export declare const ProfileFollowersSnapshotSchema: MongooseSchema<ProfileFollowersSnapshot, import("mongoose").Model<ProfileFollowersSnapshot, any, any, any, import("mongoose").Document<unknown, any, ProfileFollowersSnapshot, any, {}> & ProfileFollowersSnapshot & Required<{
|
|
47
|
+
_id: Types.ObjectId;
|
|
48
|
+
}> & {
|
|
49
|
+
__v: number;
|
|
50
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProfileFollowersSnapshot, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProfileFollowersSnapshot>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ProfileFollowersSnapshot> & Required<{
|
|
51
|
+
_id: Types.ObjectId;
|
|
52
|
+
}> & {
|
|
53
|
+
__v: number;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const ProfileFollowersSnapshotModel: import("mongoose").Model<ProfileFollowersSnapshot, {}, {}, {}, import("mongoose").Document<unknown, {}, ProfileFollowersSnapshot, {}, import("mongoose").DefaultSchemaOptions> & ProfileFollowersSnapshot & Required<{
|
|
56
|
+
_id: Types.ObjectId;
|
|
57
|
+
}> & {
|
|
58
|
+
__v: number;
|
|
59
|
+
}, MongooseSchema<ProfileFollowersSnapshot, import("mongoose").Model<ProfileFollowersSnapshot, any, any, any, import("mongoose").Document<unknown, any, ProfileFollowersSnapshot, any, {}> & ProfileFollowersSnapshot & Required<{
|
|
60
|
+
_id: Types.ObjectId;
|
|
61
|
+
}> & {
|
|
62
|
+
__v: number;
|
|
63
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProfileFollowersSnapshot, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProfileFollowersSnapshot>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ProfileFollowersSnapshot> & Required<{
|
|
64
|
+
_id: Types.ObjectId;
|
|
65
|
+
}> & {
|
|
66
|
+
__v: number;
|
|
67
|
+
}>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProfileFollowersSnapshotModel = exports.ProfileFollowersSnapshotSchema = exports.ProfileFollowersSnapshot = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
/**
|
|
16
|
+
* Histórico diário de seguidores por perfil, gravado pelo profile-sync-worker
|
|
17
|
+
* a partir do `audience_size` que a Primetag devolve na captura. Um doc por
|
|
18
|
+
* perfil por dia (`date` truncado em UTC): o trigger roda várias vezes ao dia
|
|
19
|
+
* e cada rodada só sobrescreve o valor do dia.
|
|
20
|
+
*/
|
|
21
|
+
let ProfileFollowersSnapshot = class ProfileFollowersSnapshot {
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true, required: false }),
|
|
25
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
26
|
+
], ProfileFollowersSnapshot.prototype, "_id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: 'Profile', required: true }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], ProfileFollowersSnapshot.prototype, "profile", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], ProfileFollowersSnapshot.prototype, "socialnetwork", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, mongoose_1.Prop)({ type: Number, required: true }),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], ProfileFollowersSnapshot.prototype, "followers", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
41
|
+
__metadata("design:type", Date)
|
|
42
|
+
], ProfileFollowersSnapshot.prototype, "date", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
45
|
+
__metadata("design:type", Date)
|
|
46
|
+
], ProfileFollowersSnapshot.prototype, "capturedAt", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, mongoose_1.Prop)({ type: String, enum: ['primetag'], required: true, default: 'primetag' }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ProfileFollowersSnapshot.prototype, "source", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], ProfileFollowersSnapshot.prototype, "createdAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, mongoose_1.Prop)({ default: Date.now, required: false }),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], ProfileFollowersSnapshot.prototype, "updatedAt", void 0);
|
|
59
|
+
ProfileFollowersSnapshot = __decorate([
|
|
60
|
+
(0, mongoose_1.Schema)({ collection: 'profile-followers-snapshots', timestamps: true })
|
|
61
|
+
], ProfileFollowersSnapshot);
|
|
62
|
+
exports.ProfileFollowersSnapshot = ProfileFollowersSnapshot;
|
|
63
|
+
exports.ProfileFollowersSnapshotSchema = mongoose_1.SchemaFactory.createForClass(ProfileFollowersSnapshot);
|
|
64
|
+
exports.ProfileFollowersSnapshotSchema.index({ profile: 1, date: 1 }, { unique: true });
|
|
65
|
+
exports.ProfileFollowersSnapshotModel = (0, mongoose_2.model)('ProfileFollowersSnapshot', exports.ProfileFollowersSnapshotSchema);
|
|
@@ -30,7 +30,10 @@ export declare class Profile {
|
|
|
30
30
|
_id?: Types.ObjectId;
|
|
31
31
|
username: string;
|
|
32
32
|
followers: number;
|
|
33
|
+
followersUpdatedAt?: Date;
|
|
33
34
|
picture: string;
|
|
35
|
+
pictureUpdatedAt?: Date;
|
|
36
|
+
primetagSocialProfileId?: number;
|
|
34
37
|
socialnetwork: string;
|
|
35
38
|
type: string;
|
|
36
39
|
influencer: Types.ObjectId | Influencer;
|
|
@@ -26,10 +26,22 @@ __decorate([
|
|
|
26
26
|
(0, mongoose_1.Prop)(),
|
|
27
27
|
__metadata("design:type", Number)
|
|
28
28
|
], Profile.prototype, "followers", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: Date, required: false }),
|
|
31
|
+
__metadata("design:type", Date)
|
|
32
|
+
], Profile.prototype, "followersUpdatedAt", void 0);
|
|
29
33
|
__decorate([
|
|
30
34
|
(0, mongoose_1.Prop)(),
|
|
31
35
|
__metadata("design:type", String)
|
|
32
36
|
], Profile.prototype, "picture", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: Date, required: false }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], Profile.prototype, "pictureUpdatedAt", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: Number, required: false }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], Profile.prototype, "primetagSocialProfileId", void 0);
|
|
33
45
|
__decorate([
|
|
34
46
|
(0, mongoose_1.Prop)(),
|
|
35
47
|
__metadata("design:type", String)
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -31,3 +31,5 @@ export { Note, NoteSchema, NoteMention, NoteMentionSchema } from './schemas/note
|
|
|
31
31
|
export * from './schemas/content-capture-process.schema';
|
|
32
32
|
export * from './schemas/content-draft.schema';
|
|
33
33
|
export * from './schemas/export-comments-job.schema';
|
|
34
|
+
export * from './schemas/profile-followers-snapshot.schema';
|
|
35
|
+
export * from './schemas/lead.schema';
|