@scalar/workspace-store 0.12.0 → 0.14.1

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 (431) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/client.d.ts +261 -33
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +176 -282
  5. package/dist/client.js.map +2 -2
  6. package/dist/helpers/apply-selective-updates.d.ts +1 -1
  7. package/dist/helpers/apply-selective-updates.d.ts.map +1 -1
  8. package/dist/helpers/apply-selective-updates.js +1 -1
  9. package/dist/helpers/apply-selective-updates.js.map +2 -2
  10. package/dist/helpers/deep-clone.d.ts +21 -0
  11. package/dist/helpers/deep-clone.d.ts.map +1 -0
  12. package/dist/helpers/deep-clone.js +18 -0
  13. package/dist/helpers/deep-clone.js.map +7 -0
  14. package/dist/helpers/get-resolved-ref.d.ts +19 -0
  15. package/dist/helpers/get-resolved-ref.d.ts.map +1 -0
  16. package/dist/helpers/get-resolved-ref.js +13 -0
  17. package/dist/helpers/get-resolved-ref.js.map +7 -0
  18. package/dist/helpers/merge-object.d.ts +9 -1
  19. package/dist/helpers/merge-object.d.ts.map +1 -1
  20. package/dist/helpers/merge-object.js +10 -2
  21. package/dist/helpers/merge-object.js.map +2 -2
  22. package/dist/helpers/overrides-proxy.d.ts +43 -1
  23. package/dist/helpers/overrides-proxy.d.ts.map +1 -1
  24. package/dist/helpers/overrides-proxy.js +2 -2
  25. package/dist/helpers/overrides-proxy.js.map +2 -2
  26. package/dist/mutators/helpers.d.ts +2 -34830
  27. package/dist/mutators/helpers.d.ts.map +1 -1
  28. package/dist/mutators/helpers.js.map +2 -2
  29. package/dist/mutators/request-example.d.ts.map +1 -1
  30. package/dist/mutators/request-example.js +4 -7
  31. package/dist/mutators/request-example.js.map +2 -2
  32. package/dist/navigation/helpers/traverse-document.js +2 -2
  33. package/dist/navigation/helpers/traverse-document.js.map +2 -2
  34. package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
  35. package/dist/navigation/helpers/traverse-paths.js +8 -5
  36. package/dist/navigation/helpers/traverse-paths.js.map +2 -2
  37. package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
  38. package/dist/navigation/helpers/traverse-schemas.js +8 -5
  39. package/dist/navigation/helpers/traverse-schemas.js.map +2 -2
  40. package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
  41. package/dist/navigation/helpers/traverse-webhooks.js +9 -5
  42. package/dist/navigation/helpers/traverse-webhooks.js.map +2 -2
  43. package/dist/navigation/types.d.ts +3 -3
  44. package/dist/navigation/types.d.ts.map +1 -1
  45. package/dist/plugins.d.ts +93 -0
  46. package/dist/plugins.d.ts.map +1 -0
  47. package/dist/plugins.js +107 -0
  48. package/dist/plugins.js.map +7 -0
  49. package/dist/schemas/extensions/document/x-internal.d.ts +4 -0
  50. package/dist/schemas/extensions/document/x-internal.d.ts.map +1 -0
  51. package/dist/schemas/extensions/document/x-internal.js +8 -0
  52. package/dist/schemas/extensions/document/x-internal.js.map +7 -0
  53. package/dist/schemas/extensions/document/x-scalar-icon.d.ts +4 -0
  54. package/dist/schemas/extensions/document/x-scalar-icon.d.ts.map +1 -0
  55. package/dist/schemas/extensions/document/x-scalar-icon.js +8 -0
  56. package/dist/schemas/extensions/document/x-scalar-icon.js.map +7 -0
  57. package/dist/schemas/extensions/document/x-scalar-ignore.d.ts +4 -0
  58. package/dist/schemas/extensions/document/x-scalar-ignore.d.ts.map +1 -0
  59. package/dist/schemas/extensions/document/x-scalar-ignore.js +8 -0
  60. package/dist/schemas/extensions/document/x-scalar-ignore.js.map +7 -0
  61. package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts +8 -0
  62. package/dist/schemas/extensions/document/x-scalar-sdk-installation.d.ts.map +1 -0
  63. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +16 -0
  64. package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +7 -0
  65. package/dist/schemas/extensions/operation/x-badge.d.ts +58 -0
  66. package/dist/schemas/extensions/operation/x-badge.d.ts.map +1 -0
  67. package/dist/schemas/extensions/operation/x-badge.js +41 -0
  68. package/dist/schemas/extensions/operation/x-badge.js.map +7 -0
  69. package/dist/schemas/extensions/operation/x-code-samples.d.ts +23 -0
  70. package/dist/schemas/extensions/operation/x-code-samples.d.ts.map +1 -0
  71. package/dist/schemas/extensions/operation/x-code-samples.js +16 -0
  72. package/dist/schemas/extensions/operation/x-code-samples.js.map +7 -0
  73. package/dist/schemas/extensions/operation/x-post-response.d.ts +19 -0
  74. package/dist/schemas/extensions/operation/x-post-response.d.ts.map +1 -0
  75. package/dist/schemas/extensions/operation/x-post-response.js +8 -0
  76. package/dist/schemas/extensions/operation/x-post-response.js.map +7 -0
  77. package/dist/schemas/extensions/operation/x-scalar-stability.d.ts +18 -0
  78. package/dist/schemas/extensions/operation/x-scalar-stability.d.ts.map +1 -0
  79. package/dist/schemas/extensions/operation/x-scalar-stability.js +16 -0
  80. package/dist/schemas/extensions/operation/x-scalar-stability.js.map +7 -0
  81. package/dist/schemas/extensions/schema/x-additional-properties-name.d.ts +11 -0
  82. package/dist/schemas/extensions/schema/x-additional-properties-name.d.ts.map +1 -0
  83. package/dist/schemas/extensions/schema/x-additional-properties-name.js +8 -0
  84. package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +7 -0
  85. package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts +17 -0
  86. package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts.map +1 -0
  87. package/dist/schemas/extensions/schema/x-enum-descriptions.js +8 -0
  88. package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +7 -0
  89. package/dist/schemas/extensions/schema/x-variable.d.ts +4 -0
  90. package/dist/schemas/extensions/schema/x-variable.d.ts.map +1 -0
  91. package/dist/schemas/extensions/schema/x-variable.js +8 -0
  92. package/dist/schemas/extensions/schema/x-variable.js.map +7 -0
  93. package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts +17 -0
  94. package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts.map +1 -0
  95. package/dist/schemas/extensions/security/x-scalar-credentials-location.js +8 -0
  96. package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +7 -0
  97. package/dist/schemas/extensions/security/x-scalar-redirect-uri.d.ts +4 -0
  98. package/dist/schemas/extensions/security/x-scalar-redirect-uri.d.ts.map +1 -0
  99. package/dist/schemas/extensions/security/x-scalar-redirect-uri.js +8 -0
  100. package/dist/schemas/extensions/security/x-scalar-redirect-uri.js.map +7 -0
  101. package/dist/schemas/extensions/security/x-scalar-security-body.d.ts +15 -0
  102. package/dist/schemas/extensions/security/x-scalar-security-body.d.ts.map +1 -0
  103. package/dist/schemas/extensions/security/x-scalar-security-body.js +8 -0
  104. package/dist/schemas/extensions/security/x-scalar-security-body.js.map +7 -0
  105. package/dist/schemas/extensions/security/x-scalar-security-query.d.ts +15 -0
  106. package/dist/schemas/extensions/security/x-scalar-security-query.d.ts.map +1 -0
  107. package/dist/schemas/extensions/security/x-scalar-security-query.js +8 -0
  108. package/dist/schemas/extensions/security/x-scalar-security-query.js.map +7 -0
  109. package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts +18 -0
  110. package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts.map +1 -0
  111. package/dist/schemas/extensions/security/x-scalar-security-secrets.js +13 -0
  112. package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +7 -0
  113. package/dist/schemas/extensions/security/x-tokenName.d.ts +12 -0
  114. package/dist/schemas/extensions/security/x-tokenName.d.ts.map +1 -0
  115. package/dist/schemas/extensions/security/x-tokenName.js +8 -0
  116. package/dist/schemas/extensions/security/x-tokenName.js.map +7 -0
  117. package/dist/schemas/extensions/security/x-use-pkce.d.ts +7 -0
  118. package/dist/schemas/extensions/security/x-use-pkce.d.ts.map +1 -0
  119. package/dist/schemas/extensions/security/x-use-pkce.js +13 -0
  120. package/dist/schemas/extensions/security/x-use-pkce.js.map +7 -0
  121. package/dist/schemas/extensions/tag/x-display-name.d.ts +12 -0
  122. package/dist/schemas/extensions/tag/x-display-name.d.ts.map +1 -0
  123. package/dist/schemas/extensions/tag/x-display-name.js +8 -0
  124. package/dist/schemas/extensions/tag/x-display-name.js.map +7 -0
  125. package/dist/schemas/extensions/tag/x-tag-groups.d.ts +28 -0
  126. package/dist/schemas/extensions/tag/x-tag-groups.d.ts.map +1 -0
  127. package/dist/schemas/extensions/tag/x-tag-groups.js +19 -0
  128. package/dist/schemas/extensions/tag/x-tag-groups.js.map +7 -0
  129. package/dist/schemas/inmemory-workspace.d.ts +48 -5545
  130. package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
  131. package/dist/schemas/inmemory-workspace.js +12 -3
  132. package/dist/schemas/inmemory-workspace.js.map +2 -2
  133. package/dist/schemas/reference-config/index.d.ts +12 -4
  134. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  135. package/dist/schemas/reference-config/index.js +0 -6
  136. package/dist/schemas/reference-config/index.js.map +2 -2
  137. package/dist/schemas/reference-config/settings.d.ts +12 -1
  138. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  139. package/dist/schemas/reference-config/settings.js +9 -2
  140. package/dist/schemas/reference-config/settings.js.map +2 -2
  141. package/dist/schemas/typebox-coerce.d.ts.map +1 -1
  142. package/dist/schemas/typebox-coerce.js +1 -3
  143. package/dist/schemas/typebox-coerce.js.map +2 -2
  144. package/dist/schemas/v3.1/loose/callback.d.ts +10 -0
  145. package/dist/schemas/v3.1/loose/callback.d.ts.map +1 -0
  146. package/dist/schemas/v3.1/loose/callback.js +11 -0
  147. package/dist/schemas/v3.1/loose/callback.js.map +7 -0
  148. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts +16 -0
  149. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +1 -0
  150. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js +13 -0
  151. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-cookies.js.map +7 -0
  152. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts +27 -0
  153. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.d.ts.map +1 -0
  154. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js +23 -0
  155. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-environments.js.map +7 -0
  156. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts +38 -0
  157. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.d.ts.map +1 -0
  158. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js +45 -0
  159. package/dist/schemas/v3.1/loose/client-config-extensions/x-scalar-client-config-request-example.js.map +7 -0
  160. package/dist/schemas/v3.1/loose/components.d.ts +43 -0
  161. package/dist/schemas/v3.1/loose/components.d.ts.map +1 -0
  162. package/dist/schemas/v3.1/loose/components.js +41 -0
  163. package/dist/schemas/v3.1/loose/components.js.map +7 -0
  164. package/dist/schemas/v3.1/loose/contact.d.ts +10 -0
  165. package/dist/schemas/v3.1/loose/contact.d.ts.map +1 -0
  166. package/dist/schemas/v3.1/loose/contact.js +13 -0
  167. package/dist/schemas/v3.1/loose/contact.js.map +7 -0
  168. package/dist/schemas/v3.1/loose/discriminator.d.ts +12 -0
  169. package/dist/schemas/v3.1/loose/discriminator.d.ts.map +1 -0
  170. package/dist/schemas/v3.1/loose/discriminator.js +11 -0
  171. package/dist/schemas/v3.1/loose/discriminator.js.map +7 -0
  172. package/dist/schemas/v3.1/loose/encoding.d.ts +15 -0
  173. package/dist/schemas/v3.1/loose/encoding.d.ts.map +1 -0
  174. package/dist/schemas/v3.1/loose/encoding.js +12 -0
  175. package/dist/schemas/v3.1/loose/encoding.js.map +7 -0
  176. package/dist/schemas/v3.1/loose/example.d.ts +16 -0
  177. package/dist/schemas/v3.1/loose/example.d.ts.map +1 -0
  178. package/dist/schemas/v3.1/loose/example.js +15 -0
  179. package/dist/schemas/v3.1/loose/example.js.map +7 -0
  180. package/dist/schemas/v3.1/loose/external-documentation.d.ts +8 -0
  181. package/dist/schemas/v3.1/loose/external-documentation.d.ts.map +1 -0
  182. package/dist/schemas/v3.1/loose/external-documentation.js +11 -0
  183. package/dist/schemas/v3.1/loose/external-documentation.js.map +7 -0
  184. package/dist/schemas/v3.1/loose/header.d.ts +355 -0
  185. package/dist/schemas/v3.1/loose/header.d.ts.map +1 -0
  186. package/dist/schemas/v3.1/loose/header.js +43 -0
  187. package/dist/schemas/v3.1/loose/header.js.map +7 -0
  188. package/dist/schemas/v3.1/loose/info.d.ts +48 -0
  189. package/dist/schemas/v3.1/loose/info.d.ts.map +1 -0
  190. package/dist/schemas/v3.1/loose/info.js +29 -0
  191. package/dist/schemas/v3.1/loose/info.js.map +7 -0
  192. package/dist/schemas/v3.1/loose/license.d.ts +10 -0
  193. package/dist/schemas/v3.1/loose/license.d.ts.map +1 -0
  194. package/dist/schemas/v3.1/loose/license.js +13 -0
  195. package/dist/schemas/v3.1/loose/license.js.map +7 -0
  196. package/dist/schemas/v3.1/loose/link.d.ts +30 -0
  197. package/dist/schemas/v3.1/loose/link.d.ts.map +1 -0
  198. package/dist/schemas/v3.1/loose/link.js +20 -0
  199. package/dist/schemas/v3.1/loose/link.js.map +7 -0
  200. package/dist/schemas/v3.1/loose/media-header-encoding.d.ts +1012 -0
  201. package/dist/schemas/v3.1/loose/media-header-encoding.d.ts.map +1 -0
  202. package/dist/schemas/v3.1/loose/media-header-encoding.js +19 -0
  203. package/dist/schemas/v3.1/loose/media-header-encoding.js.map +7 -0
  204. package/dist/schemas/v3.1/loose/media-type.d.ts +161 -0
  205. package/dist/schemas/v3.1/loose/media-type.d.ts.map +1 -0
  206. package/dist/schemas/v3.1/loose/media-type.js +18 -0
  207. package/dist/schemas/v3.1/loose/media-type.js.map +7 -0
  208. package/dist/schemas/v3.1/loose/oauth-flow.d.ts +95 -0
  209. package/dist/schemas/v3.1/loose/oauth-flow.d.ts.map +1 -0
  210. package/dist/schemas/v3.1/loose/oauth-flow.js +57 -0
  211. package/dist/schemas/v3.1/loose/oauth-flow.js.map +7 -0
  212. package/dist/schemas/v3.1/loose/oauthflows.d.ts +43 -0
  213. package/dist/schemas/v3.1/loose/oauthflows.d.ts.map +1 -0
  214. package/dist/schemas/v3.1/loose/oauthflows.js +21 -0
  215. package/dist/schemas/v3.1/loose/oauthflows.js.map +7 -0
  216. package/dist/schemas/v3.1/loose/openapi-document.d.ts +115 -0
  217. package/dist/schemas/v3.1/loose/openapi-document.d.ts.map +1 -0
  218. package/dist/schemas/v3.1/loose/openapi-document.js +64 -0
  219. package/dist/schemas/v3.1/loose/openapi-document.js.map +7 -0
  220. package/dist/schemas/v3.1/loose/operation.d.ts +1645 -0
  221. package/dist/schemas/v3.1/loose/operation.d.ts.map +1 -0
  222. package/dist/schemas/v3.1/loose/operation.js +61 -0
  223. package/dist/schemas/v3.1/loose/operation.js.map +7 -0
  224. package/dist/schemas/v3.1/loose/parameter.d.ts +1074 -0
  225. package/dist/schemas/v3.1/loose/parameter.d.ts.map +1 -0
  226. package/dist/schemas/v3.1/loose/parameter.js +54 -0
  227. package/dist/schemas/v3.1/loose/parameter.js.map +7 -0
  228. package/dist/schemas/v3.1/loose/path-item.d.ts +551 -0
  229. package/dist/schemas/v3.1/loose/path-item.d.ts.map +1 -0
  230. package/dist/schemas/v3.1/loose/path-item.js +42 -0
  231. package/dist/schemas/v3.1/loose/path-item.js.map +7 -0
  232. package/dist/schemas/v3.1/loose/path-operations.d.ts +2196 -0
  233. package/dist/schemas/v3.1/loose/path-operations.d.ts.map +1 -0
  234. package/dist/schemas/v3.1/loose/path-operations.js +21 -0
  235. package/dist/schemas/v3.1/loose/path-operations.js.map +7 -0
  236. package/dist/schemas/v3.1/loose/paths.d.ts +20 -0
  237. package/dist/schemas/v3.1/loose/paths.d.ts.map +1 -0
  238. package/dist/schemas/v3.1/loose/paths.js +11 -0
  239. package/dist/schemas/v3.1/loose/paths.js.map +7 -0
  240. package/dist/schemas/v3.1/loose/reference.d.ts +26 -0
  241. package/dist/schemas/v3.1/loose/reference.d.ts.map +1 -0
  242. package/dist/schemas/v3.1/loose/reference.js +24 -0
  243. package/dist/schemas/v3.1/loose/reference.js.map +7 -0
  244. package/dist/schemas/v3.1/loose/request-body.d.ts +339 -0
  245. package/dist/schemas/v3.1/loose/request-body.d.ts.map +1 -0
  246. package/dist/schemas/v3.1/loose/request-body.js +14 -0
  247. package/dist/schemas/v3.1/loose/request-body.js.map +7 -0
  248. package/dist/schemas/v3.1/loose/response.d.ts +698 -0
  249. package/dist/schemas/v3.1/loose/response.d.ts.map +1 -0
  250. package/dist/schemas/v3.1/loose/response.js +18 -0
  251. package/dist/schemas/v3.1/loose/response.js.map +7 -0
  252. package/dist/schemas/v3.1/loose/responses.d.ts +710 -0
  253. package/dist/schemas/v3.1/loose/responses.d.ts.map +1 -0
  254. package/dist/schemas/v3.1/loose/responses.js +11 -0
  255. package/dist/schemas/v3.1/loose/responses.js.map +7 -0
  256. package/dist/schemas/v3.1/loose/schema.d.ts +373 -0
  257. package/dist/schemas/v3.1/loose/schema.d.ts.map +1 -0
  258. package/dist/schemas/v3.1/loose/schema.js +146 -0
  259. package/dist/schemas/v3.1/loose/schema.js.map +7 -0
  260. package/dist/schemas/v3.1/loose/security-requirement.d.ts +11 -0
  261. package/dist/schemas/v3.1/loose/security-requirement.d.ts.map +1 -0
  262. package/dist/schemas/v3.1/loose/security-requirement.js +10 -0
  263. package/dist/schemas/v3.1/loose/security-requirement.js.map +7 -0
  264. package/dist/schemas/v3.1/loose/security-scheme.d.ts +169 -0
  265. package/dist/schemas/v3.1/loose/security-scheme.d.ts.map +1 -0
  266. package/dist/schemas/v3.1/loose/security-scheme.js +64 -0
  267. package/dist/schemas/v3.1/loose/security-scheme.js.map +7 -0
  268. package/dist/schemas/v3.1/loose/server-variable.d.ts +10 -0
  269. package/dist/schemas/v3.1/loose/server-variable.d.ts.map +1 -0
  270. package/dist/schemas/v3.1/loose/server-variable.js +13 -0
  271. package/dist/schemas/v3.1/loose/server-variable.js.map +7 -0
  272. package/dist/schemas/v3.1/loose/server.d.ts +14 -0
  273. package/dist/schemas/v3.1/loose/server.d.ts.map +1 -0
  274. package/dist/schemas/v3.1/loose/server.js +14 -0
  275. package/dist/schemas/v3.1/loose/server.js.map +7 -0
  276. package/dist/schemas/v3.1/loose/tag.d.ts +19 -0
  277. package/dist/schemas/v3.1/loose/tag.d.ts.map +1 -0
  278. package/dist/schemas/v3.1/loose/tag.js +23 -0
  279. package/dist/schemas/v3.1/loose/tag.js.map +7 -0
  280. package/dist/schemas/v3.1/loose/xml.d.ts +18 -0
  281. package/dist/schemas/v3.1/loose/xml.d.ts.map +1 -0
  282. package/dist/schemas/v3.1/loose/xml.js +17 -0
  283. package/dist/schemas/v3.1/loose/xml.js.map +7 -0
  284. package/dist/schemas/v3.1/strict/callback.d.ts +1 -8
  285. package/dist/schemas/v3.1/strict/callback.d.ts.map +1 -1
  286. package/dist/schemas/v3.1/strict/callback.js +5 -10
  287. package/dist/schemas/v3.1/strict/callback.js.map +2 -2
  288. package/dist/schemas/v3.1/strict/components.d.ts +24 -28
  289. package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
  290. package/dist/schemas/v3.1/strict/components.js +35 -32
  291. package/dist/schemas/v3.1/strict/components.js.map +2 -2
  292. package/dist/schemas/v3.1/strict/contact.d.ts +2 -2
  293. package/dist/schemas/v3.1/strict/contact.d.ts.map +1 -1
  294. package/dist/schemas/v3.1/strict/contact.js +8 -13
  295. package/dist/schemas/v3.1/strict/contact.js.map +2 -2
  296. package/dist/schemas/v3.1/strict/discriminator.d.ts +2 -2
  297. package/dist/schemas/v3.1/strict/discriminator.d.ts.map +1 -1
  298. package/dist/schemas/v3.1/strict/discriminator.js +6 -11
  299. package/dist/schemas/v3.1/strict/discriminator.js.map +2 -2
  300. package/dist/schemas/v3.1/strict/encoding.d.ts +3 -10
  301. package/dist/schemas/v3.1/strict/encoding.d.ts.map +1 -1
  302. package/dist/schemas/v3.1/strict/encoding.js +7 -12
  303. package/dist/schemas/v3.1/strict/encoding.js.map +2 -2
  304. package/dist/schemas/v3.1/strict/example.d.ts +2 -2
  305. package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
  306. package/dist/schemas/v3.1/strict/example.js +10 -15
  307. package/dist/schemas/v3.1/strict/example.js.map +2 -2
  308. package/dist/schemas/v3.1/strict/external-documentation.d.ts +2 -2
  309. package/dist/schemas/v3.1/strict/external-documentation.d.ts.map +1 -1
  310. package/dist/schemas/v3.1/strict/external-documentation.js +6 -11
  311. package/dist/schemas/v3.1/strict/external-documentation.js.map +2 -2
  312. package/dist/schemas/v3.1/strict/header.d.ts +292 -54
  313. package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
  314. package/dist/schemas/v3.1/strict/header.js +14 -17
  315. package/dist/schemas/v3.1/strict/header.js.map +2 -2
  316. package/dist/schemas/v3.1/strict/info.d.ts +11 -5
  317. package/dist/schemas/v3.1/strict/info.d.ts.map +1 -1
  318. package/dist/schemas/v3.1/strict/info.js +2 -2
  319. package/dist/schemas/v3.1/strict/info.js.map +2 -2
  320. package/dist/schemas/v3.1/strict/license.d.ts +2 -2
  321. package/dist/schemas/v3.1/strict/license.d.ts.map +1 -1
  322. package/dist/schemas/v3.1/strict/license.js +8 -13
  323. package/dist/schemas/v3.1/strict/license.js.map +2 -2
  324. package/dist/schemas/v3.1/strict/link.d.ts +6 -6
  325. package/dist/schemas/v3.1/strict/link.d.ts.map +1 -1
  326. package/dist/schemas/v3.1/strict/link.js +14 -19
  327. package/dist/schemas/v3.1/strict/link.js.map +2 -2
  328. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts +1389 -164
  329. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts.map +1 -1
  330. package/dist/schemas/v3.1/strict/media-type.d.ts +145 -19
  331. package/dist/schemas/v3.1/strict/media-type.d.ts.map +1 -1
  332. package/dist/schemas/v3.1/strict/media-type.js +13 -20
  333. package/dist/schemas/v3.1/strict/media-type.js.map +2 -2
  334. package/dist/schemas/v3.1/strict/oauth-flow.d.ts +24 -8
  335. package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
  336. package/dist/schemas/v3.1/strict/oauth-flow.js +9 -9
  337. package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
  338. package/dist/schemas/v3.1/strict/oauthflows.d.ts +12 -4
  339. package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
  340. package/dist/schemas/v3.1/strict/oauthflows.js +10 -13
  341. package/dist/schemas/v3.1/strict/oauthflows.js.map +2 -2
  342. package/dist/schemas/v3.1/strict/openapi-document.d.ts +7 -5
  343. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  344. package/dist/schemas/v3.1/strict/openapi-document.js +0 -2
  345. package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
  346. package/dist/schemas/v3.1/strict/operation.d.ts +4711 -343
  347. package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
  348. package/dist/schemas/v3.1/strict/operation.js +40 -35
  349. package/dist/schemas/v3.1/strict/operation.js.map +2 -2
  350. package/dist/schemas/v3.1/strict/parameter.d.ts +1226 -164
  351. package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
  352. package/dist/schemas/v3.1/strict/parameter.js +23 -25
  353. package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
  354. package/dist/schemas/v3.1/strict/path-item.d.ts +1320 -102
  355. package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
  356. package/dist/schemas/v3.1/strict/path-item.js +35 -40
  357. package/dist/schemas/v3.1/strict/path-item.js.map +2 -2
  358. package/dist/schemas/v3.1/strict/path-operations.d.ts +10601 -11739
  359. package/dist/schemas/v3.1/strict/path-operations.d.ts.map +1 -1
  360. package/dist/schemas/v3.1/strict/path-operations.js +3 -1
  361. package/dist/schemas/v3.1/strict/path-operations.js.map +2 -2
  362. package/dist/schemas/v3.1/strict/paths.d.ts +3 -5514
  363. package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
  364. package/dist/schemas/v3.1/strict/paths.js +4 -9
  365. package/dist/schemas/v3.1/strict/paths.js.map +2 -2
  366. package/dist/schemas/v3.1/strict/reference.d.ts +12 -5
  367. package/dist/schemas/v3.1/strict/reference.d.ts.map +1 -1
  368. package/dist/schemas/v3.1/strict/reference.js +4 -4
  369. package/dist/schemas/v3.1/strict/reference.js.map +2 -2
  370. package/dist/schemas/v3.1/strict/request-body.d.ts +468 -56
  371. package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
  372. package/dist/schemas/v3.1/strict/request-body.js +8 -13
  373. package/dist/schemas/v3.1/strict/request-body.js.map +2 -2
  374. package/dist/schemas/v3.1/strict/response.d.ts +1121 -130
  375. package/dist/schemas/v3.1/strict/response.d.ts.map +1 -1
  376. package/dist/schemas/v3.1/strict/response.js +11 -16
  377. package/dist/schemas/v3.1/strict/response.js.map +2 -2
  378. package/dist/schemas/v3.1/strict/responses.d.ts +2352 -139
  379. package/dist/schemas/v3.1/strict/responses.d.ts.map +1 -1
  380. package/dist/schemas/v3.1/strict/responses.js +4 -6
  381. package/dist/schemas/v3.1/strict/responses.js.map +2 -2
  382. package/dist/schemas/v3.1/strict/schema.d.ts +232 -15
  383. package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
  384. package/dist/schemas/v3.1/strict/schema.js +206 -31
  385. package/dist/schemas/v3.1/strict/schema.js.map +2 -2
  386. package/dist/schemas/v3.1/strict/security-requirement.d.ts +1 -1
  387. package/dist/schemas/v3.1/strict/security-requirement.d.ts.map +1 -1
  388. package/dist/schemas/v3.1/strict/security-requirement.js +4 -9
  389. package/dist/schemas/v3.1/strict/security-requirement.js.map +2 -2
  390. package/dist/schemas/v3.1/strict/security-scheme.d.ts +56 -26
  391. package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
  392. package/dist/schemas/v3.1/strict/security-scheme.js +11 -8
  393. package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
  394. package/dist/schemas/v3.1/strict/server-variable.d.ts +2 -2
  395. package/dist/schemas/v3.1/strict/server-variable.d.ts.map +1 -1
  396. package/dist/schemas/v3.1/strict/server-variable.js +8 -13
  397. package/dist/schemas/v3.1/strict/server-variable.js.map +2 -2
  398. package/dist/schemas/v3.1/strict/server.d.ts +4 -4
  399. package/dist/schemas/v3.1/strict/server.d.ts.map +1 -1
  400. package/dist/schemas/v3.1/strict/server.js +8 -13
  401. package/dist/schemas/v3.1/strict/server.js.map +2 -2
  402. package/dist/schemas/v3.1/strict/tag.d.ts +7 -3
  403. package/dist/schemas/v3.1/strict/tag.d.ts.map +1 -1
  404. package/dist/schemas/v3.1/strict/tag.js +6 -8
  405. package/dist/schemas/v3.1/strict/tag.js.map +2 -2
  406. package/dist/schemas/v3.1/strict/xml.d.ts +2 -2
  407. package/dist/schemas/v3.1/strict/xml.d.ts.map +1 -1
  408. package/dist/schemas/v3.1/strict/xml.js +12 -17
  409. package/dist/schemas/v3.1/strict/xml.js.map +2 -2
  410. package/dist/schemas/workspace-specification/config.d.ts +10 -2
  411. package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
  412. package/dist/schemas/workspace-specification/index.d.ts +39 -13
  413. package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
  414. package/dist/schemas/workspace.d.ts +63 -34
  415. package/dist/schemas/workspace.d.ts.map +1 -1
  416. package/dist/schemas/workspace.js +1 -0
  417. package/dist/schemas/workspace.js.map +2 -2
  418. package/dist/server.d.ts +2 -3290
  419. package/dist/server.d.ts.map +1 -1
  420. package/dist/server.js.map +2 -2
  421. package/dist/types.d.ts +0 -6
  422. package/dist/types.d.ts.map +1 -1
  423. package/package.json +17 -11
  424. package/dist/schemas/v3.1/strict/extensions.d.ts +0 -4
  425. package/dist/schemas/v3.1/strict/extensions.d.ts.map +0 -1
  426. package/dist/schemas/v3.1/strict/extensions.js +0 -6
  427. package/dist/schemas/v3.1/strict/extensions.js.map +0 -7
  428. package/dist/schemas/v3.1/type-guard.d.ts +0 -10
  429. package/dist/schemas/v3.1/type-guard.d.ts.map +0 -1
  430. package/dist/schemas/v3.1/type-guard.js +0 -7
  431. package/dist/schemas/v3.1/type-guard.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @scalar/workspace-store
2
2
 
3
+ ## 0.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b8776fc: feat: output validation errors in the console
8
+
9
+ ## 0.14.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b93e1fe: feat(workspace-store): support relative external references
14
+ - 5208f06: feat(workspace-store): validate that the bundle produces valid openapi document
15
+ - 4d509fb: feat(workspace-store): use the configuration fetcher to bundle the document
16
+ - 9be6eec: feat(workspace-store): preprocess documents to make them compliant
17
+ - c4bf497: fix(workspace-store): correctly propagate documents from one state to the other
18
+ - d8adbed: feat(workspace-store): resolve multi level refs
19
+ - 0c80ef0: feat(json-magic): change the way we resolve refs
20
+
21
+ ### Patch Changes
22
+
23
+ - bbef120: fix: remove extra coerces and cleanUp plugin from bundler
24
+ - a1429ca: chore: move to new extensions system for better type safety
25
+ - 66b18fc: feat: update the references to handle $refs from the magic proxy
26
+ - 0fcd446: feat(workspace-store): performance improvements
27
+ - c838a3f: chore: added measurements to workspace store
28
+ - Updated dependencies [b93e1fe]
29
+ - Updated dependencies [d4adeba]
30
+ - Updated dependencies [66b18fc]
31
+ - Updated dependencies [5f022b5]
32
+ - Updated dependencies [0fcd446]
33
+ - Updated dependencies [6a88108]
34
+ - Updated dependencies [c418e92]
35
+ - Updated dependencies [c4bf497]
36
+ - Updated dependencies [d8adbed]
37
+ - Updated dependencies [0c80ef0]
38
+ - @scalar/json-magic@0.3.0
39
+ - @scalar/openapi-parser@0.20.0
40
+ - @scalar/helpers@0.0.8
41
+ - @scalar/types@0.2.12
42
+ - @scalar/code-highlight@0.1.9
43
+
44
+ ## 0.13.0
45
+
46
+ ### Minor Changes
47
+
48
+ - 0d502cb: chore(workspace-store): clean up client store
49
+ - 0afc40c: feat(json-magic): introduce type-safe apply function with tracked target type in diff results
50
+ - 128af48: feat(workspace-store, json-magic): support `externalValue` fields on example object
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [e203e90]
55
+ - Updated dependencies [0afc40c]
56
+ - Updated dependencies [128af48]
57
+ - @scalar/openapi-parser@0.19.1
58
+ - @scalar/json-magic@0.2.0
59
+ - @scalar/code-highlight@0.1.9
60
+ - @scalar/helpers@0.0.7
61
+ - @scalar/types@0.2.11
62
+
3
63
  ## 0.12.0
