forked from aaronmars/martian
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraftFile.js
More file actions
20 lines (18 loc) · 849 Bytes
/
draftFile.js
File metadata and controls
20 lines (18 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Plug } from 'mindtouch-http.js/plug.js';
import { PageFileBase } from './pageFileBase.js';
import { Settings } from './lib/settings.js';
/**
* A class for managing a file attachment on an unpublished page.
*/
export class DraftFile extends PageFileBase {
/**
* Construct a new DraftFile
* @param {Number|String} [pageId='home'] - The ID of the unpublished page.
* @param {String} filename - The filename of the file to manage.
* @param {Settings} [settings] - The {@link Settings} information to use in construction. If not supplied, the default settings are used.
*/
constructor(pageId, filename, settings = new Settings()) {
super(pageId, filename);
this._plug = new Plug(settings.host, settings.plugConfig).at('@api', 'deki', 'drafts', this._pageId, 'files', this._filename);
}
}