Skip to content

Commit 041877f

Browse files
committed
new triggers
1 parent 3ecb4ed commit 041877f

File tree

10 files changed

+193
-5
lines changed

10 files changed

+193
-5
lines changed

components/quickbooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/quickbooks",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Pipedream Quickbooks Components",
55
"main": "quickbooks.app.mjs",
66
"keywords": [
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "quickbooks-new-employee-created",
7+
name: "New Employee Created",
8+
description: "Emit new event when a new employee is created.",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
...common.methods,
14+
getQuery(lastDate) {
15+
return `select * from Employee Where Metadata.CreateTime >= '${lastDate}' orderby Metadata.CreateTime desc`;
16+
},
17+
getFieldList() {
18+
return "Employee";
19+
},
20+
getFieldDate() {
21+
return "CreateTime";
22+
},
23+
getSummary(item) {
24+
return `New Employee: ${item.Id}`;
25+
},
26+
},
27+
sampleEmit,
28+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
"BillableTime": false,
3+
"domain": "QBO",
4+
"sparse": false,
5+
"Id": "55",
6+
"SyncToken": "0",
7+
"MetaData": {
8+
"CreateTime": "2021-08-30T11:21:48-07:00",
9+
"LastUpdatedTime": "2021-08-30T11:21:48-07:00"
10+
},
11+
"GivenName": "Emily",
12+
"FamilyName": "Platt",
13+
"DisplayName": "Emily Platt",
14+
"PrintOnCheckName": "Emily Platt",
15+
"Active": true
16+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "quickbooks-new-employee-updated",
7+
name: "New Employee Updated",
8+
description: "Emit new event when an employee is updated.",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
...common.methods,
14+
getQuery(lastDate) {
15+
return `select * from Employee Where Metadata.LastUpdatedTime >= '${lastDate}' orderby Metadata.LastUpdatedTime desc`;
16+
},
17+
getFieldList() {
18+
return "Employee";
19+
},
20+
getFieldDate() {
21+
return "LastUpdatedTime";
22+
},
23+
getSummary(item) {
24+
return `Employee Updated: ${item.Id}`;
25+
},
26+
},
27+
sampleEmit,
28+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
"BillableTime": false,
3+
"domain": "QBO",
4+
"sparse": false,
5+
"Id": "55",
6+
"SyncToken": "0",
7+
"MetaData": {
8+
"CreateTime": "2021-08-30T11:21:48-07:00",
9+
"LastUpdatedTime": "2021-08-30T11:21:48-07:00"
10+
},
11+
"GivenName": "Emily",
12+
"FamilyName": "Platt",
13+
"DisplayName": "Emily Platt",
14+
"PrintOnCheckName": "Emily Platt",
15+
"Active": true
16+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
export function adjustPropDefinitions(props, app) {
2+
return Object.fromEntries(
3+
Object.entries(props).map(([
4+
key,
5+
prop,
6+
]) => {
7+
if (typeof prop === "string") return [
8+
key,
9+
prop,
10+
];
11+
const {
12+
propDefinition, ...otherValues
13+
} = prop;
14+
if (propDefinition) {
15+
const [
16+
, ...otherDefs
17+
] = propDefinition;
18+
return [
19+
key,
20+
{
21+
propDefinition: [
22+
app,
23+
...otherDefs,
24+
],
25+
...otherValues,
26+
},
27+
];
28+
}
29+
return [
30+
key,
31+
otherValues.type === "app"
32+
? null
33+
: otherValues,
34+
];
35+
})
36+
.filter(([
37+
, value,
38+
]) => value),
39+
);
40+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/quickbooks_sandbox",
3+
"version": "0.0.1",
4+
"description": "Pipedream Quickbooks Sandbox Components",
5+
"main": "quickbooks_sandbox.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"quickbooks_sandbox"
9+
],
10+
"homepage": "https://pipedream.com/apps/quickbooks_sandbox",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
},
15+
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import common from "../quickbooks/quickbooks.app.mjs";
2+
13
export default {
24
type: "app",
35
app: "quickbooks_sandbox",
4-
propDefinitions: {},
56
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
7+
...common.methods,
8+
_apiUrl() {
9+
return "https://sandbox-quickbooks.api.intuit.com/v3";
910
},
1011
},
1112
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import app from "../../quickbooks_sandbox.app.mjs";
2+
import common from "../../../quickbooks/sources/new-employee-created/new-employee-created.mjs";
3+
4+
import { adjustPropDefinitions } from "../../common/utils.mjs";
5+
6+
const {
7+
name, description, type, ...others
8+
} = common;
9+
const props = adjustPropDefinitions(others.props, app);
10+
11+
export default {
12+
...others,
13+
key: "quickbooks_sandbox-new-employee-created",
14+
version: "0.0.1",
15+
name,
16+
description,
17+
type,
18+
props: {
19+
quickbooks: app,
20+
...props,
21+
},
22+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import app from "../../quickbooks_sandbox.app.mjs";
2+
import common from "../../../quickbooks/sources/new-employee-updated/new-employee-updated.mjs";
3+
4+
import { adjustPropDefinitions } from "../../common/utils.mjs";
5+
6+
const {
7+
name, description, type, ...others
8+
} = common;
9+
const props = adjustPropDefinitions(others.props, app);
10+
11+
export default {
12+
...others,
13+
key: "quickbooks_sandbox-new-employee-updated",
14+
version: "0.0.1",
15+
name,
16+
description,
17+
type,
18+
props: {
19+
quickbooks: app,
20+
...props,
21+
},
22+
};

0 commit comments

Comments
 (0)