@iebh/tera-fy 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.md CHANGED
@@ -79,60 +79,64 @@
79
79
  * [Parameters][75]
80
80
  * [getProjectFile][76]
81
81
  * [Parameters][77]
82
- * [handshake][78]
83
- * [Properties][79]
84
- * [User][80]
82
+ * [createProjectFile][78]
83
+ * [Parameters][79]
84
+ * [handshake][80]
85
85
  * [Properties][81]
86
- * [getUser][82]
87
- * [requireUser][83]
88
- * [Parameters][84]
89
- * [Project][85]
90
- * [getProject][86]
91
- * [getProjects][87]
92
- * [setActiveProject][88]
93
- * [Parameters][89]
94
- * [requireProject][90]
86
+ * [User][82]
87
+ * [Properties][83]
88
+ * [getUser][84]
89
+ * [requireUser][85]
90
+ * [Parameters][86]
91
+ * [Project][87]
92
+ * [getProject][88]
93
+ * [getProjects][89]
94
+ * [setActiveProject][90]
95
95
  * [Parameters][91]
96
- * [selectProject][92]
96
+ * [requireProject][92]
97
97
  * [Parameters][93]
98
- * [getProjectState][94]
98
+ * [selectProject][94]
99
99
  * [Parameters][95]
100
- * [setProjectState][96]
100
+ * [getProjectState][96]
101
101
  * [Parameters][97]
102
- * [setProjectStateDefaults][98]
102
+ * [setProjectState][98]
103
103
  * [Parameters][99]
104
- * [setProjectStateFlush][100]
105
- * [setProjectStateRefresh][101]
106
- * [saveProjectState][102]
107
- * [replaceProjectState][103]
108
- * [Parameters][104]
109
- * [applyProjectStatePatch][105]
104
+ * [setProjectStateDefaults][100]
105
+ * [Parameters][101]
106
+ * [setProjectStateFlush][102]
107
+ * [setProjectStateRefresh][103]
108
+ * [saveProjectState][104]
109
+ * [replaceProjectState][105]
110
110
  * [Parameters][106]
111
- * [subscribeProjectState][107]
112
- * [FileFilters][108]
113
- * [Properties][109]
114
- * [selectProjectFile][110]
115
- * [Parameters][111]
116
- * [setProjectFile][112]
111
+ * [applyProjectStatePatch][107]
112
+ * [Parameters][108]
113
+ * [subscribeProjectState][109]
114
+ * [FileFilters][110]
115
+ * [Properties][111]
116
+ * [selectProjectFile][112]
117
117
  * [Parameters][113]
118
- * [selectProjectLibrary][114]
118
+ * [deleteProjectFile][114]
119
119
  * [Parameters][115]
120
- * [getProjectLibrary][116]
120
+ * [setProjectFile][116]
121
121
  * [Parameters][117]
122
- * [setProjectLibrary][118]
122
+ * [selectProjectLibrary][118]
123
123
  * [Parameters][119]
124
- * [projectLog][120]
124
+ * [getProjectLibrary][120]
125
125
  * [Parameters][121]
126
- * [setPageUrl][122]
126
+ * [setProjectLibrary][122]
127
127
  * [Parameters][123]
128
- * [setPageTitle][124]
128
+ * [projectLog][124]
129
129
  * [Parameters][125]
130
- * [uiAlert][126]
130
+ * [setPageUrl][126]
131
131
  * [Parameters][127]
132
- * [uiSplat][128]
132
+ * [setPageTitle][128]
133
133
  * [Parameters][129]
134
- * [uiWindow][130]
134
+ * [uiAlert][130]
135
135
  * [Parameters][131]
136
+ * [uiSplat][132]
137
+ * [Parameters][133]
138
+ * [uiWindow][134]
139
+ * [Parameters][135]
136
140
 
137
141
  ## ProjectFile
138
142
 
@@ -142,113 +146,113 @@ A project file fetched from TERA
142
146
 
143
147
  A UUID string representing the unique ID of the file
144
148
 
145
- Type: [String][132]
149
+ Type: [String][136]
146
150
 
147
151
  ### name
148
152
 
149
153
  Relative name path (can contain prefix directories) for the human readable file name
150
154
 
151
- Type: [String][132]
155
+ Type: [String][136]
152
156
 
153
157
  ### icon
154
158
 
155
159
  CSS class to use as the file icon
156
160
 
157
- Type: [String][132]
161
+ Type: [String][136]
158
162
 
159
163
  ### path
160
164
 
161
165
  Full path to the file
162
166
  This is also used as the unique identifier within the project
163
167
 
164
- Type: [String][132]
168
+ Type: [String][136]
165
169
 
166
170
  ### url
167
171
 
168
172
  Fully qualified URL to view / access / download the file from TERA
169
173
  This will usually open an edit UI within the TERA site
170
174
 
171
- Type: [String][132]
175
+ Type: [String][136]
172
176
 
173
177
  ### teraUrl
174
178
 
175
179
  Rewrite of the URL where the absolute URL has been removed in place of a relative path, assuming the owner project is active
176
180
  This is used to direct to the edit/view/download UI when the files project is active and is usually used in place of URL for TERA related operations
177
181
 
178
- Type: [String][132]
182
+ Type: [String][136]
179
183
 
180
184
  ### parsedName
181
185
 
182
186
  An object representing meta file parts of a file name
183
187
 
184
- Type: [Object][133]
188
+ Type: [Object][137]
185
189
 
186
190
  #### Properties
187
191
 
188
- * `basename` **[String][132]** The filename + extention (i.e. everything without directory name)
189
- * `filename` **[String][132]** The file portion of the name (basename without the extension)
190
- * `ext` **[String][132]** The extension portion of the name (always lower case)
191
- * `dirName` **[String][132]** The directory path portion of the name
192
+ * `basename` **[String][136]** The filename + extention (i.e. everything without directory name)
193
+ * `filename` **[String][136]** The file portion of the name (basename without the extension)
194
+ * `ext` **[String][136]** The extension portion of the name (always lower case)
195
+ * `dirName` **[String][136]** The directory path portion of the name
192
196
 
193
197
  ### created
194
198
 
195
199
  A date representing when the file was created
196
200
 
197
- Type: [Date][134]
201
+ Type: [Date][138]
198
202
 
199
203
  ### createdFormatted
200
204
 
201
205
  A human readable, formatted version of "created"
202
206
 
203
- Type: [String][132]
207
+ Type: [String][136]
204
208
 
205
209
  ### modified
206
210
 
207
211
  A date representing when the file was created
208
212
 
209
- Type: [Date][134]
213
+ Type: [Date][138]
210
214
 
211
215
  ### modifiedFormatted
212
216
 
