Skip to content

Commit bebac6c

Browse files
committed
new-change-in-envelope-status
1 parent 0f2347b commit bebac6c

File tree

6 files changed

+55
-47
lines changed

6 files changed

+55
-47
lines changed

components/docusign/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "@pipedream/docusign",
3-
"version": "0.1.6",
3+
"version": "0.2.0",
44
"description": "Pipedream Docusign Components",
5-
"main": "docusign.app.js",
5+
"main": "docusign.app.mjs",
66
"keywords": [
77
"pipedream",
88
"docusign"
99
],
1010
"homepage": "https://pipedream.com/apps/docusign",
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12-
"dependencies": {
13-
"@pipedream/platform": "^1.2.0"
14-
},
1512
"publishConfig": {
1613
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}

components/docusign/sources/envelope-sent-or-complete/common.mjs renamed to components/docusign/sources/new-change-in-envelope-status/common.mjs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,28 @@ export default {
1515
status: {
1616
type: "string[]",
1717
label: "Status",
18-
description: "The envelope status that you are checking for",
18+
description: "Watch for envelopes that have been updated to the selected statuses",
1919
options: [
20-
"sent",
20+
"any",
2121
"completed",
22+
"created",
23+
"declined",
24+
"deleted",
25+
"delivered",
26+
"processing",
27+
"sent",
28+
"signed",
29+
"timedout",
30+
"voided",
2231
],
2332
default: [
24-
"sent",
33+
"any",
2534
],
2635
},
2736
},
2837
methods: {
2938
_getLastEvent() {
30-
return this.db.get("lastEvent");
39+
return this.db.get("lastEvent") || this.monthAgo().toISOString();
3140
},
3241
_setLastEvent(lastEvent) {
3342
this.db.set("lastEvent", lastEvent);
@@ -38,18 +47,19 @@ export default {
3847
return monthAgo;
3948
},
4049
generateMeta({
41-
envelopeId: id, emailSubject: summary, status,
42-
}, ts) {
50+
envelopeId, emailSubject, statusChangedDateTime,
51+
}) {
52+
const ts = Date.parse(statusChangedDateTime);
4353
return {
44-
id: `${id}${status}`,
45-
summary,
54+
id: `${envelopeId}-${ts}`,
55+
summary: emailSubject,
4656
ts,
4757
};
4858
},
4959
},
5060
async run(event) {
5161
const { timestamp: ts } = event;
52-
const lastEvent = this._getLastEvent() || this.monthAgo().toISOString();
62+
const lastEvent = this._getLastEvent();
5363
const baseUri = await this.docusign.getBaseUri({
5464
accountId: this.account,
5565
});
@@ -70,7 +80,7 @@ export default {
7080
else done = true;
7181

7282
for (const envelope of envelopes) {
73-
const meta = this.generateMeta(envelope, ts);
83+
const meta = this.generateMeta(envelope);
7484
this.$emit(envelope, meta);
7585
}
7686
} while (!done);

components/docusign/sources/envelope-sent-or-complete/envelope-sent-or-complete.mjs renamed to components/docusign/sources/new-change-in-envelope-status/new-change-in-envelope-status.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import common from "./common.mjs";
33

44
export default {
55
...common,
6-
key: "docusign-envelope-sent-or-complete",
7-
version: "0.0.5",
8-
name: "Envelope Sent or Complete",
9-
description:
10-
"Emit new event when an envelope status is set to sent or complete",
6+
key: "docusign-new-change-in-envelope-status",
7+
version: "0.0.1",
8+
name: "New Change in Envelope Status",
9+
description: "Emit new event when an envelope's status is updated",
1110
type: "source",
1211
props: {
1312
docusign,
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "@pipedream/docusign_developer",
3-
"version": "0.1.3",
3+
"version": "0.2.0",
44
"description": "Pipedream Docusign_developer Components",
5-
"main": "docusign_developer.app.js",
5+
"main": "docusign_developer.app.mjs",
66
"keywords": [
77
"pipedream",
88
"docusign_developer"
99
],
1010
"homepage": "https://pipedream.com/apps/docusign_developer",
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12-
"dependencies": {
13-
"@pipedream/platform": "^1.1.1"
14-
},
1512
"publishConfig": {
1613
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}

components/docusign_developer/sources/envelope-sent-or-complete/envelope-sent-or-complete.mjs

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import docusign from "../../docusign_developer.app.mjs";
2+
import common from "../../../docusign/sources/new-change-in-envelope-status/common.mjs";
3+
4+
export default {
5+
...common,
6+
key: "docusign_developer-new-change-in-envelope-status",
7+
version: "0.0.1",
8+
name: "New Change in Envelope Status",
9+
description: "Emit new event when an envelope's status is updated",
10+
type: "source",
11+
props: {
12+
docusign,
13+
account: {
14+
propDefinition: [
15+
docusign,
16+
"account",
17+
],
18+
},
19+
...common.props,
20+
},
21+
};

0 commit comments

Comments
 (0)