@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,696 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const securitySchemeApiKeyIn: readonly ["query", "header", "cookie"];
3
- declare const securitySchemeApiKey: z.ZodObject<z.objectUtil.extendShape<{
4
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
5
- /** The name key that links a security requirement to a security object */
6
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
7
- description: z.ZodOptional<z.ZodString>;
8
- }, {
9
- type: z.ZodLiteral<"apiKey">;
10
- /** REQUIRED. The name of the header, query or cookie parameter to be used. */
11
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
12
- /** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
13
- in: z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>;
14
- value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15
- }>, "strip", z.ZodTypeAny, {
16
- type: "apiKey";
17
- value: string;
18
- uid: string;
19
- name: string;
20
- nameKey: string;
21
- in: "query" | "header" | "cookie";
22
- description?: string | undefined;
23
- }, {
24
- type: "apiKey";
25
- value?: string | undefined;
26
- uid?: string | undefined;
27
- name?: string | undefined;
28
- description?: string | undefined;
29
- nameKey?: string | undefined;
30
- in?: "query" | "header" | "cookie" | undefined;
31
- }>;
32
- export type SecuritySchemeApiKey = z.infer<typeof securitySchemeApiKey>;
33
- declare const securitySchemeOauth2: z.ZodObject<z.objectUtil.extendShape<{
34
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
35
- /** The name key that links a security requirement to a security object */
36
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
37
- description: z.ZodOptional<z.ZodString>;
38
- }, {
39
- type: z.ZodLiteral<"oauth2">;
40
- /** REQUIRED. An object containing configuration information for the flow types supported. */
41
- flow: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
42
- /**
43
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
44
- * URL. The OAuth2 standard requires the use of TLS.
45
- */
46
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
47
- /**
48
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
49
- * between the scope name and a short description for it. The map MAY be empty.
50
- */
51
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
52
- /** User selected scopes per flow */
53
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
54
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
55
- }, {
56
- type: z.ZodLiteral<"implicit">;
57
- authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
58
- redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
59
- }>, "strip", z.ZodTypeAny, {
60
- type: "implicit";
61
- refreshUrl: string;
62
- selectedScopes: string[];
63
- token: string;
64
- authorizationUrl: string;
65
- redirectUri: string;
66
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
67
- }, {
68
- type: "implicit";
69
- refreshUrl?: string | undefined;
70
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
71
- selectedScopes?: string[] | undefined;
72
- token?: string | undefined;
73
- authorizationUrl?: string | undefined;
74
- redirectUri?: string | undefined;
75
- }>, z.ZodObject<z.objectUtil.extendShape<{
76
- /**
77
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
78
- * URL. The OAuth2 standard requires the use of TLS.
79
- */
80
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
81
- /**
82
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
83
- * between the scope name and a short description for it. The map MAY be empty.
84
- */
85
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
86
- /** User selected scopes per flow */
87
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
88
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
89
- }, {
90
- type: z.ZodLiteral<"password">;
91
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
92
- /** Username */
93
- value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
94
- /** Password */
95
- secondValue: z.ZodDefault<z.ZodOptional<z.ZodString>>;
96
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
97
- }>, "strip", z.ZodTypeAny, {
98
- type: "password";
99
- value: string;
100
- secondValue: string;
101
- refreshUrl: string;
102
- selectedScopes: string[];
103
- token: string;
104
- tokenUrl: string;
105
- clientSecret: string;
106
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
107
- }, {
108
- type: "password";
109
- value?: string | undefined;
110
- secondValue?: string | undefined;
111
- refreshUrl?: string | undefined;
112
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
113
- selectedScopes?: string[] | undefined;
114
- token?: string | undefined;
115
- tokenUrl?: string | undefined;
116
- clientSecret?: string | undefined;
117
- }>, z.ZodObject<z.objectUtil.extendShape<{
118
- /**
119
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
120
- * URL. The OAuth2 standard requires the use of TLS.
121
- */
122
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
123
- /**
124
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
125
- * between the scope name and a short description for it. The map MAY be empty.
126
- */
127
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
128
- /** User selected scopes per flow */
129
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
130
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
131
- }, {
132
- type: z.ZodLiteral<"clientCredentials">;
133
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
134
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
135
- }>, "strip", z.ZodTypeAny, {
136
- type: "clientCredentials";
137
- refreshUrl: string;
138
- selectedScopes: string[];
139
- token: string;
140
- tokenUrl: string;
141
- clientSecret: string;
142
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
143
- }, {
144
- type: "clientCredentials";
145
- refreshUrl?: string | undefined;
146
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
147
- selectedScopes?: string[] | undefined;
148
- token?: string | undefined;
149
- tokenUrl?: string | undefined;
150
- clientSecret?: string | undefined;
151
- }>, z.ZodObject<z.objectUtil.extendShape<{
152
- /**
153
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
154
- * URL. The OAuth2 standard requires the use of TLS.
155
- */
156
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
157
- /**
158
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
159
- * between the scope name and a short description for it. The map MAY be empty.
160
- */
161
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
162
- /** User selected scopes per flow */
163
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
164
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
165
- }, {
166
- type: z.ZodLiteral<"authorizationCode">;
167
- authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
168
- redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
169
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
170
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
171
- }>, "strip", z.ZodTypeAny, {
172
- type: "authorizationCode";
173
- refreshUrl: string;
174
- selectedScopes: string[];
175
- token: string;
176
- authorizationUrl: string;
177
- redirectUri: string;
178
- tokenUrl: string;
179
- clientSecret: string;
180
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
181
- }, {
182
- type: "authorizationCode";
183
- refreshUrl?: string | undefined;
184
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
185
- selectedScopes?: string[] | undefined;
186
- token?: string | undefined;
187
- authorizationUrl?: string | undefined;
188
- redirectUri?: string | undefined;
189
- tokenUrl?: string | undefined;
190
- clientSecret?: string | undefined;
191
- }>]>>>;
192
- clientId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
193
- }>, "strip", z.ZodTypeAny, {
194
- type: "oauth2";
195
- uid: string;
196
- nameKey: string;
197
- flow: {
198
- type: "implicit";
199
- refreshUrl: string;
200
- selectedScopes: string[];
201
- token: string;
202
- authorizationUrl: string;
203
- redirectUri: string;
204
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
205
- } | {
206
- type: "password";
207
- value: string;
208
- secondValue: string;
209
- refreshUrl: string;
210
- selectedScopes: string[];
211
- token: string;
212
- tokenUrl: string;
213
- clientSecret: string;
214
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
215
- } | {
216
- type: "clientCredentials";
217
- refreshUrl: string;
218
- selectedScopes: string[];
219
- token: string;
220
- tokenUrl: string;
221
- clientSecret: string;
222
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
223
- } | {
224
- type: "authorizationCode";
225
- refreshUrl: string;
226
- selectedScopes: string[];
227
- token: string;
228
- authorizationUrl: string;
229
- redirectUri: string;
230
- tokenUrl: string;
231
- clientSecret: string;
232
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
233
- };
234
- clientId: string;
235
- description?: string | undefined;
236
- }, {
237
- type: "oauth2";
238
- uid?: string | undefined;
239
- description?: string | undefined;
240
- nameKey?: string | undefined;
241
- flow?: {
242
- type: "implicit";
243
- refreshUrl?: string | undefined;
244
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
245
- selectedScopes?: string[] | undefined;
246
- token?: string | undefined;
247
- authorizationUrl?: string | undefined;
248
- redirectUri?: string | undefined;
249
- } | {
250
- type: "password";
251
- value?: string | undefined;
252
- secondValue?: string | undefined;
253
- refreshUrl?: string | undefined;
254
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
255
- selectedScopes?: string[] | undefined;
256
- token?: string | undefined;
257
- tokenUrl?: string | undefined;
258
- clientSecret?: string | undefined;
259
- } | {
260
- type: "clientCredentials";
261
- refreshUrl?: string | undefined;
262
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
263
- selectedScopes?: string[] | undefined;
264
- token?: string | undefined;
265
- tokenUrl?: string | undefined;
266
- clientSecret?: string | undefined;
267
- } | {
268
- type: "authorizationCode";
269
- refreshUrl?: string | undefined;
270
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
271
- selectedScopes?: string[] | undefined;
272
- token?: string | undefined;
273
- authorizationUrl?: string | undefined;
274
- redirectUri?: string | undefined;
275
- tokenUrl?: string | undefined;
276
- clientSecret?: string | undefined;
277
- } | undefined;
278
- clientId?: string | undefined;
279
- }>;
280
- export type SecuritySchemeOauth2 = z.infer<typeof securitySchemeOauth2>;
281
- declare const securityScheme: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
282
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
283
- /** The name key that links a security requirement to a security object */
284
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
285
- description: z.ZodOptional<z.ZodString>;
286
- }, {
287
- type: z.ZodLiteral<"apiKey">;
288
- /** REQUIRED. The name of the header, query or cookie parameter to be used. */
289
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
290
- /** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
291
- in: z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>;
292
- value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
293
- }>, "strip", z.ZodTypeAny, {
294
- type: "apiKey";
295
- value: string;
296
- uid: string;
297
- name: string;
298
- nameKey: string;
299
- in: "query" | "header" | "cookie";
300
- description?: string | undefined;
301
- }, {
302
- type: "apiKey";
303
- value?: string | undefined;
304
- uid?: string | undefined;
305
- name?: string | undefined;
306
- description?: string | undefined;
307
- nameKey?: string | undefined;
308
- in?: "query" | "header" | "cookie" | undefined;
309
- }>, z.ZodObject<z.objectUtil.extendShape<{
310
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
311
- /** The name key that links a security requirement to a security object */
312
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
313
- description: z.ZodOptional<z.ZodString>;
314
- }, {
315
- type: z.ZodLiteral<"http">;
316
- /**
317
- * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
318
- * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
319
- */
320
- scheme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["basic", "bearer"]>>>;
321
- /**
322
- * A hint to the client to identify how the bearer token is formatted.
323
- * Bearer tokens are usually generated by an authorization server, so
324
- * this information is primarily for documentation purposes.
325
- */
326
- bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"JWT">, z.ZodString]>>>;
327
- /** Username */
328
- value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
329
- /** Password */
330
- secondValue: z.ZodDefault<z.ZodOptional<z.ZodString>>;
331
- }>, "strip", z.ZodTypeAny, {
332
- type: "http";
333
- value: string;
334
- uid: string;
335
- nameKey: string;
336
- scheme: "basic" | "bearer";
337
- bearerFormat: string;
338
- secondValue: string;
339
- description?: string | undefined;
340
- }, {
341
- type: "http";
342
- value?: string | undefined;
343
- uid?: string | undefined;
344
- description?: string | undefined;
345
- nameKey?: string | undefined;
346
- scheme?: "basic" | "bearer" | undefined;
347
- bearerFormat?: string | undefined;
348
- secondValue?: string | undefined;
349
- }>, z.ZodObject<z.objectUtil.extendShape<{
350
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
351
- /** The name key that links a security requirement to a security object */
352
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
353
- description: z.ZodOptional<z.ZodString>;
354
- }, {
355
- type: z.ZodLiteral<"oauth2">;
356
- /** REQUIRED. An object containing configuration information for the flow types supported. */
357
- flow: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
358
- /**
359
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
360
- * URL. The OAuth2 standard requires the use of TLS.
361
- */
362
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
363
- /**
364
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
365
- * between the scope name and a short description for it. The map MAY be empty.
366
- */
367
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
368
- /** User selected scopes per flow */
369
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
370
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
371
- }, {
372
- type: z.ZodLiteral<"implicit">;
373
- authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
374
- redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
375
- }>, "strip", z.ZodTypeAny, {
376
- type: "implicit";
377
- refreshUrl: string;
378
- selectedScopes: string[];
379
- token: string;
380
- authorizationUrl: string;
381
- redirectUri: string;
382
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
383
- }, {
384
- type: "implicit";
385
- refreshUrl?: string | undefined;
386
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
387
- selectedScopes?: string[] | undefined;
388
- token?: string | undefined;
389
- authorizationUrl?: string | undefined;
390
- redirectUri?: string | undefined;
391
- }>, z.ZodObject<z.objectUtil.extendShape<{
392
- /**
393
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
394
- * URL. The OAuth2 standard requires the use of TLS.
395
- */
396
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
397
- /**
398
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
399
- * between the scope name and a short description for it. The map MAY be empty.
400
- */
401
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
402
- /** User selected scopes per flow */
403
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
404
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
405
- }, {
406
- type: z.ZodLiteral<"password">;
407
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
408
- /** Username */
409
- value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
410
- /** Password */
411
- secondValue: z.ZodDefault<z.ZodOptional<z.ZodString>>;
412
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
413
- }>, "strip", z.ZodTypeAny, {
414
- type: "password";
415
- value: string;
416
- secondValue: string;
417
- refreshUrl: string;
418
- selectedScopes: string[];
419
- token: string;
420
- tokenUrl: string;
421
- clientSecret: string;
422
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
423
- }, {
424
- type: "password";
425
- value?: string | undefined;
426
- secondValue?: string | undefined;
427
- refreshUrl?: string | undefined;
428
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
429
- selectedScopes?: string[] | undefined;
430
- token?: string | undefined;
431
- tokenUrl?: string | undefined;
432
- clientSecret?: string | undefined;
433
- }>, z.ZodObject<z.objectUtil.extendShape<{
434
- /**
435
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
436
- * URL. The OAuth2 standard requires the use of TLS.
437
- */
438
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
439
- /**
440
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
441
- * between the scope name and a short description for it. The map MAY be empty.
442
- */
443
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
444
- /** User selected scopes per flow */
445
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
446
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
447
- }, {
448
- type: z.ZodLiteral<"clientCredentials">;
449
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
450
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
451
- }>, "strip", z.ZodTypeAny, {
452
- type: "clientCredentials";
453
- refreshUrl: string;
454
- selectedScopes: string[];
455
- token: string;
456
- tokenUrl: string;
457
- clientSecret: string;
458
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
459
- }, {
460
- type: "clientCredentials";
461
- refreshUrl?: string | undefined;
462
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
463
- selectedScopes?: string[] | undefined;
464
- token?: string | undefined;
465
- tokenUrl?: string | undefined;
466
- clientSecret?: string | undefined;
467
- }>, z.ZodObject<z.objectUtil.extendShape<{
468
- /**
469
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a
470
- * URL. The OAuth2 standard requires the use of TLS.
471
- */
472
- refreshUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
473
- /**
474
- * REQUIRED. The available scopes for the OAuth2 security scheme. A map
475
- * between the scope name and a short description for it. The map MAY be empty.
476
- */
477
- scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
478
- /** User selected scopes per flow */
479
- selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
480
- token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
481
- }, {
482
- type: z.ZodLiteral<"authorizationCode">;
483
- authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
484
- redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
485
- tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
486
- clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
487
- }>, "strip", z.ZodTypeAny, {
488
- type: "authorizationCode";
489
- refreshUrl: string;
490
- selectedScopes: string[];
491
- token: string;
492
- authorizationUrl: string;
493
- redirectUri: string;
494
- tokenUrl: string;
495
- clientSecret: string;
496
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
497
- }, {
498
- type: "authorizationCode";
499
- refreshUrl?: string | undefined;
500
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
501
- selectedScopes?: string[] | undefined;
502
- token?: string | undefined;
503
- authorizationUrl?: string | undefined;
504
- redirectUri?: string | undefined;
505
- tokenUrl?: string | undefined;
506
- clientSecret?: string | undefined;
507
- }>]>>>;
508
- clientId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
509
- }>, "strip", z.ZodTypeAny, {
510
- type: "oauth2";
511
- uid: string;
512
- nameKey: string;
513
- flow: {
514
- type: "implicit";
515
- refreshUrl: string;
516
- selectedScopes: string[];
517
- token: string;
518
- authorizationUrl: string;
519
- redirectUri: string;
520
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
521
- } | {
522
- type: "password";
523
- value: string;
524
- secondValue: string;
525
- refreshUrl: string;
526
- selectedScopes: string[];
527
- token: string;
528
- tokenUrl: string;
529
- clientSecret: string;
530
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
531
- } | {
532
- type: "clientCredentials";
533
- refreshUrl: string;
534
- selectedScopes: string[];
535
- token: string;
536
- tokenUrl: string;
537
- clientSecret: string;
538
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
539
- } | {
540
- type: "authorizationCode";
541
- refreshUrl: string;
542
- selectedScopes: string[];
543
- token: string;
544
- authorizationUrl: string;
545
- redirectUri: string;
546
- tokenUrl: string;
547
- clientSecret: string;
548
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
549
- };
550
- clientId: string;
551
- description?: string | undefined;
552
- }, {
553
- type: "oauth2";
554
- uid?: string | undefined;
555
- description?: string | undefined;
556
- nameKey?: string | undefined;
557
- flow?: {
558
- type: "implicit";
559
- refreshUrl?: string | undefined;
560
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
561
- selectedScopes?: string[] | undefined;
562
- token?: string | undefined;
563
- authorizationUrl?: string | undefined;
564
- redirectUri?: string | undefined;
565
- } | {
566
- type: "password";
567
- value?: string | undefined;
568
- secondValue?: string | undefined;
569
- refreshUrl?: string | undefined;
570
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
571
- selectedScopes?: string[] | undefined;
572
- token?: string | undefined;
573
- tokenUrl?: string | undefined;
574
- clientSecret?: string | undefined;
575
- } | {
576
- type: "clientCredentials";
577
- refreshUrl?: string | undefined;
578
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
579
- selectedScopes?: string[] | undefined;
580
- token?: string | undefined;
581
- tokenUrl?: string | undefined;
582
- clientSecret?: string | undefined;
583
- } | {
584
- type: "authorizationCode";
585
- refreshUrl?: string | undefined;
586
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
587
- selectedScopes?: string[] | undefined;
588
- token?: string | undefined;
589
- authorizationUrl?: string | undefined;
590
- redirectUri?: string | undefined;
591
- tokenUrl?: string | undefined;
592
- clientSecret?: string | undefined;
593
- } | undefined;
594
- clientId?: string | undefined;
595
- }>, z.ZodObject<z.objectUtil.extendShape<{
596
- uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
597
- /** The name key that links a security requirement to a security object */
598
- nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
599
- description: z.ZodOptional<z.ZodString>;
600
- }, {
601
- type: z.ZodLiteral<"openIdConnect">;
602
- /**
603
- * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
604
- * form of a URL. The OpenID Connect standard requires the use of TLS.
605
- */
606
- openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
607
- }>, "strip", z.ZodTypeAny, {
608
- type: "openIdConnect";
609
- uid: string;
610
- nameKey: string;
611
- openIdConnectUrl: string;
612
- description?: string | undefined;
613
- }, {
614
- type: "openIdConnect";
615
- uid?: string | undefined;
616
- description?: string | undefined;
617
- nameKey?: string | undefined;
618
- openIdConnectUrl?: string | undefined;
619
- }>]>;
620
- /**
621
- * Security Scheme Object
622
- *
623
- * @see https://spec.openapis.org/oas/latest.html#security-scheme-object
624
- */
625
- export type SecurityScheme = z.infer<typeof securityScheme>;
626
- export type SecuritySchemePayload = z.input<typeof securityScheme>;
627
- /** Create Security Scheme with defaults */
628
- export declare const createSecurityScheme: (payload: SecuritySchemePayload) => {
629
- type: "apiKey";
630
- value: string;
631
- uid: string;
632
- name: string;
633
- nameKey: string;
634
- in: "query" | "header" | "cookie";
635
- description?: string | undefined;
636
- } | {
637
- type: "http";
638
- value: string;
639
- uid: string;
640
- nameKey: string;
641
- scheme: "basic" | "bearer";
642
- bearerFormat: string;
643
- secondValue: string;
644
- description?: string | undefined;
645
- } | {
646
- type: "oauth2";
647
- uid: string;
648
- nameKey: string;
649
- flow: {
650
- type: "implicit";
651
- refreshUrl: string;
652
- selectedScopes: string[];
653
- token: string;
654
- authorizationUrl: string;
655
- redirectUri: string;
656
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
657
- } | {
658
- type: "password";
659
- value: string;
660
- secondValue: string;
661
- refreshUrl: string;
662
- selectedScopes: string[];
663
- token: string;
664
- tokenUrl: string;
665
- clientSecret: string;
666
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
667
- } | {
668
- type: "clientCredentials";
669
- refreshUrl: string;
670
- selectedScopes: string[];
671
- token: string;
672
- tokenUrl: string;
673
- clientSecret: string;
674
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
675
- } | {
676
- type: "authorizationCode";
677
- refreshUrl: string;
678
- selectedScopes: string[];
679
- token: string;
680
- authorizationUrl: string;
681
- redirectUri: string;
682
- tokenUrl: string;
683
- clientSecret: string;
684
- scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
685
- };
686
- clientId: string;
687
- description?: string | undefined;
688
- } | {
689
- type: "openIdConnect";
690
- uid: string;
691
- nameKey: string;
692
- openIdConnectUrl: string;
693
- description?: string | undefined;
694
- };
695
- export {};
696
- //# sourceMappingURL=security-schemes.d.ts.map