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
2 changes: 1 addition & 1 deletion components/quickbooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/quickbooks",
"version": "0.3.0",
"version": "0.4.0",
"description": "Pipedream Quickbooks Components",
"main": "quickbooks.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "quickbooks-new-employee-created",
name: "New Employee Created",
description: "Emit new event when a new employee is created.",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getQuery(lastDate) {
return `select * from Employee Where Metadata.CreateTime >= '${lastDate}' orderby Metadata.CreateTime desc`;
},
getFieldList() {
return "Employee";
},
getFieldDate() {
return "CreateTime";
},
getSummary(item) {
return `New Employee: ${item.Id}`;
},
},
sampleEmit,
};
16 changes: 16 additions & 0 deletions components/quickbooks/sources/new-employee-created/test-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
"BillableTime": false,
"domain": "QBO",
"sparse": false,
"Id": "55",
"SyncToken": "0",
"MetaData": {
"CreateTime": "2021-08-30T11:21:48-07:00",
"LastUpdatedTime": "2021-08-30T11:21:48-07:00"
},
"GivenName": "Emily",
"FamilyName": "Platt",
"DisplayName": "Emily Platt",
"PrintOnCheckName": "Emily Platt",
"Active": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "quickbooks-new-employee-updated",
name: "New Employee Updated",
description: "Emit new event when an employee is updated.",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getQuery(lastDate) {
return `select * from Employee Where Metadata.LastUpdatedTime >= '${lastDate}' orderby Metadata.LastUpdatedTime desc`;
},
getFieldList() {
return "Employee";
},
getFieldDate() {
return "LastUpdatedTime";
},
getSummary(item) {
return `Employee Updated: ${item.Id}`;
},
},
sampleEmit,
};
16 changes: 16 additions & 0 deletions components/quickbooks/sources/new-employee-updated/test-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
"BillableTime": false,
"domain": "QBO",
"sparse": false,
"Id": "55",
"SyncToken": "0",
"MetaData": {
"CreateTime": "2021-08-30T11:21:48-07:00",
"LastUpdatedTime": "2021-08-30T11:21:48-07:00"
},
"GivenName": "Emily",
"FamilyName": "Platt",
"DisplayName": "Emily Platt",
"PrintOnCheckName": "Emily Platt",
"Active": true
}
40 changes: 40 additions & 0 deletions components/quickbooks_sandbox/common/utils.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export function adjustPropDefinitions(props, app) {
return Object.fromEntries(
Object.entries(props).map(([
key,
prop,
]) => {
if (typeof prop === "string") return [
key,
prop,
];
const {
propDefinition, ...otherValues
} = prop;
if (propDefinition) {
const [
, ...otherDefs
] = propDefinition;
return [
key,
{
propDefinition: [
app,
...otherDefs,
],
...otherValues,
},
];
}
return [
key,
otherValues.type === "app"
? null
: otherValues,
];
})
.filter(([
, value,
]) => value),
);
}
15 changes: 15 additions & 0 deletions components/quickbooks_sandbox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@pipedream/quickbooks_sandbox",
"version": "0.0.1",
"description": "Pipedream Quickbooks Sandbox Components",
"main": "quickbooks_sandbox.app.mjs",
"keywords": [
"pipedream",
"quickbooks_sandbox"
],
"homepage": "https://pipedream.com/apps/quickbooks_sandbox",
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
}
}
9 changes: 5 additions & 4 deletions components/quickbooks_sandbox/quickbooks_sandbox.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import common from "../quickbooks/quickbooks.app.mjs";

export default {
type: "app",
app: "quickbooks_sandbox",
propDefinitions: {},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
...common.methods,
_apiUrl() {
return "https://sandbox-quickbooks.api.intuit.com/v3";
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import app from "../../quickbooks_sandbox.app.mjs";
import common from "../../../quickbooks/sources/new-employee-created/new-employee-created.mjs";

import { adjustPropDefinitions } from "../../common/utils.mjs";

const {
name, description, type, ...others
} = common;
const props = adjustPropDefinitions(others.props, app);

export default {
...others,
key: "quickbooks_sandbox-new-employee-created",
version: "0.0.1",
name,
description,
type,
props: {
quickbooks: app,
...props,
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import app from "../../quickbooks_sandbox.app.mjs";
import common from "../../../quickbooks/sources/new-employee-updated/new-employee-updated.mjs";

import { adjustPropDefinitions } from "../../common/utils.mjs";

const {
name, description, type, ...others
} = common;
const props = adjustPropDefinitions(others.props, app);

export default {
...others,
key: "quickbooks_sandbox-new-employee-updated",
version: "0.0.1",
name,
description,
type,
props: {
quickbooks: app,
...props,
},
};
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading