Passed
Push — main ( 41db93...062dcb )
by Julia
02:58
created

server/src/utils/routesInfo.js

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 2065
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 0
eloc 1539
mnd 0
bc 0
fnc 0
dl 0
loc 2065
ccs 1
cts 1
cp 1
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1 1
const routesInfo = {
2
    admin: [
3
        {
4
            endpoint: "/bikes/:id/activate",
5
            method: "PUT",
6
            description: "Activate chosen bike",
7
            request: {
8
                headers: {
9
                    "x-access-token": "Admin JWT Token",
10
                    "x-api-key": "API Key",
11
                },
12
                params: {
13
                    id: "Bike ID"
14
                },
15
                body: {}
16
            },
17
            response: {
18
                status: 200,
19
                description: "Updated bike object",
20
                body: {
21
                    "id": 1,
22
                    "city_id": "STHLM",
23
                    "status_id": 1,
24
                    "status_descr": "available",
25
                    "charge_perc": 1,
26
                    "coords": [
27
                        18.05767,
28
                        59.33464
29
                    ],
30
                    "active": true
31
                }
32
            }
33
        },
34
        {
35
            endpoint: "/bikes/:id/deactivate",
36
            method: "PUT",
37
            description: "Deactivate a bike",
38
            request: {
39
                headers: {
40
                    "x-access-token": "Admin JWT Token",
41
                    "x-api-key": "API Key",
42
                },
43
                params: {
44
                    id: "Bike ID"
45
                },
46
                body: {}
47
            },
48
            response: {
49
                status: 200,
50
                description: "Updated bike object",
51
                body: {
52
                    "bike": {
53
                        "id": 1,
54
                        "city_id": "STHLM",
55
                        "status_id": 1,
56
                        "status_descr": "available",
57
                        "charge_perc": 1,
58
                        "coords": [
59
                            18.05767,
60
                            59.33464
61
                        ],
62
                        "active": false
63
                    }
64
                }
65
            }
66
        },
67
        {
68
            endpoint: "/bikes/:bikeId/status/:statusId",
69
            method: "PUT",
70
            description: "Update a bike's status",
71
            request: {
72
                headers: {
73
                    "x-access-token": "Admin JWT Token",
74
                    "x-api-key": "API Key",
75
                },
76
                params: {
77
                    bikeId: "Bike ID",
78
                    statusID: "New bike status ID",
79
                },
80
                body: {}
81
            },
82
            response: {
83
                status: 200,
84
                description: "Updated bike object",
85
                body: {
86
                    "id": 1,
87
                    "city_id": "STHLM",
88
                    "status_id": 4,
89
                    "status_descr": "maintenance required",
90
                    "charge_perc": 1,
91
                    "coords": [
92
                        18.05767,
93
                        59.33464
94
                    ],
95
                    "active": false
96
                }
97
            }
98
        },
99
        {
100
            endpoint: "/bikes/:id/change/city",
101
            method: "PUT",
102
            description: "Update a bike's city",
103
            request: {
104
                headers: {
105
                    "x-access-token": "Admin JWT Token",
106
                    "x-api-key": "API Key",
107
                },
108
                params: {
109
                    id: "Bike ID"
110
                },
111
                body: {
112
                    city_id: "New city ID."
113
                }
114
            },
115
            response: {
116
                status: 200,
117
                description: "Updated bike object.",
118
                body: {
119
                    "id": 1,
120
                    "city_id": "GBG",
121
                    "status_id": 1,
122
                    "status_descr": "available",
123
                    "charge_perc": 1,
124
                    "coords": [
125
                        18.05767,
126
                        59.33464
127
                    ],
128
                    "active": false
129
                }
130
            }
131
        },
132
        {
133
            endpoint: "/feed",
134
            method: "GET",
135
            description: "Connect admin client to feed",
136
            request: {
137
                headers: {
138
                    "x-access-token": "Admin JWT Token",
139
                    "x-api-key": "API Key",
140
                },
141
                params: {},
142
                body: {}
143
            },
144
            response: {
145
                status: null,
146
                description: "No response.",
147
                body: null
148
            }
149
        },
150
        {
151
            endpoint: "/simulate",
152
            method: "GET",
153
            description: "Start simulation",
154
            request: {
155
                headers: {
156
                    "x-access-token": "Admin JWT Token",
157
                    "x-api-key": "API Key",
158
                },
159
                params: {},
160
                body: {}
161
            },
162
            response: {
163
                status: null,
164
                description: "No response.",
165
                body: null
166
            }
167
        },
168
        {
169
            endpoint: "/transactions",
170
            method: "POST",
171
            description: "Get one user's transactions",
172
            request: {
173
                headers: {
174
                    "x-access-token": "Admin JWT Token",
175
                    "x-api-key": "API Key",
176
                },
177
                params: {},
178
                body: {
179
                    user_id: "User ID"
180
                }
181
            },
182
            response: {
183
                status: 200,
184
                description: "Array of transaction objects",
185
                body: [
186
                    {
187
                        "id": 1,
188
                        "user_id": 1,
189
                        "date": "2024-01-12T19:41:00.000Z",
190
                        "ref": "***1111",
191
                        "amount": 500
192
                    }
193
                ]
194
            }
195
        },
196
        {
197
            endpoint: "/transactions/limit/:limit/offset/:offset",
198
            method: "POST",
199
            description: "Get one user's transactions paginated",
200
            request: {
201
                headers: {
202
                    "x-access-token": "Admin JWT Token",
203
                    "x-api-key": "API Key",
204
                },
205
                params: {
206
                    limit: "Number of transactions.",
207
                    offset: "Starting point in data set."
208
                },
209
                body: {
210
                    user_id: "User ID"
211
                }
212
            },
213
            response: {
214
                status: 200,
215
                description: "Array of transaction objects.",
216
                body: [
217
                    {
218
                        "id": 1,
219
                        "user_id": 1,
220
                        "date": "2024-01-12T19:41:00.000Z",
221
                        "ref": "***1111",
222
                        "amount": 500
223
                    }
224
                ]
225
            }
226
        },
227
        {
228
            endpoint: "/transactions/all",
229
            method: "GET",
230
            description: "Get all user transactions",
231
            request: {
232
                headers: {
233
                    "x-access-token": "Admin JWT Token",
234
                    "x-api-key": "API Key",
235
                },
236
                params: {},
237
                body: {}
238
            },
239
            response: {
240
                status: 200,
241
                description: "Array of transaction objects.",
242
                body: [
243
                    {
244
                        "id": 1,
245
                        "user_id": 1,
246
                        "date": "2024-01-12T19:41:00.000Z",
247
                        "ref": "***1111",
248
                        "amount": 500
249
                    }
250
                ]
251
            }
252
        },
253
        {
254
            endpoint: "/transactions/all/limit/:limit/offset/:offset",
255
            method: "GET",
256
            description: "Get all user transactions paginated",
257
            request: {
258
                headers: {
259
                    "x-access-token": "Admin JWT Token",
260
                    "x-api-key": "API Key",
261
                },
262
                params: {
263
                    limit: "Number of transactions.",
264
                    offset: "Starting point in data set."
265
                },
266
                body: {}
267
            },
268
            response: {
269
                status: 200,
270
                description: "Array of transaction objects.",
271
                body: [
272
                    {
273
                        "id": 1,
274
                        "user_id": 1,
275
                        "date": "2024-01-12T19:41:00.000Z",
276
                        "ref": "***1111",
277
                        "amount": 500
278
                    }
279
                ]
280
            }
281
        },
282
        {
283
            endpoint: "/trips",
284
            method: "POST",
285
            description: "Get one user's trips",
286
            request: {
287
                headers: {
288
                    "x-access-token": "Admin JWT Token",
289
                    "x-api-key": "API Key",
290
                },
291
                params: {},
292
                body: {
293
                    user_id: "User ID"
294
                }
295
            },
296
            response: {
297
                status: 200,
298
                description: "Array of trip objects",
299
                body: [
300
                    {
301
                        "id": 11,
302
                        "user_id": 1,
303
                        "bike_id": 1,
304
                        "start_time": "2024-01-05T15:16:00.000Z",
305
                        "end_time": "2024-01-05T15:22:00.000Z",
306
                        "start_pos": [
307
                            13.51464,
308
                            59.37884
309
                        ],
310
                        "end_pos": [
311
                            13.5148,
312
                            59.37663
313
                        ],
314
                        "start_cost": 10,
315
                        "var_cost": 17.68,
316
                        "park_cost": 100,
317
                        "total_cost": 127.68
318
                    }
319
                ]
320
            }
321
        },
322
        {
323
            endpoint: "/trips/limit/:limit/offset/:offset",
324
            method: "POST",
325
            description: "Get one user's trips paginated",
326
            request: {
327
                headers: {
328
                    "x-access-token": "Admin JWT Token",
329
                    "x-api-key": "API Key",
330
                },
331
                params: {
332
                    limit: "Number of trips.",
333
                    offset: "Starting point in data set."
334
                },
335
                body: {
336
                    user_id: "User ID"
337
                }
338
            },
339
            response: {
340
                status: 200,
341
                description: "Array of trip objects.",
342
                body: [
343
                    {
344
                        "id": 11,
345
                        "user_id": 1,
346
                        "bike_id": 1,
347
                        "start_time": "2024-01-05T15:16:00.000Z",
348
                        "end_time": "2024-01-05T15:22:00.000Z",
349
                        "start_pos": [
350
                            13.51464,
351
                            59.37884
352
                        ],
353
                        "end_pos": [
354
                            13.5148,
355
                            59.37663
356
                        ],
357
                        "start_cost": 10,
358
                        "var_cost": 17.68,
359
                        "park_cost": 100,
360
                        "total_cost": 127.68
361
                    }
362
                ]
363
            }
364
        },
365
        {
366
            endpoint: "/trips/all",
367
            method: "GET",
368
            description: "Get all user trips",
369
            request: {
370
                headers: {
371
                    "x-access-token": "Admin JWT Token",
372
                    "x-api-key": "API Key",
373
                },
374
                params: {},
375
                body: {}
376
            },
377
            response: {
378
                status: 200,
379
                description: "Array of trip objects.",
380
                body: [
381
                    {
382
                        "id": 11,
383
                        "user_id": 1,
384
                        "bike_id": 1,
385
                        "start_time": "2024-01-05T15:16:00.000Z",
386
                        "end_time": "2024-01-05T15:22:00.000Z",
387
                        "start_pos": [
388
                            13.51464,
389
                            59.37884
390
                        ],
391
                        "end_pos": [
392
                            13.5148,
393
                            59.37663
394
                        ],
395
                        "start_cost": 10,
396
                        "var_cost": 17.68,
397
                        "park_cost": 100,
398
                        "total_cost": 127.68
399
                    }
400
                ]
401
            }
402
        },
403
        {
404
            endpoint: "/trips/all/limit/:limit/offset/:offset",
405
            method: "GET",
406
            description: "Get all user trips paginated",
407
            request: {
408
                headers: {
409
                    "x-access-token": "Admin JWT Token",
410
                    "x-api-key": "API Key",
411
                },
412
                params: {
413
                    limit: "Number of trips.",
414
                    offset: "Starting point in data set."
415
                },
416
                body: {}
417
            },
418
            response: {
419
                status: 200,
420
                description: "Array of trip objects.",
421
                body: [
422
                    {
423
                        "id": 11,
424
                        "user_id": 1,
425
                        "bike_id": 1,
426
                        "start_time": "2024-01-05T15:16:00.000Z",
427
                        "end_time": "2024-01-05T15:22:00.000Z",
428
                        "start_pos": [
429
                            13.51464,
430
                            59.37884
431
                        ],
432
                        "end_pos": [
433
                            13.5148,
434
                            59.37663
435
                        ],
436
                        "start_cost": 10,
437
                        "var_cost": 17.68,
438
                        "park_cost": 100,
439
                        "total_cost": 127.68
440
                    }
441
                ]
442
            }
443
        },
444
        {
445
            endpoint: "/users",
446
            method: "GET",
447
            description: "Get all users",
448
            request: {
449
                headers: {
450
                    "x-access-token": "Admin JWT Token",
451
                    "x-api-key": "API Key",
452
                },
453
                params: {},
454
                body: {}
455
            },
456
            response: {
457
                status: 200,
458
                description: "Array of user objects",
459
                body: [
460
                    {
461
                        "id": 1000,
462
                        "email": "[email protected]",
463
                        "balance": 500,
464
                        "active": true
465
                    }
466
                ]
467
            }
468
        },
469
        {
470
            endpoint: "/users/limit/:limit/offset/:offset",
471
            method: "GET",
472
            description: "Get users paginated",
473
            request: {
474
                headers: {
475
                    "x-access-token": "Admin JWT Token",
476
                    "x-api-key": "API Key",
477
                },
478
                params: {
479
                    limit: "Number of users.",
480
                    offset: "Starting point in data set."
481
                },
482
                body: {}
483
            },
484
            response: {
485
                status: 200,
486
                description: "Array of user objects.",
487
                body: [
488
                    {
489
                        "id": 1000,
490
                        "email": "[email protected]",
491
                        "balance": 500,
492
                        "active": true
493
                    }
494
                ]
495
            }
496
        },
497
        {
498
            endpoint: "/users/:id",
499
            method: "GET",
500
            description: "Get one user",
501
            request: {
502
                headers: {
503
                    "x-access-token": "Admin JWT Token",
504
                    "x-api-key": "API Key",
505
                },
506
                params: {
507
                    id: "User ID"
508
                },
509
                body: {}
510
            },
511
            response: {
512
                status: 200,
513
                description: "User object",
514
                body: {
515
                    "id": 1000,
516
                    "email": "[email protected]",
517
                    "balance": 500,
518
                    "active": true
519
                }
520
            }
521
        },
522
        {
523
            endpoint: "/users/search/:search",
524
            method: "GET",
525
            description: "Search for users",
526
            request: {
527
                headers: {
528
                    "x-access-token": "Admin JWT Token",
529
                    "x-api-key": "API Key",
530
                },
531
                params: {
532
                    search: "Search word."
533
                },
534
                body: {}
535
            },
536
            response: {
537
                status: 200,
538
                description: "Array of user objects",
539
                body: [
540
                    {
541
                        "id": 1000,
542
                        "email": "[email protected]",
543
                        "balance": 500,
544
                        "active": true
545
                    }
546
                ]
547
            }
548
        },
549
        {
550
            endpoint: "/users/invoice",
551
            method: "PUT",
552
            description: "Charge customers with negative balance",
553
            request: {
554
                headers: {
555
                    "x-access-token": "Admin JWT Token",
556
                    "x-api-key": "API Key",
557
                },
558
                params: {},
559
                body: {}
560
            },
561
            response: {
562
                status: 200,
563
                description: "Summary object",
564
                body: {
565
                    "invoiced_users": 5021,
566
                    "invoiced_amount": 1384057.02
567
                }
568
            }
569
        },
570
        {
571
            endpoint: "/users/:id/status",
572
            method: "PUT",
573
            description: "Update a customer's status",
574
            request: {
575
                headers: {
576
                    "x-access-token": "Admin JWT Token",
577
                    "x-api-key": "API Key",
578
                },
579
                params: {
580
                    id: "User ID"
581
                },
582
                body: {
583
                    active: "New active status - true or false."
584
                }
585
            },
586
            response: {
587
                status: 200,
588
                description: "User object",
589
                body: {
590
                    "id": 1000,
591
                    "email": "[email protected]",
592
                    "balance": 500,
593
                    "active": false
594
                }
595
            }
596
        },
597
        {
598
            endpoint: "/users/:id/email",
599
            method: "PUT",
600
            description: "Update a customer's email",
601
            request: {
602
                headers: {
603
                    "x-access-token": "Admin JWT Token",
604
                    "x-api-key": "API Key",
605
                },
606
                params: {
607
                    id: "User ID"
608
                },
609
                body: {
610
                    email: "New user email."
611
                }
612
            },
613
            response: {
614
                status: 200,
615
                description: "User object",
616
                body: {
617
                    "id": 1000,
618
                    "email": "[email protected]",
619
                    "balance": 500,
620
                    "active": true
621
                }
622
            }
623
        },
624
    ],
625
    user: [
626
        {
627
            endpoint: "/balance",
628
            method: "POST",
629
            description: "Get user's balance",
630
            request: {
631
                headers: {
632
                    "x-access-token": "User JWT Token",
633
                    "x-api-key": "API Key",
634
                },
635
                params: {},
636
                body: {}
637
            },
638
            response: {
639
                status: 200,
640
                description: "User balance",
641
                body: {
642
                    balance: 500
643
                }
644
            }
645
        },
646
        {
647
            endpoint: "/bikes/rent/:bikeId",
648
            method: "POST",
649
            description: "Rent a bike",
650
            request: {
651
                headers: {
652
                    "x-access-token": "User JWT Token",
653
                    "x-api-key": "API Key",
654
                },
655
                params: {
656
                    bikeId: "Bike ID"
657
                },
658
                body: {}
659
            },
660
            response: {
661
                status: 200,
662
                description: "Trip ID",
663
                body: {
664
                    trip_id: 1
665
                }
666
            }
667
        },
668
        {
669
            endpoint: "/bikes/return/:tripId",
670
            method: "POST",
671
            description: "Return a bike",
672
            request: {
673
                headers: {
674
                    "x-access-token": "User JWT Token",
675
                    "x-api-key": "API Key",
676
                },
677
                params: {
678
                    bikeId: "Trip ID"
679
                },
680
                body: {}
681
            },
682
            response: {
683
                status: 200,
684
                description: "Trip ID",
685
                body: {
686
                    trip_id: 1
687
                }
688
            }
689
        },
690
        {
691
            endpoint: "/card",
692
            method: "POST",
693
            description: "Get user card details",
694
            request: {
695
                headers: {
696
                    "x-access-token": "User JWT Token",
697
                    "x-api-key": "API Key",
698
                },
699
                params: {},
700
                body: {}
701
            },
702
            response: {
703
                status: 200,
704
                description: "User card detail object",
705
                body: {
706
                    "card_nr": "1111 2222 3333 4444",
707
                    "card_type": 2,
708
                    "card_type_descr": "Mastercard"
709
                }
710
            }
711
        },
712
        {
713
            endpoint: "/card",
714
            method: "PUT",
715
            description: "Update user card details",
716
            request: {
717
                headers: {
718
                    "x-access-token": "User JWT Token",
719
                    "x-api-key": "API Key",
720
                },
721
                params: {},
722
                body: {
723
                    card_nr: "2222 3333 4444 5555",
724
                    card_type: 1,
725
                }
726
            },
727
            response: {
728
                status: 200,
729
                description: "User card detail object",
730
                body: {
731
                    "card_nr": "2222 3333 4444 5555",
732
                    "card_type": 1,
733
                    "card_type_descr": "Visa"
734
                }
735
            }
736
        },
737
        {
738
            endpoint: "/cities/:id/bikes",
739
            method: "GET",
740
            description: "Get available bikes for chosen city",
741
            request: {
742
                headers: {
743
                    "x-access-token": "User JWT Token",
744
                    "x-api-key": "API Key",
745
                },
746
                params: {
747
                    id: "City ID."
748
                },
749
                body: {}
750
            },
751
            response: {
752
                status: 200,
753
                description: "Array of bike objects.",
754
                body: [
755
                    {
756
                        "id": 2,
757
                        "city_id": "STHLM",
758
                        "status_id": 1,
759
                        "status_descr": "available",
760
                        "charge_perc": 1,
761
                        "coords": [
762
                            18.02549,
763
                            59.34452
764
                        ],
765
                        "active": true
766
                    }
767
                ]
768
            }
769
        },
770
        {
771
            endpoint: "/payment",
772
            method: "POST",
773
            description: "Prepay money to user bike account",
774
            request: {
775
                headers: {
776
                    "x-access-token": "User JWT Token",
777
                    "x-api-key": "API Key",
778
                },
779
                params: {},
780
                body: {
781
                    amount: "Amount to add."
782
                }
783
            },
784
            response: {
785
                status: 200,
786
                description: "Receipt object.",
787
                body: {
788
                    "id": 3176,
789
                    "user_id": 3,
790
                    "date": "2024-01-06T10:17:42.000Z",
791
                    "ref": "***5555",
792
                    "amount": 100,
793
                    "balance": 100
794
                }
795
            }
796
        },
797
        {
798
            endpoint: "/transactions",
799
            method: "POST",
800
            description: "Get one user's transactions",
801
            request: {
802
                headers: {
803
                    "x-access-token": "Admin JWT Token",
804
                    "x-api-key": "API Key",
805
                },
806
                params: {},
807
                body: {}
808
            },
809
            response: {
810
                status: 200,
811
                description: "Array of transaction objects",
812
                body: [
813
                    {
814
                        "id": 1,
815
                        "user_id": 1,
816
                        "date": "2024-01-12T19:41:00.000Z",
817
                        "ref": "***1111",
818
                        "amount": 500
819
                    }
820
                ]
821
            }
822
        },
823
        {
824
            endpoint: "/transactions/limit/:limit/offset/:offset",
825
            method: "POST",
826
            description: "Get one user's transactions paginated",
827
            request: {
828
                headers: {
829
                    "x-access-token": "Admin JWT Token",
830
                    "x-api-key": "API Key",
831
                },
832
                params: {
833
                    limit: "Number of transactions.",
834
                    offset: "Starting point in data set."
835
                },
836
                body: {}
837
            },
838
            response: {
839
                status: 200,
840
                description: "Array of transaction objects.",
841
                body: [
842
                    {
843
                        "id": 1,
844
                        "user_id": 1,
845
                        "date": "2024-01-12T19:41:00.000Z",
846
                        "ref": "***1111",
847
                        "amount": 500
848
                    }
849
                ]
850
            }
851
        },
852
        {
853
            endpoint: "/trips",
854
            method: "POST",
855
            description: "Get one user's trips",
856
            request: {
857
                headers: {
858
                    "x-access-token": "Admin JWT Token",
859
                    "x-api-key": "API Key",
860
                },
861
                params: {},
862
                body: {}
863
            },
864
            response: {
865
                status: 200,
866
                description: "Array of trip objects",
867
                body: [
868
                    {
869
                        "id": 11,
870
                        "user_id": 1,
871
                        "bike_id": 1,
872
                        "start_time": "2024-01-05T15:16:00.000Z",
873
                        "end_time": "2024-01-05T15:22:00.000Z",
874
                        "start_pos": [
875
                            13.51464,
876
                            59.37884
877
                        ],
878
                        "end_pos": [
879
                            13.5148,
880
                            59.37663
881
                        ],
882
                        "start_cost": 10,
883
                        "var_cost": 17.68,
884
                        "park_cost": 100,
885
                        "total_cost": 127.68
886
                    }
887
                ]
888
            }
889
        },
890
        {
891
            endpoint: "/trips/limit/:limit/offset/:offset",
892
            method: "POST",
893
            description: "Get one user's trips paginated",
894
            request: {
895
                headers: {
896
                    "x-access-token": "Admin JWT Token",
897
                    "x-api-key": "API Key",
898
                },
899
                params: {
900
                    limit: "Number of trips.",
901
                    offset: "Starting point in data set."
902
                },
903
                body: {}
904
            },
905
            response: {
906
                status: 200,
907
                description: "Array of trip objects.",
908
                body: [
909
                    {
910
                        "id": 11,
911
                        "user_id": 1,
912
                        "bike_id": 1,
913
                        "start_time": "2024-01-05T15:16:00.000Z",
914
                        "end_time": "2024-01-05T15:22:00.000Z",
915
                        "start_pos": [
916
                            13.51464,
917
                            59.37884
918
                        ],
919
                        "end_pos": [
920
                            13.5148,
921
                            59.37663
922
                        ],
923
                        "start_cost": 10,
924
                        "var_cost": 17.68,
925
                        "park_cost": 100,
926
                        "total_cost": 127.68
927
                    }
928
                ]
929
            }
930
        },
931
    ],
932
    bikes: [
933
        {
934
            endpoint: "/instructions",
935
            method: "GET",
936
            description: "Connect bike to instructions feed",
937
            request: {
938
                headers: {
939
                    "x-api-key": "API Key",
940
                    "bike_id": "Bike ID"
941
                },
942
                params: {},
943
                body: {}
944
            },
945
            response: {
946
                status: null,
947
                description: "No response",
948
                body: null
949
            }
950
        },
951
        {
952
            endpoint: "/status",
953
            method: "GET",
954
            description: "Get all statuses a bike can have",
955
            request: {
956
                headers: {
957
                    "x-api-key": "API Key",
958
                },
959
                params: {},
960
                body: {}
961
            },
962
            response: {
963
                status: 200,
964
                description: "Array of bike status objects.",
965
                body: [
966
                    {
967
                        "id": 1,
968
                        "descr": "available"
969
                    },
970
                    {
971
                        "id": 2,
972
                        "descr": "rented"
973
                    },
974
                    {
975
                        "id": 3,
976
                        "descr": "in maintenance"
977
                    },
978
                    {
979
                        "id": 4,
980
                        "descr": "maintenance required"
981
                    },
982
                    {
983
                        "id": 5,
984
                        "descr": "rented maintenance required"
985
                    }
986
                ]
987
            }
988
        },
989
        {
990
            endpoint: "",
991
            method: "GET",
992
            description: "Get all bikes",
993
            request: {
994
                headers: {
995
                    "x-api-key": "API Key",
996
                },
997
                params: {},
998
                body: {}
999
            },
1000
            response: {
1001
                status: 200,
1002
                description: "Array of bike objects.",
1003
                body: [
1004
                    {
1005
                        "id": 1,
1006
                        "city_id": "STHLM",
1007
                        "status_id": 1,
1008
                        "status_descr": "available",
1009
                        "charge_perc": 1,
1010
                        "coords": [
1011
                            18.05767,
1012
                            59.33464
1013
                        ],
1014
                        "active": false
1015
                    }
1016
                ]
1017
            }
1018
        },
1019
        {
1020
            endpoint: "/:id",
1021
            method: "PUT",
1022
            description: "Update a bike",
1023
            request: {
1024
                headers: {
1025
                    "x-api-key": "API Key",
1026
                },
1027
                params: {
1028
                    id: "Bike ID"
1029
                },
1030
                body: {
1031
                    id: "Bike ID",
1032
                    city_id: "City ID",
1033
                    status_id: "Bike status",
1034
                    charge_perc: "Float 0-1",
1035
                    coords: "Array of longitude and latitude coordinates",
1036
                    speed: "Bike speed."
1037
                }
1038
            },
1039
            response: {
1040
                status: 204,
1041
                description: "Only response status.",
1042
                body: null
1043
            }
1044
        },
1045
        {
1046
            endpoint: "/:id/zones",
1047
            method: "GET",
1048
            description: "Get city zones for a bike",
1049
            request: {
1050
                headers: {
1051
                    "x-api-key": "API Key",
1052
                },
1053
                params: {
1054
                    id: "Bike ID"
1055
                },
1056
                body: {}
1057
            },
1058
            response: {
1059
                status: 200,
1060
                description: "Zone object.",
1061
                body: {
1062
                    "city_id": "STHLM",
1063
                    "geometry": {
1064
                        "coordinates": [
1065
                            [
1066
                                [
1067
                                    18.077863369208444,
1068
                                    59.3026425264305
1069
                                ],
1070
                                [
1071
                                    18.09815091103826,
1072
                                    59.30699055672042
1073
                                ],
1074
                                [
1075
                                    18.099732642276024,
1076
                                    59.31601507540503
1077
                                ],
1078
                                [
1079
                                    18.08037278179529,
1080
                                    59.31906196189343
1081
                                ],
1082
                                [
1083
                                    18.076010672122433,
1084
                                    59.32087040616561
1085
                                ],
1086
                                [
1087
                                    18.077593736164708,
1088
                                    59.32370892367982
1089
                                ],
1090
                                [
1091
                                    18.075797098176494,
1092
                                    59.32919220588397
1093
                                ],
1094
                                [
1095
                                    18.077930090748197,
1096
                                    59.33178569456575
1097
                                ],
1098
                                [
1099
                                    18.100791529590367,
1100
                                    59.330692347580595
1101
                                ],
1102
                                [
1103
                                    18.10890312372635,
1104
                                    59.33393279121245
1105
                                ],
1106
                                [
1107
                                    18.103138846212957,
1108
                                    59.34228175774038
1109
                                ],
1110
                                [
1111
                                    18.09275121649287,
1112
                                    59.346306697299184
1113
                                ],
1114
                                [
1115
                                    18.069911787579287,
1116
                                    59.34689032798022
1117
                                ],
1118
                                [
1119
                                    18.05345141862708,
1120
                                    59.35499041709903
1121
                                ],
1122
                                [
1123
                                    18.04498209014813,
1124
                                    59.35246862857877
1125
                                ],
1126
                                [
1127
                                    18.03963827622566,
1128
                                    59.35509208487899
1129
                                ],
1130
                                [
1131
                                    18.035844879372235,
1132
                                    59.355067630956945
1133
                                ],
1134
                                [
1135
                                    18.018856861582805,
1136
                                    59.35102595097108
1137
                                ],
1138
                                [
1139
                                    18.008383886213068,
1140
                                    59.34198506380844
1141
                                ],
1142
                                [
1143
                                    17.995217972094878,
1144
                                    59.33625467746916
1145
                                ],
1146
                                [
1147
                                    17.994858129940837,
1148
                                    59.33076859571398
1149
                                ],
1150
                                [
1151
                                    18.001153031824316,
1152
                                    59.32216273527965
1153
                                ],
1154
                                [
1155
                                    18.016160710469045,
1156
                                    59.31704369834036
1157
                                ],
1158
                                [
1159
                                    18.02910510590955,
1160
                                    59.31537034239837
1161
                                ],
1162
                                [
1163
                                    18.052367899989406,
1164
                                    59.307620745841746
1165
                                ],
1166
                                [
1167
                                    18.077863369208444,
1168
                                    59.3026425264305
1169
                                ]
1170
                            ]
1171
                        ],
1172
                        "type": "Polygon"
1173
                    },
1174
                    "speed_limit": 20,
1175
                    "zones": [
1176
                        {
1177
                            "zone_id": 3,
1178
                            "geometry": {
1179
                                "coordinates": [
1180
                                    [
1181
                                        [
1182
                                            18.068502264333716,
1183
                                            59.3231730630483
1184
                                        ],
1185
                                        [
1186
                                            18.068886979457517,
1187
                                            59.322819894077384
1188
                                        ],
1189
                                        [
1190
                                            18.06967157839128,
1191
                                            59.32255030139359
1192
                                        ],
1193
                                        [
1194
                                            18.071048629582293,
1195
                                            59.32269735221334
1196
                                        ],
1197
                                        [
1198
                                            18.07223353409472,
1199
                                            59.32241958901943
1200
                                        ],
1201
                                        [
1202
                                            18.072809974128347,
1203
                                            59.322092805885234
1204
                                        ],
1205
                                        [
1206
                                            18.074042915309633,
1207
                                            59.321921243481995
1208
                                        ],
1209
                                        [
1210
                                            18.07479548979822,
1211
                                            59.32297511313732
1212
                                        ],
1213
                                        [
1214
                                            18.075019974791076,
1215
                                            59.32345725774388
1216
                                        ],
1217
                                        [
1218
                                            18.07548660710907,
1219
                                            59.32483958049377
1220
                                        ],
1221
                                        [
1222
                                            18.075321027899122,
1223
                                            59.32558447555283
1224
                                        ],
1225
                                        [
1226
                                            18.072581444612837,
1227
                                            59.32786513518903
1228
                                        ],
1229
                                        [
1230
                                            18.068156053750755,
1231
                                            59.32645985525002
1232
                                        ],
1233
                                        [
1234
                                            18.066771209451673,
1235
                                            59.32563818712248
1236
                                        ],
1237
                                        [
1238
                                            18.06773457939849,
1239
                                            59.32510831583147
1240
                                        ],
1241
                                        [
1242
                                            18.067072262560714,
1243
                                            59.32410230557625
1244
                                        ],
1245
                                        [
1246
                                            18.068502264333716,
1247
                                            59.3231730630483
1248
                                        ]
1249
                                    ]
1250
                                ],
1251
                                "type": "Polygon"
1252
                            },
1253
                            "speed_limit": 0
1254
                        },
1255
                        {
1256
                            "zone_id": 3,
1257
                            "geometry": {
1258
                                "coordinates": [
1259
                                    [
1260
                                        [
1261
                                            18.02443762781263,
1262
                                            59.340943446232956
1263
                                        ],
1264
                                        [
1265
                                            18.02386921372411,
1266
                                            59.34279843846576
1267
                                        ],
1268
                                        [
1269
                                            18.021633451645016,
1270
                                            59.343957757162485
1271
                                        ],
1272
                                        [
1273
                                            18.017010350396873,
1274
                                            59.34455672298341
1275
                                        ],
1276
                                        [
1277
                                            18.015797733676123,
1278
                                            59.34310759398775
1279
                                        ],
1280
                                        [
1281
                                            18.016366147763335,
1282
                                            59.34173569489417
1283
                                        ],
1284
                                        [
1285
                                            18.019662949474537,
1286
                                            59.34069224157918
1287
                                        ],
1288
                                        [
1289
                                            18.020345046379305,
1290
                                            59.3405183295765
1291
                                        ],
1292
                                        [
1293
                                            18.02443762781263,
1294
                                            59.340943446232956
1295
                                        ]
1296
                                    ]
1297
                                ],
1298
                                "type": "Polygon"
1299
                            },
1300
                            "speed_limit": 0
1301
                        },
1302
                        {
1303
                            "zone_id": 3,
1304
                            "geometry": {
1305
                                "coordinates": [
1306
                                    [
1307
                                        [
1308
                                            18.087630304900017,
1309
                                            59.31352271604169
1310
                                        ],
1311
                                        [
1312
                                            18.085062718830812,
1313
                                            59.31208754951439
1314
                                        ],
1315
                                        [
1316
                                            18.088608432926236,
1317
                                            59.31035590926638
1318
                                        ],
1319
                                        [
1320
                                            18.09297944254385,
1321
                                            59.30910782557865
1322
                                        ],
1323
                                        [
1324
                                            18.093010009045656,
1325
                                            59.31214994931858
1326
                                        ],
1327
                                        [
1328
                                            18.087630304900017,
1329
                                            59.31352271604169
1330
                                        ]
1331
                                    ]
1332
                                ],
1333
                                "type": "Polygon"
1334
                            },
1335
                            "speed_limit": 0
1336
                        },
1337
                        {
1338
                            "zone_id": 3,
1339
                            "geometry": {
1340
                                "coordinates": [
1341
                                    [
1342
                                        [
1343
                                            18.070900400099447,
1344
                                            59.34135449650614
1345
                                        ],
1346
                                        [
1347
                                            18.070082169123253,
1348
                                            59.34052001802971
1349
                                        ],
1350
                                        [
1351
                                            18.070211363487715,
1352
                                            59.33806038325082
1353
                                        ],
1354
                                        [
1355
                                            18.073570416967385,
1356
                                            59.33726974853127
1357
                                        ],
1358
                                        [
1359
                                            18.075917447923473,
1360
                                            59.340333355564354
1361
                                        ],
1362
                                        [
1363
                                            18.070900400099447,
1364
                                            59.34135449650614
1365
                                        ]
1366
                                    ]
1367
                                ],
1368
                                "type": "Polygon"
1369
                            },
1370
                            "speed_limit": 0
1371
                        },
1372
                        {
1373
                            "zone_id": 3,
1374
                            "geometry": {
1375
                                "coordinates": [
1376
                                    [
1377
                                        [
1378
                                            18.054639270868762,
1379
                                            59.34306399153684
1380
                                        ],
1381
                                        [
1382
                                            18.053052742589585,
1383
                                            59.342616475914014
1384
                                        ],
1385
                                        [
1386
                                            18.052833329105,
1387
                                            59.34159233143461
1388
                                        ],
1389
                                        [
1390
                                            18.053356545877733,
1391
                                            59.341101763896035
1392
                                        ],
1393
                                        [
1394
                                            18.05497683007667,
1395
                                            59.34065422241727
1396
                                        ],
1397
                                        [
1398
                                            18.056681504079194,
1399
                                            59.34117922239969
1400
                                        ],
1401
                                        [
1402
                                            18.054639270868762,
1403
                                            59.34306399153684
1404
                                        ]
1405
                                    ]
1406
                                ],
1407
                                "type": "Polygon"
1408
                            },
1409
                            "speed_limit": 0
1410
                        },
1411
                        {
1412
                            "zone_id": 3,
1413
                            "geometry": {
1414
                                "coordinates": [
1415
                                    [
1416
                                        [
1417
                                            18.04562079866426,
1418
                                            59.3413307381133
1419
                                        ],
1420
                                        [
1421
                                            18.039390235082152,
1422
                                            59.33983941132573
1423
                                        ],
1424
                                        [
1425
                                            18.04101781087479,
1426
                                            59.33813403131535
1427
                                        ],
1428
                                        [
1429
                                            18.04375162958982,
1430
                                            59.33709649588337
1431
                                        ],
1432
                                        [
1433
                                            18.0441076617941,
1434
                                            59.33721322020142
1435
                                        ],
1436
                                        [
1437
                                            18.043624475231184,
1438
                                            59.337563390749466
1439
                                        ],
1440
                                        [
1441
                                            18.044794295331684,
1442
                                            59.33803027919828
1443
                                        ],
1444
                                        [
1445
                                            18.042747110155148,
1446
                                            59.3394892642404
1447
                                        ],
1448
                                        [
1449
                                            18.04656174091926,
1450
                                            59.34048782232284
1451
                                        ],
1452
                                        [
1453
                                            18.04562079866426,
1454
                                            59.3413307381133
1455
                                        ]
1456
                                    ]
1457
                                ],
1458
                                "type": "Polygon"
1459
                            },
1460
                            "speed_limit": 0
1461
                        },
1462
                        {
1463
                            "zone_id": 3,
1464
                            "geometry": {
1465
                                "coordinates": [
1466
                                    [
1467
                                        [
1468
                                            18.051585630540217,
1469
                                            59.314839311684125
1470
                                        ],
1471
                                        [
1472
                                            18.047583711517888,
1473
                                            59.31452853154846
1474
                                        ],
1475
                                        [
1476
                                            18.045648000687095,
1477
                                            59.31307448674937
1478
                                        ],
1479
                                        [
1480
                                            18.0459959936465,
1481
                                            59.312130989303085
1482
                                        ],
1483
                                        [
1484
                                            18.0473879654798,
1485
                                            59.31146497534337
1486
                                        ],
1487
                                        [
1488
                                            18.051194138461028,
1489
                                            59.31200888772014
1490
                                        ],
1491
                                        [
1492
                                            18.052955852812886,
1493
                                            59.312874689474995
1494
                                        ],
1495
                                        [
1496
                                            18.051585630540217,
1497
                                            59.314839311684125
1498
                                        ]
1499
                                    ]
1500
                                ],
1501
                                "type": "Polygon"
1502
                            },
1503
                            "speed_limit": 0
1504
                        }
1505
                    ]
1506
                }
1507
            }
1508
        },
1509
    ],
1510
    card: [
1511
        {
1512
            endpoint: "/types",
1513
            method: "GET",
1514
            description: "Get all charge card types",
1515
            request: {
1516
                headers: {
1517
                    "x-api-key": "API Key",
1518
                },
1519
                params: {},
1520
                body: {}
1521
            },
1522
            response: {
1523
                status: 200,
1524
                description: "Array of card type objects.",
1525
                body: [
1526
                    {
1527
                        "id": 1,
1528
                        "name": "Visa"
1529
                    },
1530
                    {
1531
                        "id": 2,
1532
                        "name": "Mastercard"
1533
                    },
1534
                    {
1535
                        "id": 3,
1536
                        "name": "American Express"
1537
                    }
1538
                ]
1539
            }
1540
        },
1541
    ],
1542
    cities: [
1543
        {
1544
            endpoint: "",
1545
            method: "GET",
1546
            description: "Get all cities",
1547
            request: {
1548
                headers: {
1549
                    "x-api-key": "API Key",
1550
                },
1551
                params: {},
1552
                body: {}
1553
            },
1554
            response: {
1555
                status: 200,
1556
                description: "Array of city objects.",
1557
                body: [
1558
                    {
1559
                        "id": "GBG",
1560
                        "name": "Göteborg",
1561
                        "speed_limit": 20,
1562
                        "geometry": {
1563
                            "coordinates": [
1564
                                [
1565
                                    [
1566
                                        11.944333910956516,
1567
                                        57.67919611123858
1568
                                    ],
1569
                                    [
1570
                                        11.967995787555992,
1571
                                        57.67458273107127
1572
                                    ],
1573
                                    [
1574
                                        12.007998739155909,
1575
                                        57.67849715197991
1576
                                    ],
1577
                                    [
1578
                                        12.024993457155574,
1579
                                        57.700996871231666
1580
                                    ],
1581
                                    [
1582
                                        12.028811527258256,
1583
                                        57.72496783561451
1584
                                    ],
1585
                                    [
1586
                                        11.987762696696421,
1587
                                        57.73566592553405
1588
                                    ],
1589
                                    [
1590
                                        11.941092586496723,
1591
                                        57.73859683290104
1592
                                    ],
1593
                                    [
1594
                                        11.904357849897309,
1595
                                        57.72226446708444
1596
                                    ],
1597
                                    [
1598
                                        11.891669922003103,
1599
                                        57.70220684386706
1600
                                    ],
1601
                                    [
1602
                                        11.90421986760262,
1603
                                        57.6840410615994
1604
                                    ],
1605
                                    [
1606
                                        11.925005715003266,
1607
                                        57.675094561128674
1608
                                    ],
1609
                                    [
1610
                                        11.944333910956516,
1611
                                        57.67919611123858
1612
                                    ]
1613
                                ]
1614
                            ],
1615
                            "type": "Polygon"
1616
                        }
1617
                    }
1618
                ]
1619
            }
1620
        },
1621
        {
1622
            endpoint: "/:id",
1623
            method: "GET",
1624
            description: "Get one city by ID",
1625
            request: {
1626
                headers: {
1627
                    "x-api-key": "API Key",
1628
                },
1629
                params: {
1630
                    id: "City ID"
1631
                },
1632
                body: {}
1633
            },
1634
            response: {
1635
                status: 200,
1636
                description: "City object.",
1637
                body: {
1638
                    "id": "GBG",
1639
                    "name": "Göteborg",
1640
                    "speed_limit": 20,
1641
                    "geometry": {
1642
                        "coordinates": [
1643
                            [
1644
                                [
1645
                                    11.944333910956516,
1646
                                    57.67919611123858
1647
                                ],
1648
                                [
1649
                                    11.967995787555992,
1650
                                    57.67458273107127
1651
                                ],
1652
                                [
1653
                                    12.007998739155909,
1654
                                    57.67849715197991
1655
                                ],
1656
                                [
1657
                                    12.024993457155574,
1658
                                    57.700996871231666
1659
                                ],
1660
                                [
1661
                                    12.028811527258256,
1662
                                    57.72496783561451
1663
                                ],
1664
                                [
1665
                                    11.987762696696421,
1666
                                    57.73566592553405
1667
                                ],
1668
                                [
1669
                                    11.941092586496723,
1670
                                    57.73859683290104
1671
                                ],
1672
                                [
1673
                                    11.904357849897309,
1674
                                    57.72226446708444
1675
                                ],
1676
                                [
1677
                                    11.891669922003103,
1678
                                    57.70220684386706
1679
                                ],
1680
                                [
1681
                                    11.90421986760262,
1682
                                    57.6840410615994
1683
                                ],
1684
                                [
1685
                                    11.925005715003266,
1686
                                    57.675094561128674
1687
                                ],
1688
                                [
1689
                                    11.944333910956516,
1690
                                    57.67919611123858
1691
                                ]
1692
                            ]
1693
                        ],
1694
                        "type": "Polygon"
1695
                    }
1696
                }
1697
            }
1698
        },
1699
        {
1700
            endpoint: "/:id/bikes",
1701
            method: "GET",
1702
            description: "Get all bikes of a city",
1703
            request: {
1704
                headers: {
1705
                    "x-api-key": "API Key",
1706
                },
1707
                params: {
1708
                    id: "City ID"
1709
                },
1710
                body: {}
1711
            },
1712
            response: {
1713
                status: 200,
1714
                description: "Array of bike objects.",
1715
                body: [
1716
                    {
1717
                        "id": 1,
1718
                        "city_id": "STHLM",
1719
                        "status_id": 1,
1720
                        "status_descr": "available",
1721
                        "charge_perc": 1,
1722
                        "coords": [
1723
                            18.05767,
1724
                            59.33464
1725
                        ],
1726
                        "active": false
1727
                    },
1728
                ]
1729
            }
1730
        },
1731
        {
1732
            endpoint: "/:id/zones",
1733
            method: "GET",
1734
            description: "Get all zones of a city",
1735
            request: {
1736
                headers: {
1737
                    "x-api-key": "API Key",
1738
                },
1739
                params: {
1740
                    id: "City ID"
1741
                },
1742
                body: {}
1743
            },
1744
            response: {
1745
                status: 200,
1746
                description: "Array of zone objects.",
1747
                body: [
1748
                    {
1749
                        "id": 1,
1750
                        "zone_id": 3,
1751
                        "descr": "forbidden",
1752
                        "city_id": "STHLM",
1753
                        "geometry": {
1754
                            "coordinates": [
1755
                                [
1756
                                    [
1757
                                        18.068502264333716,
1758
                                        59.3231730630483
1759
                                    ],
1760
                                    [
1761
                                        18.068886979457517,
1762
                                        59.322819894077384
1763
                                    ],
1764
                                    [
1765
                                        18.06967157839128,
1766
                                        59.32255030139359
1767
                                    ],
1768
                                    [
1769
                                        18.071048629582293,
1770
                                        59.32269735221334
1771
                                    ],
1772
                                    [
1773
                                        18.07223353409472,
1774
                                        59.32241958901943
1775
                                    ],
1776
                                    [
1777
                                        18.072809974128347,
1778
                                        59.322092805885234
1779
                                    ],
1780
                                    [
1781
                                        18.074042915309633,
1782
                                        59.321921243481995
1783
                                    ],
1784
                                    [
1785
                                        18.07479548979822,
1786
                                        59.32297511313732
1787
                                    ],
1788
                                    [
1789
                                        18.075019974791076,
1790
                                        59.32345725774388
1791
                                    ],
1792
                                    [
1793
                                        18.07548660710907,
1794
                                        59.32483958049377
1795
                                    ],
1796
                                    [
1797
                                        18.075321027899122,
1798
                                        59.32558447555283
1799
                                    ],
1800
                                    [
1801
                                        18.072581444612837,
1802
                                        59.32786513518903
1803
                                    ],
1804
                                    [
1805
                                        18.068156053750755,
1806
                                        59.32645985525002
1807
                                    ],
1808
                                    [
1809
                                        18.066771209451673,
1810
                                        59.32563818712248
1811
                                    ],
1812
                                    [
1813
                                        18.06773457939849,
1814
                                        59.32510831583147
1815
                                    ],
1816
                                    [
1817
                                        18.067072262560714,
1818
                                        59.32410230557625
1819
                                    ],
1820
                                    [
1821
                                        18.068502264333716,
1822
                                        59.3231730630483
1823
                                    ]
1824
                                ]
1825
                            ],
1826
                            "type": "Polygon"
1827
                        },
1828
                        "speed_limit": 0
1829
                    },
1830
                ]
1831
            }
1832
        },
1833
        {
1834
            endpoint: "/zones/stations/bikes",
1835
            method: "GET",
1836
            description: "Get stations and zones with bikes located at each",
1837
            request: {
1838
                headers: {
1839
                    "x-api-key": "API Key",
1840
                },
1841
                params: {},
1842
                body: {}
1843
            },
1844
            response: {
1845
                status: 200,
1846
                description: "Array of stations and zones.",
1847
                body: [
1848
                    {
1849
                        "id": 13,
1850
                        "zone_id": 1,
1851
                        "descr": "parking",
1852
                        "city_id": "STHLM",
1853
                        "geometry": {
1854
                            "coordinates": [
1855
                                [
1856
                                    [
1857
                                        18.025058911360304,
1858
                                        59.3447479215063
1859
                                    ],
1860
                                    [
1861
                                        18.02523542903245,
1862
                                        59.3443802727858
1863
                                    ],
1864
                                    [
1865
                                        18.025683384254364,
1866
                                        59.3444719730814
1867
                                    ],
1868
                                    [
1869
                                        18.025287884755357,
1870
                                        59.3447852805283
1871
                                    ],
1872
                                    [
1873
                                        18.025058911360304,
1874
                                        59.3447479215063
1875
                                    ]
1876
                                ]
1877
                            ],
1878
                            "type": "Polygon"
1879
                        },
1880
                        "bikes": [
1881
                            {
1882
                                "id": 2,
1883
                                "city_id": "STHLM",
1884
                                "status_id": 1,
1885
                                "status_descr": "available",
1886
                                "charge_perc": 1,
1887
                                "coords": [
1888
                                    18.02549,
1889
                                    59.34452
1890
                                ],
1891
                                "active": true
1892
                            }
1893
                        ],
1894
                        "bikeCount": 1
1895
                    }
1896
                ]
1897
            }
1898
        },
1899
    ],
1900
    login: [
1901
        {
1902
            endpoint: "/admin",
1903
            method: "POST",
1904
            description: "Login admin",
1905
            request: {
1906
                headers: {
1907
                    "x-api-key": "API Key",
1908
                },
1909
                params: {},
1910
                body: {
1911
                    username: "Admin username",
1912
                    password: "Admin password"
1913
                }
1914
            },
1915
            response: {
1916
                status: null,
1917
                description: "Object with admin data and JWT token.",
1918
                body: {
1919
                    data: {
1920
                        type: "success",
1921
                        message: "User logged in",
1922
                        user: {
1923
                            id: "Admin ID",
1924
                            role: "admin"
1925
                        },
1926
                        token: "Admin JWT token"
1927
                    }
1928
                }
1929
            }
1930
        },
1931
        {
1932
            endpoint: "/user",
1933
            method: "POST",
1934
            description: "Login user",
1935
            request: {
1936
                headers: {
1937
                    "x-api-key": "API Key",
1938
                },
1939
                params: {},
1940
                body: {
1941
                    token: "GitHub token"
1942
                }
1943
            },
1944
            response: {
1945
                status: null,
1946
                description: "Object with user data and JWT token.",
1947
                body: {
1948
                    data: {
1949
                        type: "success",
1950
                        message: "User logged in",
1951
                        user: {
1952
                            id: "User ID",
1953
                            email: "User email"
1954
                        },
1955
                        token: "User JWT token"
1956
                    }
1957
                }
1958
            }
1959
        },
1960
    ],
1961
    zones: [
1962
        {
1963
            endpoint: "",
1964
            method: "GET",
1965
            description: "Get all zones",
1966
            request: {
1967
                headers: {
1968
                    "x-api-key": "API Key",
1969
                },
1970
                params: {},
1971
                body: {}
1972
            },
1973
            response: {
1974
                status: 200,
1975
                description: "Array with zone objects.",
1976
                body: [
1977
                    {
1978
                        "id": 1,
1979
                        "zone_id": 3,
1980
                        "descr": "forbidden",
1981
                        "city_id": "STHLM",
1982
                        "geometry": {
1983
                            "coordinates": [
1984
                                [
1985
                                    [
1986
                                        18.068502264333716,
1987
                                        59.3231730630483
1988
                                    ],
1989
                                    [
1990
                                        18.068886979457517,
1991
                                        59.322819894077384
1992
                                    ],
1993
                                    [
1994
                                        18.06967157839128,
1995
                                        59.32255030139359
1996
                                    ],
1997
                                    [
1998
                                        18.071048629582293,
1999
                                        59.32269735221334
2000
                                    ],
2001
                                    [
2002
                                        18.07223353409472,
2003
                                        59.32241958901943
2004
                                    ],
2005
                                    [
2006
                                        18.072809974128347,
2007
                                        59.322092805885234
2008
                                    ],
2009
                                    [
2010
                                        18.074042915309633,
2011
                                        59.321921243481995
2012
                                    ],
2013
                                    [
2014
                                        18.07479548979822,
2015
                                        59.32297511313732
2016
                                    ],
2017
                                    [
2018
                                        18.075019974791076,
2019
                                        59.32345725774388
2020
                                    ],
2021
                                    [
2022
                                        18.07548660710907,
2023
                                        59.32483958049377
2024
                                    ],
2025
                                    [
2026
                                        18.075321027899122,
2027
                                        59.32558447555283
2028
                                    ],
2029
                                    [
2030
                                        18.072581444612837,
2031
                                        59.32786513518903
2032
                                    ],
2033
                                    [
2034
                                        18.068156053750755,
2035
                                        59.32645985525002
2036
                                    ],
2037
                                    [
2038
                                        18.066771209451673,
2039
                                        59.32563818712248
2040
                                    ],
2041
                                    [
2042
                                        18.06773457939849,
2043
                                        59.32510831583147
2044
                                    ],
2045
                                    [
2046
                                        18.067072262560714,
2047
                                        59.32410230557625
2048
                                    ],
2049
                                    [
2050
                                        18.068502264333716,
2051
                                        59.3231730630483
2052
                                    ]
2053
                                ]
2054
                            ],
2055
                            "type": "Polygon"
2056
                        },
2057
                        "speed_limit": 0
2058
                    },
2059
                ]
2060
            }
2061
        },
2062
    ]
2063
};
2064
2065
export default routesInfo;
2066