4
64
 
5
65
  ### Minor Changes
package/dist/client.d.ts CHANGED
@@ -1,25 +1,62 @@
1
- import type { DeepPartial, DeepRequired } from './types.js';
2
- import { type createNavigationOptions } from './navigation/index.js';
3
- import { type OpenApiDocument } from './schemas/v3.1/strict/openapi-document.js';
4
- import type { Config } from './schemas/workspace-specification/config.js';
5
- import type { WorkspaceSpecification } from './schemas/workspace-specification/index.js';
1
+ import type { TraverseSpecOptions } from './navigation/types.js';
2
+ import { type InMemoryWorkspace } from './schemas/inmemory-workspace.js';
6
3
  import type { Workspace, WorkspaceDocumentMeta, WorkspaceMeta } from './schemas/workspace.js';
7
- import { merge, type Difference } from '@scalar/json-magic/diff';
4
+ import type { WorkspaceSpecification } from './schemas/workspace-specification/index.js';
5
+ import type { Config } from './schemas/workspace-specification/config.js';
6
+ import { type Difference, merge } from '@scalar/json-magic/diff';
7
+ import type { PartialDeep, RequiredDeep } from 'type-fest';
8
+ export type DocumentConfiguration = Config & PartialDeep<{
9
+ 'x-scalar-reference-config': {
10
+ tagSort: TraverseSpecOptions['tagsSorter'];
11
+ operationsSorter: TraverseSpecOptions['operationsSorter'];
12
+ getHeadingId: TraverseSpecOptions['getHeadingId'];
13
+ getOperationId: TraverseSpecOptions['getOperationId'];
14
+ getWebhookId: TraverseSpecOptions['getWebhookId'];
15
+ getModelId: TraverseSpecOptions['getModelId'];
16
+ getTagId: TraverseSpecOptions['getTagId'];
17
+ generateOperationSlug?: (details: {
18
+ path: string;
19
+ operationId?: string;
20
+ method: string;
21
+ summary?: string;
22
+ }) => string;
23
+ generateHeadingSlug?: (details: {
24
+ slug?: string;
25
+ }) => string;
26
+ generateTagSlug?: (details: {
27
+ name?: string;
28
+ }) => string;
29
+ generateModelSlug?: (details: {
30
+ name?: string;
31
+ }) => string;
32
+ generateWebhookSlug?: (details: {
33
+ name: string;
34
+ method: string;
35
+ }) => string;
36
+ };
37
+ }>;
38
+ export type ValidationError = {
39
+ message: string;
40
+ path: string;
41
+ schema: unknown;
42
+ value: unknown;
43
+ };
44
+ declare const defaultConfig: RequiredDeep<Config>;
8
45
  /**
9
46
  * Input type for workspace document metadata and configuration.
10
47
  * This type defines the required and optional fields for initializing a document in the workspace.
11
- *
12
- * TODO: merge navigation options with the document config
13
48
  */
14
49
  type WorkspaceDocumentMetaInput = {
15
50
  /** Optional metadata about the document like title, description, etc */
16
51
  meta?: WorkspaceDocumentMeta;
17
52
  /** Required unique identifier for the document */
18
53
  name: string;
19
- /** Optional configuration for generating navigation structure */
20
- config?: Config & Partial<createNavigationOptions>;
54
+ /** Optional configuration options */
55
+ config?: DocumentConfiguration;
21
56
  /** Overrides for the document */
22
- overrides?: DeepPartial<OpenApiDocument>;
57
+ overrides?: InMemoryWorkspace['overrides'][string];
58
+ /** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */
59
+ fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
23
60
  };
24
61
  /**
25
62
  * Represents a document that is loaded from a URL.
@@ -28,8 +65,6 @@ type WorkspaceDocumentMetaInput = {
28
65
  export type UrlDoc = {
29
66
  /** URL to fetch the OpenAPI document from */
30
67
  url: string;
31
- /** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */
32
- fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
33
68
  } & WorkspaceDocumentMetaInput;
34
69
  /** Represents a document that is provided directly as an object rather than loaded from a URL */
35
70
  export type ObjectDoc = {
@@ -42,7 +77,6 @@ export type ObjectDoc = {
42
77
  * - ObjectDoc: Direct document object with metadata
43
78
  */
44
79
  export type WorkspaceDocumentInput = UrlDoc | ObjectDoc;
45
- declare const defaultConfig: DeepRequired<Config>;
46
80
  /**
47
81
  * Configuration object for initializing a workspace store.
48
82
  * Defines the initial state and documents for the workspace.
@@ -52,6 +86,8 @@ type WorkspaceProps = {
52
86
  meta?: WorkspaceMeta;
53
87
  /** Workspace configuration */
54
88
  config?: Config;
89
+ /** Fetch function for retrieving documents */
90
+ fetch?: WorkspaceDocumentInput['fetch'];
55
91
  };
56
92
  /**
57
93
  * Type definition for the workspace store return object.
@@ -60,36 +96,228 @@ type WorkspaceProps = {
60
96
  * @see https://github.com/microsoft/TypeScript/issues/43817#issuecomment-827746462
61
97
  */
62
98
  export type WorkspaceStore = {
63
- /** Returns the reactive workspace object with an additional activeDocument getter */
99
+ /**
100
+ * Returns the reactive workspace object with an additional activeDocument getter
101
+ */
64
102
  readonly workspace: Workspace;
65
- /** Updates a specific metadata field in the workspace */
103
+ /**
104
+ * Updates a specific metadata field in the workspace
105
+ * @param key - The metadata field to update
106
+ * @param value - The new value for the field
107
+ * @example
108
+ * // Update the workspace title
109
+ * update('x-scalar-active-document', 'document-name')
110
+ */
66
111
  update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]): void;
