@zuplo/runtime 5.1966.0 → 5.1968.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.
package/internal.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { OpenAPIV3_1 } from 'openapi-types';
2
-
3
1
  /* Excluded from this release type: BuildEnvironment */
4
2
 
5
3
  declare interface BuildRouteConfiguration {
@@ -435,6 +433,468 @@ export declare function isZuploReadableEnvVariableName(name: string): boolean;
435
433
 
436
434
  declare type Modify<T, R> = Omit<T, keyof R> & R;
437
435
 
436
+ declare namespace OpenAPIV3 {
437
+ interface Document<T extends {} = {}> {
438
+ openapi: string;
439
+ info: InfoObject;
440
+ servers?: ServerObject[];
441
+ paths: PathsObject<T>;
442
+ components?: ComponentsObject;
443
+ security?: SecurityRequirementObject[];
444
+ tags?: TagObject[];
445
+ externalDocs?: ExternalDocumentationObject;
446
+ 'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
447
+ 'x-express-openapi-validation-strict'?: boolean;
448
+ }
449
+ interface InfoObject {
450
+ title: string;
451
+ description?: string;
452
+ termsOfService?: string;
453
+ contact?: ContactObject;
454
+ license?: LicenseObject;
455
+ version: string;
456
+ }
457
+ interface ContactObject {
458
+ name?: string;
459
+ url?: string;
460
+ email?: string;
461
+ }
462
+ interface LicenseObject {
463
+ name: string;
464
+ url?: string;
465
+ }
466
+ interface ServerObject {
467
+ url: string;
468
+ description?: string;
469
+ variables?: {
470
+ [variable: string]: ServerVariableObject;
471
+ };
472
+ }
473
+ interface ServerVariableObject {
474
+ enum?: string[];
475
+ default: string;
476
+ description?: string;
477
+ }
478
+ interface PathsObject<T extends {} = {}, P extends {} = {}> {
479
+ [pattern: string]: (PathItemObject<T> & P) | undefined;
480
+ }
481
+ enum HttpMethods {
482
+ GET = "get",
483
+ PUT = "put",
484
+ POST = "post",
485
+ DELETE = "delete",
486
+ OPTIONS = "options",
487
+ HEAD = "head",
488
+ PATCH = "patch",
489
+ TRACE = "trace"
490
+ }
491
+ type PathItemObject<T extends {} = {}> = {
492
+ $ref?: string;
493
+ summary?: string;
494
+ description?: string;
495
+ servers?: ServerObject[];
496
+ parameters?: (ReferenceObject | ParameterObject)[];
497
+ } & {
498
+ [method in HttpMethods]?: OperationObject<T>;
499
+ };
500
+ type OperationObject<T extends {} = {}> = {
501
+ tags?: string[];
502
+ summary?: string;
503
+ description?: string;
504
+ externalDocs?: ExternalDocumentationObject;
505
+ operationId?: string;
506
+ parameters?: (ReferenceObject | ParameterObject)[];
507
+ requestBody?: ReferenceObject | RequestBodyObject;
508
+ responses: ResponsesObject;
509
+ callbacks?: {
510
+ [callback: string]: ReferenceObject | CallbackObject;
511
+ };
512
+ deprecated?: boolean;
513
+ security?: SecurityRequirementObject[];
514
+ servers?: ServerObject[];
515
+ } & T;
516
+ interface ExternalDocumentationObject {
517
+ description?: string;
518
+ url: string;
519
+ }
520
+ interface ParameterObject extends ParameterBaseObject {
521
+ name: string;
522
+ in: string;
523
+ }
524
+ interface HeaderObject extends ParameterBaseObject {
525
+ }
526
+ interface ParameterBaseObject {
527
+ description?: string;
528
+ required?: boolean;
529
+ deprecated?: boolean;
530
+ allowEmptyValue?: boolean;
531
+ style?: string;
532
+ explode?: boolean;
533
+ allowReserved?: boolean;
534
+ schema?: ReferenceObject | SchemaObject;
535
+ example?: any;
536
+ examples?: {
537
+ [media: string]: ReferenceObject | ExampleObject;
538
+ };
539
+ content?: {
540
+ [media: string]: MediaTypeObject;
541
+ };
542
+ }
543
+ type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
544
+ type ArraySchemaObjectType = 'array';
545
+ type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
546
+ interface ArraySchemaObject extends BaseSchemaObject {
547
+ type: ArraySchemaObjectType;
548
+ items: ReferenceObject | SchemaObject;
549
+ }
550
+ interface NonArraySchemaObject extends BaseSchemaObject {
551
+ type?: NonArraySchemaObjectType;
552
+ }
553
+ interface BaseSchemaObject {
554
+ title?: string;
555
+ description?: string;
556
+ format?: string;
557
+ default?: any;
558
+ multipleOf?: number;
559
+ maximum?: number;
560
+ exclusiveMaximum?: boolean;
561
+ minimum?: number;
562
+ exclusiveMinimum?: boolean;
563
+ maxLength?: number;
564
+ minLength?: number;
565
+ pattern?: string;
566
+ additionalProperties?: boolean | ReferenceObject | SchemaObject;
567
+ maxItems?: number;
568
+ minItems?: number;
569
+ uniqueItems?: boolean;
570
+ maxProperties?: number;
571
+ minProperties?: number;
572
+ required?: string[];
573
+ enum?: any[];
574
+ properties?: {
575
+ [name: string]: ReferenceObject | SchemaObject;
576
+ };
577
+ allOf?: (ReferenceObject | SchemaObject)[];
578
+ oneOf?: (ReferenceObject | SchemaObject)[];
579
+ anyOf?: (ReferenceObject | SchemaObject)[];
580
+ not?: ReferenceObject | SchemaObject;
581
+ nullable?: boolean;
582
+ discriminator?: DiscriminatorObject;
583
+ readOnly?: boolean;
584
+ writeOnly?: boolean;
585
+ xml?: XMLObject;
586
+ externalDocs?: ExternalDocumentationObject;
587
+ example?: any;
588
+ deprecated?: boolean;
589
+ }
590
+ interface DiscriminatorObject {
591
+ propertyName: string;
592
+ mapping?: {
593
+ [value: string]: string;
594
+ };
595
+ }
596
+ interface XMLObject {
597
+ name?: string;
598
+ namespace?: string;
599
+ prefix?: string;
600
+ attribute?: boolean;
601
+ wrapped?: boolean;
602
+ }
603
+ interface ReferenceObject {
604
+ $ref: string;
605
+ }
606
+ interface ExampleObject {
607
+ summary?: string;
608
+ description?: string;
609
+ value?: any;
610
+ externalValue?: string;
611
+ }
612
+ interface MediaTypeObject {
613
+ schema?: ReferenceObject | SchemaObject;
614
+ example?: any;
615
+ examples?: {
616
+ [media: string]: ReferenceObject | ExampleObject;
617
+ };
618
+ encoding?: {
619
+ [media: string]: EncodingObject;
620
+ };
621
+ }
622
+ interface EncodingObject {
623
+ contentType?: string;
624
+ headers?: {
625
+ [header: string]: ReferenceObject | HeaderObject;
626
+ };
627
+ style?: string;
628
+ explode?: boolean;
629
+ allowReserved?: boolean;
630
+ }
631
+ interface RequestBodyObject {
632
+ description?: string;
633
+ content: {
634
+ [media: string]: MediaTypeObject;
635
+ };
636
+ required?: boolean;
637
+ }
638
+ interface ResponsesObject {
639
+ [code: string]: ReferenceObject | ResponseObject;
640
+ }
641
+ interface ResponseObject {
642
+ description: string;
643
+ headers?: {
644
+ [header: string]: ReferenceObject | HeaderObject;
645
+ };
646
+ content?: {
647
+ [media: string]: MediaTypeObject;
648
+ };
649
+ links?: {
650
+ [link: string]: ReferenceObject | LinkObject;
651
+ };
652
+ }
653
+ interface LinkObject {
654
+ operationRef?: string;
655
+ operationId?: string;
656
+ parameters?: {
657
+ [parameter: string]: any;
658
+ };
659
+ requestBody?: any;
660
+ description?: string;
661
+ server?: ServerObject;
662
+ }
663
+ interface CallbackObject {
664
+ [url: string]: PathItemObject;
665
+ }
666
+ interface SecurityRequirementObject {
667
+ [name: string]: string[];
668
+ }
669
+ interface ComponentsObject {
670
+ schemas?: {
671
+ [key: string]: ReferenceObject | SchemaObject;
672
+ };
673
+ responses?: {
674
+ [key: string]: ReferenceObject | ResponseObject;
675
+ };
676
+ parameters?: {
677
+ [key: string]: ReferenceObject | ParameterObject;
678
+ };
679
+ examples?: {
680
+ [key: string]: ReferenceObject | ExampleObject;
681
+ };
682
+ requestBodies?: {
683
+ [key: string]: ReferenceObject | RequestBodyObject;
684
+ };
685
+ headers?: {
686
+ [key: string]: ReferenceObject | HeaderObject;
687
+ };
688
+ securitySchemes?: {
689
+ [key: string]: ReferenceObject | SecuritySchemeObject;
690
+ };
691
+ links?: {
692
+ [key: string]: ReferenceObject | LinkObject;
693
+ };
694
+ callbacks?: {
695
+ [key: string]: ReferenceObject | CallbackObject;
696
+ };
697
+ }
698
+ type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
699
+ interface HttpSecurityScheme {
700
+ type: 'http';
701
+ description?: string;
702
+ scheme: string;
703
+ bearerFormat?: string;
704
+ }
705
+ interface ApiKeySecurityScheme {
706
+ type: 'apiKey';
707
+ description?: string;
708
+ name: string;
709
+ in: string;
710
+ }
711
+ interface OAuth2SecurityScheme {
712
+ type: 'oauth2';
713
+ description?: string;
714
+ flows: {
715
+ implicit?: {
716
+ authorizationUrl: string;
717
+ refreshUrl?: string;
718
+ scopes: {
719
+ [scope: string]: string;
720
+ };
721
+ };
722
+ password?: {
723
+ tokenUrl: string;
724
+ refreshUrl?: string;
725
+ scopes: {
726
+ [scope: string]: string;
727
+ };
728
+ };
729
+ clientCredentials?: {
730
+ tokenUrl: string;
731
+ refreshUrl?: string;
732
+ scopes: {
733
+ [scope: string]: string;
734
+ };
735
+ };
736
+ authorizationCode?: {
737
+ authorizationUrl: string;
738
+ tokenUrl: string;
739
+ refreshUrl?: string;
740
+ scopes: {
741
+ [scope: string]: string;
742
+ };
743
+ };
744
+ };
745
+ }
746
+ interface OpenIdSecurityScheme {
747
+ type: 'openIdConnect';
748
+ description?: string;
749
+ openIdConnectUrl: string;
750
+ }
751
+ interface TagObject {
752
+ name: string;
753
+ description?: string;
754
+ externalDocs?: ExternalDocumentationObject;
755
+ }
756
+ }
757
+
758
+ declare namespace OpenAPIV3_1 {
759
+ type Modify<T, R> = Omit<T, keyof R> & R;
760
+ type PathsWebhooksComponents<T extends {} = {}> = {
761
+ paths: PathsObject<T>;
762
+ webhooks: Record<string, PathItemObject | ReferenceObject>;
763
+ components: ComponentsObject;
764
+ };
765
+ type Document<T extends {} = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
766
+ info: InfoObject;
767
+ jsonSchemaDialect?: string;
768
+ servers?: ServerObject[];
769
+ } & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>))>;
770
+ type InfoObject = Modify<OpenAPIV3.InfoObject, {
771
+ summary?: string;
772
+ license?: LicenseObject;
773
+ }>;
774
+ type ContactObject = OpenAPIV3.ContactObject;
775
+ type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
776
+ identifier?: string;
777
+ }>;
778
+ type ServerObject = Modify<OpenAPIV3.ServerObject, {
779
+ url: string;
780
+ description?: string;
781
+ variables?: Record<string, ServerVariableObject>;
782
+ }>;
783
+ type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
784
+ enum?: [string, ...string[]];
785
+ }>;
786
+ type PathsObject<T extends {} = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
787
+ type HttpMethods = OpenAPIV3.HttpMethods;
788
+ type PathItemObject<T extends {} = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
789
+ servers?: ServerObject[];
790
+ parameters?: (ReferenceObject | ParameterObject)[];
791
+ }> & {
792
+ [method in HttpMethods]?: OperationObject<T>;
793
+ };
794
+ type OperationObject<T extends {} = {}> = Modify<OpenAPIV3.OperationObject<T>, {
795
+ parameters?: (ReferenceObject | ParameterObject)[];
796
+ requestBody?: ReferenceObject | RequestBodyObject;
797
+ responses?: ResponsesObject;
798
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
799
+ servers?: ServerObject[];
800
+ }> & T;
801
+ type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
802
+ type ParameterObject = OpenAPIV3.ParameterObject;
803
+ type HeaderObject = OpenAPIV3.HeaderObject;
804
+ type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
805
+ type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
806
+ type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
807
+ /**
808
+ * There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
809
+ * 'items' will be always visible as optional
810
+ * Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
811
+ */
812
+ type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject;
813
+ interface ArraySchemaObject extends BaseSchemaObject {
814
+ type: ArraySchemaObjectType;
815
+ items: ReferenceObject | SchemaObject;
816
+ }
817
+ interface NonArraySchemaObject extends BaseSchemaObject {
818
+ type?: NonArraySchemaObjectType;
819
+ }
820
+ interface MixedSchemaObject extends BaseSchemaObject {
821
+ type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
822
+ items?: ReferenceObject | SchemaObject;
823
+ }
824
+ type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
825
+ examples?: OpenAPIV3.BaseSchemaObject['example'][];
826
+ exclusiveMinimum?: boolean | number;
827
+ exclusiveMaximum?: boolean | number;
828
+ contentMediaType?: string;
829
+ $schema?: string;
830
+ additionalProperties?: boolean | ReferenceObject | SchemaObject;
831
+ properties?: {
832
+ [name: string]: ReferenceObject | SchemaObject;
833
+ };
834
+ allOf?: (ReferenceObject | SchemaObject)[];
835
+ oneOf?: (ReferenceObject | SchemaObject)[];
836
+ anyOf?: (ReferenceObject | SchemaObject)[];
837
+ not?: ReferenceObject | SchemaObject;
838
+ discriminator?: DiscriminatorObject;
839
+ externalDocs?: ExternalDocumentationObject;
840
+ xml?: XMLObject;
841
+ const?: any;
842
+ }>;
843
+ type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
844
+ type XMLObject = OpenAPIV3.XMLObject;
845
+ type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
846
+ summary?: string;
847
+ description?: string;
848
+ }>;
849
+ type ExampleObject = OpenAPIV3.ExampleObject;
850
+ type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
851
+ schema?: SchemaObject | ReferenceObject;
852
+ examples?: Record<string, ReferenceObject | ExampleObject>;
853
+ }>;
854
+ type EncodingObject = OpenAPIV3.EncodingObject;
855
+ type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
856
+ content: {
857
+ [media: string]: MediaTypeObject;
858
+ };
859
+ }>;
860
+ type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
861
+ type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
862
+ headers?: {
863
+ [header: string]: ReferenceObject | HeaderObject;
864
+ };
865
+ content?: {
866
+ [media: string]: MediaTypeObject;
867
+ };
868
+ links?: {
869
+ [link: string]: ReferenceObject | LinkObject;
870
+ };
871
+ }>;
872
+ type LinkObject = Modify<OpenAPIV3.LinkObject, {
873
+ server?: ServerObject;
874
+ }>;
875
+ type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
876
+ type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
877
+ type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
878
+ schemas?: Record<string, SchemaObject>;
879
+ responses?: Record<string, ReferenceObject | ResponseObject>;
880
+ parameters?: Record<string, ReferenceObject | ParameterObject>;
881
+ examples?: Record<string, ReferenceObject | ExampleObject>;
882
+ requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
883
+ headers?: Record<string, ReferenceObject | HeaderObject>;
884
+ securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
885
+ links?: Record<string, ReferenceObject | LinkObject>;
886
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
887
+ pathItems?: Record<string, ReferenceObject | PathItemObject>;
888
+ }>;
889
+ type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
890
+ type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
891
+ type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
892
+ type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
893
+ type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
894
+ type TagObject = OpenAPIV3.TagObject;
895
+ {};
896
+ }
897
+
438
898
  /**
439
899
  * @beta
440
900
  */