-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_definitions.js
471 lines (457 loc) · 13.6 KB
/
_definitions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
'use strict';
module.exports = function(ob, faker, mongoose, jwt){
module.token = {
description: 'Authentication token for a user',
example: () => jwt.sign({ foo: faker.lorem.words() }, "" + faker.lorem.words())
};
module.user = {
'user_id': {
description: 'The user id',
example: () => mongoose.Types.ObjectId()
},
'name': {
description: 'The user name',
example: () => faker.name.firstName() + ' ' + faker.name.lastName()
},
'email':{
description: 'The user email address',
example: () => faker.internet.email()
},
'username': {
description: 'The username',
example: () => faker.internet.userName()
},
'password': {
description: 'The password',
example: () => faker.lorem.sentence()
},
'last_login': {
description: 'Last login timestamp',
example: () => faker.date.future()
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.world = {
'world_id': {
description: 'The world id',
example: () => mongoose.Types.ObjectId()
},
'title': {
description: 'The title for the world',
example: () => faker.lorem.sentence()
},
'color': {
description: 'A color hex code for the world',
example: () => faker.internet.color()
},
'owner_id': {
description: 'The id of the user who owns the world',
example: () => mongoose.Types.ObjectId()
},
'writers': {
description: 'All the users who have write access to the world',
example: [
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
]
},
'readers': {
description: 'All the users who have read-only access to the world',
example: [
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
ob.pick(module.user, ['user_id', 'username', 'name', 'email']),
]
},
'is_global': {
description: 'Whether or not the world is global',
example: () => faker.random.arrayElement([true, false])
},
'is_archived': {
description: 'Whether or not the world is archived',
example: () => faker.random.arrayElement([true, false])
},
'sort_order' : {
description: 'Sort order for the world',
example: () => faker.random.number(9)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.attribute = {
'attribute_id': {
description: 'The attribute id',
example: () => mongoose.Types.ObjectId()
},
'key': {
description: 'The key for the attribute pair',
example: () => faker.lorem.sentence(1, 0)
},
'value': {
description: 'The value for the attribute pair',
example: () => faker.lorem.sentence(3, 2)
}
};
module.gene = {
'gene_id': {
description: 'The gene id',
example: () => mongoose.Types.ObjectId()
},
'question': {
description: 'The question',
example: () => faker.lorem.sentence()
},
'answer': {
description: 'The answer',
example: () => faker.lorem.sentence()
}
};
module.relationship = {
'relationship_id': {
description: 'The relationship id',
example: () => mongoose.Types.ObjectId()
},
'character_ids': {
description: 'An array containing a pair of character ids',
example: [
() => mongoose.Types.ObjectId(),
() => mongoose.Types.ObjectId()
]
},
'content': {
description: 'Content describing the relationship',
example: () => faker.lorem.paragraph(),
},
};
module.gallery = {
'gallery_id': {
description: 'The gallery id',
example: () => mongoose.Types.ObjectId()
},
'images': {
description: 'An array containing gallery images',
example: [
faker.image.imageUrl(),
faker.image.imageUrl(),
faker.image.imageUrl(),
]
},
};
module.element = {
'element_id': {
description: 'The element id',
example: () => mongoose.Types.ObjectId()
},
'elements_board_id': {
description: 'The id of the elements board to which the element belongs',
example: () => mongoose.Types.ObjectId()
},
'world_id': {
description: 'The world id',
example: () => mongoose.Types.ObjectId()
},
'title': {
description: 'The title for the element',
example: () => faker.lorem.sentence()
},
'color': {
description: 'A color hex code for the element',
example: () => faker.internet.color()
},
'content': {
description: 'Content for the element',
example: () => faker.lorem.paragraph(),
},
'attachments': {
description: 'An array of media attached to the element',
example: ['TODO', 'TODO', 'TODO']
},
'sort_order' : {
description: 'Sort order for the element',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.elements_board = {
'elements_board_id': {
description: 'The elements board id',
example: () => mongoose.Types.ObjectId()
},
'world_id': {
description: 'The the id of the world to which the elements board belongs',
example: () => mongoose.Types.ObjectId()
},
'title': {
description: 'The title for the elements board',
example: () => faker.lorem.sentence()
},
'elements': {
description: 'An array of element cards belonging to the elements board',
example: [
ob.omit(module.element, ['elements_board_id']),
ob.omit(module.element, ['elements_board_id']),
ob.omit(module.element, ['elements_board_id']),
],
},
'is_archived': {
description: 'Whether or not the elements board has been archived',
example: () => faker.random.arrayElement([true, false])
},
'sort_order' : {
description: 'Sort order for the elements board',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.beats_board = {
'beats_board_id': {
description: 'The beats board id',
example: () => mongoose.Types.ObjectId()
},
'world_id': {
description: 'The the id of the world to which the beats board belongs',
example: () => mongoose.Types.ObjectId()
},
'title': {
description: 'The title for the beats board',
example: () => faker.lorem.sentence()
},
'beats': {
description: 'An array of dividers and cards belonging to the beats board',
example: 'TODO'
},
'is_archived': {
description: 'Whether or not the beats board has been archived',
example: () => faker.random.arrayElement([true, false])
},
'sort_order' : {
description: 'Sort order for the beats board',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.dividerCharacter = {
'character_id': {
description: 'The character id',
example: () => mongoose.Types.ObjectId(),
},
'primary_name': {
description: 'The primary name for the character',
example: () => faker.name.firstName() + ' ' + faker.name.lastName()
},
'avatar': {
description: 'The url for the character avatar image',
example: () => faker.image.imageUrl()
},
}
module.divider = {
'divider_id': {
description: 'The divider id',
example: () => mongoose.Types.ObjectId()
},
'parent_type': {
description: 'The type of parent the divider belongs to',
example: () => faker.random.arrayElement(["beats_board", "bio"])
},
'parent_id': {
description: 'The id of the divider parent',
example: () => mongoose.Types.ObjectId()
},
'title': {
description: 'The title for the divider',
example: () => faker.lorem.sentence()
},
'characters': {
description: 'An array of characters associated with the divider',
example: [
ob.clone(module.dividerCharacter),
ob.clone(module.dividerCharacter),
ob.clone(module.dividerCharacter),
],
},
'elements': {
description: 'An array of elements associated with the divider',
example: [
ob.pick(module.element, ['element_id', 'title']),
ob.pick(module.element, ['element_id', 'title']),
ob.pick(module.element, ['element_id', 'title']),
]
},
'sort_order' : {
description: 'Sort order for the divider',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.card = {
'card_id': {
description: 'The card id',
example: () => mongoose.Types.ObjectId()
},
'parent_type': {
description: 'The type of parent the card belongs to',
example: () => faker.random.arrayElement(["beats_board", "bio"])
},
'parent_id': {
description: 'The id of the card parent',
example: () => mongoose.Types.ObjectId()
},
'content': {
description: 'Content for the card',
example: faker.lorem.paragraph()
},
'sort_order' : {
description: 'Sort order for the card',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
module.character = {
'character_id': {
description: 'The character id',
example: () => mongoose.Types.ObjectId()
},
'world_id': {
description: 'The the id of the world to which the character belongs',
example: () => mongoose.Types.ObjectId()
},
'primary_name': {
description: 'The primary name for the character',
example: () => faker.name.firstName() + ' ' + faker.name.lastName()
},
'aliases' : {
description: 'An array of aliases for the character',
example: [
faker.name.firstName() + ' ' + faker.name.lastName(),
faker.name.firstName() + ' ' + faker.name.lastName(),
faker.name.firstName() + ' ' + faker.name.lastName(),
]
},
'avatar': {
description: 'The url for the character avatar image',
example: () => faker.image.imageUrl()
},
'cover_image': {
description: 'The url for the character profile cover image',
example: () => faker.image.imageUrl()
},
'bio': {
description: 'An array of dividers and cards containing the character bio<br><strong><small>NOTE:</small></strong> Swag Doctor seems to be choking showing properties for both dividers <em>and</em> cards',
example: [
ob.clone(module.divider),
ob.clone(module.card),
ob.clone(module.divider),
ob.clone(module.card),
ob.clone(module.card),
ob.clone(module.divider),
ob.clone(module.card),
]
},
'attributes': {
description: 'An array of key / value pairs for character attributes',
example: [
ob.clone(module.attribute),
ob.clone(module.attribute),
ob.clone(module.attribute),
ob.clone(module.attribute),
ob.clone(module.attribute),
],
},
'dna': {
description: 'An array of question / answer pairs (genes) for character DNA',
example: [
ob.clone(module.gene),
ob.clone(module.gene),
ob.clone(module.gene),
ob.clone(module.gene),
ob.clone(module.gene),
],
},
'relationships': {
description: 'An array of character relationships',
example: [
ob.clone(module.relationship),
ob.clone(module.relationship),
ob.clone(module.relationship),
ob.clone(module.relationship),
ob.clone(module.relationship),
],
},
'galleries': {
description: 'An array of image galleries associated with the character',
example: [
ob.clone(module.gallery),
ob.clone(module.gallery),
ob.clone(module.gallery),
ob.clone(module.gallery),
ob.clone(module.gallery),
],
},
'is_archived': {
description: 'Whether or not the character has been archived',
example: () => faker.random.arrayElement([true, false])
},
'sort_order' : {
description: 'Sort order for the character',
example: () => faker.random.number(99)
},
'date_created': {
description: 'Date created',
example: () => faker.date.future()
},
'date_modified': {
description: 'Date modified',
example: () => faker.date.future()
},
};
return module;
};