gd-sprest
Advanced tools
Comparing version 0.9.4 to 0.9.5
{ | ||
"name": "gd-sprest", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"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)", |
@@ -33,5 +33,2 @@ declare module $REST.Types { | ||
execute(callback?:(...args) => any): IBase; | ||
execute<IList>(callback?:(...args) => any): IList; | ||
execute<ISite>(callback?:(...args) => any): ISite; | ||
execute<IWeb>(callback?:(...args) => any): IWeb; | ||
@@ -43,5 +40,2 @@ /** | ||
execute(waitFl:boolean): IBase; | ||
execute<IList>(waitFl:boolean): IList; | ||
execute<ISite>(waitFl:boolean): ISite; | ||
execute<IWeb>(waitFl:boolean): IWeb; | ||
@@ -54,5 +48,2 @@ /** | ||
execute(callback:any, waitFl:boolean): IBase; | ||
execute<IList>(callback:any, waitFl:boolean): IList; | ||
execute<ISite>(callback:any, waitFl:boolean): ISite; | ||
execute<IWeb>(callback:any, waitFl:boolean): IWeb; | ||
@@ -63,6 +54,3 @@ /** | ||
executeAndWait(): IBase; | ||
executeAndWait<IList>(): IList; | ||
executeAndWait<ISite>(): ISite; | ||
executeAndWait<IWeb>(): IWeb; | ||
} | ||
} |
@@ -32,8 +32,2 @@ declare module $REST.Settings { | ||
/** | ||
* Constructor | ||
* @param targetInfo - (Optional) The target information. | ||
*/ | ||
new(targetInfo?:Settings.TargetInfoSettings): IEmail; | ||
/** | ||
* Properties | ||
@@ -40,0 +34,0 @@ */ |
@@ -25,6 +25,6 @@ declare module $REST.Types { | ||
* Constructor | ||
* @param url - The optional url to execute the search against. | ||
* @param settings - The search settings. | ||
* @param targetInfo - (Optional) The target information. | ||
*/ | ||
new(url?:string, targetInfo?:Settings.TargetInfoSettings): ISearch; | ||
new(url?:string, settings?:Settings.TargetInfoSettings): ISearch; | ||
@@ -31,0 +31,0 @@ /** |
@@ -6,3 +6,3 @@ module $REST { | ||
/*********************************************************************************************************************************/ | ||
export class Email extends Base { | ||
class _Email extends Base { | ||
@@ -56,2 +56,3 @@ /*********************************************************************************************************************************/ | ||
} | ||
export let Email = new _Email(); | ||
} |
@@ -5,10 +5,117 @@ module $REST { | ||
/*********************************************************************************************************************************/ | ||
Library.peoplemanager = {}; | ||
Library.peoplemanager[Types.RequestType.Get] = [ | ||
"amlFollowedBy", "amlFollowing", "getFollowedTags", "getFollowersFor", "getMyFollowers", "getMyProperties", "getMySuggestions", | ||
"getPeopleFollowedBy", "getPeopleFollowedByMe", "getPropertiesFor", "getUserProfilePropertyFor" | ||
]; | ||
Library.peoplemanager[Types.RequestType.GetAppendMethodToEndPoint] = ["getTrendingTags", "isFollowing"]; | ||
Library.peoplemanager[Types.RequestType.Post] = ["follow", "followTag", "hideSuggestion", "stopFollowing", "stopFollowingTag"]; | ||
Library.peoplemanager[Types.RequestType.PostDataInBody] = ["setMyProfilePicture"]; | ||
} | ||
export class PeopleManager extends Base { | ||
/*********************************************************************************************************************************/ | ||
// Constructor | ||
/*********************************************************************************************************************************/ | ||
constructor(targetInfo?:Settings.TargetInfoSettings) { | ||
// Call the base constructor | ||
super(targetInfo); | ||
// Default the properties | ||
this.defaultToWebFl = true; | ||
this.responses = []; | ||
this.targetInfo.endpoint = "sp.userprofiles.peoplemanager"; | ||
// Add the methods | ||
this.addMethods(this, { __metadata: { type: "peoplemanager" } } ); | ||
} | ||
} | ||
/*********************************************************************************************************************************/ | ||
// Methods | ||
/*********************************************************************************************************************************/ | ||
Library.peoplemanager = { | ||
amIFollowedBy:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
amIFollowing:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
follow:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.PostWithArgsInQS | ||
}, | ||
followTag:{ | ||
argNames: ["id"], | ||
requestType: Types.RequestType.PostWithArgsValueOnly | ||
}, | ||
getFollowedTags:{ | ||
argNames: ["maxCount"], | ||
requestType: Types.RequestType.GetWithArgsValueOnly | ||
}, | ||
getFollowersFor:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
getMyFollowers:{ | ||
requestType: Types.RequestType.Get | ||
}, | ||
getMyProperties:{ | ||
requestType: Types.RequestType.Get | ||
}, | ||
getMySuggestions:{ | ||
requestType: Types.RequestType.Get | ||
}, | ||
getPeopleFollowedBy:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
getPeopleFollowedByMe:{ | ||
requestType: Types.RequestType.Get | ||
}, | ||
getPropertiesFor:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
getTrendingTags:{ | ||
name: "sp.userprofiles.peoplemanager.gettrendingtags", | ||
replaceEndpointFl: true, | ||
requestType: Types.RequestType.Get | ||
}, | ||
getUserProfilePropertyFor:{ | ||
argNames: ["accountName", "propertyName"], | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
hideSuggestion:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.PostWithArgsInQS | ||
}, | ||
isFollowing:{ | ||
argNames: ["possibleFollowerAccountName", "possibleFolloweeAccountName"], | ||
name: "sp.userprofiles.peoplemanager.isfollowing", | ||
replaceEndpointFl: true, | ||
requestType: Types.RequestType.GetWithArgsInQS | ||
}, | ||
setMyProfilePicture:{ | ||
requestType: Types.RequestType.PostWithArgsInBody | ||
}, | ||
stopFollowing:{ | ||
argNames: ["accountName"], | ||
requestType: Types.RequestType.PostWithArgsInQS | ||
}, | ||
stopFollowingTag:{ | ||
argNames: ["id"], | ||
requestType: Types.RequestType.PostWithArgsValueOnly | ||
}, | ||
} | ||
} |
module $REST { | ||
/*********************************************************************************************************************************/ | ||
// Profile Loader | ||
/*********************************************************************************************************************************/ | ||
export class ProfileLoader extends Base { | ||
/*********************************************************************************************************************************/ | ||
// Constructor | ||
/*********************************************************************************************************************************/ | ||
constructor(targetInfo?:Settings.TargetInfoSettings) { | ||
// Call the base constructor | ||
super(targetInfo); | ||
// Default the properties | ||
this.defaultToWebFl = true; | ||
this.responses = []; | ||
this.targetInfo.endpoint = "sp.userprofiles.profileloader.getprofileloader"; | ||
this.targetInfo.method = "POST"; | ||
// Add the methods | ||
this.addMethods(this, { __metadata: { type: "profileloader" } } ); | ||
} | ||
} | ||
/*********************************************************************************************************************************/ | ||
// Methods | ||
/*********************************************************************************************************************************/ | ||
Library.profileloader = { | ||
//Library.[Types.RequestType.Post] = ["getOwnerUserProfile", "getUserProfile"]; | ||
//Library.profileloader[Types.RequestType.PostDataInBody] = ["createPersonalSiteEnqueueBulk"]; | ||
createPersonalSiteEnqueueBulk:{ | ||
argNames: ["emailIDs"], | ||
requestType: Types.RequestType.PostWithArgsInBody | ||
}, | ||
getOwnerUserProfile:{ | ||
name: "sp.userprofiles.profileloader.getowneruserprofile", | ||
replaceEndpointFl: true, | ||
requestType: Types.RequestType.Post, | ||
returnType: "userprofile" | ||
}, | ||
getUserProfile:{ | ||
requestType: Types.RequestType.Post, | ||
returnType: "userprofile" | ||
}, | ||
}; | ||
} |
@@ -5,7 +5,45 @@ module $REST { | ||
/*********************************************************************************************************************************/ | ||
Library.userprofile = {}; | ||
Library.userprofile[Types.RequestType.Post] = ["createPersonalSiteEnque", "shareAllSocialData"]; | ||
Library.userprofile[Types.RequestType.Custom] = [ | ||
{ name: "getOneDriveUrl", "function": function () { return this.FollowPersonalSiteUrl + "_layouts/15/onedrive.aspx" } } | ||
]; | ||
export class UserProfile extends Base { | ||
/*********************************************************************************************************************************/ | ||
// Constructor | ||
/*********************************************************************************************************************************/ | ||
constructor(targetInfo?:Settings.TargetInfoSettings) { | ||
// Call the base constructor | ||
super(targetInfo); | ||
// Default the properties | ||
this.defaultToWebFl = true; | ||
this.responses = []; | ||
this.targetInfo.endpoint = "sp.userprofiles.profileloader.getprofileloader/getUserProfile"; | ||
this.targetInfo.method = "POST"; | ||
// Add the methods | ||
this.addMethods(this, { __metadata: { type: "userprofile" } } ); | ||
} | ||
} | ||
/*********************************************************************************************************************************/ | ||
// Methods | ||
/*********************************************************************************************************************************/ | ||
Library.userprofile = { | ||
/*********************************************************************************************************************************/ | ||
// Properties | ||
/*********************************************************************************************************************************/ | ||
properties: [ | ||
"PersonalSite|site" | ||
], | ||
/*********************************************************************************************************************************/ | ||
// Methods | ||
/*********************************************************************************************************************************/ | ||
createPersonalSiteEnque: { | ||
requestType: Types.RequestType.PostWithArgsValueOnly | ||
}, | ||
shareAllSocialData: { | ||
requestType: Types.RequestType.PostWithArgsValueOnly | ||
} | ||
} | ||
} |
@@ -9,9 +9,12 @@ module $REST.Types { | ||
OData = 3, | ||
// Get Requests | ||
Get = 10, | ||
GetWithArgs = 11, | ||
GetWithArgsInBody = 12, | ||
GetWithArgsInQS = 13, | ||
GetWithArgsValueOnly = 14, | ||
GetReplace = 15, | ||
GetBuffer = 11, | ||
GetWithArgs = 12, | ||
GetWithArgsInBody = 13, | ||
GetWithArgsInQS = 14, | ||
GetWithArgsValueOnly = 15, | ||
GetReplace = 16, | ||
// Post Requests | ||
@@ -24,13 +27,3 @@ Post = 20, | ||
PostReplace = 25, | ||
// Remove if no longer needed | ||
GetAppendMethodToEndPoint = 30, | ||
GetBuffer = 31, | ||
GetDataAsParameter = 32, | ||
GetDataInBody = 33, | ||
GetDataInBodyNoArgs = 34, | ||
PostAppendMethodToEndPoint = 35, | ||
PostDataAsParameter = 36, | ||
PostDataInBody = 37, | ||
PostDataInBodyNoArgs = 38 | ||
} | ||
} |
@@ -616,2 +616,15 @@ module $REST.Types { | ||
/** | ||
* Personal Site Capabilities | ||
*/ | ||
export enum PersonalSiteCapabilities { | ||
Education = 16, | ||
Guest = 32, | ||
MyTasksDashboard = 8, | ||
None = 0, | ||
Profile = 1, | ||
Social = 2, | ||
Storage = 4 | ||
} | ||
/** | ||
* Reordering Rule Match Types | ||
@@ -618,0 +631,0 @@ */ |
/// <reference path="../dist/sprest.d.ts" /> | ||
// TO DO | ||
let props = (new $REST.PeopleManager()).getMyProperties().execute(); | ||
for(let prop of props.UserProfileProperties.results) { | ||
prop.Key; | ||
} | ||
let up = (new $REST.ProfileLoader()).getUserProfile().execute(); | ||
up.AccountName; |
@@ -38,4 +38,6 @@ // TypeScript configuration file | ||
"src/definitions/peopleManager.d.ts", | ||
"src/definitions/personProperties.d.ts", | ||
"src/definitions/profileLoader.d.ts", | ||
"src/definitions/promise.d.ts", | ||
"src/definitions/results.d.ts", | ||
"src/definitions/roleAssignment.d.ts", | ||
@@ -42,0 +44,0 @@ "src/definitions/roleAssignments.d.ts", |
@@ -51,5 +51,14 @@ // Type definitions for gd-sprest | ||
let List:Types.IList; | ||
/** People Manager */ | ||
let PeopleManager:Types.IPeopleManager; | ||
/** Profile Loader */ | ||
let ProfileLoader:Types.IProfileLoader; | ||
/** Site */ | ||
let Site:Types.ISite; | ||
/** User Profile */ | ||
let UserProfile:Types.IBase; | ||
@@ -56,0 +65,0 @@ /** Web */ |
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
5988415
139
23136