Skip to content

Commit

Permalink
Merge pull request #274 from gunjandatta/gdatta
Browse files Browse the repository at this point in the history
Added Web Template Extensions REST API EndPoint
  • Loading branch information
gunjandatta authored Mar 14, 2021
2 parents fe25f9a + b1b6abf commit 01b0b4d
Show file tree
Hide file tree
Showing 16 changed files with 323 additions and 13 deletions.
3 changes: 2 additions & 1 deletion @types/intellisense/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "gd-sprest-def";
//export * from "./graph";
export * from "./peoplePicker";
export * from "./utility";
export * from "./utility";
export * from "./webTemplateExtensions";
38 changes: 38 additions & 0 deletions @types/intellisense/webTemplateExtensions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {

} from "gd-sprest-def/lib/Microsoft/SharePoint/Utilities/WebTemplateExtensions";
import { IBaseExecution } from "gd-sprest-def/lib/base";
import { WebTemplateExtensions } from "gd-sprest-def/lib/Microsoft/SharePoint/Utilities";

/**
* Web Template Extensions Results
*/
export interface IResult extends IBaseExecution { }

/**
* Web Template Extensions Methods
*/
export interface IWebTemplateExtensionsMethods {
applySiteDesign(siteDesignId: string, webUrl: string): IBaseExecution;
addSiteDesignTaskToCurrentWeb(siteDesignId: string): IBaseExecution;
createSiteDesign(info: WebTemplateExtensions.SiteDesignCreationInfo)
createSiteScript(title: string, content: any): IBaseExecution;
deleteSiteDesign(id: string): IBaseExecution;
deleteSiteScript(id: string): IBaseExecution;
getSiteDesigns(): IBaseExecution;
getSiteDesignMetadata(id: string): IBaseExecution;
getSiteScripts(): IBaseExecution;
getSiteScriptFromWeb(webUrl: string, info: WebTemplateExtensions.SiteScriptSerializationInfo): IBaseExecution;
getSiteScriptFromList(listUrl: string): IBaseExecution;
getSiteScriptMetadata(id: string): IBaseExecution;
getSiteDesignRights(id: string): IBaseExecution;
grantSiteDesignRights(id: string, principalNames: string[], grantedRights: number): IBaseExecution;
revokeSiteDesignRights(id: string, principalNames: string[]): IBaseExecution;
updateSiteDesign(updateInfo: WebTemplateExtensions.SiteDesignCreationInfo & WebTemplateExtensions.SiteDesignMetadata): IBaseExecution;
updateSiteScript(updateInfo: WebTemplateExtensions.SiteScriptCreationInfo & WebTemplateExtensions.SiteScriptMetadata): IBaseExecution;
}

/**
* Web Template Extensions
*/
export interface IWebTemplateExtensions extends IWebTemplateExtensionsMethods, IBaseExecution<IWebTemplateExtensions> { }
1 change: 1 addition & 0 deletions @types/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export * from "./themeManager";
export * from "./userProfile";
export * from "./utility";
export * from "./web";
export * from "./webTemplateExtensions";
export * from "./wfInstanceService";
export * from "./wfSubscriptionService";
21 changes: 21 additions & 0 deletions @types/lib/webTemplateExtensions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as SP from "../intellisense/webTemplateExtensions";
import { ITargetInfoProps } from "../utils";

/**
* #### REST API
* _api/Microsoft.SharePoint.Utilities.WebTemplateExtensions
*/
export const WebTemplateExtensions: IWebTemplateExtensions;

