adminmate-express-mongoose 1.2.3 → 1.2.7

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.
@@ -1,656 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Cars request - No parameter 1`] = `
4
- Object {
5
- "count": 20,
6
- "data": Array [
7
- Object {
8
- "_id": "5cd5308e695db945d3cc81d2",
9
- "createdAt": "2021-04-02T00:00:00.000Z",
10
- "manufacturer": "Ferrari",
11
- "name": "Ferrari 250 LM",
12
- "updatedAt": "2021-04-02T00:00:00.000Z",
13
- "user_id": Object {
14
- "id": "5cd5308e695db945d3cc81a2",
15
- "label": "5cd5308e695db945d3cc81a2",
16
- "type": "ref",
17
- },
18
- "year": 1964,
19
- },
20
- Object {
21
- "_id": "5cd5308e695db945d3cc81d1",
22
- "createdAt": "2021-04-02T00:00:00.000Z",
23
- "manufacturer": "Ferrari",
24
- "name": "Ferrari 275",
25
- "updatedAt": "2021-04-02T00:00:00.000Z",
26
- "user_id": Object {
27
- "id": "5cd5308e695db945d3cc81a2",
28
- "label": "5cd5308e695db945d3cc81a2",
29
- "type": "ref",
30
- },
31
- "year": 1964,
32
- },
33
- Object {
34
- "_id": "5cd5308e695db945d3cc81c9",
35
- "createdAt": "2021-04-02T00:00:00.000Z",
36
- "manufacturer": "Ferrari",
37
- "name": "Ferrari 488",
38
- "updatedAt": "2021-04-02T00:00:00.000Z",
39
- "user_id": Object {
40
- "id": "5cd5308e695db945d3cc81a2",
41
- "label": "5cd5308e695db945d3cc81a2",
42
- "type": "ref",
43
- },
44
- "year": 1969,
45
- },
46
- Object {
47
- "_id": "5cd5308e695db945d3cc81c8",
48
- "createdAt": "2021-04-02T00:00:00.000Z",
49
- "manufacturer": "Ferrari",
50
- "name": "Ferrari 250 GT Lusso",
51
- "updatedAt": "2021-04-02T00:00:00.000Z",
52
- "user_id": Object {
53
- "id": "5cd5308e695db945d3cc81a1",
54
- "label": "5cd5308e695db945d3cc81a1",
55
- "type": "ref",
56
- },
57
- "year": 1962,
58
- },
59
- Object {
60
- "_id": "5cd5308e695db945d3cc81c7",
61
- "createdAt": "2021-04-02T00:00:00.000Z",
62
- "manufacturer": "Ferrari",
63
- "name": "Ferrari 250 GTO",
64
- "updatedAt": "2021-04-02T00:00:00.000Z",
65
- "user_id": Object {
66
- "id": "5cd5308e695db945d3cc81a2",
67
- "label": "5cd5308e695db945d3cc81a2",
68
- "type": "ref",
69
- },
70
- "year": 1962,
71
- },
72
- Object {
73
- "_id": "5cd5308e695db945d3cc81c6",
74
- "createdAt": "2021-04-02T00:00:00.000Z",
75
- "manufacturer": "Ferrari",
76
- "name": "Ferrari 250 GT 2+2",
77
- "updatedAt": "2021-04-02T00:00:00.000Z",
78
- "user_id": Object {
79
- "id": "5cd5308e695db945d3cc81a1",
80
- "label": "5cd5308e695db945d3cc81a1",
81
- "type": "ref",
82
- },
83
- "year": 1960,
84
- },
85
- Object {
86
- "_id": "5cd5308e695db945d3cc81c5",
87
- "createdAt": "2021-04-02T00:00:00.000Z",
88
- "manufacturer": "Ferrari",
89
- "name": "Ferrari 250 GT Berlinetta SWB",
90
- "updatedAt": "2021-04-02T00:00:00.000Z",
91
- "user_id": Object {
92
- "id": "5cd5308e695db945d3cc81a2",
93
- "label": "5cd5308e695db945d3cc81a2",
94
- "type": "ref",
95
- },
96
- "year": 1959,
97
- },
98
- Object {
99
- "_id": "5cd5308e695db945d3cc81c4",
100
- "createdAt": "2021-04-02T00:00:00.000Z",
101
- "manufacturer": "Ferrari",
102
- "name": "Ferrari 250 GT Coupé",
103
- "updatedAt": "2021-04-02T00:00:00.000Z",
104
- "user_id": Object {
105
- "id": "5cd5308e695db945d3cc81a1",
106
- "label": "5cd5308e695db945d3cc81a1",
107
- "type": "ref",
108
- },
109
- "year": 1954,
110
- },
111
- Object {
112
- "_id": "5cd5308e695db945d3cc81c3",
113
- "createdAt": "2021-04-02T00:00:00.000Z",
114
- "manufacturer": "Ferrari",
115
- "name": "Ferrari 250 MM",
116
- "updatedAt": "2021-04-02T00:00:00.000Z",
117
- "user_id": Object {
118
- "id": "5cd5308e695db945d3cc81a2",
119
- "label": "5cd5308e695db945d3cc81a2",
120
- "type": "ref",
121
- },
122
- "year": 1952,
123
- },
124
- Object {
125
- "_id": "5cd5308e695db945d3cc81c2",
126
- "createdAt": "2021-04-02T00:00:00.000Z",
127
- "manufacturer": "Ferrari",
128
- "name": "Ferrari 212 Inter",
129
- "updatedAt": "2021-04-02T00:00:00.000Z",
130
- "user_id": Object {
131
- "id": "5cd5308e695db945d3cc81a1",
132
- "label": "5cd5308e695db945d3cc81a1",
133
- "type": "ref",
134
- },
135
- "year": 1951,
136
- },
137
- ],
138
- "pagination": Object {
139
- "count": 2,
140
- "current": 1,
141
- },
142
- }
143
- `;
144
-
145
- exports[`Cars request - With "fields" parameter (name & manufacturer only) 1`] = `
146
- Object {
147
- "count": 20,
148
- "data": Array [
149
- Object {
150
- "_id": "5cd5308e695db945d3cc81d2",
151
- "manufacturer": "Ferrari",
152
- "name": "Ferrari 250 LM",
153
- },
154
- Object {
155
- "_id": "5cd5308e695db945d3cc81d1",
156
- "manufacturer": "Ferrari",
157
- "name": "Ferrari 275",
158
- },
159
- Object {
160
- "_id": "5cd5308e695db945d3cc81c9",
161
- "manufacturer": "Ferrari",
162
- "name": "Ferrari 488",
163
- },
164
- Object {
165
- "_id": "5cd5308e695db945d3cc81c8",
166
- "manufacturer": "Ferrari",
167
- "name": "Ferrari 250 GT Lusso",
168
- },
169
- Object {
170
- "_id": "5cd5308e695db945d3cc81c7",
171
- "manufacturer": "Ferrari",
172
- "name": "Ferrari 250 GTO",
173
- },
174
- Object {
175
- "_id": "5cd5308e695db945d3cc81c6",
176
- "manufacturer": "Ferrari",
177
- "name": "Ferrari 250 GT 2+2",
178
- },
179
- Object {
180
- "_id": "5cd5308e695db945d3cc81c5",
181
- "manufacturer": "Ferrari",
182
- "name": "Ferrari 250 GT Berlinetta SWB",
183
- },
184
- Object {
185
- "_id": "5cd5308e695db945d3cc81c4",
186
- "manufacturer": "Ferrari",
187
- "name": "Ferrari 250 GT Coupé",
188
- },
189
- Object {
190
- "_id": "5cd5308e695db945d3cc81c3",
191
- "manufacturer": "Ferrari",
192
- "name": "Ferrari 250 MM",
193
- },
194
- Object {
195
- "_id": "5cd5308e695db945d3cc81c2",
196
- "manufacturer": "Ferrari",
197
- "name": "Ferrari 212 Inter",
198
- },
199
- ],
200
- "pagination": Object {
201
- "count": 2,
202
- "current": 1,
203
- },
204
- }
205
- `;
206
-
207
- exports[`Cars request - With "page" parameter set to 2 1`] = `
208
- Object {
209
- "count": 20,
210
- "data": Array [
211
- Object {
212
- "_id": "5cd5308e695db945d3cc81c1",
213
- "createdAt": "2021-04-02T00:00:00.000Z",
214
- "manufacturer": "Porsche",
215
- "name": "Porsche Macan",
216
- "updatedAt": "2021-04-02T00:00:00.000Z",
217
- "user_id": Object {
218
- "id": "5cd5308e695db945d3cc81a2",
219
- "label": "5cd5308e695db945d3cc81a2",
220
- "type": "ref",
221
- },
222
- "year": 2014,
223
- },
224
- Object {
225
- "_id": "5cd5308e695db945d3cc81b9",
226
- "createdAt": "2021-04-02T00:00:00.000Z",
227
- "manufacturer": "Porsche",
228
- "name": "Porsche 924",
229
- "updatedAt": "2021-04-02T00:00:00.000Z",
230
- "user_id": Object {
231
- "id": "5cd5308e695db945d3cc81a2",
232
- "label": "5cd5308e695db945d3cc81a2",
233
- "type": "ref",
234
- },
235
- "year": 1976,
236
- },
237
- Object {
238
- "_id": "5cd5308e695db945d3cc81b8",
239
- "createdAt": "2021-04-02T00:00:00.000Z",
240
- "manufacturer": "Porsche",
241
- "name": "Porsche 917",
242
- "updatedAt": "2021-04-02T00:00:00.000Z",
243
- "user_id": Object {
244
- "id": "5cd5308e695db945d3cc81a2",
245
- "label": "5cd5308e695db945d3cc81a2",
246
- "type": "ref",
247
- },
248
- "year": 1969,
249
- },
250
- Object {
251
- "_id": "5cd5308e695db945d3cc81b7",
252
- "createdAt": "2021-04-02T00:00:00.000Z",
253
- "manufacturer": "Porsche",
254
- "name": "Porsche 914",
255
- "updatedAt": "2021-04-02T00:00:00.000Z",
256
- "user_id": Object {
257
- "id": "5cd5308e695db945d3cc81a1",
258
- "label": "5cd5308e695db945d3cc81a1",
259
- "type": "ref",
260
- },
261
- "year": 1969,
262
- },
263
- Object {
264
- "_id": "5cd5308e695db945d3cc81b6",
265
- "createdAt": "2021-04-02T00:00:00.000Z",
266
- "manufacturer": "Porsche",
267
- "name": "Porsche 908",
268
- "updatedAt": "2021-04-02T00:00:00.000Z",
269
- "user_id": Object {
270
- "id": "5cd5308e695db945d3cc81a2",
271
- "label": "5cd5308e695db945d3cc81a2",
272
- "type": "ref",
273
- },
274
- "year": 1968,
275
- },
276
- Object {
277
- "_id": "5cd5308e695db945d3cc81b5",
278
- "createdAt": "2021-04-02T00:00:00.000Z",
279
- "manufacturer": "Porsche",
280
- "name": "Porsche 906",
281
- "updatedAt": "2021-04-02T00:00:00.000Z",
282
- "user_id": Object {
283
- "id": "5cd5308e695db945d3cc81a1",
284
- "label": "5cd5308e695db945d3cc81a1",
285
- "type": "ref",
286
- },
287
- "year": 1966,
288
- },
289
- Object {
290
- "_id": "5cd5308e695db945d3cc81b4",
291
- "createdAt": "2021-04-02T00:00:00.000Z",
292
- "manufacturer": "Porsche",
293
- "name": "Porsche 904",
294
- "updatedAt": "2021-04-02T00:00:00.000Z",
295
- "user_id": Object {
296
- "id": "5cd5308e695db945d3cc81a2",
297
- "label": "5cd5308e695db945d3cc81a2",
298
- "type": "ref",
299
- },
300
- "year": 1964,
301
- },
302
- Object {
303
- "_id": "5cd5308e695db945d3cc81b3",
304
- "createdAt": "2021-04-02T00:00:00.000Z",
305
- "manufacturer": "Porsche",
306
- "name": "Porsche 911",
307
- "updatedAt": "2021-04-02T00:00:00.000Z",
308
- "user_id": Object {
309
- "id": "5cd5308e695db945d3cc81a1",
310
- "label": "5cd5308e695db945d3cc81a1",
311
- "type": "ref",
312
- },
313
- "year": 1963,
314
- },
315
- Object {
316
- "_id": "5cd5308e695db945d3cc81b2",
317
- "createdAt": "2021-04-02T00:00:00.000Z",
318
- "manufacturer": "Porsche",
319
- "name": "Porsche 550",
320
- "updatedAt": "2021-04-02T00:00:00.000Z",
321
- "user_id": Object {
322
- "id": "5cd5308e695db945d3cc81a2",
323
- "label": "5cd5308e695db945d3cc81a2",
324
- "type": "ref",
325
- },
326
- "year": 1953,
327
- },
328
- Object {
329
- "_id": "5cd5308e695db945d3cc81b1",
330
- "createdAt": "2021-04-02T00:00:00.000Z",
331
- "manufacturer": "Porsche",
332
- "name": "Porsche 356",
333
- "updatedAt": "2021-04-02T00:00:00.000Z",
334
- "user_id": Object {
335
- "id": "5cd5308e695db945d3cc81a1",
336
- "label": "5cd5308e695db945d3cc81a1",
337
- "type": "ref",
338
- },
339
- "year": 1948,
340
- },
341
- ],
342
- "pagination": Object {
343
- "count": 2,
344
- "current": 2,
345
- },
346
- }
347
- `;
348
-
349
- exports[`Cars request - With a "filters" parameter 1`] = `
350
- Object {
351
- "count": 3,
352
- "data": Array [
353
- Object {
354
- "_id": "5cd5308e695db945d3cc81b8",
355
- "name": "Porsche 917",
356
- "year": 1969,
357
- },
358
- Object {
359
- "_id": "5cd5308e695db945d3cc81b7",
360
- "name": "Porsche 914",
361
- "year": 1969,
362
- },
363
- Object {
364
- "_id": "5cd5308e695db945d3cc81b6",
365
- "name": "Porsche 908",
366
- "year": 1968,
367
- },
368
- ],
369
- "pagination": Object {
370
- "count": 1,
371
- "current": 1,
372
- },
373
- }
374
- `;
375
-
376
- exports[`Cars request - With a "order" parameter 1`] = `
377
- Object {
378
- "count": 3,
379
- "data": Array [
380
- Object {
381
- "_id": "5cd5308e695db945d3cc81b3",
382
- "name": "Porsche 911",
383
- },
384
- Object {
385
- "_id": "5cd5308e695db945d3cc81b7",
386
- "name": "Porsche 914",
387
- },
388
- Object {
389
- "_id": "5cd5308e695db945d3cc81b8",
390
- "name": "Porsche 917",
391
- },
392
- ],
393
- "pagination": Object {
394
- "count": 1,
395
- "current": 1,
396
- },
397
- }
398
- `;
399
-
400
- exports[`Cars request - With a "search" parameter 1`] = `
401
- Object {
402
- "count": 3,
403
- "data": Array [
404
- Object {
405
- "_id": "5cd5308e695db945d3cc81b8",
406
- "name": "Porsche 917",
407
- },
408
- Object {
409
- "_id": "5cd5308e695db945d3cc81b7",
410
- "name": "Porsche 914",
411
- },
412
- Object {
413
- "_id": "5cd5308e695db945d3cc81b3",
414
- "name": "Porsche 911",
415
- },
416
- ],
417
- "pagination": Object {
418
- "count": 1,
419
- "current": 1,
420
- },
421
- }
422
- `;
423
-
424
- exports[`Cars request - With a "segment" parameter 1`] = `
425
- Object {
426
- "count": 10,
427
- "data": Array [
428
- Object {
429
- "_id": "5cd5308e695db945d3cc81d2",
430
- "name": "Ferrari 250 LM",
431
- "year": 1964,
432
- },
433
- Object {
434
- "_id": "5cd5308e695db945d3cc81d1",
435
- "name": "Ferrari 275",
436
- "year": 1964,
437
- },
438
- Object {
439
- "_id": "5cd5308e695db945d3cc81c9",
440
- "name": "Ferrari 488",
441
- "year": 1969,
442
- },
443
- Object {
444
- "_id": "5cd5308e695db945d3cc81c8",
445
- "name": "Ferrari 250 GT Lusso",
446
- "year": 1962,
447
- },
448
- Object {
449
- "_id": "5cd5308e695db945d3cc81c7",
450
- "name": "Ferrari 250 GTO",
451
- "year": 1962,
452
- },
453
- Object {
454
- "_id": "5cd5308e695db945d3cc81c6",
455
- "name": "Ferrari 250 GT 2+2",
456
- "year": 1960,
457
- },
458
- Object {
459
- "_id": "5cd5308e695db945d3cc81c5",
460
- "name": "Ferrari 250 GT Berlinetta SWB",
461
- "year": 1959,
462
- },
463
- Object {
464
- "_id": "5cd5308e695db945d3cc81c4",
465
- "name": "Ferrari 250 GT Coupé",
466
- "year": 1954,
467
- },
468
- Object {
469
- "_id": "5cd5308e695db945d3cc81c3",
470
- "name": "Ferrari 250 MM",
471
- "year": 1952,
472
- },
473
- Object {
474
- "_id": "5cd5308e695db945d3cc81c2",
475
- "name": "Ferrari 212 Inter",
476
- "year": 1951,
477
- },
478
- ],
479
- "pagination": Object {
480
- "count": 1,
481
- "current": 1,
482
- },
483
- }
484
- `;
485
-
486
- exports[`Cars request - With refFields params 1`] = `
487
- Object {
488
- "count": 20,
489
- "data": Array [
490
- Object {
491
- "_id": "5cd5308e695db945d3cc81d2",
492
- "createdAt": "2021-04-02T00:00:00.000Z",
493
- "manufacturer": "Ferrari",
494
- "name": "Ferrari 250 LM",
495
- "updatedAt": "2021-04-02T00:00:00.000Z",
496
- "user_id": Object {
497
- "id": "5cd5308e695db945d3cc81a2",
498
- "label": "Maria Doe",
499
- "type": "ref",
500
- },
501
- "year": 1964,
502
- },
503
- Object {
504
- "_id": "5cd5308e695db945d3cc81d1",
505
- "createdAt": "2021-04-02T00:00:00.000Z",
506
- "manufacturer": "Ferrari",
507
- "name": "Ferrari 275",
508
- "updatedAt": "2021-04-02T00:00:00.000Z",
509
- "user_id": Object {
510
- "id": "5cd5308e695db945d3cc81a2",
511
- "label": "Maria Doe",
512
- "type": "ref",
513
- },
514
- "year": 1964,
515
- },
516
- Object {
517
- "_id": "5cd5308e695db945d3cc81c9",
518
- "createdAt": "2021-04-02T00:00:00.000Z",
519
- "manufacturer": "Ferrari",
520
- "name": "Ferrari 488",
521
- "updatedAt": "2021-04-02T00:00:00.000Z",
522
- "user_id": Object {
523
- "id": "5cd5308e695db945d3cc81a2",
524
- "label": "Maria Doe",
525
- "type": "ref",
526
- },
527
- "year": 1969,
528
- },
529
- Object {
530
- "_id": "5cd5308e695db945d3cc81c8",
531
- "createdAt": "2021-04-02T00:00:00.000Z",
532
- "manufacturer": "Ferrari",
533
- "name": "Ferrari 250 GT Lusso",
534
- "updatedAt": "2021-04-02T00:00:00.000Z",
535
- "user_id": Object {
536
- "id": "5cd5308e695db945d3cc81a1",
537
- "label": "John Doe",
538
- "type": "ref",
539
- },
540
- "year": 1962,
541
- },
542
- Object {
543
- "_id": "5cd5308e695db945d3cc81c7",
544
- "createdAt": "2021-04-02T00:00:00.000Z",
545
- "manufacturer": "Ferrari",
546
- "name": "Ferrari 250 GTO",
547
- "updatedAt": "2021-04-02T00:00:00.000Z",
548
- "user_id": Object {
549
- "id": "5cd5308e695db945d3cc81a2",
550
- "label": "Maria Doe",
551
- "type": "ref",
552
- },
553
- "year": 1962,
554
- },
555
- Object {
556
- "_id": "5cd5308e695db945d3cc81c6",
557
- "createdAt": "2021-04-02T00:00:00.000Z",
558
- "manufacturer": "Ferrari",
559
- "name": "Ferrari 250 GT 2+2",
560
- "updatedAt": "2021-04-02T00:00:00.000Z",
561
- "user_id": Object {
562
- "id": "5cd5308e695db945d3cc81a1",
563
- "label": "John Doe",
564
- "type": "ref",
565
- },
566
- "year": 1960,
567
- },
568
- Object {
569
- "_id": "5cd5308e695db945d3cc81c5",
570
- "createdAt": "2021-04-02T00:00:00.000Z",
571
- "manufacturer": "Ferrari",
572
- "name": "Ferrari 250 GT Berlinetta SWB",
573
- "updatedAt": "2021-04-02T00:00:00.000Z",
574
- "user_id": Object {
575
- "id": "5cd5308e695db945d3cc81a2",
576
- "label": "Maria Doe",
577
- "type": "ref",
578
- },
579
- "year": 1959,
580
- },
581
- Object {
582
- "_id": "5cd5308e695db945d3cc81c4",
583
- "createdAt": "2021-04-02T00:00:00.000Z",
584
- "manufacturer": "Ferrari",
585
- "name": "Ferrari 250 GT Coupé",
586
- "updatedAt": "2021-04-02T00:00:00.000Z",
587
- "user_id": Object {
588
- "id": "5cd5308e695db945d3cc81a1",
589
- "label": "John Doe",
590
- "type": "ref",
591
- },
592
- "year": 1954,
593
- },
594
- Object {
595
- "_id": "5cd5308e695db945d3cc81c3",
596
- "createdAt": "2021-04-02T00:00:00.000Z",
597
- "manufacturer": "Ferrari",
598
- "name": "Ferrari 250 MM",
599
- "updatedAt": "2021-04-02T00:00:00.000Z",
600
- "user_id": Object {
601
- "id": "5cd5308e695db945d3cc81a2",
602
- "label": "Maria Doe",
603
- "type": "ref",
604
- },
605
- "year": 1952,
606
- },
607
- Object {
608
- "_id": "5cd5308e695db945d3cc81c2",
609
- "createdAt": "2021-04-02T00:00:00.000Z",
610
- "manufacturer": "Ferrari",
611
- "name": "Ferrari 212 Inter",
612
- "updatedAt": "2021-04-02T00:00:00.000Z",
613
- "user_id": Object {
614
- "id": "5cd5308e695db945d3cc81a1",
615
- "label": "John Doe",
616
- "type": "ref",
617
- },
618
- "year": 1951,
619
- },
620
- ],
621
- "pagination": Object {
622
- "count": 2,
623
- "current": 1,
624
- },
625
- }
626
- `;
627
-
628
- exports[`Users request - No parameter 1`] = `
629
- Object {
630
- "count": 2,
631
- "data": Array [
632
- Object {
633
- "_id": "5cd5308e695db945d3cc81a2",
634
- "birthdate": "2021-04-02T00:00:00.000Z",
635
- "createdAt": "2021-04-02T00:00:00.000Z",
636
- "firstname": "Maria",
637
- "lastname": "Doe",
638
- "rating": 5,
639
- "updatedAt": "2021-04-02T00:00:00.000Z",
640
- },
641
- Object {
642
- "_id": "5cd5308e695db945d3cc81a1",
643
- "birthdate": "2021-04-02T00:00:00.000Z",
644
- "createdAt": "2021-04-02T00:00:00.000Z",
645
- "firstname": "John",
646
- "lastname": "Doe",
647
- "rating": 4,
648
- "updatedAt": "2021-04-02T00:00:00.000Z",
649
- },
650
- ],
651
- "pagination": Object {
652
- "count": 1,
653
- "current": 1,
654
- },
655
- }
656
- `;
package/test/app.js DELETED
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- // If you want to use the dev version of @adminmate-express-core
4
- global.AM_DEV_MODE = true;
5
-
6
- // Connect to database
7
- const { models, connectDb } = require('../database');
8
- connectDb().then(async () => {
9
- console.log('MongoDB connected');
10
- });
11
-
12
- // Init
13
- const amConfig = {
14
- projectId: '6037b459cbb0f63c219789eb',
15
- secretKey: '7dn6m0zrcsqta5b57hug52xlira4upqdempch65mwy5guehr33vt0r1s8cyrnmko',
16
- authKey: 'authkey_secret',
17
- masterPassword: 'demo-password',
18
- models: [
19
- {
20
- slug: 'users',
21
- model: models.User,
22
- actions: []
23
- },
24
- {
25
- slug: 'cars',
26
- model: models.Car,
27
- actions: [
28
- {
29
- label: 'Block the car',
30
- code: 'block_car',
31
- target: ['item'],
32
- filter: car => {
33
- return car.year === 1960
34
- }
35
- }
36
- ],
37
- segments: [
38
- {
39
- label: 'Ferrari',
40
- code: 'ferrari',
41
- query: {
42
- name: { $regex: 'erra', $options: 'i' }
43
- }
44
- }
45
- ]
46
- }
47
- ]
48
- };
49
-
50
- require('../index.js').init(amConfig);