Skip to content

Commit f4a3592

Browse files
author
Thomasr
committed
Add firebase spec version
1 parent a3fc994 commit f4a3592

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

server/node-service/src/plugins/firebase/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
const dataSourceConfig = {
48
type: "dataSource",
59
params: [
@@ -23,6 +27,14 @@ const dataSourceConfig = {
2327
tooltip:
2428
"The [document](https://firebase.google.com/docs/admin/setup) on how to obtain the private key.",
2529
},
30+
{
31+
label: "Spec Version",
32+
key: "specVersion",
33+
type: "select",
34+
tooltip: "Version of the spec file.",
35+
placeholder: "v1.0",
36+
options: specsToOptions(specs)
37+
},
2638
],
2739
} as const;
2840

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ import dataSourceConfig, { DataSourceDataType } from "./dataSourceConfig";
33
import queryConfig, { ActionDataType } from "./queryConfig";
44
import { runFirebasePlugin } from "./run";
55

6+
const specs = {
7+
"v1.0": queryConfig
8+
}
9+
610
const firebasePlugin: DataSourcePlugin<ActionDataType, DataSourceDataType> = {
711
id: "firebase",
812
icon: "firebase.svg",
913
name: "Firebase",
1014
category: "api",
11-
queryConfig,
15+
queryConfig: async (data) => {
16+
return specs[data.specVersion as keyof typeof specs]
17+
},
1218
dataSourceConfig,
1319
run: function (actionData, dataSourceConfig): Promise<any> {
1420
return runFirebasePlugin(actionData, dataSourceConfig);

0 commit comments

Comments
 (0)