@scalar/api-reference 0.8.1 → 0.8.3
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 +24 -0
- package/README.md +19 -15
- package/dist/browser/standalone.js +1742 -1006
- package/dist/components/ApiReference.vue.d.ts +34 -28
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/Content/Authentication/Authentication.vue.d.ts +12 -0
- package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -0
- package/dist/components/Content/Authentication/SecurityScheme.vue.d.ts +11 -0
- package/dist/components/Content/Authentication/SecurityScheme.vue.d.ts.map +1 -0
- package/dist/components/Content/Authentication/SecuritySchemeSelector.vue.d.ts +17 -0
- package/dist/components/Content/Authentication/SecuritySchemeSelector.vue.d.ts.map +1 -0
- package/dist/components/Content/Authentication/index.d.ts +2 -0
- package/dist/components/Content/Authentication/index.d.ts.map +1 -0
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +9 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts +9 -1
- package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue.d.ts +17 -1
- package/dist/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue.d.ts.map +1 -1
- package/dist/components/IntersectionObserver.vue.d.ts +6 -2
- package/dist/components/IntersectionObserver.vue.d.ts.map +1 -1
- package/dist/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.d.ts +6 -0
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeader.vue.d.ts +9 -0
- package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
- package/dist/components/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/SidebarElement.vue.d.ts +2 -0
- package/dist/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/helpers/generateRequest.d.ts +2 -2
- package/dist/helpers/generateRequest.d.ts.map +1 -1
- package/dist/helpers/getExampleFromSchema.d.ts +11 -0
- package/dist/helpers/getExampleFromSchema.d.ts.map +1 -0
- package/dist/helpers/getOperationSectionId.d.ts +2 -2
- package/dist/helpers/getOperationSectionId.d.ts.map +1 -1
- package/dist/helpers/hasSecuritySchemes.d.ts +3 -0
- package/dist/helpers/hasSecuritySchemes.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/index.js +8079 -7716
- package/dist/stores/globalStore.d.ts +21 -0
- package/dist/stores/globalStore.d.ts.map +1 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/types.d.ts +59 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/helpers/generateResponseContent.d.ts +0 -5
- package/dist/helpers/generateResponseContent.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @scalar/api-reference
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d5fccba9: add ai writer to swagger editor
|
|
8
|
+
- Updated dependencies [d5fccba9]
|
|
9
|
+
- @scalar/swagger-editor@0.6.26
|
|
10
|
+
|
|
11
|
+
## 0.8.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3b042270: fix: active state for operations with multiple tags
|
|
16
|
+
- 4685f391: feat: introducing the new universal configuration object
|
|
17
|
+
- 8ac1ad69: chore: use different heading levels
|
|
18
|
+
- 28191084: feat: add security schemes to the reference
|
|
19
|
+
- e01134d4: style: use horizontal ellipsis to indicate strings in example responses
|
|
20
|
+
- Updated dependencies [64f8a018]
|
|
21
|
+
- Updated dependencies [ce04794a]
|
|
22
|
+
- Updated dependencies [7c3091c6]
|
|
23
|
+
- @scalar/use-codemirror@0.7.10
|
|
24
|
+
- @scalar/api-client@0.7.23
|
|
25
|
+
- @scalar/swagger-editor@0.6.25
|
|
26
|
+
|
|
3
27
|
## 0.8.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -29,38 +29,40 @@ import { ApiReference } from '@scalar/api-reference'
|
|
|
29
29
|
|
|
30
30
|
You can even [mount the component in React](https://github.com/scalar/scalar/blob/main/projects/react/src/App.tsx).
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
There’s an configuration object, which can use on all platforms. In Vue.js you’re using it like this:
|
|
33
35
|
|
|
34
36
|
#### isEditable?: boolean
|
|
35
37
|
|
|
36
38
|
Whether the Swagger editor should be shown.
|
|
37
39
|
|
|
38
40
|
```vue
|
|
39
|
-
<ApiReference :
|
|
41
|
+
<ApiReference :configuration="{ isEditable: true }" />
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
#### spec?: string
|
|
44
|
+
#### spec.content?: string
|
|
43
45
|
|
|
44
46
|
Directly pass an OpenAPI/Swagger spec.
|
|
45
47
|
|
|
46
48
|
```vue
|
|
47
|
-
<ApiReference :
|
|
49
|
+
<ApiReference :configuration="{ spec: { content: '{ … }' } }" />
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
####
|
|
52
|
+
#### spec.url?: string
|
|
51
53
|
|
|
52
54
|
Pass the URL of a spec file (JSON or Yaml).
|
|
53
55
|
|
|
54
56
|
```vue
|
|
55
|
-
<ApiReference
|
|
57
|
+
<ApiReference :configuration="{ spec: { url: '/swagger.json' } }" />
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
####
|
|
60
|
+
#### spec.preparsedContent?: string
|
|
59
61
|
|
|
60
62
|
You can preprocess specs with `@scalar/swagger-parser` and directly pass the result.
|
|
61
63
|
|
|
62
64
|
```vue
|
|
63
|
-
<ApiReference :
|
|
65
|
+
<ApiReference :configuration="{ spec: { preparsedContent : '{ … }' } } />
|
|
64
66
|
```
|
|
65
67
|
|
|
66
68
|
#### proxyUrl?: string
|
|
@@ -68,23 +70,25 @@ You can preprocess specs with `@scalar/swagger-parser` and directly pass the res
|
|
|
68
70
|
Making requests to other domains is restricted in the browser and requires [CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). It’s recommended to use a proxy to send requests to other origins.
|
|
69
71
|
|
|
70
72
|
```vue
|
|
71
|
-
<ApiReference
|
|
73
|
+
<ApiReference :configuration="{ proxy: 'https://proxy.example.com' }" />
|
|
72
74
|
```
|
|
73
75
|
|
|
74
76
|
ℹ️ You can use [@scalar/api-client-proxy](https://github.com/scalar/scalar/tree/main/packages/api-client-proxy) to host your own proxy or you can just use ours:
|
|
75
77
|
|
|
76
78
|
```vue
|
|
77
|
-
<ApiReference
|
|
79
|
+
<ApiReference
|
|
80
|
+
:configuration="{ proxy: 'https://api.scalar.com/request-proxy' }" />
|
|
78
81
|
```
|
|
79
82
|
|
|
80
|
-
####
|
|
83
|
+
#### initialContent?: string
|
|
81
84
|
|
|
82
85
|
You can decide which tab should be active by default:
|
|
83
86
|
|
|
84
87
|
```vue
|
|
85
|
-
<ApiReference
|
|
88
|
+
<ApiReference
|
|
89
|
+
:initialTabState="{ tabs: { initialContent: 'Getting Started' } }" />
|
|
86
90
|
<!-- or -->
|
|
87
|
-
<ApiReference
|
|
91
|
+
<ApiReference :configuration="{ tabs: { initialContent: 'Swagger Editor' } }" />
|
|
88
92
|
```
|
|
89
93
|
|
|
90
94
|
#### showSidebar?: boolean
|
|
@@ -92,7 +96,7 @@ You can decide which tab should be active by default:
|
|
|
92
96
|
Whether the sidebar should be shown.
|
|
93
97
|
|
|
94
98
|
```vue
|
|
95
|
-
<ApiReference :
|
|
99
|
+
<ApiReference :configuration="{ showSidebar: true} />
|
|
96
100
|
```
|
|
97
101
|
|
|
98
102
|
#### footerBelowSidebar?: boolean
|
|
@@ -100,5 +104,5 @@ Whether the sidebar should be shown.
|
|
|
100
104
|
Whether the footer should below the content or below the content _and_ the sidebar.
|
|
101
105
|
|
|
102
106
|
```vue
|
|
103
|
-
<ApiReference :
|
|
107
|
+
<ApiReference :configuration="{ footerBelowSidebar: true} />
|
|
104
108
|
```
|