@iebh/tera-fy 2.2.0 → 2.2.3
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/CHANGELOG.md +2 -0
- package/api.md +372 -297
- package/dist/lib/terafy.client.d.ts +21 -1
- package/dist/lib/terafy.client.js +34 -0
- package/dist/lib/terafy.client.js.map +1 -1
- package/dist/lib/terafy.server.d.ts +45 -0
- package/dist/lib/terafy.server.js +214 -0
- package/dist/lib/terafy.server.js.map +1 -1
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +2 -2
- package/documentation.yml +3 -0
- package/lib/terafy.client.ts +59 -0
- package/lib/terafy.server.ts +242 -0
- package/package.json +1 -1
package/api.md
CHANGED
|
@@ -129,36 +129,42 @@
|
|
|
129
129
|
* [Parameters][125]
|
|
130
130
|
* [createProjectFile][126]
|
|
131
131
|
* [Parameters][127]
|
|
132
|
-
* [
|
|
132
|
+
* [moveProjectFile][128]
|
|
133
133
|
* [Parameters][129]
|
|
134
|
-
* [
|
|
134
|
+
* [deleteProjectFile][130]
|
|
135
135
|
* [Parameters][131]
|
|
136
|
-
* [
|
|
136
|
+
* [setProjectFileContents][132]
|
|
137
137
|
* [Parameters][133]
|
|
138
|
-
* [
|
|
138
|
+
* [createProjectFolder][134]
|
|
139
139
|
* [Parameters][135]
|
|
140
|
-
* [
|
|
140
|
+
* [deleteProjectFolder][136]
|
|
141
141
|
* [Parameters][137]
|
|
142
|
-
* [
|
|
142
|
+
* [selectProjectLibrary][138]
|
|
143
143
|
* [Parameters][139]
|
|
144
|
-
* [
|
|
144
|
+
* [getProjectLibrary][140]
|
|
145
145
|
* [Parameters][141]
|
|
146
|
-
* [
|
|
146
|
+
* [setProjectLibrary][142]
|
|
147
147
|
* [Parameters][143]
|
|
148
|
-
* [
|
|
148
|
+
* [projectLog][144]
|
|
149
149
|
* [Parameters][145]
|
|
150
|
-
* [
|
|
150
|
+
* [setPage][146]
|
|
151
151
|
* [Parameters][147]
|
|
152
|
-
* [
|
|
152
|
+
* [uiAlert][148]
|
|
153
153
|
* [Parameters][149]
|
|
154
|
-
* [
|
|
154
|
+
* [uiConfirm][150]
|
|
155
155
|
* [Parameters][151]
|
|
156
|
-
* [
|
|
156
|
+
* [uiPanic][152]
|
|
157
157
|
* [Parameters][153]
|
|
158
|
-
* [
|
|
158
|
+
* [uiProgress][154]
|
|
159
159
|
* [Parameters][155]
|
|
160
|
-
* [
|
|
160
|
+
* [uiPrompt][156]
|
|
161
161
|
* [Parameters][157]
|
|
162
|
+
* [uiThrow][158]
|
|
163
|
+
* [Parameters][159]
|
|
164
|
+
* [uiWindow][160]
|
|
165
|
+
* [Parameters][161]
|
|
166
|
+
* [uiSplat][162]
|
|
167
|
+
* [Parameters][163]
|
|
162
168
|
|
|
163
169
|
## ProjectFile
|
|
164
170
|
|
|
@@ -169,119 +175,119 @@ A project file fetched from TERA
|
|
|
169
175
|
The TERA compatible unique ID of the file
|
|
170
176
|
NOTE: This is computed each time from the Base64 of the file path
|
|
171
177
|
|
|
172
|
-
Type: [String][
|
|
178
|
+
Type: [String][164]
|
|
173
179
|
|
|
174
180
|
### sbId
|
|
175
181
|
|
|
176
182
|
The raw Supabase UUID of the file
|
|
177
183
|
|
|
178
|
-
Type: [String][
|
|
184
|
+
Type: [String][164]
|
|
179
185
|
|
|
180
186
|
### name
|
|
181
187
|
|
|
182
188
|
Relative name path (can contain prefix directories) for the human readable file name
|
|
183
189
|
|
|
184
|
-
Type: [String][
|
|
190
|
+
Type: [String][164]
|
|
185
191
|
|
|
186
192
|
### icon
|
|
187
193
|
|
|
188
194
|
CSS class to use as the file icon
|
|
189
195
|
|
|
190
|
-
Type: [String][
|
|
196
|
+
Type: [String][164]
|
|
191
197
|
|
|
192
198
|
### path
|
|
193
199
|
|
|
194
200
|
Full path to the file
|
|
195
201
|
This is also used as the unique identifier within the project
|
|
196
202
|
|
|
197
|
-
Type: [String][
|
|
203
|
+
Type: [String][164]
|
|
198
204
|
|
|
199
205
|
### url
|
|
200
206
|
|
|
201
207
|
Fully qualified URL to view / access / download the file from TERA
|
|
202
208
|
This will usually open an edit UI within the TERA site
|
|
203
209
|
|
|
204
|
-
Type: [String][
|
|
210
|
+
Type: [String][164]
|
|
205
211
|
|
|
206
212
|
### teraUrl
|
|
207
213
|
|
|
208
214
|
Rewrite of the URL where the absolute URL has been removed in place of a relative path, assuming the owner project is active
|
|
209
215
|
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
|
|
210
216
|
|
|
211
|
-
Type: [String][
|
|
217
|
+
Type: [String][164]
|
|
212
218
|
|
|
213
219
|
### parsedName
|
|
214
220
|
|
|
215
221
|
An object representing meta file parts of a file name
|
|
216
222
|
|
|
217
|
-
Type: [Object][
|
|
223
|
+
Type: [Object][165]
|
|
218
224
|
|
|
219
225
|
#### Properties
|
|
220
226
|
|
|
221
|
-
* `basename` **[String][
|
|
222
|
-
* `filename` **[String][
|
|
223
|
-
* `ext` **[String][
|
|
224
|
-
* `dirName` **[String][
|
|
227
|
+
* `basename` **[String][164]** The filename + extention (i.e. everything without directory name)
|
|
228
|
+
* `filename` **[String][164]** The file portion of the name (basename without the extension)
|
|
229
|
+
* `ext` **[String][164]** The extension portion of the name (always lower case)
|
|
230
|
+
* `dirName` **[String][164]** The directory path portion of the name
|
|
225
231
|
|
|
226
232
|
### created
|
|
227
233
|
|
|
228
234
|
A date representing when the file was created
|
|
229
235
|
|
|
230
|
-
Type: [Date][
|
|
236
|
+
Type: [Date][166]
|
|
231
237
|
|
|
232
238
|
### createdFormatted
|
|
233
239
|
|
|
234
240
|
A human readable, formatted version of "created"
|
|
235
241
|
|
|
236
|
-
Type: [String][
|
|
242
|
+
Type: [String][164]
|
|
237
243
|
|
|
238
244
|
### modified
|
|
239
245
|
|
|
240
246
|
A date representing when the file was created
|
|
241
247
|
|
|
242
|
-
Type: [Date][
|
|
248
|
+
Type: [Date][166]
|
|
243
249
|
|
|
244
250
|
### modifiedFormatted
|
|
245
251
|
|
|
246
252
|
A human readable, formatted version of "modified"
|
|
247
253
|
|
|
248
|
-
Type: [String][
|
|
254
|
+
Type: [String][164]
|
|
249
255
|
|
|
250
256
|
### accessed
|
|
251
257
|
|
|
252
258
|
A date representing when the file was last accessed
|
|
253
259
|
|
|
254
|
-
Type: [Date][
|
|
260
|
+
Type: [Date][166]
|
|
255
261
|
|
|
256
262
|
### accessedFormatted
|
|
257
263
|
|
|
258
264
|
A human readable, formatted version of "accessed"
|
|
259
265
|
|
|
260
|
-
Type: [String][
|
|
266
|
+
Type: [String][164]
|
|
261
267
|
|
|
262
268
|
### size
|
|
263
269
|
|
|
264
270
|
Size, in bytes, of the file
|
|
265
271
|
|
|
266
|
-
Type: [Number][
|
|
272
|
+
Type: [Number][167]
|
|
267
273
|
|
|
268
274
|
### sizeFormatted
|
|
269
275
|
|
|
270
276
|
A human readable, formatted version of the file size
|
|
271
277
|
|
|
272
|
-
Type: [String][
|
|
278
|
+
Type: [String][164]
|
|
273
279
|
|
|
274
280
|
### mime
|
|
275
281
|
|
|
276
282
|
The associated mime type for the file
|
|
277
283
|
|
|
278
|
-
Type: [String][
|
|
284
|
+
Type: [String][164]
|
|
279
285
|
|
|
280
286
|
### meta
|
|
281
287
|
|
|
282
288
|
Additional meta information for the file
|
|
283
289
|
|
|
284
|
-
Type: [Object][
|
|
290
|
+
Type: [Object][165]
|
|
285
291
|
|
|
286
292
|
### getContents
|
|
287
293
|
|
|
@@ -291,9 +297,9 @@ Fetch the raw file contents as a Blob
|
|
|
291
297
|
|
|
292
298
|
#### Parameters
|
|
293
299
|
|
|
294
|
-
* `options` **[Object][
|
|
300
|
+
* `options` **[Object][165]?** Additioanl options to mutate behaviour
|
|
295
301
|
|
|
296
|
-
Returns **[Promise][
|
|
302
|
+
Returns **[Promise][168]<[Blob][169]>** The eventual raw file contents as a Blob
|
|
297
303
|
|
|
298
304
|
### setContents
|
|
299
305
|
|
|
@@ -303,9 +309,9 @@ Overwrite the contents of a file with new content
|
|
|
303
309
|
|
|
304
310
|
#### Parameters
|
|
305
311
|
|
|
306
|
-
* `contents` **(File | [Blob][
|
|
312
|
+
* `contents` **(File | [Blob][169] | [FormData][170] | [Object][165] | [Array][171])** The new file contents
|
|
307
313
|
|
|
308
|
-
Returns **[Promise][
|
|
314
|
+
Returns **[Promise][168]\<void>** A promise which resolves when the operation has completed
|
|
309
315
|
|
|
310
316
|
### getRefs
|
|
311
317
|
|
|
@@ -313,7 +319,7 @@ Returns **[Promise][162]\<void>** A promise which resolves when the operation ha
|
|
|
313
319
|
|
|
314
320
|
Fetch the file contents as an array of Reflib refs
|
|
315
321
|
|
|
316
|
-
Returns **[Promise][
|
|
322
|
+
Returns **[Promise][168]<[Array][171]\<RefLibRef>>** An eventual array of RefLib references
|
|
317
323
|
|
|
318
324
|
### setRefs
|
|
319
325
|
|
|
@@ -323,18 +329,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
|
|
|
323
329
|
|
|
324
330
|
#### Parameters
|
|
325
331
|
|
|
326
|
-
* `refs` **[Array][
|
|
332
|
+
* `refs` **[Array][171]\<RefLibRef>** Collection of references for the selected library
|
|
327
333
|
|
|
328
|
-
Returns **[Promise][
|
|
334
|
+
Returns **[Promise][168]\<void>** A promise which resolves when the operation has completed
|
|
329
335
|
|
|
330
336
|
### serialize
|
|
331
337
|
|
|
332
|
-
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][
|
|
338
|
+
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][172]
|
|
333
339
|
|
|
334
340
|
Compress a file state down into a serializable entity
|
|
335
341
|
By default this computes a Structured Clone which can be stringified
|
|
336
342
|
|
|
337
|
-
Returns **[Object][
|
|
343
|
+
Returns **[Object][165]** A Structured Clone compatible representation of this ProjectFile instance
|
|
338
344
|
|
|
339
345
|
### deserialize
|
|
340
346
|
|
|
@@ -344,7 +350,7 @@ as it's not included in the serialized output.
|
|
|
344
350
|
|
|
345
351
|
#### Parameters
|
|
346
352
|
|
|
347
|
-
* `data` **[Object][
|
|
353
|
+
* `data` **[Object][165]** An input object created via `ProjectFiles.serialize()` (MUST include a 'tera' property added manually)
|
|
348
354
|
|
|
349
355
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
350
356
|
|
|
@@ -356,23 +362,23 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
356
362
|
|
|
357
363
|
Various settings to configure behaviour
|
|
358
364
|
|
|
359
|
-
Type: [Object][
|
|
365
|
+
Type: [Object][165]
|
|
360
366
|
|
|
361
367
|
#### Properties
|
|
362
368
|
|
|
363
|
-
* `session` **[String][
|
|
364
|
-
* `devMode` **[Boolean][
|
|
365
|
-
* `verbosity` **[Number][
|
|
369
|
+
* `session` **[String][164]** Unique session signature for this instance of TeraFy, used to sign server messages, if falsy `getEntropicString(16)` is used to populate
|
|
370
|
+
* `devMode` **[Boolean][173]** Operate in Dev-Mode - i.e. force outer refresh when encountering an existing TeraFy instance + be more tolerent of weird iframe origins
|
|
371
|
+
* `verbosity` **[Number][167]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
|
|
366
372
|
* `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
|
|
367
|
-
* `modeFallback` **[String][
|
|
368
|
-
* `modeOverrides` **[Object][
|
|
369
|
-
* `modeTimeout` **[Number][
|
|
370
|
-
* `siteUrl` **[String][
|
|
371
|
-
* `restrictOrigin` **[String][
|
|
372
|
-
* `List` **[Array][
|
|
373
|
-
* `handshakeInterval` **[Number][
|
|
374
|
-
* `handshakeTimeout` **[Number][
|
|
375
|
-
* `debugPaths` **[Array][
|
|
373
|
+
* `modeFallback` **[String][164]** Method to use when all method detection fails
|
|
374
|
+
* `modeOverrides` **[Object][165]<[Object][165]<[Function][174]>>** Functions to run when switching to specific modes, these are typically used to augment config. Called as `(config:Object)`
|
|
375
|
+
* `modeTimeout` **[Number][167]** How long entities have in 'detect' mode to identify themselves
|
|
376
|
+
* `siteUrl` **[String][164]** The TERA URL to connect to
|
|
377
|
+
* `restrictOrigin` **[String][164]** URL to restrict communications to
|
|
378
|
+
* `List` **[Array][171]<[String][164]>** of sandbox allowables for the embedded if in embed mode
|
|
379
|
+
* `handshakeInterval` **[Number][167]** Interval in milliseconds when sanning for a handshake
|
|
380
|
+
* `handshakeTimeout` **[Number][167]** Interval in milliseconds for when to give up trying to handshake
|
|
381
|
+
* `debugPaths` **[Array][171]<([String][164] | [Array][171]<[String][164]>)>?** List of paths (in either dotted or array notation) to enter debugging mode if a change is detected in dev mode e.g. `{debugPaths: ['foo.bar.baz']}`. This really slows down state writes so should only be used for debugging
|
|
376
382
|
|
|
377
383
|
### events
|
|
378
384
|
|
|
@@ -384,13 +390,13 @@ Type: Mitt
|
|
|
384
390
|
|
|
385
391
|
DOMElements for this TeraFy instance
|
|
386
392
|
|
|
387
|
-
Type: [Object][
|
|
393
|
+
Type: [Object][165]
|
|
388
394
|
|
|
389
395
|
#### Properties
|
|
390
396
|
|
|
391
397
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
392
398
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
393
|
-
* `popup` **[Window][
|
|
399
|
+
* `popup` **[Window][175]** The popup window context (if `settings.mode == 'popup'`)
|
|
394
400
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
395
401
|
|
|
396
402
|
### methods
|
|
@@ -398,13 +404,13 @@ Type: [Object][159]
|
|
|
398
404
|
List of function stubs mapped from the server to here
|
|
399
405
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
400
406
|
|
|
401
|
-
Type: [Array][
|
|
407
|
+
Type: [Array][171]<[String][164]>
|
|
402
408
|
|
|
403
409
|
### plugins
|
|
404
410
|
|
|
405
411
|
Loaded plugins via Use()
|
|
406
412
|
|
|
407
|
-
Type: [Array][
|
|
413
|
+
Type: [Array][171]\<TeraFyPlugin>
|
|
408
414
|
|
|
409
415
|
### namespaces
|
|
410
416
|
|
|
@@ -412,7 +418,7 @@ Active namespaces we are subscribed to
|
|
|
412
418
|
Each key is the namespace name with the value as the local reactive \ observer \ object equivelent
|
|
413
419
|
The key string is always of the form `${ENTITY}::${ID}` e.g. `projects:1234`
|
|
414
420
|
|
|
415
|
-
Type: [Object][
|
|
421
|
+
Type: [Object][165]<[Object][165]>
|
|
416
422
|
|
|
417
423
|
### send
|
|
418
424
|
|
|
@@ -420,9 +426,9 @@ Send a message + wait for a response object
|
|
|
420
426
|
|
|
421
427
|
#### Parameters
|
|
422
428
|
|
|
423
|
-
* `message` **[Object][
|
|
429
|
+
* `message` **[Object][165]** Message object to send
|
|
424
430
|
|
|
425
|
-
Returns **[Promise][
|
|
431
|
+
Returns **[Promise][168]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
426
432
|
|
|
427
433
|
### sendRaw
|
|
428
434
|
|
|
@@ -431,7 +437,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
431
437
|
|
|
432
438
|
#### Parameters
|
|
433
439
|
|
|
434
|
-
* `message` **[Object][
|
|
440
|
+
* `message` **[Object][165]** Message object to send
|
|
435
441
|
|
|
436
442
|
### rpc
|
|
437
443
|
|
|
@@ -439,10 +445,10 @@ Call an RPC function in the server instance
|
|
|
439
445
|
|
|
440
446
|
#### Parameters
|
|
441
447
|
|
|
442
|
-
* `method` **[String][
|
|
448
|
+
* `method` **[String][164]** The method name to call
|
|
443
449
|
* `args` **...any?** Optional arguments to pass to the function
|
|
444
450
|
|
|
445
|
-
Returns **[Promise][
|
|
451
|
+
Returns **[Promise][168]\<any>** The resolved output of the server function
|
|
446
452
|
|
|
447
453
|
### acceptMessage
|
|
448
454
|
|
|
@@ -450,9 +456,9 @@ Accept an incoming message
|
|
|
450
456
|
|
|
451
457
|
#### Parameters
|
|
452
458
|
|
|
453
|
-
* `rawMessage` **[MessageEvent][
|
|
459
|
+
* `rawMessage` **[MessageEvent][176]** Raw message event to process
|
|
454
460
|
|
|
455
|
-
Returns **[Promise][
|
|
461
|
+
Returns **[Promise][168]** A promise which will resolve when the message has been processed
|
|
456
462
|
|
|
457
463
|
### acceptPostboxes
|
|
458
464
|
|
|
@@ -465,22 +471,22 @@ This function can only be called once and will return the existing init() worker
|
|
|
465
471
|
|
|
466
472
|
#### Parameters
|
|
467
473
|
|
|
468
|
-
* `options` **[Object][
|
|
474
|
+
* `options` **[Object][165]?** Additional options to merge into `settings` via `set`
|
|
469
475
|
|
|
470
|
-
Returns **[Promise][
|
|
476
|
+
Returns **[Promise][168]<[TeraFy][31]>** An eventual promise which will resovle with this terafy instance
|
|
471
477
|
|
|
472
478
|
### detectMode
|
|
473
479
|
|
|
474
480
|
Populate `settings.mode`
|
|
475
481
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
476
482
|
|
|
477
|
-
Returns **[Promise][
|
|
483
|
+
Returns **[Promise][168]<[String][164]>** A promise which will resolve with the detected mode to use
|
|
478
484
|
|
|
479
485
|
### injectComms
|
|
480
486
|
|
|
481
487
|
Find an existing active TERA server OR initalize one
|
|
482
488
|
|
|
483
|
-
Returns **[Promise][
|
|
489
|
+
Returns **[Promise][168]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
484
490
|
|
|
485
491
|
### handshakeLoop
|
|
486
492
|
|
|
@@ -488,20 +494,20 @@ Keep trying to handshake until the target responds
|
|
|
488
494
|
|
|
489
495
|
#### Parameters
|
|
490
496
|
|
|
491
|
-
* `options` **[Object][
|
|
497
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
492
498
|
|
|
493
499
|
#### Properties
|
|
494
500
|
|
|
495
|
-
* `handshakeInterval` **[Number][
|
|
496
|
-
* `handshakeTimeout` **[Number][
|
|
501
|
+
* `handshakeInterval` **[Number][167]?** Interval in milliseconds when sanning for a handshake, defaults to global setting
|
|
502
|
+
* `handshakeTimeout` **[Number][167]?** Interval in milliseconds for when to give up trying to handshake, defaults to global setting
|
|
497
503
|
|
|
498
|
-
Returns **[Promise][
|
|
504
|
+
Returns **[Promise][168]** A promise which will either resolve when the handshake is successful OR fail with 'TIMEOUT'
|
|
499
505
|
|
|
500
506
|
### injectStylesheet
|
|
501
507
|
|
|
502
508
|
Inject a local stylesheet to handle TERA server functionality
|
|
503
509
|
|
|
504
|
-
Returns **[Promise][
|
|
510
|
+
Returns **[Promise][168]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
505
511
|
|
|
506
512
|
### injectMethods
|
|
507
513
|
|
|
@@ -516,7 +522,7 @@ This function will only act if `settings.devMode` is truthy
|
|
|
516
522
|
|
|
517
523
|
* `msg` **...any?** Output to show
|
|
518
524
|
* `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
|
|
519
|
-
* `verboseLevel` **[Number][
|
|
525
|
+
* `verboseLevel` **[Number][167]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
|
|
520
526
|
|
|
521
527
|
### set
|
|
522
528
|
|
|
@@ -525,11 +531,11 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
525
531
|
|
|
526
532
|
#### Parameters
|
|
527
533
|
|
|
528
|
-
* `key` **([String][
|
|
534
|
+
* `key` **([String][164] | [Object][165])** Either a single setting key to set or an object to merge
|
|
529
535
|
* `value` **any** The value to set if `key` is a string
|
|
530
|
-
* `options` **[Object][
|
|
536
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
531
537
|
|
|
532
|
-
* `options.ignoreNullish` **[Boolean][
|
|
538
|
+
* `options.ignoreNullish` **[Boolean][173]** If falsy, this forces the setting of undefined or null values rather than ignoring them when specifying values by string (optional, default `true`)
|
|
533
539
|
|
|
534
540
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
535
541
|
|
|
@@ -541,9 +547,9 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
541
547
|
|
|
542
548
|
#### Parameters
|
|
543
549
|
|
|
544
|
-
* `key` **([String][
|
|
550
|
+
* `key` **([String][164] | [Object][165])** Either a single setting key to set or an object to merge
|
|
545
551
|
* `value` **any** The value to set if `key` is a string
|
|
546
|
-
* `options` **[Object][
|
|
552
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
547
553
|
|
|
548
554
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
549
555
|
|
|
@@ -553,8 +559,8 @@ Include a TeraFy client plugin
|
|
|
553
559
|
|
|
554
560
|
#### Parameters
|
|
555
561
|
|
|
556
|
-
* `source` **([Function][
|
|
557
|
-
* `options` **[Object][
|
|
562
|
+
* `source` **([Function][174] | [Object][165] | [String][164])** Either the JS module class, singleton object or URL to fetch it from. Eventually constructed as invoked as `(teraClient:TeraFy, options:Object)`
|
|
563
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
|
|
558
564
|
|
|
559
565
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
560
566
|
|
|
@@ -564,8 +570,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
564
570
|
|
|
565
571
|
#### Parameters
|
|
566
572
|
|
|
567
|
-
* `target` **[Object][
|
|
568
|
-
* `source` **[Object][
|
|
573
|
+
* `target` **[Object][165]** Initalied class instance to extend
|
|
574
|
+
* `source` **[Object][165]** Initalized source object to extend from
|
|
569
575
|
|
|
570
576
|
### toggleDevMode
|
|
571
577
|
|
|
@@ -577,7 +583,7 @@ This function also accepts meta values:
|
|
|
577
583
|
|
|
578
584
|
#### Parameters
|
|
579
585
|
|
|
580
|
-
* `devModeEnabled` **(`"toggle"` | `"proxy"` | [Boolean][
|
|
586
|
+
* `devModeEnabled` **(`"toggle"` | `"proxy"` | [Boolean][173])** Optional boolean to force dev mode or specify other behaviour (optional, default `'toggle'`)
|
|
581
587
|
|
|
582
588
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
583
589
|
|
|
@@ -588,7 +594,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
588
594
|
|
|
589
595
|
#### Parameters
|
|
590
596
|
|
|
591
|
-
* `isFocused` **([String][
|
|
597
|
+
* `isFocused` **([String][164] | [Boolean][173])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
592
598
|
|
|
593
599
|
### getEntropicString
|
|
594
600
|
|
|
@@ -596,9 +602,9 @@ Generate random entropic character string in Base64
|
|
|
596
602
|
|
|
597
603
|
#### Parameters
|
|
598
604
|
|
|
599
|
-
* `maxLength` **[Number][
|
|
605
|
+
* `maxLength` **[Number][167]** Maximum lengh of the genrated string (optional, default `32`)
|
|
600
606
|
|
|
601
|
-
Returns **[String][
|
|
607
|
+
Returns **[String][164]** 
|
|
602
608
|
|
|
603
609
|
### selectProjectFile
|
|
604
610
|
|
|
@@ -610,7 +616,7 @@ This is an pre-requisite step for requireProject()
|
|
|
610
616
|
|
|
611
617
|
* `options` **any?** 
|
|
612
618
|
|
|
613
|
-
Returns **[Promise][
|
|
619
|
+
Returns **[Promise][168]** A promise which will resolve if the there is a user and they are logged in
|
|
614
620
|
|
|
615
621
|
## mountNamespace
|
|
616
622
|
|
|
@@ -619,17 +625,17 @@ This generally creates whatever framework flavoured reactive/observer/object is
|
|
|
619
625
|
|
|
620
626
|
### Parameters
|
|
621
627
|
|
|
622
|
-
* `name` **[String][
|
|
628
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
623
629
|
|
|
624
|
-
Returns **[Promise][
|
|
630
|
+
Returns **[Promise][168]\<Reactive>** A promise which resolves to the reactive object
|
|
625
631
|
|
|
626
632
|
## Actual namespace mounting function designed to be overriden by plugins
|
|
627
633
|
|
|
628
634
|
### Parameters
|
|
629
635
|
|
|
630
|
-
* `name` **[String][
|
|
636
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
631
637
|
|
|
632
|
-
Returns **[Promise][
|
|
638
|
+
Returns **[Promise][168]** A promise which resolves when the mount operation has completed
|
|
633
639
|
|
|
634
640
|
## unmountNamespace
|
|
635
641
|
|
|
@@ -638,17 +644,17 @@ This function will remove the namespace from `namespaces`, cleaning up any memor
|
|
|
638
644
|
|
|
639
645
|
### Parameters
|
|
640
646
|
|
|
641
|
-
* `name` **[String][
|
|
647
|
+
* `name` **[String][164]** The name of the namespace to unmount
|
|
642
648
|
|
|
643
|
-
Returns **[Promise][
|
|
649
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
644
650
|
|
|
645
651
|
## Actual namespace unmounting function designed to be overriden by plugins
|
|
646
652
|
|
|
647
653
|
### Parameters
|
|
648
654
|
|
|
649
|
-
* `name` **[String][
|
|
655
|
+
* `name` **[String][164]** The name of the namespace to unmount
|
|
650
656
|
|
|
651
|
-
Returns **[Promise][
|
|
657
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
652
658
|
|
|
653
659
|
## handshake
|
|
654
660
|
|
|
@@ -656,9 +662,9 @@ Return basic server information as a form of validation
|
|
|
656
662
|
|
|
657
663
|
### Properties
|
|
658
664
|
|
|
659
|
-
* `date` **[Date][
|
|
665
|
+
* `date` **[Date][166]** Server date
|
|
660
666
|
|
|
661
|
-
Returns **[Promise][
|
|
667
|
+
Returns **[Promise][168]<[Object][165]>** Basic promise result
|
|
662
668
|
|
|
663
669
|
## setServerVerbosity
|
|
664
670
|
|
|
@@ -666,7 +672,7 @@ RPC callback to set the server verbostiy level
|
|
|
666
672
|
|
|
667
673
|
### Parameters
|
|
668
674
|
|
|
669
|
-
* `verbosity` **[Number][
|
|
675
|
+
* `verbosity` **[Number][167]** The desired server verbosity level
|
|
670
676
|
|
|
671
677
|
## User
|
|
672
678
|
|
|
@@ -674,22 +680,22 @@ User / active session within TERA
|
|
|
674
680
|
|
|
675
681
|
### Properties
|
|
676
682
|
|
|
677
|
-
* `id` **[String][
|
|
678
|
-
* `email` **[String][
|
|
679
|
-
* `name` **[String][
|
|
680
|
-
* `isSubscribed` **[Boolean][
|
|
683
|
+
* `id` **[String][164]** Unique identifier of the user
|
|
684
|
+
* `email` **[String][164]** The email address of the current user
|
|
685
|
+
* `name` **[String][164]** The provided full name of the user
|
|
686
|
+
* `isSubscribed` **[Boolean][173]** Whether the active user has a TERA subscription
|
|
681
687
|
|
|
682
688
|
## getUser
|
|
683
689
|
|
|
684
690
|
Fetch the current session user
|
|
685
691
|
|
|
686
|
-
Returns **[Promise][
|
|
692
|
+
Returns **[Promise][168]<[User][88]>** The current logged in user or null if none
|
|
687
693
|
|
|
688
694
|
## getCredentials
|
|
689
695
|
|
|
690
696
|
Provide an object of credentials for 3rd party services like Firebase/Supabase
|
|
691
697
|
|
|
692
|
-
Returns **[Object][
|
|
698
|
+
Returns **[Object][165]** An object containing 3rd party service credentials
|
|
693
699
|
|
|
694
700
|
## requireUser
|
|
695
701
|
|
|
@@ -699,11 +705,11 @@ This is an pre-requisite step for requireProject()
|
|
|
699
705
|
|
|
700
706
|
### Parameters
|
|
701
707
|
|
|
702
|
-
* `options` **[Object][
|
|
708
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
703
709
|
|
|
704
|
-
* `options.forceRetry` **[Boolean][
|
|
710
|
+
* `options.forceRetry` **[Boolean][173]** Forcabily try to refresh the user state (optional, default `false`)
|
|
705
711
|
|
|
706
|
-
Returns **[Promise][
|
|
712
|
+
Returns **[Promise][168]<[User][88]>** The current logged in user or null if none
|
|
707
713
|
|
|
708
714
|
## Project
|
|
709
715
|
|
|
@@ -713,13 +719,13 @@ Project entry within TERA
|
|
|
713
719
|
|
|
714
720
|
Get the currently active project, if any
|
|
715
721
|
|
|
716
|
-
Returns **[Promise][
|
|
722
|
+
Returns **[Promise][168]<([Project][94] | null)>** The currently active project, if any
|
|
717
723
|
|
|
718
724
|
## getProjects
|
|
719
725
|
|
|
720
726
|
Get a list of projects the current session user has access to
|
|
721
727
|
|
|
722
|
-
Returns **[Promise][
|
|
728
|
+
Returns **[Promise][168]<[Array][171]<[Project][94]>>** Collection of projects the user has access to
|
|
723
729
|
|
|
724
730
|
## setActiveProject
|
|
725
731
|
|
|
@@ -727,7 +733,7 @@ Set the currently active project within TERA
|
|
|
727
733
|
|
|
728
734
|
### Parameters
|
|
729
735
|
|
|
730
|
-
* `project` **([Object][
|
|
736
|
+
* `project` **([Object][165] | [String][164])** The project to set as active - either the full Project object or its ID
|
|
731
737
|
|
|
732
738
|
## requireProject
|
|
733
739
|
|
|
@@ -736,14 +742,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
736
742
|
|
|
737
743
|
### Parameters
|
|
738
744
|
|
|
739
|
-
* `options` **[Object][
|
|
745
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
740
746
|
|
|
741
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
742
|
-
* `options.title` **[String][
|
|
743
|
-
* `options.noSelectTitle` **[String][
|
|
744
|
-
* `options.noSelectBody` **[String][
|
|
747
|
+
* `options.autoSetActiveProject` **[Boolean][173]** After selecting a project set that project as active in TERA (optional, default `true`)
|
|
748
|
+
* `options.title` **[String][164]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
749
|
+
* `options.noSelectTitle` **[String][164]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
|
|
750
|
+
* `options.noSelectBody` **[String][164]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
|
|
745
751
|
|
|
746
|
-
Returns **[Promise][
|
|
752
|
+
Returns **[Promise][168]<[Project][94]>** The active project
|
|
747
753
|
|
|
748
754
|
## selectProject
|
|
749
755
|
|
|
@@ -751,13 +757,13 @@ Prompt the user to select a project from those available
|
|
|
751
757
|
|
|
752
758
|
### Parameters
|
|
753
759
|
|
|
754
|
-
* `options` **[Object][
|
|
760
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
755
761
|
|
|
756
|
-
* `options.title` **[String][
|
|
757
|
-
* `options.allowCancel` **[Boolean][
|
|
758
|
-
* `options.setActive` **[Boolean][
|
|
762
|
+
* `options.title` **[String][164]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
763
|
+
* `options.allowCancel` **[Boolean][173]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
|
|
764
|
+
* `options.setActive` **[Boolean][173]** Also set the project as active when selected (optional, default `false`)
|
|
759
765
|
|
|
760
|
-
Returns **[Promise][
|
|
766
|
+
Returns **[Promise][168]<[Project][94]>** The active project
|
|
761
767
|
|
|
762
768
|
## getNamespace
|
|
763
769
|
|
|
@@ -766,9 +772,9 @@ This can be used for simpler apps which don't have their own reactive / observer
|
|
|
766
772
|
|
|
767
773
|
### Parameters
|
|
768
774
|
|
|
769
|
-
* `name` **[String][
|
|
775
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
770
776
|
|
|
771
|
-
Returns **[Promise][
|
|
777
|
+
Returns **[Promise][168]<[Object][165]>** A promise which resolves to the namespace POJO state
|
|
772
778
|
|
|
773
779
|
## setNamespace
|
|
774
780
|
|
|
@@ -777,13 +783,13 @@ This can be used for simpler apps which don't have their own reactive / observer
|
|
|
777
783
|
|
|
778
784
|
### Parameters
|
|
779
785
|
|
|
780
|
-
* `name` **[String][
|
|
781
|
-
* `state` **[Object][
|
|
782
|
-
* `options` **[Object][
|
|
786
|
+
* `name` **[String][164]** The name of the namespace
|
|
787
|
+
* `state` **[Object][165]** The state to merge
|
|
788
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
783
789
|
|
|
784
790
|
* `options.method` **(`"merge"` | `"set"`)** How to handle the state. 'merge' (merge a partial state over the existing namespace state), 'set' (completely overwrite the existing namespace) (optional, default `'merge'`)
|
|
785
791
|
|
|
786
|
-
Returns **[Promise][
|
|
792
|
+
Returns **[Promise][168]<[Object][165]>** A promise which resolves to the namespace POJO state
|
|
787
793
|
|
|
788
794
|
## listNamespaces
|
|
789
795
|
|
|
@@ -791,9 +797,9 @@ Return a list of namespaces available to the current project
|
|
|
791
797
|
|
|
792
798
|
### Properties
|
|
793
799
|
|
|
794
|
-
* `name` **[String][
|
|
800
|
+
* `name` **[String][164]** The name of the namespace
|
|
795
801
|
|
|
796
|
-
Returns **[Promise][
|
|
802
|
+
Returns **[Promise][168]<[Array][171]<[Object][165]>>** Collection of available namespaces for the current project
|
|
797
803
|
|
|
798
804
|
## getProjectState
|
|
799
805
|
|
|
@@ -801,12 +807,12 @@ Return the current, full snapshot state of the active project
|
|
|
801
807
|
|
|
802
808
|
### Parameters
|
|
803
809
|
|
|
804
|
-
* `options` **[Object][
|
|
810
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
805
811
|
|
|
806
|
-
* `options.autoRequire` **[Boolean][
|
|
807
|
-
* `Paths` **[Array][
|
|
812
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
813
|
+
* `Paths` **[Array][171]<[String][164]>** to subscribe to e.g. \['/users/'],
|
|
808
814
|
|
|
809
|
-
Returns **[Promise][
|
|
815
|
+
Returns **[Promise][168]<[Object][165]>** The current project state snapshot
|
|
810
816
|
|
|
811
817
|
## setProjectState
|
|
812
818
|
|
|
@@ -818,13 +824,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
818
824
|
|
|
819
825
|
### Parameters
|
|
820
826
|
|
|
821
|
-
* `path` **([String][
|
|
827
|
+
* `path` **([String][164] | [Array][171]<[String][164]>)** The sub-path within the project state to set
|
|
822
828
|
* `value` **any** The value to set
|
|
823
|
-
* `options` **[Object][
|
|
829
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
824
830
|
|
|
825
|
-
* `options.save` **[Boolean][
|
|
831
|
+
* `options.save` **[Boolean][173]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
826
832
|
|
|
827
|
-
Returns **[Promise][
|
|
833
|
+
Returns **[Promise][168]** A promise which resolves when the operation has been dispatched to the server
|
|
828
834
|
|
|
829
835
|
## setProjectStateDefaults
|
|
830
836
|
|
|
@@ -834,18 +840,18 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
834
840
|
|
|
835
841
|
### Parameters
|
|
836
842
|
|
|
837
|
-
* `path` **([String][
|
|
843
|
+
* `path` **([String][164] | [Array][171]<[String][164]>)** The sub-path within the project state to set
|
|
838
844
|
* `value` **any** The value to set
|
|
839
|
-
* `options` **[Object][
|
|
845
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
840
846
|
|
|
841
|
-
Returns **[Promise][
|
|
847
|
+
Returns **[Promise][168]<[Boolean][173]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
|
|
842
848
|
|
|
843
849
|
## setProjectStateRefresh
|
|
844
850
|
|
|
845
851
|
Force refetching the remote project state into local
|
|
846
852
|
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
847
853
|
|
|
848
|
-
Returns **[Promise][
|
|
854
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
849
855
|
|
|
850
856
|
## FileFilters
|
|
851
857
|
|
|
@@ -853,10 +859,10 @@ Data structure for a file filter
|
|
|
853
859
|
|
|
854
860
|
### Properties
|
|
855
861
|
|
|
856
|
-
* `library` **[Boolean][
|
|
857
|
-
* `filename` **[String][
|
|
858
|
-
* `basename` **[String][
|
|
859
|
-
* `ext` **[String][
|
|
862
|
+
* `library` **[Boolean][173]?** Restrict to library files only
|
|
863
|
+
* `filename` **[String][164]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
|
|
864
|
+
* `basename` **[String][164]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
|
|
865
|
+
* `ext` **[String][164]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
|
|
860
866
|
|
|
861
867
|
## selectProjectFile
|
|
862
868
|
|
|
@@ -864,20 +870,20 @@ Prompt the user to select a library to operate on
|
|
|
864
870
|
|
|
865
871
|
### Parameters
|
|
866
872
|
|
|
867
|
-
* `options` **[Object][
|
|
873
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
868
874
|
|
|
869
|
-
* `options.title` **[String][
|
|
870
|
-
* `options.hint` **([String][
|
|
871
|
-
* `options.save` **[Boolean][
|
|
875
|
+
* `options.title` **[String][164]** The title of the dialog to display (optional, default `"Select a file"`)
|
|
876
|
+
* `options.hint` **([String][164] | [Array][171]<[String][164]>)?** Hints to identify the file to select in array order of preference
|
|
877
|
+
* `options.save` **[Boolean][173]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
|
|
872
878
|
* `options.filters` **[FileFilters][116]?** Optional file filters
|
|
873
|
-
* `options.allowUpload` **[Boolean][
|
|
874
|
-
* `options.allowRefresh` **[Boolean][
|
|
875
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
876
|
-
* `options.allowCancel` **[Boolean][
|
|
877
|
-
* `options.autoRequire` **[Boolean][
|
|
879
|
+
* `options.allowUpload` **[Boolean][173]** Allow uploading new files (optional, default `true`)
|
|
880
|
+
* `options.allowRefresh` **[Boolean][173]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
881
|
+
* `options.allowDownloadZip` **[Boolean][173]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
882
|
+
* `options.allowCancel` **[Boolean][173]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
883
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
878
884
|
* `options.filter` **[FileFilters][116]?** Optional file filters
|
|
879
885
|
|
|
880
|
-
Returns **[Promise][
|
|
886
|
+
Returns **[Promise][168]<[ProjectFile][1]>** The eventually selected file, if in save mode new files are created as stubs
|
|
881
887
|
|
|
882
888
|
## getProjectFiles
|
|
883
889
|
|
|
@@ -885,13 +891,13 @@ Fetch the files associated with a given project
|
|
|
885
891
|
|
|
886
892
|
### Parameters
|
|
887
893
|
|
|
888
|
-
* `options` **[Object][
|
|
894
|
+
* `options` **[Object][165]** Options which mutate behaviour
|
|
889
895
|
|
|
890
|
-
* `options.autoRequire` **[Boolean][
|
|
891
|
-
* `options.lazy` **[Boolean][
|
|
892
|
-
* `options.meta` **[Boolean][
|
|
896
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
897
|
+
* `options.lazy` **[Boolean][173]** If true, use the fastest method to retrieve the file list such as the cache. If false, force a refresh each time (optional, default `true`)
|
|
898
|
+
* `options.meta` **[Boolean][173]** Pull meta information for each file entity (optional, default `true`)
|
|
893
899
|
|
|
894
|
-
Returns **[Promise][
|
|
900
|
+
Returns **[Promise][168]<[Array][171]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
895
901
|
|
|
896
902
|
## getProjectFileContents
|
|
897
903
|
|
|
@@ -899,8 +905,8 @@ Fetch the raw contents of a file by its ID
|
|
|
899
905
|
|
|
900
906
|
### Parameters
|
|
901
907
|
|
|
902
|
-
* `id` **[String][
|
|
903
|
-
* `options` **[Object][
|
|
908
|
+
* `id` **[String][164]?** File ID to retrieve the contents of
|
|
909
|
+
* `options` **[Object][165]?** Additioanl options to mutate behaviour
|
|
904
910
|
|
|
905
911
|
* `options.format` **(`"blob"` | `"json"`)** The format to retrieve the file in (optional, default `'blob'`)
|
|
906
912
|
|
|
@@ -912,13 +918,13 @@ Fetch a project file by its name
|
|
|
912
918
|
|
|
913
919
|
### Parameters
|
|
914
920
|
|
|
915
|
-
* `id` **[String][
|
|
916
|
-
* `options` **([Object][
|
|
921
|
+
* `id` **[String][164]** The name + relative directory path component
|
|
922
|
+
* `options` **([Object][165] | [String][164])?** Additional options to mutate behaviour, if a string is given `options.subkey` is assumed
|
|
917
923
|
|
|
918
|
-
* `options.subkey` **[String][
|
|
919
|
-
* `options.cache` **[Boolean][
|
|
924
|
+
* `options.subkey` **[String][164]?** If specified only the extracted subkey is returned rather than the full object
|
|
925
|
+
* `options.cache` **[Boolean][173]** Use the existing file cache if possible, set to false to force a refresh of files from the server first (optional, default `true`)
|
|
920
926
|
|
|
921
|
-
Returns **[Promise][
|
|
927
|
+
Returns **[Promise][168]<[ProjectFile][1]>** The eventual fetched ProjectFile (or requested subkey)
|
|
922
928
|
|
|
923
929
|
## createProjectFile
|
|
924
930
|
|
|
@@ -927,9 +933,29 @@ This creates an empty file which can then be written to
|
|
|
927
933
|
|
|
928
934
|
### Parameters
|
|
929
935
|
|
|
930
|
-
* `name` **[String][
|
|
936
|
+
* `name` **[String][164]** The name + relative directory path component
|
|
931
937
|
|
|
932
|
-
Returns **[Promise][
|
|
938
|
+
Returns **[Promise][168]<[ProjectFile][1]>** The eventual ProjectFile created
|
|
939
|
+
|
|
940
|
+
## moveProjectFile
|
|
941
|
+
|
|
942
|
+
Moves a project file to a new name/path.
|
|
943
|
+
The file's unique ID (UUID) remains the same, but its 'name' (relative path) and associated properties will be updated.
|
|
944
|
+
|
|
945
|
+
### Parameters
|
|
946
|
+
|
|
947
|
+
* `sourceId` **[String][164]** The unique ID (UUID) of the file to move.
|
|
948
|
+
* `newName` **[String][164]** The new relative name for the file (e.g., "documents/report-final.pdf" or "image.png").
|
|
949
|
+
This path is relative to the project's root file directory.
|
|
950
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour.
|
|
951
|
+
|
|
952
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing. (optional, default `true`)
|
|
953
|
+
* `options.overwrite` **[Boolean][173]** If true (default), moving a file to a `newName` that already exists will overwrite the existing file.
|
|
954
|
+
This aligns with the default behavior of the underlying Supabase storage `move` operation.
|
|
955
|
+
If set to false, the function would ideally check and prevent overwrite, but current implementation relies on underlying storage behavior. (optional, default `true`)
|
|
956
|
+
|
|
957
|
+
Returns **[Promise][168]<([ProjectFile][1] | null)>** A promise which resolves to the updated ProjectFile object for the moved file if found after the operation,
|
|
958
|
+
or null if the file could not be located post-move (e.g., if its ID changed unexpectedly or it was deleted).
|
|
933
959
|
|
|
934
960
|
## deleteProjectFile
|
|
935
961
|
|
|
@@ -937,9 +963,9 @@ Remove a project file by its ID
|
|
|
937
963
|
|
|
938
964
|
### Parameters
|
|
939
965
|
|
|
940
|
-
* `id` **[String][
|
|
966
|
+
* `id` **[String][164]** The File ID to remove
|
|
941
967
|
|
|
942
|
-
Returns **[Promise][
|
|
968
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
943
969
|
|
|
944
970
|
## setProjectFileContents
|
|
945
971
|
|
|
@@ -947,18 +973,55 @@ Save (or overwrite) a file within a project
|
|
|
947
973
|
|
|
948
974
|
### Parameters
|
|
949
975
|
|
|
950
|
-
* `id` **([String][
|
|
951
|
-
* `contents` **(File | [Blob][
|
|
952
|
-
* `options` **[Object][
|
|
976
|
+
* `id` **([String][164] | [ProjectFile][1])?** ProjectFile or ID of the same to overwrite, if omitted a file is prompted for
|
|
977
|
+
* `contents` **(File | [Blob][169] | [FormData][170] | [Object][165] | [Array][171])** The new file contents
|
|
978
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
979
|
+
|
|
980
|
+
* `options.id` **([String][164] | [ProjectFile][1])?** Alternate method to specify the file ID to save as, if omitted one will be prompted for
|
|
981
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
982
|
+
* `options.hint` **([String][164] | [Array][171]<[String][164]>)?** Hint(s) to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
983
|
+
* `options.filename` **[String][164]?** Suggested filename if `id` is unspecified
|
|
984
|
+
* `options.title` **[String][164]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
|
|
985
|
+
* `options.meta` **[Object][165]?** Optional meta data to merge into the file data
|
|
986
|
+
|
|
987
|
+
Returns **[Promise][168]** A promise which will resolve when the write operation has completed
|
|
988
|
+
|
|
989
|
+
## createProjectFolder
|
|
990
|
+
|
|
991
|
+
Creates a new "folder" within the project's file storage.
|
|
992
|
+
Folders in Supabase storage are typically represented by creating a placeholder file (e.g., .emptyFolderPlaceholder) within the desired path.
|
|
993
|
+
This operation is idempotent: if the folder (via its placeholder) already exists, it will not error.
|
|
994
|
+
|
|
995
|
+
### Parameters
|
|
996
|
+
|
|
997
|
+
* `folderPath` **[String][164]** The relative path of the folder to create (e.g., "myDocuments/reports").
|
|
998
|
+
* `options` **[Object][165]?** Additional options.
|
|
999
|
+
|
|
1000
|
+
* `options.autoRequire` **[Boolean][173]** Automatically run `requireProject()` to ensure an active project context. (optional, default `true`)
|
|
1001
|
+
|
|
1002
|
+
<!---->
|
|
953
1003
|
|
|
954
|
-
|
|
955
|
-
* `options.autoRequire` **[Boolean][167]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
956
|
-
* `options.hint` **([String][158] | [Array][165]<[String][158]>)?** Hint(s) to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
957
|
-
* `options.filename` **[String][158]?** Suggested filename if `id` is unspecified
|
|
958
|
-
* `options.title` **[String][158]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
|
|
959
|
-
* `options.meta` **[Object][159]?** Optional meta data to merge into the file data
|
|
1004
|
+
* Throws **[Error][177]** If no project is active (and autoRequire is false), or if folderPath is invalid, or if the creation fails.
|
|
960
1005
|
|
|
961
|
-
Returns **[Promise][
|
|
1006
|
+
Returns **[Promise][168]\<void>** A promise that resolves when the folder is created or ensured.
|
|
1007
|
+
|
|
1008
|
+
## deleteProjectFolder
|
|
1009
|
+
|
|
1010
|
+
Deletes a "folder" and all its contents from the project's file storage.
|
|
1011
|
+
This involves listing all files under the given folder path (prefix) and removing them.
|
|
1012
|
+
|
|
1013
|
+
### Parameters
|
|
1014
|
+
|
|
1015
|
+
* `folderPath` **[String][164]** The relative path of the folder to delete (e.g., "myDocuments/reports").
|
|
1016
|
+
* `options` **[Object][165]?** Additional options.
|
|
1017
|
+
|
|
1018
|
+
* `options.autoRequire` **[Boolean][173]** Automatically run `requireProject()` to ensure an active project context. (optional, default `true`)
|
|
1019
|
+
|
|
1020
|
+
<!---->
|
|
1021
|
+
|
|
1022
|
+
* Throws **[Error][177]** If no project is active (and autoRequire is false), or if folderPath is invalid, or if deletion fails.
|
|
1023
|
+
|
|
1024
|
+
Returns **[Promise][168]\<null>** A promise that resolves with null when the folder and its contents are deleted.
|
|
962
1025
|
|
|
963
1026
|
## selectProjectLibrary
|
|
964
1027
|
|
|
@@ -966,19 +1029,19 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
966
1029
|
|
|
967
1030
|
### Parameters
|
|
968
1031
|
|
|
969
|
-
* `options` **[Object][
|
|
1032
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
970
1033
|
|
|
971
|
-
* `options.title` **[String][
|
|
972
|
-
* `options.hint` **([String][
|
|
973
|
-
* `options.allowUpload` **[Boolean][
|
|
974
|
-
* `options.allowRefresh` **[Boolean][
|
|
975
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
976
|
-
* `options.allowCancel` **[Boolean][
|
|
977
|
-
* `options.autoRequire` **[Boolean][
|
|
1034
|
+
* `options.title` **[String][164]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
1035
|
+
* `options.hint` **([String][164] | [Array][171]<[String][164]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
|
|
1036
|
+
* `options.allowUpload` **[Boolean][173]** Allow uploading new files (optional, default `true`)
|
|
1037
|
+
* `options.allowRefresh` **[Boolean][173]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
1038
|
+
* `options.allowDownloadZip` **[Boolean][173]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
1039
|
+
* `options.allowCancel` **[Boolean][173]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
1040
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
978
1041
|
* `options.filters` **[FileFilters][116]?** Optional file filters, defaults to citation library selection only
|
|
979
1042
|
* `options` **...any?** Additional options - see `getProjectLibrary()`
|
|
980
1043
|
|
|
981
|
-
Returns **[Promise][
|
|
1044
|
+
Returns **[Promise][168]<[Array][171]\<Ref>>** A collection of references from the selected file
|
|
982
1045
|
|
|
983
1046
|
## getProjectLibrary
|
|
984
1047
|
|
|
@@ -986,15 +1049,15 @@ Fetch + convert a project file into a library of citations
|
|
|
986
1049
|
|
|
987
1050
|
### Parameters
|
|
988
1051
|
|
|
989
|
-
* `id` **[String][
|
|
990
|
-
* `options` **[Object][
|
|
1052
|
+
* `id` **[String][164]** File ID to read
|
|
1053
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
991
1054
|
|
|
992
|
-
* `options.format` **[String][
|
|
993
|
-
* `options.autoRequire` **[Boolean][
|
|
994
|
-
* `options.filter` **[Function][
|
|
995
|
-
* `options.find` **[Function][
|
|
1055
|
+
* `options.format` **[String][164]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
1056
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
1057
|
+
* `options.filter` **[Function][174]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
1058
|
+
* `options.find` **[Function][174]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
996
1059
|
|
|
997
|
-
Returns **([Promise][
|
|
1060
|
+
Returns **([Promise][168]<[Array][171]\<Ref>> | [Promise][168]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
998
1061
|
|
|
999
1062
|
## setProjectLibrary
|
|
1000
1063
|
|
|
@@ -1002,33 +1065,33 @@ Save back a citation library from some input
|
|
|
1002
1065
|
|
|
1003
1066
|
### Parameters
|
|
1004
1067
|
|
|
1005
|
-
* `id` **[String][
|
|
1006
|
-
* `refs` **([Array][
|
|
1007
|
-
* `options` **[Object][
|
|
1068
|
+
* `id` **[String][164]?** File ID to save back to, if omitted a file will be prompted for
|
|
1069
|
+
* `refs` **([Array][171]\<RefLibRef> | [Blob][169] | File)?** Collection of references for the selected library or the raw Blob/File
|
|
1070
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1008
1071
|
|
|
1009
|
-
* `options.id` **[String][
|
|
1010
|
-
* `options.refs` **([Array][
|
|
1011
|
-
* `options.format` **[String][
|
|
1012
|
-
* `options.autoRequire` **[Boolean][
|
|
1013
|
-
* `options.hint` **[String][
|
|
1014
|
-
* `options.filename` **[String][
|
|
1015
|
-
* `options.title` **[String][
|
|
1016
|
-
* `options.overwrite` **[Boolean][
|
|
1017
|
-
* `options.meta` **[Object][
|
|
1072
|
+
* `options.id` **[String][164]?** Alternate method to specify the file ID to save as, if omitted one will be prompted for
|
|
1073
|
+
* `options.refs` **([Array][171]\<RefLibRef> | [Blob][169] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
1074
|
+
* `options.format` **[String][164]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
1075
|
+
* `options.autoRequire` **[Boolean][173]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
1076
|
+
* `options.hint` **[String][164]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
1077
|
+
* `options.filename` **[String][164]?** Suggested filename if `id` is unspecified
|
|
1078
|
+
* `options.title` **[String][164]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
|
|
1079
|
+
* `options.overwrite` **[Boolean][173]** Allow existing file upsert (optional, default `true`)
|
|
1080
|
+
* `options.meta` **[Object][165]?** Optional meta data to merge into the file data
|
|
1018
1081
|
|
|
1019
|
-
Returns **[Promise][
|
|
1082
|
+
Returns **[Promise][168]** A promise which resolves when the save operation has completed
|
|
1020
1083
|
|
|
1021
1084
|
## projectLog
|
|
1022
1085
|
|
|
1023
1086
|
Create a log entry for the currently active project
|
|
1024
1087
|
|
|
1025
|
-
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][
|
|
1088
|
+
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][178] for the full list
|
|
1026
1089
|
|
|
1027
1090
|
### Parameters
|
|
1028
1091
|
|
|
1029
|
-
* `log` **[Object][
|
|
1092
|
+
* `log` **[Object][165]** The log entry to create
|
|
1030
1093
|
|
|
1031
|
-
Returns **[Promise][
|
|
1094
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
1032
1095
|
|
|
1033
1096
|
## setPage
|
|
1034
1097
|
|
|
@@ -1037,10 +1100,10 @@ This is usually called by a tool nested within the tera-tools.com embed
|
|
|
1037
1100
|
|
|
1038
1101
|
### Parameters
|
|
1039
1102
|
|
|
1040
|
-
* `options` **([Object][
|
|
1103
|
+
* `options` **([Object][165] | [String][164])** Context information about the page, if this is a string, its assumed to popupate `url`
|
|
1041
1104
|
|
|
1042
|
-
* `options.path` **[String][
|
|
1043
|
-
* `options.title` **[String][
|
|
1105
|
+
* `options.path` **[String][164]?** The URL path segment to restore on next refresh
|
|
1106
|
+
* `options.title` **[String][164]?** The page title associated with the path
|
|
1044
1107
|
|
|
1045
1108
|
## uiAlert
|
|
1046
1109
|
|
|
@@ -1048,15 +1111,15 @@ Display simple text within TERA
|
|
|
1048
1111
|
|
|
1049
1112
|
### Parameters
|
|
1050
1113
|
|
|
1051
|
-
* `text` **[String][
|
|
1052
|
-
* `options` **[Object][
|
|
1114
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1115
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1053
1116
|
|
|
1054
|
-
* `options.body` **[String][
|
|
1055
|
-
* `options.isHtml` **[Boolean][
|
|
1056
|
-
* `options.title` **[String][
|
|
1117
|
+
* `options.body` **[String][164]** The body text to display (optional, default `"Alert!"`)
|
|
1118
|
+
* `options.isHtml` **[Boolean][173]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
1119
|
+
* `options.title` **[String][164]** The title of the alert box (optional, default `'TERA'`)
|
|
1057
1120
|
* `options.buttons` **(`"ok"` | `false`)** Button set to use or falsy to disable (optional, default `'ok'`)
|
|
1058
1121
|
|
|
1059
|
-
Returns **[Promise][
|
|
1122
|
+
Returns **[Promise][168]** A promise which resolves when the alert has been dismissed
|
|
1060
1123
|
|
|
1061
1124
|
## uiConfirm
|
|
1062
1125
|
|
|
@@ -1064,14 +1127,14 @@ Present a simple ok/cancel dialog to the user
|
|
|
1064
1127
|
|
|
1065
1128
|
### Parameters
|
|
1066
1129
|
|
|
1067
|
-
* `text` **[String][
|
|
1068
|
-
* `options` **[Object][
|
|
1130
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1131
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1069
1132
|
|
|
1070
|
-
* `options.body` **[String][
|
|
1071
|
-
* `options.isHtml` **[Boolean][
|
|
1072
|
-
* `options.title` **[String][
|
|
1133
|
+
* `options.body` **[String][164]** The body text to display (optional, default `"Confirm?"`)
|
|
1134
|
+
* `options.isHtml` **[Boolean][173]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
1135
|
+
* `options.title` **[String][164]** The title of the confirmation box (optional, default `'TERA'`)
|
|
1073
1136
|
|
|
1074
|
-
Returns **[Promise][
|
|
1137
|
+
Returns **[Promise][168]** A promise which resolves with `Promise.resolve('OK')` or rejects with `Promise.reject('CANCEL')`
|
|
1075
1138
|
|
|
1076
1139
|
## uiPanic
|
|
1077
1140
|
|
|
@@ -1079,7 +1142,7 @@ Trigger a fatal error, killing the outer TERA site
|
|
|
1079
1142
|
|
|
1080
1143
|
### Parameters
|
|
1081
1144
|
|
|
1082
|
-
* `text` **[String][
|
|
1145
|
+
* `text` **[String][164]?** Text to display
|
|
1083
1146
|
|
|
1084
1147
|
## uiProgress
|
|
1085
1148
|
|
|
@@ -1088,18 +1151,18 @@ All options are cumulative - i.e. they are merged with other options previously
|
|
|
1088
1151
|
|
|
1089
1152
|
### Parameters
|
|
1090
1153
|
|
|
1091
|
-
* `options` **([Object][
|
|
1154
|
+
* `options` **([Object][165] | [Boolean][173])?** Additional options to mutate behaviour, if boolean false `{close: true}` is assumed
|
|
1092
1155
|
|
|
1093
|
-
* `options.title` **[String][
|
|
1094
|
-
* `options.backdrop` **[String][
|
|
1095
|
-
* `options.body` **[String][
|
|
1096
|
-
* `options.bodyHtml` **[Boolean][
|
|
1097
|
-
* `options.close` **[Boolean][
|
|
1098
|
-
* `options.text` **[String][
|
|
1099
|
-
* `options.progress` **[Number][
|
|
1100
|
-
* `options.maxProgress` **[Number][
|
|
1156
|
+
* `options.title` **[String][164]** Window title, can only be set on the initial call (optional, default `'TERA'`)
|
|
1157
|
+
* `options.backdrop` **[String][164]** Set to `'static'` to prevent user being able to click outside the modal to close (optional, default `true`)
|
|
1158
|
+
* `options.body` **[String][164]** Window body text, can only be set on the initial call (optional, default `''`)
|
|
1159
|
+
* `options.bodyHtml` **[Boolean][173]** Treat body text as HTML (optional, default `false`)
|
|
1160
|
+
* `options.close` **[Boolean][173]** Close the existing dialog, if true the dialog is disposed and options reset (optional, default `false`)
|
|
1161
|
+
* `options.text` **[String][164]?** The text of the task being conducted
|
|
1162
|
+
* `options.progress` **[Number][167]?** The current progress of the task being conducted, this is assumed to be a value less than `maxProgress`
|
|
1163
|
+
* `options.maxProgress` **[Number][167]?** The maximum value that the progress can be
|
|
1101
1164
|
|
|
1102
|
-
Returns **[Promise][
|
|
1165
|
+
Returns **[Promise][168]** A promise which resolves when the dialog has been updated
|
|
1103
1166
|
|
|
1104
1167
|
## uiPrompt
|
|
1105
1168
|
|
|
@@ -1107,17 +1170,17 @@ Prompt the user for an input, responding with a Promisable value
|
|
|
1107
1170
|
|
|
1108
1171
|
### Parameters
|
|
1109
1172
|
|
|
1110
|
-
* `text` **[String][
|
|
1111
|
-
* `options` **[Object][
|
|
1173
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1174
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1112
1175
|
|
|
1113
|
-
* `options.body` **[String][
|
|
1114
|
-
* `options.isHtml` **[Boolean][
|
|
1115
|
-
* `options.value` **[String][
|
|
1116
|
-
* `options.title` **[String][
|
|
1117
|
-
* `options.placeholder` **[String][
|
|
1118
|
-
* `options.required` **[Boolean][
|
|
1176
|
+
* `options.body` **[String][164]?** Optional additional body text
|
|
1177
|
+
* `options.isHtml` **[Boolean][173]** If truthy, treat the body as HTML (optional, default `false`)
|
|
1178
|
+
* `options.value` **[String][164]?** Current or default value to display pre-filled
|
|
1179
|
+
* `options.title` **[String][164]** The dialog title to display (optional, default `'Input required'`)
|
|
1180
|
+
* `options.placeholder` **[String][164]?** Optional placeholder text
|
|
1181
|
+
* `options.required` **[Boolean][173]** Treat nullish or empty inputs as a cancel operation (optional, default `true`)
|
|
1119
1182
|
|
|
1120
|
-
Returns **[Promise][
|
|
1183
|
+
Returns **[Promise][168]\<any>** Either the eventual user value or a throw with `Promise.reject('CANCEL')`
|
|
1121
1184
|
|
|
1122
1185
|
## uiThrow
|
|
1123
1186
|
|
|
@@ -1125,7 +1188,7 @@ Catch an error using the TERA error handler
|
|
|
1125
1188
|
|
|
1126
1189
|
### Parameters
|
|
1127
1190
|
|
|
1128
|
-
* `error` **([Error][
|
|
1191
|
+
* `error` **([Error][177] | [Object][165] | [String][164])** Error to handle, generally an Error object but can be a POJO or a scalar string
|
|
1129
1192
|
|
|
1130
1193
|
Returns **Void** This function is fatal
|
|
1131
1194
|
|
|
@@ -1135,13 +1198,13 @@ Open a popup window containing a new site
|
|
|
1135
1198
|
|
|
1136
1199
|
### Parameters
|
|
1137
1200
|
|
|
1138
|
-
* `url` **[String][
|
|
1139
|
-
* `options` **[Object][
|
|
1201
|
+
* `url` **[String][164]** The URL to open
|
|
1202
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1140
1203
|
|
|
1141
|
-
* `options.width` **[Number][
|
|
1142
|
-
* `options.height` **[Number][
|
|
1143
|
-
* `options.center` **[Boolean][
|
|
1144
|
-
* `options.permissions` **[Object][
|
|
1204
|
+
* `options.width` **[Number][167]** The desired width of the window (optional, default `500`)
|
|
1205
|
+
* `options.height` **[Number][167]** The desired height of the window (optional, default `600`)
|
|
1206
|
+
* `options.center` **[Boolean][173]** Attempt to center the window on the screen (optional, default `true`)
|
|
1207
|
+
* `options.permissions` **[Object][165]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
|
|
1145
1208
|
|
|
1146
1209
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
1147
1210
|
|
|
@@ -1152,10 +1215,10 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1152
1215
|
|
|
1153
1216
|
### Parameters
|
|
1154
1217
|
|
|
1155
|
-
* `content` **(DOMElement | [String][
|
|
1156
|
-
* `options` **[Object][
|
|
1218
|
+
* `content` **(DOMElement | [String][164] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
|
|
1219
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1157
1220
|
|
|
1158
|
-
* `options.logo` **([Boolean][
|
|
1221
|
+
* `options.logo` **([Boolean][173] | [String][164])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
|
|
1159
1222
|
|
|
1160
1223
|
[1]: #projectfile
|
|
1161
1224
|
|
|
@@ -1411,92 +1474,104 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1411
1474
|
|
|
1412
1475
|
[127]: #parameters-37
|
|
1413
1476
|
|
|
1414
|
-
[128]: #
|
|
1477
|
+
[128]: #moveprojectfile
|
|
1415
1478
|
|
|
1416
1479
|
[129]: #parameters-38
|
|
1417
1480
|
|
|
1418
|
-
[130]: #
|
|
1481
|
+
[130]: #deleteprojectfile
|
|
1419
1482
|
|
|
1420
1483
|
[131]: #parameters-39
|
|
1421
1484
|
|
|
1422
|
-
[132]: #
|
|
1485
|
+
[132]: #setprojectfilecontents
|
|
1423
1486
|
|
|
1424
1487
|
[133]: #parameters-40
|
|
1425
1488
|
|
|
1426
|
-
[134]: #
|
|
1489
|
+
[134]: #createprojectfolder
|
|
1427
1490
|
|
|
1428
1491
|
[135]: #parameters-41
|
|
1429
1492
|
|
|
1430
|
-
[136]: #
|
|
1493
|
+
[136]: #deleteprojectfolder
|
|
1431
1494
|
|
|
1432
1495
|
[137]: #parameters-42
|
|
1433
1496
|
|
|
1434
|
-
[138]: #
|
|
1497
|
+
[138]: #selectprojectlibrary
|
|
1435
1498
|
|
|
1436
1499
|
[139]: #parameters-43
|
|
1437
1500
|
|
|
1438
|
-
[140]: #
|
|
1501
|
+
[140]: #getprojectlibrary
|
|
1439
1502
|
|
|
1440
1503
|
[141]: #parameters-44
|
|
1441
1504
|
|
|
1442
|
-
[142]: #
|
|
1505
|
+
[142]: #setprojectlibrary
|
|
1443
1506
|
|
|
1444
1507
|
[143]: #parameters-45
|
|
1445
1508
|
|
|
1446
|
-
[144]: #
|
|
1509
|
+
[144]: #projectlog
|
|
1447
1510
|
|
|
1448
1511
|
[145]: #parameters-46
|
|
1449
1512
|
|
|
1450
|
-
[146]: #
|
|
1513
|
+
[146]: #setpage
|
|
1451
1514
|
|
|
1452
1515
|
[147]: #parameters-47
|
|
1453
1516
|
|
|
1454
|
-
[148]: #
|
|
1517
|
+
[148]: #uialert
|
|
1455
1518
|
|
|
1456
1519
|
[149]: #parameters-48
|
|
1457
1520
|
|
|
1458
|
-
[150]: #
|
|
1521
|
+
[150]: #uiconfirm
|
|
1459
1522
|
|
|
1460
1523
|
[151]: #parameters-49
|
|
1461
1524
|
|
|
1462
|
-
[152]: #
|
|
1525
|
+
[152]: #uipanic
|
|
1463
1526
|
|
|
1464
1527
|
[153]: #parameters-50
|
|
1465
1528
|
|
|
1466
|
-
[154]: #
|
|
1529
|
+
[154]: #uiprogress
|
|
1467
1530
|
|
|
1468
1531
|
[155]: #parameters-51
|
|
1469
1532
|
|
|
1470
|
-
[156]: #
|
|
1533
|
+
[156]: #uiprompt
|
|
1471
1534
|
|
|
1472
1535
|
[157]: #parameters-52
|
|
1473
1536
|
|
|
1474
|
-
[158]:
|
|
1537
|
+
[158]: #uithrow
|
|
1538
|
+
|
|
1539
|
+
[159]: #parameters-53
|
|
1540
|
+
|
|
1541
|
+
[160]: #uiwindow
|
|
1542
|
+
|
|
1543
|
+
[161]: #parameters-54
|
|
1544
|
+
|
|
1545
|
+
[162]: #uisplat
|
|
1546
|
+
|
|
1547
|
+
[163]: #parameters-55
|
|
1548
|
+
|
|
1549
|
+
[164]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1475
1550
|
|
|
1476
|
-
[
|
|
1551
|
+
[165]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1477
1552
|
|
|
1478
|
-
[
|
|
1553
|
+
[166]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1479
1554
|
|
|
1480
|
-
[
|
|
1555
|
+
[167]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1481
1556
|
|
|
1482
|
-
[
|
|
1557
|
+
[168]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1483
1558
|
|
|
1484
|
-
[
|
|
1559
|
+
[169]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1485
1560
|
|
|
1486
|
-
[
|
|
1561
|
+
[170]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1487
1562
|
|
|
1488
|
-
[
|
|
1563
|
+
[171]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1489
1564
|
|
|
1490
|
-
[
|
|
1565
|
+
[172]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1491
1566
|
|
|
1492
|
-
[
|
|
1567
|
+
[173]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1493
1568
|
|
|
1494
|
-
[
|
|
1569
|
+
[174]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1495
1570
|
|
|
1496
|
-
[
|
|
1571
|
+
[175]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1497
1572
|
|
|
1498
|
-
[
|
|
1573
|
+
[176]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1499
1574
|
|
|
1500
|
-
[
|
|
1575
|
+
[177]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
|
|
1501
1576
|
|
|
1502
|
-
[
|
|
1577
|
+
[178]: https://tera-tools.com/api/logs.json
|