@scalar/workspace-store 0.6.0 → 0.7.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 (88) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +47 -1
  3. package/dist/client.d.ts +11713 -11143
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +27 -2
  6. package/dist/client.js.map +2 -2
  7. package/dist/helpers/json-path-utils.d.ts +1 -1
  8. package/dist/helpers/json-path-utils.d.ts.map +1 -1
  9. package/dist/helpers/json-path-utils.js.map +2 -2
  10. package/dist/helpers/merge-object.d.ts +23 -0
  11. package/dist/helpers/merge-object.d.ts.map +1 -0
  12. package/dist/helpers/merge-object.js +20 -0
  13. package/dist/helpers/merge-object.js.map +7 -0
  14. package/dist/schemas/reference-config/appearance.d.ts +13 -0
  15. package/dist/schemas/reference-config/appearance.d.ts.map +1 -0
  16. package/dist/schemas/reference-config/appearance.js +26 -0
  17. package/dist/schemas/reference-config/appearance.js.map +7 -0
  18. package/dist/schemas/reference-config/features.d.ts +15 -0
  19. package/dist/schemas/reference-config/features.d.ts.map +1 -0
  20. package/dist/schemas/reference-config/features.js +30 -0
  21. package/dist/schemas/reference-config/features.js.map +7 -0
  22. package/dist/schemas/reference-config/index.d.ts +53 -0
  23. package/dist/schemas/reference-config/index.d.ts.map +1 -0
  24. package/dist/schemas/reference-config/index.js +66 -0
  25. package/dist/schemas/reference-config/index.js.map +7 -0
  26. package/dist/schemas/reference-config/meta.d.ts +12 -0
  27. package/dist/schemas/reference-config/meta.d.ts.map +1 -0
  28. package/dist/schemas/reference-config/meta.js +24 -0
  29. package/dist/schemas/reference-config/meta.js.map +7 -0
  30. package/dist/schemas/reference-config/routing.d.ts +8 -0
  31. package/dist/schemas/reference-config/routing.d.ts.map +1 -0
  32. package/dist/schemas/reference-config/routing.js +16 -0
  33. package/dist/schemas/reference-config/routing.js.map +7 -0
  34. package/dist/schemas/reference-config/settings.d.ts +8 -0
  35. package/dist/schemas/reference-config/settings.d.ts.map +1 -0
  36. package/dist/schemas/reference-config/settings.js +16 -0
  37. package/dist/schemas/reference-config/settings.js.map +7 -0
  38. package/dist/schemas/v3.1/strict/components.d.ts +167 -40
  39. package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
  40. package/dist/schemas/v3.1/strict/header.d.ts +2 -0
  41. package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
  42. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts +6 -0
  43. package/dist/schemas/v3.1/strict/media-header-encoding.d.ts.map +1 -1
  44. package/dist/schemas/v3.1/strict/media-type.d.ts +1 -0
  45. package/dist/schemas/v3.1/strict/media-type.d.ts.map +1 -1
  46. package/dist/schemas/v3.1/strict/oauth-flow.d.ts +73 -2
  47. package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
  48. package/dist/schemas/v3.1/strict/oauth-flow.js +44 -7
  49. package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
  50. package/dist/schemas/v3.1/strict/oauthflows.d.ts +11 -10
  51. package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
  52. package/dist/schemas/v3.1/strict/oauthflows.js +11 -8
  53. package/dist/schemas/v3.1/strict/oauthflows.js.map +2 -2
  54. package/dist/schemas/v3.1/strict/operation.d.ts +11 -2
  55. package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
  56. package/dist/schemas/v3.1/strict/parameter.d.ts +11 -5
  57. package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
  58. package/dist/schemas/v3.1/strict/parameter.js +1 -1
  59. package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
  60. package/dist/schemas/v3.1/strict/path-item.d.ts +5 -2
  61. package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
  62. package/dist/schemas/v3.1/strict/path-operations.d.ts +158 -32
  63. package/dist/schemas/v3.1/strict/path-operations.d.ts.map +1 -1
  64. package/dist/schemas/v3.1/strict/paths.d.ts +71 -14
  65. package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
  66. package/dist/schemas/v3.1/strict/request-body.d.ts +2 -0
  67. package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
  68. package/dist/schemas/v3.1/strict/response.d.ts +4 -0
  69. package/dist/schemas/v3.1/strict/response.d.ts.map +1 -1
  70. package/dist/schemas/v3.1/strict/responses.d.ts +4 -0
  71. package/dist/schemas/v3.1/strict/responses.d.ts.map +1 -1
  72. package/dist/schemas/v3.1/strict/schema.d.ts +6 -1
  73. package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
  74. package/dist/schemas/v3.1/strict/schema.js +7 -2
  75. package/dist/schemas/v3.1/strict/schema.js.map +2 -2
  76. package/dist/schemas/v3.1/strict/security-scheme.d.ts +22 -20
  77. package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
  78. package/dist/schemas/v3.1/type-guard.d.ts +5 -0
  79. package/dist/schemas/v3.1/type-guard.d.ts.map +1 -1
  80. package/dist/schemas/v3.1/type-guard.js +1 -3
  81. package/dist/schemas/v3.1/type-guard.js.map +2 -2
  82. package/dist/server.d.ts +640 -614
  83. package/dist/server.d.ts.map +1 -1
  84. package/dist/types.d.ts +57 -0
  85. package/dist/types.d.ts.map +1 -0
  86. package/dist/types.js +1 -0
  87. package/dist/types.js.map +7 -0
  88. package/package.json +18 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalar/workspace-store
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a05d638: feat(workspace-store): create types and validator for reference config schema
8
+ - 8d8e427: feat(api-reference): load documents on the new store
9
+ - dbbdd70: feat(workspace-store) add configuration mapping to the workspace store
10
+
11
+ ### Patch Changes
12
+
13
+ - 23b150b: fix: export and fix up some types from workspace store
14
+ - Updated dependencies [533469b]
15
+ - Updated dependencies [23b150b]
16
+ - @scalar/openapi-types@0.3.4
17
+ - @scalar/helpers@0.0.5
18
+ - @scalar/openapi-parser@0.18.0
19
+ - @scalar/types@0.2.5
20
+ - @scalar/code-highlight@0.1.4
21
+
3
22
  ## 0.6.0
