pd-spserverajax
v2.2.0
Published
<a name="module_pdspserverajax"></a>
Downloads
6
Maintainers
Readme
pdspserverajax
Author: "Jered McGlohon"
- pdspserverajax
- static
- .getContext(props) ⇒ promise.<object>
- .getData(url) ⇒ promise.<object>
- .getAllListResults(props) ⇒ promise.<Array.<object>>
- .getBatchMetered(props) ⇒ promise.<Array.<object>>
- .getBatchProfiles(props) ⇒ promise.<Array.<object>>
- .getListInfo(props) ⇒ promise.<object>
- .peopleSearch(props) ⇒ promise.<Array.<object>>
- .ensureUser(props) ⇒ promise.<object>
- .getSiteUserInfoByEmail(props) ⇒ promise.<object>
- .getItemsByCaml(props) ⇒ promise.<object>
- .getUserSitePermissions(props) ⇒ promise.<Array.<string>>
- .getUserListPermissions(props) ⇒ promise.<Array.<sting>>
- .getCurrentUserGroups(props) ⇒ promise.<Array.<sting>>
- .createItem(props) ⇒ promise.<object>
- .updateItem(props) ⇒ promise.<object>
- .deleteItem(props) ⇒ promise.<object>
- .recycleItem(props) ⇒ promise.<object>
- .getUserProfileData(props) ⇒ promise.<Array.<object>>
- .getListColumns(props) ⇒ promise.<object>
- .meteredCreateItems(props) ⇒ promise.<Array.<object>>
- .meteredUpdateItems(props) ⇒ promise.<Array.<object>>
- .meteredRecycleItems(props) ⇒ promise.<Array.<object>>
- inner
- ~itemCompletedProcessing : function
- ~itemPreProcessing : function
- static
pdspserverajax.getContext(props) ⇒ promise.<object>
Gets a context object for server requests. the key from response is FormDigestValue
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url |
pdspserverajax.getData(url) ⇒ promise.<object>
Get data from server using the REST endpoint
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | url | string | full odata url |
pdspserverajax.getAllListResults(props) ⇒ promise.<Array.<object>>
Gets all results for server requests. once the promise resolves you get an array of objects that are the servers response
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.select] | string | | | [props.filter] | string | | | [props.expand] | string | | | [props.top] | string | | | [props.orderBy] | string | |
pdspserverajax.getBatchMetered(props) ⇒ promise.<Array.<object>>
Gets all items requested in the getUrls property (batch request)
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | relative url of the site that contains the data | | props.getUrls | Array.<string> | full odata urls |
pdspserverajax.getBatchProfiles(props) ⇒ promise.<Array.<object>>
Get user profiles from the server (batch request)
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.profileEmails | Array.<string> | email addresses of the users you want profile data for |
pdspserverajax.getListInfo(props) ⇒ promise.<object>
Get list or library properties from server
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | a site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | |
pdspserverajax.peopleSearch(props) ⇒ promise.<Array.<object>>
Get user profile info from the SharePoint search service
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.query | string | query that is passed to search service, ex "'" + 'Bureau="'+ divisionName + '"'' | | [props.sourceId] | string | source id for the search service to use, defaults to the out of the box people source id | | props.properties | Array.<string> | specify which properties you want back from the request |
pdspserverajax.ensureUser(props) ⇒ promise.<object>
Checks if user is in the site collection user table
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.email | string | email address of the user to check |
pdspserverajax.getSiteUserInfoByEmail(props) ⇒ promise.<object>
Gets user info from the site collection user table
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.email | string | email address of the user to retrieve |
pdspserverajax.getItemsByCaml(props) ⇒ promise.<object>
Get request that uses CAML to filter results
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.query | string | CAML query | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | |
pdspserverajax.getUserSitePermissions(props) ⇒ promise.<Array.<string>>
Get a users permissions to a site
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.email | string | email of the user to get permissions for |
pdspserverajax.getUserListPermissions(props) ⇒ promise.<Array.<sting>>
Get a users permissions to a list or library
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | props.email | string | email of the user to check permission of |
pdspserverajax.getCurrentUserGroups(props) ⇒ promise.<Array.<sting>>
Gets the SharePoint groups that a user has been added to, identify the user by passing the id number of the user for the site.
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.userId | number | users site id number |
pdspserverajax.createItem(props) ⇒ promise.<object>
Creates a single item in a list
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.listName] | string | server name for the list | | props.infoToServer | object | object whos key is the column name and the value is what you want stored in that column |
pdspserverajax.updateItem(props) ⇒ promise.<object>
Updates a single item in a list
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.listName] | string | server name for the list | | [props.etag] | string | etag of the item to update | | props.itemId | number | id of the item to update | | props.infoToServer | object | object whos key is the column name and the value is what you want stored in that column |
pdspserverajax.deleteItem(props) ⇒ promise.<object>
Deletes a single item from a list or library be warned if you use this function, the item you delete will be gone and unrecoverable!!!!
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.etag] | string | etag of the item to update | | props.itemId | number | id of the item to delete |
pdspserverajax.recycleItem(props) ⇒ promise.<object>
Sends a single item to the recycle bin of the site collection
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | props.itemId | number | id of the item to recycle |
pdspserverajax.getUserProfileData(props) ⇒ promise.<Array.<object>>
Gets the profile information from the profile service if email is passed then that will be the profile data you get back if email is not passed you get current user profile data back
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | [props.email] | string | email of the user you want profile data for |
pdspserverajax.getListColumns(props) ⇒ promise.<object>
Get the columns of a list or library
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | |
pdspserverajax.meteredCreateItems(props) ⇒ promise.<Array.<object>>
Creates multiple items via REST, items array should contain object with a key of column name and property of value you want stored in that column ex. { Title: "something" }
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | props.items | Array.<object> | items to create | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.listName] | string | server name for the list | | [props.itemCreatedCB] | itemPreProcessing | this call back is called when an item is added to be processed | | [props.itemCompletedCB] | itemCompletedProcessing | this call back is called when item is completed |
pdspserverajax.meteredUpdateItems(props) ⇒ promise.<Array.<object>>
Updates multiple items via REST, items array should contain object with 2 properties itemId and updateInfo and 1 optional property etag ex. { itemId: 3, etag: ""3"" updateInfo: { Title: "example string" } }
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | props.items | Array.<object> | items to update | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.listName] | string | server name for the list | | [props.itemCreatedCB] | itemPreProcessing | this call back is called when an item is added to be processed | | [props.itemCompletedCB] | itemCompletedProcessing | this call back is called when item is completed |
pdspserverajax.meteredRecycleItems(props) ⇒ promise.<Array.<object>>
Recycles multiple items via REST
Kind: static method of pdspserverajax
| Param | Type | Description | | --- | --- | --- | | props | object | | | props.items | Array.<number> | ids of items to recycle | | [props.origin] | string | | | props.url | string | site relative url | | props.listGUID | string | use either listGUID or listTitle not both | | [props.listTitle] | string | | | [props.itemCreatedCB] | itemPreProcessing | this call back is called when an item is added to be processed | | [props.itemCompletedCB] | itemCompletedProcessing | this call back is called when item is completed |
pdspserverajax~itemCompletedProcessing : function
The processingCompletedCallback will be passed the order number and the process status (success or fail) to trigger any completed side effects The order number is your id to locate elements (dom or whatever) based on the specific item processing
Kind: inner typedef of pdspserverajax
| Param | Type | | --- | --- | | status | string | | index | number |
pdspserverajax~itemPreProcessing : function
The index and itemData to process will be passed to this function it MUST return a native promise. the order number is your id to locate elements (dom or whatever) based on the specific item processing
Kind: inner typedef of pdspserverajax
| Param | Type | | --- | --- | | itemData | any | | index | number |