-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Salesforce] Knowledge new action components #18216
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
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
19 changes: 19 additions & 0 deletions
19
components/salesforce_rest_api/actions/common/knowledge.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,19 @@ | ||
| import app from "../../salesforce_rest_api.app.mjs"; | ||
|
|
||
| export default { | ||
| props: { | ||
| app, | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| info: { | ||
| type: "alert", | ||
| alertType: "info", | ||
| content: "Please keep in mind that Salesforce Knowledge is available for an additional cost in: Professional Enterprise, Performance, and Developer Editions. For more information, contact your Salesforce representative. [See the documentation](https://help.salesforce.com/s/articleView?id=service.knowledge_map.htm&type=5)", | ||
| }, | ||
| language: { | ||
| type: "string", | ||
| label: "Language", | ||
| description: "The language code. Defaults to `en-US`.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| }; | ||
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
108 changes: 108 additions & 0 deletions
108
components/salesforce_rest_api/actions/get-knowledge-articles/get-knowledge-articles.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,108 @@ | ||
| import common from "../common/knowledge.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "salesforce_rest_api-get-knowledge-articles", | ||
| name: "Get Knowledge Articles", | ||
| description: "Get a page of online articles for the given language and category through either search or query. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_rest_retrieve_article_list.htm)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| ...common.props, | ||
| q: { | ||
| type: "string", | ||
| label: "Search Term", | ||
| description: "Performs an SOSL search. If this property is not set, an SOQL query runs. The characters `?` and `*` are used for wildcard searches. The characters `(`, `)`, and `\"` are used for complex search terms. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_find.htm).", | ||
| optional: true, | ||
| }, | ||
| channel: { | ||
| type: "string", | ||
| label: "Channel", | ||
| description: "Where articles are visible (App, Pkb, Csp, Prm).", | ||
| optional: true, | ||
| options: [ | ||
| { | ||
| label: "Internal Knowledge App", | ||
| value: "App", | ||
| }, | ||
| { | ||
| label: "Public Knowledge Base", | ||
| value: "Pkb", | ||
| }, | ||
| { | ||
| label: "Customer Portal", | ||
| value: "Csp", | ||
| }, | ||
| { | ||
| label: "Partner Portal", | ||
| value: "Prm", | ||
| }, | ||
| ], | ||
| }, | ||
| categories: { | ||
| type: "string", | ||
| label: "Categories", | ||
| description: "This should be a map in json format `{\"group1\": \"category1\", \"group2\": \"category2\", ...}`. It must be unique in each group:category pair, otherwise you get `ARGUMENT_OBJECT_PARSE_ERROR`. There is a limit of three data category conditions, otherwise you get `INVALID_FILTER_VALUE`.", | ||
| optional: true, | ||
| }, | ||
| queryMethod: { | ||
| type: "string", | ||
| label: "Query Method", | ||
| description: "Only valid when categories are specified, defaults to `ABOVE_OR_BELOW`.", | ||
| optional: true, | ||
| options: [ | ||
| "AT", | ||
| "BELOW", | ||
| "ABOVE", | ||
| "ABOVE_OR_BELOW", | ||
| ], | ||
| }, | ||
| sort: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "Field to sort results by. Defaults to `LastPublishedDate` for query and relevance for search", | ||
| optional: true, | ||
| options: [ | ||
| "LastPublishedDate", | ||
| "CreatedDate", | ||
| "Title", | ||
| "ViewScore", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| q, | ||
| channel, | ||
| language, | ||
| categories, | ||
| queryMethod, | ||
| sort, | ||
| } = this; | ||
|
|
||
| const items = await app.paginate({ | ||
| resultsKey: "articles", | ||
| requester: app.getKnowledgeArticles, | ||
| requesterArgs: { | ||
| $, | ||
| headers: { | ||
| ...app._makeRequestHeaders(), | ||
| "Accept": "application/json", | ||
| "Accept-Language": language || "en-US", | ||
| }, | ||
| params: { | ||
| q, | ||
| channel, | ||
| categories, | ||
| queryMethod, | ||
| sort, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully fetched \`${items.length}\` articles`); | ||
|
|
||
| return items; | ||
| }, | ||
| }; |
42 changes: 42 additions & 0 deletions
42
...est_api/actions/get-knowledge-data-category-groups/get-knowledge-data-category-groups.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,42 @@ | ||
| import common from "../common/knowledge.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "salesforce_rest_api-get-knowledge-data-category-groups", | ||
| name: "Get Knowledge Data Category Groups", | ||
| description: "Fetch data category groups visible to the current user. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/resources_knowledge_support_dcgroups.htm)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| ...common.props, | ||
| topCategoriesOnly: { | ||
| type: "boolean", | ||
| label: "Top Categories Only", | ||
| description: "Return only top-level categories if `true`, entire tree if `false`.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| topCategoriesOnly, | ||
| language, | ||
| } = this; | ||
|
|
||
| const response = await app.getKnowledgeDataCategoryGroups({ | ||
| $, | ||
| params: { | ||
| sObjectName: "KnowledgeArticleVersion", | ||
| topCategoriesOnly, | ||
| }, | ||
| headers: { | ||
| ...app._makeRequestHeaders(), | ||
| "Accept": "application/json", | ||
| "Accept-Language": language || "en-US", | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully fetched \`${response.categoryGroups?.length || 0}\` data category groups`); | ||
| return response; | ||
| }, | ||
| }; |
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
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
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.