@platformatic/service 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +1 -1
  2. package/config.d.ts +450 -94
  3. package/eslint.config.js +4 -6
  4. package/index.d.ts +55 -48
  5. package/index.js +44 -179
  6. package/lib/application.js +35 -0
  7. package/lib/capability.js +281 -0
  8. package/lib/compile.js +2 -52
  9. package/lib/generator.js +426 -0
  10. package/lib/plugins/cors.js +5 -8
  11. package/lib/plugins/graphql.js +16 -14
  12. package/lib/plugins/health-check.js +6 -8
  13. package/lib/plugins/openapi.js +43 -32
  14. package/lib/plugins/plugins.js +6 -53
  15. package/lib/{root-endpoint/index.js → plugins/root.js} +9 -8
  16. package/lib/plugins/sandbox-wrapper.js +65 -63
  17. package/lib/schema.js +1075 -203
  18. package/lib/upgrade.js +6 -8
  19. package/lib/utils.js +30 -83
  20. package/lib/versions/0.16.0.js +14 -15
  21. package/lib/versions/{from-zero-twenty-eight-to-will-see.js → 0.28.0.js} +3 -6
  22. package/lib/versions/2.0.0.js +4 -7
  23. package/lib/versions/3.0.0.js +14 -0
  24. package/package.json +28 -36
  25. package/schema.json +1452 -165
  26. package/tsconfig.json +16 -6
  27. package/.c8rc +0 -6
  28. package/help/compile.txt +0 -19
  29. package/help/create.txt +0 -11
  30. package/help/help.txt +0 -8
  31. package/help/schema.txt +0 -9
  32. package/help/start.txt +0 -23
  33. package/index.test-d.ts +0 -107
  34. package/lib/create.mjs +0 -85
  35. package/lib/gen-schema.js +0 -15
  36. package/lib/gen-types.mjs +0 -38
  37. package/lib/generator/README.md +0 -31
  38. package/lib/generator/service-generator.d.ts +0 -11
  39. package/lib/generator/service-generator.js +0 -126
  40. package/lib/openapi-schema-defs.js +0 -1108
  41. package/lib/plugins/clients.js +0 -16
  42. package/lib/plugins/metrics.js +0 -244
  43. package/lib/plugins/typescript.js +0 -20
  44. package/lib/stackable.js +0 -306
  45. package/lib/start.js +0 -175
  46. package/service.mjs +0 -71
  47. /package/{lib/root-endpoint/public → public}/images/dark_mode.svg +0 -0
  48. /package/{lib/root-endpoint/public → public}/images/favicon.ico +0 -0
  49. /package/{lib/root-endpoint/public → public}/images/light_mode.svg +0 -0
  50. /package/{lib/root-endpoint/public → public}/images/platformatic-logo-dark.svg +0 -0
  51. /package/{lib/root-endpoint/public → public}/images/platformatic-logo-light.svg +0 -0
  52. /package/{lib/root-endpoint/public → public}/images/triangle_dark.svg +0 -0
  53. /package/{lib/root-endpoint/public → public}/images/triangle_light.svg +0 -0
  54. /package/{lib/root-endpoint/public → public}/index.html +0 -0
@@ -1,1108 +0,0 @@
1
- 'use strict'
2
-
3
- const $defs = {
4
- info: {
5
- $comment: 'https://spec.openapis.org/oas/v3.1.0#info-object',
6
- type: 'object',
7
- properties: {
8
- title: {
9
- type: 'string',
10
- },
11
- summary: {
12
- type: 'string',
13
- },
14
- description: {
15
- type: 'string',
16
- },
17
- termsOfService: {
18
- type: 'string',
19
- },
20
- contact: {
21
- $ref: '#/$defs/contact',
22
- },
23
- license: {
24
- $ref: '#/$defs/license',
25
- },
26
- version: {
27
- type: 'string',
28
- },
29
- },
30
- required: [
31
- 'title',
32
- 'version',
33
- ],
34
- $ref: '#/$defs/specification-extensions',
35
- },
36
- contact: {
37
- $comment: 'https://spec.openapis.org/oas/v3.1.0#contact-object',
38
- type: 'object',
39
- properties: {
40
- name: {
41
- type: 'string',
42
- },
43
- url: {
44
- type: 'string',
45
- },
46
- email: {
47
- type: 'string',
48
- },
49
- },
50
- $ref: '#/$defs/specification-extensions',
51
- },
52
- license: {
53
- $comment: 'https://spec.openapis.org/oas/v3.1.0#license-object',
54
- type: 'object',
55
- properties: {
56
- name: {
57
- type: 'string',
58
- },
59
- identifier: {
60
- type: 'string',
61
- },
62
- url: {
63
- type: 'string',
64
- },
65
- },
66
- required: [
67
- 'name',
68
- ],
69
- $ref: '#/$defs/specification-extensions',
70
- },
71
- server: {
72
- $comment: 'https://spec.openapis.org/oas/v3.1.0#server-object',
73
- type: 'object',
74
- properties: {
75
- url: {
76
- type: 'string',
77
- },
78
- description: {
79
- type: 'string',
80
- },
81
- variables: {
82
- type: 'object',
83
- additionalProperties: {
84
- $ref: '#/$defs/server-variable',
85
- },
86
- },
87
- },
88
- required: [
89
- 'url',
90
- ],
91
- $ref: '#/$defs/specification-extensions',
92
- },
93
- 'server-variable': {
94
- $comment: 'https://spec.openapis.org/oas/v3.1.0#server-variable-object',
95
- type: 'object',
96
- properties: {
97
- enum: {
98
- type: 'array',
99
- items: {
100
- type: 'string',
101
- },
102
- minItems: 1,
103
- },
104
- default: {
105
- type: 'string',
106
- },
107
- description: {
108
- type: 'string',
109
- },
110
- },
111
- required: [
112
- 'default',
113
- ],
114
- $ref: '#/$defs/specification-extensions',
115
- },
116
- components: {
117
- $comment: 'https://spec.openapis.org/oas/v3.1.0#components-object',
118
- type: 'object',
119
- properties: {
120
- schemas: {
121
- type: 'object',
122
- },
123
- responses: {
124
- type: 'object',
125
- additionalProperties: {
126
- $ref: '#/$defs/response-or-reference',
127
- },
128
- },
129
- parameters: {
130
- type: 'object',
131
- additionalProperties: {
132
- $ref: '#/$defs/parameter-or-reference',
133
- },
134
- },
135
- examples: {
136
- type: 'object',
137
- additionalProperties: {
138
- $ref: '#/$defs/example-or-reference',
139
- },
140
- },
141
- requestBodies: {
142
- type: 'object',
143
- additionalProperties: {
144
- $ref: '#/$defs/request-body-or-reference',
145
- },
146
- },
147
- headers: {
148
- type: 'object',
149
- additionalProperties: {
150
- $ref: '#/$defs/header-or-reference',
151
- },
152
- },
153
- securitySchemes: {
154
- type: 'object',
155
- additionalProperties: {
156
- $ref: '#/$defs/security-scheme-or-reference',
157
- },
158
- },
159
- links: {
160
- type: 'object',
161
- additionalProperties: {
162
- $ref: '#/$defs/link-or-reference',
163
- },
164
- },
165
- callbacks: {
166
- type: 'object',
167
- additionalProperties: {
168
- $ref: '#/$defs/callbacks-or-reference',
169
- },
170
- },
171
- pathItems: {
172
- type: 'object',
173
- additionalProperties: {
174
- $ref: '#/$defs/path-item-or-reference',
175
- },
176
- },
177
- },
178
- $ref: '#/$defs/specification-extensions',
179
- },
180
- paths: {
181
- $comment: 'https://spec.openapis.org/oas/v3.1.0#paths-object',
182
- type: 'object',
183
- patternProperties: {
184
- '^/': {
185
- $ref: '#/$defs/path-item',
186
- },
187
- },
188
- $ref: '#/$defs/specification-extensions',
189
- },
190
- 'path-item': {
191
- $comment: 'https://spec.openapis.org/oas/v3.1.0#path-item-object',
192
- type: 'object',
193
- properties: {
194
- summary: {
195
- type: 'string',
196
- },
197
- description: {
198
- type: 'string',
199
- },
200
- servers: {
201
- type: 'array',
202
- items: {
203
- $ref: '#/$defs/server',
204
- },
205
- },
206
- parameters: {
207
- type: 'array',
208
- items: {
209
- $ref: '#/$defs/parameter-or-reference',
210
- },
211
- },
212
- get: {
213
- $ref: '#/$defs/operation',
214
- },
215
- put: {
216
- $ref: '#/$defs/operation',
217
- },
218
- post: {
219
- $ref: '#/$defs/operation',
220
- },
221
- delete: {
222
- $ref: '#/$defs/operation',
223
- },
224
- options: {
225
- $ref: '#/$defs/operation',
226
- },
227
- head: {
228
- $ref: '#/$defs/operation',
229
- },
230
- patch: {
231
- $ref: '#/$defs/operation',
232
- },
233
- trace: {
234
- $ref: '#/$defs/operation',
235
- },
236
- },
237
- $ref: '#/$defs/specification-extensions',
238
- },
239
- 'path-item-or-reference': {
240
- if: {
241
- type: 'object',
242
- required: [
243
- '$ref',
244
- ],
245
- },
246
- then: {
247
- $ref: '#/$defs/reference',
248
- },
249
- else: {
250
- $ref: '#/$defs/path-item',
251
- },
252
- },
253
- operation: {
254
- $comment: 'https://spec.openapis.org/oas/v3.1.0#operation-object',
255
- type: 'object',
256
- properties: {
257
- tags: {
258
- type: 'array',
259
- items: {
260
- type: 'string',
261
- },
262
- },
263
- summary: {
264
- type: 'string',
265
- },
266
- description: {
267
- type: 'string',
268
- },
269
- externalDocs: {
270
- $ref: '#/$defs/external-documentation',
271
- },
272
- operationId: {
273
- type: 'string',
274
- },
275
- parameters: {
276
- type: 'array',
277
- items: {
278
- $ref: '#/$defs/parameter-or-reference',
279
- },
280
- },
281
- requestBody: {
282
- $ref: '#/$defs/request-body-or-reference',
283
- },
284
- responses: {
285
- $ref: '#/$defs/responses',
286
- },
287
- callbacks: {
288
- type: 'object',
289
- additionalProperties: {
290
- $ref: '#/$defs/callbacks-or-reference',
291
- },
292
- },
293
- security: {
294
- type: 'array',
295
- items: {
296
- $ref: '#/$defs/security-requirement',
297
- },
298
- },
299
- servers: {
300
- type: 'array',
301
- items: {
302
- $ref: '#/$defs/server',
303
- },
304
- },
305
- },
306
- $ref: '#/$defs/specification-extensions',
307
- },
308
- 'external-documentation': {
309
- $comment: 'https://spec.openapis.org/oas/v3.1.0#external-documentation-object',
310
- type: 'object',
311
- properties: {
312
- description: {
313
- type: 'string',
314
- },
315
- url: {
316
- type: 'string',
317
- },
318
- },
319
- required: [
320
- 'url',
321
- ],
322
- $ref: '#/$defs/specification-extensions',
323
- },
324
- parameter: {
325
- $comment: 'https://spec.openapis.org/oas/v3.1.0#parameter-object',
326
- type: 'object',
327
- properties: {
328
- name: {
329
- type: 'string',
330
- },
331
- in: {
332
- enum: [
333
- 'query',
334
- 'header',
335
- 'path',
336
- 'cookie',
337
- ],
338
- },
339
- description: {
340
- type: 'string',
341
- },
342
- required: {
343
- default: false,
344
- type: 'boolean',
345
- },
346
- content: {
347
- type: 'object',
348
- $ref: '#/$defs/content',
349
- minProperties: 1,
350
- maxProperties: 1,
351
- },
352
- },
353
- required: [
354
- 'name',
355
- 'in',
356
- ],
357
- oneOf: [
358
- {
359
- required: [
360
- 'schema',
361
- ],
362
- },
363
- {
364
- required: [
365
- 'content',
366
- ],
367
- },
368
- ],
369
- if: {
370
- type: 'object',
371
- properties: {
372
- in: {
373
- const: 'query',
374
- },
375
- },
376
- required: [
377
- 'in',
378
- ],
379
- },
380
- then: {
381
- type: 'object',
382
- properties: {
383
- allowEmptyValue: {
384
- default: false,
385
- type: 'boolean',
386
- },
387
- },
388
- },
389
- $ref: '#/$defs/specification-extensions',
390
- },
391
- 'parameter-or-reference': {
392
- if: {
393
- type: 'object',
394
- required: [
395
- '$ref',
396
- ],
397
- },
398
- then: {
399
- $ref: '#/$defs/reference',
400
- },
401
- else: {
402
- $ref: '#/$defs/parameter',
403
- },
404
- },
405
- 'request-body': {
406
- $comment: 'https://spec.openapis.org/oas/v3.1.0#request-body-object',
407
- type: 'object',
408
- properties: {
409
- description: {
410
- type: 'string',
411
- },
412
- content: {
413
- $ref: '#/$defs/content',
414
- },
415
- required: {
416
- default: false,
417
- type: 'boolean',
418
- },
419
- },
420
- required: [
421
- 'content',
422
- ],
423
- $ref: '#/$defs/specification-extensions',
424
- },
425
- 'request-body-or-reference': {
426
- if: {
427
- type: 'object',
428
- required: [
429
- '$ref',
430
- ],
431
- },
432
- then: {
433
- $ref: '#/$defs/reference',
434
- },
435
- else: {
436
- $ref: '#/$defs/request-body',
437
- },
438
- },
439
- content: {
440
- $comment: 'https://spec.openapis.org/oas/v3.1.0#fixed-fields-10',
441
- type: 'object',
442
- additionalProperties: {
443
- $ref: '#/$defs/media-type',
444
- },
445
- },
446
- 'media-type': {
447
- $comment: 'https://spec.openapis.org/oas/v3.1.0#media-type-object',
448
- type: 'object',
449
- properties: {
450
- encoding: {
451
- type: 'object',
452
- additionalProperties: {
453
- $ref: '#/$defs/encoding',
454
- },
455
- },
456
- },
457
- allOf: [
458
- {
459
- $ref: '#/$defs/specification-extensions',
460
- },
461
- {
462
- $ref: '#/$defs/examples',
463
- },
464
- ],
465
- },
466
- encoding: {
467
- $comment: 'https://spec.openapis.org/oas/v3.1.0#encoding-object',
468
- type: 'object',
469
- properties: {
470
- contentType: {
471
- type: 'string',
472
- },
473
- headers: {
474
- type: 'object',
475
- additionalProperties: {
476
- $ref: '#/$defs/header-or-reference',
477
- },
478
- },
479
- style: {
480
- default: 'form',
481
- enum: [
482
- 'form',
483
- 'spaceDelimited',
484
- 'pipeDelimited',
485
- 'deepObject',
486
- ],
487
- },
488
- explode: {
489
- type: 'boolean',
490
- },
491
- allowReserved: {
492
- default: false,
493
- type: 'boolean',
494
- },
495
- },
496
- allOf: [
497
- {
498
- $ref: '#/$defs/specification-extensions',
499
- },
500
- {
501
- $ref: '#/$defs/encoding/$defs/explode-default',
502
- },
503
- ],
504
-
505
- $defs: {
506
- 'explode-default': {
507
- if: {
508
- type: 'object',
509
- properties: {
510
- style: {
511
- const: 'form',
512
- },
513
- },
514
- required: [
515
- 'style',
516
- ],
517
- },
518
- then: {
519
- type: 'object',
520
- properties: {
521
- explode: {
522
- default: true,
523
- },
524
- },
525
- },
526
- else: {
527
- type: 'object',
528
- properties: {
529
- explode: {
530
- default: false,
531
- },
532
- },
533
- },
534
- },
535
- },
536
- },
537
- responses: {
538
- $comment: 'https://spec.openapis.org/oas/v3.1.0#responses-object',
539
- type: 'object',
540
- additionalProperties: {
541
- $ref: '#/$defs/response-or-reference',
542
- },
543
- minProperties: 1,
544
- $ref: '#/$defs/specification-extensions',
545
- },
546
- response: {
547
- $comment: 'https://spec.openapis.org/oas/v3.1.0#response-object',
548
- type: 'object',
549
- properties: {
550
- description: {
551
- type: 'string',
552
- },
553
- headers: {
554
- type: 'object',
555
- additionalProperties: {
556
- $ref: '#/$defs/header-or-reference',
557
- },
558
- },
559
- content: {
560
- $ref: '#/$defs/content',
561
- },
562
- links: {
563
- type: 'object',
564
- additionalProperties: {
565
- $ref: '#/$defs/link-or-reference',
566
- },
567
- },
568
- },
569
- required: [
570
- 'description',
571
- ],
572
- $ref: '#/$defs/specification-extensions',
573
- },
574
- 'response-or-reference': {
575
- if: {
576
- type: 'object',
577
- required: [
578
- '$ref',
579
- ],
580
- },
581
- then: {
582
- $ref: '#/$defs/reference',
583
- },
584
- else: {
585
- $ref: '#/$defs/response',
586
- },
587
- },
588
- callbacks: {
589
- $comment: 'https://spec.openapis.org/oas/v3.1.0#callback-object',
590
- type: 'object',
591
- $ref: '#/$defs/specification-extensions',
592
- additionalProperties: {
593
- $ref: '#/$defs/path-item-or-reference',
594
- },
595
- },
596
- 'callbacks-or-reference': {
597
- if: {
598
- type: 'object',
599
- required: [
600
- '$ref',
601
- ],
602
- },
603
- then: {
604
- $ref: '#/$defs/reference',
605
- },
606
- else: {
607
- $ref: '#/$defs/callbacks',
608
- },
609
- },
610
- example: {
611
- $comment: 'https://spec.openapis.org/oas/v3.1.0#example-object',
612
- type: 'object',
613
- properties: {
614
- summary: {
615
- type: 'string',
616
- },
617
- description: {
618
- type: 'string',
619
- },
620
- value: true,
621
- externalValue: {
622
- type: 'string',
623
- },
624
- },
625
- not: {
626
- required: [
627
- 'value',
628
- 'externalValue',
629
- ],
630
- },
631
- $ref: '#/$defs/specification-extensions',
632
- },
633
- 'example-or-reference': {
634
- if: {
635
- type: 'object',
636
- required: [
637
- '$ref',
638
- ],
639
- },
640
- then: {
641
- $ref: '#/$defs/reference',
642
- },
643
- else: {
644
- $ref: '#/$defs/example',
645
- },
646
- },
647
- link: {
648
- $comment: 'https://spec.openapis.org/oas/v3.1.0#link-object',
649
- type: 'object',
650
- properties: {
651
- operationRef: {
652
- type: 'string',
653
- },
654
- operationId: {
655
- type: 'string',
656
- },
657
- parameters: {
658
- $ref: '#/$defs/map-of-strings',
659
- },
660
- requestBody: true,
661
- description: {
662
- type: 'string',
663
- },
664
- body: {
665
- $ref: '#/$defs/server',
666
- },
667
- },
668
- oneOf: [
669
- {
670
- required: [
671
- 'operationRef',
672
- ],
673
- },
674
- {
675
- required: [
676
- 'operationId',
677
- ],
678
- },
679
- ],
680
- $ref: '#/$defs/specification-extensions',
681
- },
682
- 'link-or-reference': {
683
- if: {
684
- type: 'object',
685
- required: [
686
- '$ref',
687
- ],
688
- },
689
- then: {
690
- $ref: '#/$defs/reference',
691
- },
692
- else: {
693
- $ref: '#/$defs/link',
694
- },
695
- },
696
- header: {
697
- $comment: 'https://spec.openapis.org/oas/v3.1.0#header-object',
698
- type: 'object',
699
- properties: {
700
- description: {
701
- type: 'string',
702
- },
703
- required: {
704
- default: false,
705
- type: 'boolean',
706
- },
707
- content: {
708
- type: 'object',
709
- $ref: '#/$defs/content',
710
- minProperties: 1,
711
- maxProperties: 1,
712
- },
713
- },
714
- oneOf: [
715
- {
716
- required: [
717
- 'schema',
718
- ],
719
- },
720
- {
721
- required: [
722
- 'content',
723
- ],
724
- },
725
- ],
726
- $ref: '#/$defs/specification-extensions',
727
- },
728
- 'header-or-reference': {
729
- if: {
730
- type: 'object',
731
- required: [
732
- '$ref',
733
- ],
734
- },
735
- then: {
736
- $ref: '#/$defs/reference',
737
- },
738
- else: {
739
- $ref: '#/$defs/header',
740
- },
741
- },
742
- tag: {
743
- $comment: 'https://spec.openapis.org/oas/v3.1.0#tag-object',
744
- type: 'object',
745
- properties: {
746
- name: {
747
- type: 'string',
748
- },
749
- description: {
750
- type: 'string',
751
- },
752
- externalDocs: {
753
- $ref: '#/$defs/external-documentation',
754
- },
755
- },
756
- required: [
757
- 'name',
758
- ],
759
- $ref: '#/$defs/specification-extensions',
760
- },
761
- reference: {
762
- $comment: 'https://spec.openapis.org/oas/v3.1.0#reference-object',
763
- type: 'object',
764
- properties: {
765
- $ref: {
766
- type: 'string',
767
- },
768
- summary: {
769
- type: 'string',
770
- },
771
- description: {
772
- type: 'string',
773
- },
774
- },
775
- },
776
- schema: {
777
- $comment: 'https://spec.openapis.org/oas/v3.1.0#schema-object',
778
- type: [
779
- 'object',
780
- 'boolean',
781
- ],
782
- },
783
- 'security-scheme': {
784
- $comment: 'https://spec.openapis.org/oas/v3.1.0#security-scheme-object',
785
- type: 'object',
786
- properties: {
787
- type: {
788
- enum: [
789
- 'apiKey',
790
- 'http',
791
- 'mutualTLS',
792
- 'oauth2',
793
- 'openIdConnect',
794
- ],
795
- },
796
- description: {
797
- type: 'string',
798
- },
799
- },
800
- required: [
801
- 'type',
802
- ],
803
- allOf: [
804
- {
805
- $ref: '#/$defs/specification-extensions',
806
- },
807
- {
808
- $ref: '#/$defs/security-scheme/$defs/type-apikey',
809
- },
810
- {
811
- $ref: '#/$defs/security-scheme/$defs/type-http',
812
- },
813
- {
814
- $ref: '#/$defs/security-scheme/$defs/type-http-bearer',
815
- },
816
- {
817
- $ref: '#/$defs/security-scheme/$defs/type-oauth2',
818
- },
819
- {
820
- $ref: '#/$defs/security-scheme/$defs/type-oidc',
821
- },
822
- ],
823
- $defs: {
824
- 'type-apikey': {
825
- if: {
826
- type: 'object',
827
- properties: {
828
- type: {
829
- const: 'apiKey',
830
- },
831
- },
832
- required: [
833
- 'type',
834
- ],
835
- },
836
- then: {
837
- type: 'object',
838
- properties: {
839
- name: {
840
- type: 'string',
841
- },
842
- in: {
843
- enum: [
844
- 'query',
845
- 'header',
846
- 'cookie',
847
- ],
848
- },
849
- },
850
- required: [
851
- 'name',
852
- 'in',
853
- ],
854
- },
855
- },
856
- 'type-http': {
857
- if: {
858
- type: 'object',
859
- properties: {
860
- type: {
861
- const: 'http',
862
- },
863
- },
864
- required: [
865
- 'type',
866
- ],
867
- },
868
- then: {
869
- type: 'object',
870
- properties: {
871
- scheme: {
872
- type: 'string',
873
- },
874
- },
875
- required: [
876
- 'scheme',
877
- ],
878
- },
879
- },
880
- 'type-http-bearer': {
881
- if: {
882
- type: 'object',
883
- properties: {
884
- type: {
885
- const: 'http',
886
- },
887
- scheme: {
888
- type: 'string',
889
- pattern: '^[Bb][Ee][Aa][Rr][Ee][Rr]$',
890
- },
891
- },
892
- required: [
893
- 'type',
894
- 'scheme',
895
- ],
896
- },
897
- then: {
898
- type: 'object',
899
- properties: {
900
- bearerFormat: {
901
- type: 'string',
902
- },
903
- },
904
- },
905
- },
906
- 'type-oauth2': {
907
- if: {
908
- type: 'object',
909
- properties: {
910
- type: {
911
- const: 'oauth2',
912
- },
913
- },
914
- required: [
915
- 'type',
916
- ],
917
- },
918
- then: {
919
- type: 'object',
920
- properties: {
921
- flows: {
922
- $ref: '#/$defs/oauth-flows',
923
- },
924
- },
925
- required: [
926
- 'flows',
927
- ],
928
- },
929
- },
930
- 'type-oidc': {
931
- if: {
932
- type: 'object',
933
- properties: {
934
- type: {
935
- const: 'openIdConnect',
936
- },
937
- },
938
- required: [
939
- 'type',
940
- ],
941
- },
942
- then: {
943
- type: 'object',
944
- properties: {
945
- openIdConnectUrl: {
946
- type: 'string',
947
- },
948
- },
949
- required: [
950
- 'openIdConnectUrl',
951
- ],
952
- },
953
- },
954
- },
955
- },
956
- 'security-scheme-or-reference': {
957
- if: {
958
- type: 'object',
959
- required: [
960
- '$ref',
961
- ],
962
- },
963
- then: {
964
- $ref: '#/$defs/reference',
965
- },
966
- else: {
967
- $ref: '#/$defs/security-scheme',
968
- },
969
- },
970
- 'oauth-flows': {
971
- type: 'object',
972
- properties: {
973
- implicit: {
974
- $ref: '#/$defs/oauth-flows/$defs/implicit',
975
- },
976
- password: {
977
- $ref: '#/$defs/oauth-flows/$defs/password',
978
- },
979
- clientCredentials: {
980
- $ref: '#/$defs/oauth-flows/$defs/client-credentials',
981
- },
982
- authorizationCode: {
983
- $ref: '#/$defs/oauth-flows/$defs/authorization-code',
984
- },
985
- },
986
- $ref: '#/$defs/specification-extensions',
987
-
988
- $defs: {
989
- implicit: {
990
- type: 'object',
991
- properties: {
992
- authorizationUrl: {
993
- type: 'string',
994
- },
995
- refreshUrl: {
996
- type: 'string',
997
- },
998
- scopes: {
999
- $ref: '#/$defs/map-of-strings',
1000
- },
1001
- },
1002
- required: [
1003
- 'authorizationUrl',
1004
- 'scopes',
1005
- ],
1006
- $ref: '#/$defs/specification-extensions',
1007
- },
1008
- password: {
1009
- type: 'object',
1010
- properties: {
1011
- tokenUrl: {
1012
- type: 'string',
1013
- },
1014
- refreshUrl: {
1015
- type: 'string',
1016
- },
1017
- scopes: {
1018
- $ref: '#/$defs/map-of-strings',
1019
- },
1020
- },
1021
- required: [
1022
- 'tokenUrl',
1023
- 'scopes',
1024
- ],
1025
- $ref: '#/$defs/specification-extensions',
1026
- },
1027
- 'client-credentials': {
1028
- type: 'object',
1029
- properties: {
1030
- tokenUrl: {
1031
- type: 'string',
1032
- },
1033
- refreshUrl: {
1034
- type: 'string',
1035
- },
1036
- scopes: {
1037
- $ref: '#/$defs/map-of-strings',
1038
- },
1039
- },
1040
- required: [
1041
- 'tokenUrl',
1042
- 'scopes',
1043
- ],
1044
- $ref: '#/$defs/specification-extensions',
1045
- },
1046
- 'authorization-code': {
1047
- type: 'object',
1048
- properties: {
1049
- authorizationUrl: {
1050
- type: 'string',
1051
- },
1052
- tokenUrl: {
1053
- type: 'string',
1054
- },
1055
- refreshUrl: {
1056
- type: 'string',
1057
- },
1058
- scopes: {
1059
- $ref: '#/$defs/map-of-strings',
1060
- },
1061
- },
1062
- required: [
1063
- 'authorizationUrl',
1064
- 'tokenUrl',
1065
- 'scopes',
1066
- ],
1067
- $ref: '#/$defs/specification-extensions',
1068
- },
1069
- },
1070
- },
1071
- 'security-requirement': {
1072
- $comment: 'https://spec.openapis.org/oas/v3.1.0#security-requirement-object',
1073
- type: 'object',
1074
- additionalProperties: {
1075
- type: 'array',
1076
- items: {
1077
- type: 'string',
1078
- },
1079
- },
1080
- },
1081
- 'specification-extensions': {
1082
- $comment: 'https://spec.openapis.org/oas/v3.1.0#specification-extensions',
1083
- type: 'object',
1084
- patternProperties: {
1085
- '^x-': true,
1086
- },
1087
- },
1088
- examples: {
1089
- type: 'object',
1090
- properties: {
1091
- example: true,
1092
- examples: {
1093
- type: 'object',
1094
- additionalProperties: {
1095
- $ref: '#/$defs/example-or-reference',
1096
- },
1097
- },
1098
- },
1099
- },
1100
- 'map-of-strings': {
1101
- type: 'object',
1102
- additionalProperties: {
1103
- type: 'string',
1104
- },
1105
- },
1106
- }
1107
-
1108
- module.exports = $defs