67
- /** Updates a specific metadata field in a document */
112
+ /**
113
+ * Updates a specific metadata field in a document
114
+ * @param name - The name of the document to update ('active' or a specific document name)
115
+ * @param key - The metadata field to update
116
+ * @param value - The new value for the field
117
+ * @throws Error if the specified document doesn't exist
118
+ * @example
119
+ * // Update the auth of the active document
120
+ * updateDocument('active', 'x-scalar-active-auth', 'Bearer')
121
+ * // Update the auth of a specific document
122
+ * updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')
123
+ */
68
124
  updateDocument<K extends keyof WorkspaceDocumentMeta>(name: 'active' | (string & {}), key: K, value: WorkspaceDocumentMeta[K]): void;
69
- /** Replaces the content of a specific document in the workspace with the provided input */
70
- replaceDocument(documentName: string, input: Record<string, unknown>): void;
71
- /** Resolves a reference in the active document by following the provided path and resolving any external $ref references */
125
+ /**
126
+ * Replaces the content of a specific document in the workspace with the provided input.
127
+ * This method computes the difference between the current document and the new input,
128
+ * then applies only the necessary changes in place. The updates are applied atomically,
129
+ * ensuring the document is updated in a single operation.
130
+ *
131
+ * @param documentName - The name of the document to update.
132
+ * @param input - The new content to apply to the document (as a plain object).
133
+ * @example
134
+ * // Replace the content of the 'api' document with new data
135
+ * store.replaceDocument('api', {
136
+ * openapi: '3.1.0',
137
+ * info: { title: 'Updated API', version: '1.0.1' },
138
+ * paths: {},
139
+ * })
140
+ */
141
+ replaceDocument(documentName: string, input: Record<string, unknown>): Promise<void>;
142
+ /**
143
+ * Resolves a reference in the active document by following the provided path and resolving any external $ref references.
144
+ * This method traverses the document structure following the given path and resolves any $ref references it encounters.
145
+ * During resolution, it sets a loading status and updates the reference with the resolved content.
146
+ *
147
+ * @param path - Array of strings representing the path to the reference (e.g. ['paths', '/users', 'get', 'responses', '200'])
148
+ * @throws Error if the path is invalid or empty
149
+ * @example
150
+ * // Resolve a reference in the active document
151
+ * resolve(['paths', '/users', 'get', 'responses', '200'])
152
+ */
72
153
  resolve(path: string[]): Promise<unknown>;
73
- /** Adds a new document to the workspace */
154
+ /**
155
+ * Adds a new document to the workspace
156
+ * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format
157
+ * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta
158
+ * @example
159
+ * // Add a new OpenAPI document to the workspace
160
+ * store.addDocument({
161
+ * name: 'name',
162
+ * document: {
163
+ * openapi: '3.0.0',
164
+ * info: { title: 'title' },
165
+ * },
166
+ * meta: {
167
+ * 'x-scalar-active-auth': 'Bearer',
168
+ * 'x-scalar-active-server': 'production'
169
+ * }
170
+ * })
171
+ */
74
172
  addDocument(input: WorkspaceDocumentInput): Promise<void>;
75
- /** Returns the merged configuration for the active document */
173
+ /**
174
+ * Returns the merged configuration for the active document.
175
+ *
176
+ * This getter merges configurations in the following order of precedence:
177
+ * 1. Document-specific configuration (highest priority)
178
+ * 2. Workspace-level configuration
179
+ * 3. Default configuration (lowest priority)
180
+ *
181
+ * The active document is determined by the workspace's activeDocument extension,
182
+ * falling back to the first document if none is specified.
183
+ */
76
184
  readonly config: typeof defaultConfig;
77
- /** Downloads the specified document in the requested format */
185
+ /**
186
+ * Exports the specified document in the requested format.
187
+ *
188
+ * This method serializes the most recently saved local version of the document (from the intermediateDocuments map)
189
+ * to either JSON or YAML. The exported document reflects the last locally saved state, including any edits
190
+ * that have been saved but not yet synced to a remote registry. Runtime/in-memory changes that have not been saved
191
+ * will not be included.
192
+ *
193
+ * @param documentName - The name of the document to export.
194
+ * @param format - The output format: 'json' for a JSON string, or 'yaml' for a YAML string.
195
+ * @returns The document as a string in the requested format, or undefined if the document does not exist.
196
+ *
197
+ * @example
198
+ * // Export a document as JSON
199
+ * const jsonString = store.exportDocument('api', 'json')
200
+ *
201
+ * // Export a document as YAML
202
+ * const yamlString = store.exportDocument('api', 'yaml')
203
+ */
78
204
  exportDocument(documentName: string, format: 'json' | 'yaml'): string | undefined;
79
- /** Persists the current state of the specified document back to the original documents map */
80
- saveDocument(documentName: string): unknown[] | undefined;
81
- /** Reverts the specified document to its original state */
82
- revertDocumentChanges(documentName: string): void;
83
- /** Commits the specified document */
205
+ /**
206
+ * Saves the current state of the specified document to the intermediate documents map.
207
+ *
208
+ * This function captures the latest (reactive) state of the document from the workspace and
209
+ * applies its changes to the corresponding entry in the `intermediateDocuments` map.
210
+ * The `intermediateDocuments` map represents the most recently "saved" local version of the document,
211
+ * which may include edits not yet synced to the remote registry.
212
+ *
213
+ * The update is performed in-place. A deep clone of the current document
214
+ * state is used to avoid mutating the reactive object directly.
215
+ *
216
+ * @param documentName - The name of the document to save.
217
+ * @returns An array of diffs that were excluded from being applied (such as changes to ignored keys),
218
+ * or undefined if the document does not exist or cannot be updated.
219
+ *
220
+ * @example
221
+ * // Save the current state of the document named 'api'
222
+ * const excludedDiffs = store.saveDocument('api')
223
+ */
224
+ saveDocument(documentName: string): Promise<unknown[] | undefined>;
225
+ /**
226
+ * Restores the specified document to its last locally saved state.
227
+ *
228
+ * This method updates the current reactive document (in the workspace) with the contents of the
229
+ * corresponding intermediate document (from the `intermediateDocuments` map), effectively discarding
230
+ * any unsaved in-memory changes and reverting to the last saved version.
231
+ * Vue reactivity is preserved by updating the existing reactive object in place.
232
+ *
233
+ * **Warning:** This operation will discard all unsaved (in-memory) changes to the specified document.
234
+ *
235
+ * @param documentName - The name of the document to restore.
236
+ * @returns void
237
+ *
238
+ * @example
239
+ * // Restore the document named 'api' to its last saved state
240
+ * store.revertDocumentChanges('api')
241
+ */
242
+ revertDocumentChanges(documentName: string): Promise<void>;
243
+ /**
244
+ * Commits the specified document.
245
+ *
246
+ * This method is intended to finalize and persist the current state of the document,
247
+ * potentially syncing it with a remote registry or marking it as the latest committed version.
248
+ *
249
+ * @param documentName - The name of the document to commit.
250
+ * @remarks
251
+ * The actual commit logic is not implemented yet.
252
+ */
84
253
  commitDocument(documentName: string): void;
