Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gd-sprest

Package Overview
Dependencies
Maintainers
1
Versions
841
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gd-sprest - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

2

package.json
{
"name": "gd-sprest",
"version": "0.6.5",
"version": "0.6.6",
"description": "An easy way to develop against the SharePoint REST API.",

@@ -5,0 +5,0 @@ "author": "Gunjan Datta <me@dattabase.com> (https://github.com/gunjandatta/sprest)",

@@ -36,11 +36,4 @@ # SharePoint 2013/Online REST Library

### Execute on Creation
A global flag is used to determine if the request should be executed on creation. This option can save a request to the server.
*Note - This value is false by default.*
```
$REST.ExecuteOnCreationFl = true;
```
### Asynchronous/Synchronous requests
All objects have the following constructors [Object] and [Object]_Async.
All availabe objects having an api entry point, will have the following constructors [Object] and [Object]_Async.

@@ -50,4 +43,6 @@ #### Examples

```
(new Web_Async(function(web) { ... }))
.execute(function(obj) {
// Get the current web
(new Web_Async())
// Execute the request
.execute(function(web) {
// Code to execute after the request completes

@@ -59,8 +54,7 @@ });

```
$REST.ExecuteOnCreationFl = true;
var web = new Web();
var web = (new $REST.Web()).execute();
```
### Fewer Requests to the Server
Having the execute on creation boolean option, if set to false will construct the url of the base object without making a request to the server.
Having the ability to chain the 'Properties', it allows for the developer to get the target object with one request to the server.

@@ -70,6 +64,8 @@ #### Example - Creating a List

```
// This will create the web object, but not execute the request.
// This will create the web object
var list = (new $REST.Web())
// Get the list collection
.Lists()
// Create a list
.web.addList({
.add({
BaseTemplate: 100,

@@ -87,4 +83,6 @@ Description: "This is a test list.",

(new $REST.Web_Async())
// Get the list collection
.Lists()
// Create the list
.addList({
.add({
BaseTemplate: 100,

@@ -94,3 +92,3 @@ Description: "This is a test list.",

})
// This will execute after the list is created
// Execute the request
.execute(function(list) {

@@ -105,5 +103,7 @@ // Additional code goes here

var items = (new $REST.List("[List Name]"))
// Query using OData
.query({
// OData properties - Refer to the OData section for additional details
})
// Execute the request
.execute();

@@ -113,3 +113,5 @@

(new $REST.List("Site Assets"))
// Get the items by a CAML Query
.getItemsByQuery("<Query><Where><Gt><FieldRef Name='ID' /><Value Type='Integer'>0</Value></Gt></Where></Query>")
// Execute the request
.execute();

@@ -119,3 +121,5 @@

(new $REST.List("Site Assets"))
// Get the items by a CAML View Query
.getItems("<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>sprest.js</Value></Eq></Where></Query></View>")
// Execute the request
.execute();

@@ -127,10 +131,4 @@ ```

```
// The target information and execute request flags are optional
new Object([Object Specific Input Parameters], executeRequestFl);
// The target information is optional
new Object([Object Specific Input Parameters], targetInfo);
new Object([Object Specific Input Parameters], executeRequestFl, targetInfo);
// Asynchronous methods can take either a target information object, or the callback function
new Object_Async([Object Specific Input Parameters], executeRequestFl, targetInfo);
new Object_Async([Object Specific Input Parameters], function(obj) { ... }, executeRequestFl);
```

@@ -149,5 +147,2 @@

#### Execute Request Flag
The executeRequestFl parameter will default to the global $REST.ExecuteOnCreationFl value.
### PowerShell-Like Experience

@@ -171,4 +166,4 @@ Since the library can be executed synchronously, the user can execute commands in the browser's console window and interact with the SharePoint site in a command-line interface.

```
// Get the lists for the current web, but don't execute a request to the server
var list = new $REST.Lists(false)
// Get the current web's list collection
var list = (new $REST.List())
// Query for the 'Dev' list

@@ -182,4 +177,6 @@ .query({

```
// Get the 'Dev' list, but don't execute a request to the server
(new $REST.ListItems_Async("Dev", false))
// Get the 'Dev' list
(new $REST.List_Async("Dev"))
// Get the item collection
.Items()
// Query for my items, expanding the created by information

@@ -191,4 +188,4 @@ .query({

})
// Execute code after the request is complete
.execute(function(items:$REST.ListItems) {
// Execute the request
.execute(function(items) {
// Code goes here

@@ -257,6 +254,3 @@ });

var field = (new $REST.List("documents"))
.Fields()
.query({
Filter: ["InternalName eq 'Title'"]
})
.Fields("Title")
.execute();

@@ -268,6 +262,3 @@ ```

(new $REST.Web())
.Fields()
.query({
Filter: ["InternalName eq 'Title'"]
})
.Fields("Title")
.execute(function(field) {

@@ -301,9 +292,6 @@ // Additional code goes here

.RootFolder()
.getByUrl("Forms/EditForm.aspx")
.execute(function(folder) {
folder.Files()
.getByUrl('EditForm.aspx')
.execute(function(file) {
// Additional code goes here
});
.Folders("forms")
.Files("EditForm.aspx")
.execute(function(file) {
// Additional code goes here
})

@@ -316,7 +304,5 @@ ```

.RootFolder()
.getByUrl("Forms/EditForm.aspx")
.execute()
.Files()
.getByUrl('EditForm.aspx')
.execute();
.Folders("forms")
.Files("editform.aspx")
execute();
```

@@ -327,3 +313,3 @@

var file = (new $REST.Web())
.getFileByServerRelativeUrl("/sites/dev/shared documents/forms/EditForm.aspx")
.getFileByServerRelativeUrl("/sites/dev/shared documents/forms/editform.aspx")
.execute();

@@ -352,4 +338,3 @@ ```

var folder = (new $REST.List("Documents"))
.RootFolder()
.getByUrl("Forms")
.RootFolder("Forms")
.execute()

@@ -396,4 +381,3 @@ ```

var item = (new $REST.List("documents"))
.Items()
.getById(1)
.Items(1)
.execute();

@@ -400,0 +384,0 @@ ```

@@ -6,3 +6,2 @@ module $REST {

export var DefaultRequestToHostWebFl:boolean = false;
export var ExecuteOnCreationFl:boolean = false;
export var Library:any = {};

@@ -19,9 +18,6 @@ var SP:any;

/*********************************************************************************************************************************/
constructor(params:Settings.BaseSettings) {
constructor(targetInfo:Settings.TargetInfoSettings) {
// Default the properties
this.targetInfo = params.settings;
this.targetInfo = targetInfo || {};
this.requestType = 0;
// Default the properties
this.executeRequestFl = typeof(params.executeRequestFl) === "boolean" ? params.executeRequestFl : ExecuteOnCreationFl;
}

@@ -41,3 +37,3 @@

// The parent
public parent:Base;
public parent:any;

@@ -54,15 +50,2 @@ // The request type

// Method to execute after the asynchronous request completes
public done(callback:() => void) {
// See if the promise exists
if(this.promise) {
// Execute the callback
this.promise.done(callback);
}
else {
// Set the callback in the target information
this.targetInfo.callback = callback;
}
}
// Method to execute a child request

@@ -94,65 +77,13 @@ public execute(callback?:(...args) => void) {

// Method to get the input parameters for an asynchronous request
public static getAsyncInputParmeters(...args):Settings.BaseSettings {
// Get the input parameters
let params = Base.getInputParmeters.apply(null, args);
public static getAsyncInputParmeters(targetInfo?:Settings.TargetInfoSettings):Settings.TargetInfoSettings {
// Ensure the target information exists
targetInfo = targetInfo ? targetInfo : {};
// Set the asynchronous flag
params.settings.asyncFl = true;
targetInfo.asyncFl = true;
// Return the parameters
return params;
// Return the target information
return targetInfo;
}
// Method to get the input parameters
public static getInputParmeters(...args):Settings.BaseSettings {
let settings = null;
let params:Settings.BaseSettings = {
executeRequestFl: null,
settings: null
};
// Ensure arguments exist
if(args && args.length > 0) {
// Determine if this is an IBaseType
if(args.length == 1 && args[0].hasOwnProperty("executeRequestFl") && args[0].hasOwnProperty("settings")) {
// Return it
return args[0];
}
// See if the first parameter is the flag
if(typeof(args[0]) === "boolean") {
// Set the parameters
params.executeRequestFl = args[0];
settings = args[1];
}
else {
// Set the parameters
params.executeRequestFl = args[1];
settings = args[0];
}
}
// See if settings exist
if(settings) {
params.settings = {};
// See if it's a callback
if(typeof(settings) === "function") {
// Set the callback
params.settings.callback = settings;
}
else {
// Set the settings
params.settings = settings;
}
}
else {
// Create them
params.settings = {};
}
// Return the parameters
return params;
}
/*********************************************************************************************************************************/

@@ -162,5 +93,2 @@ // Private Variables

// Flag to determine if we should execute the request on creation
protected executeRequestFl:boolean;
// Flag to default the url to the current web url, site otherwise

@@ -230,5 +158,18 @@ protected defaultToWebFl:boolean;

let propType = propInfo.length > 1 ? propInfo[1] : null;
let subPropName = propInfo.length > 2 ? propInfo[2] : null;
let subPropType = propInfo.length > 3 ? propInfo[3] : null;
// Add the property
obj[propName] = new Function("executeRequestFl", "return this.getProperty('" + propName + "', '" + propType + "', executeRequestFl);");
// See if this property has a sub-property defined for it
if(propInfo.length == 4) {
// Update the ' char in the property name
subPropName = subPropName.replace(/'/g, "\\'");
// Add the property
obj[propName] = new Function("name",
"name = name ? '" + propName + subPropName + "'.replace(/\\[Name\\]/g, name) : null;" +
"return this.getProperty(name ? name : '" + propName + "', name ? '" + subPropType + "' : '" + propType + "');");
} else {
// Add the property
obj[propName] = new Function("return this.getProperty('" + propName + "', '" + propType + "');");
}
}

@@ -276,2 +217,15 @@

// Method to execute after the asynchronous request completes
protected done(callback:() => void) {
// See if the promise exists
if(this.promise) {
// Execute the callback
this.promise.done(callback);
}
else {
// Set the callback in the target information
this.targetInfo.callback = callback;
}
}
// Method to execute a method

@@ -326,3 +280,3 @@ protected executeMethod(methodName:string, methodConfig:Settings.MethodInfoSettings, args?:any) {

// Create a new object
let obj = new Base({ settings: targetInfo, executeRequestFl: this.executeRequestFl });
let obj = new Base(targetInfo);

@@ -333,5 +287,2 @@ // Set the parent and request type

// Execute the request
obj.executeRequestFl ? obj.execute() : null;
// Return the object

@@ -367,3 +318,3 @@ return obj;

// Create a new object
let obj = new Base({ settings: targetInfo, executeRequestFl: this.executeRequestFl });
let obj = new Base(targetInfo);

@@ -373,5 +324,2 @@ // Set the parent

// Execute the request
obj.executeRequestFl ? obj.execute() : null;
// Return the object

@@ -382,3 +330,3 @@ return obj;

// Method to return a property of this object
protected getProperty(propertyName:string, requestType?:string, executeRequestFl?:boolean) {
protected getProperty(propertyName:string, requestType?:string) {
// Copy the target information

@@ -404,7 +352,4 @@ let targetInfo = Object.create(this.targetInfo);

// Default the request flag
executeRequestFl = executeRequestFl == null ? this.executeRequestFl : executeRequestFl;
// Create a new object
let obj = new Base({ settings: targetInfo, executeRequestFl: executeRequestFl });
let obj = new Base(targetInfo);

@@ -414,4 +359,4 @@ // Set the parent

// Execute the request
obj.executeRequestFl ? obj.execute() : this.addMethods(obj, { __metadata: { type: requestType } });
// Add the methods
requestType ? this.addMethods(obj, { __metadata: { type: requestType } }) : null;

@@ -418,0 +363,0 @@ // Return the object

@@ -13,2 +13,3 @@ module $REST {

argNames: ["name"],
name: "",
requestType: Types.RequestType.PostWithArgs

@@ -15,0 +16,0 @@ },

@@ -32,12 +32,12 @@ declare module $REST.Types {

/**
* Gets the column (also known as field) references in the content type.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the column (also known as field) reference(s) in the content type.
* @param guid - (Optional) The guid of the field link.
*/
FieldLinks(executeRequestFl?:boolean): IFieldLinks;
FieldLinks(guid?:string): IFieldLinks;
/**
* Gets a value that specifies the collection of fields for the content type.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets field(s) for the content type.
* @param internalNameOrTitle - (Optional) The internal name or title of the field.
*/
Fields(executeRequestFl?:boolean): IFields;
Fields(internalNameOrTitle?:string): IField | IFields;

@@ -88,5 +88,4 @@ /** Gets or sets a value that specifies the content type group for the content type. */

* Gets a value that specifies the collection of workflow associations for the content type.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
WorkflowAssociations(executeRequestFl?:boolean): any;
WorkflowAssociations(): any;

@@ -93,0 +92,0 @@ /**

@@ -7,3 +7,3 @@ module $REST {

properties: [
"FieldLinks|fieldlinks", "Fields|fields", "WorkflowAssociations"
"FieldLinks|fieldlinks|('[Name]')|fieldlink", "Fields|fields|/getByInternalNameOrTitle('[Name]')|field", "WorkflowAssociations"
],

@@ -10,0 +10,0 @@

@@ -8,4 +8,4 @@ module $REST {

add: {
argNames: ["parameters"],
metadataType: "SP.ContentType",
name: "",
requestType: Types.RequestType.PostWithArgsInBody

@@ -12,0 +12,0 @@ },

@@ -27,6 +27,5 @@ declare module $REST.Settings {

* Constructor
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* @param targetInfo - (Optional) The target information.
*/
new(executeRequestFl?:boolean, targetInfo?:Settings.TargetInfoSettings): IEmail;
new(targetInfo?:Settings.TargetInfoSettings): IEmail;

@@ -33,0 +32,0 @@ /**

@@ -11,5 +11,5 @@ module $REST {

/*********************************************************************************************************************************/
constructor(...args) {
constructor(targetInfo?:Settings.TargetInfoSettings) {
// Call the base constructor
super(Base.getInputParmeters.apply(null, args));
super(targetInfo);

@@ -53,7 +53,7 @@ // Default the properties

/*********************************************************************************************************************************/
constructor(...args) {
constructor(targetInfo?:Settings.TargetInfoSettings) {
// Call the base constructor
super(Base.getAsyncInputParmeters.apply(null, args));
super(Base.getAsyncInputParmeters.apply(null, targetInfo));
}
}
}

@@ -10,2 +10,3 @@ module $REST {

metadataType: "SP.FieldLink",
name: "",
requestType: Types.RequestType.PostWithArgsInBody

@@ -12,0 +13,0 @@ },

@@ -10,2 +10,3 @@ module $REST {

metadataType: "SP.FieldCreationInformation",
name: "addField",
requestType: Types.RequestType.PostWithArgsInBody

@@ -12,0 +13,0 @@ },

@@ -12,11 +12,9 @@ declare module $REST.Types {

* Gets a value that specifies the user who added the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Author(executeRequestFl?:boolean): IUser;
Author(): IUser;
/**
* Gets a value that returns the user who has checked out the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
CheckedOutByUser(executeRequestFl?:boolean): IUser;
CheckedOutByUser(): IUser;

@@ -49,11 +47,9 @@ /** Gets a value that returns the comment used when a document is checked in to a document library. */

* Gets a value that specifies the list item field values for the list item corresponding to the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ListItemAllFields(executeRequestFl?:boolean): any;
ListItemAllFields(): any;
/**
* Gets a value that returns the user that owns the current lock on the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
LockedByUser(executeRequestFl?:boolean): IUser;
LockedByUser(): IUser;

@@ -68,5 +64,4 @@ /** Gets a value that specifies the major version of the file. */

* Gets a value that returns the user who last modified the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ModifiedBy(executeRequestFl?:boolean): IUser;
ModifiedBy(): IUser;

@@ -96,5 +91,4 @@ /** Gets the name of the file including the extension. */

* Gets a value that returns a collection of file version objects that represent the versions of the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Versions(executeRequestFl?:boolean): IFileVersions;
Versions(): IFileVersions;

@@ -101,0 +95,0 @@ /**

@@ -18,5 +18,4 @@ declare module $REST.Types {

* Gets a value that specifies the user that represents the creator of the file version.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
CreatedBy(executeRequestFl?:boolean): IUser;
CreatedBy(): IUser;

@@ -23,0 +22,0 @@ /** Gets the internal identifier for the file version. */

@@ -14,12 +14,12 @@ declare module $REST.Types {

/**
* Gets the collection of all files contained in the list folder. You can add a file to a folder by using the Add method on the folder’s FileCollection resource.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the file(s) contained in the folder.
* @param url - (Optional) The url of the file within the current folder.
*/
Files(executeRequestFl?:boolean): IFiles;
Files(url?:string): IFile | IFiles;
/**
* Gets the collection of list folders contained in the list folder.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the folder(s) contained in the list folder.
* @param url - (Optional) The url of the sub-folder within the current folder.
*/
Folders(executeRequestFl?:boolean): IFolders;
Folders(url?:string): IFolder | IFolders;

@@ -31,5 +31,4 @@ /** Gets a value that specifies the count of items in the list folder. */

* Specifies the list item field (2) values for the list item corresponding to the file.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ListItemAllFields(executeRequestFl?:boolean): any;
ListItemAllFields(): any;

@@ -41,11 +40,9 @@ /** Gets the name of the folder. */

* Gets the parent list folder of the folder.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ParentFolder(executeRequestFl?:boolean): IFolder;
ParentFolder(): IFolder;
/**
* Gets the collection of all files contained in the folder.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Properties(executeRequestFl?:boolean): any;
Properties(): any;

@@ -52,0 +49,0 @@ /** Gets the server-relative URL of the list folder. */

@@ -8,3 +8,4 @@ module $REST {

properties: [
"Files|files", "Folders|folders", "ListItemAllFields", "ParentFolder|folder", "Properties", "StorageMetrics"
"Files|files|/getByUrl('[Name]')|file", "Folders|folders|/getByUrl('[Name]')|folder", "ListItemAllFields",
"ParentFolder|folder", "Properties", "StorageMetrics"
],

@@ -11,0 +12,0 @@

module $REST {
/*********************************************************************************************************************************/
// Methods
// Library
/*********************************************************************************************************************************/
Library.folders = {
/*********************************************************************************************************************************/
// Properties
/*********************************************************************************************************************************/
properties: [
"Files|files|/getByUrl('[Name]')|file", "Folders|folders|/getByUrl('[Name]')|folder", "ListItemAllFields", "ParentFolder",
"Properties", "StorageMetrics"
],
/*********************************************************************************************************************************/
// Methods
/*********************************************************************************************************************************/
// Adds the folder that is located at the specified URL to the collection.

@@ -7,0 +19,0 @@ add: {

@@ -18,23 +18,19 @@ declare module $REST.Types {

* Gets or sets a value that indicates whether the request to join or leave the group can be accepted automatically.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AutoAcceptRequestToJoinLeave(executeRequestFl?:boolean): string;
AutoAcceptRequestToJoinLeave(): string;
/**
* Gets a value that indicates whether the current user can edit the membership of the group.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
CanCurrentUserEditMembership(executeRequestFl?:boolean): string;
CanCurrentUserEditMembership(): string;
/**
* Gets a value that indicates whether the current user can manage the group.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
CanCurrentUserManageGroup(executeRequestFl?:boolean): string;
CanCurrentUserManageGroup(): string;
/**
* Gets a value that indicates whether the current user can view the membership of the group.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
CanCurrentUserViewMembership(executeRequestFl?:boolean): string;
CanCurrentUserViewMembership(): string;

@@ -58,5 +54,4 @@ /** Gets or sets the description of the group. */

* Gets or sets the owner of the group which can be a user or another group assigned permissions to control security.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Owner(executeRequestFl?:boolean): IUser;
Owner(): IUser;

@@ -77,5 +72,4 @@ /** Gets the name for the owner of this group. */

* Gets a collection of user objects that represents all of the users in the group.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Users(executeRequestFl?:boolean): IUsers;
Users(): IUsers;

@@ -82,0 +76,0 @@ /**

@@ -9,2 +9,3 @@ module $REST {

metadataType: function(obj) { return obj.Parent && obj.Parent["ListItemEntityTypeFullName"] ? obj.Parent["ListItemEntityTypeFullName"] : "SP.ListItem" },
name: "",
requestType: Types.RequestType.PostWithArgsInBody

@@ -11,0 +12,0 @@ },

@@ -14,3 +14,3 @@ declare module $REST.Types {

* Gets a webpart by its id.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* @param id - The web part id.
*/

@@ -17,0 +17,0 @@ WebParts(id);

@@ -8,6 +8,6 @@ declare module $REST.Types {

* Constructor
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* @param listName - The name of the list.
* @param targetInfo - (Optional) The target information.
*/
new(executeRequestFl?:boolean, targetInfo?:Settings.TargetInfoSettings): IList;
new(listName:string, targetInfo?:Settings.TargetInfoSettings): IList;

@@ -29,11 +29,10 @@ /**

* Gets a value that specifies the override of the web application's BrowserFileHandling property at the list level. Represents an SP.BrowserFileHandling value: Permissive = 0; Strict = 1.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
BrowserFileHandling(executeRequestFl?:boolean): string;
BrowserFileHandling(): string;
/**
* Gets the content types that are associated with the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the content type(s) that are associated with the list.
* @param id - (Optional) The id of the content type.
*/
ContentTypes(executeRequestFl?:boolean): IContentTypes;
ContentTypes(id?:string, ): IContentType | IContentTypes;

@@ -48,5 +47,4 @@ /** Gets or sets a value that specifies whether content types are enabled for the list. */

* Gets the data source associated with the list, or null if the list is not a virtual list. Returns null if the HasExternalDataSource property is false.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DataSource(executeRequestFl?:boolean): string;
DataSource(): string;

@@ -58,29 +56,24 @@ /** Gets a value that specifies the default workflow identifier for content approval on the list. Returns an empty GUID if there is no default content approval workflow. */

* Gets a value that specifies the location of the default display form for the list. Clients specify a server-relative URL, and the server returns a site-relative URL
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DefaultDisplayFormUrl(executeRequestFl?:boolean): string;
DefaultDisplayFormUrl(): string;
/**
* Gets a value that specifies the URL of the edit form to use for list items in the list. Clients specify a server-relative URL, and the server returns a site-relative URL.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DefaultEditFormUrl(executeRequestFl?:boolean): string;
DefaultEditFormUrl(): string;
/**
* Gets a value that specifies the location of the default new form for the list. Clients specify a server-relative URL, and the server returns a site-relative URL.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DefaultNewFormUrl(executeRequestFl?:boolean): string;
DefaultNewFormUrl(): string;
/**
* Gets the default list view.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DefaultView(executeRequestFl?:boolean): IView;
DefaultView(): IView;
/**
* Gets the URL of the default view for the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DefaultViewUrl(executeRequestFl?:boolean): string;
DefaultViewUrl(): string;

@@ -101,11 +94,9 @@ /** Gets or sets a value that specifies the description of the list. */

* Gets a value that specifies the effective permissions on the list that are assigned to the current user.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
EffectiveBasePermissions(executeRequestFl?:boolean): any;
EffectiveBasePermissions(): any;
/**
* Gets a value that specifies the effective permissions on the list that are for the user interface.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
EffectiveBasePermissionsForUI(executeRequestFl?:boolean): any;
EffectiveBasePermissionsForUI(): any;

@@ -131,18 +122,17 @@ /** Gets or sets a value that specifies whether list item attachments are enabled for the list. */

/**
* Gets a value that specifies the collection of event receivers associated with the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the event receiver(s) associated with the list.
* @param id - (Optional) The id of the event receiver.
*/
EventReceivers(executeRequestFl?:boolean): any;
EventReceivers(id?:string): IEventReceiver | IEventReceivers;
/**
* Gets a value that specifies the collection of all fields in the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the field(s) in the list.
* @param internalNameOrTitle - (Optional) The internal name or title of the field.
*/
Fields(executeRequestFl?:boolean): IFields;
Fields(internalNameOrTitle?:string): IField | IFields;
/**
* Gets the object where role assignments for this object are defined. If role assignments are defined directly on the current object, the current object is returned.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
FirstUniqueAncestorSecurableObject(executeRequestFl?:boolean): string;
FirstUniqueAncestorSecurableObject(): string;

@@ -153,6 +143,6 @@ /** Gets or sets a value that indicates whether forced checkout is enabled for the document library. */

/**
* Gets a value that specifies the collection of all list forms in the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the list form(s) in the list.
* @param id - (Optional) The id of the form.
*/
Forms(executeRequestFl?:boolean): any;
Forms(id?:string): any;

@@ -164,5 +154,4 @@ /** Gets a value that specifies whether the list is an external list. */

* Gets a value that specifies whether the role assignments are uniquely defined for this securable object or inherited from a parent securable object.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
HasUniqueRoleAssignments(executeRequestFl?:boolean): any;
HasUniqueRoleAssignments(): any;

@@ -180,5 +169,4 @@ /** Gets or sets a Boolean value that specifies whether the list is hidden. If true, the server sets the OnQuickLaunch property to false. */

* Gets a value that specifies the information rights management settings.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
InformationRightsManagementSettings(executeRequestFl?:boolean): any;
InformationRightsManagementSettings(): any;

@@ -205,5 +193,4 @@ /** */

* Gets a value that indicates whether the list is designated as a default asset location for images or other files which the users upload to their wiki pages.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
IsSiteAssetsLibrary(executeRequestFl?:boolean): string;
IsSiteAssetsLibrary(): string;

@@ -214,6 +201,6 @@ /** Gets a value that specifies the number of list items in the list. */

/**
* Gets all the items in the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the list item(s) in the list.
* @param id - (Optional) The id of the list item.
*/
Items(executeRequestFl?:boolean): IListItems;
Items(id?:number): IListItem | IListItems;

@@ -237,11 +224,9 @@ /** Gets a value that specifies the last time a list item was deleted from the list. */

* Gets or sets a value that specifies whether the list appears on the Quick Launch of the site. If true, the server sets the Hidden property to false.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
OnQuickLaunch(executeRequestFl?:boolean): string;
OnQuickLaunch(): string;
/**
* Gets a value that specifies the site that contains the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ParentWeb(executeRequestFl?:boolean): any;
ParentWeb(): any;

@@ -252,18 +237,17 @@ /** Gets a value that specifies the server-relative URL of the site that contains the list. */

/**
* Gets the role assignments for the securable object.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the role assignment(s) for the securable object.
* @param id - (Optional) The role assignment id.
*/
RoleAssignments(executeRequestFl?:boolean): IRoleAssignments;
RoleAssignments(id?:string): IRoleAssignment | IRoleAssignments;
/**
* Gets the root folder that contains the files in the list and any related files.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the root folder or file in the list.
* @param url - (Optional) The url of the file within the root folder.
*/
RootFolder(executeRequestFl?:boolean): IFolder;
RootFolder(url?:string): IFile | IFolder;
/**
* Gets a value that specifies the list schema of the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
SchemaXml(executeRequestFl?:boolean): string;
SchemaXml(): string;

@@ -280,30 +264,27 @@ /** Gets a value that indicates whether folders can be created within the list. */

/**
* Gets a value that specifies the collection of all user custom actions for the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the user custom action(s) for the list.
* @param id - (Optional) The id of the user custom action.
*/
UserCustomActions(executeRequestFl?:boolean): IUserCustomActions;
UserCustomActions(id?:string): IUserCustomAction | IUserCustomActions;
/**
* Gets or sets a value that specifies the data validation criteria for a list item. Its length must be <= 1023.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ValidationFormula(executeRequestFl?:boolean): string;
ValidationFormula(): string;
/**
* Gets or sets a value that specifies the error message returned when data validation fails for a list item. Its length must be <= 1023.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ValidationMessage(executeRequestFl?:boolean): string;
ValidationMessage(): string;
/**
* Gets a value that specifies the collection of all public views on the list and personal views of the current user on the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the view(s) in the list.
* @param id - (Optional) The id of the view.
*/
Views(executeRequestFl?:boolean): IViews;
Views(id?:string): IView | IViews;
/**
* Gets a value that specifies the collection of all workflow associations for the list.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
WorkflowAssociations(executeRequestFl?:boolean): string;
WorkflowAssociations(): string;

@@ -310,0 +291,0 @@ /**

@@ -10,19 +10,12 @@ module $REST {

/*********************************************************************************************************************************/
constructor(listName:string, ...args) {
constructor(listName:string, targetInfo?:Settings.TargetInfoSettings) {
// Call the base constructor
super(Base.getInputParmeters.apply(null, args));
super(targetInfo);
// Default the properties
this.defaultToWebFl = true;
this.targetInfo.endpoint = "web/lists/getByTitle('" + listName + "')";
this.targetInfo.endpoint = "lists/getByTitle('" + listName + "')";
// See if we are executing the request
if(this.executeRequestFl) {
// Execute the request
this.execute();
}
else {
// Add the methods
this.addMethods(this, { __metadata: { type: "list" } } );
}
// Add the methods
this.addMethods(this, { __metadata: { type: "list" } } );
}

@@ -51,6 +44,8 @@ }

properties: [
"BrowserFileHandling", "ContentTypes|contenttypes", "CreatablesInfo", "DefaultView|view", "DescriptionResource",
"EventReceivers|eventreceivers", "Fields|fields", "FirstUniqueAncestorSecurableObject", "Forms", "InformationRightsManagementSettings",
"Items|items", "ParentWeb", "RoleAssignments|roleassignments", "RootFolder|folder", "Subscriptions", "TitleResource",
"UserCustomActions|usercustomactions", "Views|views", "WorkflowAssociations"
"BrowserFileHandling", "ContentTypes|contenttypes|([Name])|contenttype", "CreatablesInfo", "DefaultView|view",
"DescriptionResource", "EventReceivers|eventreceivers|('[Name]')|eventreceiver", "Fields|fields|/getByInternalNameOrTitle('[Name]')|field",
"FirstUniqueAncestorSecurableObject", "Forms|forms|('[Name]')|form", "InformationRightsManagementSettings",
"Items|items|([Name])|item", "ParentWeb", "RoleAssignments|roleassignments|([Name])|roleassignment",
"RootFolder|folder|/getByUrl('[Name]')|file", "Subscriptions", "TitleResource",
"UserCustomActions|usercustomactions|('[Name]')|usercustomaction", "Views|views||('[Name]')|view", "WorkflowAssociations"
],

@@ -57,0 +52,0 @@

@@ -12,17 +12,14 @@ declare module $REST.Types {

* Specifies the collection of attachments that are associated with the list item.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AttachmentFiles(executeRequestFl?:boolean): IAttachmentFiles;
AttachmentFiles(): IAttachmentFiles;
/**
* Gets a value that specifies the content type of the list item.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ContentType(executeRequestFl?:boolean): IContentType;
ContentType(): IContentType;
/**
* Gets a value that specifies the display name of the list item.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
DisplayName(executeRequestFl?:boolean): string;
DisplayName(): string;

@@ -37,23 +34,19 @@ /** Gets a value that specifies the effective permissions on the list item that are assigned to the current user. */

* Gets the values for the list item as HTML.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
FieldValuesAsHtml(executeRequestFl?:boolean): string;
FieldValuesAsHtml(): string;
/**
* Gets the list item's field values as a collection of string values.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
FieldValuesAsText(executeRequestFl?:boolean): string;
FieldValuesAsText(): string;
/**
* Gets the formatted values to be displayed in an edit form.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
FieldValuesForEdit(executeRequestFl?:boolean): string;
FieldValuesForEdit(): string;
/**
* Gets the file that is represented by the item from a document library.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
File(executeRequestFl?:boolean): IFile;
File(): IFile;

@@ -65,9 +58,7 @@ /** Gets a value that specifies whether the list item is a file or a list folder. Represents an SP.FileSystemObjectType value: Invalid = -1; File = 0; Folder = 1; Web = 2. */

* Gets the object where role assignments for this object are defined. If role assignments are defined directly on the current object, the current object is returned.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
FirstUniqueAncestorSecurableObject(executeRequestFl?:boolean): string;
FirstUniqueAncestorSecurableObject(): string;
/**
* Gets a folder object that is associated with a folder item.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/

@@ -78,5 +69,4 @@ Folder(): IFolder;

* Gets a value that specifies whether the role assignments are uniquely defined for this securable object or inherited from a parent securable object.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
HasUniqueRoleAssignments(executeRequestFl?:boolean): string;
HasUniqueRoleAssignments(): string;

@@ -88,11 +78,10 @@ /** Gets a value that specifies the list item identifier. */

* Gets the parent list that contains the list item.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ParentList(executeRequestFl?:boolean): IList;
ParentList(): IList;
/**
* Gets the role assignments for the securable object.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the role assignment(s) for the securable object.
* @param id - (Optional) The role assignment id.
*/
RoleAssignments(executeRequestFl?:boolean): IRoleAssignments;
RoleAssignments(id?:string): IRoleAssignment | IRoleAssignments;

@@ -99,0 +88,0 @@ /**

@@ -10,3 +10,3 @@ module $REST {

"File|file", "FirstUniqueAncestorSecurableObject", "Folder|folder", "GetDlpPolicyTip", "ParentList|list",
"RoleAssignments|roleassignments"
"RoleAssignments|roleassignments|roleassignments|([Name])|roleassignment"
],

@@ -13,0 +13,0 @@

@@ -9,3 +9,4 @@ module $REST {

metadataType: "SP.List",
requestType: Types.RequestType.PostWithArgs
name: "",
requestType: Types.RequestType.PostWithArgsInBody
},

@@ -12,0 +13,0 @@

@@ -12,5 +12,4 @@ declare module $REST.Types {

* Gets the user or group that corresponds to the Role Assignment.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Member(executeRequestFl?:boolean): any;
Member(): any;

@@ -22,5 +21,4 @@ /** The unique identifier of the role assignment. */

* Gets the collection of role definition bindings for the role assignment.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
RoleDefinitionBindings(executeRequestFl?:boolean): IRoleDefinitions;
RoleDefinitionBindings(): IRoleDefinitions;

@@ -27,0 +25,0 @@ /**

@@ -8,6 +8,6 @@ declare module $REST.Types {

* Constructor
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* @param url - (Optional) The site url.
* @param targetInfo - (Optional) The target information.
*/
new(executeRequestFl?:boolean, targetInfo?:Settings.TargetInfoSettings): ISite;
new(url?:string, targetInfo?:Settings.TargetInfoSettings): ISite;

@@ -40,12 +40,11 @@ /**

/**
* Provides event receivers for events that occur at the scope of the site collection.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
EventReceivers(executeRequestFl?:boolean): any;
* Gets the event receiver(s) associated with the site.
* @param id - (Optional) The id of the event receiver.
*/
EventReceivers(id?:string): IEventReceiver | IEventReceivers;
/**
* Gets a value that specifies the collection of the site collection features for the site collection that contains the site.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Features(executeRequestFl?:boolean): any;
Features(): any;

@@ -63,5 +62,4 @@ /** Gets the GUID that identifies the site collection. */

* Gets or sets the owner of the site collection. (Read-only in sandboxed solutions.)
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
Owner(executeRequestFl?:boolean): IUser;
Owner(): IUser;

@@ -79,5 +77,4 @@ /** Specifies the primary URI of this site collection, including the host name, port number, and path. */

* Gets a value that returns the top-level site of the site collection.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
RootWeb(executeRequestFl?:boolean): IWeb;
RootWeb(): IWeb;

@@ -112,6 +109,6 @@ /** Gets the server-relative URL of the root Web site in the site collection. */

/**
* Gets a value that specifies the collection of user custom actions for the site collection.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the user custom action(s) for the list.
* @param id - (Optional) The id of the user custom action.
*/
UserCustomActions(executeRequestFl?:boolean): IUserCustomActions;
UserCustomActions(id?:string): IUserCustomAction | IUserCustomActions;

@@ -118,0 +115,0 @@ /**

@@ -10,5 +10,5 @@ module $REST {

/*********************************************************************************************************************************/
constructor(...args) {
constructor(url?:string, targetInfo?:Settings.TargetInfoSettings) {
// Call the base constructor
super(Base.getInputParmeters(args));
super(targetInfo);

@@ -19,15 +19,14 @@ // Default the properties

// See if we are executing the request
if(this.executeRequestFl) {
// Execute the request
this.execute();
// See if the web url exists
if(url) {
// Set the settings
this.targetInfo.url = url;
}
else {
// Add the methods
this.addMethods(this, { __metadata: { type: "site" } } );
}
// Add the methods
this.addMethods(this, { __metadata: { type: "site" } } );
}
// Method to get the root web
public getRootWeb() { return new Web(this.targetInfo); }
public getRootWeb() { return new Web(null, this.targetInfo); }

@@ -45,5 +44,5 @@ // Method to determine if the current user has access, based on the permissions.

/*********************************************************************************************************************************/
constructor(...args) {
constructor(url?:string, ...args) {
// Call the base constructor
super(Base.getAsyncInputParmeters.apply(null, args));
super(url, Base.getAsyncInputParmeters.apply(null, args));
}

@@ -60,3 +59,4 @@ }

properties: [
"EventReceivers|eventreceivers", "Features", "Owner|user", "RootWeb|web", "UserCustomActions|usercustomactions"
"EventReceivers|eventreceivers|('[Name]')|eventreceiver", "Features", "Owner|user", "RootWeb|web",
"UserCustomActions|usercustomactions|('[Name]')|usercustomaction"
],

@@ -63,0 +63,0 @@

@@ -14,6 +14,6 @@ declare module $REST.Types {

/**
* Gets the collection of groups of which the user is a member.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* Gets the group(s) of which the user is a member.
* @param id - (Optional) The group id.
*/
Groups(executeRequestFl?:boolean): ISiteGroups;
Groups(id?:number): IGroup | ISiteGroups;

@@ -20,0 +20,0 @@ /** Gets a value that specifies the member identifier for the user or group. */

@@ -7,3 +7,3 @@ module $REST {

properties: [
"Groups|sitegroups"
"Groups|sitegroups|([Name])|group"
],

@@ -10,0 +10,0 @@

@@ -111,5 +111,4 @@ declare module $REST.Types {

* Gets a value that specifies the collection of fields in the list view.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
ViewFields(executeRequestFl?:boolean): IViewFields;
ViewFields(): IViewFields;

@@ -116,0 +115,0 @@ /** Gets or sets a value that specifies the joins that are used in the list view. If not null, the XML must conform to ListJoinsDefinition, as specified in [MS-WSSCAML]. */

@@ -9,2 +9,3 @@ module $REST {

metadataType: "SP.View",
name: "",
requestType: Types.RequestType.PostWithArgs

@@ -11,0 +12,0 @@ },

@@ -8,6 +8,6 @@ declare module $REST.Types {

* Constructor
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
* @param url - (Optional) The web url.
* @param targetInfo - (Optional) The target information.
*/
new(executeRequestFl?:boolean, targetInfo?:Settings.TargetInfoSettings): IWeb;
new(url?:string, targetInfo?:Settings.TargetInfoSettings): IWeb;

@@ -20,23 +20,19 @@ /**

* Specifies whether the current user can create declarative workflows. If not disabled on the Web application, the value is the same as the AllowCreateDeclarativeWorkflow property of the site collection. Default value: true.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AllowCreateDeclarativeWorkflowForCurrentUser(executeRequestFl?:boolean): any;
AllowCreateDeclarativeWorkflowForCurrentUser(): any;
/**
* Gets a value that specifies whether the current user is allowed to use a designer application to customize this site.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AllowDesignerForCurrentUser(executeRequestFl?:boolean): any;
AllowDesignerForCurrentUser(): any;
/**
* Gets a value that specifies whether the current user is allowed to edit the master page.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AllowMasterPageEditingForCurrentUser(executeRequestFl?:boolean): any;
AllowMasterPageEditingForCurrentUser(): any;
/**
* Gets a value that specifies whether the current user is allowed to revert the site to a default site template.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AllowRevertFromTemplateForCurrentUser(executeRequestFl?:boolean): any;
AllowRevertFromTemplateForCurrentUser(): any;

@@ -48,5 +44,4 @@ /** Gets a value that specifies whether the site allows RSS feeds. */

* Specifies whether the current user can save declarative workflows as a template. If not disabled on the Web application, the value is the same as the AllowSaveDeclarativeWorkflowAsTemplate property of the site collection. Default value: true.
* @param executeRequestFl - (Optional) True to execute the request to the server, false to construct the object only.
*/
AllowSaveDeclarativeWorkflowAsTemplateForCurrentUser(executeRequestFl?:boolean): any;
AllowSaveDeclarativeWorkflowAsTemplateForCurrentUser(): any;

@@ -57,3 +52,3 @@ /**

*/
AllowSavePublishDeclarativeWorkflowForCurrentUser(executeRequestFl?:boolean): any;
AllowSavePublishDeclarativeWorkflowForCurrentUser(): any;

@@ -64,3 +59,3 @@ /**

*/
AllProperties(executeRequestFl?:boolean): any;
AllProperties(): any;

@@ -74,3 +69,3 @@ /** The instance Id of the App Instance that this web represents. */

*/
AssociatedMemberGroup(executeRequestFl?:boolean): IGroup;
AssociatedMemberGroup(): IGroup;

@@ -81,3 +76,3 @@ /**

*/
AssociatedOwnerGroup(executeRequestFl?:boolean): IGroup;
AssociatedOwnerGroup(): IGroup;

@@ -88,3 +83,3 @@ /**

*/
AssociatedVisitorGroup(executeRequestFl?:boolean): IGroup;
AssociatedVisitorGroup(): IGroup;

@@ -95,3 +90,3 @@ /**

*/
AvailableContentTypes(executeRequestFl?:boolean): any;
AvailableContentTypes(): any;

@@ -102,3 +97,3 @@ /**

*/
AvailableFields(executeRequestFl?:boolean): any;
AvailableFields(): any;

@@ -109,6 +104,6 @@ /** Gets either the identifier (ID) of the site definition configuration that was used to create the site, or the ID of the site definition configuration from which the site template used to create the site was derived. */

/**
* Gets the collection of content types for the Web site.
* @param targetInfo - (Optional) The target information.
* Gets the content type(s) that are associated with the web.
* @param id - (Optional) The id of the content type.
*/
ContentTypes(executeRequestFl?:boolean): IContentTypes;
ContentTypes(id?:string): IContentType | IContentTypes;

@@ -122,3 +117,3 @@ /** Gets a value that specifies when the site was created. */

*/
CurrentUser(executeRequestFl?:boolean): IUser;
CurrentUser(): IUser;

@@ -135,3 +130,3 @@ /** Gets or sets the URL for a custom master page file to apply to the website. */

*/
DesignerDownloadUrlForCurrentUser(executeRequestFl?:boolean): any;
DesignerDownloadUrlForCurrentUser(): any;

@@ -145,3 +140,3 @@ /** Determines if the Document Library Callout's WAC previewers are enabled or not. */

*/
EffectiveBasePermissions(executeRequestFl?:boolean): string;
EffectiveBasePermissions(): string;

@@ -152,6 +147,6 @@ /** Gets or sets a Boolean value that specifies whether the Web site should use Minimal Download Strategy. */

/**
* Gets the collection of event receiver definitions that are currently available on the website.
* @param targetInfo - (Optional) The target information.
*/
EventReceivers(executeRequestFl?:boolean): any;
* Gets the event receiver(s) associated with the web.
* @param id - (Optional) The id of the event receiver.
*/
EventReceivers(id?:string): IEventReceiver | IEventReceivers;

@@ -162,15 +157,15 @@ /**

*/
Features(executeRequestFl?:boolean): any;
Features(): any;
/**
* Gets the collection of field objects that represents all the fields in the Web site.
* @param targetInfo - (Optional) The target information.
* Gets the field(s) in the web.
* @param internalNameOrTitle - (Optional) The internal name or title of the field.
*/
Fields(executeRequestFl?:boolean): IFields;
Fields(internalNameOrTitle?:string): IField | IFields;
/**
* Gets the collection of all first-level folders in the Web site.
* @param targetInfo - (Optional) The target information.
* Gets the folder(s) contained in the root folder.
* @param url - (Optional) The url of the sub-folder within the current folder.
*/
Folders(executeRequestFl?:boolean): IFolders;
Folders(url?:string): IFolder | IFolders;

@@ -187,12 +182,14 @@ /** Gets a value that specifies the site identifier for the site. */

/**
* Gets the collection of all lists that are contained in the Web site available to the current user based on the permissions of the current user.
* Gets the list(s) in the Web.
* @param name - (Optional) The list name.
* @param targetInfo - (Optional) The target information.
*/
Lists(executeRequestFl?:boolean): ILists;
Lists(): IList | ILists;
/**
* Gets a value that specifies the collection of list definitions and list templates available for creating lists on the site.
* Gets the list definition(s) and/or list template(s) available for creating lists on the site.
* @param name - (Optional) The list template form name.
* @param targetInfo - (Optional) The target information.
*/
ListTemplates(executeRequestFl?:boolean): any;
ListTemplates(name?:string): any;

@@ -206,3 +203,3 @@ /** Gets or sets the URL of the master page that is used for the website. */

*/
Navigation(executeRequestFl?:boolean): any;
Navigation(): any;

@@ -213,3 +210,3 @@ /**

*/
ParentWeb(executeRequestFl?:boolean): any;
ParentWeb(): any;

@@ -220,3 +217,3 @@ /**

*/
PushNotificationSubscribers(executeRequestFl?:boolean): any;
PushNotificationSubscribers(): any;

@@ -230,3 +227,3 @@ /** Gets or sets a value that specifies whether the Quick Launch area is enabled on the site. */

*/
RecycleBin(executeRequestFl?:boolean): any;
RecycleBin(): any;

@@ -240,15 +237,17 @@ /** Gets or sets a value that determines whether the recycle bin is enabled for the website. */

*/
RegionalSettings(executeRequestFl?:boolean): any;
RegionalSettings(): any;
/**
* Gets the collection of role definitions for the Web site.
* Gets the role definition(s) for the web.
* @param id - (Optional) The role definition id.
* @param targetInfo - (Optional) The target information.
*/
RoleDefinitions(executeRequestFl?:boolean): IRoleDefinitions;
RoleDefinitions(id?:number): IRoleDefinition | IRoleDefinitions;
/**
* Gets the root folder for the Web site.
* Gets the root folder or file in the web.
* @param url - (Optional) The url of the file within the root folder.
* @param targetInfo - (Optional) The target information.
*/
RootFolder(executeRequestFl?:boolean): IFolder;
RootFolder(url?:string): IFile | IFolder;

@@ -259,3 +258,3 @@ /**

*/
SaveSiteAsTemplateEnabled(executeRequestFl?:boolean): any;
SaveSiteAsTemplateEnabled(): any;

@@ -269,9 +268,10 @@ /** Gets or sets the server-relative URL for the Web site. */

*/
ShowUrlStructureForCurrentUser(executeRequestFl?:boolean): any;
ShowUrlStructureForCurrentUser(): any;
/**
* Gets the collection of groups for the site collection.
* Gets the site group(s) for the web.
* @param id - (Optional) The group id.
* @param targetInfo - (Optional) The target information.
*/
SiteGroups(executeRequestFl?:boolean): ISiteGroups;
SiteGroups(id?:number): IGroup | ISiteGroups;

@@ -282,3 +282,3 @@ /**

*/
SiteUserInfoList(executeRequestFl?:boolean): any;
SiteUserInfoList(): any;

@@ -289,3 +289,3 @@ /**

*/
SiteUsers(executeRequestFl?:boolean): IUsers;
SiteUsers(): IUsers;

@@ -296,3 +296,3 @@ /**

*/
SupportedUILanguageIds(executeRequestFl?:boolean): any;
SupportedUILanguageIds(): any;

@@ -306,3 +306,3 @@ /** Gets or sets a value that specifies whether the RSS feeds are enabled on the site. */

*/
ThemeInfo(executeRequestFl?:boolean): any;
ThemeInfo(): any;

@@ -325,6 +325,6 @@ /** Gets or sets the title for the Web site. */

/**
* Gets a value that specifies the collection of user custom actions for the site.
* @param targetInfo - (Optional) The target information.
* Gets the user custom action(s) for the web.
* @param id - (Optional) The id of the user custom action.
*/
UserCustomActions(executeRequestFl?:boolean): IUserCustomActions;
UserCustomActions(id?:string): IUserCustomAction | IUserCustomActions;

@@ -335,3 +335,3 @@ /**

*/
WebInfos(executeRequestFl?:boolean): any;
WebInfos(): any;

@@ -342,3 +342,3 @@ /**

*/
Webs(executeRequestFl?:boolean): IWebs;
Webs(): IWebs;

@@ -352,3 +352,3 @@ /** Gets the name of the site definition or site template that was used to create the site. */

*/
WorkflowAssociations(executeRequestFl?:boolean): any;
WorkflowAssociations(): any;

@@ -359,3 +359,3 @@ /**

*/
WorkflowTemplates(executeRequestFl?:boolean): any;
WorkflowTemplates(): any;

@@ -362,0 +362,0 @@ /**

module $REST {
/*********************************************************************************************************************************/
// Web
// The SPWeb object.
/*********************************************************************************************************************************/

@@ -11,5 +10,5 @@ export class Web extends Base {

/*********************************************************************************************************************************/
constructor(...args) {
constructor(url?:string, targetInfo?:Settings.TargetInfoSettings) {
// Call the base constructor
super(Base.getInputParmeters.apply(null, args));
super(targetInfo);

@@ -20,11 +19,10 @@ // Default the properties

// See if we are executing the request
if(this.executeRequestFl) {
// Execute the request
this.execute();
// See if the web url exists
if(url) {
// Set the settings
this.targetInfo.url = url;
}
else {
// Add the methods
this.addMethods(this, { __metadata: { type: "web" } } );
}
// Add the methods
this.addMethods(this, { __metadata: { type: "web" } } );
}

@@ -43,5 +41,5 @@

/*********************************************************************************************************************************/
constructor(...args) {
constructor(url?:string, ...args) {
// Call the base constructor
super(Base.getAsyncInputParmeters.apply(null, args));
super(url, Base.getAsyncInputParmeters.apply(null, args));
}

@@ -60,9 +58,12 @@ }

"AllProperties", "AppTiles", "AssociatedMemberGroup|group", "AssociatedOwnerGroup|group", "AssociatedVisitorGroup|group",
"Author|user", "AvailableContentTypes|contenttypes", "AvailableFields|fields", "ClientWebParts", "ContentTypes|contenttypes",
"CurrentUser|user", "DataLeakagePreventionStatusInfo", "DescriptionResource", "EventReceivers|eventreceivers", "Features",
"Fields|fields", "FirstUniqueAncestorSecurableObject", "Folders|folders", "Lists|lists", "ListTemplates", "Navigation",
"ParentWeb", "PushNotificationSubscribers", "RecycleBin", "RegionalSettings", "RoleAssignments|roleassignments",
"RoleDefinitions|roledefinitions", "RootFolder|folder", "SiteGroups|sitegroups", "SiteUserInfoList", "SiteUsers|users",
"ThemeInfo", "TitleResource", "UserCustomActions|usercustomactions", "WebInfos", "Webs|webs", "WorkflowAssociations",
"WorkflowTemplates"
"Author|user", "AvailableContentTypes|contenttypes", "AvailableFields|fields", "ClientWebParts",
"ContentTypes|contenttypes|('[Name]')|contenttype", "CurrentUser|user", "DataLeakagePreventionStatusInfo",
"DescriptionResource", "EventReceivers|eventreceivers|('[Name]')|eventreceiver", "Features",
"Fields|fields|/getByInternalNameOrTitle('[Name]')|field", "FirstUniqueAncestorSecurableObject",
"Folders|folders|/getByUrl('[Name]')|folder", "Lists|lists|/getByTitle('[Name]')|list",
"ListTemplates|listtemplates|('[Name]')|listtemplate", "Navigation", "ParentWeb", "PushNotificationSubscribers", "RecycleBin",
"RegionalSettings", "RoleAssignments|roleassignments|([Name])|roleassignment",
"RoleDefinitions|roledefinitions|([Name])|roledefinition", "RootFolder|folder|/getByUrl('[Name]')|file",
"SiteGroups|sitegroups|([Name])|group", "SiteUserInfoList", "SiteUsers|users", "ThemeInfo", "TitleResource",
"UserCustomActions|usercustomactions|('[Name]')|usercustomaction", "WebInfos", "Webs|webs", "WorkflowAssociations", "WorkflowTemplates"
],

@@ -69,0 +70,0 @@

@@ -1,14 +0,1 @@

declare module $REST.Settings {
/**
* Base Settings
*/
interface BaseSettings {
/** True to execute the request to the server, false to construct the object only. */
executeRequestFl?:boolean;
/** The target information settings. */
settings?:TargetInfoSettings;
}
}
declare module $REST.Types {

@@ -32,5 +19,2 @@ /**

/** Method executed after the asynchronous request completes. */
done(callback:(...args) => void);
/**

@@ -37,0 +21,0 @@ * Method to execute the request.

/// <reference path="../dist/sprest.d.ts" />
// Set the global flag
$REST.ExecuteOnCreationFl = true;
var log = document.querySelector("#log");

@@ -75,6 +72,8 @@ var LogType = {

// Create the content type
var web = new $REST.Web(null, false);
ct = web.addContentType({
Name: "SPRest" + SP.Guid.newGuid().toString()
});
var web = new $REST.Web();
var ct = web.ContentTypes()
.add({
Name: "SPRest" + SP.Guid.newGuid().toString()
})
.execute();

@@ -92,7 +91,6 @@ // Test

Group: "Dev"
});
}).execute();
// Read the content types
var cts = new $REST.ContentTypes();
ct = cts.getById(ct.Id.StringValue);
ct = (new $REST.Web()).ContentTypes(ct.Id.StringValue).execute();

@@ -106,6 +104,6 @@ // Test

// Get the test field
var field = new $REST.Field("SPRestText");
var field = (new $REST.Web()).Fields("SPRestText").execute();
if(!field.existsFl) {
// Create the test field
field = web.addFieldAsXml('<Field ID="{AA3AF8EA-2D8D-4345-8BD9-6017205F2212}" Name="SPRestText" StaticName="SPRestText" DisplayName="SPREST Test Text" Type="Text" />');
field = web.addFieldAsXml('<Field ID="{AA3AF8EA-2D8D-4345-8BD9-6017205F2212}" Name="SPRestText" StaticName="SPRestText" DisplayName="SPREST Test Text" Type="Text" />').execute();
}

@@ -120,3 +118,3 @@

// Add the field to the list
var listField = list.addFieldAsXml('<Field ID="{AA3AF8EA-2D8D-4345-8BD9-6017205F2212}" Name="SPRestText" StaticName="SPRestText" DisplayName="SPREST Test Text" Type="Text" />');
var listField = list.addFieldAsXml('<Field ID="{AA3AF8EA-2D8D-4345-8BD9-6017205F2212}" Name="SPRestText" StaticName="SPRestText" DisplayName="SPREST Test Text" Type="Text" />').execute();

@@ -133,3 +131,3 @@ // Test

// Add the field to the content type
var fieldLink = ct.addFieldLink({ FieldInternalName: field.InternalName });
var fieldLink = ct.addFieldLink({ FieldInternalName: field.InternalName }).execute();

@@ -143,3 +141,3 @@ // Test

// Add the content type to the list
var ctList = list.addAvailableContentType(ct.Id.StringValue);
var ctList = list.addAvailableContentType(ct.Id.StringValue).execute();

@@ -153,3 +151,3 @@ // Test

// Delete the content type from the list
ctList.delete();
ctList.delete().execute();

@@ -163,3 +161,3 @@ // Test

// Delete the content type
ct = ct.delete();
ct = ct.delete().execute();

@@ -173,3 +171,3 @@ // Test

// Delete the content type
field = field.delete();
field = field.delete().execute();

@@ -198,3 +196,3 @@ // Test

// Get this file
var file = new $REST.File(_spPageContextInfo.serverRequestPath);
var file = (new $REST.Web()).getFileByServerRelativeUrl(_spPageContextInfo.serverRequestPath).execute();

@@ -208,3 +206,3 @@ // Test

// Get the parent folder
var folder = new $REST.Folder(file.ServerRelativeUrl.substr(0, file.ServerRelativeUrl.length - file.Name.length - 1));
var folder = (new $REST.Web()).getFolderByServerRelativeUrl(file.ServerRelativeUrl.substr(0, file.ServerRelativeUrl.length - file.Name.length - 1)).execute();

@@ -218,3 +216,3 @@ // Test

// Create a sub-folder
var subFolder = folder.addSubFolder("Test");
var subFolder = folder.addSubFolder("Test").execute();

@@ -228,3 +226,3 @@ // Test

// Read the content types of this file
var fileContent = file.content();
var fileContent = file.content().execute();

@@ -243,3 +241,3 @@ // Test

// Copy the file
file = subFolder.addFile("test.aspx", true, buffer);
file = subFolder.addFile("test.aspx", true, buffer).execute();

@@ -253,3 +251,3 @@ // Test

// Delete the file
file = file.delete();
file = file.delete().execute();

@@ -263,3 +261,3 @@ // Test

// Delete the sub-folder
subFolder = subFolder.delete();
subFolder = subFolder.delete().execute();

@@ -278,8 +276,10 @@ // Test

// Create the list
var web = new $REST.Web(null, false);
list = web.addList({
BaseTemplate: 100,
Description: "This is a test list.",
Title: "SPRest" + SP.Guid.newGuid().toString()
});
var web = new $REST.Web();
var list = web.Lists()
.add({
BaseTemplate: 100,
Description: "This is a test list.",
Title: "SPRest" + SP.Guid.newGuid().toString()
})
.execute();

@@ -297,6 +297,6 @@ // Test

Description: "Updated description"
});
}).execute();
// Read the updated list
list = new $REST.List(list.Title);
list = new $REST.List(list.Title).execute();

@@ -319,3 +319,3 @@ // Test

// Delete the list
list = list.delete();
list = list.delete().execute();

@@ -342,3 +342,3 @@ // Test

Title: "New Item"
});
}).execute();
assert(item, "create", "existsFl", true);

@@ -352,6 +352,6 @@

Title: "Updated Item"
});
}).execute();
// Read the updated item
item = new $REST.ListItem(item.ID, list.Title);
item = (new $REST.List(list.Title)).Items(item.ID).execute();

@@ -365,3 +365,3 @@ // Test

// Delete the item
item = item.delete();
item = item.delete().execute();

@@ -389,3 +389,3 @@ // Test

Title: title
});
}).execute();

@@ -409,3 +409,3 @@ // Test

// Get the items
items = (new $REST.List(list.Title, false)).getItemsByQuery(caml);
items = (new $REST.List(list.Title, false)).getItemsByQuery(caml).execute();

@@ -412,0 +412,0 @@ // Test

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc