Skip to content

Commit b4d33d4

Browse files
committed
Merge remote-tracking branch 'origin/master' into fixing-pipedream-sdk-components-package-incident
2 parents 72edd27 + 70aca9e commit b4d33d4

File tree

34 files changed

+1785
-45
lines changed

34 files changed

+1785
-45
lines changed

components/attio/actions/create-note/create-note.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "attio-create-note",
55
name: "Create Note",
66
description: "Creates a new note for a given record. The note will be linked to the specified record. [See the documentation](https://developers.attio.com/reference/post_v2-notes)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
attio,

components/attio/actions/create-update-record/create-update-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "attio-create-update-record",
66
name: "Create or Update Record",
77
description: "Creates or updates a specific record such as a person or a deal. If the record already exists, it's updated. Otherwise, a new record is created. [See the documentation](https://developers.attio.com/reference/put_v2-objects-object-records)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
attio,

components/attio/actions/delete-list-entry/delete-list-entry.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "attio-delete-list-entry",
55
name: "Delete List Entry",
66
description: "Deletes an existing entry from a specific list. [See the documentation](https://developers.attio.com/reference/delete_v2-lists-list-entries-entry-id)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
attio,

components/attio/attio.app.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ export default {
6464
offset: page * DEFAULT_LIMIT,
6565
},
6666
});
67-
return data?.map(({ id }) => id.record_id) || [];
67+
return data?.map(({
68+
id, values,
69+
}) => ({
70+
value: id.record_id,
71+
label: (values?.name?.length && (values.name[0].value || values.name[0].full_name))
72+
?? (values?.domains?.length && values.domains[0].domain)
73+
?? (values?.email_addresses?.length && values.email_addresses[0].email_address)
74+
?? values?.id?.record_id,
75+
})) || [];
6876
},
6977
},
7078
attributeId: {

components/attio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/attio",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Pipedream Attio Components",
55
"main": "attio.app.mjs",
66
"keywords": [

components/attio/sources/new-list-entry-instant/new-list-entry-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "attio-new-list-entry-instant",
77
name: "New List Entry (Instant)",
88
description: "Emit new event when a record, such as person, company, or deal, is added to a list",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {

components/attio/sources/new-record-created-instant/new-record-created-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "attio-new-record-created-instant",
77
name: "New Record Created (Instant)",
88
description: "Emit new event when new record, such as person, company or deal gets created",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {

components/attio/sources/record-updated-instant/record-updated-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "attio-record-updated-instant",
77
name: "Record Updated (Instant)",
88
description: "Emit new event when values on a record, such as person, company or deal, are updated",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import FormData from "form-data";
3+
import fs from "fs";
4+
import { LANGUAGE_OPTIONS } from "../../common/constants.mjs";
5+
import {
6+
checkTmp, parseObject,
7+
} from "../../common/utils.mjs";
8+
import ignisign from "../../ignisign.app.mjs";
9+
10+
export default {
11+
key: "ignisign-create-signature-request",
12+
name: "Create Signature Request",
13+
description: "Creates a document signature request through IgniSign. [See the documentation](https://ignisign.io/docs/ignisign-api/init-signature-request)",
14+
version: "0.0.1",
15+
type: "action",
16+
props: {
17+
ignisign,
18+
signerIds: {
19+
propDefinition: [
20+
ignisign,
21+
"signerIds",
22+
],
23+
},
24+
documentLabel: {
25+
type: "string",
26+
label: "Document Label",
27+
description: "A user-friendly label to identify the document.",
28+
optional: true,
29+
},
30+
documentDescription: {
31+
type: "string",
32+
label: "Document Description",
33+
description: "A detailed, human-readable description of the document.",
34+
optional: true,
35+
},
36+
documentExternalId: {
37+
type: "string",
38+
label: "Document External Id",
39+
description: "An optional external identifier that can be used to reference the document from external systems. It's a free text. Ignisign's system do not interprete it.",
40+
optional: true,
41+
},
42+
file: {
43+
type: "string",
44+
label: "Document File",
45+
description: "The file to be uploaded, 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)",
46+
},
47+
title: {
48+
type: "string",
49+
label: "Title",
50+
description: "The title of the signature request.",
51+
},
52+
description: {
53+
type: "string",
54+
label: "Description",
55+
description: "The description of the signature request.",
56+
optional: true,
57+
},
58+
expirationDateIsActivated: {
59+
type: "boolean",
60+
label: "Expiration Date Is Activated",
61+
description: "Indicates whether the expiration date is activated.",
62+
reloadProps: true,
63+
optional: true,
64+
},
65+
expirationDate: {
66+
type: "string",
67+
label: "Expiration Date",
68+
description: "The expiration date. The action linked to this date is performed every 5 minutes, at 5, 10, 15... 55.",
69+
optional: true,
70+
hidden: true,
71+
},
72+
language: {
73+
type: "string",
74+
label: "Language",
75+
description: "Represents the languages for signatures supported by a signature profile.",
76+
options: LANGUAGE_OPTIONS,
77+
optional: true,
78+
},
79+
},
80+
async additionalProps(props) {
81+
props.expirationDate.hidden = !this.expirationDateIsActivated;
82+
return {};
83+
},
84+
async run({ $ }) {
85+
const data = new FormData();
86+
87+
const { signatureRequestId } = await this.ignisign.initSignatureRequest();
88+
89+
const { documentId } = await this.ignisign.initDocument({
90+
data: {
91+
signatureRequestId,
92+
label: this.documentLabel,
93+
description: this.documentDescription,
94+
externalId: this.documentExternalId,
95+
},
96+
});
97+
98+
const path = checkTmp(this.file);
99+
if (!fs.existsSync(path)) {
100+
await this.ignisign.closeSignatureRequest({
101+
signatureRequestId,
102+
});
103+
throw new ConfigurationError("File does not exist!");
104+
}
105+
const file = fs.createReadStream(path);
106+
data.append("file", file);
107+
108+
await this.ignisign.uploadFile({
109+
documentId,
110+
data,
111+
headers: data.getHeaders(),
112+
});
113+
114+
await this.ignisign.updateSignatureRequest({
115+
signatureRequestId,
116+
data: {
117+
title: this.title,
118+
description: this.description,
119+
expirationDateIsActivated: this.expirationDateIsActivated,
120+
expirationDate: this.expirationDate,
121+
language: this.language,
122+
documentIds: [
123+
documentId,
124+
],
125+
signerIds: parseObject(this.signerIds),
126+
},
127+
});
128+
129+
await this.ignisign.publishSignatureRequest({
130+
$,
131+
signatureRequestId,
132+
});
133+
134+
$.export("$summary", `Successfully published signature request with ID ${signatureRequestId}`);
135+
return {
136+
signatureRequestId,
137+
};
138+
},
139+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import ignisign from "../../ignisign.app.mjs";
2+
3+
export default {
4+
key: "ignisign-create-signer",
5+
name: "Create Signer",
6+
description: "Creates a new signer entity in IgniSign. [See the documentation](https://ignisign.io/docs/ignisign-api/create-signer)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
ignisign,
11+
signerProfileId: {
12+
propDefinition: [
13+
ignisign,
14+
"signerProfileId",
15+
],
16+
optional: true,
17+
},
18+
externalId: {
19+
propDefinition: [
20+
ignisign,
21+
"externalId",
22+
],
23+
optional: true,
24+
},
25+
firstName: {
26+
propDefinition: [
27+
ignisign,
28+
"firstName",
29+
],
30+
optional: true,
31+
},
32+
lastName: {
33+
propDefinition: [
34+
ignisign,
35+
"lastName",
36+
],
37+
optional: true,
38+
},
39+
email: {
40+
propDefinition: [
41+
ignisign,
42+
"email",
43+
],
44+
},
45+
phoneNumber: {
46+
propDefinition: [
47+
ignisign,
48+
"phoneNumber",
49+
],
50+
optional: true,
51+
},
52+
nationality: {
53+
propDefinition: [
54+
ignisign,
55+
"nationality",
56+
],
57+
optional: true,
58+
},
59+
birthDate: {
60+
propDefinition: [
61+
ignisign,
62+
"birthDate",
63+
],
64+
optional: true,
65+
},
66+
birthPlace: {
67+
propDefinition: [
68+
ignisign,
69+
"birthPlace",
70+
],
71+
optional: true,
72+
},
73+
birthCountry: {
74+
propDefinition: [
75+
ignisign,
76+
"birthCountry",
77+
],
78+
optional: true,
79+
},
80+
},
81+
async run({ $ }) {
82+
const {
83+
ignisign,
84+
...data
85+
} = this;
86+
87+
const response = await ignisign.createSigner({
88+
$,
89+
data,
90+
});
91+
92+
$.export("$summary", `Successfully created signer with ID: ${response.signerId}`);
93+
return response;
94+
},
95+
};

0 commit comments

Comments
 (0)