-
Notifications
You must be signed in to change notification settings - Fork 2
/
spec.yml
872 lines (858 loc) · 42.8 KB
/
spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
---
openapi: 3.0.2
info:
title: ECE 461 - Spring 2023 - Project 2
version: 2.3.5
description: "API for ECE 461/Spring 2023/Project 2: A Trustworthy Module Registry"
termsOfService: http://swagger.io/terms/
contact:
name: Prof. Davis
url: http://davisjam.github.io
email: davisjam@purdue.edu
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://ece461-project2-2shruw53aq-uc.a.run.app
paths:
/packages:
post:
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PackageQuery'
required: true
parameters:
- name: offset
description: "Provide this for pagination. If not provided, returns the first\
\ page of results."
schema:
$ref: '#/components/schemas/EnumerateOffset'
in: query
required: false
responses:
"200":
headers:
offset:
schema:
$ref: '#/components/schemas/EnumerateOffset'
examples:
ExampleRequest:
value: "3"
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PackageMetadata'
examples:
ExampleResponse:
value:
- Version: 1.2.3
Name: Underscore
ID: underscore
- Version: 1.2.3-2.1.0
Name: Lodash
ID: lodash
- Version: ^1.2.3
Name: React
ID: react
description: List of packages
"400":
description: "There is missing field(s) in the PackageQuery/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"413":
description: Too many packages returned.
operationId: PackagesList
summary: Get the packages from the registry.
description: |-
Get any packages fitting the query.
Search for packages satisfying the indicated query.
If you want to enumerate all packages, provide an array with a single PackageQuery whose name is "*".
The response is paginated; the response header includes the offset to use in the next query.
parameters:
- name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/reset:
delete:
responses:
"200":
description: Registry is reset.
"400":
description: "There is missing field(s) in the AuthenticationToken or it\
\ is formed improperly, or the AuthenticationToken is invalid."
"401":
description: You do not have permission to reset the registry.
operationId: RegistryReset
summary: Reset the registry
description: Reset the registry to a system default state.
parameters:
- name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/package/{id}:
get:
parameters:
- name: id
description: ID of package to fetch
schema:
$ref: '#/components/schemas/PackageID'
in: path
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Package'
examples:
ExampleResponse:
value:
metadata:
Name: Underscore
Version: 1.0.0
ID: underscore
data:
Content: UEsDBBQAAAAAADZVaVMAAAAAAAAAAAAAAAAFACAAdXVpZC9VVA0AB7iWimG4lophuJaKYXV4CwABBPcBAAAEFAAAAFBLAwQUAAgACAAkVWlTAAAAAAAAAAB6AQAAFg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i1NlqncOgyVBmZCC0IdN4oT5ozE49ZuQy45L/VQn3rCuCn1sDkjp4y1lp+PT3gCNW+Re9nWHjbvm/azhzjVNvfdSBpwugfiSBpgu4TgZOY+iJtCYyByjotCEAtFSQYFiS4N0AhJrFDuuCTB6UR86oAFI5/RU/PiZDQyPTDy6V5QMLLU2nahvbju3rb7DXzwQFhBPqh7b1BWJmMTiMYSQjkqabLvDeKOccENcGJmJHAvbq0ykEdlaahxhBQ6UOMOUsSqcj4f1uHwTzlGUDu5k8A87HnyqKgu7PM0bCSPURwKuUxzV2pipXTMSg50GGvBmDYl1ioPam83vkEUlI7Glj2kbLB0MHPlWbE0axs0L5JxDESjB2eOuoRhowdHcQuWVcqRzFrusMMY0E0yowiF9CCEyY6C/YyeZD4WbWHc5Id0TvkpP9QrK2uwELLdGgqAamViJVtD+oxFQYzvaJx0byyiN/ISCtSEUmIwziBuc22BuNnCKfBMsBBVpZHSgolcJqBWC8fqy80KtBw1HBqAHZwo+KWFP+B0A3kZmFO3h8Bax50kN65ANB4zyzJJkwAhHHMUt7m0hjFlC0Fz650Uc2C+jnIhKcl9P+mo45oMVCA61CH5eXUIW2SP/oEP/SN7pg75y/JpmTCyX2CuxgeWigTW0zO0tv2y8TVlPwjdA6eUKx9qe2SqTjfbFoqWQJNBqYennPv1I6eOpAPI8hxdPQAA6ar31U3T28iOQ66K7HWg7qAo0E8oceqhaBl8A7ltHRJ7LIcOyLp39UeCbutJPf9DWOWAZw/+FIn6uHC3bLYr420QzFFFVr9AV/7KRp6ESh9oG9t4FnK/bMI+5mPOPd7EVJugnWwrWXv+P0c/Rzbmw7YHM46NND8tLG81UOInTZc7W9t
JSProgram: |
if (process.argv.length === 7) {
console.log('Success')
process.exit(0)
} else {
console.log('Failed')
process.exit(1)
}
ExampleResponse2:
value:
metadata:
Name: Underscore
Version: 1.0.0
ID: underscore
data:
Content: UEsDBBQAAAAAADZVaVMAAAAAAAAAAAAAAAAFACAAdXVpZC9VVA0AB7iWimG4lophu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7YP8PEEdyvYF46hsEoPv9uysE29Gfu15CEHRWT/UBSSe0JDY4LLa6yJL9YxAHYi1NlqncOgyVBmZCC0IdN4oT5ozE49ZuQy45L/VQn3rCuCn1sDkjp4y1lp+PT3gCNW+Re9nWHjbvm/azhzjVNvfdSBpwugfiSBpgu4TgZOY+iJtCYyByjotCEAtFSQYFiS4N0AhJrFDuuCTB6UR86oAFI5/RU/PiZDQyPTDy6V5QMLLU2nahvbju3rb7DXzwQFhBPqh7b1BWJmMTiMYSQjkqabLvDeKOccENcGJmJHAvbq0ykEdlaahxhBQ6UOMOUsSqcj4f1uHwTzlGUDu5k8A87HnyqKgu7PM0bCSPURwKuUxzV2pipXTMSg50GGvBmDYl1ioPam83vkEUlI7Glj2kbLB0MHPlWbE0axs0L5JxDESjB2eOuoRhowdHcQuWVcqRzFrusMMY0E0yowiF9CCEyY6C/YyeZD4WbWHc5Id0TvkpP9QrK2uwELLdGgqAamViJVtD+oxFQYzvaJx0byyiN/ISCtSEUmIwziBuc22BuNnCKfBMsBBVpZHSgolcJqBWC8fqy80KtBw1HBqAHZwo+KWFP+B0A3kZmFO3h8Bax50kN65ANB4zyzJJkwAhHHMUt7m0hjFlC0Fz650Uc2C+jnIhKcl9P+mo45oMVCA61CH5eXUIW2SP/oEP/SN7pg75y/JpmTCyX2CuxgeWigTW0zO0tv2y8TVlPwjdA6eUKx9qe2SqTjfbFoqWQJNBqYennPv1I6eOpAPI8hxdPQAA6ar31U3T28iOQ66K7HWg7qAo0E8oceqhaBl8A7ltHRJ7LIcOyLp39UeCbutJPf9DWOWAZw/+FIn6uHC3bLYr420QzFFFVr9AV/7KRp6ESh9oG9t4FnK/bMI+5mPOPd7EVJugnWwrWXv+P0c/Rzbmw7YHM46NND8tLG81UOInTZc7W9t
URL: https://github.com/jashkenas/underscore
JSProgram: |
if (process.argv.length === 7) {
console.log('Success')
process.exit(0)
} else {
console.log('Failed')
process.exit(1)
}
description: Return the package. Content is required.
"400":
description: "There is missing field(s) in the PackageID/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package does not exist.
operationId: PackageRetrieve
summary: Interact with the package with this ID
description: Return this package.
put:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Package'
required: true
parameters:
- name: id
description: ""
schema:
$ref: '#/components/schemas/PackageID'
in: path
required: true
responses:
"200":
description: Version is updated.
"400":
description: "There is missing field(s) in the PackageID/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package does not exist.
operationId: PackageUpdate
summary: Update this content of the package.
description: |-
The name, version, and ID must match.
The package contents (from PackageData) will replace the previous contents.
delete:
parameters:
- name: id
description: Package ID
schema:
$ref: '#/components/schemas/PackageID'
in: path
required: true
responses:
"200":
description: Package is deleted.
"400":
description: "There is missing field(s) in the PackageID/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package does not exist.
operationId: PackageDelete
summary: Delete this version of the package.
parameters:
- examples:
ExampleID:
value: underscore
name: id
description: Package ID
schema:
$ref: '#/components/schemas/PackageID'
in: path
required: true
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/package:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PackageData'
examples:
ExampleRequestWithContent:
value:
Content: UEsDBBQAAAAAAA9DQlMAAAAAAAAAAAAAAAALACAAZXhjZXB0aW9ucy9VVA0AB35PWGF+T1hhfk9YYXV4CwABBPcBAAAEFAAAAFBLAwQUAAgACACqMCJTAAAAAAAAAABNAQAAJAAgAGV4Y2VwdGlvbnMvQ29tbWNvdXJpZXJFeGNlcHRpb24uamF2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qUkbTRpOME//JuerZ08yFrofAeKxEu7xMNc5QQ6XxRBXDjsI6AmMQ+NL2RRAF7FvaE96LQHMDZb2X2TA8yFM+ubnXhvnt7ptA3YNJBYUa6MVlwZ6Rx/hhxQqzNl7usayCAnx89St93+nn8zxv2Y/jbexoNz4nh2ai16eQBE76Td/ZkJNE42hFEnxKEeB61m9G+7k+B3PIdqkIvG8Ylk7EZ4XYvR6KGpGGpX0nHaoq3y0aQR6lEQqMR82IQoi1RSJzGTJD81bWfgFOq2YhTwE97/xsQ8SZZJIyE2QK9WSaO/IF2Ac/4fiMZB+MiO7AdQSwcIIu3xZlgBAAAZAwAAUEsBAhQDFAAAAAAAD0NCUwAAAAAAAAAAAAAAAAsAIAAAAAAAAAAAAO1BAAAAAGV4Y2VwdGlvbnMvVVQNAAd+T1hhfk9YYX5PWGF1eAsAAQT3AQAABBQAAABQSwECFAMUAAgACACqMCJT4Rfj66IAAABNAQAAJAAgAAAAAAAAAAAApIFJAAAAZXhjZXB0aW9ucy9Db21tY291cmllckV4Y2VwdGlvbi5qYXZhVVQNAAfgoTBh4aEwYeChMGF1eAsAAQT3AQAABBQAAABQSwECFAMUAAgACACqMCJTlfA84wYBAAB9AgAAKgAgAAAAAAAAAAAApIFdAQAAZXhjZXB0aW9ucy9Db21tY291cmllckV4Y2VwdGlvbk1hcHBlci5qYXZhVVQNAAfgoTBh4aEwYeChMGF1eAsAAQT3AQAABBQAAABQSwECFAMUAAgACAAPQ0JTIu3xZlgBAAAZAwAAJgAgAAAAAAAAAAAApIHbAgAAZXhjZXB0aW9ucy9HZW5lcmljRXhjZXB0aW9uTWFwcGVyLmphdmFVVA0AB35PWGF/T1hhfk9YYXV4CwABBPcBAAAEFAAAAFBLBQYAAAAABAAEALcBAACnBAAAAAA=
JSProgram: |
if (process.argv.length === 7) {
console.log('Success')
process.exit(0)
} else {
console.log('Failed')
process.exit(1)
}
ExampleRequestWithURL:
value:
JSProgram: |
if (process.argv.length === 7) {
console.log('Success')
process.exit(0)
} else {
console.log('Failed')
process.exit(1)
}
URL: https://github.com/jashkenas/underscore
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/Package'
examples:
ExampleResponse:
value:
metadata:
Name: Underscore
Version: 1.0.0
ID: underscore
data:
Content: UEsDBBQAAAAAAA9DQlMAAAAAAAAAAAAAAAALACAAZXhjZXB0aW9ucy9VVA0AB35PWGF+T1hhfk9YYXV4CwABBPcBAAAEFAAAAFBLAwQUAAgACACqMCJTAAAAAAAAAABNAQAAJAAgAGV4Y2VwdGlvbnMvQ29tbWNvdXJpZXJFeGNlcHRpb24uamF2YVVUDQAH4KEwYeGhMGHgoTBhdXgLAAEE9wEAAAQUAAAAdY7NCoMwDMfvfYoct0tfQAYDGbv7BrVmW9DaksQhDN99BSc65gKBwP/jl+R86+4IPgabN/g4MCFbHD0mpdhLYQyFFFl/PIyijpVuzqvYCiVlO5axwWKJdDHUsbVXVEXOTef5MmmoO/LgOycC5dp5WbCAo2LfCFRDrxRwFV7GQJ7E9HSKsMUCf/0w+2bSHuPwN3vMFPiMPkjsVoTTHmcyk3kDUEsHCOEX4+uiAAAATQEAAFBLAwQUAAgACACqMCJTAAAAAAAAAAB9AgAAKgAgAGV4Y2VwdGlvbnMvQ29tbWNvdXJpZXJFeGNlcHRpb25NYXBwZXIuamF2YVVUDQAH4KEwYeGhMGHgoTBhdXgLAAEE9wEAAAQUAAAAdVHNTsMwDL7nKXzcJOQXKKCJwYEDAiHxACY1U0bbRI7bVUJ7d7JCtrbbIkVx4u/HdgLZb9owWF9j2rX1rTgW5N5yUOebWBjj6uBFzzDCUUnUfZHViA8U+Z1jSBQurlFadZVTxxEz9CO9jDy21FGPrtmyVXwejmKa20WUmESF8cxujOBe8Sl38UIhsFzFvYnvXHkAmFWOTWg/K2fBVhQjrE9NzEQhaVZcc6MRZqnbS6x7+DEG0lr9tTfEk2mAzGYzoF87FkmFDbf/2jIN1OdwcckTuF9m28Ma/9XRDe6g4d0kt1gWJ5KwttJ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h4aEwYeChMGF1eAsAAQT3AQAABBQAAABQSwECFAMUAAgACAAPQ0JTIu3xZlgBAAAZAwAAJgAgAAAAAAAAAAAApIHbAgAAZXhjZXB0aW9ucy9HZW5lcmljRXhjZXB0aW9uTWFwcGVyLmphdmFVVA0AB35PWGF/T1hhfk9YYXV4CwABBPcBAAAEFAAAAFBLBQYAAAAABAAEALcBAACnBAAAAAA=
JSProgram: |
if (process.argv.length === 7) {
console.log('Success')
process.exit(0)
} else {
console.log('Failed')
process.exit(1)
}
description: Success. Check the ID in the returned metadata for the official
ID.
"400":
description: "There is missing field(s) in the PackageData/AuthenticationToken\
\ or it is formed improperly (e.g. Content and URL are both set), or the\
\ AuthenticationToken is invalid."
"409":
description: Package exists already.
"424":
description: Package is not uploaded due to the disqualified rating.
operationId: PackageCreate
parameters:
- name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/package/{id}/rate:
get:
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/PackageRating'
description: Return the rating. Only use this if each metric was computed
successfully.
"400":
description: "There is missing field(s) in the PackageID/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package does not exist.
"500":
description: The package rating system choked on at least one of the metrics.
operationId: PackageRate
parameters:
- name: id
schema:
$ref: '#/components/schemas/PackageID'
in: path
required: true
- name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/authenticate:
summary: Authenticate this user -- get an access token.
description: |-
If your system supports the authentication scheme described in the spec, then:
1. The obtained token should be provided to the other endpoints via the "X-Authorization" header.
2. The "Authorization" header is *required* in your system.
Otherwise, this endpoint should return HTTP 501 "Not implemented", and the "X-Authorization" header should be unused for the other endpoints.
put:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AuthenticationRequest'
examples:
ExampleRequest:
value:
User:
name: ece30861defaultadminuser
isAdmin: true
Secret:
password: correcthorsebatterystaple123(!__+@**(A'"`;DROP TABLE packages;
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/AuthenticationToken'
examples:
ExampleResponse:
value: '"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"'
description: Return an AuthenticationToken.
"400":
description: There is missing field(s) in the AuthenticationRequest or it
is formed improperly.
"401":
description: The user or password is invalid.
"501":
description: This system does not support authentication.
operationId: CreateAuthToken
description: Create an access token.
/package/byName/{name}:
get:
parameters:
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PackageHistoryEntry'
examples:
zaza:
value:
- User:
name: James Davis
isAdmin: true
Date: 2023-03-23T23:11:15Z
PackageMetadata:
Name: Underscore
Version: 1.0.0
ID: underscore
Action: DOWNLOAD
- User:
name: James Davis
isAdmin: true
Date: 2023-03-22T23:06:25Z
PackageMetadata:
Name: Underscore
Version: 1.0.0
ID: underscore
Action: UPDATE
- User:
name: James Davis
isAdmin: true
Date: 2023-03-21T22:59:40Z
PackageMetadata:
Name: Underscore
Version: 1.0.0
ID: underscore
Action: RATE
- User:
name: James Davis
isAdmin: true
Date: 2023-03-20T22:45:31Z
PackageMetadata:
Name: Underscore
Version: 1.0.0
ID: underscore
Action: CREATE
description: Return the package history.
"400":
description: "There is missing field(s) in the PackageName/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: No such package.
operationId: PackageByNameGet
description: Return the history of this package (all versions).
delete:
parameters:
- name: name
schema:
$ref: '#/components/schemas/PackageName'
in: path
required: true
responses:
"200":
description: Package is deleted.
"400":
description: "There is missing field(s) in the PackageName/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package does not exist.
operationId: PackageByNameDelete
summary: Delete all versions of this package.
parameters:
- examples:
ExampleName:
value: Underscore
name: name
schema:
$ref: '#/components/schemas/PackageName'
in: path
required: true
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/package/byRegEx:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PackageRegEx'
examples:
ExampleRegEx:
value:
RegEx: .*?Underscore.*
required: true
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PackageMetadata'
examples:
ExampleResponse:
value:
- Version: 1.2.3
Name: Underscore
- Version: 1.2.3-2.1.0
Name: Lodash
- Version: ^1.2.3
Name: React
description: Return a list of packages.
"400":
description: "There is missing field(s) in the PackageRegEx/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: No package found under this regex.
operationId: PackageByRegExGet
summary: Get any packages fitting the regular expression.
description: Search for a package using regular expression over package names
and READMEs. This is similar to search by name.
parameters:
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/package/review:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PackageReviewEntry'
responses:
"200":
description: Package review is created.
"400":
description: "There is missing field(s) in the PackageReviewEntry/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
delete:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PackageReviewQuery'
examples:
ExampleReview:
value:
packageName: Underscore
userName: "James Davis"
responses:
"200":
description: Package review is deleted.
"400":
description: "There is missing field(s) in the PackageName/AuthenticationToken\
\ or it is formed improperly, or the AuthenticationToken is invalid."
"404":
description: Package review does not exist.
operationId: PackageDeleteHistory
summary: Delete all reviews of this package.
parameters:
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
/popularity/{name}:
get:
parameters:
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
responses:
"200":
content:
application/json:
schema:
type: number
examples:
ExampleResponse:
value: 1.5
description: Return the popularity of a package.
"404":
description: Package does not exist.
parameters:
- examples:
ExampleName:
value: Underscore
name: name
schema:
$ref: '#/components/schemas/PackageName'
in: path
required: true
- examples:
ExampleToken:
value: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
name: X-Authorization
description: ""
schema:
$ref: '#/components/schemas/AuthenticationToken'
in: header
required: true
components:
schemas:
Package:
required:
- metadata
- data
type: object
properties:
metadata:
$ref: '#/components/schemas/PackageMetadata'
description: ""
data:
$ref: '#/components/schemas/PackageData'
description: ""
PackageMetadata:
description: |-
The "Name" and "Version" are used as a unique identifier pair when uploading a package.
The "ID" is used as an internal identifier for interacting with existing packages.
required:
- Name
- Version
- ID
type: object
properties:
Name:
$ref: '#/components/schemas/PackageName'
description: Package name
example: my-package
Version:
description: Package version
type: string
example: 1.2.3
ID:
$ref: '#/components/schemas/PackageID'
description: "Unique ID for use with the /package/{id} endpoint."
example: "123567192081501"
PackageData:
description: |-
This is a "union" type.
- On package upload, either Content or URL should be set. If both are set, returns 400.
- On package update, exactly one field should be set.
- On download, the Content field should be set.
type: object
properties:
Content:
description: |-
Package contents. This is the zip file uploaded by the user. (Encoded as text using a Base64 encoding).
This will be a zipped version of an npm package's GitHub repository, minus the ".git/" directory." It will, for example, include the "package.json" file that can be used to retrieve the project homepage.
See https://docs.npmjs.com/cli/v7/configuring-npm/package-json#homepage.
type: string
URL:
description: Package URL (for use in public ingest).
type: string
JSProgram:
description: A JavaScript program (for use with sensitive modules).
type: string
User:
description: ""
required:
- name
- isAdmin
type: object
properties:
name:
description: ""
type: string
example: Alfalfa
isAdmin:
description: Is this user an admin?
type: boolean
UserAuthenticationInfo:
description: Authentication info for a user
required:
- password
type: object
properties:
password:
description: "Password for a user. Per the spec, this should be a \"strong\"\
\ password."
type: string
PackageID:
description: ""
type: string
PackageRating:
description: |-
Package rating (cf. Project 1).
If the Project 1 that you inherited does not support one or more of the original properties, denote this with the value "-1".
required:
- RampUp
- Correctness
- BusFactor
- ResponsiveMaintainer
- LicenseScore
- GoodPinningPractice
- PullRequest
- NetScore
type: object
properties:
BusFactor:
format: double
description: ""
type: number
Correctness:
format: double
description: ""
type: number
RampUp:
format: double
description: ""
type: number
ResponsiveMaintainer:
format: double
description: ""
type: number
LicenseScore:
format: double
description: ""
type: number
GoodPinningPractice:
format: double
description: "The fraction of its dependencies that are pinned to at least\
\ a specific major+minor version, e.g. version 2.3.X of a package. (If\
\ there are zero dependencies, they should receive a 1.0 rating. If there\
\ are two dependencies, one pinned to this degree, then they should receive\
\ a ½ = 0.5 rating)."
type: number
PullRequest:
format: double
description: The fraction of project code that was introduced through pull
requests with a code review.
type: number
NetScore:
format: double
description: Scores calculated from other seven metrics.
type: number
PackageHistoryEntry:
description: One entry of the history of this package.
required:
- User
- Date
- PackageMetadata
- Action
type: object
properties:
User:
$ref: '#/components/schemas/User'
description: ""
Date:
format: date-time
description: Date of activity using ISO-8601 Datetime standard in UTC format.
type: string
example: 2023-03-23T23:11:15Z
PackageMetadata:
$ref: '#/components/schemas/PackageMetadata'
description: ""
Action:
description: ""
enum:
- CREATE
- UPDATE
- DOWNLOAD
- RATE
type: string
PackageName:
description: |-
Name of a package.
- Names should only use typical "keyboard" characters.
- The name "*" is reserved. See the `/packages` API for its meaning.
type: string
AuthenticationToken:
description: "The spec permits you to use any token format you like. You could,\
\ for example, look into JSON Web Tokens (\"JWT\", pronounced \"jots\"): https://jwt.io."
type: string
AuthenticationRequest:
description: ""
required:
- User
- Secret
type: object
properties:
User:
$ref: '#/components/schemas/User'
description: ""
Secret:
$ref: '#/components/schemas/UserAuthenticationInfo'
description: ""
SemverRange:
description: ""
type: string
example: |-
Exact (1.2.3)
Bounded range (1.2.3-2.1.0)
Carat (^1.2.3)
Tilde (~1.2.0)
PackageQuery:
description: ""
required:
- Name
type: object
properties:
Version:
$ref: '#/components/schemas/SemverRange'
description: ""
Name:
$ref: '#/components/schemas/PackageName'
description: ""
EnumerateOffset:
description: Offset in pagination.
type: string
example: "1"
PackageRegEx:
description: ""
required:
- RegEx
type: object
properties:
RegEx:
description: A regular expression over package names and READMEs that is
used for searching for a package
type: string
PackageReviewEntry:
description: "*"
required:
- userName
- stars
- review
- packageName
type: object
properties:
userName:
description: "name"
type: string
stars:
description: "number of stars for the package"
type: string
review:
description: "review for the package"
type: string
packageName:
description: "name of the package"
type: string
PackageReviewQuery:
description: "*"
required:
- packageName
- userName
type: object
properties:
packageName:
description: "name of the package"
type: string
userName:
description: "name of the user"
type: string