Skip to content

Commit 1829184

Browse files
authored
Merge branch 'master' into 13965-bug-linkedin-components-api-version-update
2 parents 6fa142b + db59016 commit 1829184

File tree

8 files changed

+95
-66
lines changed

8 files changed

+95
-66
lines changed

components/botcake/botcake.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "botcake",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/botcake/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/botcake",
3+
"version": "0.0.1",
4+
"description": "Pipedream Botcake Components",
5+
"main": "botcake.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"botcake"
9+
],
10+
"homepage": "https://pipedream.com/apps/botcake",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/clarify/clarify.app.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "clarify",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/clarify/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/clarify",
3+
"version": "0.0.1",
4+
"description": "Pipedream Clarify Components",
5+
"main": "clarify.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"clarify"
9+
],
10+
"homepage": "https://pipedream.com/apps/clarify",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/notion/package.json

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

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

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "notion-updated-page",
99
name: "Updated Page in Database", /* eslint-disable-line pipedream/source-name */
1010
description: "Emit new event when a page in a database is updated. To select a specific page, use `Updated Page ID` instead",
11-
version: "0.0.15",
11+
version: "0.0.16",
1212
type: "source",
1313
dedupe: "unique",
1414
props: {
@@ -40,14 +40,12 @@ export default {
4040
},
4141
hooks: {
4242
async deploy() {
43-
if (!this.properties?.length) {
44-
return;
45-
}
43+
const properties = await this.getProperties();
4644
const propertyValues = {};
4745
const pagesStream = this.notion.getPages(this.databaseId);
4846
for await (const page of pagesStream) {
4947
propertyValues[page.id] = {};
50-
for (const property of this.properties) {
48+
for (const property of properties) {
5149
propertyValues[page.id][property] = JSON.stringify(page.properties[property]);
5250
}
5351
}
@@ -62,70 +60,61 @@ export default {
6260
_setPropertyValues(propertyValues) {
6361
this.db.set("propertyValues", propertyValues);
6462
},
63+
async getProperties() {
64+
if (this.properties?.length) {
65+
return this.properties;
66+
}
67+
const { properties } = await this.notion.retrieveDatabase(this.databaseId);
68+
return Object.keys(properties);
69+
},
70+
generateMeta(obj, summary) {
71+
const { id } = obj;
72+
const title = this.notion.extractPageTitle(obj);
73+
const ts = Date.now();
74+
return {
75+
id: `${id}-${ts}`,
76+
summary: `${summary}: ${title} - ${id}`,
77+
ts,
78+
};
79+
},
6580
},
6681
async run() {
6782
const lastCheckedTimestamp = this.getLastUpdatedTimestamp();
68-
const lastCheckedTimestampDate = new Date(lastCheckedTimestamp);
69-
const lastCheckedTimestampISO = lastCheckedTimestampDate.toISOString();
7083
const propertyValues = this._getPropertyValues();
7184

72-
// Add a filter so that we only receive pages that have been updated since the last call.
7385
const params = {
7486
...this.lastUpdatedSortParam(),
75-
filter: {
76-
timestamp: "last_edited_time",
77-
last_edited_time: {
78-
after: lastCheckedTimestampISO,
79-
},
80-
},
8187
};
8288
let newLastUpdatedTimestamp = lastCheckedTimestamp;
83-
89+
const properties = await this.getProperties();
8490
const pagesStream = this.notion.getPages(this.databaseId, params);
8591

8692
for await (const page of pagesStream) {
87-
if (!this.isResultNew(page.last_edited_time, lastCheckedTimestamp)) {
88-
// The call to getPages() includes a descending sort by last_edited_time.
89-
// As soon as one page !isResultNew(), all of the following ones will also.
90-
// NOTE: the last_edited_filter means this will never be called,
91-
// but it's worth keeping as future-proofing.
92-
break;
93-
}
94-
9593
newLastUpdatedTimestamp = Math.max(
9694
newLastUpdatedTimestamp,
9795
Date.parse(page?.last_edited_time),
9896
);
9997

100-
if (this.properties?.length) {
101-
let propertyChangeFound = false;
102-
for (const property of this.properties) {
103-
const currentProperty = JSON.stringify(page.properties[property]);
104-
if (!propertyValues[page.id] || currentProperty !== propertyValues[page.id][property]) {
105-
propertyChangeFound = true;
106-
propertyValues[page.id] = {
107-
...propertyValues[page.id],
108-
[property]: currentProperty,
109-
};
110-
}
111-
}
112-
if (!propertyChangeFound) {
113-
continue;
98+
let propertyChangeFound = false;
99+
for (const property of properties) {
100+
const currentProperty = JSON.stringify(page.properties[property]);
101+
if (!propertyValues[page.id] || currentProperty !== propertyValues[page.id][property]) {
102+
propertyChangeFound = true;
103+
propertyValues[page.id] = {
104+
...propertyValues[page.id],
105+
[property]: currentProperty,
106+
};
114107
}
115108
}
109+
if (!propertyChangeFound && Date.parse(page?.last_edited_time) <= lastCheckedTimestamp) {
110+
continue;
111+
}
116112

117113
if (!this.includeNewPages && page?.last_edited_time === page?.created_time) {
118114
continue;
119115
}
120116

121-
const meta = this.generateMeta(
122-
page,
123-
constants.types.PAGE,
124-
constants.timestamps.LAST_EDITED_TIME,
125-
constants.summaries.PAGE_UPDATED,
126-
true,
127-
);
128-
117+
const meta = this.generateMeta(page, constants.summaries.PAGE_UPDATED);
129118
this.$emit(page, meta);
130119
}
131120

docs-v2/vercel.json

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
2-
"rewrites": [
2+
"redirects": [
33
{
44
"source": "/docs/v3",
55
"destination": "/docs"
66
},
77
{
88
"source": "/docs/v3/(.*)",
99
"destination": "/docs/$1"
10-
}
11-
],
12-
"redirects": [
10+
},
1311
{
1412
"source": "/docs/notebook/actions/",
1513
"destination": "/workflows/steps/actions/"
@@ -222,14 +220,6 @@
222220
"source": "/docs/components/quickstart/nodejs/actions",
223221
"destination": "/docs/components/actions-quickstart"
224222
},
225-
{
226-
"source": "/docs/components/quickstart/nodejs/sources",
227-
"destination": "/docs/components/sources-quickstart"
228-
},
229-
{
230-
"source": "/docs/v3/components/quickstart/nodejs/sources",
231-
"destination": "/docs/components/sources-quickstart"
232-
},
233223
{
234224
"source": "/docs/github-sync",
235225
"destination": "/docs/quickstart/github-sync"
@@ -285,14 +275,6 @@
285275
{
286276
"source": "/docs/workflows/networking",
287277
"destination": "/docs/databases#connecting-to-restricted-databases"
288-
},
289-
{
290-
"source": "/docs/errors/",
291-
"destination": "/docs/workflows/errors"
292-
},
293-
{
294-
"source": "/docs/v3/api/sse",
295-
"destination": "/docs/destinations/sse"
296278
}
297279
]
298280
}

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)