citz-imb-sp-utilities v1.3.2
SharePoint Utilities
utility methods/functions for use with SharePoint 2016. Depends on React.
Installation
npm install citz-imb-sp-utilities
PeoplePicker Usage
import { PeoplePicker } from 'citz-imb-sp-utilities'
const getUserInfo = () => {code...}
<PeoplePicker schema={{ PrincipalAccountType: "User | DL | SecGroup | SPGroup", SearchPrincipleSource: 15, ResolvePrincipalSource: 15, AllowMultipleValues: true | false, MaximumEntitySuggestions: 5, Width: "250px", SharePointGroupID: null | groupNumber }} elementName="_elementName" getUserInfo={getUserInfo} />
Method Usage
import { MethodName } from 'citz-imb-sp-utilities'
MethodName(parameters).then(response => {code...})
Parameters
Parameters in bold are required. Where an Id and a Name parameter are specified, usually only one is required, with Id being used if both are supplied.
- baseurl: a string the form of https://\<mydomain>/sites/\<mysite>. Default is the value of _spPageContextInfo.webAbsoluteUrl or _spPageContextInfo.siteAbsoluteUrl, as appropriate.
- bcc: an array of userAccounts in form of _i:0ǵ.t|bcgovidp|-
- body: a string. May contain html tags.
- cc: an array of userAccounts in form of i:0ǵ.t|bcgovidp|a32d6f859c66450ca4995b0b2bf0a###. a32d6f859c66450ca4995b0b2bf0a###_.
- clear: a boolean value.
- copy: a boolean value.
- expand: a string of comma-separated properties to expand
- filter: a string of comma-separated properties to filter
- groupDescription: a string.
- groupId: an integer.
- groupName: a string.
- itemIds: an array of integers. May also be a single integer.
- items: a json object.
- listGUID: a string in the form of a 529b7384-98bd-40c6-81e6-54a797###ec5.
- listName: a string.
- loginName: an array of userAccounts in form of i:0ǵ.t|bcgovidp|a32d6f859c66450ca4995b0b2bf0a###. May also be a string with a single userAccount
- ownerGroupId: an integer.
- ownerGroupName: a string.
- principalId: an integer.
- roleDefId: an integer
- select: a string of comma-separated properties to select
- subject: a string.
- to: an array of userAccounts in form of i:0ǵ.t|bcgovidp| a32d6f859c66450ca4995b0b2bf0a###.
- userId: an integer.
- viewGUID: a string in the form of a {529b7384-98bd-40c6-81e6-54a797###ec5}.
Methods
ContextInfo
- GetContextWebInformation(baseurl)
- GetFormDigestValue(baseurl)
- GetCurrentUser(baseurl)
- SendEmail({baseurl, to, cc, bcc, subject, body})
Groups
- AddUsersToGroup({baseurl, groupId, groupName, loginName})
- ChangeGroupOwner({baseurl, groupId, groupName, ownerGroupId, ownerGroupName})
- CreateGroup({baseurl, groupName, groupDescription})
- DeleteGroup({baseurl, groupId, groupName})
- GetAssociatedGroups(baseurl)
- GetGroup({baseurl, groupId, groupName})
- GetGroupMembers({baseurl, groupId, groupName})
- RemoveUsersFromGroup({baseurl, groupId, groupName, loginName, userId})
Lists
- AddItemsToList({baseurl, listName, listGUID, items})
- CreateList({baseurl, listName, allowContentTypes, baseTemplate, contentTypesEnabled, description})
- DeleteList({baseurl, listName, listGUID})
- GetList({baseurl, listName, listGUID, filter, expand, select})
- GetListDefaultView({baseurl, listName, listGUID})
- GetListFields({baseurl, listName, listGUID, filter, expand, select})
- GetListItems({baseurl, listName, listGUID, filter, expand, select})
- GetListViews({baseurl, listName, listGUID, viewGUID})
- RemoveItemsFromList({baseurl, listName, listGUID, itemIds})
- UpdateListItem({baseurl, listName, listGUID, items})
Permissions
- List
- AddPermissionsToList({baseurl, listName, listGUID, principalId, roleDefId})
- BreakListPermissionsInheritance({baseurl, listName, listGUID, copy, clear})
- GetListPermissions({baseurl, listName, listGUID})
- RemovePermissionsFromList({baseurl, listName, listGUID, principalId, roleDefId})
- Site
- AddPermissionsToSite({baseurl, principalId, roleDefId})
- BreakSitePermissionsInheritance({baseurl, copy, clear})
- GetSitePermissions(baseurl)
- RemovePermissionsFromSite({baseurl, principalId, roleDefId})
- ResetSitePermissionsInheritance(baseurl)
Sites
- GetSite({baseurl})
- GetRoleDefinitions({baseurl})
Users
- GetUser({baseurl, userId })
- GetUserGroups({baseurl, userId })
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago