@scalar/workspace-store 0.12.0 → 0.14.0

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 +54 -0
  2. package/dist/client.d.ts +252 -30
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +144 -277
  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,59 @@
1
1
  # @scalar/workspace-store
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b93e1fe: feat(workspace-store): support relative external references
8
+ - 5208f06: feat(workspace-store): validate that the bundle produces valid openapi document
9
+ - 4d509fb: feat(workspace-store): use the configuration fetcher to bundle the document
10
+ - 9be6eec: feat(workspace-store): preprocess documents to make them compliant
11
+ - c4bf497: fix(workspace-store): correctly propagate documents from one state to the other
12
+ - d8adbed: feat(workspace-store): resolve multi level refs
13
+ - 0c80ef0: feat(json-magic): change the way we resolve refs
14
+
15
+ ### Patch Changes
16
+
17
+ - bbef120: fix: remove extra coerces and cleanUp plugin from bundler
18
+ - a1429ca: chore: move to new extensions system for better type safety
19
+ - 66b18fc: feat: update the references to handle $refs from the magic proxy
20
+ - 0fcd446: feat(workspace-store): performance improvements
21
+ - c838a3f: chore: added measurements to workspace store
22
+ - Updated dependencies [b93e1fe]
23
+ - Updated dependencies [d4adeba]
24
+ - Updated dependencies [66b18fc]
25
+ - Updated dependencies [5f022b5]
26
+ - Updated dependencies [0fcd446]
27
+ - Updated dependencies [6a88108]
28
+ - Updated dependencies [c418e92]
29
+ - Updated dependencies [c4bf497]
30
+ - Updated dependencies [d8adbed]
31
+ - Updated dependencies [0c80ef0]
32
+ - @scalar/json-magic@0.3.0
33
+ - @scalar/openapi-parser@0.20.0
34
+ - @scalar/helpers@0.0.8
35
+ - @scalar/types@0.2.12
36
+ - @scalar/code-highlight@0.1.9
37
+
38
+ ## 0.13.0
39
+
40
+ ### Minor Changes
41
+
42
+ - 0d502cb: chore(workspace-store): clean up client store
43
+ - 0afc40c: feat(json-magic): introduce type-safe apply function with tracked target type in diff results
44
+ - 128af48: feat(workspace-store, json-magic): support `externalValue` fields on example object
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [e203e90]
49
+ - Updated dependencies [0afc40c]
50
+ - Updated dependencies [128af48]
51
+ - @scalar/openapi-parser@0.19.1
52
+ - @scalar/json-magic@0.2.0
53
+ - @scalar/code-highlight@0.1.9
54
+ - @scalar/helpers@0.0.7
55
+ - @scalar/types@0.2.11
56
+
3
57
  ## 0.12.0
4
58
 
5
59
  ### Minor Changes
package/dist/client.d.ts CHANGED
@@ -1,25 +1,56 @@
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
1
  import type { Config } from './schemas/workspace-specification/config.js';
2
+ import { type InMemoryWorkspace } from './schemas/inmemory-workspace.js';
5
3
  import type { WorkspaceSpecification } from './schemas/workspace-specification/index.js';
6
4
  import type { Workspace, WorkspaceDocumentMeta, WorkspaceMeta } from './schemas/workspace.js';
7
5
  import { merge, type Difference } from '@scalar/json-magic/diff';
6
+ import type { TraverseSpecOptions } from './navigation/types.js';
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
+ declare const defaultConfig: RequiredDeep<Config>;
8
39
  /**
9
40
  * Input type for workspace document metadata and configuration.
10
41
  * 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
42
  */
14
43
  type WorkspaceDocumentMetaInput = {
15
44
  /** Optional metadata about the document like title, description, etc */
16
45
  meta?: WorkspaceDocumentMeta;
17
46
  /** Required unique identifier for the document */
18
47
  name: string;
19
- /** Optional configuration for generating navigation structure */
20
- config?: Config & Partial<createNavigationOptions>;
48
+ /** Optional configuration options */
49
+ config?: DocumentConfiguration;
21
50
  /** Overrides for the document */
22
- overrides?: DeepPartial<OpenApiDocument>;
51
+ overrides?: InMemoryWorkspace['overrides'][string];
52
+ /** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */
53
+ fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
23
54
  };
24
55
  /**
25
56
  * Represents a document that is loaded from a URL.
@@ -28,8 +59,6 @@ type WorkspaceDocumentMetaInput = {
28
59
  export type UrlDoc = {
29
60
  /** URL to fetch the OpenAPI document from */
30
61
  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
62
  } & WorkspaceDocumentMetaInput;
34
63
  /** Represents a document that is provided directly as an object rather than loaded from a URL */
35
64
  export type ObjectDoc = {
@@ -42,7 +71,6 @@ export type ObjectDoc = {
42
71
  * - ObjectDoc: Direct document object with metadata
43
72
  */
44
73
  export type WorkspaceDocumentInput = UrlDoc | ObjectDoc;
45
- declare const defaultConfig: DeepRequired<Config>;
46
74
  /**
47
75
  * Configuration object for initializing a workspace store.
48
76
  * Defines the initial state and documents for the workspace.
@@ -52,6 +80,8 @@ type WorkspaceProps = {
52
80
  meta?: WorkspaceMeta;
53
81
  /** Workspace configuration */
54
82
  config?: Config;
83
+ /** Fetch function for retrieving documents */
84
+ fetch?: WorkspaceDocumentInput['fetch'];
55
85
  };
56
86
  /**
57
87
  * Type definition for the workspace store return object.
@@ -60,36 +90,228 @@ type WorkspaceProps = {
60
90
  * @see https://github.com/microsoft/TypeScript/issues/43817#issuecomment-827746462
61
91
  */
62
92
  export type WorkspaceStore = {
63
- /** Returns the reactive workspace object with an additional activeDocument getter */
93
+ /**
94
+ * Returns the reactive workspace object with an additional activeDocument getter
95
+ */
64
96
  readonly workspace: Workspace;
65
- /** Updates a specific metadata field in the workspace */
97
+ /**
98
+ * Updates a specific metadata field in the workspace
99
+ * @param key - The metadata field to update
100
+ * @param value - The new value for the field
101
+ * @example
102
+ * // Update the workspace title
103
+ * update('x-scalar-active-document', 'document-name')
104
+ */
66
105
  update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]): void;
67
- /** Updates a specific metadata field in a document */
106
+ /**
107
+ * Updates a specific metadata field in a document
108
+ * @param name - The name of the document to update ('active' or a specific document name)
109
+ * @param key - The metadata field to update
110
+ * @param value - The new value for the field
111
+ * @throws Error if the specified document doesn't exist
112
+ * @example
113
+ * // Update the auth of the active document
114
+ * updateDocument('active', 'x-scalar-active-auth', 'Bearer')
115
+ * // Update the auth of a specific document
116
+ * updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')
117
+ */
68
118
  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 */
119
+ /**
120
+ * Replaces the content of a specific document in the workspace with the provided input.
121
+ * This method computes the difference between the current document and the new input,
122
+ * then applies only the necessary changes in place. The updates are applied atomically,
123
+ * ensuring the document is updated in a single operation.
124
+ *
125
+ * @param documentName - The name of the document to update.
126
+ * @param input - The new content to apply to the document (as a plain object).
127
+ * @example
128
+ * // Replace the content of the 'api' document with new data
129
+ * store.replaceDocument('api', {
130
+ * openapi: '3.1.0',
131
+ * info: { title: 'Updated API', version: '1.0.1' },
132
+ * paths: {},
133
+ * })
134
+ */
135
+ replaceDocument(documentName: string, input: Record<string, unknown>): Promise<void>;
136
+ /**
137
+ * Resolves a reference in the active document by following the provided path and resolving any external $ref references.
138
+ * This method traverses the document structure following the given path and resolves any $ref references it encounters.
139
+ * During resolution, it sets a loading status and updates the reference with the resolved content.
140
+ *
141
+ * @param path - Array of strings representing the path to the reference (e.g. ['paths', '/users', 'get', 'responses', '200'])
142
+ * @throws Error if the path is invalid or empty
143
+ * @example
144
+ * // Resolve a reference in the active document
145
+ * resolve(['paths', '/users', 'get', 'responses', '200'])
146
+ */
72
147
  resolve(path: string[]): Promise<unknown>;
73
- /** Adds a new document to the workspace */
148
+ /**
149
+ * Adds a new document to the workspace
150
+ * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format
151
+ * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta
152
+ * @example
153
+ * // Add a new OpenAPI document to the workspace
154
+ * store.addDocument({
155
+ * name: 'name',
156
+ * document: {
157
+ * openapi: '3.0.0',
158
+ * info: { title: 'title' },
159
+ * },
160
+ * meta: {
161
+ * 'x-scalar-active-auth': 'Bearer',
162
+ * 'x-scalar-active-server': 'production'
163
+ * }
164
+ * })
165
+ */
74
166
  addDocument(input: WorkspaceDocumentInput): Promise<void>;
75
- /** Returns the merged configuration for the active document */
167
+ /**
168
+ * Returns the merged configuration for the active document.
169
+ *
170
+ * This getter merges configurations in the following order of precedence:
171
+ * 1. Document-specific configuration (highest priority)
172
+ * 2. Workspace-level configuration
173
+ * 3. Default configuration (lowest priority)
174
+ *
175
+ * The active document is determined by the workspace's activeDocument extension,
176
+ * falling back to the first document if none is specified.
177
+ */
76
178
  readonly config: typeof defaultConfig;
77
- /** Downloads the specified document in the requested format */
179
+ /**
180
+ * Exports the specified document in the requested format.
181
+ *
182
+ * This method serializes the most recently saved local version of the document (from the intermediateDocuments map)
183
+ * to either JSON or YAML. The exported document reflects the last locally saved state, including any edits
184
+ * that have been saved but not yet synced to a remote registry. Runtime/in-memory changes that have not been saved
185
+ * will not be included.
186
+ *
187
+ * @param documentName - The name of the document to export.
188
+ * @param format - The output format: 'json' for a JSON string, or 'yaml' for a YAML string.
189
+ * @returns The document as a string in the requested format, or undefined if the document does not exist.
190
+ *
191
+ * @example
192
+ * // Export a document as JSON
193
+ * const jsonString = store.exportDocument('api', 'json')
194
+ *
195
+ * // Export a document as YAML
196
+ * const yamlString = store.exportDocument('api', 'yaml')
197
+ */
78
198
  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 */
199
+ /**
200
+ * Saves the current state of the specified document to the intermediate documents map.
201
+ *
202
+ * This function captures the latest (reactive) state of the document from the workspace and
203
+ * applies its changes to the corresponding entry in the `intermediateDocuments` map.
204
+ * The `intermediateDocuments` map represents the most recently "saved" local version of the document,
205
+ * which may include edits not yet synced to the remote registry.
206
+ *
207
+ * The update is performed in-place. A deep clone of the current document
208
+ * state is used to avoid mutating the reactive object directly.
209
+ *
210
+ * @param documentName - The name of the document to save.
211
+ * @returns An array of diffs that were excluded from being applied (such as changes to ignored keys),
212
+ * or undefined if the document does not exist or cannot be updated.
213
+ *
214
+ * @example
215
+ * // Save the current state of the document named 'api'
216
+ * const excludedDiffs = store.saveDocument('api')
217
+ */
218
+ saveDocument(documentName: string): Promise<unknown[] | undefined>;
219
+ /**
220
+ * Restores the specified document to its last locally saved state.
221
+ *
222
+ * This method updates the current reactive document (in the workspace) with the contents of the
223
+ * corresponding intermediate document (from the `intermediateDocuments` map), effectively discarding
224
+ * any unsaved in-memory changes and reverting to the last saved version.
225
+ * Vue reactivity is preserved by updating the existing reactive object in place.
226
+ *
227
+ * **Warning:** This operation will discard all unsaved (in-memory) changes to the specified document.
228
+ *
229
+ * @param documentName - The name of the document to restore.
230
+ * @returns void
231
+ *
232
+ * @example
233
+ * // Restore the document named 'api' to its last saved state
234
+ * store.revertDocumentChanges('api')
235
+ */
236
+ revertDocumentChanges(documentName: string): Promise<void>;
237
+ /**
238
+ * Commits the specified document.
239
+ *
240
+ * This method is intended to finalize and persist the current state of the document,
241
+ * potentially syncing it with a remote registry or marking it as the latest committed version.
242
+ *
243
+ * @param documentName - The name of the document to commit.
244
+ * @remarks
245
+ * The actual commit logic is not implemented yet.
246
+ */
84
247
  commitDocument(documentName: string): void;
85
- /** Serializes the current workspace state to a JSON string for backup, persistence, or sharing. */
248
+ /**
249
+ * Serializes the current workspace state to a JSON string for backup, persistence, or sharing.
250
+ *
251
+ * This method exports all workspace documents (removing Vue reactivity proxies), workspace metadata,
252
+ * document configurations, and both the original and intermediate document states. The resulting JSON
253
+ * can be imported later to fully restore the workspace to this exact state, including all documents
254
+ * and their configurations.
255
+ *
256
+ * @returns A JSON string representing the complete workspace state.
257
+ */
86
258
  exportWorkspace(): string;
87
- /** Imports a workspace from a serialized JSON string. */
259
+ /**
260
+ * Imports a workspace from a serialized JSON string.
261
+ *
262
+ * This method parses the input string using the InMemoryWorkspaceSchema,
263
+ * then updates the current workspace state, including documents, metadata,
264
+ * and configuration, with the imported values.
265
+ *
266
+ * @param input - The serialized workspace JSON string to import.
267
+ */
88
268
  loadWorkspace(input: string): void;
89
- /** Imports a workspace from a specification object */
269
+ /**
270
+ * Imports a workspace from a WorkspaceSpecification object.
271
+ *
272
+ * This method assigns workspace metadata and adds all documents defined in the specification.
273
+ * Each document is added using its $ref and optional overrides.
274
+ *
275
+ * @example
276
+ * ```ts
277
+ * await store.importWorkspaceFromSpecification({
278
+ * documents: {
279
+ * api: { $ref: '/specs/api.yaml' },
280
+ * petstore: { $ref: '/specs/petstore.yaml' }
281
+ * },
282
+ * overrides: {
283
+ * api: { config: { features: { showModels: true } } }
284
+ * },
285
+ * info: { title: 'My Workspace' },
286
+ * workspace: 'v1',
287
+ * "x-scalar-dark-mode": true
288
+ * })
289
+ * ```
290
+ *
291
+ * @param specification - The workspace specification to import.
292
+ */
90
293
  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'];
294
+ /**
295
+ * Rebases a document in the workspace with a new origin, resolving conflicts if provided.
296
+ *
297
+ * This method is used to rebase a document (e.g., after pulling remote changes) by applying the changes
298
+ * from the new origin and merging them with local edits. If there are conflicts, they can be resolved
299
+ * by providing a list of resolved conflicts.
300
+ *
301
+ * @param documentName - The name of the document to rebase.
302
+ * @param newDocumentOrigin - The new origin document (as an object) to rebase onto.
303
+ * @param resolvedConflicts - (Optional) An array of resolved conflicts to apply.
304
+ * @returns If there are unresolved conflicts and no resolution is provided, returns the list of conflicts.
305
+ *
306
+ * @example
307
+ * // Example: Rebase a document with a new origin and resolve conflicts
308
+ * const conflicts = store.rebaseDocument('api', newOriginDoc)
309
+ * if (conflicts && conflicts.length > 0) {
310
+ * // User resolves conflicts here...
311
+ * store.rebaseDocument('api', newOriginDoc, userResolvedConflicts)
312
+ * }
313
+ */
314
+ rebaseDocument: (documentName: string, newDocumentOrigin: Record<string, unknown>, resolvedConflicts?: Difference<unknown>[]) => void | ReturnType<typeof merge>['conflicts'];
93
315
  };
94
316
  /**
95
317
  * 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,E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