Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# SpRestLib

## JavaScript Library for SharePoint REST Web Services
## SharePoint REST Web Services JavaScript Library
Provides a clean, concise API that greatly simplifies asynchronous REST interaction with SharePoint. Easily read/write List
items (CRUD), execute REST calls, and gather site/user/group information. Enables rapid development of SharePoint Apps/Add-ins
using the JavaScript SharePoint App Model.
Expand Down Expand Up @@ -90,6 +90,8 @@ using the JavaScript SharePoint App Model.
- [Issues / Suggestions](#issues--suggestions)
- [Authentication](#authentication)
- [Bugs](#bugs)
- [Supported SharePoint Versions](#supported-sharepoint-versions)
- [Backwards Compatibility](#backwards-compatibility)
- [Special Thanks](#special-thanks)
- [License](#license)

Expand Down Expand Up @@ -206,6 +208,15 @@ When reporting issues, please include a code snippet or a link demonstrating the



**************************************************************************************************
# Supported SharePoint Versions

## Backwards Compatibility
*Does SpRestLib support SharePoint 2010 or 2007?*
Unfortunately, older versions cannot be supported. The SharePoint 2007/2010 API utilized SOAP web services with XML (`_vti_bin/lists.asmx` endpoints) while the current API uses a completely new (`_api/web/lists()` endpoint) backed by REST services.



**************************************************************************************************
# Special Thanks

Expand Down
59 changes: 59 additions & 0 deletions dist/sprestlib.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Type definitions for sprestlib v1.7.0
// Project: https://gitbrent.github.io/SpRestLib/
// Definitions by: Brent Ely <https://github.com/gitbrent/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace sprLib {
const version: string;

function baseUrl(): string;
function baseUrl(baseUrl: string): void;

function nodeConfig(options: object): void;

function renewSecurityToken(): void;

/**
* SharePoint List/Library API.
*
* @see \`{@link https://gitbrent.github.io/SpRestLib/docs/api-list.html }\`
* @since 1.0
*/
class list {
constructor(listName: string);
constructor(listGuid: string);
constructor(options: object);

cols(): object[];
info(): object[];
perms(): object[];

items(options: object): Promise<object[]>;
create(options: object): Promise<object[]>;
update(options: object): Promise<object[]>;
delete(options: object): Promise<number>;
recycle(options: object): Promise<number>;
}

function rest(options: object): Promise<object[]>;

class site {
constructor(siteUrl?: string);

info(): object[];
lists(): object[];
subsites(): object[];
perms(): object[];
roles(): object[];
groups(): object[];
users(): object[];
}

class user {
constructor(options?: object);

info(): Promise<object>;
groups(): object[];
profile(arrProfileKeys: object): object;
}
}
4 changes: 4 additions & 0 deletions dist/sprestlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ var NODEJS = false;
/**
* Get specified or all List/Library column values - optionally: filter, sort, limit
*
* @param options - array of column names
*
* Options:
*
* | property | type | reqd | description | example/allowed vals |
Expand Down Expand Up @@ -665,6 +667,8 @@ var NODEJS = false;
*
* @see: Field Ref.: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx
* @see: FieldTypes: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.fieldtype.aspx
* @see: DOCS: https://gitbrent.github.io/SpRestLib/docs/api-list.html
* @since 1.0
*/
_newList.items = function(inObj) {
var listGUID = '';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"gulp-uglify": "^3.0.0"
},
"main": "dist/sprestlib.js",
"types": "dist/sprestlib.d.ts",
"directories": {
"example": "example",
"lib": "dist"
Expand Down