Releases: gunjandatta/sprest
More Intellisense
This major update removes all intellisense files related to the SharePoint REST API. The gd-sprest-def library generates the interfaces for this library. The interfaces are generated from the $metadata endpoint in the SharePoint REST API.
This update may require some minor code updates, but only if you are referencing the types.
Please report any issues here.
Intellisense Updated
This release fixes minor bugs, but the main update has been the intellisense. The Types property is no longer there, so there may be a need to do some minor updates for imports.
import { Types.SP, Types.Helper } -> import { SP, Helper }
The intellisense has been updated to reduce the amount of functions and properties that are displayed.
Batch Request Updated
This release includes minor bug fixes and intellisense updates.
The batch request has been updated to include:
- Allow callback and appendFl to be set
- Added an XML parser for responses returning XML data
Permissions
This release adds the "hasPermissions" helper method. Refer to the permissions code examples for additional details on how to use it.
Intellisense Update
This release adds a reference to the gd-sprest-def library. This library takes the $metadata api endpoint in SharePoint and generates TypeScript definition files. This update removed about 20k lines of code that were used for the SharePoint intellisense, making it much easier to maintain.
This update will enhance the overall intellisense, since it includes much more information than we previous had.
Updating to the latest MAY require minor code updates. These updates can easily be done via a global search and replace. Most likely you will need to do a search and replace for "Helper.Types" to "Types.Helper".
Please post issues here, and they will be fixed within 24-48 hours.
Reject Added to Execution
This release includes minor bug fixes and intellisense updates. Along with these, the "execute" method adds the "reject" method, for requests that are not successful. Existing code does not need to be updated, it will still support the following ways:
- execute(resolve)
- execute(boolean)
- execute(resolve, boolean)
- execute(resolve, reject, boolean)
Refer to the request execution documentation for additional information.
Activate & Deactivate Site/Web Features
This release adds the ability to activate and deactivate web/site features, along with minor updates and bug fixes.
- Activate/Deactivate web/site features
- Major Bug Fix - List Item updates aren't working
- Added the "JSLink" & "ReadOnly" property to the SPConfiguration Field generator
New Helper Methods
This release adds new "Helper" methods:
- createDocSet - Creates a document set item using the _vti_bin/listdata.svc endpoint.
- request - A generic method for executing requests using the XMLHttpRequest object.
WebPack Externals
This major release fixes issue 166, related to the library not working as an external library in webpack. The webpack configuration for the gd-sprest and gd-sprest-js libraries can be configured as:
webpack.config.js
// WebPack Config
module.exports = {
// External Libs
externals: {
"gd-sprest": "$REST",
"gd-sprest-js": "$REST.JS"
}
}
The libraries have been updated to match the $REST global variable, which will require code updates for existing solutions. The code update is very minimal and straight forward. The libraries no longer require the "new" instance, for example:
TypeScript
import { List } from "gd-sprest";
// Old Way
(new List("Style Library")).Items().execute(items => {
// Code goes here
});
// New Way
List("Style Library").Items().execute(items => {
// Code goes here
});
New Helper Method "Executor"
Executor Helper Method
This release brings a new helper class for executing methods. Documentation has been provided to give an overview with code examples.
Updated Taxonomy Helper Class
The taxonomy helper class has been updated to include getting groups and term sets for a specified group.
Updated WebPart Helper Class
The webpart helper class has been updated to include a static method for adding webparts to a webpart page.
Update SPTypes
The SPTypes enumerator has been updated to include the web template types.