@scalar/oas-utils 0.2.43 → 0.2.45

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 (188) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/diff/diff.d.ts +13 -0
  3. package/dist/diff/diff.d.ts.map +1 -0
  4. package/dist/diff/index.d.ts +1 -0
  5. package/dist/diff/index.d.ts.map +1 -0
  6. package/dist/diff/index.js +1 -0
  7. package/dist/entities/{workspace/cookie → cookie}/cookie.d.ts +1 -17
  8. package/dist/entities/cookie/cookie.d.ts.map +1 -0
  9. package/dist/entities/{workspace/cookie → cookie}/cookie.js +1 -4
  10. package/dist/entities/cookie/index.d.ts.map +1 -0
  11. package/dist/entities/cookie/index.js +1 -0
  12. package/dist/entities/environment/environment.d.ts +24 -0
  13. package/dist/entities/environment/environment.d.ts.map +1 -0
  14. package/dist/entities/environment/environment.js +12 -0
  15. package/dist/entities/environment/index.d.ts.map +1 -0
  16. package/dist/entities/environment/index.js +1 -0
  17. package/dist/entities/{workspace/consts/hot-keys.d.ts → hotkeys/hotkeys.d.ts} +2 -2
  18. package/dist/entities/hotkeys/hotkeys.d.ts.map +1 -0
  19. package/dist/entities/{workspace/consts/hot-keys.js → hotkeys/hotkeys.js} +1 -0
  20. package/dist/entities/hotkeys/index.d.ts +2 -0
  21. package/dist/entities/hotkeys/index.d.ts.map +1 -0
  22. package/dist/entities/hotkeys/index.js +1 -0
  23. package/dist/entities/index.d.ts +1 -1
  24. package/dist/entities/index.d.ts.map +1 -1
  25. package/dist/entities/index.js +1 -1
  26. package/dist/entities/shared/index.d.ts.map +1 -0
  27. package/dist/entities/shared/utility.d.ts.map +1 -0
  28. package/dist/entities/spec/collection.d.ts +489 -0
  29. package/dist/entities/spec/collection.d.ts.map +1 -0
  30. package/dist/entities/spec/collection.js +63 -0
  31. package/dist/entities/spec/index.d.ts +10 -0
  32. package/dist/entities/spec/index.d.ts.map +1 -0
  33. package/dist/entities/spec/index.js +7 -0
  34. package/dist/entities/spec/parameters.d.ts +42 -0
  35. package/dist/entities/spec/parameters.d.ts.map +1 -0
  36. package/dist/entities/spec/parameters.js +30 -0
  37. package/dist/entities/spec/request-examples.d.ts +916 -0
  38. package/dist/entities/spec/request-examples.d.ts.map +1 -0
  39. package/dist/entities/spec/request-examples.js +168 -0
  40. package/dist/entities/spec/requests.d.ts +317 -0
  41. package/dist/entities/spec/requests.d.ts.map +1 -0
  42. package/dist/entities/{workspace/spec → spec}/requests.js +56 -32
  43. package/dist/entities/spec/security.d.ts +964 -0
  44. package/dist/entities/spec/security.d.ts.map +1 -0
  45. package/dist/entities/spec/security.js +222 -0
  46. package/dist/entities/spec/server.d.ts +82 -0
  47. package/dist/entities/spec/server.d.ts.map +1 -0
  48. package/dist/entities/{workspace/server → spec}/server.js +11 -13
  49. package/dist/entities/spec/spec-objects.d.ts +279 -0
  50. package/dist/entities/spec/spec-objects.d.ts.map +1 -0
  51. package/dist/entities/{workspace/collection/collection.js → spec/spec-objects.js} +21 -45
  52. package/dist/entities/workspace/index.js +1 -1
  53. package/dist/entities/workspace/workspace.d.ts +24 -43
  54. package/dist/entities/workspace/workspace.d.ts.map +1 -1
  55. package/dist/entities/workspace/workspace.js +6 -7
  56. package/dist/helpers/httpMethods.d.ts +16 -82
  57. package/dist/helpers/httpMethods.d.ts.map +1 -1
  58. package/dist/helpers/httpMethods.js +45 -41
  59. package/dist/helpers/index.d.ts +2 -0
  60. package/dist/helpers/index.d.ts.map +1 -1
  61. package/dist/helpers/index.js +4 -2
  62. package/dist/helpers/local-storage.d.ts +16 -0
  63. package/dist/helpers/local-storage.d.ts.map +1 -0
  64. package/dist/helpers/local-storage.js +17 -0
  65. package/dist/helpers/redirectToProxy.d.ts +2 -0
  66. package/dist/helpers/redirectToProxy.d.ts.map +1 -1
  67. package/dist/helpers/redirectToProxy.js +6 -7
  68. package/dist/helpers/regexHelpers.d.ts +3 -0
  69. package/dist/helpers/regexHelpers.d.ts.map +1 -0
  70. package/dist/helpers/regexHelpers.js +4 -0
  71. package/dist/helpers/schema-model.d.ts +2 -2
  72. package/dist/helpers/schema-model.d.ts.map +1 -1
  73. package/dist/helpers/schema-model.js +11 -17
  74. package/dist/migrations/data-version.d.ts +12 -0
  75. package/dist/migrations/data-version.d.ts.map +1 -0
  76. package/dist/migrations/data-version.js +13 -0
  77. package/dist/migrations/generate-types.d.ts +2 -0
  78. package/dist/migrations/generate-types.d.ts.map +1 -0
  79. package/dist/migrations/index.d.ts +4 -0
  80. package/dist/migrations/index.d.ts.map +1 -0
  81. package/dist/migrations/index.js +3 -0
  82. package/dist/migrations/local-storage.d.ts +8 -0
  83. package/dist/migrations/local-storage.d.ts.map +1 -0
  84. package/dist/migrations/local-storage.js +36 -0
  85. package/dist/migrations/migrator.d.ts +4 -0
  86. package/dist/migrations/migrator.d.ts.map +1 -0
  87. package/dist/migrations/migrator.js +40 -0
  88. package/dist/migrations/semver.d.ts +5 -0
  89. package/dist/migrations/semver.d.ts.map +1 -0
  90. package/dist/migrations/semver.js +25 -0
  91. package/dist/migrations/v-0.0.0/index.d.ts +2 -0
  92. package/dist/migrations/v-0.0.0/index.d.ts.map +1 -0
  93. package/dist/migrations/v-0.0.0/index.js +1 -0
  94. package/dist/migrations/v-0.0.0/types.generated.d.ts +347 -0
  95. package/dist/migrations/v-0.0.0/types.generated.d.ts.map +1 -0
  96. package/dist/migrations/v-2.1.0/index.d.ts +3 -0
  97. package/dist/migrations/v-2.1.0/index.d.ts.map +1 -0
  98. package/dist/migrations/v-2.1.0/index.js +1 -0
  99. package/dist/migrations/v-2.1.0/migration.d.ts +334 -0
  100. package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -0
  101. package/dist/migrations/v-2.1.0/migration.js +249 -0
  102. package/dist/migrations/v-2.1.0/types.generated.d.ts +42 -0
  103. package/dist/migrations/v-2.1.0/types.generated.d.ts.map +1 -0
  104. package/dist/spec-getters/getExampleFromSchema.d.ts.map +1 -1
  105. package/dist/spec-getters/getExampleFromSchema.js +21 -8
  106. package/dist/spec-getters/getParametersFromOperation.d.ts +1 -1
  107. package/dist/spec-getters/getParametersFromOperation.d.ts.map +1 -1
  108. package/dist/spec-getters/getParametersFromOperation.js +8 -7
  109. package/dist/spec-getters/getRequestBodyFromOperation.d.ts +12 -40
  110. package/dist/spec-getters/getRequestBodyFromOperation.d.ts.map +1 -1
  111. package/dist/spec-getters/getRequestBodyFromOperation.js +34 -23
  112. package/dist/spec-getters/getRequestFromOperation.d.ts.map +1 -1
  113. package/dist/spec-getters/getRequestFromOperation.js +1 -2
  114. package/dist/spec-getters/getServerVariableExamples.d.ts +4 -0
  115. package/dist/spec-getters/getServerVariableExamples.d.ts.map +1 -0
  116. package/dist/spec-getters/getServerVariableExamples.js +12 -0
  117. package/dist/spec-getters/index.d.ts +1 -0
  118. package/dist/spec-getters/index.d.ts.map +1 -1
  119. package/dist/spec-getters/index.js +1 -0
  120. package/dist/transforms/export-spec.d.ts +68 -0
  121. package/dist/transforms/export-spec.d.ts.map +1 -0
  122. package/dist/transforms/import-spec.d.ts +20 -68
  123. package/dist/transforms/import-spec.d.ts.map +1 -1
  124. package/dist/transforms/import-spec.js +209 -126
  125. package/package.json +43 -37
  126. package/dist/entities/workspace/collection/collection.d.ts +0 -330
  127. package/dist/entities/workspace/collection/collection.d.ts.map +0 -1
  128. package/dist/entities/workspace/collection/index.d.ts +0 -2
  129. package/dist/entities/workspace/collection/index.d.ts.map +0 -1
  130. package/dist/entities/workspace/collection/index.js +0 -1
  131. package/dist/entities/workspace/consts/hot-keys.d.ts.map +0 -1
  132. package/dist/entities/workspace/consts/index.d.ts +0 -2
  133. package/dist/entities/workspace/consts/index.d.ts.map +0 -1
  134. package/dist/entities/workspace/consts/index.js +0 -1
  135. package/dist/entities/workspace/cookie/cookie.d.ts.map +0 -1
  136. package/dist/entities/workspace/cookie/index.d.ts.map +0 -1
  137. package/dist/entities/workspace/cookie/index.js +0 -1
  138. package/dist/entities/workspace/environment/environment.d.ts +0 -55
  139. package/dist/entities/workspace/environment/environment.d.ts.map +0 -1
  140. package/dist/entities/workspace/environment/environment.js +0 -23
  141. package/dist/entities/workspace/environment/index.d.ts.map +0 -1
  142. package/dist/entities/workspace/environment/index.js +0 -1
  143. package/dist/entities/workspace/folder/folder.d.ts +0 -36
  144. package/dist/entities/workspace/folder/folder.d.ts.map +0 -1
  145. package/dist/entities/workspace/folder/folder.js +0 -21
  146. package/dist/entities/workspace/folder/index.d.ts +0 -2
  147. package/dist/entities/workspace/folder/index.d.ts.map +0 -1
  148. package/dist/entities/workspace/folder/index.js +0 -1
  149. package/dist/entities/workspace/security/index.d.ts +0 -3
  150. package/dist/entities/workspace/security/index.d.ts.map +0 -1
  151. package/dist/entities/workspace/security/index.js +0 -2
  152. package/dist/entities/workspace/security/security-requirement.d.ts +0 -13
  153. package/dist/entities/workspace/security/security-requirement.d.ts.map +0 -1
  154. package/dist/entities/workspace/security/security-requirement.js +0 -15
  155. package/dist/entities/workspace/security/security-schemes.d.ts +0 -696
  156. package/dist/entities/workspace/security/security-schemes.d.ts.map +0 -1
  157. package/dist/entities/workspace/security/security-schemes.js +0 -139
  158. package/dist/entities/workspace/server/index.d.ts +0 -2
  159. package/dist/entities/workspace/server/index.d.ts.map +0 -1
  160. package/dist/entities/workspace/server/index.js +0 -1
  161. package/dist/entities/workspace/server/server.d.ts +0 -91
  162. package/dist/entities/workspace/server/server.d.ts.map +0 -1
  163. package/dist/entities/workspace/shared/index.d.ts.map +0 -1
  164. package/dist/entities/workspace/shared/utility.d.ts.map +0 -1
  165. package/dist/entities/workspace/spec/components.d.ts +0 -3
  166. package/dist/entities/workspace/spec/components.d.ts.map +0 -1
  167. package/dist/entities/workspace/spec/index.d.ts +0 -5
  168. package/dist/entities/workspace/spec/index.d.ts.map +0 -1
  169. package/dist/entities/workspace/spec/index.js +0 -2
  170. package/dist/entities/workspace/spec/parameters.d.ts +0 -16
  171. package/dist/entities/workspace/spec/parameters.d.ts.map +0 -1
  172. package/dist/entities/workspace/spec/refs.d.ts +0 -30
  173. package/dist/entities/workspace/spec/refs.d.ts.map +0 -1
  174. package/dist/entities/workspace/spec/refs.js +0 -9
  175. package/dist/entities/workspace/spec/request-examples.d.ts +0 -1573
  176. package/dist/entities/workspace/spec/request-examples.d.ts.map +0 -1
  177. package/dist/entities/workspace/spec/request-examples.js +0 -96
  178. package/dist/entities/workspace/spec/requests.d.ts +0 -181
  179. package/dist/entities/workspace/spec/requests.d.ts.map +0 -1
  180. package/dist/entities/workspace/spec/spec.d.ts +0 -18
  181. package/dist/entities/workspace/spec/spec.d.ts.map +0 -1
  182. package/dist/entities/workspace/spec/spec.js +0 -8
  183. /package/dist/entities/{workspace/cookie → cookie}/index.d.ts +0 -0
  184. /package/dist/entities/{workspace/environment → environment}/index.d.ts +0 -0
  185. /package/dist/entities/{workspace/shared → shared}/index.d.ts +0 -0
  186. /package/dist/entities/{workspace/shared → shared}/index.js +0 -0
  187. /package/dist/entities/{workspace/shared → shared}/utility.d.ts +0 -0
  188. /package/dist/entities/{workspace/shared → shared}/utility.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/spec/request-examples.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAA;AAEF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMW,CAAA;AAE3B,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAEjD,QAAA,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMlC,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlF,CAAA;AAEF,kFAAkF;AAClF,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8ElF,CAAA;AAEF,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAExE,oCAAoC;AACpC,eAAO,MAAM,oBAAoB,YAAa,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhE,CAAA"}