213
217
  A human readable, formatted version of "modified"
214
218
 
215
- Type: [String][132]
219
+ Type: [String][136]
216
220
 
217
221
  ### accessed
218
222
 
219
223
  A date representing when the file was last accessed
220
224
 
221
- Type: [Date][134]
225
+ Type: [Date][138]
222
226
 
223
227
  ### accessedFormatted
224
228
 
225
229
  A human readable, formatted version of "accessed"
226
230
 
227
- Type: [String][132]
231
+ Type: [String][136]
228
232
 
229
233
  ### size
230
234
 
231
235
  Size, in bytes, of the file
232
236
 
233
- Type: [Number][135]
237
+ Type: [Number][139]
234
238
 
235
239
  ### sizeFormatted
236
240
 
237
241
  A human readable, formatted version of the file size
238
242
 
239
- Type: [String][132]
243
+ Type: [String][136]
240
244
 
241
245
  ### mime
242
246
 
243
247
  The associated mime type for the file
244
248
 
245
- Type: [String][132]
249
+ Type: [String][136]
246
250
 
247
251
  ### meta
248
252
 
249
253
  Additional meta information for the file
250
254
 
251
- Type: [Object][133]
255
+ Type: [Object][137]
252
256
 
253
257
  ### getContents
254
258
 
@@ -266,9 +270,9 @@ Overwrite the contents of a file with new content
266
270
 
267
271
  #### Parameters
268
272
 
269
- * `contents` **(File | [Blob][136] | [FormData][137] | [Object][133] | [Array][138])** The new file contents
273
+ * `contents` **(File | [Blob][140] | [FormData][141] | [Object][137] | [Array][142])** The new file contents
270
274
 
271
- Returns **[Promise][139]** A promise which resolves when the operation has completed
275
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
272
276
 
273
277
  ### getRefs
274
278
 
@@ -276,7 +280,7 @@ Returns **[Promise][139]** A promise which resolves when the operation has compl
276
280
 
277
281
  Fetch the file contents as an array of Reflib refs
278
282
 
279
- Returns **[Promise][139]<[Array][138]\<Ref>>** An eventual array of RefLib references
283
+ Returns **[Promise][143]<[Array][142]\<Ref>>** An eventual array of RefLib references
280
284
 
281
285
  ### setRefs
282
286
 
@@ -287,18 +291,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
287
291
  #### Parameters
288
292
 
289
293
  * `refs` &#x20;
290
- * `Collection` **[Array][138]\<RefLibRef>** of references for the selected library
294
+ * `Collection` **[Array][142]\<RefLibRef>** of references for the selected library
291
295
 
292
- Returns **[Promise][139]** A promise which resolves when the operation has completed
296
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
293
297
 
294
298
  ### serialize
295
299
 
296
- * **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][140]
300
+ * **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][144]
297
301
 
298
302
  Compress a file state down into a serializable entity
299
303
  By default this computes a Structured Clone which can be stringified
300
304
 
301
- Returns **[Object][133]** A Structured Clone compatible representation of this ProjectFile instance
305
+ Returns **[Object][137]** A Structured Clone compatible representation of this ProjectFile instance
302
306
 
303
307
  ### deserialize
304
308
 
@@ -306,7 +310,7 @@ Restore an entity created with serialize
306
310
 
307
311
  #### Parameters
308
312
 
309
- * `data` **[Object][133]** An input object created via `ProjectFiles.serialize()`
313
+ * `data` **[Object][137]** An input object created via `ProjectFiles.serialize()`
310
314
 
311
315
  Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
312
316
 
@@ -326,19 +330,19 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
326
330
 
327
331
  Various settings to configure behaviour
328
332
 
329
- Type: [Object][133]
333
+ Type: [Object][137]
330
334
 
331
335
  #### Properties
332
336
 
333
- * `devMode` **[Boolean][141]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
334
- * `verbosity` **[Number][135]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
337
+ * `devMode` **[Boolean][145]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
338
+ * `verbosity` **[Number][139]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
335
339
  * `mode` **(`"detect"` | `"parent"` | `"child"` | `"popup"`)** How to communicate with TERA. 'parent' assumes that the parent of the current document is TERA, 'child' spawns an iFrame and uses TERA there, 'detect' tries parent and switches to `modeFallback` if communication fails
336
- * `modeFallback` **[String][132]** Method to use when all method detection fails
337
- * `modeTimeout` **[Number][135]** How long entities have in 'detect' mode to identify themselves
338
- * `siteUrl` **[String][132]** The TERA URL to connect to
339
- * `restrictOrigin` **[String][132]** URL to restrict communications to
340
- * `List` **[Array][138]<[String][132]>** of sandbox allowables for the embedded if in embed mode
341
- * `handshakeInterval` **[Number][135]** Interval in milliseconds when sanning for a handshake
340
+ * `modeFallback` **[String][136]** Method to use when all method detection fails
341
+ * `modeTimeout` **[Number][139]** How long entities have in 'detect' mode to identify themselves
342
+ * `siteUrl` **[String][136]** The TERA URL to connect to
343
+ * `restrictOrigin` **[String][136]** URL to restrict communications to
344
+ * `List` **[Array][142]<[String][136]>** of sandbox allowables for the embedded if in embed mode
345
+ * `handshakeInterval` **[Number][139]** Interval in milliseconds when sanning for a handshake
342
346
 
343
347
  ### events
344
348
 
@@ -350,13 +354,13 @@ Type: Mitt
350
354
 
351
355
  DOMElements for this TeraFy instance
352
356
 
353
- Type: [Object][133]
357
+ Type: [Object][137]
354
358
 
355
359
  #### Properties
356
360
 
357
361
  * `el` **DOMElement** The main tera-fy div wrapper
