Skip to content

Commit eb5c27b

Browse files
committed
Source updates
1 parent e02bcc1 commit eb5c27b

File tree

8 files changed

+46
-16
lines changed

8 files changed

+46
-16
lines changed

components/notion/notion.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
pageId: {
2121
type: "string",
2222
label: "Page ID",
23-
description: "Search for a page or provide a page ID",
23+
description: "Select a page or provide a page ID",
2424
async options({ prevContext }) {
2525
const response = await this.search(undefined, {
2626
start_cursor: prevContext.nextPageParameters ?? undefined,

components/notion/sources/common/base.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747

4848
return {
4949
id,
50-
summary: `${summary}: ${title} - ${id}`,
50+
summary: `${summary}: ${title || id}`,
5151
ts,
5252
};
5353
},

components/notion/sources/new-comment-created/new-comment-created.mjs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,33 @@ export default {
1010
dedupe: "unique",
1111
props: {
1212
...base.props,
13+
infoLabel: {
14+
type: "alert",
15+
alertType: "info",
16+
content: "Ensure the selected page is shared with your Pipedream integration to receive events.",
17+
},
1318
pageId: {
1419
propDefinition: [
1520
base.props.notion,
1621
"pageId",
1722
],
18-
description: "Unique identifier of a page or block",
23+
description: "Select the page to watch for new comments, or provide a page ID",
1924
},
2025
},
2126
methods: {
2227
...base.methods,
2328
generateMeta(comment) {
29+
const { id } = comment;
30+
const text = comment.rich_text?.[0]?.plain_text;
31+
const summary = text
32+
? `"${text.length > 40
33+
? text.slice(0, 35) + "[...]"
34+
: text}"`
35+
: `ID ${id}`;
2436
return {
25-
id: comment.id,
26-
summary: `New Comment ID: ${comment.id}`,
27-
ts: comment.created_time,
37+
id,
38+
summary: `New Comment: ${summary}`,
39+
ts: Date.parse(comment.created_time),
2840
};
2941
},
3042
},

components/notion/sources/new-database/new-database.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ import constants from "../common/constants.mjs";
55
export default {
66
...base,
77
key: "notion-new-database",
8-
name: "New Database",
9-
description: "Emit new event when a database is created. Note: Databases must be shared with your Pipedream Integtration to trigger event.",
8+
name: "New Database Created",
9+
description: "Emit new event when a database is created. [See the documentation](https://developers.notion.com/reference/database)",
1010
version: "0.0.8",
1111
type: "source",
12+
props: {
13+
...base.props,
14+
infoLabel: {
15+
type: "alert",
16+
alertType: "info",
17+
content: "Ensure Databases are shared with your Pipedream integration to receive events.",
18+
},
19+
},
1220
async run() {
1321
const databases = [];
1422
const params = this.lastCreatedSortParam();

components/notion/sources/new-page/new-page.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
...base,
88
key: "notion-new-page",
99
name: "New Page in Database",
10-
description: "Emit new event when a page in a database is created",
10+
description: "Emit new event when a page is created in the selected database. [See the documentation](https://developers.notion.com/reference/page)",
1111
version: "0.0.10",
1212
type: "source",
1313
props: {

components/notion/sources/page-or-subpage-updated/page-or-subpage-updated.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ export default {
66
...base,
77
key: "notion-page-or-subpage-updated",
88
name: "Page or Subpage Updated", /* eslint-disable-line pipedream/source-name */
9-
description: "Emit new event when a page or one of its sub-pages is updated.",
9+
description: "Emit new event when the selected page or one of its sub-pages is updated. [See the documentation](https://developers.notion.com/reference/page)",
1010
version: "0.0.6",
1111
type: "source",
1212
dedupe: "unique",
1313
props: {
1414
...base.props,
15+
infoLabel: {
16+
type: "alert",
17+
alertType: "info",
18+
content: "Ensure the selected page is shared with your Pipedream integration to receive events.",
19+
},
1520
pageId: {
1621
propDefinition: [
1722
base.props.notion,

components/notion/sources/updated-page-id/updated-page-id.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ import constants from "../common/constants.mjs";
55
export default {
66
...base,
77
key: "notion-updated-page-id",
8-
name: "Updated Page ID", /* eslint-disable-line pipedream/source-name */
9-
description: "Emit new event when a selected page is updated",
8+
name: "Page Updated", /* eslint-disable-line pipedream/source-name */
9+
description: "Emit new event when a selected page is updated. [See the documentation](https://developers.notion.com/reference/page)",
1010
version: "0.0.5",
1111
type: "source",
1212
dedupe: "unique",
1313
props: {
1414
...base.props,
15+
infoLabel: {
16+
type: "alert",
17+
alertType: "info",
18+
content: "Ensure the selected page is shared with your Pipedream integration to receive events.",
19+
},
1520
pageId: {
1621
propDefinition: [
1722
notion,

components/notion/sources/updated-page/updated-page.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import zlib from "zlib";
77
export default {
88
...base,
99
key: "notion-updated-page",
10-
name: "Updated Page in Database", /* eslint-disable-line pipedream/source-name */
11-
description: "Emit new event when a page in a database is updated. To select a specific page, use `Updated Page ID` instead",
10+
name: "New or Updated Page in Database", /* eslint-disable-line pipedream/source-name */
11+
description: "Emit new event when a page is created or updated in the selected database. [See the documentation](https://developers.notion.com/reference/page)",
1212
version: "0.1.4",
1313
type: "source",
1414
dedupe: "unique",
@@ -23,7 +23,7 @@ export default {
2323
includeNewPages: {
2424
type: "boolean",
2525
label: "Include New Pages",
26-
description: "Set to `true` to emit events when pages are created. Set to `false` to ignore new pages.",
26+
description: "Set to `false` to emit events only for updates, not for new pages.",
2727
default: true,
2828
},
2929
properties: {
@@ -40,7 +40,7 @@ export default {
4040
},
4141
alert: {
4242
type: "alert",
43-
alertType: "info",
43+
alertType: "warning",
4444
content: "Source not saving? Your database might be too large. If deployment takes longer than one minute, an error will occur.",
4545
},
4646
},

0 commit comments

Comments
 (0)