Skip to content

Commit 49b653f

Browse files
Fix Confluence cursor handling for pagination
The previous implementation used the full URL link as a cursor value instead of extracting just the cursor parameter. This caused an "INVALID_REQUEST_PARAMETER" error when users tried to use "Load More" when searching for Space IDs. - Added a new method _extractCursorFromLink() to extract only the cursor parameter from the URL - Fixed cursor handling in the paginate method and propDefinitions - Updated package and component versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4d8499a commit 49b653f

File tree

8 files changed

+22
-11
lines changed

8 files changed

+22
-11
lines changed

components/confluence/actions/create-post/create-post.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "confluence-create-post",
55
name: "Create Post",
66
description: "Creates a new page or blog post on Confluence. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-post)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
confluence,

components/confluence/actions/delete-post/delete-post.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "confluence-delete-post",
55
name: "Delete Post",
66
description: "Removes a blog post from Confluence by its ID. Use with caution, the action is irreversible. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-id-delete)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
confluence,

components/confluence/actions/update-post/update-post.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "confluence-update-post",
66
name: "Update a Post",
77
description: "Updates a page or blog post on Confluence by its ID. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/#api-blogposts-id-put)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "action",
1010
props: {
1111
confluence,

components/confluence/confluence.app.mjs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
return {
3131
options,
3232
context: {
33-
cursor: links?.next,
33+
cursor: this._extractCursorFromLink(links?.next),
3434
},
3535
};
3636
},
@@ -61,7 +61,7 @@ export default {
6161
return {
6262
options,
6363
context: {
64-
cursor: links?.next,
64+
cursor: this._extractCursorFromLink(links?.next),
6565
},
6666
};
6767
},
@@ -106,6 +106,16 @@ export default {
106106
...otherOpts,
107107
});
108108
},
109+
_extractCursorFromLink(link) {
110+
if (!link) return null;
111+
try {
112+
const url = new URL(link);
113+
return url.searchParams.get("cursor");
114+
} catch (e) {
115+
console.log("Error extracting cursor from link:", e);
116+
return null;
117+
}
118+
},
109119
async getCloudId(opts = {}) {
110120
const response = await this._makeRequest({
111121
url: "https://api.atlassian.com/oauth/token/accessible-resources",
@@ -203,8 +213,9 @@ export default {
203213
return;
204214
}
205215
}
206-
hasMore = links?.next;
207-
args.params.cursor = hasMore;
216+
const cursor = this._extractCursorFromLink(links?.next);
217+
hasMore = cursor;
218+
args.params.cursor = cursor;
208219
} while (hasMore);
209220
},
210221
},

components/confluence/package.json

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

components/confluence/sources/new-page-or-blog-post/new-page-or-blog-post.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "confluence-new-page-or-blog-post",
77
name: "New Page or Blog Post",
88
description: "Emit new event whenever a new page or blog post is created in a specified space",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {

components/confluence/sources/watch-blog-posts/watch-blog-posts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "confluence-watch-blog-posts",
77
name: "Watch Blog Posts",
88
description: "Emit new event when a blog post is created or updated",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {

components/confluence/sources/watch-pages/watch-pages.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "confluence-watch-pages",
77
name: "Watch Pages",
88
description: "Emit new event when a page is created or updated in Confluence",
9-
version: "0.0.1",
9+
version: "0.0.2",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {

0 commit comments

Comments
 (0)