358
362
  * `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
359
- * `popup` **[Window][142]** The popup window context (if `settings.mode == 'popup'`)
363
+ * `popup` **[Window][146]** The popup window context (if `settings.mode == 'popup'`)
360
364
  * `stylesheet` **DOMElement** The corresponding stylesheet
361
365
 
362
366
  ### methods
@@ -364,13 +368,13 @@ Type: [Object][133]
364
368
  List of function stubs mapped from the server to here
365
369
  This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
366
370
 
367
- Type: [Array][138]<[String][132]>
371
+ Type: [Array][142]<[String][136]>
368
372
 
369
373
  ### plugins
370
374
 
371
375
  Loaded plugins via Use()
372
376
 
373
- Type: [Array][138]\<TeraFyPlugin>
377
+ Type: [Array][142]\<TeraFyPlugin>
374
378
 
375
379
  ### send
376
380
 
@@ -378,9 +382,9 @@ Send a message + wait for a response object
378
382
 
379
383
  #### Parameters
380
384
 
381
- * `message` **[Object][133]** Message object to send
385
+ * `message` **[Object][137]** Message object to send
382
386
 
383
- Returns **[Promise][139]\<any>** A promise which resolves when the operation has completed with the remote reply
387
+ Returns **[Promise][143]\<any>** A promise which resolves when the operation has completed with the remote reply
384
388
 
385
389
  ### sendRaw
386
390
 
@@ -389,7 +393,7 @@ This function does not return or wait for a reply - use `send()` for that
389
393
 
390
394
  #### Parameters
391
395
 
392
- * `message` **[Object][133]** Message object to send
396
+ * `message` **[Object][137]** Message object to send
393
397
 
394
398
  ### rpc
395
399
 
@@ -397,10 +401,10 @@ Call an RPC function in the server instance
397
401
 
398
402
  #### Parameters
399
403
 
400
- * `method` **[String][132]** The method name to call
404
+ * `method` **[String][136]** The method name to call
401
405
  * `args` **...any**&#x20;
402
406
 
403
- Returns **[Promise][139]\<any>** The resolved output of the server function
407
+ Returns **[Promise][143]\<any>** The resolved output of the server function
404
408
 
405
409
  ### acceptMessage
406
410
 
@@ -409,7 +413,7 @@ Accept an incoming message
409
413
  #### Parameters
410
414
 
411
415
  * `rawMessage` &#x20;
412
- * `Raw` **[MessageEvent][143]** message event to process
416
+ * `Raw` **[MessageEvent][147]** message event to process
413
417
 
414
418
  ### acceptPostboxes
415
419
 
@@ -418,27 +422,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
418
422
  ### createProjectStatePatch
419
423
 
420
424
  Create + transmit a new project state patch base on the current and previous states
421
- The transmitted patch follows the [JSPatch][144] standard
425
+ The transmitted patch follows the [JSPatch][148] standard
422
426
  This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
423
427
 
424
428
  #### Parameters
425
429
 
426
- * `newState` **[Object][133]** The local projectState to accept
427
- * `oldState` **[Object][133]** The previous projectState to examine against
430
+ * `newState` **[Object][137]** The local projectState to accept
431
+ * `oldState` **[Object][137]** The previous projectState to examine against
428
432
 
429
- Returns **[Promise][139]** A promise which will resolve when the operation has completed
433
+ Returns **[Promise][143]** A promise which will resolve when the operation has completed
430
434
 
431
435
  ### applyProjectStatePatchLocal
432
436
 
433
437
  Client function which accepts a patch from the server and applies it to local project state
434
- The patch should follow the [JSPatch][144] standard
438
+ The patch should follow the [JSPatch][148] standard
435
439
  This function is expected to be sub-classed by a plugin
436
440
 
437
441
  #### Parameters
438
442
 
439
- * `patch` **[Array][138]** A JSPatch patch to apply
443
+ * `patch` **[Array][142]** A JSPatch patch to apply
440
444
 
441
- Returns **[Promise][139]** A promise which will resolve when the operation has completed
445
+ Returns **[Promise][143]** A promise which will resolve when the operation has completed
442
446
 
443
447
  ### init
444
448
 
@@ -447,28 +451,28 @@ This function can only be called once and will return the existing init() worker
447
451
 
448
452
  #### Parameters
449
453
 
450
- * `options` **[Object][133]?** Additional options to merge into `settings` via `set`
454
+ * `options` **[Object][137]?** Additional options to merge into `settings` via `set`
451
455
 
452
- Returns **[Promise][139]<[TeraFy][31]>** An eventual promise which will resovle with this terafy instance
456
+ Returns **[Promise][143]<[TeraFy][31]>** An eventual promise which will resovle with this terafy instance
453
457
 
454
458
  ### detectMode
455
459
 
456
460
  Populate `settings.mode`
457
461
  Try to communicate with a parent frame, if none assume we need to fallback to child mode
458
462
 
459
- Returns **[Promise][139]<[String][132]>** A promise which will resolve with the detected mode to use
463
+ Returns **[Promise][143]<[String][136]>** A promise which will resolve with the detected mode to use
460
464
 
461
465
  ### injectComms
462
466
 
463
467
  Find an existing active TERA server OR initalize one
464
468
 
465
- Returns **[Promise][139]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
469
+ Returns **[Promise][143]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
466
470
 
467
471
  ### injectStylesheet
468
472
 
469
473
  Inject a local stylesheet to handle TERA server functionality
470
474
 
471
- Returns **[Promise][139]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
475
+ Returns **[Promise][143]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
472
476
 
473
477
  ### injectMethods
474
478
 
@@ -483,7 +487,7 @@ This function will only act if `settings.devMode` is truthy
483
487
 
484
488
  * `msg` **...any**&#x20;
485
489
  * `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
486
- * `verboseLevel` **[Number][135]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
490
+ * `verboseLevel` **[Number][139]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
487
491
 
488
492
  ### set
489
493
 
@@ -492,7 +496,7 @@ This function also routes 'special' keys like `devMode` to their internal handle
492
496
 
493
497
  #### Parameters
494
498
 
495
- * `key` **([String][132] | [Object][133])** Either a single setting key to set or an object to merge
499
+ * `key` **([String][136] | [Object][137])** Either a single setting key to set or an object to merge
496
500
  * `value` **any** The value to set if `key` is a string
497
501
 
498
502
  Returns **[TeraFy][31]** This chainable terafy instance
@@ -505,7 +509,7 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
505
509
 
506
510
  #### Parameters
507
511
 
508
- * `key` **([String][132] | [Object][133])** Either a single setting key to set or an object to merge
512
+ * `key` **([String][136] | [Object][137])** Either a single setting key to set or an object to merge
509
513
  * `value` **any** The value to set if `key` is a string
510
514
 
511
515
  Returns **[TeraFy][31]** This chainable terafy instance
@@ -517,8 +521,8 @@ Include a TeraFy client plugin
517
521
  #### Parameters
518
522
 
519
523
  * `mod` &#x20;
520
- * `options` **[Object][133]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
521
- * `The` **[Object][133]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
524
+ * `options` **[Object][137]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
525
+ * `The` **[Object][137]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
522
526
 
523
527
  Returns **[TeraFy][31]** This chainable terafy instance
524
528
 
@@ -528,8 +532,8 @@ Internal function used by use() to merge an external declared singleton against
528
532
 
529
533
  #### Parameters
530
534
 
531
- * `target` **[Object][133]** Initalied class instance to extend
532
- * `source` **[Object][133]** Initalized source object to extend from
535
+ * `target` **[Object][137]** Initalied class instance to extend
536
+ * `source` **[Object][137]** Initalized source object to extend from
533
537
 
534
538
  ### toggleDevMode
535
539
 
@@ -537,7 +541,7 @@ Set or toggle devMode
537
541
 
538
542
  #### Parameters
539
543
 
540
- * `devModeEnabled` **([String][132] | [Boolean][141])** Optional boolean to force dev mode (optional, default `'toggle'`)
544
+ * `devModeEnabled` **([String][136] | [Boolean][145])** Optional boolean to force dev mode (optional, default `'toggle'`)
541
545
 
542
546
  Returns **[TeraFy][31]** This chainable terafy instance
543
547
 
@@ -548,7 +552,7 @@ This is usually because the server component wants to perform some user activity
548
552
 
549
553
  #### Parameters
550
554
 
551
- * `isFocused` **([String][132] | [Boolean][141])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
555
+ * `isFocused` **([String][136] | [Boolean][145])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
552
556
 
553
557
  ### selectProjectFile
554
558
 
@@ -560,7 +564,7 @@ This is an pre-requisite step for requireProject()
560
564
 
561
565
  * `options` &#x20;
562
566
 
563
- Returns **[Promise][139]** A promise which will resolve if the there is a user and they are logged in
567
+ Returns **[Promise][143]** A promise which will resolve if the there is a user and they are logged in
564
568
 
565
569
  ### getProjectFiles
566
570
 
@@ -568,22 +572,38 @@ Fetch the files associated with a given project
568
572
 
569
573
  #### Parameters
570
574
 
571
- * `options` **[Object][133]** Options which mutate behaviour
575
+ * `options` **[Object][137]** Options which mutate behaviour
572
576
 
573
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
574
- * `options.meta` **[Boolean][141]** Pull meta information for each file entity (optional, default `true`)
577
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
578
+ * `options.meta` **[Boolean][145]** Pull meta information for each file entity (optional, default `true`)
575
579
 
576
- Returns **[Promise][139]<[Array][138]<[ProjectFile][1]>>** A collection of project files for the given project
580
+ Returns **[Promise][143]<[Array][142]<[ProjectFile][1]>>** A collection of project files for the given project
577
581
 
578
582
  ### getProjectFile
579
583
 
580
- Fetch a project file
584
+ Fetch a project file by its name
581
585
 
582
586
  #### Parameters
583
587
 
584
- * `id` **[String][132]** File ID to read
588
+ * `id` &#x20;
589
+ * `name` **[String][136]** The name + relative directory path component
590
+ * `options` **([Object][137] | [String][136])?** Additional options to mutate behaviour, if a string is given `options.subkey` is assumed
585
591
 
586
- Returns **[Promise][139]<[Blob][136]>** The eventual fetched file as a blob
592
+ * `options.subkey` **[String][136]?** If specified only the extracted subkey is returned rather than the full object
593
+ * `options.cache` **[Boolean][145]** Use the existing file cache if possible, set to false to force a refresh of files from the server first (optional, default `true`)
594
+
595
+ Returns **[Promise][143]<[ProjectFile][1]>** The eventual fetched ProjectFile (or requested subkey)
596
+
597
+ ### createProjectFile
598
+
599
+ Create a new file
600
+ This creates an empty file which can then be written to
601
+
602
+ #### Parameters
603
+
604
+ * `name` **[String][136]** The name + relative directory path component
605
+
606
+ Returns **[Promise][143]<[ProjectFile][1]>** The eventual ProjectFile created
587
607
 
588
608
  ## handshake
589
609
 
@@ -591,9 +611,9 @@ Return basic server information as a form of validation
591
611
 
592
612
  ### Properties
593
613
 
594
- * `date` **[Date][134]** Server date
614
+ * `date` **[Date][138]** Server date
595
615
 
596
- Returns **[Promise][139]<[Object][133]>** Basic promise result
616
+ Returns **[Promise][143]<[Object][137]>** Basic promise result
597
617
 
598
618
  ## User
599
619
 
@@ -601,16 +621,16 @@ User / active session within TERA
601
621
 
602
622
  ### Properties
603
623
 
604
- * `id` **[String][132]** Unique identifier of the user
605
- * `email` **[String][132]** The email address of the current user
606
- * `name` **[String][132]** The provided full name of the user
607
- * `isSubscribed` **[Boolean][141]** Whether the active user has a TERA subscription
624
+ * `id` **[String][136]** Unique identifier of the user
625
+ * `email` **[String][136]** The email address of the current user
626
+ * `name` **[String][136]** The provided full name of the user
627
+ * `isSubscribed` **[Boolean][145]** Whether the active user has a TERA subscription
608
628
 
609
629
  ## getUser
610
630
 
611
631
  Fetch the current session user
612
632
 
613
- Returns **[Promise][139]<[User][80]>** The current logged in user or null if none
633
+ Returns **[Promise][143]<[User][82]>** The current logged in user or null if none
614
634
 
615
635
  ## requireUser
616
636
 
@@ -620,11 +640,11 @@ This is an pre-requisite step for requireProject()
620
640
 
621
641
  ### Parameters
622
642
 
623
- * `options` **[Object][133]?** Additional options to mutate behaviour
643
+ * `options` **[Object][137]?** Additional options to mutate behaviour
624
644
 
625
- * `options.forceRetry` **[Boolean][141]** Forcabily try to refresh the user state (optional, default `false`)
645
+ * `options.forceRetry` **[Boolean][145]** Forcabily try to refresh the user state (optional, default `false`)
626
646
 
627
- Returns **[Promise][139]<[User][80]>** The current logged in user or null if none
647
+ Returns **[Promise][143]<[User][82]>** The current logged in user or null if none
628
648
 
629
649
  ## Project
630
650
 
@@ -634,13 +654,13 @@ Project entry within TERA
634
654
 
635
655
  Get the currently active project, if any
636
656
 
637
- Returns **[Promise][139]<([Project][85] | null)>** The currently active project, if any
657
+ Returns **[Promise][143]<([Project][87] | null)>** The currently active project, if any
638
658
 
639
659
  ## getProjects
640
660
 
641
661
  Get a list of projects the current session user has access to
642
662
 
643
- Returns **[Promise][139]<[Array][138]<[Project][85]>>** Collection of projects the user has access to
663
+ Returns **[Promise][143]<[Array][142]<[Project][87]>>** Collection of projects the user has access to
644
664
 
645
665
  ## setActiveProject
646
666
 
@@ -648,7 +668,7 @@ Set the currently active project within TERA
648
668
 
649
669
  ### Parameters
650
670
 
651
- * `project` **([Object][133] | [String][132])** The project to set as active - either the full Project object or its ID
671
+ * `project` **([Object][137] | [String][136])** The project to set as active - either the full Project object or its ID
652
672
 
653
673
  ## requireProject
654
674
 
@@ -657,14 +677,14 @@ Note that this function will percist in asking the uesr even if they try to canc
657
677
 
658
678
  ### Parameters
659
679
 
660
- * `options` **[Object][133]?** Additional options to mutate behaviour
680
+ * `options` **[Object][137]?** Additional options to mutate behaviour
661
681
 
662
- * `options.autoSetActiveProject` **[Boolean][141]** After selecting a project set that project as active in TERA (optional, default `true`)
663
- * `options.title` **[String][132]** The title of the dialog to display (optional, default `"Select a project to work with"`)
664
- * `options.noSelectTitle` **[String][132]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
665
- * `options.noSelectBody` **[String][132]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
682
+ * `options.autoSetActiveProject` **[Boolean][145]** After selecting a project set that project as active in TERA (optional, default `true`)
683
+ * `options.title` **[String][136]** The title of the dialog to display (optional, default `"Select a project to work with"`)
684
+ * `options.noSelectTitle` **[String][136]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
685
+ * `options.noSelectBody` **[String][136]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
666
686
 
667
- Returns **[Promise][139]<[Project][85]>** The active project
687
+ Returns **[Promise][143]<[Project][87]>** The active project
668
688
 
669
689
  ## selectProject
670
690
 
@@ -672,13 +692,13 @@ Prompt the user to select a project from those available
672
692
 
673
693
  ### Parameters
674
694
 
675
- * `options` **[Object][133]?** Additional options to mutate behaviour
695
+ * `options` **[Object][137]?** Additional options to mutate behaviour
676
696
 
677
- * `options.title` **[String][132]** The title of the dialog to display (optional, default `"Select a project to work with"`)
678
- * `options.allowCancel` **[Boolean][141]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
679
- * `options.setActive` **[Boolean][141]** Also set the project as active when selected (optional, default `false`)
697
+ * `options.title` **[String][136]** The title of the dialog to display (optional, default `"Select a project to work with"`)
698
+ * `options.allowCancel` **[Boolean][145]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
699
+ * `options.setActive` **[Boolean][145]** Also set the project as active when selected (optional, default `false`)
680
700
 
681
- Returns **[Promise][139]<[Project][85]>** The active project
701
+ Returns **[Promise][143]<[Project][87]>** The active project
682
702
 
683
703
  ## getProjectState
684
704
 
@@ -686,12 +706,12 @@ Return the current, full snapshot state of the active project
686
706
 
687
707
  ### Parameters
688
708
 
689
- * `options` **[Object][133]?** Additional options to mutate behaviour
709
+ * `options` **[Object][137]?** Additional options to mutate behaviour
690
710
 
691
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
692
- * `Paths` **[Array][138]<[String][132]>** to subscribe to e.g. \['/users/'],
711
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
712
+ * `Paths` **[Array][142]<[String][136]>** to subscribe to e.g. \['/users/'],
693
713
 
694
- Returns **[Promise][139]<[Object][133]>** The current project state snapshot
714
+ Returns **[Promise][143]<[Object][137]>** The current project state snapshot
695
715
 
696
716
  ## setProjectState
697
717
 
@@ -703,13 +723,13 @@ Paths can be any valid Lodash.set() value such as:
703
723
 
704
724
  ### Parameters
705
725
 
706
- * `path` **([String][132] | [Array][138]<[String][132]>)** The sub-path within the project state to set
726
+ * `path` **([String][136] | [Array][142]<[String][136]>)** The sub-path within the project state to set
707
727
  * `value` **any** The value to set
708
- * `options` **[Object][133]?** Additional options to mutate behaviour
728
+ * `options` **[Object][137]?** Additional options to mutate behaviour
709
729
 
710
- * `options.save` **[Boolean][141]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
730
+ * `options.save` **[Boolean][145]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
711
731
 
712
- Returns **[Promise][139]** A promise which resolves when the operation has been dispatched to the server
732
+ Returns **[Promise][143]** A promise which resolves when the operation has been dispatched to the server
713
733
 
714
734
  ## setProjectStateDefaults
715
735
 
@@ -719,31 +739,31 @@ Set a nested value within the project state - just like `setProjectState()` - bu
719
739
 
720
740
  ### Parameters
721
741
 
722
- * `path` **([String][132] | [Array][138]<[String][132]>)** The sub-path within the project state to set
742
+ * `path` **([String][136] | [Array][142]<[String][136]>)** The sub-path within the project state to set
723
743
  * `value` **any** The value to set
724
- * `options` **[Object][133]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
744
+ * `options` **[Object][137]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
725
745
 
726
- Returns **[Promise][139]<[Boolean][141]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
746
+ Returns **[Promise][143]<[Boolean][145]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
727
747
 
728
748
  ## setProjectStateFlush
729
749
 
730
750
  Force copying local changes to the server
731
751
  This is only ever needed when saving large quantities of data that need to be immediately available
732
752
 
733
- Returns **[Promise][139]** A promise which resolves when the operation has completed
753
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
734
754
 
735
755
  ## setProjectStateRefresh
736
756
 
737
757
  Force refetching the remote project state into local
738
758
  This is only ever needed when saving large quantities of data that need to be immediately available
739
759
 
740
- Returns **[Promise][139]** A promise which resolves when the operation has completed
760
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
741
761
 
742
762
  ## saveProjectState
743
763
 
744
764
  Force-Save the currently active project state
745
765
 
746
- Returns **[Promise][139]** A promise which resolves when the operation has completed
766
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
747
767
 
748
768
  ## replaceProjectState
749
769
 
