File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
server/node-service/src/plugins Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { parseOpenApi, ParseOpenApiOptions } from "../openApi/parse";
9
9
const spec = readYaml ( path . join ( __dirname , "./openAi.yaml" ) ) ;
10
10
const specs = {
11
11
"v1.0" : spec ,
12
- "v2.0" : spec ,
13
12
}
14
13
15
14
const dataSourceConfig = {
@@ -49,8 +48,8 @@ const openAiPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
49
48
icon : "openAI.svg" ,
50
49
category : "api" ,
51
50
dataSourceConfig,
52
- queryConfig : async ( ) => {
53
- const { actions, categories } = await parseOpenApi ( spec , parseOptions ) ;
51
+ queryConfig : async ( data ) => {
52
+ const { actions, categories } = await parseOpenApi ( specs [ data . specVersion as keyof typeof specs ] , parseOptions ) ;
54
53
return {
55
54
type : "query" ,
56
55
label : "Action" ,
@@ -68,7 +67,7 @@ const openAiPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
68
67
dynamicParamsConfig : dataSourceConfig ,
69
68
specVersion : dataSourceConfig . specVersion ,
70
69
} ;
71
- return runOpenApi ( actionData , runApiDsConfig , spec as OpenAPIV3 . Document ) ;
70
+ return runOpenApi ( actionData , runApiDsConfig , specs [ dataSourceConfig . specVersion as keyof typeof specs ] as OpenAPIV3 . Document ) ;
72
71
} ,
73
72
} ;
74
73
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import spec from "./woocommerce-spec.json";
8
8
import { specsToOptions } from "../../common/util" ;
9
9
const specs = {
10
10
"v1.0" : spec ,
11
- "v2.0" : spec ,
12
11
}
13
12
14
13
export function prepareServerUrl ( url : string ) {
You can’t perform that action at this time.
0 commit comments