1 | import { __decorate } from "tslib";
|
2 | import { body, TextParse, BlobParse, BufferParse, JSONParse, cancelableScope, CancelAction } from "@pnp/queryable";
|
3 | import { getGUID, isFunc, stringIsNullOrEmpty, isUrlAbsolute } from "@pnp/core";
|
4 | import { _SPCollection, spInvokableFactory, _SPInstance, SPInstance, deleteableWithETag, } from "../spqueryable.js";
|
5 | import { Item } from "../items/index.js";
|
6 | import { odataUrlFrom } from "../utils/odata-url-from.js";
|
7 | import { defaultPath } from "../decorators.js";
|
8 | import { spPost, spGet } from "../operations.js";
|
9 | import { escapeQueryStrValue } from "../utils/escape-query-str.js";
|
10 | import { extractWebUrl } from "../utils/extract-web-url.js";
|
11 | import { toResourcePath } from "../utils/to-resource-path.js";
|
12 | /**
|
13 | * Describes a collection of File objects
|
14 | *
|
15 | */
|
16 | let _Files = class _Files extends _SPCollection {
|
17 | /**
|
18 | * Gets a File by filename
|
19 | *
|
20 | * @param name The name of the file, including extension.
|
21 | */
|
22 | getByUrl(name) {
|
23 | if (/%#/.test(name)) {
|
24 | throw Error("For file names containing % or # please use web.getFileByServerRelativePath");
|
25 | }
|
26 | return File(this).concat(`('${escapeQueryStrValue(name)}')`);
|
27 | }
|
28 | /**
|
29 | * Adds a file using the pound percent safe methods
|
30 | *
|
31 | * @param url Encoded url of the file
|
32 | * @param content The file content
|
33 | * @param parameters Additional parameters to control method behavior
|
34 | */
|
35 | async addUsingPath(url, content, parameters = { Overwrite: false }) {
|
36 | const path = [`AddUsingPath(decodedurl='${escapeQueryStrValue(url)}'`];
|
37 | if (parameters) {
|
38 | if (parameters.Overwrite) {
|
39 | path.push(",Overwrite=true");
|
40 | }
|
41 | if (parameters.AutoCheckoutOnInvalidData) {
|
42 | path.push(",AutoCheckoutOnInvalidData=true");
|
43 | }
|
44 | if (!stringIsNullOrEmpty(parameters.XorHash)) {
|
45 | path.push(`,XorHash=${escapeQueryStrValue(parameters.XorHash)}`);
|
46 | }
|
47 | }
|
48 | path.push(")");
|
49 | const resp = await spPost(Files(this, path.join("")), { body: content });
|
50 | return {
|
51 | data: resp,
|
52 | file: fileFromServerRelativePath(this, resp.ServerRelativeUrl),
|
53 | };
|
54 | }
|
55 | /**
|
56 | * Uploads a file. Not supported for batching
|
57 | *
|
58 | * @param url The folder-relative url of the file.
|
59 | * @param content The Blob file content to add
|
60 | * @param progress A callback function which can be used to track the progress of the upload
|
61 | * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)
|
62 | * @param chunkSize The size of each file slice, in bytes (default: 10485760)
|
63 | * @returns The new File and the raw response.
|
64 | */
|
65 | async addChunked(url, content, progress, shouldOverWrite = true, chunkSize = 10485760) {
|
66 | const response = await spPost(Files(this, `add(overwrite=${shouldOverWrite},url='${escapeQueryStrValue(url)}')`));
|
67 | const file = fileFromServerRelativePath(this, response.ServerRelativeUrl);
|
68 | // file.using(CancelAction(() => {
|
69 | // return File(file).delete();
|
70 | // }));
|
71 | return await file.setContentChunked(content, progress, chunkSize);
|
72 | }
|
73 | /**
|
74 | * Adds a ghosted file to an existing list or document library. Not supported for batching.
|
75 | *
|
76 | * @param fileUrl The server-relative url where you want to save the file.
|
77 | * @param templateFileType The type of use to create the file.
|
78 | * @returns The template file that was added and the raw response.
|
79 | */
|
80 | async addTemplateFile(fileUrl, templateFileType) {
|
81 | const response = await spPost(Files(this, `addTemplateFile(urloffile='${escapeQueryStrValue(fileUrl)}',templatefiletype=${templateFileType})`));
|
82 | return {
|
83 | data: response,
|
84 | file: fileFromServerRelativePath(this, response.ServerRelativeUrl),
|
85 | };
|
86 | }
|
87 | };
|
88 | __decorate([
|
89 | cancelableScope
|
90 | ], _Files.prototype, "addChunked", null);
|
91 | _Files = __decorate([
|
92 | defaultPath("files")
|
93 | ], _Files);
|
94 | export { _Files };
|
95 | export const Files = spInvokableFactory(_Files);
|
96 | /**
|
97 | * Describes a single File instance
|
98 | *
|
99 | */
|
100 | export class _File extends _SPInstance {
|
101 | constructor() {
|
102 | super(...arguments);
|
103 | this.delete = deleteableWithETag();
|
104 | }
|
105 | /**
|
106 | * Gets a value that specifies the list item field values for the list item corresponding to the file.
|
107 | *
|
108 | */
|
109 | get listItemAllFields() {
|
110 | return SPInstance(this, "listItemAllFields");
|
111 | }
|
112 | /**
|
113 | * Gets a collection of versions
|
114 | *
|
115 | */
|
116 | get versions() {
|
117 | return Versions(this);
|
118 | }
|
119 | /**
|
120 | * Gets the current locked by user
|
121 | *
|
122 | */
|
123 | async getLockedByUser() {
|
124 | const u = await spGet(File(this, "lockedByUser"));
|
125 | if (u["odata.null"] === true) {
|
126 | return null;
|
127 | }
|
128 | else {
|
129 | return u;
|
130 | }
|
131 | }
|
132 | /**
|
133 | * Approves the file submitted for content approval with the specified comment.
|
134 | * Only documents in lists that are enabled for content approval can be approved.
|
135 | *
|
136 | * @param comment The comment for the approval.
|
137 | */
|
138 | approve(comment = "") {
|
139 | return spPost(File(this, `approve(comment='${escapeQueryStrValue(comment)}')`));
|
140 | }
|
141 | /**
|
142 | * Stops the chunk upload session without saving the uploaded data. Does not support batching.
|
143 | * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.
|
144 | * Use this in response to user action (as in a request to cancel an upload) or an error or exception.
|
145 | * Use the uploadId value that was passed to the StartUpload method that started the upload session.
|
146 | * This method is currently available only on Office 365.
|
147 | *
|
148 | * @param uploadId The unique identifier of the upload session.
|
149 | */
|
150 | cancelUpload(uploadId) {
|
151 | return spPost(File(this, `cancelUpload(uploadId=guid'${uploadId}')`));
|
152 | }
|
153 | /**
|
154 | * Checks the file in to a document library based on the check-in type.
|
155 | *
|
156 | * @param comment A comment for the check-in. Its length must be <= 1023.
|
157 | * @param checkinType The check-in type for the file.
|
158 | */
|
159 | checkin(comment = "", checkinType = CheckinType.Major) {
|
160 | if (comment.length > 1023) {
|
161 | throw Error("The maximum comment length is 1023 characters.");
|
162 | }
|
163 | return spPost(File(this, `checkin(comment='${escapeQueryStrValue(comment)}',checkintype=${checkinType})`));
|
164 | }
|
165 | /**
|
166 | * Checks out the file from a document library.
|
167 | */
|
168 | checkout() {
|
169 | return spPost(File(this, "checkout"));
|
170 | }
|
171 | /**
|
172 | * Copies the file to the destination url.
|
173 | *
|
174 | * @param url The absolute url or server relative url of the destination file path to copy to.
|
175 | * @param shouldOverWrite Should a file with the same name in the same location be overwritten?
|
176 | */
|
177 | copyTo(url, shouldOverWrite = true) {
|
178 | return spPost(File(this, `copyTo(strnewurl='${escapeQueryStrValue(url)}',boverwrite=${shouldOverWrite})`));
|
179 | }
|
180 | /**
|
181 | * Copies the file by path to destination path.
|
182 | * Also works with different site collections.
|
183 | *
|
184 | * @param destUrl The absolute url or server relative url of the destination file path to copy to.
|
185 | * @param shouldOverWrite Should a file with the same name in the same location be overwritten?
|
186 | * @param keepBoth Keep both if file with the same name in the same location already exists? Only relevant when shouldOverWrite is set to false.
|
187 | */
|
188 | async copyByPath(destUrl, shouldOverWrite, KeepBoth = false) {
|
189 | const { ServerRelativeUrl: srcUrl, ["odata.id"]: absoluteUrl } = await this.select("ServerRelativeUrl")();
|
190 | const webBaseUrl = new URL(extractWebUrl(absoluteUrl));
|
191 | return spPost(File([this, webBaseUrl.toString()], `/_api/SP.MoveCopyUtil.CopyFileByPath(overwrite=@a1)?@a1=${shouldOverWrite}`), body({
|
192 | destPath: toResourcePath(isUrlAbsolute(destUrl) ? destUrl : `${webBaseUrl.protocol}//${webBaseUrl.host}${destUrl}`),
|
193 | options: {
|
194 | KeepBoth,
|
195 | ResetAuthorAndCreatedOnCopy: true,
|
196 | ShouldBypassSharedLocks: true,
|
197 | },
|
198 | srcPath: toResourcePath(isUrlAbsolute(srcUrl) ? srcUrl : `${webBaseUrl.protocol}//${webBaseUrl.host}${srcUrl}`),
|
199 | }));
|
200 | }
|
201 | /**
|
202 | * Denies approval for a file that was submitted for content approval.
|
203 | * Only documents in lists that are enabled for content approval can be denied.
|
204 | *
|
205 | * @param comment The comment for the denial.
|
206 | */
|
207 | deny(comment = "") {
|
208 | if (comment.length > 1023) {
|
209 | throw Error("The maximum comment length is 1023 characters.");
|
210 | }
|
211 | return spPost(File(this, `deny(comment='${escapeQueryStrValue(comment)}')`));
|
212 | }
|
213 | /**
|
214 | * Moves the file by path to the specified destination url.
|
215 | * Also works with different site collections.
|
216 | *
|
217 | * @param destUrl The absolute url or server relative url of the destination file path to move to.
|
218 | * @param shouldOverWrite Should a file with the same name in the same location be overwritten?
|
219 | * @param keepBoth Keep both if file with the same name in the same location already exists? Only relevant when shouldOverWrite is set to false.
|
220 | */
|
221 | async moveByPath(destUrl, shouldOverWrite, KeepBoth = false) {
|
222 | const { ServerRelativeUrl: srcUrl, ["odata.id"]: absoluteUrl } = await this.select("ServerRelativeUrl")();
|
223 | const webBaseUrl = new URL(extractWebUrl(absoluteUrl));
|
224 | return spPost(File([this, webBaseUrl.toString()], `/_api/SP.MoveCopyUtil.MoveFileByPath(overwrite=@a1)?@a1=${shouldOverWrite}`), body({
|
225 | destPath: toResourcePath(isUrlAbsolute(destUrl) ? destUrl : `${webBaseUrl.protocol}//${webBaseUrl.host}${destUrl}`),
|
226 | options: {
|
227 | KeepBoth,
|
228 | ResetAuthorAndCreatedOnCopy: false,
|
229 | ShouldBypassSharedLocks: true,
|
230 | },
|
231 | srcPath: toResourcePath(isUrlAbsolute(srcUrl) ? srcUrl : `${webBaseUrl.protocol}//${webBaseUrl.host}${srcUrl}`),
|
232 | }));
|
233 | }
|
234 | /**
|
235 | * Submits the file for content approval with the specified comment.
|
236 | *
|
237 | * @param comment The comment for the published file. Its length must be <= 1023.
|
238 | */
|
239 | publish(comment = "") {
|
240 | if (comment.length > 1023) {
|
241 | throw Error("The maximum comment length is 1023 characters.");
|
242 | }
|
243 | return spPost(File(this, `publish(comment='${escapeQueryStrValue(comment)}')`));
|
244 | }
|
245 | /**
|
246 | * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.
|
247 | *
|
248 | * @returns The GUID of the recycled file.
|
249 | */
|
250 | recycle() {
|
251 | return spPost(File(this, "recycle"));
|
252 | }
|
253 | /**
|
254 | * Deletes the file object with options.
|
255 | *
|
256 | * @param parameters Specifies the options to use when deleting a file.
|
257 | */
|
258 | async deleteWithParams(parameters) {
|
259 | return spPost(File(this, "DeleteWithParameters"), body({ parameters }));
|
260 | }
|
261 | /**
|
262 | * Reverts an existing checkout for the file.
|
263 | *
|
264 | */
|
265 | undoCheckout() {
|
266 | return spPost(File(this, "undoCheckout"));
|
267 | }
|
268 | /**
|
269 | * Removes the file from content approval or unpublish a major version.
|
270 | *
|
271 | * @param comment The comment for the unpublish operation. Its length must be <= 1023.
|
272 | */
|
273 | unpublish(comment = "") {
|
274 | if (comment.length > 1023) {
|
275 | throw Error("The maximum comment length is 1023 characters.");
|
276 | }
|
277 | return spPost(File(this, `unpublish(comment='${escapeQueryStrValue(comment)}')`));
|
278 | }
|
279 | /**
|
280 | * Checks to see if the file represented by this object exists
|
281 | *
|
282 | */
|
283 | async exists() {
|
284 | try {
|
285 | const r = await File(this).select("Exists")();
|
286 | return r.Exists;
|
287 | }
|
288 | catch (e) {
|
289 | // this treats any error here as the file not existing, which
|
290 | // might not be true, but is good enough.
|
291 | return false;
|
292 | }
|
293 | }
|
294 | /**
|
295 | * Gets the contents of the file as text. Not supported in batching.
|
296 | *
|
297 | */
|
298 | getText() {
|
299 | return File(this, "$value").using(TextParse())();
|
300 | }
|
301 | /**
|
302 | * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.
|
303 | *
|
304 | */
|
305 | getBlob() {
|
306 | return File(this, "$value").using(BlobParse())();
|
307 | }
|
308 | /**
|
309 | * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
|
310 | */
|
311 | getBuffer() {
|
312 | return File(this, "$value").using(BufferParse())();
|
313 | }
|
314 | // (headers({ "binaryStringResponseBody": "true" })
|
315 | /**
|
316 | * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
|
317 | */
|
318 | getJSON() {
|
319 | return File(this, "$value").using(JSONParse())();
|
320 | }
|
321 | /**
|
322 | * Sets the content of a file, for large files use setContentChunked. Not supported in batching.
|
323 | *
|
324 | * @param content The file content
|
325 | *
|
326 | */
|
327 | async setContent(content) {
|
328 | await spPost(File(this, "$value"), {
|
329 | body: content,
|
330 | headers: {
|
331 | "X-HTTP-Method": "PUT",
|
332 | },
|
333 | });
|
334 | return File(this);
|
335 | }
|
336 | /**
|
337 | * Gets the associated list item for this folder, loading the default properties
|
338 | */
|
339 | async getItem(...selects) {
|
340 | const q = this.listItemAllFields;
|
341 | const d = await q.select(...selects)();
|
342 | return Object.assign(Item([this, odataUrlFrom(d)]), d);
|
343 | }
|
344 | /**
|
345 | * Sets the contents of a file using a chunked upload approach. Not supported in batching.
|
346 | *
|
347 | * @param file The file to upload
|
348 | * @param progress A callback function which can be used to track the progress of the upload
|
349 | * @param chunkSize The size of each file slice, in bytes (default: 10485760)
|
350 | */
|
351 | async setContentChunked(file, progress, chunkSize = 10485760) {
|
352 | if (!isFunc(progress)) {
|
353 | progress = () => null;
|
354 | }
|
355 | const fileSize = (file === null || file === void 0 ? void 0 : file.size) || file.length;
|
356 | const totalBlocks = parseInt((fileSize / chunkSize).toString(), 10) + ((fileSize % chunkSize === 0) ? 1 : 0);
|
357 | const uploadId = getGUID();
|
358 | const fileRef = File(this).using(CancelAction(() => {
|
359 | return File(fileRef).cancelUpload(uploadId);
|
360 | }));
|
361 | // report that we are starting
|
362 | progress({ uploadId, blockNumber: 1, chunkSize, currentPointer: 0, fileSize, stage: "starting", totalBlocks });
|
363 | let currentPointer = await fileRef.startUpload(uploadId, file.slice(0, chunkSize));
|
364 | // skip the first and last blocks
|
365 | for (let i = 2; i < totalBlocks; i++) {
|
366 | progress({ uploadId, blockNumber: i, chunkSize, currentPointer, fileSize, stage: "continue", totalBlocks });
|
367 | currentPointer = await fileRef.continueUpload(uploadId, currentPointer, file.slice(currentPointer, currentPointer + chunkSize));
|
368 | }
|
369 | progress({ uploadId, blockNumber: totalBlocks, chunkSize, currentPointer, fileSize, stage: "finishing", totalBlocks });
|
370 | return fileRef.finishUpload(uploadId, currentPointer, file.slice(currentPointer));
|
371 | }
|
372 | /**
|
373 | * Starts a new chunk upload session and uploads the first fragment.
|
374 | * The current file content is not changed when this method completes.
|
375 | * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.
|
376 | * The upload session ends either when you use the CancelUpload method or when you successfully
|
377 | * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.
|
378 | * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,
|
379 | * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.
|
380 | * This method is currently available only on Office 365.
|
381 | *
|
382 | * @param uploadId The unique identifier of the upload session.
|
383 | * @param fragment The file contents.
|
384 | * @returns The size of the total uploaded data in bytes.
|
385 | */
|
386 | async startUpload(uploadId, fragment) {
|
387 | let n = await spPost(File(this, `startUpload(uploadId=guid'${uploadId}')`), { body: fragment });
|
388 | if (typeof n === "object") {
|
389 | // When OData=verbose the payload has the following shape:
|
390 | // { StartUpload: "10485760" }
|
391 | n = n.StartUpload;
|
392 | }
|
393 | return parseFloat(n);
|
394 | }
|
395 | /**
|
396 | * Continues the chunk upload session with an additional fragment.
|
397 | * The current file content is not changed.
|
398 | * Use the uploadId value that was passed to the StartUpload method that started the upload session.
|
399 | * This method is currently available only on Office 365.
|
400 | *
|
401 | * @param uploadId The unique identifier of the upload session.
|
402 | * @param fileOffset The size of the offset into the file where the fragment starts.
|
403 | * @param fragment The file contents.
|
404 | * @returns The size of the total uploaded data in bytes.
|
405 | */
|
406 | async continueUpload(uploadId, fileOffset, fragment) {
|
407 | let n = await spPost(File(this, `continueUpload(uploadId=guid'${uploadId}',fileOffset=${fileOffset})`), { body: fragment });
|
408 | if (typeof n === "object") {
|
409 | // When OData=verbose the payload has the following shape:
|
410 | // { ContinueUpload: "20971520" }
|
411 | n = n.ContinueUpload;
|
412 | }
|
413 | return parseFloat(n);
|
414 | }
|
415 | /**
|
416 | * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.
|
417 | * Use the uploadId value that was passed to the StartUpload method that started the upload session.
|
418 | * This method is currently available only on Office 365.
|
419 | *
|
420 | * @param uploadId The unique identifier of the upload session.
|
421 | * @param fileOffset The size of the offset into the file where the fragment starts.
|
422 | * @param fragment The file contents.
|
423 | * @returns The newly uploaded file.
|
424 | */
|
425 | async finishUpload(uploadId, fileOffset, fragment) {
|
426 | const response = await spPost(File(this, `finishUpload(uploadId=guid'${uploadId}',fileOffset=${fileOffset})`), { body: fragment });
|
427 | return {
|
428 | data: response,
|
429 | file: fileFromServerRelativePath(this, response.ServerRelativeUrl),
|
430 | };
|
431 | }
|
432 | }
|
433 | __decorate([
|
434 | cancelableScope
|
435 | ], _File.prototype, "setContentChunked", null);
|
436 | export const File = spInvokableFactory(_File);
|
437 | /**
|
438 | * Creates an IFile instance given a base object and a server relative path
|
439 | *
|
440 | * @param base Valid SPQueryable from which the observers will be used and the web url extracted
|
441 | * @param serverRelativePath The server relative url to the file (ex: '/sites/dev/documents/file.txt')
|
442 | * @returns IFile instance referencing the file described by the supplied parameters
|
443 | */
|
444 | export function fileFromServerRelativePath(base, serverRelativePath) {
|
445 | return File([base, extractWebUrl(base.toUrl())], `_api/web/getFileByServerRelativePath(decodedUrl='${escapeQueryStrValue(serverRelativePath)}')`);
|
446 | }
|
447 | /**
|
448 | * Describes a collection of Version objects
|
449 | *
|
450 | */
|
451 | let _Versions = class _Versions extends _SPCollection {
|
452 | /**
|
453 | * Gets a version by id
|
454 | *
|
455 | * @param versionId The id of the version to retrieve
|
456 | */
|
457 | getById(versionId) {
|
458 | return Version(this).concat(`(${versionId})`);
|
459 | }
|
460 | /**
|
461 | * Deletes all the file version objects in the collection.
|
462 | *
|
463 | */
|
464 | deleteAll() {
|
465 | return spPost(Versions(this, "deleteAll"));
|
466 | }
|
467 | /**
|
468 | * Deletes the specified version of the file.
|
469 | *
|
470 | * @param versionId The ID of the file version to delete.
|
471 | */
|
472 | deleteById(versionId) {
|
473 | return spPost(Versions(this, `deleteById(vid=${versionId})`));
|
474 | }
|
475 | /**
|
476 | * Recycles the specified version of the file.
|
477 | *
|
478 | * @param versionId The ID of the file version to delete.
|
479 | */
|
480 | recycleByID(versionId) {
|
481 | return spPost(Versions(this, `recycleByID(vid=${versionId})`));
|
482 | }
|
483 | /**
|
484 | * Deletes the file version object with the specified version label.
|
485 | *
|
486 | * @param label The version label of the file version to delete, for example: 1.2
|
487 | */
|
488 | deleteByLabel(label) {
|
489 | return spPost(Versions(this, `deleteByLabel(versionlabel='${escapeQueryStrValue(label)}')`));
|
490 | }
|
491 | /**
|
492 | * Recycles the file version object with the specified version label.
|
493 | *
|
494 | * @param label The version label of the file version to delete, for example: 1.2
|
495 | */
|
496 | recycleByLabel(label) {
|
497 | return spPost(Versions(this, `recycleByLabel(versionlabel='${escapeQueryStrValue(label)}')`));
|
498 | }
|
499 | /**
|
500 | * Creates a new file version from the file specified by the version label.
|
501 | *
|
502 | * @param label The version label of the file version to restore, for example: 1.2
|
503 | */
|
504 | restoreByLabel(label) {
|
505 | return spPost(Versions(this, `restoreByLabel(versionlabel='${escapeQueryStrValue(label)}')`));
|
506 | }
|
507 | };
|
508 | _Versions = __decorate([
|
509 | defaultPath("versions")
|
510 | ], _Versions);
|
511 | export { _Versions };
|
512 | export const Versions = spInvokableFactory(_Versions);
|
513 | /**
|
514 | * Describes a single Version instance
|
515 | *
|
516 | */
|
517 | export class _Version extends _SPInstance {
|
518 | }
|
519 | export const Version = spInvokableFactory(_Version);
|
520 | /**
|
521 | * Types for document check in.
|
522 | * Minor = 0
|
523 | * Major = 1
|
524 | * Overwrite = 2
|
525 | */
|
526 | export var CheckinType;
|
527 | (function (CheckinType) {
|
528 | CheckinType[CheckinType["Minor"] = 0] = "Minor";
|
529 | CheckinType[CheckinType["Major"] = 1] = "Major";
|
530 | CheckinType[CheckinType["Overwrite"] = 2] = "Overwrite";
|
531 | })(CheckinType || (CheckinType = {}));
|
532 | /**
|
533 | * File move opertions
|
534 | */
|
535 | export var MoveOperations;
|
536 | (function (MoveOperations) {
|
537 | /**
|
538 | * Produce an error if a file with the same name exists in the destination
|
539 | */
|
540 | MoveOperations[MoveOperations["None"] = 0] = "None";
|
541 | /**
|
542 | * Overwrite a file with the same name if it exists. Value is 1.
|
543 | */
|
544 | MoveOperations[MoveOperations["Overwrite"] = 1] = "Overwrite";
|
545 | /**
|
546 | * Complete the move operation even if supporting files are separated from the file. Value is 8.
|
547 | */
|
548 | MoveOperations[MoveOperations["AllowBrokenThickets"] = 8] = "AllowBrokenThickets";
|
549 | /**
|
550 | * Boolean specifying whether to retain the source of the move's editor and modified by datetime.
|
551 | */
|
552 | MoveOperations[MoveOperations["RetainEditorAndModifiedOnMove"] = 2048] = "RetainEditorAndModifiedOnMove";
|
553 | })(MoveOperations || (MoveOperations = {}));
|
554 | export var TemplateFileType;
|
555 | (function (TemplateFileType) {
|
556 | TemplateFileType[TemplateFileType["StandardPage"] = 0] = "StandardPage";
|
557 | TemplateFileType[TemplateFileType["WikiPage"] = 1] = "WikiPage";
|
558 | TemplateFileType[TemplateFileType["FormPage"] = 2] = "FormPage";
|
559 | TemplateFileType[TemplateFileType["ClientSidePage"] = 3] = "ClientSidePage";
|
560 | })(TemplateFileType || (TemplateFileType = {}));
|
561 | //# sourceMappingURL=types.js.map |
\ | No newline at end of file |