Skip to content

Commit 6b54810

Browse files
author
Thomasr
committed
add version field to plugin definition.
1 parent 8288a82 commit 6b54810

File tree

21 files changed

+365
-4
lines changed

21 files changed

+365
-4
lines changed

server/node-service/src/plugins/asana/index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,24 @@ const dataSourceConfig = {
2323
"key": "personalAccessToken.value",
2424
"label": "Token",
2525
"tooltip": "A [personal access token](https://developers.asana.com/docs/personal-access-token) allows access to the api for the user who created it. This should be kept a secret and be treated like a password.",
26-
}
26+
},
27+
{
28+
label: "Spec Version",
29+
key: "specVersion",
30+
type: "select",
31+
tooltip: "Version of the spec file.",
32+
placeholder: "v1.0",
33+
options: [
34+
{
35+
value: "v1.0",
36+
label: "v1.0",
37+
},
38+
{
39+
value: "v2.0",
40+
label: "v2.0",
41+
}
42+
]
43+
},
2744
]
2845
} as const;
2946

@@ -58,6 +75,7 @@ const asanaPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
5875
url: "",
5976
serverURL: "",
6077
dynamicParamsConfig: dataSourceConfig,
78+
specVersion: dataSourceConfig.specVersion,
6179
};
6280
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);
6381
},

server/node-service/src/plugins/circleCi/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ const dataSourceConfig = {
1616
tooltip:
1717
"[Personal API Token](https://circleci.com/docs/managing-api-tokens/#creating-a-personal-api-token)",
1818
},
19+
{
20+
label: "Spec Version",
21+
key: "specVersion",
22+
type: "select",
23+
tooltip: "Version of the spec file.",
24+
placeholder: "v1.0",
25+
options: [
26+
{
27+
value: "v1.0",
28+
label: "v1.0",
29+
},
30+
{
31+
value: "v2.0",
32+
label: "v2.0",
33+
}
34+
]
35+
},
1936
],
2037
} as const;
2138

@@ -53,6 +70,7 @@ const circleCiPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
5370
url: "",
5471
serverURL: "",
5572
dynamicParamsConfig: dataSourceConfig,
73+
specVersion: dataSourceConfig.specVersion,
5674
};
5775
return runOpenApi(actionData, runApiDsConfig, spec as unknown as OpenAPIV3.Document);
5876
},

server/node-service/src/plugins/cloudinary/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ const dataSourceConfig = {
3232
tooltip: "Basic auth password",
3333
placeholder: "<Basic Auth Password>",
3434
},
35+
{
36+
label: "Spec Version",
37+
key: "specVersion",
38+
type: "select",
39+
tooltip: "Version of the spec file.",
40+
placeholder: "v1.0",
41+
options: [
42+
{
43+
value: "v1.0",
44+
label: "v1.0",
45+
},
46+
{
47+
value: "v2.0",
48+
label: "v2.0",
49+
}
50+
]
51+
},
3552
],
3653
} as const;
3754

@@ -74,6 +91,7 @@ const cloudinaryPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7491
url: "",
7592
serverURL: "",
7693
dynamicParamsConfig: dataSourceConfig,
94+
specVersion: dataSourceConfig.specVersion,
7795
};
7896
return runOpenApi(actionData, runApiDsConfig, specList);
7997
},

server/node-service/src/plugins/couchdb/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ const dataSourceConfig = {
3838
tooltip: "",
3939
placeholder: "",
4040
},
41+
{
42+
label: "Spec Version",
43+
key: "specVersion",
44+
type: "select",
45+
tooltip: "Version of the spec file.",
46+
placeholder: "v1.0",
47+
options: [
48+
{
49+
value: "v1.0",
50+
label: "v1.0",
51+
},
52+
{
53+
value: "v2.0",
54+
label: "v2.0",
55+
}
56+
]
57+
},
4158
],
4259
} as const;
4360