4
23
 
5
24
  ### Minor Changes
package/README.md CHANGED
@@ -237,4 +237,50 @@ await store.addDocument({
237
237
 
238
238
  // Output: { openapi: 'x.x.x', ... }
239
239
  console.log(store.workspace.documents.default)
240
- ```
240
+ ```
241
+
242
+ #### Configuration
243
+
244
+ You can pass configuration object to the workspace store which is going to be applied to all the documents
245
+
246
+ ```ts
247
+ const store = createWorkspaceStore({
248
+ config: {
249
+ "x-scalar-reference-config": {
250
+ features: {
251
+ showModels: true,
252
+ },
253
+ appearance: {
254
+ layout: 'modern'
255
+ },
256
+ }
257
+ }
258
+ })
259
+ ```
260
+
261
+ You can override specific document configuration when you add the document to the store
262
+
263
+ ```ts
264
+ store.addDocumentSync({
265
+ name: 'example',
266
+ document: {
267
+ openapi: '3.0.0',
268
+ info: { title: 'Example API', version: '1.0.0' },
269
+ paths: {},
270
+ },
271
+ config: {
272
+ features: {
273
+ showModels: false,
274
+ },
275
+ }
276
+ })
277
+ ```
278
+
279
+ To get the active document configuration you can use config getter\
280
+
281
+ ```ts
282
+ // Get the configuration for the active document
283
+ console.log(store.config['x-scalar-reference-config'].features.showModels)
284
+ ```
285
+
286
+ When no configuration is provided it will return the default configuration