/**
* Web Template Extensions
* @category WebTemplateExtensions
*/
export interface IWebTemplateExtensions {
/**
* Creates an instance of the utility library.
* @param url - (Optional) The web url.
* @param targetInfo - (Optional) The target information.
*/
(url?: string, targetInfo?: ITargetInfoProps): SP.IWebTemplateExtensions;
}
5 changes: 5 additions & 0 deletions @types/rest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ export interface IREST {
*/
Web: LibTypes.IWeb;

/**
* Use this api to interact with a SharePoint web template extensions.
*/
WebTemplateExtensions: LibTypes.IWebTemplateExtensions;

/**
* User this api to interact with the SharePoint 2013 workflow instance service.
*/
Expand Down
73 changes: 73 additions & 0 deletions dist/gd-sprest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// ../gd-sprest-def/base
// ../gd-sprest-def/lib/SP/Taxonomy/entitytypes
// ../gd-sprest-def/lib/SP/UI/ApplicationPages/complextypes
// ../gd-sprest-def/lib/Microsoft/SharePoint/Utilities
// ../gd-sprest-def/lib/SP

declare module 'gd-sprest' {
Expand Down Expand Up @@ -81,6 +82,7 @@ declare module 'gd-sprest/lib' {
export * from "gd-sprest/lib/userProfile";
export * from "gd-sprest/lib/utility";
export * from "gd-sprest/lib/web";
export * from "gd-sprest/lib/webTemplateExtensions";
export * from "gd-sprest/lib/wfInstanceService";
export * from "gd-sprest/lib/wfSubscriptionService";
}
Expand Down Expand Up @@ -330,6 +332,11 @@ declare module 'gd-sprest/rest' {
*/
Web: LibTypes.IWeb;

/**
* Use this api to interact with a SharePoint web template extensions.
*/
WebTemplateExtensions: LibTypes.IWebTemplateExtensions;

/**
* User this api to interact with the SharePoint 2013 workflow instance service.
*/
Expand Down Expand Up @@ -395,6 +402,7 @@ declare module 'gd-sprest/intellisense' {
export * from "gd-sprest-def";
export * from "gd-sprest/intellisense/peoplePicker";
export * from "gd-sprest/intellisense/utility";
export * from "gd-sprest/intellisense/webTemplateExtensions";
}

declare module 'gd-sprest/lib/apps' {
Expand Down Expand Up @@ -1552,6 +1560,30 @@ declare module 'gd-sprest/lib/web' {
}
}

declare module 'gd-sprest/lib/webTemplateExtensions' {
import * as SP from "gd-sprest/intellisense/webTemplateExtensions";
import { ITargetInfoProps } from "gd-sprest/utils";

/**
* #### REST API
* _api/Microsoft.SharePoint.Utilities.WebTemplateExtensions
*/
export const WebTemplateExtensions: IWebTemplateExtensions;

/**
* Web Template Extensions
* @category WebTemplateExtensions
*/
export interface IWebTemplateExtensions {
/**
* Creates an instance of the utility library.
* @param url - (Optional) The web url.
* @param targetInfo - (Optional) The target information.
*/
(url?: string, targetInfo?: ITargetInfoProps): SP.IWebTemplateExtensions;
}
}

declare module 'gd-sprest/lib/wfInstanceService' {
import { IBaseExecution } from "gd-sprest-def/lib/base";
import * as SP from "gd-sprest-def/lib/SP/WorkflowServices/entitytypes";
Expand Down Expand Up @@ -5398,6 +5430,47 @@ declare module 'gd-sprest/intellisense/utility' {
}
}

declare module 'gd-sprest/intellisense/webTemplateExtensions' {
import {

} from "gd-sprest-def/lib/Microsoft/SharePoint/Utilities/WebTemplateExtensions";
import { IBaseExecution } from "gd-sprest-def/lib/base";
import { WebTemplateExtensions } from "gd-sprest-def/lib/Microsoft/SharePoint/Utilities";

/**
* Web Template Extensions Results
*/
export interface IResult extends IBaseExecution { }

/**
* Web Template Extensions Methods
*/
export interface IWebTemplateExtensionsMethods {
applySiteDesign(siteDesignId: string, webUrl: string): IBaseExecution;
addSiteDesignTaskToCurrentWeb(siteDesignId: string): IBaseExecution;
createSiteDesign(info: WebTemplateExtensions.SiteDesignCreationInfo)
createSiteScript(title: string, content: any): IBaseExecution;
deleteSiteDesign(id: string): IBaseExecution;
deleteSiteScript(id: string): IBaseExecution;
getSiteDesigns(): IBaseExecution;
getSiteDesignMetadata(id: string): IBaseExecution;
getSiteScripts(): IBaseExecution;
getSiteScriptFromWeb(webUrl: string, info: WebTemplateExtensions.SiteScriptSerializationInfo): IBaseExecution;
getSiteScriptFromList(listUrl: string): IBaseExecution;
getSiteScriptMetadata(id: string): IBaseExecution;
getSiteDesignRights(id: string): IBaseExecution;
grantSiteDesignRights(id: string, principalNames: string[], grantedRights: number): IBaseExecution;
revokeSiteDesignRights(id: string, principalNames: string[]): IBaseExecution;
updateSiteDesign(updateInfo: WebTemplateExtensions.SiteDesignCreationInfo & WebTemplateExtensions.SiteDesignMetadata): IBaseExecution;
updateSiteScript(updateInfo: WebTemplateExtensions.SiteScriptCreationInfo & WebTemplateExtensions.SiteScriptMetadata): IBaseExecution;
}

/**
* Web Template Extensions
*/
export interface IWebTemplateExtensions extends IWebTemplateExtensionsMethods, IBaseExecution<IWebTemplateExtensions> { }
}

declare module 'gd-sprest/utils' {
export * from "gd-sprest/utils/base";
export * from "gd-sprest/utils/helper";
Expand Down
Loading

0 comments on commit 01b0b4d

Please sign in to comment.