Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
/* eslint-disable pipedream/props-description */
/* eslint-disable pipedream/props-label */
import { ConfigurationError } from "@pipedream/platform";
import app from "../../cloze.app.mjs";
import utils from "../../common/utils.mjs";

export default {
key: "cloze-create-update-company",
name: "Create Or Update Company",
description: "Create a new company or enhance an existing company within Cloze. Companies can be created with just a domain name or both a name and another unique identifier such as a phone number and email address. [See the documentation](https://api.cloze.com/api-docs/#!/Relations_-_Companies/post_v1_companies_create).",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
alert: {
type: "alert",
alertType: "info",
content: "Companies can be created with just a domain name, or both a name and another unique identifier such as a phone number and email address.",
},
name: {
type: "string",
label: "Company Name",
Expand Down Expand Up @@ -127,6 +135,10 @@ export default {
additionalData,
} = this;

if (!name && !domains) {
throw new ConfigurationError("Either **Company Name** or **Domains** are required.");
}

const response = await createCompany({
$,
data: {
Expand Down
2 changes: 1 addition & 1 deletion components/cloze/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/cloze",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Cloze Components",
"main": "cloze.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/cloze/sources/common/webhook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
scope: {
type: "string",
label: "Scope",
description: "Scope of subscription, changes to the user's local person, project, and company may be monitored, or team relations may be monitored, or team hierarchies can be monitored. Can be `local`, `team`, `hierarchy:/X/Y/Z` or `hierarchy:/X/Y/Z/*`",
description: "Scope of subscription.",
options: [
"local",
"team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "cloze-company-change-instant",
name: "Company Change (Instant)",

Check warning on line 8 in components/cloze/sources/company-change-instant/company-change-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when significant changes regarding a company are detected. [See the documentation](https://api.cloze.com/api-docs/#!/Webhooks/post_v1_subscribe).",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand All @@ -16,10 +16,15 @@
return events.COMPANY_CHANGE;
},
generateMeta(event) {
const {
syncKey: id,
lastChanged: ts,
} = event.company;

return {
id: event?.company.syncKey,
id: `${id}-${ts}`,
summary: "New Company Change",
ts: event?.company.lastChanged,
ts,
};
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "cloze-person-change-instant",
name: "Person Change (Instant)",

Check warning on line 8 in components/cloze/sources/person-change-instant/person-change-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when significant changes happen to a person. [See the documentation](https://api.cloze.com/api-docs/#!/Webhooks/post_v1_subscribe).",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand All @@ -16,10 +16,15 @@
return events.PERSON_CHANGE;
},
generateMeta(event) {
const {
syncKey: id,
lastChanged: ts,
} = event.person;

return {
id: event?.person.syncKey,
id: `${id}-${ts}`,
summary: "New Person Change",
ts: event?.person.lastChanged,
ts,
};
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "cloze-project-change-instant",
name: "Project Change (Instant)",

Check warning on line 8 in components/cloze/sources/project-change-instant/project-change-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a significant change occurs in a project. [See the documentation](https://api.cloze.com/api-docs/#!/Webhooks/post_v1_subscribe).",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand All @@ -16,10 +16,15 @@
return events.PROJECT_CHANGE;
},
generateMeta(event) {
const {
syncKey: id,
lastChanged: ts,
} = event.project;

return {
id: event?.project.syncKey,
id: `${id}-${ts}`,
summary: "New Project Change",
ts: event?.project.lastChanged,
ts,
};
},
},
Expand Down
Loading