@scalar/oas-utils 0.2.140 → 0.2.141

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 (280) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/entities/cookie/cookie.js +14 -13
  3. package/dist/entities/cookie/cookie.js.map +7 -0
  4. package/dist/entities/cookie/index.d.ts +1 -1
  5. package/dist/entities/cookie/index.d.ts.map +1 -1
  6. package/dist/entities/cookie/index.js +5 -1
  7. package/dist/entities/cookie/index.js.map +7 -0
  8. package/dist/entities/environment/environment.js +10 -9
  9. package/dist/entities/environment/environment.js.map +7 -0
  10. package/dist/entities/environment/index.d.ts +1 -1
  11. package/dist/entities/environment/index.d.ts.map +1 -1
  12. package/dist/entities/environment/index.js +5 -1
  13. package/dist/entities/environment/index.js.map +7 -0
  14. package/dist/entities/hotkeys/hotkeys.js +109 -116
  15. package/dist/entities/hotkeys/hotkeys.js.map +7 -0
  16. package/dist/entities/hotkeys/index.d.ts +1 -1
  17. package/dist/entities/hotkeys/index.d.ts.map +1 -1
  18. package/dist/entities/hotkeys/index.js +6 -1
  19. package/dist/entities/hotkeys/index.js.map +7 -0
  20. package/dist/entities/shared/index.d.ts +1 -1
  21. package/dist/entities/shared/index.d.ts.map +1 -1
  22. package/dist/entities/shared/index.js +7 -1
  23. package/dist/entities/shared/index.js.map +7 -0
  24. package/dist/entities/shared/utility.js +9 -12
  25. package/dist/entities/shared/utility.js.map +7 -0
  26. package/dist/entities/spec/collection.d.ts.map +1 -1
  27. package/dist/entities/spec/collection.js +91 -94
  28. package/dist/entities/spec/collection.js.map +7 -0
  29. package/dist/entities/spec/index.d.ts +8 -8
  30. package/dist/entities/spec/index.d.ts.map +1 -1
  31. package/dist/entities/spec/index.js +59 -9
  32. package/dist/entities/spec/index.js.map +7 -0
  33. package/dist/entities/spec/operation.d.ts +1 -1
  34. package/dist/entities/spec/operation.d.ts.map +1 -1
  35. package/dist/entities/spec/operation.js +5 -8
  36. package/dist/entities/spec/operation.js.map +7 -0
  37. package/dist/entities/spec/operation.test.js +43 -0
  38. package/dist/entities/spec/operation.test.js.map +7 -0
  39. package/dist/entities/spec/parameters.d.ts +1 -1
  40. package/dist/entities/spec/parameters.d.ts.map +1 -1
  41. package/dist/entities/spec/parameters.js +40 -38
  42. package/dist/entities/spec/parameters.js.map +7 -0
  43. package/dist/entities/spec/parameters.test.js +71 -0
  44. package/dist/entities/spec/parameters.test.js.map +7 -0
  45. package/dist/entities/spec/request-example.test.js +637 -0
  46. package/dist/entities/spec/request-example.test.js.map +7 -0
  47. package/dist/entities/spec/request-examples.d.ts +3 -3
  48. package/dist/entities/spec/request-examples.d.ts.map +1 -1
  49. package/dist/entities/spec/request-examples.js +323 -338
  50. package/dist/entities/spec/request-examples.js.map +7 -0
  51. package/dist/entities/spec/requests.d.ts +6 -8
  52. package/dist/entities/spec/requests.d.ts.map +1 -1
  53. package/dist/entities/spec/requests.js +80 -101
  54. package/dist/entities/spec/requests.js.map +7 -0
  55. package/dist/entities/spec/server.js +47 -63
  56. package/dist/entities/spec/server.js.map +7 -0
  57. package/dist/entities/spec/server.test.js +120 -0
  58. package/dist/entities/spec/server.test.js.map +7 -0
  59. package/dist/entities/spec/spec-objects.d.ts.map +1 -1
  60. package/dist/entities/spec/spec-objects.js +77 -121
  61. package/dist/entities/spec/spec-objects.js.map +7 -0
  62. package/dist/entities/spec/spec-objects.test.js +205 -0
  63. package/dist/entities/spec/spec-objects.test.js.map +7 -0
  64. package/dist/entities/spec/x-scalar-environments.js +21 -18
  65. package/dist/entities/spec/x-scalar-environments.js.map +7 -0
  66. package/dist/entities/spec/x-scalar-environments.test.js +11 -0
  67. package/dist/entities/spec/x-scalar-environments.test.js.map +7 -0
  68. package/dist/entities/spec/x-scalar-secrets.js +8 -6
  69. package/dist/entities/spec/x-scalar-secrets.js.map +7 -0
  70. package/dist/entities/spec/x-scalar-secrets.test.js +11 -0
  71. package/dist/entities/spec/x-scalar-secrets.test.js.map +7 -0
  72. package/dist/entities/workspace/index.d.ts +1 -1
  73. package/dist/entities/workspace/index.d.ts.map +1 -1
  74. package/dist/entities/workspace/index.js +7 -1
  75. package/dist/entities/workspace/index.js.map +7 -0
  76. package/dist/entities/workspace/workspace.js +46 -50
  77. package/dist/entities/workspace/workspace.js.map +7 -0
  78. package/dist/helpers/create-hash.js +15 -18
  79. package/dist/helpers/create-hash.js.map +7 -0
  80. package/dist/helpers/ensure-protocol.js +9 -10
  81. package/dist/helpers/ensure-protocol.js.map +7 -0
  82. package/dist/helpers/ensure-protocol.test.js +70 -0
  83. package/dist/helpers/ensure-protocol.test.js.map +7 -0
  84. package/dist/helpers/fetch-document.js +24 -32
  85. package/dist/helpers/fetch-document.js.map +7 -0
  86. package/dist/helpers/fetch-document.test.js +63 -0
  87. package/dist/helpers/fetch-document.test.js.map +7 -0
  88. package/dist/helpers/fetch-with-proxy-fallback.js +20 -28
  89. package/dist/helpers/fetch-with-proxy-fallback.js.map +7 -0
  90. package/dist/helpers/find-variables.d.ts +1 -1
  91. package/dist/helpers/find-variables.d.ts.map +1 -1
  92. package/dist/helpers/find-variables.js +6 -8
  93. package/dist/helpers/find-variables.js.map +7 -0
  94. package/dist/helpers/find-variables.test.js +20 -0
  95. package/dist/helpers/find-variables.test.js.map +7 -0
  96. package/dist/helpers/http-methods.d.ts +1 -1
  97. package/dist/helpers/http-methods.d.ts.map +1 -1
  98. package/dist/helpers/http-methods.js +60 -66
  99. package/dist/helpers/http-methods.js.map +7 -0
  100. package/dist/helpers/http-status-codes.js +319 -317
  101. package/dist/helpers/http-status-codes.js.map +7 -0
  102. package/dist/helpers/index.d.ts +27 -27
  103. package/dist/helpers/index.d.ts.map +1 -1
  104. package/dist/helpers/index.js +73 -27
  105. package/dist/helpers/index.js.map +7 -0
  106. package/dist/helpers/is-defined.js +5 -14
  107. package/dist/helpers/is-defined.js.map +7 -0
  108. package/dist/helpers/is-defined.test.js +37 -0
  109. package/dist/helpers/is-defined.test.js.map +7 -0
  110. package/dist/helpers/is-local-url.js +11 -16
  111. package/dist/helpers/is-local-url.js.map +7 -0
  112. package/dist/helpers/is-local-url.test.js +40 -0
  113. package/dist/helpers/is-local-url.test.js.map +7 -0
  114. package/dist/helpers/is-valid-url.js +9 -18
  115. package/dist/helpers/is-valid-url.js.map +7 -0
  116. package/dist/helpers/is-valid-url.test.js +17 -0
  117. package/dist/helpers/is-valid-url.test.js.map +7 -0
  118. package/dist/helpers/iterate-title.js +11 -15
  119. package/dist/helpers/iterate-title.js.map +7 -0
  120. package/dist/helpers/json2xml.js +40 -47
  121. package/dist/helpers/json2xml.js.map +7 -0
  122. package/dist/helpers/json2xml.test.js +19 -0
  123. package/dist/helpers/json2xml.test.js.map +7 -0
  124. package/dist/helpers/local-storage.js +13 -15
  125. package/dist/helpers/local-storage.js.map +7 -0
  126. package/dist/helpers/make-url-absolute.js +11 -17
  127. package/dist/helpers/make-url-absolute.js.map +7 -0
  128. package/dist/helpers/make-url-absolute.test.js +61 -0
  129. package/dist/helpers/make-url-absolute.test.js.map +7 -0
  130. package/dist/helpers/merge-urls.js +50 -75
  131. package/dist/helpers/merge-urls.js.map +7 -0
  132. package/dist/helpers/merge-urls.test.js +339 -0
  133. package/dist/helpers/merge-urls.test.js.map +7 -0
  134. package/dist/helpers/normalize-mime-type-object.js +21 -31
  135. package/dist/helpers/normalize-mime-type-object.js.map +7 -0
  136. package/dist/helpers/normalize-mime-type-object.test.js +53 -0
  137. package/dist/helpers/normalize-mime-type-object.test.js.map +7 -0
  138. package/dist/helpers/normalize-mime-type.js +8 -18
  139. package/dist/helpers/normalize-mime-type.js.map +7 -0
  140. package/dist/helpers/normalize-mime-type.test.js +33 -0
  141. package/dist/helpers/normalize-mime-type.test.js.map +7 -0
  142. package/dist/helpers/object.js +12 -18
  143. package/dist/helpers/object.js.map +7 -0
  144. package/dist/helpers/omit-undefined-values.js +17 -19
  145. package/dist/helpers/omit-undefined-values.js.map +7 -0
  146. package/dist/helpers/omit-undefined-values.test.js +89 -0
  147. package/dist/helpers/omit-undefined-values.test.js.map +7 -0
  148. package/dist/helpers/parse.js +71 -83
  149. package/dist/helpers/parse.js.map +7 -0
  150. package/dist/helpers/parse.test.js +45 -0
  151. package/dist/helpers/parse.test.js.map +7 -0
  152. package/dist/helpers/pretty-print-json.js +31 -35
  153. package/dist/helpers/pretty-print-json.js.map +7 -0
  154. package/dist/helpers/pretty-print-json.test.js +28 -0
  155. package/dist/helpers/pretty-print-json.test.js.map +7 -0
  156. package/dist/helpers/redirect-to-proxy.js +46 -83
  157. package/dist/helpers/redirect-to-proxy.js.map +7 -0
  158. package/dist/helpers/redirect-to-proxy.test.js +54 -0
  159. package/dist/helpers/redirect-to-proxy.test.js.map +7 -0
  160. package/dist/helpers/regex-helpers.js +11 -9
  161. package/dist/helpers/regex-helpers.js.map +7 -0
  162. package/dist/helpers/regex-helpers.test.js +154 -0
  163. package/dist/helpers/regex-helpers.test.js.map +7 -0
  164. package/dist/helpers/replace-variables.js +13 -16
  165. package/dist/helpers/replace-variables.js.map +7 -0
  166. package/dist/helpers/replace-variables.test.js +30 -0
  167. package/dist/helpers/replace-variables.test.js.map +7 -0
  168. package/dist/helpers/schema-model.js +15 -14
  169. package/dist/helpers/schema-model.js.map +7 -0
  170. package/dist/helpers/security/get-schemes.d.ts +1 -1
  171. package/dist/helpers/security/get-schemes.d.ts.map +1 -1
  172. package/dist/helpers/security/get-schemes.js +7 -9
  173. package/dist/helpers/security/get-schemes.js.map +7 -0
  174. package/dist/helpers/security/get-schemes.test.js +71 -0
  175. package/dist/helpers/security/get-schemes.test.js.map +7 -0
  176. package/dist/helpers/security/has-token.js +18 -19
  177. package/dist/helpers/security/has-token.js.map +7 -0
  178. package/dist/helpers/security/has-token.test.js +157 -0
  179. package/dist/helpers/security/has-token.test.js.map +7 -0
  180. package/dist/helpers/security/index.d.ts +2 -2
  181. package/dist/helpers/security/index.d.ts.map +1 -1
  182. package/dist/helpers/security/index.js +7 -2
  183. package/dist/helpers/security/index.js.map +7 -0
  184. package/dist/helpers/should-ignore-entity.d.ts +2 -2
  185. package/dist/helpers/should-ignore-entity.d.ts.map +1 -1
  186. package/dist/helpers/should-ignore-entity.js +5 -6
  187. package/dist/helpers/should-ignore-entity.js.map +7 -0
  188. package/dist/helpers/ssr-state.js +6 -6
  189. package/dist/helpers/ssr-state.js.map +7 -0
  190. package/dist/helpers/string.js +6 -18
  191. package/dist/helpers/string.js.map +7 -0
  192. package/dist/migrations/data-version.js +7 -17
  193. package/dist/migrations/data-version.js.map +7 -0
  194. package/dist/migrations/generate-types.js +56 -0
  195. package/dist/migrations/generate-types.js.map +7 -0
  196. package/dist/migrations/index.d.ts +3 -3
  197. package/dist/migrations/index.d.ts.map +1 -1
  198. package/dist/migrations/index.js +10 -3
  199. package/dist/migrations/index.js.map +7 -0
  200. package/dist/migrations/local-storage.d.ts +1 -1
  201. package/dist/migrations/local-storage.d.ts.map +1 -1
  202. package/dist/migrations/local-storage.js +27 -32
  203. package/dist/migrations/local-storage.js.map +7 -0
  204. package/dist/migrations/migrator.d.ts +1 -1
  205. package/dist/migrations/migrator.d.ts.map +1 -1
  206. package/dist/migrations/migrator.js +51 -58
  207. package/dist/migrations/migrator.js.map +7 -0
  208. package/dist/migrations/semver.js +23 -25
  209. package/dist/migrations/semver.js.map +7 -0
  210. package/dist/migrations/semver.test.js +21 -0
  211. package/dist/migrations/semver.test.js.map +7 -0
  212. package/dist/migrations/v-0.0.0/types.generated.js +1 -0
  213. package/dist/migrations/v-0.0.0/types.generated.js.map +7 -0
  214. package/dist/migrations/v-2.1.0/migration.d.ts +2 -2
  215. package/dist/migrations/v-2.1.0/migration.d.ts.map +1 -1
  216. package/dist/migrations/v-2.1.0/migration.js +256 -273
  217. package/dist/migrations/v-2.1.0/migration.js.map +7 -0
  218. package/dist/migrations/v-2.1.0/types.generated.js +1 -0
  219. package/dist/migrations/v-2.1.0/types.generated.js.map +7 -0
  220. package/dist/migrations/v-2.2.0/migration.d.ts +2 -2
  221. package/dist/migrations/v-2.2.0/migration.d.ts.map +1 -1
  222. package/dist/migrations/v-2.2.0/migration.js +95 -100
  223. package/dist/migrations/v-2.2.0/migration.js.map +7 -0
  224. package/dist/migrations/v-2.2.0/types.generated.js +1 -0
  225. package/dist/migrations/v-2.2.0/types.generated.js.map +7 -0
  226. package/dist/migrations/v-2.3.0/migration.d.ts +2 -2
  227. package/dist/migrations/v-2.3.0/migration.d.ts.map +1 -1
  228. package/dist/migrations/v-2.3.0/migration.js +47 -46
  229. package/dist/migrations/v-2.3.0/migration.js.map +7 -0
  230. package/dist/migrations/v-2.3.0/types.generated.js +1 -0
  231. package/dist/migrations/v-2.3.0/types.generated.js.map +7 -0
  232. package/dist/migrations/v-2.4.0/migration.d.ts +2 -2
  233. package/dist/migrations/v-2.4.0/migration.d.ts.map +1 -1
  234. package/dist/migrations/v-2.4.0/migration.js +24 -26
  235. package/dist/migrations/v-2.4.0/migration.js.map +7 -0
  236. package/dist/migrations/v-2.4.0/migration.test.js +90 -0
  237. package/dist/migrations/v-2.4.0/migration.test.js.map +7 -0
  238. package/dist/migrations/v-2.4.0/types.generated.js +1 -0
  239. package/dist/migrations/v-2.4.0/types.generated.js.map +7 -0
  240. package/dist/migrations/v-2.5.0/migration.d.ts +2 -2
  241. package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -1
  242. package/dist/migrations/v-2.5.0/migration.js +135 -119
  243. package/dist/migrations/v-2.5.0/migration.js.map +7 -0
  244. package/dist/migrations/v-2.5.0/migration.test.js +108 -0
  245. package/dist/migrations/v-2.5.0/migration.test.js.map +7 -0
  246. package/dist/migrations/v-2.5.0/types.generated.d.ts +8 -8
  247. package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
  248. package/dist/migrations/v-2.5.0/types.generated.js +1 -0
  249. package/dist/migrations/v-2.5.0/types.generated.js.map +7 -0
  250. package/dist/spec-getters/get-example-from-schema.js +206 -268
  251. package/dist/spec-getters/get-example-from-schema.js.map +7 -0
  252. package/dist/spec-getters/get-example-from-schema.test.js +1092 -0
  253. package/dist/spec-getters/get-example-from-schema.test.js.map +7 -0
  254. package/dist/spec-getters/get-parameters-from-operation.js +22 -42
  255. package/dist/spec-getters/get-parameters-from-operation.js.map +7 -0
  256. package/dist/spec-getters/get-parameters-from-operation.test.js +178 -0
  257. package/dist/spec-getters/get-parameters-from-operation.test.js.map +7 -0
  258. package/dist/spec-getters/get-request-body-from-operation.js +110 -162
  259. package/dist/spec-getters/get-request-body-from-operation.js.map +7 -0
  260. package/dist/spec-getters/get-request-body-from-operation.test.js +289 -0
  261. package/dist/spec-getters/get-request-body-from-operation.test.js.map +7 -0
  262. package/dist/spec-getters/get-server-variable-examples.d.ts +1 -1
  263. package/dist/spec-getters/get-server-variable-examples.d.ts.map +1 -1
  264. package/dist/spec-getters/get-server-variable-examples.js +12 -11
  265. package/dist/spec-getters/get-server-variable-examples.js.map +7 -0
  266. package/dist/spec-getters/index.d.ts +4 -4
  267. package/dist/spec-getters/index.d.ts.map +1 -1
  268. package/dist/spec-getters/index.js +11 -4
  269. package/dist/spec-getters/index.js.map +7 -0
  270. package/dist/transforms/import-spec.d.ts +6 -6
  271. package/dist/transforms/import-spec.d.ts.map +1 -1
  272. package/dist/transforms/import-spec.js +313 -425
  273. package/dist/transforms/import-spec.js.map +7 -0
  274. package/dist/transforms/import-spec.test.js +1124 -0
  275. package/dist/transforms/import-spec.test.js.map +7 -0
  276. package/dist/transforms/index.d.ts +1 -1
  277. package/dist/transforms/index.d.ts.map +1 -1
  278. package/dist/transforms/index.js +7 -1
  279. package/dist/transforms/index.js.map +7 -0
  280. package/package.json +9 -10
@@ -1 +1 @@
1
- {"version":3,"file":"spec-objects.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/spec-objects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAEzB,mDAAmD;;IAEnD,2GAA2G;;IAE3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'@scalar/openapi-types/schemas/extensions';
3
- import { nanoidSchema } from '@scalar/types/utils';
4
- import { z } from 'zod';
5
-
6
- /**
7
- * License Object
8
- *
9
- * License information for the exposed API.
10
- *
11
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#license-object
12
- */
13
- const oasLicenseSchema = z
14
- .object({
15
- /** REQUIRED. The license name used for the API. */
16
- name: z.string().optional().nullable().catch(null),
17
- /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
18
- identifier: z.string().optional().catch(undefined),
19
- /**
20
- * A URI for the license used for the API. This MUST be in the form of a URI. The url field is mutually exclusive of the identifier field.
21
- */
22
- url: z.string().url().optional().catch(undefined),
23
- })
24
- .transform(omitUndefinedValues);
25
- /**
26
- * Contact Object
27
- *
28
- * Contact information for the exposed API.
29
- *
30
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#contact-object
31
- */
32
- const oasContactSchema = z
33
- .object({
34
- /** The identifying name of the contact person/organization. */
35
- name: z.string().optional(),
36
- /** The URL pointing to the contact information. This MUST be in the form of a URL. */
37
- url: z.string().url().optional().catch(undefined),
38
- /** The email address of the contact person/organization. This MUST be in the form of an email address. */
39
- email: z.string().optional().catch(undefined),
40
- })
41
- .transform(omitUndefinedValues);
42
- /**
43
- * Info Object
44
- *
45
- * The object provides metadata about the API. The metadata MAY be used by the clients if needed,
46
- * and MAY be presented in editing or documentation generation tools for convenience.
47
- *
48
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#info-object
49
- */
50
- const oasInfoSchema = z
51
- .object({
52
- /** REQUIRED. The title of the API. */
53
- title: z.string().catch('API'),
54
- /** A short summary of the API. */
55
- summary: z.string().optional().catch(undefined),
56
- /** A description of the API. CommonMark syntax MAY be used for rich text representation. */
57
- description: z.string().optional().catch(undefined),
58
- /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
59
- termsOfService: z.string().url().optional().catch(undefined),
60
- /** The contact information for the exposed API. */
61
- contact: oasContactSchema.optional().catch(undefined),
62
- /** The license information for the exposed API. */
63
- license: oasLicenseSchema.optional().catch(undefined),
64
- /**
65
- * REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the
66
- * version of the API being described or the version of the OpenAPI Description).
67
- */
68
- version: z.string().catch('1.0'),
69
- })
70
- .merge(XScalarSdkInstallationSchema)
71
- .transform(omitUndefinedValues);
72
- /**
73
- * External Documentation Object
74
- *
75
- * Allows referencing an external resource for extended documentation.
76
- *
77
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#external-documentation-object
78
- */
79
- const oasExternalDocumentationSchema = z
80
- .object({
81
- /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
82
- description: z.string().optional().catch(undefined),
83
- /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
84
- url: z.string(),
85
- })
86
- .transform(omitUndefinedValues);
87
- const xScalarNestedSchema = z
88
- .object({
89
- tagName: z.string(),
90
- })
91
- .array();
92
- /**
93
- * Tag Object
94
- *
95
- * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag
96
- * defined in the Operation Object instances.
97
- *
98
- * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object
99
- */
1
+ import { omitUndefinedValues } from "../../helpers/omit-undefined-values.js";
2
+ import { XScalarSdkInstallationSchema } from "@scalar/openapi-types/schemas/extensions";
3
+ import { nanoidSchema } from "@scalar/types/utils";
4
+ import { z } from "zod";
5
+ const oasLicenseSchema = z.object({
6
+ /** REQUIRED. The license name used for the API. */
7
+ name: z.string().optional().nullable().catch(null),
8
+ /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */
9
+ identifier: z.string().optional().catch(void 0),
10
+ /**
11
+ * A URI for the license used for the API. This MUST be in the form of a URI. The url field is mutually exclusive of the identifier field.
12
+ */
13
+ url: z.string().url().optional().catch(void 0)
14
+ }).transform(omitUndefinedValues);
15
+ const oasContactSchema = z.object({
16
+ /** The identifying name of the contact person/organization. */
17
+ name: z.string().optional(),
18
+ /** The URL pointing to the contact information. This MUST be in the form of a URL. */
19
+ url: z.string().url().optional().catch(void 0),
20
+ /** The email address of the contact person/organization. This MUST be in the form of an email address. */
21
+ email: z.string().optional().catch(void 0)
22
+ }).transform(omitUndefinedValues);
23
+ const oasInfoSchema = z.object({
24
+ /** REQUIRED. The title of the API. */
25
+ title: z.string().catch("API"),
26
+ /** A short summary of the API. */
27
+ summary: z.string().optional().catch(void 0),
28
+ /** A description of the API. CommonMark syntax MAY be used for rich text representation. */
29
+ description: z.string().optional().catch(void 0),
30
+ /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
31
+ termsOfService: z.string().url().optional().catch(void 0),
32
+ /** The contact information for the exposed API. */
33
+ contact: oasContactSchema.optional().catch(void 0),
34
+ /** The license information for the exposed API. */
35
+ license: oasLicenseSchema.optional().catch(void 0),
36
+ /**
37
+ * REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the
38
+ * version of the API being described or the version of the OpenAPI Description).
39
+ */
40
+ version: z.string().catch("1.0")
41
+ }).merge(XScalarSdkInstallationSchema).transform(omitUndefinedValues);
42
+ const oasExternalDocumentationSchema = z.object({
43
+ /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */
44
+ description: z.string().optional().catch(void 0),
45
+ /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
46
+ url: z.string()
47
+ }).transform(omitUndefinedValues);
48
+ const xScalarNestedSchema = z.object({
49
+ tagName: z.string()
50
+ }).array();
100
51
  const oasTagSchema = z.object({
101
- // TODO: Remove
102
- /**
103
- * @deprecated Needs to be remove as it is not a spec property
104
- */
105
- 'type': z.literal('tag').optional().default('tag'),
106
- /** REQUIRED. The name of the tag. */
107
- 'name': z.string(),
108
- /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
109
- 'description': z.string().optional().catch(undefined),
110
- /** Additional external documentation for this tag. */
111
- 'externalDocs': oasExternalDocumentationSchema.optional(),
112
- 'x-scalar-children': xScalarNestedSchema.default([]).optional(),
113
- /** Hide collections */
114
- 'x-internal': z.boolean().optional(),
115
- 'x-scalar-ignore': z.boolean().optional(),
52
+ // TODO: Remove
53
+ /**
54
+ * @deprecated Needs to be remove as it is not a spec property
55
+ */
56
+ "type": z.literal("tag").optional().default("tag"),
57
+ /** REQUIRED. The name of the tag. */
58
+ "name": z.string(),
59
+ /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
60
+ "description": z.string().optional().catch(void 0),
61
+ /** Additional external documentation for this tag. */
62
+ "externalDocs": oasExternalDocumentationSchema.optional(),
63
+ "x-scalar-children": xScalarNestedSchema.default([]).optional(),
64
+ /** Hide collections */
65
+ "x-internal": z.boolean().optional(),
66
+ "x-scalar-ignore": z.boolean().optional()
116
67
  });
117
68
  const tagSchema = oasTagSchema.extend({
118
- uid: nanoidSchema.brand(),
119
- children: z
120
- .union([z.string().brand(), z.string().brand()])
121
- .array()
122
- .default([]),
69
+ uid: nanoidSchema.brand(),
70
+ children: z.union([z.string().brand(), z.string().brand()]).array().default([])
123
71
  });
124
-
125
- export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, oasTagSchema, tagSchema, xScalarNestedSchema };
72
+ export {
73
+ oasContactSchema,
74
+ oasExternalDocumentationSchema,
75
+ oasInfoSchema,
76
+ oasLicenseSchema,
77
+ oasTagSchema,
78
+ tagSchema,
79
+ xScalarNestedSchema
80
+ };
81
+ //# sourceMappingURL=spec-objects.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/spec-objects.ts"],
4
+ "sourcesContent": ["import { omitUndefinedValues } from '@/helpers/omit-undefined-values'\nimport { XScalarSdkInstallationSchema } from '@scalar/openapi-types/schemas/extensions'\nimport { type ENTITY_BRANDS, nanoidSchema } from '@scalar/types/utils'\nimport { z } from 'zod'\n\n/**\n * License Object\n *\n * License information for the exposed API.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#license-object\n */\nexport const oasLicenseSchema = z\n .object({\n /** REQUIRED. The license name used for the API. */\n name: z.string().optional().nullable().catch(null),\n /** An SPDX license expression for the API. The identifier field is mutually exclusive of the url field. */\n identifier: z.string().optional().catch(undefined),\n /**\n * A URI for the license used for the API. This MUST be in the form of a URI. The url field is mutually exclusive of the identifier field.\n */\n url: z.string().url().optional().catch(undefined),\n })\n .transform(omitUndefinedValues)\n\n/**\n * Contact Object\n *\n * Contact information for the exposed API.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#contact-object\n */\nexport const oasContactSchema = z\n .object({\n /** The identifying name of the contact person/organization. */\n name: z.string().optional(),\n /** The URL pointing to the contact information. This MUST be in the form of a URL. */\n url: z.string().url().optional().catch(undefined),\n /** The email address of the contact person/organization. This MUST be in the form of an email address. */\n email: z.string().optional().catch(undefined),\n })\n .transform(omitUndefinedValues)\n\n/**\n * Info Object\n *\n * The object provides metadata about the API. The metadata MAY be used by the clients if needed,\n * and MAY be presented in editing or documentation generation tools for convenience.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#info-object\n */\nexport const oasInfoSchema = z\n .object({\n /** REQUIRED. The title of the API. */\n title: z.string().catch('API'),\n /** A short summary of the API. */\n summary: z.string().optional().catch(undefined),\n /** A description of the API. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional().catch(undefined),\n /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */\n termsOfService: z.string().url().optional().catch(undefined),\n /** The contact information for the exposed API. */\n contact: oasContactSchema.optional().catch(undefined),\n /** The license information for the exposed API. */\n license: oasLicenseSchema.optional().catch(undefined),\n /**\n * REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification version or the\n * version of the API being described or the version of the OpenAPI Description).\n */\n version: z.string().catch('1.0'),\n })\n .merge(XScalarSdkInstallationSchema)\n .transform(omitUndefinedValues)\n\n/**\n * External Documentation Object\n *\n * Allows referencing an external resource for extended documentation.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#external-documentation-object\n */\nexport const oasExternalDocumentationSchema = z\n .object({\n /** A description of the target documentation. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional().catch(undefined),\n /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */\n url: z.string(),\n })\n .transform(omitUndefinedValues)\n\nexport type ExternalDocumentation = z.infer<typeof oasExternalDocumentationSchema>\n\nexport const xScalarNestedSchema = z\n .object({\n tagName: z.string(),\n })\n .array()\n\n/**\n * Tag Object\n *\n * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag\n * defined in the Operation Object instances.\n *\n * @see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#tag-object\n */\nexport const oasTagSchema = z.object({\n // TODO: Remove\n /**\n * @deprecated Needs to be remove as it is not a spec property\n */\n 'type': z.literal('tag').optional().default('tag'),\n /** REQUIRED. The name of the tag. */\n 'name': z.string(),\n /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */\n 'description': z.string().optional().catch(undefined),\n /** Additional external documentation for this tag. */\n 'externalDocs': oasExternalDocumentationSchema.optional(),\n 'x-scalar-children': xScalarNestedSchema.default([]).optional(),\n /** Hide collections */\n 'x-internal': z.boolean().optional(),\n 'x-scalar-ignore': z.boolean().optional(),\n})\n\nexport const tagSchema = oasTagSchema.extend({\n uid: nanoidSchema.brand<ENTITY_BRANDS['TAG']>(),\n children: z\n .union([z.string().brand<ENTITY_BRANDS['OPERATION']>(), z.string().brand<ENTITY_BRANDS['TAG']>()])\n .array()\n .default([]),\n})\n\nexport type Tag = z.infer<typeof tagSchema>\nexport type TagPayload = z.input<typeof tagSchema>\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAA6B,oBAAoB;AACjD,SAAS,SAAS;AASX,MAAM,mBAAmB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AAC,EACA,UAAU,mBAAmB;AAIzB,MAAM,sBAAsB,EAChC,OAAO;AAAA,EACN,SAAS,EAAE,OAAO;AACpB,CAAC,EACA,MAAM;AAUF,MAAM,eAAe,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnC,QAAQ,EAAE,QAAQ,KAAK,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA;AAAA,EAEjD,QAAQ,EAAE,OAAO;AAAA;AAAA,EAEjB,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAS;AAAA;AAAA,EAEpD,gBAAgB,+BAA+B,SAAS;AAAA,EACxD,qBAAqB,oBAAoB,QAAQ,CAAC,CAAC,EAAE,SAAS;AAAA;AAAA,EAE9D,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA,EACnC,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAC1C,CAAC;AAEM,MAAM,YAAY,aAAa,OAAO;AAAA,EAC3C,KAAK,aAAa,MAA4B;AAAA,EAC9C,UAAU,EACP,MAAM,CAAC,EAAE,OAAO,EAAE,MAAkC,GAAG,EAAE,OAAO,EAAE,MAA4B,CAAC,CAAC,EAChG,MAAM,EACN,QAAQ,CAAC,CAAC;AACf,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,205 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { oasInfoSchema } from "./spec-objects.js";
3
+ describe("spec-objects", () => {
4
+ describe("oasInfoSchema", () => {
5
+ describe("title", () => {
6
+ it("parses title", () => {
7
+ const title = oasInfoSchema.parse({
8
+ title: "My API"
9
+ });
10
+ expect(title).toMatchObject({
11
+ title: "My API"
12
+ });
13
+ });
14
+ it("defaults to API", () => {
15
+ const title = oasInfoSchema.parse({});
16
+ expect(title).toMatchObject({
17
+ title: "API"
18
+ });
19
+ });
20
+ it("ignores invalid title", () => {
21
+ const title = oasInfoSchema.parse({
22
+ title: 123
23
+ });
24
+ expect(title).toMatchObject({ title: "API" });
25
+ });
26
+ });
27
+ describe("summary", () => {
28
+ it("parses summary", () => {
29
+ const info = oasInfoSchema.parse({
30
+ summary: "A brief summary of the API"
31
+ });
32
+ expect(info).toMatchObject({
33
+ summary: "A brief summary of the API"
34
+ });
35
+ });
36
+ it("ignores invalid summary", () => {
37
+ const info = oasInfoSchema.parse({
38
+ summary: 123
39
+ });
40
+ expect(info.summary).toBeUndefined();
41
+ });
42
+ });
43
+ describe("description", () => {
44
+ it("parses description", () => {
45
+ const info = oasInfoSchema.parse({
46
+ description: "A detailed description of the API"
47
+ });
48
+ expect(info).toMatchObject({
49
+ description: "A detailed description of the API"
50
+ });
51
+ });
52
+ it("ignores invalid description", () => {
53
+ const info = oasInfoSchema.parse({
54
+ description: 123
55
+ });
56
+ expect(info.description).toBeUndefined();
57
+ });
58
+ });
59
+ describe("version", () => {
60
+ it("parses version", () => {
61
+ const version = oasInfoSchema.parse({
62
+ version: "1.0.0"
63
+ });
64
+ expect(version).toMatchObject({ version: "1.0.0" });
65
+ });
66
+ it("defaults to 1.0", () => {
67
+ const version = oasInfoSchema.parse({});
68
+ expect(version).toMatchObject({ version: "1.0" });
69
+ });
70
+ it("ignores invalid version", () => {
71
+ const version = oasInfoSchema.parse({
72
+ version: 123
73
+ });
74
+ expect(version).toMatchObject({ version: "1.0" });
75
+ });
76
+ });
77
+ describe("contact", () => {
78
+ it("parses contact object", () => {
79
+ const info = oasInfoSchema.parse({
80
+ contact: {
81
+ name: "John Doe",
82
+ url: "https://example.com",
83
+ email: "john.doe@example.com"
84
+ }
85
+ });
86
+ expect(info).toMatchObject({
87
+ contact: {
88
+ name: "John Doe",
89
+ url: "https://example.com",
90
+ email: "john.doe@example.com"
91
+ }
92
+ });
93
+ });
94
+ it("ignores invalid contact", () => {
95
+ const info = oasInfoSchema.parse({
96
+ contact: 123
97
+ });
98
+ expect(info.contact).toStrictEqual(void 0);
99
+ });
100
+ it("works with just the name", () => {
101
+ const info = oasInfoSchema.parse({
102
+ contact: {
103
+ name: "John Doe"
104
+ }
105
+ });
106
+ expect(info).toMatchObject({
107
+ contact: {
108
+ name: "John Doe"
109
+ }
110
+ });
111
+ });
112
+ it("works with just the url", () => {
113
+ const info = oasInfoSchema.parse({
114
+ contact: {
115
+ url: "https://example.com"
116
+ }
117
+ });
118
+ expect(info).toMatchObject({
119
+ contact: {
120
+ url: "https://example.com"
121
+ }
122
+ });
123
+ });
124
+ it("works with just the email", () => {
125
+ const info = oasInfoSchema.parse({
126
+ contact: {
127
+ email: "john.doe@example.com"
128
+ }
129
+ });
130
+ expect(info).toMatchObject({
131
+ contact: {
132
+ email: "john.doe@example.com"
133
+ }
134
+ });
135
+ });
136
+ it("keeps invalid emails", () => {
137
+ const info = oasInfoSchema.parse({
138
+ contact: {
139
+ name: "John Doe",
140
+ url: "invalid",
141
+ email: "invalid",
142
+ something: "random"
143
+ }
144
+ });
145
+ expect(info.contact).toStrictEqual({
146
+ name: "John Doe",
147
+ email: "invalid"
148
+ });
149
+ });
150
+ });
151
+ describe("license", () => {
152
+ it("parses license object", () => {
153
+ const info = oasInfoSchema.parse({
154
+ license: {
155
+ name: "MIT",
156
+ url: "https://opensource.org/licenses/MIT",
157
+ identifier: "MIT"
158
+ }
159
+ });
160
+ expect(info).toMatchObject({
161
+ license: {
162
+ name: "MIT",
163
+ url: "https://opensource.org/licenses/MIT",
164
+ identifier: "MIT"
165
+ }
166
+ });
167
+ });
168
+ it("ignores invalid license", () => {
169
+ const info = oasInfoSchema.parse({
170
+ license: 123
171
+ });
172
+ expect(info.license).toStrictEqual(void 0);
173
+ });
174
+ it("works with just the name", () => {
175
+ const info = oasInfoSchema.parse({
176
+ license: {
177
+ name: "MIT"
178
+ }
179
+ });
180
+ expect(info).toMatchObject({
181
+ license: {
182
+ name: "MIT"
183
+ }
184
+ });
185
+ });
186
+ });
187
+ describe("termsOfService", () => {
188
+ it("parses termsOfService", () => {
189
+ const info = oasInfoSchema.parse({
190
+ termsOfService: "https://example.com/terms-of-service"
191
+ });
192
+ expect(info).toMatchObject({
193
+ termsOfService: "https://example.com/terms-of-service"
194
+ });
195
+ });
196
+ it("ignores invalid termsOfService", () => {
197
+ const info = oasInfoSchema.parse({
198
+ termsOfService: 123
199
+ });
200
+ expect(info.termsOfService).toStrictEqual(void 0);
201
+ });
202
+ });
203
+ });
204
+ });
205
+ //# sourceMappingURL=spec-objects.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/spec-objects.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { oasInfoSchema } from './spec-objects'\n\ndescribe('spec-objects', () => {\n describe('oasInfoSchema', () => {\n describe('title', () => {\n it('parses title', () => {\n const title = oasInfoSchema.parse({\n title: 'My API',\n })\n\n expect(title).toMatchObject({\n title: 'My API',\n })\n })\n\n it('defaults to API', () => {\n const title = oasInfoSchema.parse({})\n\n expect(title).toMatchObject({\n title: 'API',\n })\n })\n\n it('ignores invalid title', () => {\n const title = oasInfoSchema.parse({\n title: 123,\n })\n\n expect(title).toMatchObject({ title: 'API' })\n })\n })\n\n describe('summary', () => {\n it('parses summary', () => {\n const info = oasInfoSchema.parse({\n summary: 'A brief summary of the API',\n })\n\n expect(info).toMatchObject({\n summary: 'A brief summary of the API',\n })\n })\n\n it('ignores invalid summary', () => {\n const info = oasInfoSchema.parse({\n summary: 123,\n })\n\n expect(info.summary).toBeUndefined()\n })\n })\n\n describe('description', () => {\n it('parses description', () => {\n const info = oasInfoSchema.parse({\n description: 'A detailed description of the API',\n })\n\n expect(info).toMatchObject({\n description: 'A detailed description of the API',\n })\n })\n\n it('ignores invalid description', () => {\n const info = oasInfoSchema.parse({\n description: 123,\n })\n\n expect(info.description).toBeUndefined()\n })\n })\n\n describe('version', () => {\n it('parses version', () => {\n const version = oasInfoSchema.parse({\n version: '1.0.0',\n })\n\n expect(version).toMatchObject({ version: '1.0.0' })\n })\n\n it('defaults to 1.0', () => {\n const version = oasInfoSchema.parse({})\n\n expect(version).toMatchObject({ version: '1.0' })\n })\n\n it('ignores invalid version', () => {\n const version = oasInfoSchema.parse({\n version: 123,\n })\n\n expect(version).toMatchObject({ version: '1.0' })\n })\n })\n\n describe('contact', () => {\n it('parses contact object', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n url: 'https://example.com',\n email: 'john.doe@example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n name: 'John Doe',\n url: 'https://example.com',\n email: 'john.doe@example.com',\n },\n })\n })\n\n it('ignores invalid contact', () => {\n const info = oasInfoSchema.parse({\n contact: 123,\n })\n\n expect(info.contact).toStrictEqual(undefined)\n })\n\n it('works with just the name', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n name: 'John Doe',\n },\n })\n })\n\n it('works with just the url', () => {\n const info = oasInfoSchema.parse({\n contact: {\n url: 'https://example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n url: 'https://example.com',\n },\n })\n })\n\n it('works with just the email', () => {\n const info = oasInfoSchema.parse({\n contact: {\n email: 'john.doe@example.com',\n },\n })\n\n expect(info).toMatchObject({\n contact: {\n email: 'john.doe@example.com',\n },\n })\n })\n\n it('keeps invalid emails', () => {\n const info = oasInfoSchema.parse({\n contact: {\n name: 'John Doe',\n url: 'invalid',\n email: 'invalid',\n something: 'random',\n },\n })\n\n expect(info.contact).toStrictEqual({\n name: 'John Doe',\n email: 'invalid',\n })\n })\n })\n\n describe('license', () => {\n it('parses license object', () => {\n const info = oasInfoSchema.parse({\n license: {\n name: 'MIT',\n url: 'https://opensource.org/licenses/MIT',\n identifier: 'MIT',\n },\n })\n\n expect(info).toMatchObject({\n license: {\n name: 'MIT',\n url: 'https://opensource.org/licenses/MIT',\n identifier: 'MIT',\n },\n })\n })\n\n it('ignores invalid license', () => {\n const info = oasInfoSchema.parse({\n license: 123,\n })\n\n expect(info.license).toStrictEqual(undefined)\n })\n\n it('works with just the name', () => {\n const info = oasInfoSchema.parse({\n license: {\n name: 'MIT',\n },\n })\n\n expect(info).toMatchObject({\n license: {\n name: 'MIT',\n },\n })\n })\n })\n\n describe('termsOfService', () => {\n it('parses termsOfService', () => {\n const info = oasInfoSchema.parse({\n termsOfService: 'https://example.com/terms-of-service',\n })\n\n expect(info).toMatchObject({\n termsOfService: 'https://example.com/terms-of-service',\n })\n })\n\n it('ignores invalid termsOfService', () => {\n const info = oasInfoSchema.parse({\n termsOfService: 123,\n })\n\n expect(info.termsOfService).toStrictEqual(undefined)\n })\n })\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,qBAAqB;AAE9B,SAAS,gBAAgB,MAAM;AAC7B,WAAS,iBAAiB,MAAM;AAC9B,aAAS,SAAS,MAAM;AACtB,SAAG,gBAAgB,MAAM;AACvB,cAAM,QAAQ,cAAc,MAAM;AAAA,UAChC,OAAO;AAAA,QACT,CAAC;AAED,eAAO,KAAK,EAAE,cAAc;AAAA,UAC1B,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,SAAG,mBAAmB,MAAM;AAC1B,cAAM,QAAQ,cAAc,MAAM,CAAC,CAAC;AAEpC,eAAO,KAAK,EAAE,cAAc;AAAA,UAC1B,OAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAED,SAAG,yBAAyB,MAAM;AAChC,cAAM,QAAQ,cAAc,MAAM;AAAA,UAChC,OAAO;AAAA,QACT,CAAC;AAED,eAAO,KAAK,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC;AAAA,MAC9C,CAAC;AAAA,IACH,CAAC;AAED,aAAS,WAAW,MAAM;AACxB,SAAG,kBAAkB,MAAM;AACzB,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,SAAS;AAAA,QACX,CAAC;AAED,eAAO,IAAI,EAAE,cAAc;AAAA,UACzB,SAAS;AAAA,QACX,CAAC;AAAA,MACH,CAAC;AAED,SAAG,2BAA2B,MAAM;AAClC,cAAM,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AAG,yBAAyB,MAAM;AAChC,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,SAAS;AAAA,YACP,MAAM;AAAA,YACN,KAAK;AAAA,YACL,YAAY;AAAA,UACd;AAAA,QACF,CAAC;AAED,eAAO,IAAI,EAAE,cAAc;AAAA,UACzB,SAAS;AAAA,YACP,MAAM;AAAA,YACN,KAAK;AAAA,YACL,YAAY;AAAA,UACd;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAED,SAAG,2BAA2B,MAAM;AAClC,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,SAAS;AAAA,QACX,CAAC;AAED,eAAO,KAAK,OAAO,EAAE,cAAc,MAAS;AAAA,MAC9C,CAAC;AAED,SAAG,4BAA4B,MAAM;AACnC,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,SAAS;AAAA,YACP,MAAM;AAAA,UACR;AAAA,QACF,CAAC;AAED,eAAO,IAAI,EAAE,cAAc;AAAA,UACzB,SAAS;AAAA,YACP,MAAM;AAAA,UACR;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAAA,IACH,CAAC;AAED,aAAS,kBAAkB,MAAM;AAC/B,SAAG,yBAAyB,MAAM;AAChC,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,gBAAgB;AAAA,QAClB,CAAC;AAED,eAAO,IAAI,EAAE,cAAc;AAAA,UACzB,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH,CAAC;AAED,SAAG,kCAAkC,MAAM;AACzC,cAAM,OAAO,cAAc,MAAM;AAAA,UAC/B,gBAAgB;AAAA,QAClB,CAAC;AAED,eAAO,KAAK,cAAc,EAAE,cAAc,MAAS;AAAA,MACrD,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,23 +1,26 @@
1
- import { z } from 'zod';
2
-
1
+ import { z } from "zod";
3
2
  const xScalarEnvVarSchema = z.union([
4
- z.object({
5
- description: z.string().optional(),
6
- default: z.string().default(''),
7
- }),
8
- z.string(),
3
+ z.object({
4
+ description: z.string().optional(),
5
+ default: z.string().default("")
6
+ }),
7
+ z.string()
9
8
  ]);
10
9
  const xScalarEnvironmentSchema = z.object({
11
- description: z.string().optional(),
12
- color: z.string().optional(),
13
- /** A map of variables by name */
14
- variables: z.record(z.string(), xScalarEnvVarSchema),
10
+ description: z.string().optional(),
11
+ color: z.string().optional(),
12
+ /** A map of variables by name */
13
+ variables: z.record(z.string(), xScalarEnvVarSchema)
15
14
  });
16
- /** A map of environments by name */
17
15
  const xScalarEnvironmentsSchema = z.record(
18
- /** Name */
19
- z.string(),
20
- /** Environment definition */
21
- xScalarEnvironmentSchema);
22
-
23
- export { xScalarEnvVarSchema, xScalarEnvironmentSchema, xScalarEnvironmentsSchema };
16
+ /** Name */
17
+ z.string(),
18
+ /** Environment definition */
19
+ xScalarEnvironmentSchema
20
+ );
21
+ export {
22
+ xScalarEnvVarSchema,
23
+ xScalarEnvironmentSchema,
24
+ xScalarEnvironmentsSchema
25
+ };
26
+ //# sourceMappingURL=x-scalar-environments.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/x-scalar-environments.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\nexport type XScalarEnvVar = z.infer<typeof xScalarEnvVarSchema>\n\nexport const xScalarEnvVarSchema = z.union([\n z.object({\n description: z.string().optional(),\n default: z.string().default(''),\n }),\n z.string(),\n])\n\nexport const xScalarEnvironmentSchema = z.object({\n description: z.string().optional(),\n color: z.string().optional(),\n /** A map of variables by name */\n variables: z.record(z.string(), xScalarEnvVarSchema),\n})\n\n/** A map of environments by name */\nexport const xScalarEnvironmentsSchema = z.record(\n /** Name */\n z.string(),\n /** Environment definition */\n xScalarEnvironmentSchema,\n)\n\nexport type XScalarEnvironment = z.infer<typeof xScalarEnvironmentSchema>\nexport type XScalarEnvironments = z.infer<typeof xScalarEnvironmentsSchema>\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAIX,MAAM,sBAAsB,EAAE,MAAM;AAAA,EACzC,EAAE,OAAO;AAAA,IACP,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,IACjC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;AAAA,EAChC,CAAC;AAAA,EACD,EAAE,OAAO;AACX,CAAC;AAEM,MAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAE3B,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB;AACrD,CAAC;AAGM,MAAM,4BAA4B,EAAE;AAAA;AAAA,EAEzC,EAAE,OAAO;AAAA;AAAA,EAET;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { parseJsonOrYaml } from "../../helpers/parse.js";
3
+ import baseDefinition from "@/spec-extentions/x-scalar-environments.yaml?raw";
4
+ import { xScalarEnvironmentsSchema } from "./x-scalar-environments.js";
5
+ describe("x-scalar-environments", () => {
6
+ it("Handles spec definition", () => {
7
+ const parsed = parseJsonOrYaml(baseDefinition);
8
+ expect(xScalarEnvironmentsSchema.parse(parsed["x-scalar-environments"])).toEqual(parsed["x-scalar-environments"]);
9
+ });
10
+ });
11
+ //# sourceMappingURL=x-scalar-environments.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/x-scalar-environments.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { parseJsonOrYaml } from '@/helpers/parse'\nimport baseDefinition from '@/spec-extentions/x-scalar-environments.yaml?raw'\nimport { xScalarEnvironmentsSchema } from './x-scalar-environments'\n\ndescribe('x-scalar-environments', () => {\n it('Handles spec definition', () => {\n const parsed = parseJsonOrYaml(baseDefinition)\n\n expect(xScalarEnvironmentsSchema.parse(parsed['x-scalar-environments'])).toEqual(parsed['x-scalar-environments'])\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAChC,OAAO,oBAAoB;AAC3B,SAAS,iCAAiC;AAE1C,SAAS,yBAAyB,MAAM;AACtC,KAAG,2BAA2B,MAAM;AAClC,UAAM,SAAS,gBAAgB,cAAc;AAE7C,WAAO,0BAA0B,MAAM,OAAO,uBAAuB,CAAC,CAAC,EAAE,QAAQ,OAAO,uBAAuB,CAAC;AAAA,EAClH,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,9 +1,11 @@
1
- import { z } from 'zod';
2
-
1
+ import { z } from "zod";
3
2
  const xScalarSecretVarSchema = z.object({
4
- description: z.string().optional(),
5
- example: z.string().optional(),
3
+ description: z.string().optional(),
4
+ example: z.string().optional()
6
5
  });
7
6
  const xScalarSecretsSchema = z.record(z.string(), xScalarSecretVarSchema);
8
-
9
- export { xScalarSecretVarSchema, xScalarSecretsSchema };
7
+ export {
8
+ xScalarSecretVarSchema,
9
+ xScalarSecretsSchema
10
+ };
11
+ //# sourceMappingURL=x-scalar-secrets.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/x-scalar-secrets.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\nexport const xScalarSecretVarSchema = z.object({\n description: z.string().optional(),\n example: z.string().optional(),\n})\n\nexport const xScalarSecretsSchema = z.record(z.string(), xScalarSecretVarSchema)\nexport type XScalarSecrets = z.infer<typeof xScalarSecretsSchema>\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAEX,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,MAAM,uBAAuB,EAAE,OAAO,EAAE,OAAO,GAAG,sBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { parseJsonOrYaml } from "../../helpers/parse.js";
3
+ import baseDefinition from "@/spec-extentions/x-scalar-environments.yaml?raw";
4
+ import { xScalarSecretsSchema } from "./x-scalar-secrets.js";
5
+ describe("x-scalar-secrets", () => {
6
+ it("Handles spec definition", () => {
7
+ const parsed = parseJsonOrYaml(baseDefinition);
8
+ expect(xScalarSecretsSchema.parse(parsed["x-scalar-secrets"])).toEqual(parsed["x-scalar-secrets"]);
9
+ });
10
+ });
11
+ //# sourceMappingURL=x-scalar-secrets.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/spec/x-scalar-secrets.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { parseJsonOrYaml } from '@/helpers/parse'\nimport baseDefinition from '@/spec-extentions/x-scalar-environments.yaml?raw'\nimport { xScalarSecretsSchema } from './x-scalar-secrets'\n\ndescribe('x-scalar-secrets', () => {\n it('Handles spec definition', () => {\n const parsed = parseJsonOrYaml(baseDefinition)\n\n expect(xScalarSecretsSchema.parse(parsed['x-scalar-secrets'])).toEqual(parsed['x-scalar-secrets'])\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,uBAAuB;AAChC,OAAO,oBAAoB;AAC3B,SAAS,4BAA4B;AAErC,SAAS,oBAAoB,MAAM;AACjC,KAAG,2BAA2B,MAAM;AAClC,UAAM,SAAS,gBAAgB,cAAc;AAE7C,WAAO,qBAAqB,MAAM,OAAO,kBAAkB,CAAC,CAAC,EAAE,QAAQ,OAAO,kBAAkB,CAAC;AAAA,EACnG,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- export { type HotKeyConfig, type HotKeyModifiers, type Workspace, type WorkspacePayload, workspaceSchema, } from './workspace.ts';
1
+ export { type HotKeyConfig, type HotKeyModifiers, type Workspace, type WorkspacePayload, workspaceSchema, } from './workspace.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,aAAa,CAAA"}
@@ -1 +1,7 @@
1
- export { workspaceSchema } from './workspace.js';
1
+ import {
2
+ workspaceSchema
3
+ } from "./workspace.js";
4
+ export {
5
+ workspaceSchema
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/entities/workspace/index.ts"],
4
+ "sourcesContent": ["export {\n type HotKeyConfig,\n type HotKeyModifiers,\n type Workspace,\n type WorkspacePayload,\n workspaceSchema,\n} from './workspace'\n"],
5
+ "mappings": "AAAA;AAAA,EAKE;AAAA,OACK;",
6
+ "names": []
7
+ }