@@ -754,9 +774,9 @@ You almost never want to use this function directly, see `setProjectState(path,
754
774
 
755
775
  ### Parameters
756
776
 
757
- * `newState` **[Object][133]** The new state to replace the current state with
777
+ * `newState` **[Object][137]** The new state to replace the current state with
758
778
 
759
- Returns **[Promise][139]** A promise which resolves when the operation has completed
779
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
760
780
 
761
781
  ## applyProjectStatePatch
762
782
 
@@ -764,9 +784,9 @@ Apply a computed `just-diff` patch to the current project state
764
784
 
765
785
  ### Parameters
766
786
 
767
- * `Patch` **[Object][133]** to apply
787
+ * `Patch` **[Object][137]** to apply
768
788
 
769
- Returns **[Promise][139]** A promise which resolves when the operation has completed
789
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
770
790
 
771
791
  ## subscribeProjectState
772
792
 
@@ -774,7 +794,7 @@ Subscribe to project state changes
774
794
  This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
775
795
  If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
776
796
 
777
- Returns **[Promise][139]<[Function][145]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
797
+ Returns **[Promise][143]<[Function][149]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
778
798
 
779
799
  ## FileFilters
780
800
 
@@ -782,10 +802,10 @@ Data structure for a file filter
782
802
 
783
803
  ### Properties
784
804
 
785
- * `library` **[Boolean][141]?** Restrict to library files only
786
- * `filename` **[String][132]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
787
- * `basename` **[String][132]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
788
- * `ext` **[String][132]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
805
+ * `library` **[Boolean][145]?** Restrict to library files only
806
+ * `filename` **[String][136]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
807
+ * `basename` **[String][136]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
808
+ * `ext` **[String][136]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
789
809
 
790
810
  ## selectProjectFile
791
811
 
@@ -793,20 +813,30 @@ Prompt the user to select a library to operate on
793
813
 
794
814
  ### Parameters
795
815
 
796
- * `options` **[Object][133]?** Additional options to mutate behaviour
816
+ * `options` **[Object][137]?** Additional options to mutate behaviour
817
+
818
+ * `options.title` **[String][136]** The title of the dialog to display (optional, default `"Select a file"`)
819
+ * `options.hint` **([String][136] | [Array][142]<[String][136]>)?** Hints to identify the file to select in array order of preference
820
+ * `options.save` **[Boolean][145]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
821
+ * `options.filters` **[FileFilters][110]?** Optional file filters
822
+ * `options.allowUpload` **[Boolean][145]** Allow uploading new files (optional, default `true`)
823
+ * `options.allowRefresh` **[Boolean][145]** Allow the user to manually refresh the file list (optional, default `true`)
824
+ * `options.allowDownloadZip` **[Boolean][145]** Allow the user to download a Zip of all files (optional, default `true`)
825
+ * `options.allowCancel` **[Boolean][145]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
826
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
827
+ * `options.filter` **[FileFilters][110]?** Optional file filters
828
+
829
+ Returns **[Promise][143]<[ProjectFile][1]>** The eventually selected file, if in save mode new files are created as stubs
797
830
 
798
- * `options.title` **[String][132]** The title of the dialog to display (optional, default `"Select a file"`)
799
- * `options.hint` **([String][132] | [Array][138]<[String][132]>)?** Hints to identify the file to select in array order of preference
800
- * `options.save` **[Boolean][141]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
801
- * `options.filters` **[FileFilters][108]?** Optional file filters
802
- * `options.allowUpload` **[Boolean][141]** Allow uploading new files (optional, default `true`)
803
- * `options.allowRefresh` **[Boolean][141]** Allow the user to manually refresh the file list (optional, default `true`)
804
- * `options.allowDownloadZip` **[Boolean][141]** Allow the user to download a Zip of all files (optional, default `true`)
805
- * `options.allowCancel` **[Boolean][141]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
806
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
807
- * `options.filter` **[FileFilters][108]?** Optional file filters
831
+ ## deleteProjectFile
808
832
 
809
- Returns **[Promise][139]<[ProjectFile][1]>** The eventually selected file
833
+ Remove a project file by its ID
834
+
835
+ ### Parameters
836
+
837
+ * `id` **[String][136]** The File ID to remove
838
+
839
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
810
840
 
811
841
  ## setProjectFile
812
842
 
@@ -814,10 +844,10 @@ Replace a project files contents
814
844
 
815
845
  ### Parameters
816
846
 
817
- * `id` **[String][132]** File to overwrite
818
- * `contents` **(File | [Blob][136] | [FormData][137] | [Object][133] | [Array][138])** The new file contents
847
+ * `id` **[String][136]** File to overwrite
848
+ * `contents` **(File | [Blob][140] | [FormData][141] | [Object][137] | [Array][142])** The new file contents
819
849
 
820
- Returns **[Promise][139]** A promise which will resolve when the write operation has completed
850
+ Returns **[Promise][143]** A promise which will resolve when the write operation has completed
821
851
 
822
852
  ## selectProjectLibrary
823
853
 
@@ -825,18 +855,18 @@ Prompt the user to select a library to operate on and return a array of referenc
825
855
 
826
856
  ### Parameters
827
857
 
828
- * `options` **[Object][133]?** Additional options to mutate behaviour
858
+ * `options` **[Object][137]?** Additional options to mutate behaviour
829
859
 
830
- * `options.title` **[String][132]** The title of the dialog to display (optional, default `"Select a citation library"`)
831
- * `options.hint` **([String][132] | [Array][138]<[String][132]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
832
- * `options.allowUpload` **[Boolean][141]** Allow uploading new files (optional, default `true`)
833
- * `options.allowRefresh` **[Boolean][141]** Allow the user to manually refresh the file list (optional, default `true`)
834
- * `options.allowDownloadZip` **[Boolean][141]** Allow the user to download a Zip of all files (optional, default `true`)
835
- * `options.allowCancel` **[Boolean][141]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
836
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
837
- * `options.filters` **[FileFilters][108]?** Optional file filters, defaults to citation library selection only
860
+ * `options.title` **[String][136]** The title of the dialog to display (optional, default `"Select a citation library"`)
861
+ * `options.hint` **([String][136] | [Array][142]<[String][136]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
862
+ * `options.allowUpload` **[Boolean][145]** Allow uploading new files (optional, default `true`)
863
+ * `options.allowRefresh` **[Boolean][145]** Allow the user to manually refresh the file list (optional, default `true`)
864
+ * `options.allowDownloadZip` **[Boolean][145]** Allow the user to download a Zip of all files (optional, default `true`)
865
+ * `options.allowCancel` **[Boolean][145]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
866
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
867
+ * `options.filters` **[FileFilters][110]?** Optional file filters, defaults to citation library selection only
838
868
 
839
- Returns **[Promise][139]<[Array][138]\<Ref>>** A collection of references from the selected file
869
+ Returns **[Promise][143]<[Array][142]\<Ref>>** A collection of references from the selected file
840
870
 
841
871
  ## getProjectLibrary
842
872
 
@@ -844,15 +874,15 @@ Fetch + convert a project file into a library of citations
844
874
 
845
875
  ### Parameters
846
876
 
847
- * `id` **[String][132]** File ID to read
848
- * `options` **[Object][133]?** Additional options to mutate behaviour
877
+ * `id` **[String][136]** File ID to read
878
+ * `options` **[Object][137]?** Additional options to mutate behaviour
849
879
 
850
- * `options.format` **[String][132]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
851
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
852
- * `options.filter` **[Function][145]?** Optional async file filter, called each time as `(File:ProjectFile)`
853
- * `options.find` **[Function][145]?** Optional async final stage file filter to reduce all candidates down to one subject file
880
+ * `options.format` **[String][136]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
881
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
882
+ * `options.filter` **[Function][149]?** Optional async file filter, called each time as `(File:ProjectFile)`
883
+ * `options.find` **[Function][149]?** Optional async final stage file filter to reduce all candidates down to one subject file
854
884
 
855
- Returns **([Promise][139]<[Array][138]\<Ref>> | [Promise][139]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
885
+ Returns **([Promise][143]<[Array][142]\<Ref>> | [Promise][143]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
856
886
 
857
887
  ## setProjectLibrary
858
888
 
@@ -860,33 +890,33 @@ Save back a citation library from some input
860
890
 
861
891
  ### Parameters
862
892
 
863
- * `id` **[String][132]?** File ID to save back to, if omitted a file will be prompted for
864
- * `refs` **([Array][138]\<RefLibRef> | [Blob][136] | File)?** Collection of references for the selected library or the raw Blob/File
865
- * `options` **[Object][133]?** Additional options to mutate behaviour
893
+ * `id` **[String][136]?** File ID to save back to, if omitted a file will be prompted for
894
+ * `refs` **([Array][142]\<RefLibRef> | [Blob][140] | File)?** Collection of references for the selected library or the raw Blob/File
895
+ * `options` **[Object][137]?** Additional options to mutate behaviour
866
896
 
867
- * `options.id` **[String][132]?** Alternate method to specify the file ID to save as, if omitted one will be prompted for
868
- * `options.refs` **([Array][138]\<RefLibRef> | [Blob][136] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
869
- * `options.format` **[String][132]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
870
- * `options.autoRequire` **[Boolean][141]** Run `requireProject()` automatically before continuing (optional, default `true`)
871
- * `options.hint` **[String][132]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
872
- * `options.filename` **[String][132]?** Suggested filename if `id` is unspecified
873
- * `options.title` **[String][132]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
874
- * `options.overwrite` **[Boolean][141]** Allow existing file upsert (optional, default `true`)
875
- * `options.meta` **[Object][133]?** Optional meta data to merge into the file data
897
+ * `options.id` **[String][136]?** Alternate method to specify the file ID to save as, if omitted one will be prompted for
898
+ * `options.refs` **([Array][142]\<RefLibRef> | [Blob][140] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
899
+ * `options.format` **[String][136]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
900
+ * `options.autoRequire` **[Boolean][145]** Run `requireProject()` automatically before continuing (optional, default `true`)
901
+ * `options.hint` **[String][136]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
902
+ * `options.filename` **[String][136]?** Suggested filename if `id` is unspecified
903
+ * `options.title` **[String][136]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
904
+ * `options.overwrite` **[Boolean][145]** Allow existing file upsert (optional, default `true`)
905
+ * `options.meta` **[Object][137]?** Optional meta data to merge into the file data
876
906
 
877
- Returns **[Promise][139]** A promise which resolves when the save operation has completed
907
+ Returns **[Promise][143]** A promise which resolves when the save operation has completed
878
908
 
879
909
  ## projectLog
880
910
 
881
911
  Create a log entry for the currently active project
882
912
 
883
- The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][146] for the full list
913
+ The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][150] for the full list
884
914
 
885
915
  ### Parameters
886
916
 
887
- * `log` **[Object][133]** The log entry to create
917
+ * `log` **[Object][137]** The log entry to create
888
918
 
889
- Returns **[Promise][139]** A promise which resolves when the operation has completed
919
+ Returns **[Promise][143]** A promise which resolves when the operation has completed
890
920
 
891
921
  ## setPageUrl
892
922
 
@@ -895,7 +925,7 @@ This only really makes a difference to tools within the tera-tools.com site wher
895
925
 
896
926
  ### Parameters
897
927
 
898
- * `url` **[String][132]** The URL to restore on next refresh
928
+ * `url` **[String][136]** The URL to restore on next refresh
899
929
 
900
930
  ## setPageTitle
901
931
 
@@ -904,7 +934,7 @@ This is usually called by a tool nested within the tera-tools.com embed
904
934
 
905
935
  ### Parameters
906
936
 
907
- * `title` **[String][132]** The current page title
937
+ * `title` **[String][136]** The current page title
908
938
 
909
939
  ## uiAlert
910
940
 
@@ -912,13 +942,13 @@ Display simple text within TERA
912
942
 
913
943
  ### Parameters
914
944
 
915
- * `text` **[String][132]** The text to display
916
- * `options` **[Object][133]?** Additional options to mutate behaviour
945
+ * `text` **[String][136]** The text to display
946
+ * `options` **[Object][137]?** Additional options to mutate behaviour
917
947
 
918
- * `options.title` **[String][132]** The title of the alert box (optional, default `'TERA'`)
919
- * `options.isHtml` **[Boolean][141]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
948
+ * `options.title` **[String][136]** The title of the alert box (optional, default `'TERA'`)
949
+ * `options.isHtml` **[Boolean][145]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
920
950
 
921
- Returns **[Promise][139]** A promise which resolves when the alert has been dismissed
951
+ Returns **[Promise][143]** A promise which resolves when the alert has been dismissed
922
952
 
923
953
  ## uiSplat
924
954
 
@@ -927,10 +957,10 @@ This function is ideally called within a requestFocus() wrapper
927
957
 
928
958
  ### Parameters
929
959
 
930
- * `content` **(DOMElement | [String][132] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
931
- * `options` **[Object][133]?** Additional options to mutate behaviour
960
+ * `content` **(DOMElement | [String][136] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
961
+ * `options` **[Object][137]?** Additional options to mutate behaviour
932
962
 
933
- * `options.logo` **([Boolean][141] | [String][132])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
963
+ * `options.logo` **([Boolean][145] | [String][136])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
934
964
 
935
965
  ## uiWindow
936
966
 
@@ -938,13 +968,13 @@ Open a popup window containing a new site
938
968
 
939
969
  ### Parameters
940
970
 
941
- * `url` **[String][132]** The URL to open
942
- * `options` **[Object][133]?** Additional options to mutate behaviour
971
+ * `url` **[String][136]** The URL to open
972
+ * `options` **[Object][137]?** Additional options to mutate behaviour
943
973
 
944
- * `options.width` **[Number][135]** The desired width of the window (optional, default `500`)
945
- * `options.height` **[Number][135]** The desired height of the window (optional, default `600`)
946
- * `options.center` **[Boolean][141]** Attempt to center the window on the screen (optional, default `true`)
947
- * `options.permissions` **[Object][133]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
974
+ * `options.width` **[Number][139]** The desired width of the window (optional, default `500`)
975
+ * `options.height` **[Number][139]** The desired height of the window (optional, default `600`)
976
+ * `options.center` **[Boolean][145]** Attempt to center the window on the screen (optional, default `true`)
977
+ * `options.permissions` **[Object][137]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
948
978
 
949
979
  Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
950
980
 
@@ -1102,140 +1132,148 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
1102
1132
 
1103
1133
  [77]: #parameters-20
1104
1134
 
1105
- [78]: #handshake
1135
+ [78]: #createprojectfile
1106
1136
 
1107
- [79]: #properties-3
1137
+ [79]: #parameters-21
1108
1138
 
1109
- [80]: #user
1139
+ [80]: #handshake
1110
1140
 
1111
- [81]: #properties-4
1141
+ [81]: #properties-3
1112
1142
 
1113
- [82]: #getuser
1143
+ [82]: #user
1114
1144
 
1115
- [83]: #requireuser
1145
+ [83]: #properties-4
1116
1146
 
1117
- [84]: #parameters-21
1147
+ [84]: #getuser
1118
1148
 
1119
- [85]: #project
1149
+ [85]: #requireuser
1120
1150
 
1121
- [86]: #getproject
1151
+ [86]: #parameters-22
1122
1152
 
1123
- [87]: #getprojects
1153
+ [87]: #project
1124
1154
 
1125
- [88]: #setactiveproject
1155
+ [88]: #getproject
1126
1156
 
1127
- [89]: #parameters-22
1157
+ [89]: #getprojects
1128
1158
 
1129
- [90]: #requireproject
1159
+ [90]: #setactiveproject
1130
1160
 
1131
1161
  [91]: #parameters-23
1132
1162
 
1133
- [92]: #selectproject
1163
+ [92]: #requireproject
1134
1164
 
1135
1165
  [93]: #parameters-24
1136
1166
 
1137
- [94]: #getprojectstate
1167
+ [94]: #selectproject
1138
1168
 
1139
1169
  [95]: #parameters-25
1140
1170
 
1141
- [96]: #setprojectstate
1171
+ [96]: #getprojectstate
1142
1172
 
1143
1173
  [97]: #parameters-26
1144
1174
 
1145
- [98]: #setprojectstatedefaults
1175
+ [98]: #setprojectstate
1146
1176
 
1147
1177
  [99]: #parameters-27
1148
1178
 
1149
- [100]: #setprojectstateflush
1179
+ [100]: #setprojectstatedefaults
1150
1180
 
1151
- [101]: #setprojectstaterefresh
1181
+ [101]: #parameters-28
1152
1182
 
1153
- [102]: #saveprojectstate
1183
+ [102]: #setprojectstateflush
1154
1184
 
1155
- [103]: #replaceprojectstate
1185
+ [103]: #setprojectstaterefresh
1156
1186
 
1157
- [104]: #parameters-28
1187
+ [104]: #saveprojectstate
1158
1188
 
1159
- [105]: #applyprojectstatepatch
1189
+ [105]: #replaceprojectstate
1160
1190
 
1161
1191
  [106]: #parameters-29
1162
1192
 
1163
- [107]: #subscribeprojectstate
1193
+ [107]: #applyprojectstatepatch
1164
1194
 
1165
- [108]: #filefilters
1195
+ [108]: #parameters-30
1166
1196
 
1167
- [109]: #properties-5
1197
+ [109]: #subscribeprojectstate
1168
1198
 
1169
- [110]: #selectprojectfile-1
1199
+ [110]: #filefilters
1170
1200
 
1171
- [111]: #parameters-30
1201
+ [111]: #properties-5
1172
1202
 
1173
- [112]: #setprojectfile
1203
+ [112]: #selectprojectfile-1
1174
1204
 
1175
1205
  [113]: #parameters-31
1176
1206
 
1177
- [114]: #selectprojectlibrary
1207
+ [114]: #deleteprojectfile
1178
1208
 
1179
1209
  [115]: #parameters-32
1180
1210
 
1181
- [116]: #getprojectlibrary
1211
+ [116]: #setprojectfile
1182
1212
 
1183
1213
  [117]: #parameters-33
1184
1214
 
1185
- [118]: #setprojectlibrary
1215
+ [118]: #selectprojectlibrary
1186
1216
 
1187
1217
  [119]: #parameters-34
1188
1218
 
1189
- [120]: #projectlog
1219
+ [120]: #getprojectlibrary
1190
1220
 
1191
1221
  [121]: #parameters-35
1192
1222
 
1193
- [122]: #setpageurl
1223
+ [122]: #setprojectlibrary
1194
1224
 
1195
1225
  [123]: #parameters-36
1196
1226
 
1197
- [124]: #setpagetitle
1227
+ [124]: #projectlog
1198
1228
 
1199
1229
  [125]: #parameters-37
1200
1230
 
1201
- [126]: #uialert
1231
+ [126]: #setpageurl
1202
1232
 
1203
1233
  [127]: #parameters-38
1204
1234
 
1205
- [128]: #uisplat
1235
+ [128]: #setpagetitle
1206
1236
 
1207
1237
  [129]: #parameters-39
1208
1238
 
1209
- [130]: #uiwindow
1239
+ [130]: #uialert
1210
1240
 
1211
1241
  [131]: #parameters-40
1212
1242
 
1213
- [132]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1243
+ [132]: #uisplat
1244
+
1245
+ [133]: #parameters-41
1246
+
1247
+ [134]: #uiwindow
1248
+
1249
+ [135]: #parameters-42
1250
+
1251
+ [136]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1214
1252
 
1215
- [133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1253
+ [137]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1216
1254
 
1217
- [134]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
1255
+ [138]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
1218
1256
 
1219
- [135]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1257
+ [139]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1220
1258
 
1221
- [136]: https://developer.mozilla.org/docs/Web/API/Blob
1259
+ [140]: https://developer.mozilla.org/docs/Web/API/Blob
1222
1260
 
1223
- [137]: https://developer.mozilla.org/docs/Web/API/FormData
1261
+ [141]: https://developer.mozilla.org/docs/Web/API/FormData
1224
1262
 
1225
- [138]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1263
+ [142]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
1226
1264
 
1227
- [139]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1265
+ [143]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1228
1266
 
1229
- [140]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
1267
+ [144]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
1230
1268
 
1231
- [141]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1269
+ [145]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
1232
1270
 
1233
- [142]: https://developer.mozilla.org/docs/Web/API/Window
1271
+ [146]: https://developer.mozilla.org/docs/Web/API/Window
1234
1272
 
1235
- [143]: https://developer.mozilla.org/docs/Web/API/MessageEvent
1273
+ [147]: https://developer.mozilla.org/docs/Web/API/MessageEvent
1236
1274
 
1237
- [144]: http://jsonpatch.com
1275
+ [148]: http://jsonpatch.com
1238
1276
 
1239
- [145]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
1277
+ [149]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
1240
1278
 
1241
- [146]: https://tera-tools.com/api/logs.json
1279
+ [150]: https://tera-tools.com/api/logs.json