@pipedream/pandadoc 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,41 @@
1
+ Pipedream Source Available License Version 1.0
2
+
3
+ This Pipedream Source Available License Agreement Version 1.0 (this “Agreement”) sets forth the terms on which Pipedream, Inc., a Delaware corporation (“Pipedream”) makes available certain software (the “Software”). By installing, downloading, accessing, using or distributing the Software, you agree to the terms of this Agreement. If you do not agree to such terms, you must not use the Software. If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this Agreement on behalf of such entity. “Licensee” means you, an individual, or the entity on whose behalf you are receiving the Software.
4
+
5
+ LICENSE GRANT AND CONDITIONS.
6
+
7
+ 1.1 License. Subject to the terms and conditions of this Agreement, Pipedream hereby grants to Licensee a non-exclusive, royalty-free, worldwide, non-transferable, non-sublicenseable license during the term of this Agreement to use, prepare modifications and derivative works, distribute (including without limitation in source code or object code form) and reproduce copies of the Software (the “License”). Licensee is not granted the right to, and Licensee shall not, exercise the License for an Excluded Purpose. For purposes of this Agreement, “Excluded Purpose” means any commercial use of the software including, but not limited to, making available any software-as-a-service, platform-as-a-service, infrastructure-as-a-service or other online service that competes with the Software or any other Pipedream products or services.
8
+
9
+ 1.2 Conditions. In consideration of the License, Licensee’s distribution of the Software is subject to the following conditions:
10
+
11
+ a. Licensee must cause any Software modified by Licensee to carry prominent notices stating that Licensee modified the Software.
12
+
13
+ b. On each Software copy, Licensee shall reproduce and not remove or alter all Pipedream or third party copyright or other proprietary notices contained in the Software, and Licensee must provide this with each copy: “This software is made available by Pipedream, Inc., under the terms of the Pipedream Source Available License, Version 1.0 located at https://github.com/PipedreamHQ/pipedream/blob/master/LICENSE. By installing, downloading, accessing, using or distributing the Software, you agree to the terms of such License Agreement.”
14
+
15
+ 1.3 Modifications. Licensee may add its own copyright notices to modifications made by Licensee and may provide additional or different license terms and conditions for use, reproduction, or distribution of Licensee’s modifications. While redistributing the Software or modifications thereof, Licensee may choose to offer, for a fee or free of charge, support, warranty, indemnity, or other obligations. Licensee, and not Pipedream, will be responsible for any such obligations.
16
+
17
+ 1.4 No Sublicensing. The License does not include the right to sublicense the Software; provided, however, that any recipient to which Licensee provides the Software may exercise the License so long as such recipient agrees to the terms and conditions of this Agreement.
18
+
19
+ TERM AND TERMINATION.
20
+
21
+ This Agreement will continue unless and until earlier terminated as set forth herein. If Licensee breaches any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the License will terminate automatically and permanently.
22
+
23
+ INTELLECTUAL PROPERTY.
24
+
25
+ As between the parties, Pipedream retains all right, title, and interest in the Software, and all intellectual property rights therein. Pipedream hereby reserves all rights not expressly granted to Licensee in this Agreement. Pipedream reserves all rights in its trademarks and service marks, and no licenses thereto are granted by this Agreement.
26
+
27
+ DISCLAIMER.
28
+
29
+ PIPEDREAM HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE.
30
+
31
+ LIMITATION OF LIABILITY.
32
+
33
+ PIPEDREAM WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
34
+
35
+ GENERAL.
36
+
37
+ 6.1 Governing Law. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If Licensee is located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS International Arbitration Rules. The tribunal will consist of one arbitrator. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. All disputes including arbitrations shall take place in Santa Clara County, California. The language to be used in any such proceedings shall be English.
38
+
39
+ 6.2. Assignment. Licensee is not authorized to assign its rights under this Agreement to any third party. Pipedream may freely assign its rights under this Agreement to any third party.
40
+
41
+ 6.3. Other. This Agreement is the entire agreement between the parties regarding the subject matter hereof. No amendment or modification of this Agreement will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Waiver by Pipedream of a breach of any provision of this Agreement or the failure by Pipedream to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Overview
2
+
3
+ The PandaDoc API is a powerful tool that can be used to create and customize
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.
7
+
8
+ Using the PandaDoc API, you can:
9
+
10
+ - Automate and streamline document creation and editing
11
+ - Create custom document workflows
12
+ - Securely store documents and access document data
13
+ - Track document activity and analyze document data
14
+ - Automate document approvals and sign-off
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
@@ -0,0 +1,52 @@
1
+ export default {
2
+ DOCUMENTS_STATUS_OPTS: [
3
+ {
4
+ value: "0",
5
+ label: "document.draft",
6
+ },
7
+ {
8
+ value: "1",
9
+ label: "document.sent",
10
+ },
11
+ {
12
+ value: "2",
13
+ label: "document.completed",
14
+ },
15
+ {
16
+ value: "5",
17
+ label: "document.viewed",
18
+ },
19
+ {
20
+ value: "6",
21
+ label: "document.waiting_approval",
22
+ },
23
+ {
24
+ value: "7",
25
+ label: "document.approved",
26
+ },
27
+ {
28
+ value: "8",
29
+ label: "document.rejected",
30
+ },
31
+ {
32
+ value: "9",
33
+ label: "document.waiting_pay",
34
+ },
35
+ {
36
+ value: "10",
37
+ label: "document.paid",
38
+ },
39
+ {
40
+ value: "11",
41
+ label: "document.voided",
42
+ },
43
+ {
44
+ value: "12",
45
+ label: "document.declined",
46
+ },
47
+ {
48
+ value: "13",
49
+ label: "document.external_review",
50
+ },
51
+ ],
52
+ };
@@ -0,0 +1,84 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+ import { ConfigurationError } from "@pipedream/platform";
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import FormData from "form-data";
6
+
7
+ export default {
8
+ key: "pandadoc-create-document-attachment",
9
+ name: "Create Document Attachment",
10
+ description: "Adds an attachment to a document. [See the docs here](https://developers.pandadoc.com/reference/create-document-attachment)",
11
+ type: "action",
12
+ version: "0.0.1",
13
+ props: {
14
+ app,
15
+ documentId: {
16
+ propDefinition: [
17
+ app,
18
+ "documentId",
19
+ ],
20
+ },
21
+ file: {
22
+ type: "string",
23
+ label: "File",
24
+ description: "The file to upload to Box, please provide a file from `/tmp`. To upload a file to `/tmp` folder, please follow the doc [here](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)",
25
+ },
26
+ fileName: {
27
+ type: "string",
28
+ label: "File Name",
29
+ description: "A name you want to set for a file in the system",
30
+ },
31
+ },
32
+ methods: {
33
+ isValidFile(filePath) {
34
+ const filePathWithTmp = `/tmp/${filePath}`;
35
+ if (fs.existsSync(filePathWithTmp)) {
36
+ return filePathWithTmp;
37
+ } else if (fs.existsSync(filePath)) {
38
+ return filePath;
39
+ }
40
+ return false;
41
+ },
42
+ getFileStream(filePath) {
43
+ return fs.createReadStream(filePath);
44
+ },
45
+ getFileMeta(filePath) {
46
+ const stats = fs.statSync(filePath);
47
+ return {
48
+ name: path.basename(filePath),
49
+ size: stats.size,
50
+ };
51
+ },
52
+ },
53
+ async run({ $ }) {
54
+ const {
55
+ documentId,
56
+ file,
57
+ fileName,
58
+ } = this;
59
+
60
+ const fileValidation = this.isValidFile(file);
61
+ if (!fileValidation) {
62
+ throw new ConfigurationError("`file` must be a valid file path!");
63
+ }
64
+ const fileMeta = this.getFileMeta(fileValidation);
65
+ const fileContent = this.getFileStream(fileValidation);
66
+ const data = new FormData();
67
+ data.append("name", fileName);
68
+ data.append("file", fileContent, {
69
+ knownLength: fileMeta.size,
70
+ });
71
+
72
+ const response = await this.app.createDocumentAttachments({
73
+ $,
74
+ documentId,
75
+ data,
76
+ headers: {
77
+ "Content-Type": `multipart/form-data; boundary=${data._boundary}`,
78
+ },
79
+ });
80
+
81
+ $.export("$summary", `Successfully created document attachment with ID: ${response.uuid}`);
82
+ return response;
83
+ },
84
+ };
@@ -0,0 +1,92 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-create-document-from-template",
5
+ name: "Create Document From Template",
6
+ description: "Create Document from PandaDoc Template. [See the docs here](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ props: {
10
+ app,
11
+ name: {
12
+ type: "string",
13
+ label: "Document Name",
14
+ description: "Specify the document's name.",
15
+ },
16
+ templateId: {
17
+ propDefinition: [
18
+ app,
19
+ "templateId",
20
+ ],
21
+ },
22
+ documentFolderId: {
23
+ propDefinition: [
24
+ app,
25
+ "documentFolderId",
26
+ ],
27
+ },
28
+ tags: {
29
+ type: "string[]",
30
+ label: "Tags",
31
+ description: "Mark your document with one or several tags.",
32
+ optional: true,
33
+ },
34
+ recipients: {
35
+ type: "string[]",
36
+ label: "Recipients",
37
+ description: `The list of recipients you're sending the document to. Every object must contain the email parameter.
38
+ The role, first_name and last_name parameters are optional. If the role parameter passed, a person is assigned all fields matching their corresponding role.
39
+ If not passed, a person will receive a read-only link to view the document.
40
+ If the first_name and last_name not passed the system: 1. creates a new contact,
41
+ if none exists with the given email; or 2. gets the existing contact with the given email that already exists.
42
+ \n\nE.g. \`{ "email": "john.doe@pipedream.com", "first_name": "John", "last_name": "Doe" }\``,
43
+ },
44
+ tokens: {
45
+ type: "string[]",
46
+ label: "Tokens",
47
+ description: `You may pass a list of tokens/values to pre-fill tokens (variables) used in a template.
48
+ Name is a token (variable) name in a template.
49
+ Value is a real value you would like to replace a token (variable) with.
50
+ \n\nE.g. \`{ "name": "Favorite.Pet", "value": "Dog Doe" }\``,
51
+ optional: true,
52
+ },
53
+ },
54
+ methods: {
55
+ parseToAnyArray(arr) {
56
+ if (!arr) {
57
+ return undefined;
58
+ }
59
+ return arr.map((item) => {
60
+ if (typeof (item) === "string") {
61
+ return JSON.parse(item);
62
+ }
63
+ return item;
64
+ });
65
+ },
66
+ },
67
+ async run({ $ }) {
68
+ const {
69
+ name,
70
+ templateId,
71
+ documentFolderId,
72
+ tags,
73
+ recipients,
74
+ tokens,
75
+ } = this;
76
+
77
+ const response = await this.app.createDocumentFromTemplate({
78
+ $,
79
+ data: {
80
+ name,
81
+ template_uuid: templateId,
82
+ folder_uuid: documentFolderId,
83
+ tags,
84
+ recipients: this.parseToAnyArray(recipients),
85
+ tokens: this.parseToAnyArray(tokens),
86
+ },
87
+ });
88
+
89
+ $.export("$summary", `Successfully created document with template ID: ${templateId}`);
90
+ return response;
91
+ },
92
+ };
@@ -0,0 +1,112 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-create-or-update-contact",
5
+ name: "Create or Update Contact",
6
+ description: "This method adds or updates a contact using the email as index. [See the docs here](https://developers.pandadoc.com/reference/create-contact)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ props: {
10
+ app,
11
+ email: {
12
+ type: "string",
13
+ label: "Email",
14
+ description: "Contact's email address.",
15
+ },
16
+ firstName: {
17
+ type: "string",
18
+ label: "First Name",
19
+ description: "Contact's first name.",
20
+ optional: true,
21
+ },
22
+ lastName: {
23
+ type: "string",
24
+ label: "Last Name",
25
+ description: "Contact's last name.",
26
+ optional: true,
27
+ },
28
+ company: {
29
+ type: "string",
30
+ label: "Company",
31
+ description: "Contact's company name.",
32
+ optional: true,
33
+ },
34
+ jobTitle: {
35
+ type: "string",
36
+ label: "Job Title",
37
+ description: "Contact's job title.",
38
+ optional: true,
39
+ },
40
+ phone: {
41
+ type: "string",
42
+ label: "Phone",
43
+ description: "Contact's phone number.",
44
+ optional: true,
45
+ },
46
+ country: {
47
+ type: "string",
48
+ label: "Country",
49
+ description: "Contact's country name.",
50
+ optional: true,
51
+ },
52
+ state: {
53
+ type: "string",
54
+ label: "State",
55
+ description: "Contact's state name.",
56
+ optional: true,
57
+ },
58
+ streetAddress: {
59
+ type: "string",
60
+ label: "Street Address",
61
+ description: "Contact's street address.",
62
+ optional: true,
63
+ },
64
+ city: {
65
+ type: "string",
66
+ label: "City",
67
+ description: "Contact's city name.",
68
+ optional: true,
69
+ },
70
+ postalCode: {
71
+ type: "string",
72
+ label: "Postal Code",
73
+ description: "Contact's postal code.",
74
+ optional: true,
75
+ },
76
+ },
77
+ async run({ $ }) {
78
+ const {
79
+ email,
80
+ firstName,
81
+ lastName,
82
+ company,
83
+ jobTitle,
84
+ phone,
85
+ country,
86
+ state,
87
+ streetAddress,
88
+ city,
89
+ postalCode,
90
+ } = this;
91
+
92
+ const response = await this.app.createOrUpdateContact({
93
+ $,
94
+ data: {
95
+ email,
96
+ first_name: firstName,
97
+ last_name: lastName,
98
+ company,
99
+ job_title: jobTitle,
100
+ phone,
101
+ country,
102
+ state,
103
+ street_address: streetAddress,
104
+ city,
105
+ postal_code: postalCode,
106
+ },
107
+ });
108
+
109
+ $.export("$summary", `Successfully created or updated a contact with email: ${email}`);
110
+ return response;
111
+ },
112
+ };
@@ -0,0 +1,29 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-document-details",
5
+ name: "Document Details",
6
+ description: "Return detailed data about a document. [See the docs here](https://developers.pandadoc.com/reference/document-details)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ props: {
10
+ app,
11
+ id: {
12
+ propDefinition: [
13
+ app,
14
+ "documentId",
15
+ ],
16
+ },
17
+ },
18
+ async run({ $ }) {
19
+ const { id } = this;
20
+
21
+ const response = await this.app.documentDetails({
22
+ $,
23
+ id,
24
+ });
25
+
26
+ $.export("$summary", `Successfully fetched document with ID: ${id}`);
27
+ return response;
28
+ },
29
+ };
@@ -0,0 +1,20 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-list-contacts",
5
+ name: "List Contacts",
6
+ description: "This method lists all contacts within an account. [See the docs here](https://developers.pandadoc.com/reference/list-contacts)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ props: {
10
+ app,
11
+ },
12
+ async run({ $ }) {
13
+ const response = await this.app.listContacts({
14
+ $,
15
+ });
16
+
17
+ $.export("$summary", `Successfully fetched ${response?.results?.length} contact(s).`);
18
+ return response;
19
+ },
20
+ };
@@ -0,0 +1,29 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-list-document-attachments",
5
+ name: "List Document Attachment",
6
+ description: "Returns a list of attachments associated with a specified document. [See the docs here](https://developers.pandadoc.com/reference/list-attachment)",
7
+ type: "action",
8
+ version: "0.0.1",
9
+ props: {
10
+ app,
11
+ documentId: {
12
+ propDefinition: [
13
+ app,
14
+ "documentId",
15
+ ],
16
+ },
17
+ },
18
+ async run({ $ }) {
19
+ const { documentId } = this;
20
+
21
+ const response = await this.app.listDocumentAttachments({
22
+ $,
23
+ documentId,
24
+ });
25
+
26
+ $.export("$summary", `Successfully fetched attachments of the document with ID: ${documentId}`);
27
+ return response;
28
+ },
29
+ };
@@ -0,0 +1,86 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+ import constants from "../common/constants.mjs";
3
+
4
+ export default {
5
+ key: "pandadoc-list-documents",
6
+ name: "List Documents",
7
+ description: "List documents optionally filter by a search query or tags. [See the docs here](https://developers.pandadoc.com/reference/list-documents)",
8
+ type: "action",
9
+ version: "0.0.1",
10
+ props: {
11
+ app,
12
+ query: {
13
+ type: "string",
14
+ label: "Query",
15
+ description: "Search query. Filter by document reference number (this token is stored on template level) or name.",
16
+ optional: true,
17
+ },
18
+ tag: {
19
+ type: "string",
20
+ label: "Tag",
21
+ description: "Search tag. Filter by document tag.",
22
+ optional: true,
23
+ },
24
+ status: {
25
+ type: "string",
26
+ label: "Status",
27
+ description: "Specify the status of documents to return.",
28
+ options: constants.DOCUMENTS_STATUS_OPTS,
29
+ optional: true,
30
+ },
31
+ id: {
32
+ propDefinition: [
33
+ app,
34
+ "documentId",
35
+ ],
36
+ optional: true,
37
+ },
38
+ deleted: {
39
+ type: "boolean",
40
+ label: "Deleted",
41
+ description: "Returns only deleted documents. Default is false.",
42
+ optional: true,
43
+ },
44
+ count: {
45
+ type: "integer",
46
+ label: "Count",
47
+ description: "Specify how many document results to return. Default is 50 documents, maximum is 100 documents.",
48
+ optional: true,
49
+ min: 0,
50
+ },
51
+ page: {
52
+ type: "integer",
53
+ label: "Page",
54
+ description: "Specify which page of the dataset to return.",
55
+ optional: true,
56
+ min: 0,
57
+ },
58
+ },
59
+ async run({ $ }) {
60
+ const {
61
+ query,
62
+ tag,
63
+ status,
64
+ count,
65
+ page,
66
+ deleted,
67
+ id,
68
+ } = this;
69
+
70
+ const response = await this.app.listDocuments({
71
+ $,
72
+ params: {
73
+ q: query,
74
+ tag,
75
+ status,
76
+ count,
77
+ page,
78
+ deleted,
79
+ id,
80
+ },
81
+ });
82
+
83
+ $.export("$summary", `Successfully fetched ${response?.results?.length} documents`);
84
+ return response;
85
+ },
86
+ };
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipedream/pandadoc",
3
+ "version": "0.0.1",
4
+ "description": "Pipedream PandaDoc Components",
5
+ "main": "pandadoc.app.mjs",
6
+ "keywords": [
7
+ "pipedream",
8
+ "pandadoc"
9
+ ],
10
+ "homepage": "https://pipedream.com/apps/pandadoc",
11
+ "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
+ "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "dependencies": {
17
+ "@pipedream/platform": "^1.3.0",
18
+ "form-data": "^4.0.0"
19
+ }
20
+ }
@@ -0,0 +1,145 @@
1
+ import { axios } from "@pipedream/platform";
2
+
3
+ export default {
4
+ type: "app",
5
+ app: "pandadoc",
6
+ propDefinitions: {
7
+ documentId: {
8
+ type: "string",
9
+ label: "Document Id",
10
+ description: "Specify document's ID",
11
+ async options() {
12
+ const response = await this.listDocuments({
13
+ params: {
14
+ deleted: false,
15
+ },
16
+ });
17
+ return response?.results?.map(({
18
+ id,
19
+ name,
20
+ }) => ({
21
+ label: name,
22
+ value: id,
23
+ })) || [];
24
+ },
25
+ },
26
+ templateId: {
27
+ type: "string",
28
+ label: "Template Id",
29
+ description: "Specify template's ID",
30
+ async options() {
31
+ const response = await this.listTemplates({
32
+ params: {
33
+ deleted: false,
34
+ },
35
+ });
36
+ return response?.results?.map(({
37
+ id,
38
+ name,
39
+ }) => ({
40
+ label: name,
41
+ value: id,
42
+ })) || [];
43
+ },
44
+ },
45
+ documentFolderId: {
46
+ type: "string",
47
+ label: "Document Folder Id",
48
+ description: "Specify the document folder ID",
49
+ optional: true,
50
+ async options() {
51
+ const response = await this.listDocumentFolders();
52
+ return response?.results?.map(({
53
+ uuid,
54
+ name,
55
+ }) => ({
56
+ label: name,
57
+ value: uuid,
58
+ })) || [];
59
+ },
60
+ },
61
+ },
62
+ methods: {
63
+ getUrl(path) {
64
+ return `https://api.pandadoc.com/public/v1${path}`;
65
+ },
66
+ getHeaders(headers = {}) {
67
+ return {
68
+ authorization: `Bearer ${this.$auth.oauth_access_token}`,
69
+ ...headers,
70
+ };
71
+ },
72
+ makeRequest(customConfig) {
73
+ const {
74
+ $ = this,
75
+ path,
76
+ headers,
77
+ ...otherConfig
78
+ } = customConfig;
79
+
80
+ const config = {
81
+ headers: this.getHeaders(headers),
82
+ url: this.getUrl(path),
83
+ ...otherConfig,
84
+ };
85
+ return axios($, config);
86
+ },
87
+ listTemplates(args = {}) {
88
+ return this.makeRequest({
89
+ path: "/templates",
90
+ ...args,
91
+ });
92
+ },
93
+ listDocuments(args = {}) {
94
+ return this.makeRequest({
95
+ path: "/documents",
96
+ ...args,
97
+ });
98
+ },
99
+ listDocumentFolders(args = {}) {
100
+ return this.makeRequest({
101
+ path: "/documents/folders",
102
+ ...args,
103
+ });
104
+ },
105
+ documentDetails(args = {}) {
106
+ return this.makeRequest({
107
+ path: `/documents/${args.id}/details`,
108
+ ...args,
109
+ });
110
+ },
111
+ listDocumentAttachments(args = {}) {
112
+ return this.makeRequest({
113
+ path: `/documents/${args.documentId}/attachments`,
114
+ ...args,
115
+ });
116
+ },
117
+ createDocumentAttachments(args = {}) {
118
+ return this.makeRequest({
119
+ path: `/documents/${args.documentId}/attachments`,
120
+ method: "POST",
121
+ ...args,
122
+ });
123
+ },
124
+ createDocumentFromTemplate(args = {}) {
125
+ return this.makeRequest({
126
+ path: "/documents",
127
+ method: "POST",
128
+ ...args,
129
+ });
130
+ },
131
+ createOrUpdateContact(args = {}) {
132
+ return this.makeRequest({
133
+ path: "/contacts",
134
+ method: "POST",
135
+ ...args,
136
+ });
137
+ },
138
+ listContacts(args = {}) {
139
+ return this.makeRequest({
140
+ path: "/contacts",
141
+ ...args,
142
+ });
143
+ },
144
+ },
145
+ };