Skip to content

Commit 0459a6d

Browse files
committed
[FEATURE] Cloze usability updates
1 parent d110209 commit 0459a6d

File tree

6 files changed

+39
-12
lines changed

6 files changed

+39
-12
lines changed

components/cloze/actions/create-update-company/create-update-company.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
/* eslint-disable pipedream/props-description */
2+
/* eslint-disable pipedream/props-label */
3+
import { ConfigurationError } from "@pipedream/platform";
14
import app from "../../cloze.app.mjs";
25
import utils from "../../common/utils.mjs";
36

47
export default {
58
key: "cloze-create-update-company",
69
name: "Create Or Update Company",
710
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).",
8-
version: "0.0.1",
11+
version: "0.0.2",
912
type: "action",
1013
props: {
1114
app,
15+
alert: {
16+
type: "alert",
17+
alertType: "info",
18+
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.",
19+
},
1220
name: {
1321
type: "string",
1422
label: "Company Name",
@@ -127,6 +135,10 @@ export default {
127135
additionalData,
128136
} = this;
129137

138+
if (!name && !domains) {
139+
throw new ConfigurationError("**Company Name** or **Domains** are required.");
140+
}
141+
130142
const response = await createCompany({
131143
$,
132144
data: {

components/cloze/package.json

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

components/cloze/sources/common/webhook.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
scope: {
1414
type: "string",
1515
label: "Scope",
16-
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/*`",
16+
description: "Scope of subscription.",
1717
options: [
1818
"local",
1919
"team",

components/cloze/sources/company-change-instant/company-change-instant.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "cloze-company-change-instant",
88
name: "Company Change (Instant)",
99
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).",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
type: "source",
1212
dedupe: "unique",
1313
methods: {
@@ -16,10 +16,15 @@ export default {
1616
return events.COMPANY_CHANGE;
1717
},
1818
generateMeta(event) {
19+
const {
20+
syncKey: id,
21+
lastChanged: ts,
22+
} = event.company;
23+
1924
return {
20-
id: event?.company.syncKey,
25+
id: `${id}-${ts}`,
2126
summary: "New Company Change",
22-
ts: event?.company.lastChanged,
27+
ts,
2328
};
2429
},
2530
},

components/cloze/sources/person-change-instant/person-change-instant.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "cloze-person-change-instant",
88
name: "Person Change (Instant)",
99
description: "Emit new event when significant changes happen to a person. [See the documentation](https://api.cloze.com/api-docs/#!/Webhooks/post_v1_subscribe).",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
type: "source",
1212
dedupe: "unique",
1313
methods: {
@@ -16,10 +16,15 @@ export default {
1616
return events.PERSON_CHANGE;
1717
},
1818
generateMeta(event) {
19+
const {
20+
syncKey: id,
21+
lastChanged: ts,
22+
} = event.person;
23+
1924
return {
20-
id: event?.person.syncKey,
25+
id: `${id}-${ts}`,
2126
summary: "New Person Change",
22-
ts: event?.person.lastChanged,
27+
ts,
2328
};
2429
},
2530
},

components/cloze/sources/project-change-instant/project-change-instant.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "cloze-project-change-instant",
88
name: "Project Change (Instant)",
99
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).",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
type: "source",
1212
dedupe: "unique",
1313
methods: {
@@ -16,10 +16,15 @@ export default {
1616
return events.PROJECT_CHANGE;
1717
},
1818
generateMeta(event) {
19+
const {
20+
syncKey: id,
21+
lastChanged: ts,
22+
} = event.project;
23+
1924
return {
20-
id: event?.project.syncKey,
25+
id: `${id}-${ts}`,
2126
summary: "New Project Change",
22-
ts: event?.project.lastChanged,
27+
ts,
2328
};
2429
},
2530
},

0 commit comments

Comments
 (0)