@pipedream/pandadoc 1.0.0 → 1.0.2

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.
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Create Document Attachment",
8
8
  description: "Adds an attachment to a document. [See the documentation here](https://developers.pandadoc.com/reference/create-document-attachment)",
9
9
  type: "action",
10
- version: "0.1.0",
10
+ version: "0.1.1",
11
11
  props: {
12
12
  app,
13
13
  documentId: {
@@ -27,6 +27,12 @@ export default {
27
27
  label: "File Name",
28
28
  description: "A name you want to set for a file in the system",
29
29
  },
30
+ syncDir: {
31
+ type: "dir",
32
+ accessMode: "read",
33
+ sync: true,
34
+ optional: true,
35
+ },
30
36
  },
31
37
  methods: {
32
38
  async getFormData(file, fileName) {
@@ -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 documentation here](https://developers.pandadoc.com/reference/create-document-from-pdf)",
9
9
  type: "action",
10
- version: "1.0.0",
10
+ version: "1.0.1",
11
11
  props: {
12
12
  app,
13
13
  name: {
@@ -41,6 +41,12 @@ export default {
41
41
  \nE.g. \`{ "name": { "value": "Jane", "role": "user" }, "like": { "value": true, "role": "user" } }\``,
42
42
  optional: true,
43
43
  },
44
+ syncDir: {
45
+ type: "dir",
46
+ accessMode: "read",
47
+ sync: true,
48
+ optional: true,
49
+ },
44
50
  },
45
51
  methods: createDocumentAttachment.methods,
46
52
  async run({ $ }) {
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create Document From Template",
6
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.7",
8
+ version: "0.0.8",
9
9
  props: {
10
10
  app,
11
11
  name: {
@@ -52,7 +52,12 @@ export default {
52
52
  },
53
53
  async additionalProps() {
54
54
  const props = {};
55
- const { fields } = await this.app.getTemplate({
55
+ if (!this.templateId) {
56
+ return props;
57
+ }
58
+ const {
59
+ fields, images,
60
+ } = await this.app.getTemplate({
56
61
  templateId: this.templateId,
57
62
  });
58
63
  for (const field of fields) {
@@ -65,6 +70,15 @@ export default {
65
70
  optional: true,
66
71
  };
67
72
  }
73
+ if (images?.length) {
74
+ for (const image of images) {
75
+ props[image.block_uuid] = {
76
+ type: "string",
77
+ label: `${image.name} URL`,
78
+ optional: true,
79
+ };
80
+ }
81
+ }
68
82
  return props;
69
83
  },
70
84
  methods: {
@@ -91,7 +105,9 @@ export default {
91
105
  } = this;
92
106
 
93
107
  const fields = {};
94
- const { fields: items } = await this.app.getTemplate({
108
+ const {
109
+ fields: items, images: templateImages,
110
+ } = await this.app.getTemplate({
95
111
  templateId: this.templateId,
96
112
  });
97
113
  for (const field of items) {
@@ -103,6 +119,20 @@ export default {
103
119
  };
104
120
  }
105
121
 
122
+ const images = [];
123
+ if (templateImages?.length) {
124
+ for (const image of templateImages) {
125
+ if (this[image.block_uuid]) {
126
+ images.push({
127
+ name: image.name,
128
+ urls: [
129
+ this[image.block_uuid],
130
+ ],
131
+ });
132
+ }
133
+ }
134
+ }
135
+
106
136
  const response = await this.app.createDocument({
107
137
  $,
108
138
  data: {
@@ -113,6 +143,7 @@ export default {
113
143
  recipients: this.parseToAnyArray(recipients),
114
144
  tokens: this.parseToAnyArray(tokens),
115
145
  fields,
146
+ images,
116
147
  },
117
148
  });
118
149
 
@@ -7,7 +7,7 @@ export default {
7
7
  description:
8
8
  "Download a document as PDF. [See documentation here](https://developers.pandadoc.com/reference/download-document)",
9
9
  type: "action",
10
- version: "0.0.1",
10
+ version: "0.0.2",
11
11
  props: {
12
12
  app,
13
13
  id: {
@@ -34,6 +34,11 @@ export default {
34
34
  "separateFiles",
35
35
  ],
36
36
  },
37
+ syncDir: {
38
+ type: "dir",
39
+ accessMode: "write",
40
+ sync: true,
41
+ },
37
42
  },
38
43
  additionalProps() {
39
44
  return this.showWatermark
@@ -7,7 +7,7 @@ export default {
7
7
  description:
8
8
  "Download a completed document as a verifiable PDF. [See documentation here](https://developers.pandadoc.com/reference/download-protected-document)",
9
9
  type: "action",
10
- version: "0.0.1",
10
+ version: "0.0.2",
11
11
  props: {
12
12
  app,
13
13
  id: {
@@ -28,6 +28,11 @@ export default {
28
28
  "separateFiles",
29
29
  ],
30
30
  },
31
+ syncDir: {
32
+ type: "dir",
33
+ accessMode: "write",
34
+ sync: true,
35
+ },
31
36
  },
32
37
  async run({ $ }) {
33
38
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/pandadoc",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Pipedream PandaDoc Components",
5
5
  "main": "pandadoc.app.mjs",
6
6
  "keywords": [