@scalar/nextjs-api-reference 0.4.10 → 0.4.13
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 +23 -0
- package/dist/index.cjs +11 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -5
- package/dist/index.umd.cjs +11 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @scalar/nextjs-api-reference
|
|
2
2
|
|
|
3
|
+
## 0.4.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [d7a011a]
|
|
8
|
+
- Updated dependencies [40d7c3d]
|
|
9
|
+
- @scalar/api-reference@1.24.15
|
|
10
|
+
|
|
11
|
+
## 0.4.12
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 008ac8c: feat: add URL support
|
|
16
|
+
- Updated dependencies [fb9baa5]
|
|
17
|
+
- @scalar/api-reference@1.24.14
|
|
18
|
+
|
|
19
|
+
## 0.4.11
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [5e92eab]
|
|
24
|
+
- @scalar/api-reference@1.24.13
|
|
25
|
+
|
|
3
26
|
## 0.4.10
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -122,14 +122,20 @@ const nextjsThemeCss = `
|
|
|
122
122
|
border: 1px solid var(--scalar-border-color);
|
|
123
123
|
}
|
|
124
124
|
`;
|
|
125
|
-
const ApiReference = (
|
|
126
|
-
|
|
127
|
-
if (!(spec == null ? void 0 :
|
|
125
|
+
const ApiReference = (config) => {
|
|
126
|
+
var _a, _b, _c, _d, _e, _f;
|
|
127
|
+
if (!((_a = config.spec) == null ? void 0 : _a.content) && !((_b = config.spec) == null ? void 0 : _b.url)) {
|
|
128
128
|
throw new Error(
|
|
129
129
|
"[@scalar/nextjs-api-reference] You didn’t provide a spec.content or spec.url. Please provide one of these options."
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
if (typeof ((_c = config.spec) == null ? void 0 : _c.content) === "function") {
|
|
133
|
+
config.spec.content = config.spec.content();
|
|
134
|
+
}
|
|
135
|
+
const documentString = ((_d = config == null ? void 0 : config.spec) == null ? void 0 : _d.content) ? typeof ((_e = config == null ? void 0 : config.spec) == null ? void 0 : _e.content) === "string" ? config.spec.content : JSON.stringify(config.spec.content) : "";
|
|
136
|
+
if ((_f = config == null ? void 0 : config.spec) == null ? void 0 : _f.content) {
|
|
137
|
+
delete config.spec.content;
|
|
138
|
+
}
|
|
133
139
|
if (!(config == null ? void 0 : config.customCss) && !(config == null ? void 0 : config.theme)) {
|
|
134
140
|
config.customCss = nextjsThemeCss;
|
|
135
141
|
}
|
|
@@ -149,7 +155,7 @@ const ApiReference = (refConfig) => {
|
|
|
149
155
|
id="api-reference"
|
|
150
156
|
type="application/json"
|
|
151
157
|
data-configuration="${configString}">
|
|
152
|
-
${
|
|
158
|
+
${documentString}
|
|
153
159
|
<\/script>
|
|
154
160
|
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"><\/script>
|
|
155
161
|
</body>
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ import { ReferenceConfiguration } from '@scalar/api-reference';
|
|
|
8
8
|
* @params config - the Api Reference config object
|
|
9
9
|
* @params options - reserved for future use to add customization to the response
|
|
10
10
|
*/
|
|
11
|
-
export declare const ApiReference: (
|
|
11
|
+
export declare const ApiReference: (config: ReferenceConfiguration) => () => Promise<Response>;
|
|
12
12
|
|
|
13
13
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -120,14 +120,20 @@ const nextjsThemeCss = `
|
|
|
120
120
|
border: 1px solid var(--scalar-border-color);
|
|
121
121
|
}
|
|
122
122
|
`;
|
|
123
|
-
const ApiReference = (
|
|
124
|
-
|
|
125
|
-
if (!(spec == null ? void 0 :
|
|
123
|
+
const ApiReference = (config) => {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f;
|
|
125
|
+
if (!((_a = config.spec) == null ? void 0 : _a.content) && !((_b = config.spec) == null ? void 0 : _b.url)) {
|
|
126
126
|
throw new Error(
|
|
127
127
|
"[@scalar/nextjs-api-reference] You didn’t provide a spec.content or spec.url. Please provide one of these options."
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
if (typeof ((_c = config.spec) == null ? void 0 : _c.content) === "function") {
|
|
131
|
+
config.spec.content = config.spec.content();
|
|
132
|
+
}
|
|
133
|
+
const documentString = ((_d = config == null ? void 0 : config.spec) == null ? void 0 : _d.content) ? typeof ((_e = config == null ? void 0 : config.spec) == null ? void 0 : _e.content) === "string" ? config.spec.content : JSON.stringify(config.spec.content) : "";
|
|
134
|
+
if ((_f = config == null ? void 0 : config.spec) == null ? void 0 : _f.content) {
|
|
135
|
+
delete config.spec.content;
|
|
136
|
+
}
|
|
131
137
|
if (!(config == null ? void 0 : config.customCss) && !(config == null ? void 0 : config.theme)) {
|
|
132
138
|
config.customCss = nextjsThemeCss;
|
|
133
139
|
}
|
|
@@ -147,7 +153,7 @@ const ApiReference = (refConfig) => {
|
|
|
147
153
|
id="api-reference"
|
|
148
154
|
type="application/json"
|
|
149
155
|
data-configuration="${configString}">
|
|
150
|
-
${
|
|
156
|
+
${documentString}
|
|
151
157
|
<\/script>
|
|
152
158
|
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"><\/script>
|
|
153
159
|
</body>
|
package/dist/index.umd.cjs
CHANGED
|
@@ -124,14 +124,20 @@
|
|
|
124
124
|
border: 1px solid var(--scalar-border-color);
|
|
125
125
|
}
|
|
126
126
|
`;
|
|
127
|
-
const ApiReference = (
|
|
128
|
-
|
|
129
|
-
if (!(spec == null ? void 0 :
|
|
127
|
+
const ApiReference = (config) => {
|
|
128
|
+
var _a, _b, _c, _d, _e, _f;
|
|
129
|
+
if (!((_a = config.spec) == null ? void 0 : _a.content) && !((_b = config.spec) == null ? void 0 : _b.url)) {
|
|
130
130
|
throw new Error(
|
|
131
131
|
"[@scalar/nextjs-api-reference] You didn’t provide a spec.content or spec.url. Please provide one of these options."
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
if (typeof ((_c = config.spec) == null ? void 0 : _c.content) === "function") {
|
|
135
|
+
config.spec.content = config.spec.content();
|
|
136
|
+
}
|
|
137
|
+
const documentString = ((_d = config == null ? void 0 : config.spec) == null ? void 0 : _d.content) ? typeof ((_e = config == null ? void 0 : config.spec) == null ? void 0 : _e.content) === "string" ? config.spec.content : JSON.stringify(config.spec.content) : "";
|
|
138
|
+
if ((_f = config == null ? void 0 : config.spec) == null ? void 0 : _f.content) {
|
|
139
|
+
delete config.spec.content;
|
|
140
|
+
}
|
|
135
141
|
if (!(config == null ? void 0 : config.customCss) && !(config == null ? void 0 : config.theme)) {
|
|
136
142
|
config.customCss = nextjsThemeCss;
|
|
137
143
|
}
|
|
@@ -151,7 +157,7 @@
|
|
|
151
157
|
id="api-reference"
|
|
152
158
|
type="application/json"
|
|
153
159
|
data-configuration="${configString}">
|
|
154
|
-
${
|
|
160
|
+
${documentString}
|
|
155
161
|
<\/script>
|
|
156
162
|
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"><\/script>
|
|
157
163
|
</body>
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"openapi",
|
|
19
19
|
"swagger"
|
|
20
20
|
],
|
|
21
|
-
"version": "0.4.
|
|
21
|
+
"version": "0.4.13",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"next": "^14.1.1",
|
|
39
39
|
"react": "^18.3.1",
|
|
40
|
-
"@scalar/api-reference": "1.24.
|
|
40
|
+
"@scalar/api-reference": "1.24.15"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.8.4",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-dom": "^18.3.1",
|
|
50
50
|
"vite": "^5.2.10",
|
|
51
51
|
"vite-plugin-dts": "^3.6.3",
|
|
52
|
-
"@scalar/api-reference": "1.24.
|
|
52
|
+
"@scalar/api-reference": "1.24.15"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "pnpm types:check && pnpm build-only",
|