@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.
- package/CHANGELOG.md +19 -0
- package/README.md +47 -1
- package/dist/client.d.ts +11713 -11143
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -2
- package/dist/client.js.map +2 -2
- package/dist/helpers/json-path-utils.d.ts +1 -1
- package/dist/helpers/json-path-utils.d.ts.map +1 -1
- package/dist/helpers/json-path-utils.js.map +2 -2
- package/dist/helpers/merge-object.d.ts +23 -0
- package/dist/helpers/merge-object.d.ts.map +1 -0
- package/dist/helpers/merge-object.js +20 -0
- package/dist/helpers/merge-object.js.map +7 -0
- package/dist/schemas/reference-config/appearance.d.ts +13 -0
- package/dist/schemas/reference-config/appearance.d.ts.map +1 -0
- package/dist/schemas/reference-config/appearance.js +26 -0
- package/dist/schemas/reference-config/appearance.js.map +7 -0
- package/dist/schemas/reference-config/features.d.ts +15 -0
- package/dist/schemas/reference-config/features.d.ts.map +1 -0
- package/dist/schemas/reference-config/features.js +30 -0
- package/dist/schemas/reference-config/features.js.map +7 -0
- package/dist/schemas/reference-config/index.d.ts +53 -0
- package/dist/schemas/reference-config/index.d.ts.map +1 -0
- package/dist/schemas/reference-config/index.js +66 -0
- package/dist/schemas/reference-config/index.js.map +7 -0
- package/dist/schemas/reference-config/meta.d.ts +12 -0
- package/dist/schemas/reference-config/meta.d.ts.map +1 -0
- package/dist/schemas/reference-config/meta.js +24 -0
- package/dist/schemas/reference-config/meta.js.map +7 -0
- package/dist/schemas/reference-config/routing.d.ts +8 -0
- package/dist/schemas/reference-config/routing.d.ts.map +1 -0
- package/dist/schemas/reference-config/routing.js +16 -0
- package/dist/schemas/reference-config/routing.js.map +7 -0
- package/dist/schemas/reference-config/settings.d.ts +8 -0
- package/dist/schemas/reference-config/settings.d.ts.map +1 -0
- package/dist/schemas/reference-config/settings.js +16 -0
- package/dist/schemas/reference-config/settings.js.map +7 -0
- package/dist/schemas/v3.1/strict/components.d.ts +167 -40
- package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/header.d.ts +2 -0
- package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/media-header-encoding.d.ts +6 -0
- package/dist/schemas/v3.1/strict/media-header-encoding.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/media-type.d.ts +1 -0
- package/dist/schemas/v3.1/strict/media-type.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts +73 -2
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.js +44 -7
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
- package/dist/schemas/v3.1/strict/oauthflows.d.ts +11 -10
- package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauthflows.js +11 -8
- package/dist/schemas/v3.1/strict/oauthflows.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +11 -2
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/parameter.d.ts +11 -5
- package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/parameter.js +1 -1
- package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
- package/dist/schemas/v3.1/strict/path-item.d.ts +5 -2
- package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/path-operations.d.ts +158 -32
- package/dist/schemas/v3.1/strict/path-operations.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/paths.d.ts +71 -14
- package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/request-body.d.ts +2 -0
- package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/response.d.ts +4 -0
- package/dist/schemas/v3.1/strict/response.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/responses.d.ts +4 -0
- package/dist/schemas/v3.1/strict/responses.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/schema.d.ts +6 -1
- package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/schema.js +7 -2
- package/dist/schemas/v3.1/strict/schema.js.map +2 -2
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +22 -20
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/type-guard.d.ts +5 -0
- package/dist/schemas/v3.1/type-guard.d.ts.map +1 -1
- package/dist/schemas/v3.1/type-guard.js +1 -3
- package/dist/schemas/v3.1/type-guard.js.map +2 -2
- package/dist/server.d.ts +640 -614
- package/dist/server.d.ts.map +1 -1
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +7 -0
- 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
|