@zuplo/runtime 5.1965.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/mocks.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { OpenAPIV3_1 } from 'openapi-types';
2
-
3
1
  declare interface BuildRouteConfiguration {
4
2
  path: string;
5
3
  methods: HttpMethod[];
@@ -507,6 +505,468 @@ declare interface OnResponseSendingHook {
507
505
  (response: Response, request: ZuploRequest, context: ZuploContext): Promise<Response> | Response;
508
506
  }
509
507
 
508
+ declare namespace OpenAPIV3 {
509
+ interface Document<T extends {} = {}> {
510
+ openapi: string;
511
+ info: InfoObject;
512
+ servers?: ServerObject[];
513
+ paths: PathsObject<T>;
514
+ components?: ComponentsObject;
515
+ security?: SecurityRequirementObject[];
516
+ tags?: TagObject[];
517
+ externalDocs?: ExternalDocumentationObject;
518
+ 'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
519
+ 'x-express-openapi-validation-strict'?: boolean;
520
+ }
521
+ interface InfoObject {
522
+ title: string;
523
+ description?: string;
524
+ termsOfService?: string;
525
+ contact?: ContactObject;
526
+ license?: LicenseObject;
527
+ version: string;
528
+ }
529
+ interface ContactObject {
530
+ name?: string;
531
+ url?: string;
532
+ email?: string;
533
+ }
534
+ interface LicenseObject {
535
+ name: string;
536
+ url?: string;
537
+ }
538
+ interface ServerObject {
539
+ url: string;
540
+ description?: string;
541
+ variables?: {
542
+ [variable: string]: ServerVariableObject;
543
+ };
544
+ }
545
+ interface ServerVariableObject {
546
+ enum?: string[];
547
+ default: string;
548
+ description?: string;
549
+ }
550
+ interface PathsObject<T extends {} = {}, P extends {} = {}> {
551
+ [pattern: string]: (PathItemObject<T> & P) | undefined;
552
+ }
553
+ enum HttpMethods {
554
+ GET = "get",
555
+ PUT = "put",
556
+ POST = "post",
557
+ DELETE = "delete",
558
+ OPTIONS = "options",
559
+ HEAD = "head",
560
+ PATCH = "patch",
561
+ TRACE = "trace"
562
+ }
563
+ type PathItemObject<T extends {} = {}> = {
564
+ $ref?: string;
565
+ summary?: string;
566
+ description?: string;
567
+ servers?: ServerObject[];
568
+ parameters?: (ReferenceObject | ParameterObject)[];
569
+ } & {
570
+ [method in HttpMethods]?: OperationObject<T>;
571
+ };
572
+ type OperationObject<T extends {} = {}> = {
573
+ tags?: string[];
574
+ summary?: string;
575
+ description?: string;
576
+ externalDocs?: ExternalDocumentationObject;
577
+ operationId?: string;
578
+ parameters?: (ReferenceObject | ParameterObject)[];
579
+ requestBody?: ReferenceObject | RequestBodyObject;
580
+ responses: ResponsesObject;
581
+ callbacks?: {
582
+ [callback: string]: ReferenceObject | CallbackObject;
583
+ };
584
+ deprecated?: boolean;
585
+ security?: SecurityRequirementObject[];
586
+ servers?: ServerObject[];
587
+ } & T;
588
+ interface ExternalDocumentationObject {
589
+ description?: string;
590
+ url: string;
591
+ }
592
+ interface ParameterObject extends ParameterBaseObject {
593
+ name: string;
594
+ in: string;
595
+ }
596
+ interface HeaderObject extends ParameterBaseObject {
597
+ }
598
+ interface ParameterBaseObject {
599
+ description?: string;
600
+ required?: boolean;
601
+ deprecated?: boolean;
602
+ allowEmptyValue?: boolean;
603
+ style?: string;
604
+ explode?: boolean;
605
+ allowReserved?: boolean;
606
+ schema?: ReferenceObject | SchemaObject;
607
+ example?: any;
608
+ examples?: {
609
+ [media: string]: ReferenceObject | ExampleObject;
610
+ };
611
+ content?: {
612
+ [media: string]: MediaTypeObject;
613
+ };
614
+ }
615
+ type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
616
+ type ArraySchemaObjectType = 'array';
617
+ type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
618
+ interface ArraySchemaObject extends BaseSchemaObject {
619
+ type: ArraySchemaObjectType;
620
+ items: ReferenceObject | SchemaObject;
621
+ }
622
+ interface NonArraySchemaObject extends BaseSchemaObject {
623
+ type?: NonArraySchemaObjectType;
624
+ }
625
+ interface BaseSchemaObject {
626
+ title?: string;
627
+ description?: string;
628
+ format?: string;
629
+ default?: any;
630
+ multipleOf?: number;
631
+ maximum?: number;
632
+ exclusiveMaximum?: boolean;
633
+ minimum?: number;
634
+ exclusiveMinimum?: boolean;
635
+ maxLength?: number;
636
+ minLength?: number;
637
+ pattern?: string;
638
+ additionalProperties?: boolean | ReferenceObject | SchemaObject;
639
+ maxItems?: number;
640
+ minItems?: number;
641
+ uniqueItems?: boolean;
642
+ maxProperties?: number;
643
+ minProperties?: number;
644
+ required?: string[];
645
+ enum?: any[];
646
+ properties?: {
647
+ [name: string]: ReferenceObject | SchemaObject;
648
+ };
649
+ allOf?: (ReferenceObject | SchemaObject)[];
650
+ oneOf?: (ReferenceObject | SchemaObject)[];
651
+ anyOf?: (ReferenceObject | SchemaObject)[];
652
+ not?: ReferenceObject | SchemaObject;
653
+ nullable?: boolean;
654
+ discriminator?: DiscriminatorObject;
655
+ readOnly?: boolean;
656
+ writeOnly?: boolean;
657
+ xml?: XMLObject;
658
+ externalDocs?: ExternalDocumentationObject;
659
+ example?: any;
660
+ deprecated?: boolean;
661
+ }
662
+ interface DiscriminatorObject {
663
+ propertyName: string;
664
+ mapping?: {
665
+ [value: string]: string;
666
+ };
667
+ }
668
+ interface XMLObject {
669
+ name?: string;
670
+ namespace?: string;
671
+ prefix?: string;
672
+ attribute?: boolean;
673
+ wrapped?: boolean;
674
+ }
675
+ interface ReferenceObject {
676
+ $ref: string;
677
+ }
678
+ interface ExampleObject {
679
+ summary?: string;
680
+ description?: string;
681
+ value?: any;
682
+ externalValue?: string;
683
+ }
684
+ interface MediaTypeObject {
685
+ schema?: ReferenceObject | SchemaObject;
686
+ example?: any;
687
+ examples?: {
688
+ [media: string]: ReferenceObject | ExampleObject;
689
+ };
690
+ encoding?: {
691
+ [media: string]: EncodingObject;
692
+ };
693
+ }
694
+ interface EncodingObject {
695
+ contentType?: string;
696
+ headers?: {
697
+ [header: string]: ReferenceObject | HeaderObject;
698
+ };
699
+ style?: string;
700
+ explode?: boolean;
701
+ allowReserved?: boolean;
702
+ }
703
+ interface RequestBodyObject {
704
+ description?: string;
705
+ content: {
706
+ [media: string]: MediaTypeObject;
707
+ };
708
+ required?: boolean;
709
+ }
710
+ interface ResponsesObject {
711
+ [code: string]: ReferenceObject | ResponseObject;
712
+ }
713
+ interface ResponseObject {
714
+ description: string;
715
+ headers?: {
716
+ [header: string]: ReferenceObject | HeaderObject;
717
+ };
718
+ content?: {
719
+ [media: string]: MediaTypeObject;
720
+ };
721
+ links?: {
722
+ [link: string]: ReferenceObject | LinkObject;
723
+ };
724
+ }
725
+ interface LinkObject {
726
+ operationRef?: string;
727
+ operationId?: string;
728
+ parameters?: {
729
+ [parameter: string]: any;
730
+ };
731
+ requestBody?: any;
732
+ description?: string;
733
+ server?: ServerObject;
734
+ }
735
+ interface CallbackObject {
736
+ [url: string]: PathItemObject;
737
+ }
738
+ interface SecurityRequirementObject {
739
+ [name: string]: string[];
740
+ }
741
+ interface ComponentsObject {
742
+ schemas?: {
743
+ [key: string]: ReferenceObject | SchemaObject;
744
+ };
745
+ responses?: {
746
+ [key: string]: ReferenceObject | ResponseObject;
747
+ };
748
+ parameters?: {
749
+ [key: string]: ReferenceObject | ParameterObject;
750
+ };
751
+ examples?: {
752
+ [key: string]: ReferenceObject | ExampleObject;
753
+ };
754
+ requestBodies?: {
755
+ [key: string]: ReferenceObject | RequestBodyObject;
756
+ };
757
+ headers?: {
758
+ [key: string]: ReferenceObject | HeaderObject;
759
+ };
760
+ securitySchemes?: {
761
+ [key: string]: ReferenceObject | SecuritySchemeObject;
762
+ };
763
+ links?: {
764
+ [key: string]: ReferenceObject | LinkObject;
765
+ };
766
+ callbacks?: {
767
+ [key: string]: ReferenceObject | CallbackObject;
768
+ };
769
+ }
770
+ type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
771
+ interface HttpSecurityScheme {
772
+ type: 'http';
773
+ description?: string;
774
+ scheme: string;
775
+ bearerFormat?: string;
776
+ }
777
+ interface ApiKeySecurityScheme {
778
+ type: 'apiKey';
779
+ description?: string;
780
+ name: string;
781
+ in: string;
782
+ }
783
+ interface OAuth2SecurityScheme {
784
+ type: 'oauth2';
785
+ description?: string;
786
+ flows: {
787
+ implicit?: {
788
+ authorizationUrl: string;
789
+ refreshUrl?: string;
790
+ scopes: {
791
+ [scope: string]: string;
792
+ };
793
+ };
794
+ password?: {
795
+ tokenUrl: string;
796
+ refreshUrl?: string;
797
+ scopes: {
798
+ [scope: string]: string;
799
+ };
800
+ };
801
+ clientCredentials?: {
802
+ tokenUrl: string;
803
+ refreshUrl?: string;
804
+ scopes: {
805
+ [scope: string]: string;
806
+ };
807
+ };
808
+ authorizationCode?: {
809
+ authorizationUrl: string;
810
+ tokenUrl: string;
811
+ refreshUrl?: string;
812
+ scopes: {
813
+ [scope: string]: string;
814
+ };
815
+ };
816
+ };
817
+ }
818
+ interface OpenIdSecurityScheme {
819
+ type: 'openIdConnect';
820
+ description?: string;
821
+ openIdConnectUrl: string;
822
+ }
823
+ interface TagObject {
824
+ name: string;
825
+ description?: string;
826
+ externalDocs?: ExternalDocumentationObject;
827
+ }
828
+ }
829
+
830
+ declare namespace OpenAPIV3_1 {
831
+ type Modify<T, R> = Omit<T, keyof R> & R;
832
+ type PathsWebhooksComponents<T extends {} = {}> = {
833
+ paths: PathsObject<T>;
834
+ webhooks: Record<string, PathItemObject | ReferenceObject>;
835
+ components: ComponentsObject;
836
+ };
837
+ type Document<T extends {} = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
838
+ info: InfoObject;
839
+ jsonSchemaDialect?: string;
840
+ servers?: ServerObject[];
841
+ } & ((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'>))>;
842
+ type InfoObject = Modify<OpenAPIV3.InfoObject, {
843
+ summary?: string;
844
+ license?: LicenseObject;
845
+ }>;
846
+ type ContactObject = OpenAPIV3.ContactObject;
847
+ type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
848
+ identifier?: string;
849
+ }>;
850
+ type ServerObject = Modify<OpenAPIV3.ServerObject, {
851
+ url: string;
852
+ description?: string;
853
+ variables?: Record<string, ServerVariableObject>;
854
+ }>;
855
+ type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
856
+ enum?: [string, ...string[]];
857
+ }>;
858
+ type PathsObject<T extends {} = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
859
+ type HttpMethods = OpenAPIV3.HttpMethods;
860
+ type PathItemObject<T extends {} = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
861
+ servers?: ServerObject[];
862
+ parameters?: (ReferenceObject | ParameterObject)[];
863
+ }> & {
864
+ [method in HttpMethods]?: OperationObject<T>;
865
+ };
866
+ type OperationObject<T extends {} = {}> = Modify<OpenAPIV3.OperationObject<T>, {
867
+ parameters?: (ReferenceObject | ParameterObject)[];
868
+ requestBody?: ReferenceObject | RequestBodyObject;
869
+ responses?: ResponsesObject;
870
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
871
+ servers?: ServerObject[];
872
+ }> & T;
873
+ type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
874
+ type ParameterObject = OpenAPIV3.ParameterObject;
875
+ type HeaderObject = OpenAPIV3.HeaderObject;
876
+ type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
877
+ type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
878
+ type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
879
+ /**
880
+ * There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
881
+ * 'items' will be always visible as optional
882
+ * Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
883
+ */
884
+ type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject;
885
+ interface ArraySchemaObject extends BaseSchemaObject {
886
+ type: ArraySchemaObjectType;
887
+ items: ReferenceObject | SchemaObject;
888
+ }
889
+ interface NonArraySchemaObject extends BaseSchemaObject {
890
+ type?: NonArraySchemaObjectType;
891
+ }
892
+ interface MixedSchemaObject extends BaseSchemaObject {
893
+ type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
894
+ items?: ReferenceObject | SchemaObject;
895
+ }
896
+ type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
897
+ examples?: OpenAPIV3.BaseSchemaObject['example'][];
898
+ exclusiveMinimum?: boolean | number;
899
+ exclusiveMaximum?: boolean | number;
900
+ contentMediaType?: string;
901
+ $schema?: string;
902
+ additionalProperties?: boolean | ReferenceObject | SchemaObject;
903
+ properties?: {
904
+ [name: string]: ReferenceObject | SchemaObject;
905
+ };
906
+ allOf?: (ReferenceObject | SchemaObject)[];
907
+ oneOf?: (ReferenceObject | SchemaObject)[];
908
+ anyOf?: (ReferenceObject | SchemaObject)[];
909
+ not?: ReferenceObject | SchemaObject;
910
+ discriminator?: DiscriminatorObject;
911
+ externalDocs?: ExternalDocumentationObject;
912
+ xml?: XMLObject;
913
+ const?: any;
914
+ }>;
915
+ type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
916
+ type XMLObject = OpenAPIV3.XMLObject;
917
+ type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
918
+ summary?: string;
919
+ description?: string;
920
+ }>;
921
+ type ExampleObject = OpenAPIV3.ExampleObject;
922
+ type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
923
+ schema?: SchemaObject | ReferenceObject;
924
+ examples?: Record<string, ReferenceObject | ExampleObject>;
925
+ }>;
926
+ type EncodingObject = OpenAPIV3.EncodingObject;
927
+ type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
928
+ content: {
929
+ [media: string]: MediaTypeObject;
930
+ };
931
+ }>;
932
+ type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
933
+ type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
934
+ headers?: {
935
+ [header: string]: ReferenceObject | HeaderObject;
936
+ };
937
+ content?: {
938
+ [media: string]: MediaTypeObject;
939
+ };
940
+ links?: {
941
+ [link: string]: ReferenceObject | LinkObject;
942
+ };
943
+ }>;
944
+ type LinkObject = Modify<OpenAPIV3.LinkObject, {
945
+ server?: ServerObject;
946
+ }>;
947
+ type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
948
+ type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
949
+ type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
950
+ schemas?: Record<string, SchemaObject>;
951
+ responses?: Record<string, ReferenceObject | ResponseObject>;
952
+ parameters?: Record<string, ReferenceObject | ParameterObject>;
953
+ examples?: Record<string, ReferenceObject | ExampleObject>;
954
+ requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
955
+ headers?: Record<string, ReferenceObject | HeaderObject>;
956
+ securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
957
+ links?: Record<string, ReferenceObject | LinkObject>;
958
+ callbacks?: Record<string, ReferenceObject | CallbackObject>;
959
+ pathItems?: Record<string, ReferenceObject | PathItemObject>;
960
+ }>;
961
+ type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
962
+ type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
963
+ type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
964
+ type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
965
+ type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
966
+ type TagObject = OpenAPIV3.TagObject;
967
+ {};
968
+ }
969
+
510
970
  /**
511
971
  * @beta
512
972
  */
@@ -593,7 +1053,12 @@ declare interface RouteConfiguration extends Omit<BuildRouteConfiguration, "raw"
593
1053
 
594
1054
  declare type UserDataDefault = any;
595
1055
 
596
- /* Excluded from this release type: WaitUntilFunc */
1056
+ /**
1057
+ * @public
1058
+ */
1059
+ declare interface WaitUntilFunc {
1060
+ (promise: Promise<any>): void;
1061
+ }
597
1062
 
598
1063
  /**
599
1064
  * @beta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
- "version": "5.1965.0",
3
+ "version": "5.1968.0",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "exports": {