1 | import { ISPQueryable, _SPQueryable } from "../spqueryable.js";
|
2 | export declare class _SiteScripts extends _SPQueryable {
|
3 | constructor(base: string | ISPQueryable, methodName?: string);
|
4 | run<T>(props: any): Promise<T>;
|
5 | /**
|
6 | * Gets a list of information on all existing site scripts.
|
7 | */
|
8 | getSiteScripts(): Promise<ISiteScriptInfo[]>;
|
9 | /**
|
10 | * Creates a new site script.
|
11 | *
|
12 | * @param title The display name of the site script.
|
13 | * @param content JSON value that describes the script. For more information, see JSON reference.
|
14 | */
|
15 | createSiteScript(title: string, description: string, content: any): Promise<ISiteScriptInfo>;
|
16 | /**
|
17 | * Gets information about a specific site script. It also returns the JSON of the script.
|
18 | *
|
19 | * @param id The ID of the site script to get information about.
|
20 | */
|
21 | getSiteScriptMetadata(id: string): Promise<ISiteScriptInfo>;
|
22 | /**
|
23 | * Deletes a site script.
|
24 | *
|
25 | * @param id The ID of the site script to delete.
|
26 | */
|
27 | deleteSiteScript(id: string): Promise<void>;
|
28 | /**
|
29 | * Updates a site script with new values. In the REST call, all parameters are optional except the site script Id.
|
30 | *
|
31 | * @param siteScriptUpdateInfo Object that contains the information to update a site script.
|
32 | * Make sure you stringify the content object or pass it in the second 'content' parameter
|
33 | * @param content (Optional) A new JSON script defining the script actions. For more information, see Site design JSON schema.
|
34 | */
|
35 | updateSiteScript(updateInfo: ISiteScriptUpdateInfo, content?: any): Promise<ISiteScriptInfo>;
|
36 | /**
|
37 | * Gets the site script syntax (JSON) for a specific list
|
38 | * @param listUrl The absolute url of the list to retrieve site script
|
39 | */
|
40 | getSiteScriptFromList(listUrl: string): Promise<string>;
|
41 | /**
|
42 | * Gets the site script syntax (JSON) for a specific web
|
43 | * @param webUrl The absolute url of the web to retrieve site script
|
44 | * @param extractInfo configuration object to specify what to extract
|
45 | */
|
46 | getSiteScriptFromWeb(webUrl: string, info: ISiteScriptSerializationInfo): Promise<ISiteScriptSerializationResult>;
|
47 | /**
|
48 | * Executes the indicated site design action on the indicated web.
|
49 | *
|
50 | * @param webUrl The absolute url of the web to retrieve site script
|
51 | * @param extractInfo configuration object to specify what to extract
|
52 | */
|
53 | executeSiteScriptAction(actionDefinition: string): Promise<ISiteScriptActionResult>;
|
54 | }
|
55 | export interface ISiteScripts extends _SiteScripts {
|
56 | }
|
57 | export declare const SiteScripts: (baseUrl: string | ISPQueryable, methodName?: string) => ISiteScripts;
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | export interface ISiteScriptInfo {
|
63 | |
64 |
|
65 |
|
66 | Id: string;
|
67 | |
68 |
|
69 |
|
70 | Title: string;
|
71 | |
72 |
|
73 |
|
74 | Description: string;
|
75 | |
76 |
|
77 |
|
78 | Content: string;
|
79 | |
80 |
|
81 |
|
82 | Version: string;
|
83 | }
|
84 |
|
85 |
|
86 |
|
87 |
|
88 | export interface ISiteScriptUpdateInfo {
|
89 | |
90 |
|
91 |
|
92 | Id: string;
|
93 | |
94 |
|
95 |
|
96 | Title?: string;
|
97 | |
98 |
|
99 |
|
100 | Description?: string;
|
101 | |
102 |
|
103 |
|
104 | Content?: string;
|
105 | |
106 |
|
107 |
|
108 | Version?: string;
|
109 | }
|
110 | export interface ISiteScriptSerializationInfo {
|
111 | |
112 |
|
113 |
|
114 | IncludeBranding?: boolean;
|
115 | |
116 |
|
117 |
|
118 | IncludedLists?: string[];
|
119 | |
120 |
|
121 |
|
122 | IncludeLinksToExportedItems?: boolean;
|
123 | |
124 |
|
125 |
|
126 | IncludeRegionalSettings?: boolean;
|
127 | |
128 |
|
129 |
|
130 | IncludeSiteExternalSharingCapability?: boolean;
|
131 | |
132 |
|
133 |
|
134 | IncludeTheme?: boolean;
|
135 | }
|
136 | export interface ISiteScriptSerializationResult {
|
137 | |
138 |
|
139 |
|
140 | JSON: string;
|
141 | |
142 |
|
143 |
|
144 | Warnings: string[];
|
145 | }
|
146 | export interface ISiteScriptActionResult {
|
147 | |
148 |
|
149 |
|
150 | Title: string;
|
151 | |
152 |
|
153 |
|
154 | OutcomeText: string;
|
155 | |
156 |
|
157 |
|
158 | Outcome: SiteScriptActionOutcome;
|
159 | |
160 |
|
161 |
|
162 | Target: string;
|
163 | }
|
164 | export declare enum SiteScriptActionOutcome {
|
165 | |
166 |
|
167 |
|
168 | Success = 0,
|
169 | |
170 |
|
171 |
|
172 |
|
173 | Failure = 1,
|
174 | |
175 |
|
176 |
|
177 | NoOp = 2,
|
178 | |
179 |
|
180 |
|
181 |
|
182 | SucceededWithException = 3
|
183 | }
|
184 |
|
\ | No newline at end of file |