File tree Expand file tree Collapse file tree 7 files changed +522
-38
lines changed Expand file tree Collapse file tree 7 files changed +522
-38
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @gitbook/openapi-parser " : patch
3+ ---
4+
5+ Upgrade Scalar dependencies
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1212 "version" : " 3.0.1" ,
1313 "sideEffects" : false ,
1414 "dependencies" : {
15- "@scalar/openapi-parser" : " ^0.18.0" ,
16- "@scalar/openapi-types" : " ^0.1.9"
15+ "@scalar/json-magic" : " ^0.3.1" ,
16+ "@scalar/openapi-parser" : " ^0.20.1" ,
17+ "@scalar/openapi-types" : " ^0.3.7"
1718 },
1819 "devDependencies" : {
1920 "@tsconfig/strictest" : " ^2.0.5" ,
Original file line number Diff line number Diff line change 1- import { bundle } from '@scalar/openapi-parser ' ;
2- import { parseJson , parseYaml } from '@scalar/openapi-parser/ plugins- browser' ;
1+ import { bundle } from '@scalar/json-magic/bundle ' ;
2+ import { parseJson , parseYaml } from '@scalar/json-magic/bundle/ plugins/ browser' ;
33import type { ParseOpenAPIInput } from './parse' ;
44import { fetchURL } from './scalar-plugins/fetchURL' ;
55import { fetchURLs } from './scalar-plugins/fetchURLs' ;
Original file line number Diff line number Diff line change 1- import type { AnyObject , ErrorObject , bundle } from '@scalar/openapi-parser' ;
1+ import type { Plugin } from '@scalar/json-magic/bundle' ;
2+ import type { AnyObject , ErrorObject } from '@scalar/openapi-parser' ;
23import { OpenAPIParseError } from './error' ;
34import type { Filesystem , OpenAPIV3xDocument } from './types' ;
45import { convertOpenAPIV2ToOpenAPIV3 } from './v2' ;
56import { parseOpenAPIV3 } from './v3' ;
67
7- export type ParsePlugin = Parameters < typeof bundle > [ 1 ] [ 'plugins' ] [ number ] ;
8-
98export interface ParseOpenAPIInput {
109 /**
1110 * The API definition to parse.
@@ -19,7 +18,7 @@ export interface ParseOpenAPIInput {
1918 * Options for the parser.
2019 */
2120 options ?: {
22- plugins ?: ParsePlugin [ ] ;
21+ plugins ?: Plugin [ ] ;
2322 } ;
2423}
2524
Original file line number Diff line number Diff line change 1+ import type { Plugin } from '@scalar/json-magic/bundle' ;
12import { normalize } from '@scalar/openapi-parser' ;
2- import type { ParsePlugin } from '../parse' ;
33
44export const fetchUrlsDefaultConfiguration = {
55 limit : 40 ,
66} ;
77
8- export const fetchURL = ( ) : ParsePlugin => ( {
8+ export const fetchURL = ( ) : Plugin => ( {
9+ type : 'loader' ,
910 validate ( value ) {
1011 return URL . canParse ( value ) ;
1112 } ,
Original file line number Diff line number Diff line change 1+ import type { Plugin } from '@scalar/json-magic/bundle' ;
12import { normalize } from '@scalar/openapi-parser' ;
2- import type { ParsePlugin } from '../parse' ;
33
44export const fetchUrlsDefaultConfiguration = {
55 limit : 40 ,
@@ -15,7 +15,7 @@ export const fetchURLs = (customConfiguration: {
1515 * Limit the number of requests. Set to `false` to disable the limit.
1616 */
1717 limit ?: number | false ;
18- } ) : ParsePlugin => {
18+ } ) : Plugin => {
1919 // State
2020 let numberOfRequests = 0 ;
2121
@@ -26,6 +26,7 @@ export const fetchURLs = (customConfiguration: {
2626 } ;
2727
2828 return {
29+ type : 'loader' ,
2930 validate ( value ) {
3031 // Not a string
3132 if ( typeof value !== 'string' ) {
You can’t perform that action at this time.
0 commit comments