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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "document360-create-document",
name: "Create Document",
description: "Creates a new document in Document360 from text. [See the documentation](https://apidocs.document360.com/apidocs/how-to-create-and-publish-an-article)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
document360,
Expand Down Expand Up @@ -34,6 +34,26 @@ export default {
"userId",
],
},
contentType: {
type: "string",
label: "Content Type",
description: "The type of content of the new document.",
options: [
{
value: "0",
label: "Markdown",
},
{
value: "1",
label: "WYSIWYG(HTML)",
},
{
value: "2",
label: "Advanced WYSIWYG(HTML)",
},
],
optional: true,
},
content: {
type: "string",
label: "Document Content",
Expand All @@ -56,6 +76,7 @@ export default {
user_id: this.userId,
content: this.content,
order: this.order,
content_type: this.contentType,
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import app from "../../document360.app.mjs";

export default {
key: "document360-drive-search-files-and-folders",
name: "Drive Search - Files and Folders",
description: "Search for files and folders in Document360 Drive. [See the documentation](https://apidocs.document360.com/apidocs/drive-search-files-and-folders)",
version: "0.0.1",
type: "action",
props: {
app,
searchKeyword: {
type: "string",
label: "Search Keyword",
description: "Keyword to search file items from drive",
},
pageNo: {
type: "integer",
label: "Page Number",
description: "Specify the page to retrieve. Page numbers are zero-based. Therefore, to retrieve the 10th page, you need to set `9`",
optional: true,
},
take: {
type: "integer",
label: "Take",
description: "The number of results per page",
optional: true,
},
allowImagesOnly: {
type: "boolean",
label: "Allow Images Only",
description: "Allow images only in response",
optional: true,
},
userIds: {
type: "string[]",
label: "User IDs",
description: "Find by userId",
optional: true,
propDefinition: [
app,
"userId",
],
},
filterFromDate: {
type: "string",
label: "Filter From Date",
description: "Filter using from-date (date-time format). Example: `2025-01-01T00:00:00Z`",
optional: true,
},
filterToDate: {
type: "string",
label: "Filter To Date",
description: "Filter using to-date (date-time format). Example: `2025-01-01T00:00:00Z`",
optional: true,
},
filterTags: {
type: "string[]",
label: "Filter Tags",
description: "Filter using tagIds",
optional: true,
},
},
async run({ $ }) {
const {
app,
searchKeyword,
pageNo,
take,
allowImagesOnly,
userIds,
filterFromDate,
filterToDate,
filterTags,
} = this;

const response = await app.driveSearchFilesAndFolders({
$,
params: {
searchKeyword,
pageNo,
take,
allowImagesOnly,
userIds,
filterFromDate,
filterToDate,
filterTags,
},
});

$.export("$summary", `Successfully searched for files and folders with keyword \`${searchKeyword}\``);
return response;
},
};
79 changes: 79 additions & 0 deletions components/document360/actions/get-article/get-article.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import app from "../../document360.app.mjs";

export default {
key: "document360-get-article",
name: "Get Article",
description: "Gets an article from Document360. [See the documentation](https://apidocs.document360.com/apidocs/get-article)",
version: "0.0.1",
type: "action",
props: {
app,
projectVersionId: {
propDefinition: [
app,
"projectVersionId",
],
},
articleId: {
propDefinition: [
app,
"articleId",
({ projectVersionId }) => ({
projectVersionId,
}),
],
},
langCode: {
propDefinition: [
app,
"langCode",
({ projectVersionId }) => ({
projectVersionId,
}),
],
default: "en",
},
isForDisplay: {
type: "boolean",
label: "Is For Display",
description: "Set this to `true`, if you are displaying the article to the end-user. If `, the content of snippets or variables appears in the article. Note: If the value is true, ensure that the article content is not passed for update article endpoints.",
optional: true,
},
isPublished: {
type: "boolean",
label: "Is Published",
description: "`true` : You will get the latest published version of the article. (If there are no published versions, then it will return the latest version) `false` : To get the the latest version of the article",
optional: true,
},
appendSASToken: {
type: "boolean",
label: "Append SAS Token",
description: "Set this to `false` to exclude appending SAS token for images/files",
optional: true,
},
},
async run({ $ }) {
const {
app,
articleId,
langCode,
isForDisplay,
isPublished,
appendSASToken,
} = this;

const response = await app.getArticle({
$,
articleId,
langCode,
params: {
isForDisplay,
isPublished,
appendSASToken,
},
});

$.export("$summary", `Successfully retrieved article ID \`${articleId}\` (${langCode})`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import app from "../../document360.app.mjs";

export default {
key: "document360-get-file-information",
name: "Get File Information",
description: "Gets file information from Document360 Drive. [See the documentation](https://apidocs.document360.com/apidocs/gets-file-information)",
version: "0.0.1",
type: "action",
props: {
app,
folderId: {
propDefinition: [
app,
"folderId",
],
},
fileId: {
propDefinition: [
app,
"fileId",
({ folderId }) => ({
folderId,
}),
],
},
appendSASToken: {
type: "boolean",
label: "Append SAS Token",
description: "Set this to false to exclude appending SAS token for images/files",
optional: true,
},
},
async run({ $ }) {
const {
app,
folderId,
fileId,
appendSASToken,
} = this;

const response = await app.getFileInformation({
$,
folderId,
fileId,
params: {
appendSASToken,
},
});

$.export("$summary", `Successfully retrieved file information for file ID \`${fileId}\``);
return response;
},
};
Loading
Loading