-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] Document360 - new components #18316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
...nts/document360/actions/drive-search-files-and-folders/drive-search-files-and-folders.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| }, | ||
| }); | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| $.export("$summary", `Successfully searched for files and folders with keyword \`${searchKeyword}\``); | ||
| return response; | ||
| }, | ||
| }; | ||
79 changes: 79 additions & 0 deletions
79
components/document360/actions/get-article/get-article.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.", | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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; | ||
| }, | ||
| }; | ||
53 changes: 53 additions & 0 deletions
53
components/document360/actions/get-file-information/get-file-information.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.