@tsed/openspec 8.0.1 → 8.0.2

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 (38) hide show
  1. package/package.json +4 -3
  2. package/src/common/OpenSpecExternalDocs.ts +10 -0
  3. package/src/common/OpenSpecHash.ts +1 -0
  4. package/src/common/OpenSpecInfo.ts +52 -0
  5. package/src/common/OpenSpecJsonSchema.ts +153 -0
  6. package/src/common/OpenSpecPath.ts +10 -0
  7. package/src/common/OpenSpecRef.ts +3 -0
  8. package/src/common/OpenSpecSecurity.ts +3 -0
  9. package/src/common/OpenSpecTag.ts +7 -0
  10. package/src/common/OpenSpecTypes.ts +1 -0
  11. package/src/common/OpenSpecVersions.ts +3 -0
  12. package/src/common/OpenSpecXML.ts +22 -0
  13. package/src/index.ts +39 -0
  14. package/src/openspec2/OS2Header.ts +8 -0
  15. package/src/openspec2/OS2Operation.ts +65 -0
  16. package/src/openspec2/OS2Parameter.ts +65 -0
  17. package/src/openspec2/OS2Paths.ts +8 -0
  18. package/src/openspec2/OS2Response.ts +22 -0
  19. package/src/openspec2/OS2Schema.ts +39 -0
  20. package/src/openspec2/OS2Security.ts +58 -0
  21. package/src/openspec2/OpenSpec2.ts +73 -0
  22. package/src/openspec3/OS3Callbacks.ts +5 -0
  23. package/src/openspec3/OS3Components.ts +49 -0
  24. package/src/openspec3/OS3Encoding.ts +25 -0
  25. package/src/openspec3/OS3Example.ts +19 -0
  26. package/src/openspec3/OS3Flows.ts +49 -0
  27. package/src/openspec3/OS3Header.ts +18 -0
  28. package/src/openspec3/OS3Link.ts +25 -0
  29. package/src/openspec3/OS3MediaType.ts +24 -0
  30. package/src/openspec3/OS3Operation.ts +70 -0
  31. package/src/openspec3/OS3Parameter.ts +83 -0
  32. package/src/openspec3/OS3Paths.ts +29 -0
  33. package/src/openspec3/OS3RequestBody.ts +22 -0
  34. package/src/openspec3/OS3Response.ts +25 -0
  35. package/src/openspec3/OS3Schema.ts +51 -0
  36. package/src/openspec3/OS3Security.ts +63 -0
  37. package/src/openspec3/OS3Server.ts +31 -0
  38. package/src/openspec3/OpenSpec3.ts +44 -0
@@ -0,0 +1,31 @@
1
+ import {OpenSpecHash} from "../common/OpenSpecHash.js";
2
+
3
+ export interface OpenSpecServerVariable {
4
+ /**
5
+ * An enumeration of string values to be used if the substitution options are from a limited set.
6
+ */
7
+ enum?: string;
8
+ /**
9
+ * The default value to use for substitution, and to send, if an alternate value is not supplied. Unlike the Schema Object's default, this value MUST be provided by the consumer.
10
+ */
11
+ default: string;
12
+ /**
13
+ * An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
14
+ */
15
+ description?: string;
16
+ }
17
+
18
+ export interface OS3Server {
19
+ /**
20
+ * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{brackets}`.
21
+ */
22
+ url: string;
23
+ /**
24
+ * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
25
+ */
26
+ description: string;
27
+ /**
28
+ * A map between a variable name and its value. The value is used for substitution in the server's URL template.
29
+ */
30
+ variables?: OpenSpecHash<OpenSpecServerVariable>;
31
+ }
@@ -0,0 +1,44 @@
1
+ import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js";
2
+ import {OpenSpecHash} from "../common/OpenSpecHash.js";
3
+ import {OpenSpecInfo} from "../common/OpenSpecInfo.js";
4
+ import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js";
5
+ import {OpenSpecTag} from "../common/OpenSpecTag.js";
6
+ import {OS3Components} from "./OS3Components.js";
7
+ import {OS3Paths} from "./OS3Paths.js";
8
+ import {OS3Schema} from "./OS3Schema.js";
9
+ import {OS3Server} from "./OS3Server.js";
10
+
11
+ export interface OpenSpec3<Schema = OS3Schema> {
12
+ /**
13
+ * This string MUST be the semantic version number of the OpenAPI Specification version that the OpenAPI document uses. The openapi field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is not related to the API info.version string.
14
+ */
15
+ openapi: string;
16
+ /**
17
+ * Provides metadata about the API. The metadata MAY be used by tooling as required.
18
+ */
19
+ info: OpenSpecInfo;
20
+ /**
21
+ * An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.
22
+ */
23
+ servers?: OS3Server[];
24
+ /**
25
+ * The available paths and operations for the API.
26
+ */
27
+ paths: OpenSpecHash<OS3Paths<Schema>>;
28
+ /**
29
+ * An element to hold various schemas for the specification.
30
+ */
31
+ components?: OS3Components<Schema>;
32
+ /**
33
+ * A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
34
+ */
35
+ security?: OpenSpecSecurity;
36
+ /**
37
+ * A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
38
+ */
39
+ tags?: OpenSpecTag[];
40
+ /**
41
+ * Additional external documentation.
42
+ */
43
+ externalDocs?: OpenSpecExternalDocs;
44
+ }