-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Sharepoint - new components & updates #19761
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
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7c3346f
new components & updates
michelle0927 b77c366
versions
michelle0927 04cb133
Merge branch 'master' into issue-19743
michelle0927 08c50a2
package.json
michelle0927 58a58bb
versions
michelle0927 53f24e5
updates
michelle0927 0d2b800
Merge branch 'master' into issue-19743
michelle0927 18b2397
versions
michelle0927 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import sharepoint from "../../sharepoint.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sharepoint-get-site", | ||
| name: "Get Site", | ||
| description: "Get a site in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0&tabs=http)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| sharepoint, | ||
| siteId: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "siteId", | ||
| ], | ||
| }, | ||
| select: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "select", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.sharepoint.getSite({ | ||
| $, | ||
| siteId: this.siteId, | ||
| params: { | ||
| select: this.select, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved site with ID: ${this.siteId}`); | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import sharepoint from "../../sharepoint.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sharepoint-list-sites", | ||
| name: "List Sites", | ||
| description: "List all sites in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/site-list?view=graph-rest-1.0&tabs=http)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| sharepoint, | ||
| select: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "select", | ||
| ], | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const sites = []; | ||
| let count = 0; | ||
|
|
||
| const results = this.sharepoint.paginate({ | ||
| fn: this.sharepoint.listAllSites, | ||
| args: { | ||
| $, | ||
| params: { | ||
| select: this.select, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| for await (const site of results) { | ||
| sites.push(site); | ||
| count++; | ||
| if (this.maxResults && count >= this.maxResults) { | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| $.export("$summary", `Successfully listed ${count} site${count === 1 | ||
| ? "" | ||
| : "s"}`); | ||
|
|
||
| return sites; | ||
| }, | ||
| }; |
84 changes: 84 additions & 0 deletions
84
components/sharepoint/actions/search-files/search-files.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,84 @@ | ||
| import sharepoint from "../../sharepoint.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sharepoint-search-files", | ||
| name: "Search Files", | ||
| description: "Search for files in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0&tabs=http)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| sharepoint, | ||
| queryString: { | ||
| type: "string", | ||
| label: "Query String", | ||
| description: "The search query containing the search terms", | ||
| }, | ||
| queryTemplate: { | ||
| type: "string", | ||
| label: "Query Template", | ||
| description: "Provides a way to decorate the query string. Supports both KQL and query variables. Example: `({searchTerms}) AuthorOWSUSER:Adventure` [See the documentation](https://learn.microsoft.com/en-us/graph/search-concept-query-template) for more information.", | ||
| optional: true, | ||
| }, | ||
| select: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "select", | ||
| ], | ||
| }, | ||
| size: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "maxResults", | ||
| ], | ||
| max: 500, | ||
| }, | ||
| sortField: { | ||
| type: "string", | ||
| label: "Sort Field", | ||
| description: "The field to sort the results by", | ||
| default: "lastModifiedDateTime", | ||
| optional: true, | ||
| }, | ||
| descending: { | ||
| type: "boolean", | ||
| label: "Descending", | ||
| description: "Whether to sort the results in descending order", | ||
| optional: true, | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.sharepoint.searchQuery({ | ||
| $, | ||
| data: { | ||
| requests: [ | ||
| { | ||
| entityTypes: [ | ||
| "driveItem", | ||
| ], | ||
| query: { | ||
| queryString: this.queryString, | ||
| queryTemplate: this.queryTemplate, | ||
| }, | ||
| fields: this.select | ||
| ? this.select.split(",").map((f) => f.trim()) | ||
| : undefined, | ||
| size: this.size, | ||
| sortProperties: [ | ||
| { | ||
| name: this.sortField, | ||
| isDescending: this.descending, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully searched for ${this.queryString}`); | ||
| return response; | ||
| }, | ||
| }; | ||
63 changes: 63 additions & 0 deletions
63
components/sharepoint/actions/search-sites/search-sites.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,63 @@ | ||
| import sharepoint from "../../sharepoint.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sharepoint-search-sites", | ||
| name: "Search Sites", | ||
| description: "Search for sites in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/site-search?view=graph-rest-1.0&tabs=http)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| sharepoint, | ||
| query: { | ||
| type: "string", | ||
| label: "Query", | ||
| description: "The query to search for", | ||
| }, | ||
| select: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "select", | ||
| ], | ||
| }, | ||
| maxResults: { | ||
| propDefinition: [ | ||
| sharepoint, | ||
| "maxResults", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const sites = []; | ||
| let count = 0; | ||
|
|
||
| const results = this.sharepoint.paginate({ | ||
| fn: this.sharepoint.listAllSites, | ||
| args: { | ||
| $, | ||
| params: { | ||
| search: this.query, | ||
| select: this.select, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| for await (const site of results) { | ||
| sites.push(site); | ||
| count++; | ||
| if (this.maxResults && count >= this.maxResults) { | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| $.export("$summary", `Successfully listed ${count} site${count === 1 | ||
| ? "" | ||
| : "s"}`); | ||
|
|
||
| return sites; | ||
| }, | ||
| }; |
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.