@pipedream/pandadoc 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -18
- package/actions/create-document-attachment/create-document-attachment.mjs +2 -2
- package/actions/create-document-from-file/create-document-from-file.mjs +16 -3
- package/actions/create-document-from-template/create-document-from-template.mjs +35 -2
- package/actions/create-folder/create-folder.mjs +2 -2
- package/actions/create-or-update-contact/create-or-update-contact.mjs +2 -2
- package/actions/document-details/document-details.mjs +3 -3
- package/actions/download-document/download-document.mjs +92 -0
- package/actions/download-protected-document/download-protected-document.mjs +52 -0
- package/actions/get-document-status/get-document-status.mjs +6 -3
- package/actions/list-contacts/list-contacts.mjs +2 -2
- package/actions/list-document-attachments/list-document-attachments.mjs +3 -3
- package/actions/list-documents/list-documents.mjs +2 -2
- package/actions/list-folders/list-folders.mjs +2 -2
- package/actions/send-document/send-document.mjs +1 -1
- package/common/constants.mjs +1 -0
- package/package.json +2 -2
- package/pandadoc.app.mjs +74 -7
- package/sources/document-creation-failed/document-creation-failed.mjs +2 -2
- package/sources/document-deleted/document-deleted.mjs +2 -2
- package/sources/document-state-changed/document-state-changed.mjs +2 -2
- package/sources/document-updated/document-updated.mjs +2 -2
- package/sources/recipient-completed/recipient-completed.mjs +2 -2
package/README.md
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
The PandaDoc API
|
|
4
|
-
documents with ease. With the PandaDoc API, you can connect to the PandaDoc
|
|
5
|
-
cloud Platform and create automated document workflows, streamline document
|
|
6
|
-
creation and editing, and more.
|
|
3
|
+
The PandaDoc API opens up a realm of possibilities for automating document workflows, creating a seamless bridge between document management and various business processes. With it, you can programmatically create, send, and track documents, streamline electronic signatures, and manage templates, among others. Integrations through Pipedream can harness these capabilities, enabling you to trigger actions in PandaDoc based on events from other apps, or vice versa.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
# Example Use Cases
|
|
9
6
|
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
- Integrate PandaDoc with third-party applications
|
|
16
|
-
- Personalize documents with dynamic data fields
|
|
17
|
-
- Generate intelligent document insights
|
|
18
|
-
- View, sign, and approve documents online
|
|
19
|
-
- Automatically store documents in cloud-based file storage
|
|
20
|
-
- Automatically send documents directly to customers
|
|
21
|
-
- Customize integration with your organization's branding
|
|
22
|
-
- Create reports and dashboard to monitor document performance
|
|
7
|
+
- **Sales Pipeline Automation**: When a new deal is marked as "won" in a CRM like Salesforce, trigger a PandaDoc workflow to automatically generate a contract from a template, fill it with the deal details, and send it out for e-signature.
|
|
8
|
+
|
|
9
|
+
- **HR Onboarding Processes**: Sync PandaDoc with an HR platform like BambooHR. Once a new employee is added to the HR system, kick off a workflow that auto-populates and sends out onboarding paperwork through PandaDoc.
|
|
10
|
+
|
|
11
|
+
- **Real-time Notifications**: Combine PandaDoc with a messaging platform like Slack. Set up a workflow that sends a message to a designated channel or direct message when a document is completed or a specific action is taken on a document in PandaDoc.
|
|
@@ -7,9 +7,9 @@ import FormData from "form-data";
|
|
|
7
7
|
export default {
|
|
8
8
|
key: "pandadoc-create-document-attachment",
|
|
9
9
|
name: "Create Document Attachment",
|
|
10
|
-
description: "Adds an attachment to a document. [See the
|
|
10
|
+
description: "Adds an attachment to a document. [See the documentation here](https://developers.pandadoc.com/reference/create-document-attachment)",
|
|
11
11
|
type: "action",
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.7",
|
|
13
13
|
props: {
|
|
14
14
|
app,
|
|
15
15
|
documentId: {
|
|
@@ -5,9 +5,9 @@ import createDocumentAttachment from "../create-document-attachment/create-docum
|
|
|
5
5
|
export default {
|
|
6
6
|
key: "pandadoc-create-document-from-file",
|
|
7
7
|
name: "Create Document From File",
|
|
8
|
-
description: "Create a document from a file or public file URL. [See the
|
|
8
|
+
description: "Create a document from a file or public file URL. [See the documentation here](https://developers.pandadoc.com/reference/create-document-from-pdf)",
|
|
9
9
|
type: "action",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.8",
|
|
11
11
|
props: {
|
|
12
12
|
app,
|
|
13
13
|
name: {
|
|
@@ -41,6 +41,13 @@ export default {
|
|
|
41
41
|
"documentFolderId",
|
|
42
42
|
],
|
|
43
43
|
},
|
|
44
|
+
fields: {
|
|
45
|
+
type: "string",
|
|
46
|
+
label: "Fields",
|
|
47
|
+
description: `A \`fields\` object containing fields to add to the document. [See the documentation](https://developers.pandadoc.com/reference/create-document-from-pdf) for more information about fields.
|
|
48
|
+
\nE.g. \`{ "name": { "value": "Jane", "role": "user" }, "like": { "value": true, "role": "user" } }\``,
|
|
49
|
+
optional: true,
|
|
50
|
+
},
|
|
44
51
|
},
|
|
45
52
|
methods: createDocumentAttachment.methods,
|
|
46
53
|
async run({ $ }) {
|
|
@@ -64,6 +71,12 @@ export default {
|
|
|
64
71
|
recipients: parsedRecipients,
|
|
65
72
|
folder_uuid: documentFolderId,
|
|
66
73
|
};
|
|
74
|
+
if (this.fields) {
|
|
75
|
+
json.parse_form_fields = true;
|
|
76
|
+
json.fields = typeof this.fields === "string"
|
|
77
|
+
? JSON.parse(this.fields)
|
|
78
|
+
: this.fields;
|
|
79
|
+
}
|
|
67
80
|
|
|
68
81
|
if (fileUrl) {
|
|
69
82
|
data = json;
|
|
@@ -83,7 +96,7 @@ export default {
|
|
|
83
96
|
},
|
|
84
97
|
});
|
|
85
98
|
|
|
86
|
-
$.export("$summary", `Successfully created document
|
|
99
|
+
$.export("$summary", `Successfully created document with ID: ${response.uuid}`);
|
|
87
100
|
return response;
|
|
88
101
|
},
|
|
89
102
|
};
|
|
@@ -3,9 +3,9 @@ import app from "../../pandadoc.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-create-document-from-template",
|
|
5
5
|
name: "Create Document From Template",
|
|
6
|
-
description: "Create Document from PandaDoc Template. [See the
|
|
6
|
+
description: "Create a Document from a PandaDoc Template. [See the documentation here](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
name: {
|
|
@@ -19,6 +19,8 @@ export default {
|
|
|
19
19
|
app,
|
|
20
20
|
"templateId",
|
|
21
21
|
],
|
|
22
|
+
reloadProps: true,
|
|
23
|
+
description: "The ID of a template you want to use. Note: if you want to **prefill fields in your template**, you need to map your template fields to the API fields following [the instruction here](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template#prefilled-fields)",
|
|
22
24
|
},
|
|
23
25
|
documentFolderId: {
|
|
24
26
|
propDefinition: [
|
|
@@ -48,6 +50,23 @@ export default {
|
|
|
48
50
|
optional: true,
|
|
49
51
|
},
|
|
50
52
|
},
|
|
53
|
+
async additionalProps() {
|
|
54
|
+
const props = {};
|
|
55
|
+
const { fields } = await this.app.getTemplate({
|
|
56
|
+
templateId: this.templateId,
|
|
57
|
+
});
|
|
58
|
+
for (const field of fields) {
|
|
59
|
+
if (!field.merge_field) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
props[field.merge_field] = {
|
|
63
|
+
type: "string",
|
|
64
|
+
label: `Field ${field.merge_field}`,
|
|
65
|
+
optional: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return props;
|
|
69
|
+
},
|
|
51
70
|
methods: {
|
|
52
71
|
parseToAnyArray(arr) {
|
|
53
72
|
if (!arr) {
|
|
@@ -71,6 +90,19 @@ export default {
|
|
|
71
90
|
tokens,
|
|
72
91
|
} = this;
|
|
73
92
|
|
|
93
|
+
const fields = {};
|
|
94
|
+
const { fields: items } = await this.app.getTemplate({
|
|
95
|
+
templateId: this.templateId,
|
|
96
|
+
});
|
|
97
|
+
for (const field of items) {
|
|
98
|
+
if (!field.merge_field) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
fields[field.merge_field] = {
|
|
102
|
+
value: this[field.merge_field],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
74
106
|
const response = await this.app.createDocument({
|
|
75
107
|
$,
|
|
76
108
|
data: {
|
|
@@ -80,6 +112,7 @@ export default {
|
|
|
80
112
|
tags,
|
|
81
113
|
recipients: this.parseToAnyArray(recipients),
|
|
82
114
|
tokens: this.parseToAnyArray(tokens),
|
|
115
|
+
fields,
|
|
83
116
|
},
|
|
84
117
|
});
|
|
85
118
|
|
|
@@ -3,9 +3,9 @@ import app from "../../pandadoc.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-create-folder",
|
|
5
5
|
name: "Create Folder",
|
|
6
|
-
description: "Create a new folder to store your documents. [See the
|
|
6
|
+
description: "Create a new folder to store your documents. [See the documentation here](https://developers.pandadoc.com/reference/create-documents-folder)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
name: {
|
|
@@ -3,9 +3,9 @@ import app from "../../pandadoc.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-create-or-update-contact",
|
|
5
5
|
name: "Create or Update Contact",
|
|
6
|
-
description: "This method adds or updates a contact using the email as index. [See the
|
|
6
|
+
description: "This method adds or updates a contact using the email as index. [See the documentation here](https://developers.pandadoc.com/reference/create-contact)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
email: {
|
|
@@ -2,10 +2,10 @@ import app from "../../pandadoc.app.mjs";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-document-details",
|
|
5
|
-
name: "Document Details",
|
|
6
|
-
description: "Return detailed data about a document. [See the
|
|
5
|
+
name: "Get Document Details",
|
|
6
|
+
description: "Return detailed data about a document. [See the documentation here](https://developers.pandadoc.com/reference/document-details)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
id: {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import app from "../../pandadoc.app.mjs";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "pandadoc-download-document",
|
|
6
|
+
name: "Download Document",
|
|
7
|
+
description:
|
|
8
|
+
"Download a document as PDF. [See documentation here](https://developers.pandadoc.com/reference/download-document)",
|
|
9
|
+
type: "action",
|
|
10
|
+
version: "0.0.1",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
id: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"documentId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
outputFilename: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"outputFilename",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
showWatermark: {
|
|
26
|
+
type: "boolean",
|
|
27
|
+
label: "Apply Watermark",
|
|
28
|
+
description: "Set to true to show available watermark props",
|
|
29
|
+
reloadProps: true,
|
|
30
|
+
},
|
|
31
|
+
separateFiles: {
|
|
32
|
+
propDefinition: [
|
|
33
|
+
app,
|
|
34
|
+
"separateFiles",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
additionalProps() {
|
|
39
|
+
return this.showWatermark
|
|
40
|
+
? {
|
|
41
|
+
watermarkText: {
|
|
42
|
+
type: "string",
|
|
43
|
+
label: "Watermark Text",
|
|
44
|
+
description: "Specify watermark text",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
watermarkColor: {
|
|
48
|
+
type: "string",
|
|
49
|
+
label: "Watermark Color",
|
|
50
|
+
description: "Should be a HEX code `#RRGGBB`",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
53
|
+
watermarkFontSize: {
|
|
54
|
+
type: "integer",
|
|
55
|
+
label: "Watermark Font Size",
|
|
56
|
+
description: "Font size of the watermark - positive integer",
|
|
57
|
+
optional: true,
|
|
58
|
+
},
|
|
59
|
+
watermarkOpacity: {
|
|
60
|
+
type: "string",
|
|
61
|
+
label: "Watermark Opacity",
|
|
62
|
+
description: "Should be in range 0.0 - 1.0",
|
|
63
|
+
optional: true,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
: {};
|
|
67
|
+
},
|
|
68
|
+
async run({ $ }) {
|
|
69
|
+
const {
|
|
70
|
+
outputFilename, id,
|
|
71
|
+
} = this;
|
|
72
|
+
const data = await this.app.downloadDocument({
|
|
73
|
+
$,
|
|
74
|
+
id,
|
|
75
|
+
params: {
|
|
76
|
+
separate_files: this.separateFiles,
|
|
77
|
+
watermark_text: this.watermarkText,
|
|
78
|
+
watermark_color: this.watermarkColor,
|
|
79
|
+
watermark_font_size: this.watermarkFontSize,
|
|
80
|
+
watermark_opacity: this.watermarkOpacity,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const filePath = `/tmp/${outputFilename}`;
|
|
85
|
+
fs.writeFileSync(filePath, data);
|
|
86
|
+
$.export("$summary", `Successfully downloaded document "${outputFilename}"`);
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
filePath,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import app from "../../pandadoc.app.mjs";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "pandadoc-download-protected-document",
|
|
6
|
+
name: "Download Protected Document",
|
|
7
|
+
description:
|
|
8
|
+
"Download a completed document as a verifiable PDF. [See documentation here](https://developers.pandadoc.com/reference/download-protected-document)",
|
|
9
|
+
type: "action",
|
|
10
|
+
version: "0.0.1",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
id: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"completedDocumentId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
outputFilename: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"outputFilename",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
separateFiles: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
app,
|
|
28
|
+
"separateFiles",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
async run({ $ }) {
|
|
33
|
+
const {
|
|
34
|
+
outputFilename, id,
|
|
35
|
+
} = this;
|
|
36
|
+
const data = await this.app.downloadProtectedDocument({
|
|
37
|
+
$,
|
|
38
|
+
id,
|
|
39
|
+
params: {
|
|
40
|
+
separate_files: this.separateFiles,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const filePath = `/tmp/${outputFilename}`;
|
|
45
|
+
fs.writeFileSync(filePath, data);
|
|
46
|
+
$.export("$summary", `Successfully downloaded protected document "${outputFilename}"`);
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
filePath,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -6,16 +6,19 @@ export default {
|
|
|
6
6
|
description:
|
|
7
7
|
"Get basic status info about a document. [See documentation here](https://developers.pandadoc.com/reference/document-status)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
props: {
|
|
11
11
|
app,
|
|
12
12
|
id: {
|
|
13
|
-
propDefinition: [
|
|
13
|
+
propDefinition: [
|
|
14
|
+
app,
|
|
15
|
+
"documentId",
|
|
16
|
+
],
|
|
14
17
|
},
|
|
15
18
|
},
|
|
16
19
|
async run({ $ }) {
|
|
17
20
|
const response = await this.app.getDocument({
|
|
18
|
-
id: this.id
|
|
21
|
+
id: this.id,
|
|
19
22
|
});
|
|
20
23
|
|
|
21
24
|
$.export("$summary", `Successfully fetched document status with ID ${this.id}`);
|
|
@@ -3,9 +3,9 @@ import app from "../../pandadoc.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-list-contacts",
|
|
5
5
|
name: "List Contacts",
|
|
6
|
-
description: "
|
|
6
|
+
description: "List all contacts within an account. [See the documentation here](https://developers.pandadoc.com/reference/list-contacts)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
},
|
|
@@ -2,10 +2,10 @@ import app from "../../pandadoc.app.mjs";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-list-document-attachments",
|
|
5
|
-
name: "List Document
|
|
6
|
-
description: "Returns a list of attachments associated with a specified document. [See the
|
|
5
|
+
name: "List Document Attachments",
|
|
6
|
+
description: "Returns a list of attachments associated with a specified document. [See the documentation here](https://developers.pandadoc.com/reference/list-attachment)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
documentId: {
|
|
@@ -4,9 +4,9 @@ import constants from "../common/constants.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "pandadoc-list-documents",
|
|
6
6
|
name: "List Documents",
|
|
7
|
-
description: "List documents optionally
|
|
7
|
+
description: "List documents, optionally filtering by a search query or tags. [See the documentation here](https://developers.pandadoc.com/reference/list-documents)",
|
|
8
8
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.7",
|
|
10
10
|
props: {
|
|
11
11
|
app,
|
|
12
12
|
query: {
|
|
@@ -3,9 +3,9 @@ import app from "../../pandadoc.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "pandadoc-list-folders",
|
|
5
5
|
name: "List Folders",
|
|
6
|
-
description: "List folders which contain Documents [See the
|
|
6
|
+
description: "List folders which contain Documents. [See the documentation here](https://developers.pandadoc.com/reference/list-documents-folders)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
parentFolderId: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Send Document",
|
|
6
6
|
description: "Move a document to sent status and send an optional email. [See the documentation](https://developers.pandadoc.com/reference/send-document)",
|
|
7
7
|
type: "action",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
props: {
|
|
10
10
|
app,
|
|
11
11
|
documentId: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DOCUMENT_STATUS_COMPLETED = 2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/pandadoc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Pipedream PandaDoc Components",
|
|
5
5
|
"main": "pandadoc.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pipedream/platform": "^1.
|
|
17
|
+
"@pipedream/platform": "^1.6.0",
|
|
18
18
|
"form-data": "^4.0.0"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/pandadoc.app.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { axios } from "@pipedream/platform";
|
|
2
|
+
import { DOCUMENT_STATUS_COMPLETED } from "./common/constants.mjs";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
type: "app",
|
|
@@ -8,10 +9,32 @@ export default {
|
|
|
8
9
|
type: "string",
|
|
9
10
|
label: "Document Id",
|
|
10
11
|
description: "Specify document's ID",
|
|
11
|
-
async options() {
|
|
12
|
+
async options({ page }) {
|
|
12
13
|
const response = await this.listDocuments({
|
|
13
14
|
params: {
|
|
14
15
|
deleted: false,
|
|
16
|
+
page: page || undefined,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
return response?.results?.map(({
|
|
20
|
+
id,
|
|
21
|
+
name,
|
|
22
|
+
}) => ({
|
|
23
|
+
label: name,
|
|
24
|
+
value: id,
|
|
25
|
+
})) || [];
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
completedDocumentId: {
|
|
29
|
+
type: "string",
|
|
30
|
+
label: "Completed Document Id",
|
|
31
|
+
description: "Select a completed document or provide its ID",
|
|
32
|
+
async options({ page }) {
|
|
33
|
+
const response = await this.listDocuments({
|
|
34
|
+
params: {
|
|
35
|
+
deleted: false,
|
|
36
|
+
status: DOCUMENT_STATUS_COMPLETED,
|
|
37
|
+
page: page || undefined,
|
|
15
38
|
},
|
|
16
39
|
});
|
|
17
40
|
return response?.results?.map(({
|
|
@@ -27,10 +50,11 @@ export default {
|
|
|
27
50
|
type: "string",
|
|
28
51
|
label: "Template Id",
|
|
29
52
|
description: "Specify template's ID",
|
|
30
|
-
async options() {
|
|
53
|
+
async options({ page }) {
|
|
31
54
|
const response = await this.listTemplates({
|
|
32
55
|
params: {
|
|
33
56
|
deleted: false,
|
|
57
|
+
page: page || undefined,
|
|
34
58
|
},
|
|
35
59
|
});
|
|
36
60
|
return response?.results?.map(({
|
|
@@ -47,8 +71,12 @@ export default {
|
|
|
47
71
|
label: "Document Folder Id",
|
|
48
72
|
description: "Specify the document folder ID",
|
|
49
73
|
optional: true,
|
|
50
|
-
async options() {
|
|
51
|
-
const response = await this.listDocumentFolders(
|
|
74
|
+
async options({ page }) {
|
|
75
|
+
const response = await this.listDocumentFolders({
|
|
76
|
+
params: {
|
|
77
|
+
page: page || undefined,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
52
80
|
return response?.results?.map(({
|
|
53
81
|
uuid,
|
|
54
82
|
name,
|
|
@@ -61,7 +89,7 @@ export default {
|
|
|
61
89
|
file: {
|
|
62
90
|
type: "string",
|
|
63
91
|
label: "File",
|
|
64
|
-
description: "The file to upload from the `/tmp` folder. [See the docs here]
|
|
92
|
+
description: "The file to upload from the `/tmp` folder. [See the docs here](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp) on how to upload a file to `/tmp`.",
|
|
65
93
|
},
|
|
66
94
|
name: {
|
|
67
95
|
type: "string",
|
|
@@ -76,7 +104,18 @@ export default {
|
|
|
76
104
|
If not passed, a person will receive a read-only link to view the document.
|
|
77
105
|
If the first_name and last_name not passed the system: 1. creates a new contact,
|
|
78
106
|
if none exists with the given email; or 2. gets the existing contact with the given email that already exists.
|
|
79
|
-
\n\nE.g. \`{ "email": "john.doe@pipedream.com", "first_name": "John", "last_name": "Doe" }\``,
|
|
107
|
+
\n\nE.g. \`{ "email": "john.doe@pipedream.com", "first_name": "John", "last_name": "Doe", "role": "user" }\``,
|
|
108
|
+
},
|
|
109
|
+
separateFiles: {
|
|
110
|
+
type: "boolean",
|
|
111
|
+
label: "Separate Files",
|
|
112
|
+
description: "Download document bundle as a zip-archive of separate PDFs (1 file per section)",
|
|
113
|
+
optional: true,
|
|
114
|
+
},
|
|
115
|
+
outputFilename: {
|
|
116
|
+
type: "string",
|
|
117
|
+
label: "Output Filename",
|
|
118
|
+
description: "The filename of the downloaded file in the `tmp` folder.",
|
|
80
119
|
},
|
|
81
120
|
},
|
|
82
121
|
methods: {
|
|
@@ -104,6 +143,14 @@ export default {
|
|
|
104
143
|
};
|
|
105
144
|
return axios($, config);
|
|
106
145
|
},
|
|
146
|
+
getTemplate({
|
|
147
|
+
templateId, ...args
|
|
148
|
+
}) {
|
|
149
|
+
return this.makeRequest({
|
|
150
|
+
path: `/templates/${templateId}/details`,
|
|
151
|
+
...args,
|
|
152
|
+
});
|
|
153
|
+
},
|
|
107
154
|
listTemplates(args = {}) {
|
|
108
155
|
return this.makeRequest({
|
|
109
156
|
path: "/templates",
|
|
@@ -188,11 +235,31 @@ export default {
|
|
|
188
235
|
...args,
|
|
189
236
|
});
|
|
190
237
|
},
|
|
191
|
-
getDocument({
|
|
238
|
+
getDocument({
|
|
239
|
+
id, ...args
|
|
240
|
+
}) {
|
|
192
241
|
return this.makeRequest({
|
|
193
242
|
path: `/documents/${id}`,
|
|
194
243
|
...args,
|
|
195
244
|
});
|
|
196
245
|
},
|
|
246
|
+
downloadDocument({
|
|
247
|
+
id, ...args
|
|
248
|
+
}) {
|
|
249
|
+
return this.makeRequest({
|
|
250
|
+
path: `/documents/${id}/download`,
|
|
251
|
+
responseType: "arraybuffer",
|
|
252
|
+
...args,
|
|
253
|
+
});
|
|
254
|
+
},
|
|
255
|
+
downloadProtectedDocument({
|
|
256
|
+
id, ...args
|
|
257
|
+
}) {
|
|
258
|
+
return this.makeRequest({
|
|
259
|
+
path: `/documents/${id}/download-protected`,
|
|
260
|
+
responseType: "arraybuffer",
|
|
261
|
+
...args,
|
|
262
|
+
});
|
|
263
|
+
},
|
|
197
264
|
},
|
|
198
265
|
};
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
name: "Document Creation Failed (Instant)",
|
|
8
8
|
description:
|
|
9
|
-
`Emit new event when a document failed to be created [See
|
|
9
|
+
`Emit new event when a document failed to be created. [See the documentation here](${DOCS_LINK})`,
|
|
10
10
|
key: "pandadoc-document-creation-failed",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "source",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
name: "Document Deleted (Instant)",
|
|
8
8
|
description:
|
|
9
|
-
`Emit new event when a document is deleted [See
|
|
9
|
+
`Emit new event when a document is deleted. [See the documentation here](${DOCS_LINK})`,
|
|
10
10
|
key: "pandadoc-document-deleted",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "source",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
name: "Document State Changed (Instant)",
|
|
8
8
|
description:
|
|
9
|
-
`Emit new event when a document's state is changed [See
|
|
9
|
+
`Emit new event when a document's state is changed. [See the documentation here](${DOCS_LINK})`,
|
|
10
10
|
key: "pandadoc-document-state-changed",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "source",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
name: "Document Updated (Instant)",
|
|
8
8
|
description:
|
|
9
|
-
`Emit new event when a document is updated [See
|
|
9
|
+
`Emit new event when a document is updated. [See the documentation here](${DOCS_LINK})`,
|
|
10
10
|
key: "pandadoc-document-updated",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "source",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
...common,
|
|
7
7
|
name: "Recipient Completed (Instant)",
|
|
8
8
|
description:
|
|
9
|
-
`Emit new event when a recipient completes a document [See
|
|
9
|
+
`Emit new event when a recipient completes a document. [See the documentation here](${DOCS_LINK})`,
|
|
10
10
|
key: "pandadoc-recipient-completed",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "source",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|