@@ -77,6 +94,7 @@ const couchdbPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7794
url: "",
7895
serverURL: serverURL,
7996
dynamicParamsConfig: otherDataSourceConfig,
97+
specVersion: dataSourceConfig.specVersion
8098
};
8199
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV2.Document);
82100
},

server/node-service/src/plugins/datadog/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ const dataSourceConfig = {
2727
key: "appKeyAuth.value",
2828
label: "Application Key",
2929
},
30+
{
31+
label: "Spec Version",
32+
key: "specVersion",
33+
type: "select",
34+
tooltip: "Version of the spec file.",
35+
placeholder: "v1.0",
36+
options: [
37+
{
38+
value: "v1.0",
39+
label: "v1.0",
40+
},
41+
{
42+
value: "v2.0",
43+
label: "v2.0",
44+
}
45+
]
46+
},
3047
],
3148
} as const;
3249

@@ -64,6 +81,7 @@ const datadogPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6481
url: "",
6582
serverURL: dataSourceConfig.serverURL,
6683
dynamicParamsConfig: dataSourceConfig,
84+
specVersion: dataSourceConfig.specVersion,
6785
};
6886
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);
6987
},

server/node-service/src/plugins/did/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ const dataSourceConfig = {
4444
tooltip: "Basic auth password",
4545
placeholder: "<Basic Auth Password>",
4646
},
47+
{
48+
label: "Spec Version",
49+
key: "specVersion",
50+
type: "select",
51+
tooltip: "Version of the spec file.",
52+
placeholder: "v1.0",
53+
options: [
54+
{
55+
value: "v1.0",
56+
label: "v1.0",
57+
},
58+
{
59+
value: "v2.0",
60+
label: "v2.0",
61+
}
62+
]
63+
},
4764
],
4865
} as const;
4966

@@ -83,6 +100,7 @@ const didPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
83100
url: "",
84101
serverURL: "",
85102
dynamicParamsConfig: dataSourceConfig,
103+
specVersion: dataSourceConfig.specVersion,
86104
};
87105
return runOpenApi(actionData, runApiDsConfig, specList);
88106
},

server/node-service/src/plugins/front/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ const dataSourceConfig = {
1414
key: "http.value",
1515
label: "Token",
1616
},
17+
{
18+
label: "Spec Version",
19+
key: "specVersion",
20+
type: "select",
21+
tooltip: "Version of the spec file.",
22+
placeholder: "v1.0",
23+
options: [
24+
{
25+
value: "v1.0",
26+
label: "v1.0",
27+
},
28+
{
29+
value: "v2.0",
30+
label: "v2.0",
31+
}
32+
]
33+
},
1734
],
1835
} as const;
1936

@@ -51,6 +68,7 @@ const frontPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
5168
url: "",
5269
serverURL: "",
5370
dynamicParamsConfig: dataSourceConfig,
71+
specVersion: dataSourceConfig.specVersion,
5472
};
5573
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);
5674
},

server/node-service/src/plugins/github/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ const dataSourceConfig = {
2727
"[Document](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) about how to create a personal access token",
2828
placeholder: "<Your Personal Access Token>",
2929
},
30+
{
31+
label: "Spec Version",
32+
key: "specVersion",
33+
type: "select",
34+
tooltip: "Version of the spec file.",
35+
placeholder: "v1.0",
36+
options: [
37+
{
38+
value: "v1.0",
39+
label: "v1.0",
40+
},
41+
{
42+
value: "v2.0",
43+
label: "v2.0",
44+
}
45+
]
46+
},
3047
],
3148
} as const;
3249

@@ -62,6 +79,7 @@ const gitHubPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6279
url: "",
6380
serverURL: "https://api.github.com",
6481
dynamicParamsConfig: dataSourceConfig,
82+
specVersion: dataSourceConfig.specVersion,
6583
};
6684
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document, undefined, await deRefedSpec);
6785
},

