Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/firebase_admin_sdk/actions/common/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ export default {
],
},
},
methods: {
parseBooleanValues(data) {
Object.entries(data).forEach(([
key,
value,
]) => {
data[key] = value === "false"
? false
: value === "true"
? true
: value;
});
return data;
},
},
async run({ $ }) {
try {
await this.firebase.initializeApp(this.databaseRegion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default {
...common,
key: "firebase_admin_sdk-create-document",
name: "Create Document",
description: "Creates a New Document. [See the docs here](https://googleapis.dev/nodejs/firestore/latest/CollectionReference.html#add)",
version: "0.0.7",
description: "Creates a New Document. [See the documentation](https://googleapis.dev/nodejs/firestore/latest/CollectionReference.html#add)",
version: "0.0.8",
type: "action",
props: {
...common.props,
Expand Down Expand Up @@ -34,7 +34,8 @@ export default {
methods: {
...common.methods,
async getResponse() {
return this.firebase.createDocument(this.collection, this.data, this.customId);
const data = this.parseBooleanValues(this.data);
return this.firebase.createDocument(this.collection, data, this.customId);
},
emitSummary($, response) {
$.export("$summary", `Successfully added document ${response?._path?.segments[1] ?? ""}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "firebase_admin_sdk-create-realtime-db-record",
name: "Create Firebase Realtime Database Record",
description: "Creates or replaces a child object within your Firebase Realtime Database. [See the docs here](https://firebase.google.com/docs/reference/js/database#update)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "firebase_admin_sdk-list-documents",
name: "List Documents",
description: "Lists documents in a collection. [See the docs here](https://googleapis.dev/nodejs/firestore/latest/CollectionReference.html#listDocuments)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import common from "../common/base.mjs";
export default {
...common,
key: "firebase_admin_sdk-update-document",
name: "Update Documents",
description: "Updates a Document. [See the docs here](https://googleapis.dev/nodejs/firestore/latest/DocumentReference.html#update)",
version: "0.0.4",
name: "Update Document",
description: "Updates a Document. [See the documentation](https://googleapis.dev/nodejs/firestore/latest/DocumentReference.html#update)",
version: "0.0.5",
type: "action",
props: {
...common.props,
Expand Down Expand Up @@ -39,7 +39,8 @@ export default {
methods: {
...common.methods,
async getResponse() {
return this.firebase.updateDocument(this.collection, this.document, this.data);
const data = this.parseBooleanValues(this.data);
return this.firebase.updateDocument(this.collection, this.document, data);
},
emitSummary($) {
$.export("$summary", `Successfully updated document ${this.document}`);
Expand Down
2 changes: 1 addition & 1 deletion components/firebase_admin_sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/firebase_admin_sdk",
"version": "0.0.7",
"version": "0.0.8",
"description": "Pipedream Firebase Admin SDK Components",
"main": "firebase_admin_sdk.app.mjs",
"keywords": [
Expand Down