@scalar/express-api-reference 0.4.162 → 0.4.164
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 +8 -0
- package/dist/index.cjs +9 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -87,3 +87,11 @@ app.use(
|
|
|
87
87
|
}),
|
|
88
88
|
)
|
|
89
89
|
```
|
|
90
|
+
|
|
91
|
+
## Community
|
|
92
|
+
|
|
93
|
+
We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar>
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
The source code in this repository is licensed under [MIT](https://github.com/scalar/scalar/blob/main/LICENSE).
|
package/dist/index.cjs
CHANGED
|
@@ -122,13 +122,19 @@ var customThemeCSS = `
|
|
|
122
122
|
--scalar-radius-xl: 3px;
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
125
|
-
var ApiReference = (
|
|
125
|
+
var ApiReference = (configuration) => {
|
|
126
|
+
const defaultConfiguration = {
|
|
127
|
+
_integration: "express"
|
|
128
|
+
};
|
|
126
129
|
return `
|
|
127
130
|
<script
|
|
128
131
|
id="api-reference"
|
|
129
132
|
type="application/json"
|
|
130
|
-
data-configuration="${JSON.stringify(
|
|
131
|
-
|
|
133
|
+
data-configuration="${JSON.stringify({
|
|
134
|
+
...defaultConfiguration,
|
|
135
|
+
...configuration
|
|
136
|
+
}).split('"').join(""")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
|
|
137
|
+
<script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
|
|
132
138
|
`;
|
|
133
139
|
};
|
|
134
140
|
function apiReference(options) {
|
package/dist/index.d.cts
CHANGED
|
@@ -11,7 +11,7 @@ declare const customThemeCSS = "\n/* basic theme */\n.light-mode {\n --scalar-c
|
|
|
11
11
|
/**
|
|
12
12
|
* The HTML to load the @scalar/api-reference package.
|
|
13
13
|
*/
|
|
14
|
-
declare const ApiReference: (
|
|
14
|
+
declare const ApiReference: (configuration: ApiReferenceOptions) => string;
|
|
15
15
|
/**
|
|
16
16
|
* The HTML template to render the API Reference.
|
|
17
17
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const customThemeCSS = "\n/* basic theme */\n.light-mode {\n --scalar-c
|
|
|
11
11
|
/**
|
|
12
12
|
* The HTML to load the @scalar/api-reference package.
|
|
13
13
|
*/
|
|
14
|
-
declare const ApiReference: (
|
|
14
|
+
declare const ApiReference: (configuration: ApiReferenceOptions) => string;
|
|
15
15
|
/**
|
|
16
16
|
* The HTML template to render the API Reference.
|
|
17
17
|
*/
|
package/dist/index.js
CHANGED
|
@@ -94,13 +94,19 @@ var customThemeCSS = `
|
|
|
94
94
|
--scalar-radius-xl: 3px;
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
|
-
var ApiReference = (
|
|
97
|
+
var ApiReference = (configuration) => {
|
|
98
|
+
const defaultConfiguration = {
|
|
99
|
+
_integration: "express"
|
|
100
|
+
};
|
|
98
101
|
return `
|
|
99
102
|
<script
|
|
100
103
|
id="api-reference"
|
|
101
104
|
type="application/json"
|
|
102
|
-
data-configuration="${JSON.stringify(
|
|
103
|
-
|
|
105
|
+
data-configuration="${JSON.stringify({
|
|
106
|
+
...defaultConfiguration,
|
|
107
|
+
...configuration
|
|
108
|
+
}).split('"').join(""")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
|
|
109
|
+
<script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
|
|
104
110
|
`;
|
|
105
111
|
};
|
|
106
112
|
function apiReference(options) {
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/express-api-reference"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.4.
|
|
13
|
+
"version": "0.4.164",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=18"
|
|
16
16
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"module": "dist/index.js",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@scalar/types": "0.0.
|
|
37
|
+
"@scalar/types": "0.0.16"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/express": "^4.17.21",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tsup": "^7.2.0",
|
|
43
43
|
"vite": "^5.2.10",
|
|
44
44
|
"vitest": "^1.6.0",
|
|
45
|
-
"@scalar/api-reference": "1.25.
|
|
45
|
+
"@scalar/api-reference": "1.25.38"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsup ./src/index.ts --format esm,cjs --dts",
|