UNPKG

8.16 kBTypeScriptView Raw
1import { _SPInstance, SPInit } from "../spqueryable.js";
2import { IWeb } from "../webs/types.js";
3import { IChangeQuery } from "../types.js";
4export declare class _Site extends _SPInstance<ISiteInfo> {
5 constructor(base: SPInit, path?: string);
6 /**
7 * Gets the root web of the site collection
8 *
9 */
10 get rootWeb(): IWeb;
11 /**
12 * Returns the collection of changes from the change log that have occurred within the list, based on the specified query
13 *
14 * @param query The change query
15 */
16 getChanges(query: IChangeQuery): Promise<any>;
17 /**
18 * Opens a web by id (using POST)
19 *
20 * @param webId The GUID id of the web to open
21 */
22 openWebById(webId: string): Promise<IOpenWebByIdResult>;
23 /**
24 * Gets a Web instance representing the root web of the site collection
25 * correctly setup for chaining within the library
26 */
27 getRootWeb(): Promise<IWeb>;
28 /**
29 * Deletes the current site
30 *
31 */
32 delete(): Promise<void>;
33 /**
34 * Gets the document libraries on a site. Static method. (SharePoint Online only)
35 *
36 * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
37 */
38 getDocumentLibraries(absoluteWebUrl: string): Promise<IDocumentLibraryInformation[]>;
39 /**
40 * Gets the site url from a page url
41 *
42 * @param absolutePageUrl The absolute url of the page
43 */
44 getWebUrlFromPageUrl(absolutePageUrl: string): Promise<string>;
45 /**
46 * Creates a Modern communication site.
47 *
48 * @param title The title of the site to create
49 * @param lcid The language to use for the site. If not specified will default to 1033 (English).
50 * @param shareByEmailEnabled If set to true, it will enable sharing files via Email. By default it is set to false
51 * @param url The fully qualified URL (e.g. https://yourtenant.sharepoint.com/sites/mysitecollection) of the site.
52 * @param description The description of the communication site.
53 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
54 * @param siteDesignId The Guid of the site design to be used.
55 * You can use the below default OOTB GUIDs:
56 * Topic: 00000000-0000-0000-0000-000000000000
57 * Showcase: 6142d2a0-63a5-4ba0-aede-d9fefca2c767
58 * Blank: f6cc5403-0d63-442e-96c0-285923709ffc
59 * @param hubSiteId The id of the hub site to which the new site should be associated
60 * @param owner Optional owner value, required if executing the method in app only mode
61 */
62 createCommunicationSite(title: string, lcid: number, shareByEmailEnabled: boolean, url: string, description?: string, classification?: string, siteDesignId?: string, hubSiteId?: string, owner?: string): Promise<ISiteCreationResponse>;
63 createCommunicationSiteFromProps(props: ICreateCommSiteProps): Promise<ISiteCreationResponse>;
64 /**
65 *
66 * @param url Site Url that you want to check if exists
67 */
68 exists(url: string): Promise<boolean>;
69 /**
70 * Creates a Modern team site backed by Office 365 group. For use in SP Online only. This will not work with App-only tokens
71 *
72 * @param displayName The title or display name of the Modern team site to be created
73 * @param alias Alias of the underlying Office 365 Group
74 * @param isPublic Defines whether the Office 365 Group will be public (default), or private.
75 * @param lcid The language to use for the site. If not specified will default to English (1033).
76 * @param description The description of the site to be created.
77 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
78 * @param owners The Owners of the site to be created
79 */
80 createModernTeamSite(displayName: string, alias: string, isPublic?: boolean, lcid?: number, description?: string, classification?: string, owners?: string[], hubSiteId?: string, siteDesignId?: string): Promise<ISiteCreationResponse>;
81 createModernTeamSiteFromProps(props: ICreateTeamSiteProps): Promise<ISiteCreationResponse>;
82 update(props: ISiteInfo): Promise<any>;
83 /**
84 * Set's the site's `Site Logo` property, vs the Site Icon property available on the web's properties
85 *
86 * @param logoProperties An instance of ISiteLogoProperties which sets the new site logo.
87 */
88 setSiteLogo(logoProperties: ISiteLogoProperties): Promise<void>;
89}
90export interface ISite extends _Site {
91}
92export declare const Site: import("../spqueryable.js").ISPInvokableFactory<ISite>;
93/**
94 * The result of opening a web by id: contains the data returned as well as a chainable web instance
95 */
96export interface IOpenWebByIdResult {
97 data: any;
98 web: IWeb;
99}
100/**
101 * This is the interface to expose data for Document Library
102 */
103export interface IDocumentLibraryInformation {
104 AbsoluteUrl: string;
105 DriveId: string;
106 FromCrossFarm: boolean;
107 Id: string;
108 IsDefaultDocumentLibrary: boolean;
109 Modified: string;
110 ModifiedFriendlyDisplay: string;
111 ServerRelativeUrl: string;
112 Title: string;
113}
114export interface ICreateCommSiteProps {
115 Classification?: string;
116 Description?: string;
117 HubSiteId?: string;
118 Lcid?: number;
119 Owner?: string;
120 ShareByEmailEnabled?: boolean;
121 SiteDesignId?: string;
122 Title: string;
123 Url: string;
124 WebTemplate?: "SITEPAGEPUBLISHING#0" | "STS#3";
125 WebTemplateExtensionId?: string;
126}
127export interface ICreateTeamSiteProps {
128 displayName: string;
129 alias: string;
130 isPublic?: boolean;
131 lcid?: number;
132 description?: string;
133 classification?: string;
134 owners?: string[];
135 hubSiteId?: string;
136 siteDesignId?: string;
137}
138export interface ISiteCreationResponse {
139 "SiteId": string;
140 "SiteStatus": 0 | 1 | 2 | 3;
141 "SiteUrl": string;
142}
143export interface ISiteInfo {
144 AllowCreateDeclarativeWorkflow: boolean;
145 AllowDesigner: boolean;
146 AllowMasterPageEditing: boolean;
147 AllowRevertFromTemplate: boolean;
148 AllowSaveDeclarativeWorkflowAsTemplate: boolean;
149 AllowSavePublishDeclarativeWorkflow: boolean;
150 AllowSelfServiceUpgrade: boolean;
151 AllowSelfServiceUpgradeEvaluation: boolean;
152 AuditLogTrimmingRetention: number;
153 ChannelGroupId: string;
154 Classification: string;
155 CompatibilityLevel: number;
156 CurrentChangeToken: {
157 StringValue: string;
158 };
159 DisableAppViews: boolean;
160 DisableCompanyWideSharingLinks: boolean;
161 DisableFlows: boolean;
162 ExternalSharingTipsEnabled: boolean;
163 GeoLocation: string;
164 GroupId: string;
165 HubSiteId: string;
166 Id: string;
167 IsHubSite: boolean;
168 LockIssue: string | null;
169 MaxItemsPerThrottledOperation: number;
170 MediaTranscriptionDisabled: boolean;
171 NeedsB2BUpgrade: boolean;
172 PrimaryUri: string;
173 ReadOnly: boolean;
174 RequiredDesignerVersion: string;
175 ResourcePath: {
176 DecodedUrl: string;
177 };
178 SandboxedCodeActivationCapability: number;
179 SensitivityLabel: string;
180 SensitivityLabelId: string | null;
181 ServerRelativeUrl: string;
182 ShareByEmailEnabled: boolean;
183 ShareByLinkEnabled: boolean;
184 ShowUrlStructure: boolean;
185 TrimAuditLog: boolean;
186 UIVersionConfigurationEnabled: boolean;
187 UpgradeReminderDate: string;
188 UpgradeScheduled: boolean;
189 UpgradeScheduledDate: string;
190 Upgrading: boolean;
191 Url: string;
192 WriteLocked: boolean;
193}
194export declare const enum SiteLogoType {
195 /**
196 * Site header logo
197 */
198 WebLogo = 0,
199 /**
200 * Hub site logo
201 */
202 HubLogo = 1,
203 /**
204 * Header background image
205 */
206 HeaderBackground = 2,
207 /**
208 * Global navigation logo
209 */
210 GlobalNavLogo = 3
211}
212export declare const enum SiteLogoAspect {
213 Square = 0,
214 Rectangular = 1
215}
216export interface ISiteLogoProperties {
217 relativeLogoUrl: string;
218 type: SiteLogoType;
219 aspect: SiteLogoAspect;
220}
221//# sourceMappingURL=types.d.ts.map
\No newline at end of file