Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions components/ringcentral/actions/create-contact/create-contact.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import ringcentral from "../../ringcentral.app.mjs";

export default {
key: "ringcentral-create-contact",
name: "Create Contact",
description: "Creates a user personal contact. [See the documentation](https://developers.ringcentral.com/api-reference/External-Contacts/createContact)",
version: "0.0.1",
type: "action",
props: {
ringcentral,
accountId: {
propDefinition: [
ringcentral,
"accountId",
],
},
extensionId: {
propDefinition: [
ringcentral,
"extensionId",
],
description: "Internal identifier of the RingCentral extension/user",
},
email: {
type: "string",
label: "Email",
description: "Email address of the contact",
optional: true,
},
firstName: {
type: "string",
label: "First Name",
description: "First name of the contact",
optional: true,
},
lastName: {
type: "string",
label: "Last Name",
description: "Last name of the contact",
optional: true,
},
mobilePhone: {
type: "string",
label: "Mobile Phone",
description: "Mobile phone of the contact",
optional: true,
},
additionalOptions: {
type: "object",
label: "Additional Options",
description: "Additional parameters to set for the contact. [See the documentation](https://developers.ringcentral.com/api-reference/External-Contacts/createContact) for all available parameters. Example: `{ \"notes\": \"Notes for the contact\" }`",
optional: true,
},
},
methods: {
createContact({
accountId, extensionId, ...args
}) {
return this.ringcentral.makeRequest({
method: "POST",
path: `/account/${accountId}/extension/${extensionId}/address-book/contact`,
...args,
});
},
},
async run({ $ }) {
const { // eslint-disable-next-line no-unused-vars
ringcentral, createContact, accountId, extensionId, additionalOptions, ...data
} = this;

const response =
await createContact({
$,
accountId,
extensionId,
data: {
...data,
...additionalOptions,
},
});

$.export("$summary", `Successfully created contact (ID: ${response.id})`);
return response;
},
};
4 changes: 2 additions & 2 deletions components/ringcentral/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/ringcentral",
"version": "0.4.1",
"version": "0.5.0",
"description": "Pipedream Ringcentral Components",
"main": "ringcentral.app.mjs",
"keywords": [
Expand All @@ -14,6 +14,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.2.0"
"@pipedream/platform": "^3.0.3"
}
}
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading