@scalar/hono-api-reference 0.3.72 → 0.3.75
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/README.md +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,3 +69,21 @@ app.get(
|
|
|
69
69
|
}),
|
|
70
70
|
)
|
|
71
71
|
```
|
|
72
|
+
|
|
73
|
+
### Custom CDN
|
|
74
|
+
|
|
75
|
+
You can use a custom CDN ,default is `https://cdn.jsdelivr.net/npm/@scalar/api-reference`.
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { apiReference } from '@scalar/nestjs-api-reference'
|
|
79
|
+
|
|
80
|
+
app.use(
|
|
81
|
+
'/reference',
|
|
82
|
+
apiReference({
|
|
83
|
+
cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference',
|
|
84
|
+
spec: {
|
|
85
|
+
content: OpenApiSpecification,
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
)
|
|
89
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -143,7 +143,7 @@ var javascript = (configuration) => {
|
|
|
143
143
|
configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""
|
|
144
144
|
)}
|
|
145
145
|
</script>
|
|
146
|
-
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
146
|
+
<script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
|
|
147
147
|
`;
|
|
148
148
|
};
|
|
149
149
|
var apiReference = (options) => async (c) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { Env, MiddlewareHandler } from 'hono';
|
|
|
4
4
|
|
|
5
5
|
type ApiReferenceOptions = ReferenceConfiguration & {
|
|
6
6
|
pageTitle?: string;
|
|
7
|
+
cdn?: string;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* The custom theme CSS for the API Reference.
|
|
@@ -12,7 +13,7 @@ declare const customThemeCSS = "\n:root {\n --theme-font: 'Inter', var(--system
|
|
|
12
13
|
/**
|
|
13
14
|
* The HTML to load the @scalar/api-reference JavaScript package.
|
|
14
15
|
*/
|
|
15
|
-
declare const javascript: (configuration:
|
|
16
|
+
declare const javascript: (configuration: ApiReferenceOptions) => hono_utils_html.HtmlEscapedString | Promise<hono_utils_html.HtmlEscapedString>;
|
|
16
17
|
/**
|
|
17
18
|
* The middleware for the API Reference.
|
|
18
19
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Env, MiddlewareHandler } from 'hono';
|
|
|
4
4
|
|
|
5
5
|
type ApiReferenceOptions = ReferenceConfiguration & {
|
|
6
6
|
pageTitle?: string;
|
|
7
|
+
cdn?: string;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* The custom theme CSS for the API Reference.
|
|
@@ -12,7 +13,7 @@ declare const customThemeCSS = "\n:root {\n --theme-font: 'Inter', var(--system
|
|
|
12
13
|
/**
|
|
13
14
|
* The HTML to load the @scalar/api-reference JavaScript package.
|
|
14
15
|
*/
|
|
15
|
-
declare const javascript: (configuration:
|
|
16
|
+
declare const javascript: (configuration: ApiReferenceOptions) => hono_utils_html.HtmlEscapedString | Promise<hono_utils_html.HtmlEscapedString>;
|
|
16
17
|
/**
|
|
17
18
|
* The middleware for the API Reference.
|
|
18
19
|
*/
|
package/dist/index.js
CHANGED
|
@@ -115,7 +115,7 @@ var javascript = (configuration) => {
|
|
|
115
115
|
configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""
|
|
116
116
|
)}
|
|
117
117
|
</script>
|
|
118
|
-
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
118
|
+
<script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
|
|
119
119
|
`;
|
|
120
120
|
};
|
|
121
121
|
var apiReference = (options) => async (c) => {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Scalar (https://github.com/scalar)",
|
|
6
6
|
"homepage": "https://github.com/scalar/scalar",
|
|
7
7
|
"bugs": "https://github.com/scalar/scalar/issues/new/choose",
|
|
8
|
-
"version": "0.3.
|
|
8
|
+
"version": "0.3.75",
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": ">=18"
|
|
11
11
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"directory": "packages/hono-api-reference"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@scalar/api-reference": "1.18.
|
|
37
|
+
"@scalar/api-reference": "1.18.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"hono": "^3.11.7",
|