Skip to content

Commit df93bd8

Browse files
author
Thomasr
committed
Add gcstorage spec version
1 parent ceeec59 commit df93bd8

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

server/node-service/src/plugins/googleCloudStorage/dataSourceConfig.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { ConfigToType } from "lowcoder-sdk/dataSource";
2+
import { specsToOptions } from "../../common/util";
23

4+
const specs = {
5+
"v1.0": ""
6+
}
37
export const dataSourceConfig = {
48
type: "dataSource",
59
params: [
@@ -18,6 +22,14 @@ export const dataSourceConfig = {
1822
type: "textInput",
1923
label: "Region",
2024
},
25+
{
26+
label: "Spec Version",
27+
key: "specVersion",
28+
type: "select",
29+
tooltip: "Version of the spec file.",
30+
placeholder: "v1.0",
31+
options: specsToOptions(specs)
32+
},
2133
],
2234
} as const;
2335

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ import { DataSourceDataType } from "./dataSourceConfig";
77
import run, { validateDataSourceConfig } from "./run";
88
import { dataSourceConfig } from "./dataSourceConfig";
99

10+
const specs = {
11+
"v1.0": queryConfig
12+
}
1013
const gcsPlugin = {
1114
id: "googleCloudStorage",
1215
name: "Google Cloud Storage",
1316
icon: "gcs.svg",
1417
category: "api",
1518
dataSourceConfig,
16-
queryConfig: queryConfig,
19+
queryConfig: async (data: any) => {
20+
return specs[data.specVersion as keyof typeof specs];
21+
},
1722

1823
validateDataSourceConfig: async (dataSourceConfig: DataSourceDataType) => {
1924
return validateDataSourceConfig(dataSourceConfig);

0 commit comments

Comments
 (0)