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.3.7 to 0.3.9

2

package.json
{
"name": "gd-sprest",
"version": "0.3.7",
"version": "0.3.9",
"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)",

@@ -12,8 +12,32 @@ /// <reference path="../base.d.ts" />

constructor(serverRelativeUrl:string, listName?:string, ...args) {
var endpoint = "";
// Call the base constructor
super(Base.getInputParmeters.apply(null, args));
// See if the list name exists
if(listName) {
// Update the endpoint
endpoint = "/lists/getByTitle('" + listName + "')/rootfolder";
// Split the url
var url = serverRelativeUrl ? serverRelativeUrl.split("/") : [];
// Parse the folders
for(var i=0; i < url.length - 1; i++) {
// Update the endpoint
endpoint += "/folders/getByUrl('" + url[i] + "')";
}
// Add the file
endpoint += "/files/getByUrl('" + url[url.length-1] + "')";
}
else {
// Update the endpoint
endpoint += "/getFileByServerRelativeUrl('" + serverRelativeUrl + "')";
}
// Default the properties
this.defaultToWebFl = true;
this.targetInfo.endpoint = "web/" + (listName ? "lists/getByTitle('" + listName + "')/rootfolder/files/getByUrl('" : "getFileByServerRelativeUrl('") + serverRelativeUrl + "')";
this.targetInfo.endpoint = "web" + endpoint;

@@ -20,0 +44,0 @@ // See if we are executing the request

@@ -12,8 +12,39 @@ /// <reference path="../base.d.ts" />

constructor(serverRelativeUrl:string, listName?:string, ...args) {
var endpoint = "";
var getRootFolder = serverRelativeUrl == null || serverRelativeUrl == "" ? true : false;
// Call the base constructor
super(Base.getInputParmeters.apply(null, args));
// See if the list name exists
if(listName) {
// Update the endpoint
endpoint = "/lists/getByTitle('" + listName + "')";
}
// See if we are getting the root folder
if(getRootFolder || listName) {
// Update the endpoint
endpoint += "/rootfolder";
}
// See if the list name exists
if(listName) {
// Split the url
var url = serverRelativeUrl ? serverRelativeUrl.split("/") : [];
// Parse the url
for(var i=0; i < url.length; i++) {
// Update the endpoint
endpoint += "/folders/getByUrl('" + url[i] + "')";
}
}
else {
// Update the endpoint
endpoint += getRootFolder ? "" : "/getFolderByServerRelativeUrl('" + serverRelativeUrl + "')";
}
// Default the properties
this.defaultToWebFl = true;
this.targetInfo.endpoint = "web/" + (listName ? "lists/getByTitle('" + listName + "')/rootfolder/folders/getByUrl('" : "getFolderByServerRelativeUrl('") + serverRelativeUrl + "')";
this.targetInfo.endpoint = "web" + endpoint;

@@ -20,0 +51,0 @@ // See if we are executing the request

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