@scalar/sveltekit 0.1.26 → 0.1.27
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.
|
@@ -4,5 +4,5 @@ import type { ApiReferenceConfiguration } from './types.js';
|
|
|
4
4
|
*
|
|
5
5
|
* {@link https://github.com/scalar/scalar/tree/main/documentation/configuration.md Configuration}
|
|
6
6
|
*/
|
|
7
|
-
export declare const ScalarApiReference: (givenConfiguration: Partial<ApiReferenceConfiguration>) => () =>
|
|
7
|
+
export declare const ScalarApiReference: (givenConfiguration: Partial<ApiReferenceConfiguration>) => (() => Response);
|
|
8
8
|
//# sourceMappingURL=scalar-api-reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalar-api-reference.d.ts","sourceRoot":"","sources":["../src/scalar-api-reference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAS3D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,oBAAoB,OAAO,CAAC,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"scalar-api-reference.d.ts","sourceRoot":"","sources":["../src/scalar-api-reference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAS3D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,oBAAoB,OAAO,CAAC,yBAAyB,CAAC,KAAG,CAAC,MAAM,QAAQ,CAc1G,CAAA"}
|
|
@@ -17,12 +17,11 @@ export const ScalarApiReference = (givenConfiguration) => {
|
|
|
17
17
|
...DEFAULT_CONFIGURATION,
|
|
18
18
|
...givenConfiguration,
|
|
19
19
|
};
|
|
20
|
-
return
|
|
21
|
-
|
|
20
|
+
return () => {
|
|
21
|
+
const referenceDocument = getHtmlDocument(configuration, customTheme);
|
|
22
|
+
return new Response(referenceDocument, {
|
|
22
23
|
status: 200,
|
|
23
|
-
headers: {
|
|
24
|
-
'Content-Type': 'text/html',
|
|
25
|
-
},
|
|
24
|
+
headers: { 'Content-Type': 'text/html' },
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
27
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"openapi",
|
|
19
19
|
"swagger"
|
|
20
20
|
],
|
|
21
|
-
"version": "0.1.
|
|
21
|
+
"version": "0.1.27",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"svelte": "./dist/index.js",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@scalar/core": "0.3.
|
|
46
|
+
"@scalar/core": "0.3.21"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@sveltejs/kit": "^2.25.0",
|
|
@@ -15,19 +15,18 @@ const DEFAULT_CONFIGURATION: Partial<ApiReferenceConfiguration> = {
|
|
|
15
15
|
*
|
|
16
16
|
* {@link https://github.com/scalar/scalar/tree/main/documentation/configuration.md Configuration}
|
|
17
17
|
*/
|
|
18
|
-
export const ScalarApiReference = (givenConfiguration: Partial<ApiReferenceConfiguration>) => {
|
|
18
|
+
export const ScalarApiReference = (givenConfiguration: Partial<ApiReferenceConfiguration>): (() => Response) => {
|
|
19
19
|
// Merge the defaults
|
|
20
|
-
const configuration = {
|
|
20
|
+
const configuration: Partial<ApiReferenceConfiguration> = {
|
|
21
21
|
...DEFAULT_CONFIGURATION,
|
|
22
22
|
...givenConfiguration,
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
return
|
|
26
|
-
|
|
25
|
+
return () => {
|
|
26
|
+
const referenceDocument = getHtmlDocument(configuration, customTheme)
|
|
27
|
+
return new Response(referenceDocument, {
|
|
27
28
|
status: 200,
|
|
28
|
-
headers: {
|
|
29
|
-
'Content-Type': 'text/html',
|
|
30
|
-
},
|
|
29
|
+
headers: { 'Content-Type': 'text/html' },
|
|
31
30
|
})
|
|
32
31
|
}
|
|
33
32
|
}
|