@@ -1,96 +0,0 @@
1
- import { deepMerge } from '@scalar/object-utils/merge';
2
- import { z } from 'zod';
3
- import { nanoidSchema } from '../shared/utility.js';
4
-
5
- // Define the Blob schema
6
- const blobSchema = z.object({
7
- size: z.number().nonnegative('Blob size must be a non-negative number').int(), // Size of the Blob
8
- type: z.string(), // MIME type of the Blob
9
- arrayBuffer: z.function().returns(z.promise(z.instanceof(ArrayBuffer))), // Returns a Promise of ArrayBuffer
10
- slice: z
11
- .function()
12
- .args(z.number().optional(), z.number().optional(), z.string().optional())
13
- .returns(z.any()), // Returns a Blob (any type for now)
14
- stream: z.function().returns(z.instanceof((ReadableStream))), // Returns a ReadableStream of Uint8Array
15
- text: z.function().returns(z.promise(z.string())), // Returns a Promise of string
16
- });
17
- const fileSchema = z
18
- .object({
19
- name: z.string(),
20
- lastModified: z.number(),
21
- webkitRelativePath: z.string(),
22
- })
23
- .extend(blobSchema.shape);
24
- const requestExampleParametersSchema = z.object({
25
- key: z.string().default(''),
26
- value: z.union([z.string(), z.number()]).transform(String).default(''),
27
- enabled: z.boolean().default(true),
28
- file: fileSchema.optional(),
29
- description: z.string().optional(),
30
- /** Params are linked to parents such as path params and global headers/cookies */
31
- refUid: nanoidSchema.optional(),
32
- required: z.boolean().optional(),
33
- enum: z.array(z.string()).optional(),
34
- type: z.string().optional(),
35
- format: z.string().optional(),
36
- minimum: z.number().optional(),
37
- maximum: z.number().optional(),
38
- default: z.any().optional(),
39
- nullable: z.boolean().optional(),
40
- });
41
- /** Create request example parameter helper */
42
- const createRequestExampleParameter = (payload) => deepMerge(requestExampleParametersSchema.parse({}), payload);
43
- const requestExampleSchema = z.object({
44
- uid: nanoidSchema,
45
- url: z.string().optional().default(''),
46
- requestUid: z.string().min(7),
47
- name: z.string().optional().default('Name'),
48
- body: z
49
- .object({
50
- raw: z
51
- .object({
52
- encoding: z
53
- .union([
54
- z.literal('json'),
55
- z.literal('text'),
56
- z.literal('html'),
57
- z.literal('text'),
58
- z.literal('javascript'),
59
- z.literal('xml'),
60
- z.literal('yaml'),
61
- z.literal('edn'),
62
- ])
63
- .default('json'),
64
- value: z.string().default(''),
65
- })
66
- .default({}),
67
- formData: z
68
- .object({
69
- encoding: z
70
- .union([z.literal('form-data'), z.literal('urlencoded')])
71
- .default('form-data'),
72
- value: requestExampleParametersSchema.array().default([]),
73
- })
74
- .default({}),
75
- binary: fileSchema.optional(),
76
- activeBody: z
77
- .union([z.literal('raw'), z.literal('formData'), z.literal('binary')])
78
- .default('raw'),
79
- })
80
- .optional()
81
- .default({}),
82
- parameters: z
83
- .object({
84
- path: requestExampleParametersSchema.array().default([]),
85
- query: requestExampleParametersSchema.array().default([]),
86
- headers: requestExampleParametersSchema.array().default([]),
87
- cookies: requestExampleParametersSchema.array().default([]),
88
- })
89
- .optional()
90
- .default({}),
91
- auth: z.record(z.string(), z.any()).default({}),
92
- });
93
- /** Create request example helper */
94
- const createRequestExample = (payload) => deepMerge(requestExampleSchema.parse({ requestUid: payload.requestUid }), payload);
95
-
96
- export { blobSchema, createRequestExample, createRequestExampleParameter };
@@ -1,181 +0,0 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import { z } from 'zod';
3
- import type { RequestExample } from './request-examples.js';
4
- /** A single set of populated values for a sent request */
5
- export type ResponseInstance = Omit<Response, 'headers'> & {
6
- /** Store headers as an object to match what we had with axios */
7
- headers: Record<string, string>;
8
- /** Keys of headers which set cookies */
9
- cookieHeaderKeys: string[];
10
- /** Time in ms the request took */
11
- duration: number;
12
- /** The response data */
13
- data: unknown;
14
- };
15
- /** A single request/response set to save to the history stack */
16
- export type RequestEvent = {
17
- request: RequestExample;
18
- response: ResponseInstance;
19
- timestamp: number;
20
- };
21
- declare const requestSchema: z.ZodObject<{
22
- path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
23
- method: z.ZodDefault<z.ZodOptional<z.ZodEnum<["GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS"]>>>;
24
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
25
- ref: z.ZodDefault<z.ZodNullable<z.ZodObject<{
26
- path: z.ZodString;
27
- collectionRef: z.ZodOptional<z.ZodString>;
28
- isExternal: z.ZodBoolean;
29
- }, "strip", z.ZodTypeAny, {
30
- path: string;
31
- isExternal: boolean;
32
- collectionRef?: string | undefined;
33
- }, {
34
- path: string;
35
- isExternal: boolean;
36
- collectionRef?: string | undefined;
37
- }>>>;
38
- /**
39
- * A list of tags for API documentation control. Tags can be used for logical
40
- * grouping of operations by resources or any other qualifier.
41
- */
42
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
- /** A short summary of what the operation does. */
44
- summary: z.ZodOptional<z.ZodString>;
45
- /** A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation. */
46
- description: z.ZodOptional<z.ZodString>;
47
- /**
48
- * Unique string used to identify the operation. The id MUST be unique among all operations described in the API.
49
- * The operationId value is case-sensitive. Tools and libraries MAY use the operationId to uniquely identify an
50
- * operation, therefore, it is RECOMMENDED to follow bin common programming naming conventions./
51
- */
52
- operationId: z.ZodOptional<z.ZodString>;
53
- parameters: z.ZodDefault<z.ZodObject<{
54
- path: z.ZodRecord<z.ZodString, z.ZodAny>;
55
- query: z.ZodRecord<z.ZodString, z.ZodAny>;
56
- headers: z.ZodRecord<z.ZodString, z.ZodAny>;
57
- cookies: z.ZodRecord<z.ZodString, z.ZodAny>;
58
- }, "strip", z.ZodTypeAny, {
59
- path: Record<string, any>;
60
- query: Record<string, any>;
61
- headers: Record<string, any>;
62
- cookies: Record<string, any>;
63
- }, {
64
- path: Record<string, any>;
65
- query: Record<string, any>;
66
- headers: Record<string, any>;
67
- cookies: Record<string, any>;
68
- }>>;
69
- /**
70
- * A declaration of which security mechanisms can be used across the API. The list of
71
- * values includes alternative security requirement objects that can be used. Only
72
- * one of the security requirement objects need to be satisfied to authorize a request.
73
- * Individual operations can override this definition. To make security optional, an empty
74
- * security requirement ({}) can be included in the array.
75
- */
76
- security: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>, "many">>;
77
- /** Security schemes which have been created specifically for this request */
78
- securitySchemeUids: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>>;
79
- /** The currently selected security schemes at the request level */
80
- selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
81
- /**
82
- * The request body applicable for this operation. The requestBody is fully supported in HTTP methods where the
83
- * HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request bodies. In other cases where the
84
- * HTTP spec is vague (such as GET, HEAD and DELETE), requestBody is permitted but does not have well-defined
85
- * semantics and SHOULD be avoided if possible.
86
- */
87
- requestBody: z.ZodOptional<z.ZodAny>;
88
- /** Ordered exampleUids for the sidenav */
89
- childUids: z.ZodDefault<z.ZodArray<z.ZodDefault<z.ZodOptional<z.ZodString>>, "many">>;
90
- history: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
91
- }, "strip", z.ZodTypeAny, {
92
- path: string;
93
- uid: string;
94
- childUids: string[];
95
- parameters: {
96
- path: Record<string, any>;
97
- query: Record<string, any>;
98
- headers: Record<string, any>;
99
- cookies: Record<string, any>;
100
- };
101
- method: "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS";
102
- ref: {
103
- path: string;
104
- isExternal: boolean;
105
- collectionRef?: string | undefined;
106
- } | null;
107
- securitySchemeUids: string[];
108
- selectedSecuritySchemeUids: string[];
109
- history: any[];
110
- description?: string | undefined;
111
- summary?: string | undefined;
112
- security?: Record<string, string[]>[] | undefined;
113
- tags?: string[] | undefined;
114
- operationId?: string | undefined;
115
- requestBody?: any;
116
- }, {
117
- path?: string | undefined;
118
- uid?: string | undefined;
119
- description?: string | undefined;
120
- summary?: string | undefined;
121
- security?: Record<string, string[] | undefined>[] | undefined;
122
- tags?: string[] | undefined;
123
- childUids?: (string | undefined)[] | undefined;
124
- parameters?: {
125
- path: Record<string, any>;
126
- query: Record<string, any>;
127
- headers: Record<string, any>;
128
- cookies: Record<string, any>;
129
- } | undefined;
130
- method?: "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS" | undefined;
131
- ref?: {
132
- path: string;
133
- isExternal: boolean;
134
- collectionRef?: string | undefined;
135
- } | null | undefined;
136
- operationId?: string | undefined;
137
- securitySchemeUids?: (string | undefined)[] | undefined;
138
- selectedSecuritySchemeUids?: (string | undefined)[] | undefined;
139
- requestBody?: any;
140
- history?: any[] | undefined;
141
- }>;
142
- /**
143
- * Each operation in an OpenAPI file will correspond with a single request
144
- *
145
- * @see https://spec.openapis.org/oas/v3.1.0#operation-object
146
- */
147
- export type Request = z.infer<typeof requestSchema> & {
148
- externalDocs?: OpenAPIV3_1.ExternalDocumentationObject;
149
- };
150
- export type RequestPayload = z.input<typeof requestSchema> & {
151
- externalDocs?: OpenAPIV3_1.ExternalDocumentationObject;
152
- };
153
- /** Create request helper */
154
- export declare const createRequest: (payload: RequestPayload) => {
155
- path: string;
156
- uid: string;
157
- childUids: string[];
158
- parameters: {
159
- path: Record<string, any>;
160
- query: Record<string, any>;
161
- headers: Record<string, any>;
162
- cookies: Record<string, any>;
163
- };
164
- method: "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS";
165
- ref: {
166
- path: string;
167
- isExternal: boolean;
168
- collectionRef?: string | undefined;
169
- } | null;
170
- securitySchemeUids: string[];
171
- selectedSecuritySchemeUids: string[];
172
- history: any[];
173
- description?: string | undefined;
174
- summary?: string | undefined;
175
- security?: Record<string, string[]>[] | undefined;
176
- tags?: string[] | undefined;
177
- operationId?: string | undefined;
178
- requestBody?: any;
179
- };
180
- export {};
181
- //# sourceMappingURL=requests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/spec/requests.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAkB,CAAC,EAAE,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1,18 +0,0 @@
1
- import { z } from 'zod';
2
- export type TagObject = {
3
- name: string;
4
- /** Optional CommonMark Description */
5
- description?: string;
6
- externalDocs?: object;
7
- };
8
- export declare const tagObjectSchema: z.ZodObject<{
9
- name: z.ZodString;
10
- description: z.ZodOptional<z.ZodString>;
11
- }, "strip", z.ZodTypeAny, {
12
- name: string;
13
- description?: string | undefined;
14
- }, {
15
- name: string;
16
- description?: string | undefined;
17
- }>;
18
- //# sourceMappingURL=spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/spec/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvC,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;EAGK,CAAA"}
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- const tagObjectSchema = z.object({
4
- name: z.string().min(1),
5
- description: z.string().optional(),
6
- });
7
-
8
- export { tagObjectSchema };