85
- /** Serializes the current workspace state to a JSON string for backup, persistence, or sharing. */
254
+ /**
255
+ * Serializes the current workspace state to a JSON string for backup, persistence, or sharing.
256
+ *
257
+ * This method exports all workspace documents (removing Vue reactivity proxies), workspace metadata,
258
+ * document configurations, and both the original and intermediate document states. The resulting JSON
259
+ * can be imported later to fully restore the workspace to this exact state, including all documents
260
+ * and their configurations.
261
+ *
262
+ * @returns A JSON string representing the complete workspace state.
263
+ */
86
264
  exportWorkspace(): string;
87
- /** Imports a workspace from a serialized JSON string. */
265
+ /**
266
+ * Imports a workspace from a serialized JSON string.
267
+ *
268
+ * This method parses the input string using the InMemoryWorkspaceSchema,
269
+ * then updates the current workspace state, including documents, metadata,
270
+ * and configuration, with the imported values.
271
+ *
272
+ * @param input - The serialized workspace JSON string to import.
273
+ */
88
274
  loadWorkspace(input: string): void;
89
- /** Imports a workspace from a specification object */
275
+ /**
276
+ * Imports a workspace from a WorkspaceSpecification object.
277
+ *
278
+ * This method assigns workspace metadata and adds all documents defined in the specification.
279
+ * Each document is added using its $ref and optional overrides.
280
+ *
281
+ * @example
282
+ * ```ts
283
+ * await store.importWorkspaceFromSpecification({
284
+ * documents: {
285
+ * api: { $ref: '/specs/api.yaml' },
286
+ * petstore: { $ref: '/specs/petstore.yaml' }
287
+ * },
288
+ * overrides: {
289
+ * api: { config: { features: { showModels: true } } }
290
+ * },
291
+ * info: { title: 'My Workspace' },
292
+ * workspace: 'v1',
293
+ * "x-scalar-dark-mode": true
294
+ * })
295
+ * ```
296
+ *
297
+ * @param specification - The workspace specification to import.
298
+ */
90
299
  importWorkspaceFromSpecification(specification: WorkspaceSpecification): Promise<void[]>;
91
- /** Rebase document with a remote origin */
92
- rebaseDocument: (documentName: string, newDocumentOrigin: Record<string, unknown>, resolvedConflicts?: Difference[]) => void | ReturnType<typeof merge>['conflicts'];
300
+ /**
301
+ * Rebases a document in the workspace with a new origin, resolving conflicts if provided.
302
+ *
303
+ * This method is used to rebase a document (e.g., after pulling remote changes) by applying the changes
304
+ * from the new origin and merging them with local edits. If there are conflicts, they can be resolved
305
+ * by providing a list of resolved conflicts.
306
+ *
307
+ * @param documentName - The name of the document to rebase.
308
+ * @param newDocumentOrigin - The new origin document (as an object) to rebase onto.
309
+ * @param resolvedConflicts - (Optional) An array of resolved conflicts to apply.
310
+ * @returns If there are unresolved conflicts and no resolution is provided, returns the list of conflicts.
311
+ *
312
+ * @example
313
+ * // Example: Rebase a document with a new origin and resolve conflicts
314
+ * const conflicts = store.rebaseDocument('api', newOriginDoc)
315
+ * if (conflicts && conflicts.length > 0) {
316
+ * // User resolves conflicts here...
317
+ * store.rebaseDocument('api', newOriginDoc, userResolvedConflicts)
318
+ * }
319
+ */
320
+ rebaseDocument: (documentName: string, newDocumentOrigin: Record<string, unknown>, resolvedConflicts?: Difference<unknown>[]) => void | ReturnType<typeof merge>['conflicts'];
93
321
  };
94
322
  /**
95
323
  * Creates a reactive workspace store that manages documents and their metadata.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAKxD,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAG7E,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAEpG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAG1F,OAAO,EAAe,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAE7E;;;;;GAKG;AACH,KAAK,0BAA0B,GAAG;IAChC,wEAAwE;IACxE,IAAI,CAAC,EAAE,qBAAqB,CAAA;IAC5B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;IAClD,iCAAiC;IACjC,SAAS,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;CACzC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAA;IACX,wIAAwI;IACxI,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CA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