Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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: "sharepoint-create-folder",
name: "Create Folder",
description: "Create a new folder in SharePoint. [See the documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_post_children?view=odsp-graph-online)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/sharepoint/actions/create-item/create-item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "sharepoint-create-item",
name: "Create Item",
description: "Create a new item in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http)",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/sharepoint/actions/create-link/create-link.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sharepoint-create-link",
name: "Create Link",
description: "Create a sharing link for a DriveItem. [See the documentation](https://docs.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/sharepoint/actions/create-list/create-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "sharepoint-create-list",
name: "Create List",
description: "Create a new list in Microsoft Sharepoint. [See the documentation](https://learn.microsoft.com/en-us/graph/api/list-create?view=graph-rest-1.0&tabs=http)",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "sharepoint-download-file",
name: "Download File",
description: "Download a Microsoft Sharepoint file to the /tmp directory. [See the documentation](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http)",
version: "0.0.7",
version: "0.0.8",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "sharepoint-find-file-by-name",
name: "Find File by Name",
description: "Search for a file or folder by name. [See the documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_search)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
key: "sharepoint-get-excel-table",
name: "Get Excel Table",
description: "Retrieve a table from an Excel spreadsheet stored in Sharepoint [See the documentation](https://learn.microsoft.com/en-us/graph/api/table-range?view=graph-rest-1.0&tabs=http)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand All @@ -13,7 +13,7 @@
},
props: {
sharepoint,
alert: {

Check warning on line 16 in components/sharepoint/actions/get-excel-table/get-excel-table.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

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

Check warning on line 16 in components/sharepoint/actions/get-excel-table/get-excel-table.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop alert must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `Note: The table must exist within the Excel spreadsheet.
Expand Down
11 changes: 10 additions & 1 deletion components/sharepoint/actions/get-file-by-id/get-file-by-id.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "sharepoint-get-file-by-id",
name: "Get File by ID",
description: "Retrieves a file by ID. [See the documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand Down Expand Up @@ -39,12 +39,21 @@ export default {
],
description: "The file to retrieve. You can either search for the file here or provide a custom *File ID*.",
},
select: {
propDefinition: [
sharepoint,
"select",
],
},
},
async run({ $ }) {
const response = await this.sharepoint.getDriveItem({
$,
siteId: this.siteId,
fileId: this.fileId,
params: {
select: this.select,
},
});
$.export("$summary", `Successfully retrieved file with ID: ${this.fileId}`);
return response;
Expand Down
40 changes: 40 additions & 0 deletions components/sharepoint/actions/get-site/get-site.mjs
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;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "sharepoint-list-files-in-folder",
name: "List Files in Folder",
description: "Retrieves a list of the files and/or folders directly within a folder. [See the documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children)",
version: "0.0.2",
version: "0.0.3",
type: "action",
annotations: {
destructiveHint: false,
Expand Down Expand Up @@ -44,18 +44,37 @@ export default {
"excludeFolders",
],
},
select: {
propDefinition: [
sharepoint,
"select",
],
},
orderBy: {
type: "string",
label: "Order By",
description: "The field to order the results by",
default: "lastModifiedDateTime",
optional: true,
},
},
async run({ $ }) {
const params = {
select: this.select,
orderby: this.orderBy,
};
const response = this.folderId
? await this.sharepoint.listDriveItemsInFolder({
$,
driveId: this.driveId,
folderId: this.folderId,
params,
})
: await this.sharepoint.listDriveItems({
$,
siteId: this.siteId,
driveId: this.driveId,
params,
});
const values = this.excludeFolders
? response.value.filter(({ folder }) => !folder)
Expand Down
57 changes: 57 additions & 0 deletions components/sharepoint/actions/list-sites/list-sites.mjs
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 components/sharepoint/actions/search-files/search-files.mjs
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,
},
},
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 components/sharepoint/actions/search-sites/search-sites.mjs
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;
},
};
Loading