allow users to select firestore databases other than the default
This commit is contained in:
parent
59a98ec0cb
commit
2d7ef6cee4
|
@ -12,6 +12,7 @@ interface FirebaseConfig {
|
|||
email: string
|
||||
privateKey: string
|
||||
projectId: string
|
||||
databaseId?: string
|
||||
}
|
||||
|
||||
const SCHEMA: Integration = {
|
||||
|
@ -30,12 +31,21 @@ const SCHEMA: Integration = {
|
|||
},
|
||||
privateKey: {
|
||||
type: DatasourceFieldType.STRING,
|
||||
display: "Private Key",
|
||||
required: true,
|
||||
},
|
||||
projectId: {
|
||||
type: DatasourceFieldType.STRING,
|
||||
display: "Project ID",
|
||||
required: true,
|
||||
},
|
||||
databaseId: {
|
||||
type: DatasourceFieldType.STRING,
|
||||
display: "Database ID",
|
||||
required: false,
|
||||
default: "(default)",
|
||||
placeholder: "(default)",
|
||||
},
|
||||
},
|
||||
query: {
|
||||
create: {
|
||||
|
@ -97,6 +107,7 @@ class FirebaseIntegration implements IntegrationBase {
|
|||
this.config = config
|
||||
this.client = new Firestore({
|
||||
projectId: config.projectId,
|
||||
databaseId: config.databaseId || "(default)",
|
||||
credentials: {
|
||||
client_email: config.email,
|
||||
private_key: config.privateKey?.replace(/\\n/g, "\n"),
|
||||
|
|
Loading…
Reference in New Issue