@iebh/tera-fy 2.0.22 → 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 +38 -0
- package/api.md +375 -298
- package/dist/lib/projectFile.d.ts +182 -0
- package/dist/lib/projectFile.js +157 -0
- package/dist/lib/projectFile.js.map +1 -0
- package/dist/lib/syncro/entities.d.ts +28 -0
- package/dist/lib/syncro/entities.js +203 -0
- package/dist/lib/syncro/entities.js.map +1 -0
- package/dist/lib/syncro/keyed.d.ts +95 -0
- package/dist/lib/syncro/keyed.js +286 -0
- package/dist/lib/syncro/keyed.js.map +1 -0
- package/dist/lib/syncro/syncro.d.ts +328 -0
- package/dist/lib/syncro/syncro.js +633 -0
- package/dist/lib/syncro/syncro.js.map +1 -0
- package/dist/lib/terafy.bootstrapper.d.ts +42 -0
- package/dist/lib/terafy.bootstrapper.js +130 -0
- package/dist/lib/terafy.bootstrapper.js.map +1 -0
- package/dist/lib/terafy.client.d.ts +552 -0
- package/dist/lib/terafy.client.js +1144 -0
- package/dist/lib/terafy.client.js.map +1 -0
- package/dist/lib/terafy.proxy.d.ts +66 -0
- package/dist/lib/terafy.proxy.js +123 -0
- package/dist/lib/terafy.proxy.js.map +1 -0
- package/dist/lib/terafy.server.d.ts +652 -0
- package/dist/lib/terafy.server.js +1988 -0
- package/dist/lib/terafy.server.js.map +1 -0
- package/dist/plugin.vue2.es2019.js +30 -13
- package/dist/plugins/base.d.ts +20 -0
- package/dist/plugins/base.js +21 -0
- package/dist/plugins/base.js.map +1 -0
- package/dist/plugins/firebase.d.ts +62 -0
- package/dist/plugins/firebase.js +111 -0
- package/dist/plugins/firebase.js.map +1 -0
- package/dist/plugins/vite.d.ts +12 -0
- package/dist/plugins/vite.js +22 -0
- package/dist/plugins/vite.js.map +1 -0
- package/dist/plugins/vue2.d.ts +68 -0
- package/dist/plugins/vue2.js +96 -0
- package/dist/plugins/vue2.js.map +1 -0
- package/dist/plugins/vue3.d.ts +64 -0
- package/dist/plugins/vue3.js +96 -0
- package/dist/plugins/vue3.js.map +1 -0
- package/dist/terafy.bootstrapper.es2019.js +2 -2
- package/dist/terafy.bootstrapper.js +2 -2
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +2 -2
- package/dist/utils/mixin.d.ts +11 -0
- package/dist/utils/mixin.js +15 -0
- package/dist/utils/mixin.js.map +1 -0
- package/dist/utils/pDefer.d.ts +12 -0
- package/dist/utils/pDefer.js +14 -0
- package/dist/utils/pDefer.js.map +1 -0
- package/dist/utils/pathTools.d.ts +70 -0
- package/dist/utils/pathTools.js +120 -0
- package/dist/utils/pathTools.js.map +1 -0
- package/documentation.yml +3 -0
- package/eslint.config.js +44 -8
- package/lib/{projectFile.js → projectFile.ts} +83 -40
- package/lib/syncro/entities.ts +288 -0
- package/lib/syncro/{keyed.js → keyed.ts} +114 -57
- package/lib/syncro/{syncro.js → syncro.ts} +201 -168
- package/lib/{terafy.bootstrapper.js → terafy.bootstrapper.ts} +49 -31
- package/lib/{terafy.client.js → terafy.client.ts} +153 -86
- package/lib/{terafy.proxy.js → terafy.proxy.ts} +43 -16
- package/lib/{terafy.server.js → terafy.server.ts} +606 -223
- package/package.json +65 -26
- package/plugins/{base.js → base.ts} +3 -1
- package/plugins/{firebase.js → firebase.ts} +34 -16
- package/plugins/{vite.js → vite.ts} +3 -3
- package/plugins/{vue2.js → vue2.ts} +17 -10
- package/plugins/{vue3.js → vue3.ts} +11 -9
- package/tsconfig.json +30 -0
- package/utils/{mixin.js → mixin.ts} +1 -1
- package/utils/{pDefer.js → pDefer.ts} +10 -3
- package/utils/{pathTools.js → pathTools.ts} +11 -9
- package/lib/syncro/entities.js +0 -232
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 **[Blob][
|
|
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][165]** A promise which resolves when the operation has compl
|
|
|
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,26 +329,28 @@ 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
|
|
|
341
347
|
Restore an entity created with serialize
|
|
348
|
+
NOTE: This requires the 'tera' instance to be manually added to the 'data' object before calling deserialize,
|
|
349
|
+
as it's not included in the serialized output.
|
|
342
350
|
|
|
343
351
|
#### Parameters
|
|
344
352
|
|
|
345
|
-
* `data` **[Object][
|
|
353
|
+
* `data` **[Object][165]** An input object created via `ProjectFiles.serialize()` (MUST include a 'tera' property added manually)
|
|
346
354
|
|
|
347
355
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
348
356
|
|
|
@@ -354,23 +362,23 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
354
362
|
|
|
355
363
|
Various settings to configure behaviour
|
|
356
364
|
|
|
357
|
-
Type: [Object][
|
|
365
|
+
Type: [Object][165]
|
|
358
366
|
|
|
359
367
|
#### Properties
|
|
360
368
|
|
|
361
|
-
* `session` **[String][
|
|
362
|
-
* `devMode` **[Boolean][
|
|
363
|
-
* `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
|
|
364
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
|
|
365
|
-
* `modeFallback` **[String][
|
|
366
|
-
* `modeOverrides` **[Object][
|
|
367
|
-
* `modeTimeout` **[Number][
|
|
368
|
-
* `siteUrl` **[String][
|
|
369
|
-
* `restrictOrigin` **[String][
|
|
370
|
-
* `List` **[Array][
|
|
371
|
-
* `handshakeInterval` **[Number][
|
|
372
|
-
* `handshakeTimeout` **[Number][
|
|
373
|
-
* `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
|
|
374
382
|
|
|
375
383
|
### events
|
|
376
384
|
|
|
@@ -382,13 +390,13 @@ Type: Mitt
|
|
|
382
390
|
|
|
383
391
|
DOMElements for this TeraFy instance
|
|
384
392
|
|
|
385
|
-
Type: [Object][
|
|
393
|
+
Type: [Object][165]
|
|
386
394
|
|
|
387
395
|
#### Properties
|
|
388
396
|
|
|
389
397
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
390
398
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
391
|
-
* `popup` **[Window][
|
|
399
|
+
* `popup` **[Window][175]** The popup window context (if `settings.mode == 'popup'`)
|
|
392
400
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
393
401
|
|
|
394
402
|
### methods
|
|
@@ -396,13 +404,13 @@ Type: [Object][159]
|
|
|
396
404
|
List of function stubs mapped from the server to here
|
|
397
405
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
398
406
|
|
|
399
|
-
Type: [Array][
|
|
407
|
+
Type: [Array][171]<[String][164]>
|
|
400
408
|
|
|
401
409
|
### plugins
|
|
402
410
|
|
|
403
411
|
Loaded plugins via Use()
|
|
404
412
|
|
|
405
|
-
Type: [Array][
|
|
413
|
+
Type: [Array][171]\<TeraFyPlugin>
|
|
406
414
|
|
|
407
415
|
### namespaces
|
|
408
416
|
|
|
@@ -410,7 +418,7 @@ Active namespaces we are subscribed to
|
|
|
410
418
|
Each key is the namespace name with the value as the local reactive \ observer \ object equivelent
|
|
411
419
|
The key string is always of the form `${ENTITY}::${ID}` e.g. `projects:1234`
|
|
412
420
|
|
|
413
|
-
Type: [Object][
|
|
421
|
+
Type: [Object][165]<[Object][165]>
|
|
414
422
|
|
|
415
423
|
### send
|
|
416
424
|
|
|
@@ -418,9 +426,9 @@ Send a message + wait for a response object
|
|
|
418
426
|
|
|
419
427
|
#### Parameters
|
|
420
428
|
|
|
421
|
-
* `message` **[Object][
|
|
429
|
+
* `message` **[Object][165]** Message object to send
|
|
422
430
|
|
|
423
|
-
Returns **[Promise][
|
|
431
|
+
Returns **[Promise][168]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
424
432
|
|
|
425
433
|
### sendRaw
|
|
426
434
|
|
|
@@ -429,7 +437,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
429
437
|
|
|
430
438
|
#### Parameters
|
|
431
439
|
|
|
432
|
-
* `message` **[Object][
|
|
440
|
+
* `message` **[Object][165]** Message object to send
|
|
433
441
|
|
|
434
442
|
### rpc
|
|
435
443
|
|
|
@@ -437,10 +445,10 @@ Call an RPC function in the server instance
|
|
|
437
445
|
|
|
438
446
|
#### Parameters
|
|
439
447
|
|
|
440
|
-
* `method` **[String][
|
|
448
|
+
* `method` **[String][164]** The method name to call
|
|
441
449
|
* `args` **...any?** Optional arguments to pass to the function
|
|
442
450
|
|
|
443
|
-
Returns **[Promise][
|
|
451
|
+
Returns **[Promise][168]\<any>** The resolved output of the server function
|
|
444
452
|
|
|
445
453
|
### acceptMessage
|
|
446
454
|
|
|
@@ -448,9 +456,9 @@ Accept an incoming message
|
|
|
448
456
|
|
|
449
457
|
#### Parameters
|
|
450
458
|
|
|
451
|
-
* `rawMessage` **[MessageEvent][
|
|
459
|
+
* `rawMessage` **[MessageEvent][176]** Raw message event to process
|
|
452
460
|
|
|
453
|
-
Returns **[Promise][
|
|
461
|
+
Returns **[Promise][168]** A promise which will resolve when the message has been processed
|
|
454
462
|
|
|
455
463
|
### acceptPostboxes
|
|
456
464
|
|
|
@@ -463,22 +471,22 @@ This function can only be called once and will return the existing init() worker
|
|
|
463
471
|
|
|
464
472
|
#### Parameters
|
|
465
473
|
|
|
466
|
-
* `options` **[Object][
|
|
474
|
+
* `options` **[Object][165]?** Additional options to merge into `settings` via `set`
|
|
467
475
|
|
|
468
|
-
Returns **[Promise][
|
|
476
|
+
Returns **[Promise][168]<[TeraFy][31]>** An eventual promise which will resovle with this terafy instance
|
|
469
477
|
|
|
470
478
|
### detectMode
|
|
471
479
|
|
|
472
480
|
Populate `settings.mode`
|
|
473
481
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
474
482
|
|
|
475
|
-
Returns **[Promise][
|
|
483
|
+
Returns **[Promise][168]<[String][164]>** A promise which will resolve with the detected mode to use
|
|
476
484
|
|
|
477
485
|
### injectComms
|
|
478
486
|
|
|
479
487
|
Find an existing active TERA server OR initalize one
|
|
480
488
|
|
|
481
|
-
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
|
|
482
490
|
|
|
483
491
|
### handshakeLoop
|
|
484
492
|
|
|
@@ -486,20 +494,20 @@ Keep trying to handshake until the target responds
|
|
|
486
494
|
|
|
487
495
|
#### Parameters
|
|
488
496
|
|
|
489
|
-
* `options` **[Object][
|
|
497
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
490
498
|
|
|
491
499
|
#### Properties
|
|
492
500
|
|
|
493
|
-
* `handshakeInterval` **[Number][
|
|
494
|
-
* `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
|
|
495
503
|
|
|
496
|
-
Returns **[Promise][
|
|
504
|
+
Returns **[Promise][168]** A promise which will either resolve when the handshake is successful OR fail with 'TIMEOUT'
|
|
497
505
|
|
|
498
506
|
### injectStylesheet
|
|
499
507
|
|
|
500
508
|
Inject a local stylesheet to handle TERA server functionality
|
|
501
509
|
|
|
502
|
-
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
|
|
503
511
|
|
|
504
512
|
### injectMethods
|
|
505
513
|
|
|
@@ -514,7 +522,7 @@ This function will only act if `settings.devMode` is truthy
|
|
|
514
522
|
|
|
515
523
|
* `msg` **...any?** Output to show
|
|
516
524
|
* `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
|
|
517
|
-
* `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`)
|
|
518
526
|
|
|
519
527
|
### set
|
|
520
528
|
|
|
@@ -523,11 +531,11 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
523
531
|
|
|
524
532
|
#### Parameters
|
|
525
533
|
|
|
526
|
-
* `key` **([String][
|
|
534
|
+
* `key` **([String][164] | [Object][165])** Either a single setting key to set or an object to merge
|
|
527
535
|
* `value` **any** The value to set if `key` is a string
|
|
528
|
-
* `options` **[Object][
|
|
536
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
529
537
|
|
|
530
|
-
* `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`)
|
|
531
539
|
|
|
532
540
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
533
541
|
|
|
@@ -539,9 +547,9 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
539
547
|
|
|
540
548
|
#### Parameters
|
|
541
549
|
|
|
542
|
-
* `key` **([String][
|
|
550
|
+
* `key` **([String][164] | [Object][165])** Either a single setting key to set or an object to merge
|
|
543
551
|
* `value` **any** The value to set if `key` is a string
|
|
544
|
-
* `options` **[Object][
|
|
552
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
545
553
|
|
|
546
554
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
547
555
|
|
|
@@ -551,8 +559,8 @@ Include a TeraFy client plugin
|
|
|
551
559
|
|
|
552
560
|
#### Parameters
|
|
553
561
|
|
|
554
|
-
* `source` **([Function][
|
|
555
|
-
* `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)
|
|
556
564
|
|
|
557
565
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
558
566
|
|
|
@@ -562,8 +570,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
562
570
|
|
|
563
571
|
#### Parameters
|
|
564
572
|
|
|
565
|
-
* `target` **[Object][
|
|
566
|
-
* `source` **[Object][
|
|
573
|
+
* `target` **[Object][165]** Initalied class instance to extend
|
|
574
|
+
* `source` **[Object][165]** Initalized source object to extend from
|
|
567
575
|
|
|
568
576
|
### toggleDevMode
|
|
569
577
|
|
|
@@ -575,7 +583,7 @@ This function also accepts meta values:
|
|
|
575
583
|
|
|
576
584
|
#### Parameters
|
|
577
585
|
|
|
578
|
-
* `devModeEnabled` **(`"toggle"` | `"proxy"` | [Boolean][
|
|
586
|
+
* `devModeEnabled` **(`"toggle"` | `"proxy"` | [Boolean][173])** Optional boolean to force dev mode or specify other behaviour (optional, default `'toggle'`)
|
|
579
587
|
|
|
580
588
|
Returns **[TeraFy][31]** This chainable terafy instance
|
|
581
589
|
|
|
@@ -586,7 +594,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
586
594
|
|
|
587
595
|
#### Parameters
|
|
588
596
|
|
|
589
|
-
* `isFocused` **([String][
|
|
597
|
+
* `isFocused` **([String][164] | [Boolean][173])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
590
598
|
|
|
591
599
|
### getEntropicString
|
|
592
600
|
|
|
@@ -594,9 +602,9 @@ Generate random entropic character string in Base64
|
|
|
594
602
|
|
|
595
603
|
#### Parameters
|
|
596
604
|
|
|
597
|
-
* `maxLength` **[Number][
|
|
605
|
+
* `maxLength` **[Number][167]** Maximum lengh of the genrated string (optional, default `32`)
|
|
598
606
|
|
|
599
|
-
Returns **[String][
|
|
607
|
+
Returns **[String][164]** 
|
|
600
608
|
|
|
601
609
|
### selectProjectFile
|
|
602
610
|
|
|
@@ -606,9 +614,9 @@ This is an pre-requisite step for requireProject()
|
|
|
606
614
|
|
|
607
615
|
#### Parameters
|
|
608
616
|
|
|
609
|
-
* `options`
|
|
617
|
+
* `options` **any?** 
|
|
610
618
|
|
|
611
|
-
Returns **[Promise][
|
|
619
|
+
Returns **[Promise][168]** A promise which will resolve if the there is a user and they are logged in
|
|
612
620
|
|
|
613
621
|
## mountNamespace
|
|
614
622
|
|
|
@@ -617,17 +625,17 @@ This generally creates whatever framework flavoured reactive/observer/object is
|
|
|
617
625
|
|
|
618
626
|
### Parameters
|
|
619
627
|
|
|
620
|
-
* `name` **[String][
|
|
628
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
621
629
|
|
|
622
|
-
Returns **[Promise][
|
|
630
|
+
Returns **[Promise][168]\<Reactive>** A promise which resolves to the reactive object
|
|
623
631
|
|
|
624
632
|
## Actual namespace mounting function designed to be overriden by plugins
|
|
625
633
|
|
|
626
634
|
### Parameters
|
|
627
635
|
|
|
628
|
-
* `name` **[String][
|
|
636
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
629
637
|
|
|
630
|
-
Returns **[Promise][
|
|
638
|
+
Returns **[Promise][168]** A promise which resolves when the mount operation has completed
|
|
631
639
|
|
|
632
640
|
## unmountNamespace
|
|
633
641
|
|
|
@@ -636,17 +644,17 @@ This function will remove the namespace from `namespaces`, cleaning up any memor
|
|
|
636
644
|
|
|
637
645
|
### Parameters
|
|
638
646
|
|
|
639
|
-
* `name` **[String][
|
|
647
|
+
* `name` **[String][164]** The name of the namespace to unmount
|
|
640
648
|
|
|
641
|
-
Returns **[Promise][
|
|
649
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
642
650
|
|
|
643
651
|
## Actual namespace unmounting function designed to be overriden by plugins
|
|
644
652
|
|
|
645
653
|
### Parameters
|
|
646
654
|
|
|
647
|
-
* `name` **[String][
|
|
655
|
+
* `name` **[String][164]** The name of the namespace to unmount
|
|
648
656
|
|
|
649
|
-
Returns **[Promise][
|
|
657
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
650
658
|
|
|
651
659
|
## handshake
|
|
652
660
|
|
|
@@ -654,9 +662,9 @@ Return basic server information as a form of validation
|
|
|
654
662
|
|
|
655
663
|
### Properties
|
|
656
664
|
|
|
657
|
-
* `date` **[Date][
|
|
665
|
+
* `date` **[Date][166]** Server date
|
|
658
666
|
|
|
659
|
-
Returns **[Promise][
|
|
667
|
+
Returns **[Promise][168]<[Object][165]>** Basic promise result
|
|
660
668
|
|
|
661
669
|
## setServerVerbosity
|
|
662
670
|
|
|
@@ -664,7 +672,7 @@ RPC callback to set the server verbostiy level
|
|
|
664
672
|
|
|
665
673
|
### Parameters
|
|
666
674
|
|
|
667
|
-
* `verbosity` **[Number][
|
|
675
|
+
* `verbosity` **[Number][167]** The desired server verbosity level
|
|
668
676
|
|
|
669
677
|
## User
|
|
670
678
|
|
|
@@ -672,22 +680,22 @@ User / active session within TERA
|
|
|
672
680
|
|
|
673
681
|
### Properties
|
|
674
682
|
|
|
675
|
-
* `id` **[String][
|
|
676
|
-
* `email` **[String][
|
|
677
|
-
* `name` **[String][
|
|
678
|
-
* `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
|
|
679
687
|
|
|
680
688
|
## getUser
|
|
681
689
|
|
|
682
690
|
Fetch the current session user
|
|
683
691
|
|
|
684
|
-
Returns **[Promise][
|
|
692
|
+
Returns **[Promise][168]<[User][88]>** The current logged in user or null if none
|
|
685
693
|
|
|
686
694
|
## getCredentials
|
|
687
695
|
|
|
688
696
|
Provide an object of credentials for 3rd party services like Firebase/Supabase
|
|
689
697
|
|
|
690
|
-
Returns **[Object][
|
|
698
|
+
Returns **[Object][165]** An object containing 3rd party service credentials
|
|
691
699
|
|
|
692
700
|
## requireUser
|
|
693
701
|
|
|
@@ -697,11 +705,11 @@ This is an pre-requisite step for requireProject()
|
|
|
697
705
|
|
|
698
706
|
### Parameters
|
|
699
707
|
|
|
700
|
-
* `options` **[Object][
|
|
708
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
701
709
|
|
|
702
|
-
* `options.forceRetry` **[Boolean][
|
|
710
|
+
* `options.forceRetry` **[Boolean][173]** Forcabily try to refresh the user state (optional, default `false`)
|
|
703
711
|
|
|
704
|
-
Returns **[Promise][
|
|
712
|
+
Returns **[Promise][168]<[User][88]>** The current logged in user or null if none
|
|
705
713
|
|
|
706
714
|
## Project
|
|
707
715
|
|
|
@@ -711,13 +719,13 @@ Project entry within TERA
|
|
|
711
719
|
|
|
712
720
|
Get the currently active project, if any
|
|
713
721
|
|
|
714
|
-
Returns **[Promise][
|
|
722
|
+
Returns **[Promise][168]<([Project][94] | null)>** The currently active project, if any
|
|
715
723
|
|
|
716
724
|
## getProjects
|
|
717
725
|
|
|
718
726
|
Get a list of projects the current session user has access to
|
|
719
727
|
|
|
720
|
-
Returns **[Promise][
|
|
728
|
+
Returns **[Promise][168]<[Array][171]<[Project][94]>>** Collection of projects the user has access to
|
|
721
729
|
|
|
722
730
|
## setActiveProject
|
|
723
731
|
|
|
@@ -725,7 +733,7 @@ Set the currently active project within TERA
|
|
|
725
733
|
|
|
726
734
|
### Parameters
|
|
727
735
|
|
|
728
|
-
* `project` **([Object][
|
|
736
|
+
* `project` **([Object][165] | [String][164])** The project to set as active - either the full Project object or its ID
|
|
729
737
|
|
|
730
738
|
## requireProject
|
|
731
739
|
|
|
@@ -734,14 +742,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
734
742
|
|
|
735
743
|
### Parameters
|
|
736
744
|
|
|
737
|
-
* `options` **[Object][
|
|
745
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
738
746
|
|
|
739
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
740
|
-
* `options.title` **[String][
|
|
741
|
-
* `options.noSelectTitle` **[String][
|
|
742
|
-
* `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'`)
|
|
743
751
|
|
|
744
|
-
Returns **[Promise][
|
|
752
|
+
Returns **[Promise][168]<[Project][94]>** The active project
|
|
745
753
|
|
|
746
754
|
## selectProject
|
|
747
755
|
|
|
@@ -749,13 +757,13 @@ Prompt the user to select a project from those available
|
|
|
749
757
|
|
|
750
758
|
### Parameters
|
|
751
759
|
|
|
752
|
-
* `options` **[Object][
|
|
760
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
753
761
|
|
|
754
|
-
* `options.title` **[String][
|
|
755
|
-
* `options.allowCancel` **[Boolean][
|
|
756
|
-
* `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`)
|
|
757
765
|
|
|
758
|
-
Returns **[Promise][
|
|
766
|
+
Returns **[Promise][168]<[Project][94]>** The active project
|
|
759
767
|
|
|
760
768
|
## getNamespace
|
|
761
769
|
|
|
@@ -764,9 +772,9 @@ This can be used for simpler apps which don't have their own reactive / observer
|
|
|
764
772
|
|
|
765
773
|
### Parameters
|
|
766
774
|
|
|
767
|
-
* `name` **[String][
|
|
775
|
+
* `name` **[String][164]** The alias of the namespace, this should be alphanumeric + hyphens + underscores
|
|
768
776
|
|
|
769
|
-
Returns **[Promise][
|
|
777
|
+
Returns **[Promise][168]<[Object][165]>** A promise which resolves to the namespace POJO state
|
|
770
778
|
|
|
771
779
|
## setNamespace
|
|
772
780
|
|
|
@@ -775,13 +783,13 @@ This can be used for simpler apps which don't have their own reactive / observer
|
|
|
775
783
|
|
|
776
784
|
### Parameters
|
|
777
785
|
|
|
778
|
-
* `name` **[String][
|
|
779
|
-
* `state` **[Object][
|
|
780
|
-
* `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
|
|
781
789
|
|
|
782
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'`)
|
|
783
791
|
|
|
784
|
-
Returns **[Promise][
|
|
792
|
+
Returns **[Promise][168]<[Object][165]>** A promise which resolves to the namespace POJO state
|
|
785
793
|
|
|
786
794
|
## listNamespaces
|
|
787
795
|
|
|
@@ -789,9 +797,9 @@ Return a list of namespaces available to the current project
|
|
|
789
797
|
|
|
790
798
|
### Properties
|
|
791
799
|
|
|
792
|
-
* `name` **[String][
|
|
800
|
+
* `name` **[String][164]** The name of the namespace
|
|
793
801
|
|
|
794
|
-
Returns **[Promise][
|
|
802
|
+
Returns **[Promise][168]<[Array][171]<[Object][165]>>** Collection of available namespaces for the current project
|
|
795
803
|
|
|
796
804
|
## getProjectState
|
|
797
805
|
|
|
@@ -799,12 +807,12 @@ Return the current, full snapshot state of the active project
|
|
|
799
807
|
|
|
800
808
|
### Parameters
|
|
801
809
|
|
|
802
|
-
* `options` **[Object][
|
|
810
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
803
811
|
|
|
804
|
-
* `options.autoRequire` **[Boolean][
|
|
805
|
-
* `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/'],
|
|
806
814
|
|
|
807
|
-
Returns **[Promise][
|
|
815
|
+
Returns **[Promise][168]<[Object][165]>** The current project state snapshot
|
|
808
816
|
|
|
809
817
|
## setProjectState
|
|
810
818
|
|
|
@@ -816,13 +824,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
816
824
|
|
|
817
825
|
### Parameters
|
|
818
826
|
|
|
819
|
-
* `path` **([String][
|
|
827
|
+
* `path` **([String][164] | [Array][171]<[String][164]>)** The sub-path within the project state to set
|
|
820
828
|
* `value` **any** The value to set
|
|
821
|
-
* `options` **[Object][
|
|
829
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
822
830
|
|
|
823
|
-
* `options.save` **[Boolean][
|
|
831
|
+
* `options.save` **[Boolean][173]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
824
832
|
|
|
825
|
-
Returns **[Promise][
|
|
833
|
+
Returns **[Promise][168]** A promise which resolves when the operation has been dispatched to the server
|
|
826
834
|
|
|
827
835
|
## setProjectStateDefaults
|
|
828
836
|
|
|
@@ -832,18 +840,18 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
832
840
|
|
|
833
841
|
### Parameters
|
|
834
842
|
|
|
835
|
-
* `path` **([String][
|
|
843
|
+
* `path` **([String][164] | [Array][171]<[String][164]>)** The sub-path within the project state to set
|
|
836
844
|
* `value` **any** The value to set
|
|
837
|
-
* `options` **[Object][
|
|
845
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
838
846
|
|
|
839
|
-
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
|
|
840
848
|
|
|
841
849
|
## setProjectStateRefresh
|
|
842
850
|
|
|
843
851
|
Force refetching the remote project state into local
|
|
844
852
|
This is only ever needed when saving large quantities of data that need to be immediately available
|
|
845
853
|
|
|
846
|
-
Returns **[Promise][
|
|
854
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
847
855
|
|
|
848
856
|
## FileFilters
|
|
849
857
|
|
|
@@ -851,10 +859,10 @@ Data structure for a file filter
|
|
|
851
859
|
|
|
852
860
|
### Properties
|
|
853
861
|
|
|
854
|
-
* `library` **[Boolean][
|
|
855
|
-
* `filename` **[String][
|
|
856
|
-
* `basename` **[String][
|
|
857
|
-
* `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
|
|
858
866
|
|
|
859
867
|
## selectProjectFile
|
|
860
868
|
|
|
@@ -862,20 +870,20 @@ Prompt the user to select a library to operate on
|
|
|
862
870
|
|
|
863
871
|
### Parameters
|
|
864
872
|
|
|
865
|
-
* `options` **[Object][
|
|
873
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
866
874
|
|
|
867
|
-
* `options.title` **[String][
|
|
868
|
-
* `options.hint` **([String][
|
|
869
|
-
* `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`)
|
|
870
878
|
* `options.filters` **[FileFilters][116]?** Optional file filters
|
|
871
|
-
* `options.allowUpload` **[Boolean][
|
|
872
|
-
* `options.allowRefresh` **[Boolean][
|
|
873
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
874
|
-
* `options.allowCancel` **[Boolean][
|
|
875
|
-
* `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`)
|
|
876
884
|
* `options.filter` **[FileFilters][116]?** Optional file filters
|
|
877
885
|
|
|
878
|
-
Returns **[Promise][
|
|
886
|
+
Returns **[Promise][168]<[ProjectFile][1]>** The eventually selected file, if in save mode new files are created as stubs
|
|
879
887
|
|
|
880
888
|
## getProjectFiles
|
|
881
889
|
|
|
@@ -883,13 +891,13 @@ Fetch the files associated with a given project
|
|
|
883
891
|
|
|
884
892
|
### Parameters
|
|
885
893
|
|
|
886
|
-
* `options` **[Object][
|
|
894
|
+
* `options` **[Object][165]** Options which mutate behaviour
|
|
887
895
|
|
|
888
|
-
* `options.autoRequire` **[Boolean][
|
|
889
|
-
* `options.lazy` **[Boolean][
|
|
890
|
-
* `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`)
|
|
891
899
|
|
|
892
|
-
Returns **[Promise][
|
|
900
|
+
Returns **[Promise][168]<[Array][171]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
893
901
|
|
|
894
902
|
## getProjectFileContents
|
|
895
903
|
|
|
@@ -897,8 +905,8 @@ Fetch the raw contents of a file by its ID
|
|
|
897
905
|
|
|
898
906
|
### Parameters
|
|
899
907
|
|
|
900
|
-
* `id` **[String][
|
|
901
|
-
* `options` **[Object][
|
|
908
|
+
* `id` **[String][164]?** File ID to retrieve the contents of
|
|
909
|
+
* `options` **[Object][165]?** Additioanl options to mutate behaviour
|
|
902
910
|
|
|
903
911
|
* `options.format` **(`"blob"` | `"json"`)** The format to retrieve the file in (optional, default `'blob'`)
|
|
904
912
|
|
|
@@ -910,13 +918,13 @@ Fetch a project file by its name
|
|
|
910
918
|
|
|
911
919
|
### Parameters
|
|
912
920
|
|
|
913
|
-
* `id` **[String][
|
|
914
|
-
* `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
|
|
915
923
|
|
|
916
|
-
* `options.subkey` **[String][
|
|
917
|
-
* `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`)
|
|
918
926
|
|
|
919
|
-
Returns **[Promise][
|
|
927
|
+
Returns **[Promise][168]<[ProjectFile][1]>** The eventual fetched ProjectFile (or requested subkey)
|
|
920
928
|
|
|
921
929
|
## createProjectFile
|
|
922
930
|
|
|
@@ -925,9 +933,29 @@ This creates an empty file which can then be written to
|
|
|
925
933
|
|
|
926
934
|
### Parameters
|
|
927
935
|
|
|
928
|
-
* `name` **[String][
|
|
936
|
+
* `name` **[String][164]** The name + relative directory path component
|
|
929
937
|
|
|
930
|
-
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).
|
|
931
959
|
|
|
932
960
|
## deleteProjectFile
|
|
933
961
|
|
|
@@ -935,9 +963,9 @@ Remove a project file by its ID
|
|
|
935
963
|
|
|
936
964
|
### Parameters
|
|
937
965
|
|
|
938
|
-
* `id` **[String][
|
|
966
|
+
* `id` **[String][164]** The File ID to remove
|
|
939
967
|
|
|
940
|
-
Returns **[Promise][
|
|
968
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
941
969
|
|
|
942
970
|
## setProjectFileContents
|
|
943
971
|
|
|
@@ -945,18 +973,55 @@ Save (or overwrite) a file within a project
|
|
|
945
973
|
|
|
946
974
|
### Parameters
|
|
947
975
|
|
|
948
|
-
* `id` **([String][
|
|
949
|
-
* `contents` **(File | [Blob][
|
|
950
|
-
* `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
|
+
<!---->
|
|
951
1003
|
|
|
952
|
-
|
|
953
|
-
* `options.autoRequire` **[Boolean][167]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
954
|
-
* `options.hint` **([String][158] | [Array][164]<[String][158]>)?** Hint(s) to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
955
|
-
* `options.filename` **[String][158]?** Suggested filename if `id` is unspecified
|
|
956
|
-
* `options.title` **[String][158]** Dialog title if `id` is unspecified and a prompt is necessary (optional, default `'Save citation library'`)
|
|
957
|
-
* `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.
|
|
958
1005
|
|
|
959
|
-
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.
|
|
960
1025
|
|
|
961
1026
|
## selectProjectLibrary
|
|
962
1027
|
|
|
@@ -964,19 +1029,19 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
964
1029
|
|
|
965
1030
|
### Parameters
|
|
966
1031
|
|
|
967
|
-
* `options` **[Object][
|
|
1032
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
968
1033
|
|
|
969
|
-
* `options.title` **[String][
|
|
970
|
-
* `options.hint` **([String][
|
|
971
|
-
* `options.allowUpload` **[Boolean][
|
|
972
|
-
* `options.allowRefresh` **[Boolean][
|
|
973
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
974
|
-
* `options.allowCancel` **[Boolean][
|
|
975
|
-
* `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`)
|
|
976
1041
|
* `options.filters` **[FileFilters][116]?** Optional file filters, defaults to citation library selection only
|
|
977
1042
|
* `options` **...any?** Additional options - see `getProjectLibrary()`
|
|
978
1043
|
|
|
979
|
-
Returns **[Promise][
|
|
1044
|
+
Returns **[Promise][168]<[Array][171]\<Ref>>** A collection of references from the selected file
|
|
980
1045
|
|
|
981
1046
|
## getProjectLibrary
|
|
982
1047
|
|
|
@@ -984,15 +1049,15 @@ Fetch + convert a project file into a library of citations
|
|
|
984
1049
|
|
|
985
1050
|
### Parameters
|
|
986
1051
|
|
|
987
|
-
* `id` **[String][
|
|
988
|
-
* `options` **[Object][
|
|
1052
|
+
* `id` **[String][164]** File ID to read
|
|
1053
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
989
1054
|
|
|
990
|
-
* `options.format` **[String][
|
|
991
|
-
* `options.autoRequire` **[Boolean][
|
|
992
|
-
* `options.filter` **[Function][
|
|
993
|
-
* `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
|
|
994
1059
|
|
|
995
|
-
Returns **([Promise][
|
|
1060
|
+
Returns **([Promise][168]<[Array][171]\<Ref>> | [Promise][168]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
996
1061
|
|
|
997
1062
|
## setProjectLibrary
|
|
998
1063
|
|
|
@@ -1000,33 +1065,33 @@ Save back a citation library from some input
|
|
|
1000
1065
|
|
|
1001
1066
|
### Parameters
|
|
1002
1067
|
|
|
1003
|
-
* `id` **[String][
|
|
1004
|
-
* `refs` **([Array][
|
|
1005
|
-
* `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
|
|
1006
1071
|
|
|
1007
|
-
* `options.id` **[String][
|
|
1008
|
-
* `options.refs` **([Array][
|
|
1009
|
-
* `options.format` **[String][
|
|
1010
|
-
* `options.autoRequire` **[Boolean][
|
|
1011
|
-
* `options.hint` **[String][
|
|
1012
|
-
* `options.filename` **[String][
|
|
1013
|
-
* `options.title` **[String][
|
|
1014
|
-
* `options.overwrite` **[Boolean][
|
|
1015
|
-
* `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
|
|
1016
1081
|
|
|
1017
|
-
Returns **[Promise][
|
|
1082
|
+
Returns **[Promise][168]** A promise which resolves when the save operation has completed
|
|
1018
1083
|
|
|
1019
1084
|
## projectLog
|
|
1020
1085
|
|
|
1021
1086
|
Create a log entry for the currently active project
|
|
1022
1087
|
|
|
1023
|
-
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
|
|
1024
1089
|
|
|
1025
1090
|
### Parameters
|
|
1026
1091
|
|
|
1027
|
-
* `log` **[Object][
|
|
1092
|
+
* `log` **[Object][165]** The log entry to create
|
|
1028
1093
|
|
|
1029
|
-
Returns **[Promise][
|
|
1094
|
+
Returns **[Promise][168]** A promise which resolves when the operation has completed
|
|
1030
1095
|
|
|
1031
1096
|
## setPage
|
|
1032
1097
|
|
|
@@ -1035,10 +1100,10 @@ This is usually called by a tool nested within the tera-tools.com embed
|
|
|
1035
1100
|
|
|
1036
1101
|
### Parameters
|
|
1037
1102
|
|
|
1038
|
-
* `options` **([Object][
|
|
1103
|
+
* `options` **([Object][165] | [String][164])** Context information about the page, if this is a string, its assumed to popupate `url`
|
|
1039
1104
|
|
|
1040
|
-
* `options.path` **[String][
|
|
1041
|
-
* `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
|
|
1042
1107
|
|
|
1043
1108
|
## uiAlert
|
|
1044
1109
|
|
|
@@ -1046,15 +1111,15 @@ Display simple text within TERA
|
|
|
1046
1111
|
|
|
1047
1112
|
### Parameters
|
|
1048
1113
|
|
|
1049
|
-
* `text` **[String][
|
|
1050
|
-
* `options` **[Object][
|
|
1114
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1115
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1051
1116
|
|
|
1052
|
-
* `options.body` **[String][
|
|
1053
|
-
* `options.isHtml` **[Boolean][
|
|
1054
|
-
* `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'`)
|
|
1055
1120
|
* `options.buttons` **(`"ok"` | `false`)** Button set to use or falsy to disable (optional, default `'ok'`)
|
|
1056
1121
|
|
|
1057
|
-
Returns **[Promise][
|
|
1122
|
+
Returns **[Promise][168]** A promise which resolves when the alert has been dismissed
|
|
1058
1123
|
|
|
1059
1124
|
## uiConfirm
|
|
1060
1125
|
|
|
@@ -1062,14 +1127,14 @@ Present a simple ok/cancel dialog to the user
|
|
|
1062
1127
|
|
|
1063
1128
|
### Parameters
|
|
1064
1129
|
|
|
1065
|
-
* `text` **[String][
|
|
1066
|
-
* `options` **[Object][
|
|
1130
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1131
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1067
1132
|
|
|
1068
|
-
* `options.body` **[String][
|
|
1069
|
-
* `options.isHtml` **[Boolean][
|
|
1070
|
-
* `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'`)
|
|
1071
1136
|
|
|
1072
|
-
Returns **[Promise][
|
|
1137
|
+
Returns **[Promise][168]** A promise which resolves with `Promise.resolve('OK')` or rejects with `Promise.reject('CANCEL')`
|
|
1073
1138
|
|
|
1074
1139
|
## uiPanic
|
|
1075
1140
|
|
|
@@ -1077,7 +1142,7 @@ Trigger a fatal error, killing the outer TERA site
|
|
|
1077
1142
|
|
|
1078
1143
|
### Parameters
|
|
1079
1144
|
|
|
1080
|
-
* `text` **[String][
|
|
1145
|
+
* `text` **[String][164]?** Text to display
|
|
1081
1146
|
|
|
1082
1147
|
## uiProgress
|
|
1083
1148
|
|
|
@@ -1086,18 +1151,18 @@ All options are cumulative - i.e. they are merged with other options previously
|
|
|
1086
1151
|
|
|
1087
1152
|
### Parameters
|
|
1088
1153
|
|
|
1089
|
-
* `options` **([Object][
|
|
1154
|
+
* `options` **([Object][165] | [Boolean][173])?** Additional options to mutate behaviour, if boolean false `{close: true}` is assumed
|
|
1090
1155
|
|
|
1091
|
-
* `options.title` **[String][
|
|
1092
|
-
* `options.backdrop` **[String][
|
|
1093
|
-
* `options.body` **[String][
|
|
1094
|
-
* `options.bodyHtml` **[Boolean][
|
|
1095
|
-
* `options.close` **[Boolean][
|
|
1096
|
-
* `options.text` **[String][
|
|
1097
|
-
* `options.progress` **[Number][
|
|
1098
|
-
* `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
|
|
1099
1164
|
|
|
1100
|
-
Returns **[Promise][
|
|
1165
|
+
Returns **[Promise][168]** A promise which resolves when the dialog has been updated
|
|
1101
1166
|
|
|
1102
1167
|
## uiPrompt
|
|
1103
1168
|
|
|
@@ -1105,17 +1170,17 @@ Prompt the user for an input, responding with a Promisable value
|
|
|
1105
1170
|
|
|
1106
1171
|
### Parameters
|
|
1107
1172
|
|
|
1108
|
-
* `text` **[String][
|
|
1109
|
-
* `options` **[Object][
|
|
1173
|
+
* `text` **[String][164]?** Text to display, if specified this populates `options.body`
|
|
1174
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1110
1175
|
|
|
1111
|
-
* `options.body` **[String][
|
|
1112
|
-
* `options.isHtml` **[Boolean][
|
|
1113
|
-
* `options.value` **[String][
|
|
1114
|
-
* `options.title` **[String][
|
|
1115
|
-
* `options.placeholder` **[String][
|
|
1116
|
-
* `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`)
|
|
1117
1182
|
|
|
1118
|
-
Returns **[Promise][
|
|
1183
|
+
Returns **[Promise][168]\<any>** Either the eventual user value or a throw with `Promise.reject('CANCEL')`
|
|
1119
1184
|
|
|
1120
1185
|
## uiThrow
|
|
1121
1186
|
|
|
@@ -1123,7 +1188,7 @@ Catch an error using the TERA error handler
|
|
|
1123
1188
|
|
|
1124
1189
|
### Parameters
|
|
1125
1190
|
|
|
1126
|
-
* `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
|
|
1127
1192
|
|
|
1128
1193
|
Returns **Void** This function is fatal
|
|
1129
1194
|
|
|
@@ -1133,13 +1198,13 @@ Open a popup window containing a new site
|
|
|
1133
1198
|
|
|
1134
1199
|
### Parameters
|
|
1135
1200
|
|
|
1136
|
-
* `url` **[String][
|
|
1137
|
-
* `options` **[Object][
|
|
1201
|
+
* `url` **[String][164]** The URL to open
|
|
1202
|
+
* `options` **[Object][165]?** Additional options to mutate behaviour
|
|
1138
1203
|
|
|
1139
|
-
* `options.width` **[Number][
|
|
1140
|
-
* `options.height` **[Number][
|
|
1141
|
-
* `options.center` **[Boolean][
|
|
1142
|
-
* `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)
|
|
1143
1208
|
|
|
1144
1209
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
1145
1210
|
|
|
@@ -1150,10 +1215,10 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1150
1215
|
|
|
1151
1216
|
### Parameters
|
|
1152
1217
|
|
|
1153
|
-
* `content` **(DOMElement | [String][
|
|
1154
|
-
* `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
|
|
1155
1220
|
|
|
1156
|
-
* `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`)
|
|
1157
1222
|
|
|
1158
1223
|
[1]: #projectfile
|
|
1159
1224
|
|
|
@@ -1409,92 +1474,104 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1409
1474
|
|
|
1410
1475
|
[127]: #parameters-37
|
|
1411
1476
|
|
|
1412
|
-
[128]: #
|
|
1477
|
+
[128]: #moveprojectfile
|
|
1413
1478
|
|
|
1414
1479
|
[129]: #parameters-38
|
|
1415
1480
|
|
|
1416
|
-
[130]: #
|
|
1481
|
+
[130]: #deleteprojectfile
|
|
1417
1482
|
|
|
1418
1483
|
[131]: #parameters-39
|
|
1419
1484
|
|
|
1420
|
-
[132]: #
|
|
1485
|
+
[132]: #setprojectfilecontents
|
|
1421
1486
|
|
|
1422
1487
|
[133]: #parameters-40
|
|
1423
1488
|
|
|
1424
|
-
[134]: #
|
|
1489
|
+
[134]: #createprojectfolder
|
|
1425
1490
|
|
|
1426
1491
|
[135]: #parameters-41
|
|
1427
1492
|
|
|
1428
|
-
[136]: #
|
|
1493
|
+
[136]: #deleteprojectfolder
|
|
1429
1494
|
|
|
1430
1495
|
[137]: #parameters-42
|
|
1431
1496
|
|
|
1432
|
-
[138]: #
|
|
1497
|
+
[138]: #selectprojectlibrary
|
|
1433
1498
|
|
|
1434
1499
|
[139]: #parameters-43
|
|
1435
1500
|
|
|
1436
|
-
[140]: #
|
|
1501
|
+
[140]: #getprojectlibrary
|
|
1437
1502
|
|
|
1438
1503
|
[141]: #parameters-44
|
|
1439
1504
|
|
|
1440
|
-
[142]: #
|
|
1505
|
+
[142]: #setprojectlibrary
|
|
1441
1506
|
|
|
1442
1507
|
[143]: #parameters-45
|
|
1443
1508
|
|
|
1444
|
-
[144]: #
|
|
1509
|
+
[144]: #projectlog
|
|
1445
1510
|
|
|
1446
1511
|
[145]: #parameters-46
|
|
1447
1512
|
|
|
1448
|
-
[146]: #
|
|
1513
|
+
[146]: #setpage
|
|
1449
1514
|
|
|
1450
1515
|
[147]: #parameters-47
|
|
1451
1516
|
|
|
1452
|
-
[148]: #
|
|
1517
|
+
[148]: #uialert
|
|
1453
1518
|
|
|
1454
1519
|
[149]: #parameters-48
|
|
1455
1520
|
|
|
1456
|
-
[150]: #
|
|
1521
|
+
[150]: #uiconfirm
|
|
1457
1522
|
|
|
1458
1523
|
[151]: #parameters-49
|
|
1459
1524
|
|
|
1460
|
-
[152]: #
|
|
1525
|
+
[152]: #uipanic
|
|
1461
1526
|
|
|
1462
1527
|
[153]: #parameters-50
|
|
1463
1528
|
|
|
1464
|
-
[154]: #
|
|
1529
|
+
[154]: #uiprogress
|
|
1465
1530
|
|
|
1466
1531
|
[155]: #parameters-51
|
|
1467
1532
|
|
|
1468
|
-
[156]: #
|
|
1533
|
+
[156]: #uiprompt
|
|
1469
1534
|
|
|
1470
1535
|
[157]: #parameters-52
|
|
1471
1536
|
|
|
1472
|
-
[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
|
|
1473
1550
|
|
|
1474
|
-
[
|
|
1551
|
+
[165]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1475
1552
|
|
|
1476
|
-
[
|
|
1553
|
+
[166]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1477
1554
|
|
|
1478
|
-
[
|
|
1555
|
+
[167]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1479
1556
|
|
|
1480
|
-
[
|
|
1557
|
+
[168]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1481
1558
|
|
|
1482
|
-
[
|
|
1559
|
+
[169]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1483
1560
|
|
|
1484
|
-
[
|
|
1561
|
+
[170]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1485
1562
|
|
|
1486
|
-
[
|
|
1563
|
+
[171]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1487
1564
|
|
|
1488
|
-
[
|
|
1565
|
+
[172]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1489
1566
|
|
|
1490
|
-
[
|
|
1567
|
+
[173]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1491
1568
|
|
|
1492
|
-
[
|
|
1569
|
+
[174]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1493
1570
|
|
|
1494
|
-
[
|
|
1571
|
+
[175]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1495
1572
|
|
|
1496
|
-
[
|
|
1573
|
+
[176]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1497
1574
|
|
|
1498
|
-
[
|
|
1575
|
+
[177]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
|
|
1499
1576
|
|
|
1500
|
-
[
|
|
1577
|
+
[178]: https://tera-tools.com/api/logs.json
|