Skip to content

Commit 7851ded

Browse files
17095 components offorte (#17141)
* [Components] offorte #17095 Sources - New Event (Instant) Actions - Create Contact Organisation - Create Contact Person - Create Proposal - List Proposal Temaplates - List Proposals - List Users - Search Contact Organisation - Search Contact People - Send Proposal * pnpm update * Update components/offorte/actions/get-contact-details/get-contact-details.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/offorte/sources/new-event-instant/new-event-instant.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * add prop name * fix test-event file * some adjusts * pnpm update * pnpm update * Fix export key in get-contact-details action --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 8110056 commit 7851ded

File tree

17 files changed

+1223
-8
lines changed

17 files changed

+1223
-8
lines changed
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import offorte from "../../offorte.app.mjs";
3+
4+
export default {
5+
key: "offorte-create-contact-organisation",
6+
name: "Create Contact Organisation",
7+
description: "Create a new contact organisation in Offorte. [See the documentation](https://www.offorte.com/api-docs/api#tag/Contacts/operation/createContactOrganisation)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
offorte,
12+
name: {
13+
propDefinition: [
14+
offorte,
15+
"name",
16+
],
17+
},
18+
street: {
19+
propDefinition: [
20+
offorte,
21+
"street",
22+
],
23+
},
24+
zipcode: {
25+
propDefinition: [
26+
offorte,
27+
"zipcode",
28+
],
29+
},
30+
city: {
31+
propDefinition: [
32+
offorte,
33+
"city",
34+
],
35+
},
36+
state: {
37+
propDefinition: [
38+
offorte,
39+
"state",
40+
],
41+
},
42+
country: {
43+
propDefinition: [
44+
offorte,
45+
"country",
46+
],
47+
},
48+
phone: {
49+
propDefinition: [
50+
offorte,
51+
"phone",
52+
],
53+
},
54+
fax: {
55+
type: "string",
56+
label: "Fax",
57+
description: "The fax number of the contact",
58+
optional: true,
59+
},
60+
email: {
61+
propDefinition: [
62+
offorte,
63+
"email",
64+
],
65+
optional: true,
66+
},
67+
internet: {
68+
propDefinition: [
69+
offorte,
70+
"internet",
71+
],
72+
optional: true,
73+
},
74+
linkedin: {
75+
propDefinition: [
76+
offorte,
77+
"linkedin",
78+
],
79+
optional: true,
80+
},
81+
facebook: {
82+
propDefinition: [
83+
offorte,
84+
"facebook",
85+
],
86+
optional: true,
87+
},
88+
twitter: {
89+
propDefinition: [
90+
offorte,
91+
"twitter",
92+
],
93+
optional: true,
94+
},
95+
instagram: {
96+
propDefinition: [
97+
offorte,
98+
"instagram",
99+
],
100+
optional: true,
101+
},
102+
coc_number: {
103+
type: "string",
104+
label: "COC Number",
105+
description: "The COC number of the contact",
106+
optional: true,
107+
},
108+
vat_number: {
109+
type: "string",
110+
label: "VAT Number",
111+
description: "The VAT number of the contact",
112+
optional: true,
113+
},
114+
tags: {
115+
propDefinition: [
116+
offorte,
117+
"tags",
118+
],
119+
optional: true,
120+
},
121+
},
122+
async run({ $ }) {
123+
const response = await this.offorte.createContactOrganisation({
124+
$,
125+
data: {
126+
name: this.name,
127+
type: "organisation",
128+
street: this.street,
129+
zipcode: this.zipcode,
130+
city: this.city,
131+
state: this.state,
132+
country: this.country,
133+
phone: this.phone,
134+
fax: this.fax,
135+
email: this.email,
136+
internet: this.internet,
137+
linkedin: this.linkedin,
138+
facebook: this.facebook,
139+
twitter: this.twitter,
140+
instagram: this.instagram,
141+
coc_number: this.coc_number,
142+
vat_number: this.vat_number,
143+
tags: parseObject(this.tags),
144+
},
145+
});
146+
147+
$.export("$summary", "Contact organisation created successfully");
148+
return response.data;
149+
},
150+
};
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import offorte from "../../offorte.app.mjs";
3+
4+
export default {
5+
key: "offorte-create-contact-person",
6+
name: "Create Contact Person",
7+
description: "Create a new contact person in Offorte. [See the documentation](https://www.offorte.com/api-docs/api#tag/Contacts/operation/createContactPerson)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
offorte,
12+
organisationId: {
13+
propDefinition: [
14+
offorte,
15+
"organisationId",
16+
],
17+
},
18+
fullname: {
19+
propDefinition: [
20+
offorte,
21+
"name",
22+
],
23+
},
24+
firstname: {
25+
type: "string",
26+
label: "First Name",
27+
description: "The first name of the contact",
28+
optional: true,
29+
},
30+
lastname: {
31+
type: "string",
32+
label: "Last Name",
33+
description: "The last name of the contact",
34+
optional: true,
35+
},
36+
salutation: {
37+
type: "string",
38+
label: "Salutation",
39+
description: "The salutation of the contact",
40+
optional: true,
41+
},
42+
street: {
43+
propDefinition: [
44+
offorte,
45+
"street",
46+
],
47+
optional: true,
48+
},
49+
zipcode: {
50+
propDefinition: [
51+
offorte,
52+
"zipcode",
53+
],
54+
optional: true,
55+
},
56+
city: {
57+
propDefinition: [
58+
offorte,
59+
"city",
60+
],
61+
optional: true,
62+
},
63+
state: {
64+
propDefinition: [
65+
offorte,
66+
"state",
67+
],
68+
optional: true,
69+
},
70+
country: {
71+
propDefinition: [
72+
offorte,
73+
"country",
74+
],
75+
optional: true,
76+
},
77+
phone: {
78+
propDefinition: [
79+
offorte,
80+
"phone",
81+
],
82+
optional: true,
83+
},
84+
mobile: {
85+
type: "string",
86+
label: "Mobile",
87+
description: "The mobile number of the contact",
88+
optional: true,
89+
},
90+
email: {
91+
propDefinition: [
92+
offorte,
93+
"email",
94+
],
95+
optional: true,
96+
},
97+
internet: {
98+
propDefinition: [
99+
offorte,
100+
"internet",
101+
],
102+
optional: true,
103+
},
104+
linkedin: {
105+
propDefinition: [
106+
offorte,
107+
"linkedin",
108+
],
109+
optional: true,
110+
},
111+
facebook: {
112+
propDefinition: [
113+
offorte,
114+
"facebook",
115+
],
116+
optional: true,
117+
},
118+
twitter: {
119+
propDefinition: [
120+
offorte,
121+
"twitter",
122+
],
123+
optional: true,
124+
},
125+
instagram: {
126+
propDefinition: [
127+
offorte,
128+
"instagram",
129+
],
130+
optional: true,
131+
},
132+
tags: {
133+
propDefinition: [
134+
offorte,
135+
"tags",
136+
],
137+
optional: true,
138+
},
139+
},
140+
async run({ $ }) {
141+
const {
142+
offorte,
143+
organisationId,
144+
tags,
145+
...data
146+
} = this;
147+
148+
const response = await offorte.createContactPerson({
149+
$,
150+
organisationId,
151+
data: {
152+
...data,
153+
tags: parseObject(tags),
154+
},
155+
});
156+
157+
$.export("$summary", "Contact person created successfully");
158+
return response.data;
159+
},
160+
};

0 commit comments

Comments
 (0)