server/node-service/src/plugins/huggingFaceEndpoint/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ const dataSourceConfig = {
2525
tooltip:
2626
"You can get an Access Token [in your profile setting page](https://huggingface.co/settings/tokens)",
2727
},
28+
{
29+
label: "Spec Version",
30+
key: "specVersion",
31+
type: "select",
32+
tooltip: "Version of the spec file.",
33+
placeholder: "v1.0",
34+
options: [
35+
{
36+
value: "v1.0",
37+
label: "v1.0",
38+
},
39+
{
40+
value: "v2.0",
41+
label: "v2.0",
42+
}
43+
]
44+
},
2845
],
2946
} as const;
3047

@@ -62,6 +79,7 @@ const huggingFacePlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6279
url: "",
6380
serverURL: "",
6481
dynamicParamsConfig: dataSourceConfig,
82+
specVersion: dataSourceConfig.specVersion,
6583
};
6684
return runOpenApi(actionData, runApiDsConfig, spec as unknown as OpenAPIV3.Document);
6785
},

server/node-service/src/plugins/jira/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ const dataSourceConfig = {
3636
tooltip: "Basic auth password",
3737
placeholder: "<API Token>",
3838
},
39+
{
40+
label: "Spec Version",
41+
key: "specVersion",
42+
type: "select",
43+
tooltip: "Version of the spec file.",
44+
placeholder: "v1.0",
45+
options: [
46+
{
47+
value: "v1.0",
48+
label: "v1.0",
49+
},
50+
{
51+
value: "v2.0",
52+
label: "v2.0",
53+
}
54+
]
55+
},
3956
],
4057
} as const;
4158

@@ -79,6 +96,7 @@ const jiraPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7996
url: "",
8097
serverURL: dataSourceConfig.serverUrl,
8198
dynamicParamsConfig: dataSourceConfig,
99+
specVersion: dataSourceConfig.specVersion,
82100
};
83101
return runOpenApi(actionData, runApiDsConfig, spec);
84102
},

server/node-service/src/plugins/lowcoder/index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,24 @@ const dataSourceConfig = {
3030
label: "Authorization",
3131
"tooltip": "API Key Authentication with a Bearer token. Copy your API Key here. (e.g. 'Bearer eyJhbGciO...')",
3232
"placeholder": "API Key Authentication with a Bearer token. Copy your API Key here. (e.g. 'Bearer eyJhbGciO...')"
33-
}
33+
},
34+
{
35+
label: "Spec Version",
36+
key: "specVersion",
37+
type: "select",
38+
tooltip: "Version of the spec file.",
39+
placeholder: "v1.0",
40+
options: [
41+
{
42+
value: "v1.0",
43+
label: "v1.0",
44+
},
45+
{
46+
value: "v2.0",
47+
label: "v2.0",
48+
}
49+
]
50+
},
3451
]
3552
} as const;
3653

@@ -67,6 +84,7 @@ const lowcoderPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6784
url: "",
6885
serverURL: serverURL,
6986
dynamicParamsConfig: otherDataSourceConfig,
87+
specVersion: dataSourceConfig.specVersion,
7088
};
7189
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);
7290
},

server/node-service/src/plugins/n8n/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ const dataSourceConfig = {
3535
tooltip:
3636
"You api key, doc: [n8n API authentication](https://docs.n8n.io/api/authentication/)",
3737
},
38+
{
39+
label: "Spec Version",
40+
key: "specVersion",
41+
type: "select",
42+
tooltip: "Version of the spec file.",
43+
placeholder: "v1.0",
44+
options: [
45+
{
46+
value: "v1.0",
47+
label: "v1.0",
48+
},
49+
{
50+
value: "v2.0",
51+
label: "v2.0",
52+
}
53+
]
54+
},
3855
],
3956
} as const;
4057

@@ -77,6 +94,7 @@ const n8nPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
7794
dynamicParamsConfig: {
7895
"ApiKeyAuth.value": apiKey,
7996
},
97+
specVersion: dataSourceConfig.specVersion
8098
};
8199
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);
82100
},

0 commit comments

Comments
 (0)