Skip to content
Merged
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
2 changes: 1 addition & 1 deletion components/confluence/actions/create-page/create-page.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
key: "confluence-create-page",
name: "Create Page",
description: "Creates a new page in the space. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
confluence,
draftInfo: {

Check warning on line 11 in components/confluence/actions/create-page/create-page.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop draftInfo must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 11 in components/confluence/actions/create-page/create-page.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop draftInfo must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: "Pages are created as published by default, unless specified as a draft in the `Status` prop.",
Expand Down
2 changes: 1 addition & 1 deletion components/confluence/actions/create-post/create-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "confluence-create-post",
name: "Create Post",
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)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
confluence,
Expand Down
2 changes: 1 addition & 1 deletion components/confluence/actions/delete-post/delete-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "confluence-delete-post",
name: "Delete Post",
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)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
confluence,
Expand Down
30 changes: 30 additions & 0 deletions components/confluence/actions/get-page-by-id/get-page-by-id.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import confluence from "../../confluence.app.mjs";

export default {
key: "confluence-get-page-by-id",
name: "Get Page by ID",
description: "Retrieve a page by its ID. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get)",
version: "0.0.1",
type: "action",
props: {
confluence,
pageId: {
propDefinition: [
confluence,
"pageId",
],
},
},
async run({ $ }) {
const cloudId = await this.confluence.getCloudId({
$,
});
const response = await this.confluence.getPageById({
$,
cloudId,
pageId: this.pageId,
});
$.export("$summary", `Successfully retrieved page with ID: ${this.pageId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import confluence from "../../confluence.app.mjs";

export default {
key: "confluence-get-pages-in-space",
name: "Get Pages in Space",
description: "Retrieve a list of pages in a space. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-spaces-id-pages-get)",
version: "0.0.1",
type: "action",
props: {
confluence,
spaceId: {
propDefinition: [
confluence,
"spaceId",
],
},
sort: {
propDefinition: [
confluence,
"pageSort",
],
},
status: {
propDefinition: [
confluence,
"pageStatus",
],
},
pageTitle: {
propDefinition: [
confluence,
"pageTitle",
],
},
bodyFormat: {
propDefinition: [
confluence,
"bodyFormat",
],
},
subType: {
propDefinition: [
confluence,
"subType",
],
},
cursor: {
propDefinition: [
confluence,
"cursor",
],
},
limit: {
propDefinition: [
confluence,
"limit",
],
},
},
async run({ $ }) {
const cloudId = await this.confluence.getCloudId({
$,
});
const response = await this.confluence.listPagesInSpace({
$,
cloudId,
spaceId: this.spaceId,
params: {
sort: this.sort,
status: this.status,
title: this.pageTitle,
bodyFormat: this.bodyFormat,
subType: this.subType,
cursor: this.cursor,
limit: this.limit,
},
});
$.export("$summary", `Successfully retrieved ${response.results.length} page${response.results.length === 1
? ""
: "s"}`);
return response;
},
};
76 changes: 76 additions & 0 deletions components/confluence/actions/get-pages/get-pages.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import confluence from "../../confluence.app.mjs";

export default {
key: "confluence-get-pages",
name: "Get Pages",
description: "Retrieve a list of pages. [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-get)",
version: "0.0.1",
type: "action",
props: {
confluence,
sort: {
propDefinition: [
confluence,
"pageSort",
],
},
status: {
propDefinition: [
confluence,
"pageStatus",
],
},
pageTitle: {
propDefinition: [
confluence,
"pageTitle",
],
},
bodyFormat: {
propDefinition: [
confluence,
"bodyFormat",
],
},
subType: {
propDefinition: [
confluence,
"subType",
],
},
cursor: {
propDefinition: [
confluence,
"cursor",
],
},
limit: {
propDefinition: [
confluence,
"limit",
],
},
},
async run({ $ }) {
const cloudId = await this.confluence.getCloudId({
$,
});
const response = await this.confluence.listPages({
$,
cloudId,
params: {
sort: this.sort,
status: this.status,
title: this.pageTitle,
bodyFormat: this.bodyFormat,
subType: this.subType,
cursor: this.cursor,
limit: this.limit,
},
});
$.export("$summary", `Successfully retrieved ${response.results.length} page${response.results.length === 1
? ""
: "s"}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "confluence-search-content",
name: "Search Content",
description: "Searches for content using the Confluence Query Language (CQL). [See the documentation](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search#api-wiki-rest-api-search-get)",
version: "0.0.3",
version: "0.0.4",
type: "action",
props: {
confluence,
Expand Down
2 changes: 1 addition & 1 deletion components/confluence/actions/update-post/update-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "confluence-update-post",
name: "Update a Post",
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)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
confluence,
Expand Down
105 changes: 105 additions & 0 deletions components/confluence/confluence.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,103 @@ export default {
};
},
},
pageId: {
type: "string",
label: "Page ID",
description: "Select a page or provide its ID",
async options({ prevContext }) {
const params = prevContext?.cursor
? {
cursor: prevContext.cursor,
}
: {};
const cloudId = await this.getCloudId();
const {
results, _links: links,
} = await this.listPages({
cloudId,
params,
});
const options = results?.map(({
id: value, title: label,
}) => ({
value,
label,
})) || [];
return {
options,
context: {
cursor: this._extractCursorFromLink(links?.next),
},
};
},
},
pageSort: {
type: "string",
label: "Sort",
description: "Used to sort the result by a particular field",
options: [
"id",
"-id",
"created-date",
"-created-date",
"modified-date",
"-modified-date",
"title",
"-title",
],
optional: true,
},
pageStatus: {
type: "string",
label: "Status",
description: "Filter the results to pages based on their status",
options: [
"current",
"archived",
"deleted",
"trashed",
],
optional: true,
},
pageTitle: {
type: "string",
label: "Title",
description: "Filter the results to pages based on their title",
optional: true,
},
bodyFormat: {
type: "string",
label: "Body Format",
description: "The content format types to be returned in the body field of the response. If available, the representation will be available under a response field of the same name under the body field.",
options: [
"storage",
"atlas_doc_format",
],
optional: true,
},
subType: {
type: "string",
label: "Subtype",
description: "Filter the results to pages based on their subtype",
options: [
"live",
"page",
],
optional: true,
},
cursor: {
type: "string",
label: "Cursor",
description: "Used for pagination, this opaque cursor will be returned in the next URL in the Link response header. Use the relative URL in the Link header to retrieve the next set of results.",
optional: true,
},
limit: {
type: "integer",
label: "Limit",
description: "Maximum number of pages per result to return",
optional: true,
},
},
methods: {
_baseUrl(cloudId) {
Expand Down Expand Up @@ -179,6 +276,14 @@ export default {
...opts,
});
},
getPageById({
pageId, ...opts
}) {
return this._makeRequest({
path: `/pages/${pageId}`,
...opts,
});
},
listSpaces(opts = {}) {
return this._makeRequest({
path: "/spaces",
Expand Down
2 changes: 1 addition & 1 deletion components/confluence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/confluence",
"version": "0.2.1",
"version": "0.3.0",
"description": "Pipedream Confluence Components",
"main": "confluence.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "confluence-new-page-or-blog-post",
name: "New Page or Blog Post",
description: "Emit new event whenever a new page or blog post is created in a specified space",
version: "0.0.4",
version: "0.0.5",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export default {
...common,
key: "confluence-watch-blog-posts",
name: "Watch Blog Posts",

Check warning on line 7 in components/confluence/sources/watch-blog-posts/watch-blog-posts.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 blog post is created or updated",
version: "0.0.4",
version: "0.0.5",
type: "source",
dedupe: "unique",
methods: {
Expand Down
2 changes: 1 addition & 1 deletion components/confluence/sources/watch-pages/watch-pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export default {
...common,
key: "confluence-watch-pages",
name: "Watch Pages",

Check warning on line 7 in components/confluence/sources/watch-pages/watch-pages.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 page is created or updated in Confluence",
version: "0.0.4",
version: "0.0.5",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Loading