@pipedream/pandadoc 0.2.1 → 0.2.3

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.
@@ -9,7 +9,7 @@ export default {
9
9
  name: "Create Document Attachment",
10
10
  description: "Adds an attachment to a document. [See the docs here](https://developers.pandadoc.com/reference/create-document-attachment)",
11
11
  type: "action",
12
- version: "0.0.4",
12
+ version: "0.0.5",
13
13
  props: {
14
14
  app,
15
15
  documentId: {
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Create Document From File",
8
8
  description: "Create a document from a file or public file URL. [See the docs here](https://developers.pandadoc.com/reference/create-document-from-pdf)",
9
9
  type: "action",
10
- version: "0.0.5",
10
+ version: "0.0.6",
11
11
  props: {
12
12
  app,
13
13
  name: {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create Document From Template",
6
6
  description: "Create Document from PandaDoc Template. [See the docs here](https://developers.pandadoc.com/reference/create-document-from-pandadoc-template)",
7
7
  type: "action",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  props: {
10
10
  app,
11
11
  name: {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create Folder",
6
6
  description: "Create a new folder to store your documents. [See the docs here](https://developers.pandadoc.com/reference/create-documents-folder)",
7
7
  type: "action",
8
- version: "0.0.3",
8
+ version: "0.0.4",
9
9
  props: {
10
10
  app,
11
11
  name: {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create or Update Contact",
6
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
7
  type: "action",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  props: {
10
10
  app,
11
11
  email: {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Document Details",
6
6
  description: "Return detailed data about a document. [See the docs here](https://developers.pandadoc.com/reference/document-details)",
7
7
  type: "action",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  props: {
10
10
  app,
11
11
  id: {
@@ -0,0 +1,24 @@
1
+ import app from "../../pandadoc.app.mjs";
2
+
3
+ export default {
4
+ key: "pandadoc-get-document-status",
5
+ name: "Get Document Status",
6
+ description:
7
+ "Get basic status info about a document. [See documentation here](https://developers.pandadoc.com/reference/document-status)",
8
+ type: "action",
9
+ version: "0.0.1",
10
+ props: {
11
+ app,
12
+ id: {
13
+ propDefinition: [app, "documentId"],
14
+ },
15
+ },
16
+ async run({ $ }) {
17
+ const response = await this.app.getDocument({
18
+ id: this.id
19
+ });
20
+
21
+ $.export("$summary", `Successfully fetched document status with ID ${this.id}`);
22
+ return response;
23
+ },
24
+ };
@@ -5,7 +5,7 @@ export default {
5
5
  name: "List Contacts",
6
6
  description: "This method lists all contacts within an account. [See the docs here](https://developers.pandadoc.com/reference/list-contacts)",
7
7
  type: "action",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  props: {
10
10
  app,
11
11
  },
@@ -5,7 +5,7 @@ export default {
5
5
  name: "List Document Attachment",
6
6
  description: "Returns a list of attachments associated with a specified document. [See the docs here](https://developers.pandadoc.com/reference/list-attachment)",
7
7
  type: "action",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  props: {
10
10
  app,
11
11
  documentId: {
@@ -6,7 +6,7 @@ export default {
6
6
  name: "List Documents",
7
7
  description: "List documents optionally filter by a search query or tags. [See the docs here](https://developers.pandadoc.com/reference/list-documents)",
8
8
  type: "action",
9
- version: "0.0.4",
9
+ version: "0.0.5",
10
10
  props: {
11
11
  app,
12
12
  query: {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "List Folders",
6
6
  description: "List folders which contain Documents [See the docs here](https://developers.pandadoc.com/reference/list-documents-folders)",
7
7
  type: "action",
8
- version: "0.0.3",
8
+ version: "0.0.4",
9
9
  props: {
10
10
  app,
11
11
  parentFolderId: {
@@ -5,7 +5,7 @@ export default defineComponent({
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.1",
8
+ version: "0.0.3",
9
9
  props: {
10
10
  app,
11
11
  documentId: {
@@ -61,6 +61,24 @@ export default defineComponent({
61
61
  async run({ $ }) {
62
62
  const documentId = this.documentId;
63
63
 
64
+ let documentStatus = "";
65
+
66
+ while (documentStatus !== "document.draft") {
67
+ try {
68
+ const response = await this.app.getDocument({
69
+ id: documentId,
70
+ });
71
+ docStatus = response.status;
72
+ if (docStatus == "document.draft") break;
73
+ console.log(
74
+ `Document status is '${documentStatus}' and not 'document.draft'. Waiting 1s and trying again...`
75
+ );
76
+ await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
77
+ } catch (error) {
78
+ console.error("Error fetching document details:", error);
79
+ }
80
+ }
81
+
64
82
  const data = {
65
83
  subject: this.subject,
66
84
  message: this.message,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/pandadoc",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Pipedream PandaDoc Components",
5
5
  "main": "pandadoc.app.mjs",
6
6
  "keywords": [
package/pandadoc.app.mjs CHANGED
@@ -188,5 +188,11 @@ export default {
188
188
  ...args,
189
189
  });
190
190
  },
191
+ getDocument({ id, ...args }) {
192
+ return this.makeRequest({
193
+ path: `/documents/${id}`,
194
+ ...args,
195
+ });
196
+ },
191
197
  },
192
198
  };
@@ -8,7 +8,7 @@ export default {
8
8
  description:
9
9
  `Emit new event when a document failed to be created [See docs here](${DOCS_LINK})`,
10
10
  key: "pandadoc-document-creation-failed",
11
- version: "0.0.2",
11
+ version: "0.0.3",
12
12
  type: "source",
13
13
  methods: {
14
14
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  description:
9
9
  `Emit new event when a document is deleted [See docs here](${DOCS_LINK})`,
10
10
  key: "pandadoc-document-deleted",
11
- version: "0.0.2",
11
+ version: "0.0.3",
12
12
  type: "source",
13
13
  methods: {
14
14
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  description:
9
9
  `Emit new event when a document's state is changed [See docs here](${DOCS_LINK})`,
10
10
  key: "pandadoc-document-state-changed",
11
- version: "0.0.2",
11
+ version: "0.0.3",
12
12
  type: "source",
13
13
  methods: {
14
14
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  description:
9
9
  `Emit new event when a document is updated [See docs here](${DOCS_LINK})`,
10
10
  key: "pandadoc-document-updated",
11
- version: "0.0.2",
11
+ version: "0.0.3",
12
12
  type: "source",
13
13
  methods: {
14
14
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  description:
9
9
  `Emit new event when a recipient completes a document [See docs here](${DOCS_LINK})`,
10
10
  key: "pandadoc-recipient-completed",
11
- version: "0.0.2",
11
+ version: "0.0.3",
12
12
  type: "source",
13
13
  methods: {
14
14
  ...common.methods,