@iebh/tera-fy 2.3.1 → 2.3.2
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/.vscode/settings.json +5 -0
- package/CHANGELOG.md +15 -0
- package/api.md +34 -35
- package/dist/lib/projectFile.d.ts +3 -3
- package/dist/lib/projectFile.js +4 -3
- package/dist/lib/projectFile.js.map +1 -1
- package/dist/lib/syncro/entities.js +11 -10
- package/dist/lib/syncro/entities.js.map +1 -1
- package/dist/lib/syncro/keyed.d.ts +2 -2
- package/dist/lib/syncro/keyed.js +23 -23
- package/dist/lib/syncro/keyed.js.map +1 -1
- package/dist/lib/syncro/syncro.d.ts +15 -13
- package/dist/lib/syncro/syncro.js +84 -59
- package/dist/lib/syncro/syncro.js.map +1 -1
- package/dist/lib/terafy.bootstrapper.d.ts +2 -2
- package/dist/lib/terafy.bootstrapper.js +15 -16
- package/dist/lib/terafy.bootstrapper.js.map +1 -1
- package/dist/lib/terafy.client.d.ts +24 -25
- package/dist/lib/terafy.client.js +50 -48
- package/dist/lib/terafy.client.js.map +1 -1
- package/dist/lib/terafy.proxy.js +4 -2
- package/dist/lib/terafy.proxy.js.map +1 -1
- package/dist/lib/terafy.server.d.ts +21 -7
- package/dist/lib/terafy.server.js +51 -53
- package/dist/lib/terafy.server.js.map +1 -1
- package/dist/plugin.vue2.es2019.js +210 -1224
- package/dist/plugins/base.d.ts +2 -2
- package/dist/plugins/base.js +1 -0
- package/dist/plugins/base.js.map +1 -1
- package/dist/plugins/firebase.d.ts +4 -4
- package/dist/plugins/firebase.js +7 -7
- package/dist/plugins/firebase.js.map +1 -1
- package/dist/plugins/vue2.d.ts +1 -1
- package/dist/plugins/vue2.js +6 -5
- package/dist/plugins/vue2.js.map +1 -1
- package/dist/plugins/vue3.js +6 -5
- package/dist/plugins/vue3.js.map +1 -1
- 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.js +1 -1
- package/dist/utils/mixin.js.map +1 -1
- package/dist/utils/pDefer.d.ts +5 -1
- package/dist/utils/pDefer.js +6 -1
- package/dist/utils/pDefer.js.map +1 -1
- package/dist/utils/pathTools.d.ts +1 -1
- package/dist/utils/pathTools.js +2 -2
- package/dist/utils/pathTools.js.map +1 -1
- package/eslint.config.js +21 -7
- package/lib/projectFile.ts +5 -4
- package/lib/syncro/entities.ts +11 -10
- package/lib/syncro/keyed.ts +24 -24
- package/lib/syncro/syncro.ts +97 -60
- package/lib/terafy.bootstrapper.ts +15 -16
- package/lib/terafy.client.ts +61 -61
- package/lib/terafy.proxy.ts +8 -5
- package/lib/terafy.server.ts +72 -57
- package/package.json +5 -3
- package/plugins/base.ts +3 -2
- package/plugins/firebase.ts +12 -11
- package/plugins/vue2.ts +7 -6
- package/plugins/vue3.ts +6 -5
- package/utils/mixin.ts +1 -1
- package/utils/pDefer.ts +7 -2
- package/utils/pathTools.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.2](https://github.com/IEBH/TERA-fy/compare/v2.3.1...v2.3.2) (2026-02-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### chore
|
|
7
|
+
|
|
8
|
+
* Regen package-lock ([e0bbf05](https://github.com/IEBH/TERA-fy/commit/e0bbf056b31e2f59aa63e612f452adedf7d3e848))
|
|
9
|
+
* Version bump release-it ([bd52942](https://github.com/IEBH/TERA-fy/commit/bd52942ccd00822d65fdc3c1a31700a95dda0ae4))
|
|
10
|
+
|
|
11
|
+
### fix
|
|
12
|
+
|
|
13
|
+
* Build errors ([5678d93](https://github.com/IEBH/TERA-fy/commit/5678d9364869e9e46a22f67260fa31128cbdc20e))
|
|
14
|
+
* Invited user fails to initialise project ([845a994](https://github.com/IEBH/TERA-fy/commit/845a994646810ba88b5f6eb7b06aa86a20e42b76))
|
|
15
|
+
* Most eslint errors + typos ([c478060](https://github.com/IEBH/TERA-fy/commit/c4780603ff4adf0dc7b32ae04f0c75dc41cd6eb8))
|
|
16
|
+
* Select project file settings documentation ([ebe4e7f](https://github.com/IEBH/TERA-fy/commit/ebe4e7fa26b95d581e1c7bc1e736c0e1687334de))
|
|
17
|
+
|
|
3
18
|
## [2.3.1](https://github.com/IEBH/TERA-fy/compare/v2.3.0...v2.3.1) (2025-09-25)
|
|
4
19
|
|
|
5
20
|
|
package/api.md
CHANGED
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
* [Parameters][77]
|
|
82
82
|
* [mountNamespace][78]
|
|
83
83
|
* [Parameters][79]
|
|
84
|
-
* [Actual namespace mounting function designed to be
|
|
84
|
+
* [Actual namespace mounting function designed to be overridden by plugins][80]
|
|
85
85
|
* [Parameters][81]
|
|
86
86
|
* [unmountNamespace][82]
|
|
87
87
|
* [Parameters][83]
|
|
88
|
-
* [Actual namespace unmounting function designed to be
|
|
88
|
+
* [Actual namespace unmounting function designed to be overridden by plugins][84]
|
|
89
89
|
* [Parameters][85]
|
|
90
90
|
* [handshake][86]
|
|
91
91
|
* [Properties][87]
|
|
@@ -228,7 +228,7 @@ Type: [Object][169]
|
|
|
228
228
|
|
|
229
229
|
#### Properties
|
|
230
230
|
|
|
231
|
-
* `basename` **[String][168]** The filename +
|
|
231
|
+
* `basename` **[String][168]** The filename + extension (i.e. everything without directory name)
|
|
232
232
|
* `filename` **[String][168]** The file portion of the name (basename without the extension)
|
|
233
233
|
* `ext` **[String][168]** The extension portion of the name (always lower case)
|
|
234
234
|
* `dirName` **[String][168]** The directory path portion of the name
|
|
@@ -313,7 +313,7 @@ Fetch the raw file contents as a Blob
|
|
|
313
313
|
|
|
314
314
|
#### Parameters
|
|
315
315
|
|
|
316
|
-
* `options` **[Object][169]?**
|
|
316
|
+
* `options` **[Object][169]?** Additional options to mutate behaviour
|
|
317
317
|
|
|
318
318
|
Returns **[Promise][174]<[Blob][175]>** The eventual raw file contents as a Blob
|
|
319
319
|
|
|
@@ -368,7 +368,7 @@ as it's not included in the serialized output.
|
|
|
368
368
|
|
|
369
369
|
* `data` **[Object][169]** An input object created via `ProjectFiles.serialize()` (MUST include a 'tera' property added manually)
|
|
370
370
|
|
|
371
|
-
Returns **[ProjectFile][1]** A ProjectFile instance setup against the
|
|
371
|
+
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserialized data
|
|
372
372
|
|
|
373
373
|
## TeraFy
|
|
374
374
|
|
|
@@ -383,7 +383,7 @@ Type: [Object][169]
|
|
|
383
383
|
#### Properties
|
|
384
384
|
|
|
385
385
|
* `session` **[String][168]** Unique session signature for this instance of TeraFy, used to sign server messages, if falsy `getEntropicString(16)` is used to populate
|
|
386
|
-
* `devMode` **[Boolean][172]** Operate in Dev-Mode - i.e. force outer refresh when encountering an existing TeraFy instance + be more
|
|
386
|
+
* `devMode` **[Boolean][172]** Operate in Dev-Mode - i.e. force outer refresh when encountering an existing TeraFy instance + be more tolerant of weird iframe origins
|
|
387
387
|
* `verbosity` **[Number][171]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
|
|
388
388
|
* `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
|
|
389
389
|
* `modeFallback` **[String][168]** Method to use when all method detection fails
|
|
@@ -392,7 +392,7 @@ Type: [Object][169]
|
|
|
392
392
|
* `siteUrl` **[String][168]** The TERA URL to connect to
|
|
393
393
|
* `restrictOrigin` **[String][168]** URL to restrict communications to
|
|
394
394
|
* `List` **[Array][173]<[String][168]>** of sandbox allowables for the embedded if in embed mode
|
|
395
|
-
* `handshakeInterval` **[Number][171]** Interval in milliseconds when
|
|
395
|
+
* `handshakeInterval` **[Number][171]** Interval in milliseconds when scanning for a handshake
|
|
396
396
|
* `handshakeTimeout` **[Number][171]** Interval in milliseconds for when to give up trying to handshake
|
|
397
397
|
* `debugPaths` **[Array][173]<([String][168] | [Array][173]<[String][168]>)>?** 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
|
|
398
398
|
|
|
@@ -431,7 +431,7 @@ Type: [Array][173]\<TeraFyPlugin>
|
|
|
431
431
|
### namespaces
|
|
432
432
|
|
|
433
433
|
Active namespaces we are subscribed to
|
|
434
|
-
Each key is the namespace name with the value as the local reactive \ observer \ object
|
|
434
|
+
Each key is the namespace name with the value as the local reactive \ observer \ object equivalent
|
|
435
435
|
The key string is always of the form `${ENTITY}::${ID}` e.g. `projects:1234`
|
|
436
436
|
|
|
437
437
|
Type: [Object][169]<[Object][169]>
|
|
@@ -482,14 +482,14 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
|
|
|
482
482
|
|
|
483
483
|
### init
|
|
484
484
|
|
|
485
|
-
|
|
486
|
-
This function can only be called once and will return the existing init() worker Promise if its called
|
|
485
|
+
Initialize the TERA client singleton
|
|
486
|
+
This function can only be called once and will return the existing init() worker Promise if its called against
|
|
487
487
|
|
|
488
488
|
#### Parameters
|
|
489
489
|
|
|
490
490
|
* `options` **[Object][169]?** Additional options to merge into `settings` via `set`
|
|
491
491
|
|
|
492
|
-
Returns **[Promise][174]<[TeraFy][33]>** An eventual promise which will
|
|
492
|
+
Returns **[Promise][174]<[TeraFy][33]>** An eventual promise which will resolve with this terafy instance
|
|
493
493
|
|
|
494
494
|
### detectMode
|
|
495
495
|
|
|
@@ -500,9 +500,9 @@ Returns **[Promise][174]<[String][168]>** A promise which will resolve with the
|
|
|
500
500
|
|
|
501
501
|
### injectComms
|
|
502
502
|
|
|
503
|
-
Find an existing active TERA server OR
|
|
503
|
+
Find an existing active TERA server OR initialize one
|
|
504
504
|
|
|
505
|
-
Returns **[Promise][174]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or
|
|
505
|
+
Returns **[Promise][174]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initialized a child
|
|
506
506
|
|
|
507
507
|
### handshakeLoop
|
|
508
508
|
|
|
@@ -514,7 +514,7 @@ Keep trying to handshake until the target responds
|
|
|
514
514
|
|
|
515
515
|
#### Properties
|
|
516
516
|
|
|
517
|
-
* `handshakeInterval` **[Number][171]?** Interval in milliseconds when
|
|
517
|
+
* `handshakeInterval` **[Number][171]?** Interval in milliseconds when scanning for a handshake, defaults to global setting
|
|
518
518
|
* `handshakeTimeout` **[Number][171]?** Interval in milliseconds for when to give up trying to handshake, defaults to global setting
|
|
519
519
|
|
|
520
520
|
Returns **[Promise][174]** A promise which will either resolve when the handshake is successful OR fail with 'TIMEOUT'
|
|
@@ -523,7 +523,7 @@ Returns **[Promise][174]** A promise which will either resolve when the handshak
|
|
|
523
523
|
|
|
524
524
|
Inject a local stylesheet to handle TERA server functionality
|
|
525
525
|
|
|
526
|
-
Returns **[Promise][174]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or
|
|
526
|
+
Returns **[Promise][174]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initialized a child
|
|
527
527
|
|
|
528
528
|
### injectMethods
|
|
529
529
|
|
|
@@ -576,7 +576,7 @@ Include a TeraFy client plugin
|
|
|
576
576
|
#### Parameters
|
|
577
577
|
|
|
578
578
|
* `source` **([Function][178] | [Object][169] | [String][168])** Either the JS module class, singleton object or URL to fetch it from. Eventually constructed as invoked as `(teraClient:TeraFy, options:Object)`
|
|
579
|
-
* `options` **[Object][169]?** Additional options to mutate behaviour during construction (pass options to init() to
|
|
579
|
+
* `options` **[Object][169]?** Additional options to mutate behaviour during construction (pass options to init() to initialize later options)
|
|
580
580
|
|
|
581
581
|
Returns **[TeraFy][33]** This chainable terafy instance
|
|
582
582
|
|
|
@@ -586,8 +586,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
586
586
|
|
|
587
587
|
#### Parameters
|
|
588
588
|
|
|
589
|
-
* `target` **[Object][169]**
|
|
590
|
-
* `source` **[Object][169]**
|
|
589
|
+
* `target` **[Object][169]** Installed class instance to extend
|
|
590
|
+
* `source` **[Object][169]** Initialized source object to extend from
|
|
591
591
|
|
|
592
592
|
### toggleDevMode
|
|
593
593
|
|
|
@@ -618,7 +618,7 @@ Generate random entropic character string in Base64
|
|
|
618
618
|
|
|
619
619
|
#### Parameters
|
|
620
620
|
|
|
621
|
-
* `maxLength` **[Number][171]** Maximum
|
|
621
|
+
* `maxLength` **[Number][171]** Maximum length of the generated string (optional, default `32`)
|
|
622
622
|
|
|
623
623
|
Returns **[String][168]** 
|
|
624
624
|
|
|
@@ -645,7 +645,7 @@ This generally creates whatever framework flavoured reactive/observer/object is
|
|
|
645
645
|
|
|
646
646
|
Returns **[Promise][174]\<Reactive>** A promise which resolves to the reactive object
|
|
647
647
|
|
|
648
|
-
## Actual namespace mounting function designed to be
|
|
648
|
+
## Actual namespace mounting function designed to be overridden by plugins
|
|
649
649
|
|
|
650
650
|
### Parameters
|
|
651
651
|
|
|
@@ -664,7 +664,7 @@ This function will remove the namespace from `namespaces`, cleaning up any memor
|
|
|
664
664
|
|
|
665
665
|
Returns **[Promise][174]** A promise which resolves when the operation has completed
|
|
666
666
|
|
|
667
|
-
## Actual namespace unmounting function designed to be
|
|
667
|
+
## Actual namespace unmounting function designed to be overridden by plugins
|
|
668
668
|
|
|
669
669
|
### Parameters
|
|
670
670
|
|
|
@@ -684,7 +684,7 @@ Returns **[Promise][174]<[Object][169]>** Basic promise result
|
|
|
684
684
|
|
|
685
685
|
## setServerVerbosity
|
|
686
686
|
|
|
687
|
-
RPC callback to set the server
|
|
687
|
+
RPC callback to set the server verbosity level
|
|
688
688
|
|
|
689
689
|
### Parameters
|
|
690
690
|
|
|
@@ -723,7 +723,7 @@ This is an pre-requisite step for requireProject()
|
|
|
723
723
|
|
|
724
724
|
* `options` **[Object][169]?** Additional options to mutate behaviour
|
|
725
725
|
|
|
726
|
-
* `options.forceRetry` **[Boolean][172]**
|
|
726
|
+
* `options.forceRetry` **[Boolean][172]** Forcibly try to refresh the user state (optional, default `false`)
|
|
727
727
|
|
|
728
728
|
Returns **[Promise][174]<[User][90]>** The current logged in user or null if none
|
|
729
729
|
|
|
@@ -754,7 +754,7 @@ Set the currently active project within TERA
|
|
|
754
754
|
## requireProject
|
|
755
755
|
|
|
756
756
|
Ask the user to select a project from those available - if one isn't already active
|
|
757
|
-
Note that this function will
|
|
757
|
+
Note that this function will persist in asking the user even if they try to cancel
|
|
758
758
|
|
|
759
759
|
### Parameters
|
|
760
760
|
|
|
@@ -784,7 +784,7 @@ Returns **[Promise][174]<[Project][96]>** The active project
|
|
|
784
784
|
## getNamespace
|
|
785
785
|
|
|
786
786
|
Get a one-off snapshot of a namespace without mounting it
|
|
787
|
-
This can be used for simpler apps which don't have their own reactive / observer
|
|
787
|
+
This can be used for simpler apps which don't have their own reactive / observer equivalent
|
|
788
788
|
|
|
789
789
|
### Parameters
|
|
790
790
|
|
|
@@ -795,7 +795,7 @@ Returns **[Promise][174]<[Object][169]>** A promise which resolves to the namesp
|
|
|
795
795
|
## setNamespace
|
|
796
796
|
|
|
797
797
|
Set (or merge by default) a one-off snapshot over an existing namespace
|
|
798
|
-
This can be used for simpler apps which don't have their own reactive / observer
|
|
798
|
+
This can be used for simpler apps which don't have their own reactive / observer equivalent and just want to quickly set something
|
|
799
799
|
|
|
800
800
|
### Parameters
|
|
801
801
|
|
|
@@ -896,10 +896,9 @@ Prompt the user to select a library to operate on
|
|
|
896
896
|
* `options.allowUpload` **[Boolean][172]** Allow uploading new files (optional, default `true`)
|
|
897
897
|
* `options.allowRefresh` **[Boolean][172]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
898
898
|
* `options.allowDownloadZip` **[Boolean][172]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
899
|
-
* `options.allowCancel` **[Boolean][172]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if
|
|
899
|
+
* `options.allowCancel` **[Boolean][172]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if actioned (optional, default `true`)
|
|
900
900
|
* `options.autoRequire` **[Boolean][172]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
901
901
|
* `options.showHiddenFiles` **[Boolean][172]** Whether hidden data.json files should be shown (optional, default `false`)
|
|
902
|
-
* `options.filter` **[FileFilters][118]?** Optional file filters
|
|
903
902
|
|
|
904
903
|
Returns **[Promise][174]<[ProjectFile][1]>** The eventually selected file, if in save mode new files are created as stubs
|
|
905
904
|
|
|
@@ -924,7 +923,7 @@ Fetch the raw contents of a file by its ID
|
|
|
924
923
|
### Parameters
|
|
925
924
|
|
|
926
925
|
* `id` **[String][168]?** File ID to retrieve the contents of
|
|
927
|
-
* `options` **[Object][169]?**
|
|
926
|
+
* `options` **[Object][169]?** Additional options to mutate behaviour
|
|
928
927
|
|
|
929
928
|
* `options.format` **(`"blob"` | `"json"`)** The format to retrieve the file in (optional, default `'blob'`)
|
|
930
929
|
|
|
@@ -1050,11 +1049,11 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
1050
1049
|
* `options` **[Object][169]?** Additional options to mutate behaviour
|
|
1051
1050
|
|
|
1052
1051
|
* `options.title` **[String][168]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
1053
|
-
* `options.hint` **([String][168] | [Array][173]<[String][168]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', '
|
|
1052
|
+
* `options.hint` **([String][168] | [Array][173]<[String][168]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'demisted'
|
|
1054
1053
|
* `options.allowUpload` **[Boolean][172]** Allow uploading new files (optional, default `true`)
|
|
1055
1054
|
* `options.allowRefresh` **[Boolean][172]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
1056
1055
|
* `options.allowDownloadZip` **[Boolean][172]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
1057
|
-
* `options.allowCancel` **[Boolean][172]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if
|
|
1056
|
+
* `options.allowCancel` **[Boolean][172]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if actioned (optional, default `true`)
|
|
1058
1057
|
* `options.autoRequire` **[Boolean][172]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
1059
1058
|
* `options.filters` **[FileFilters][118]?** Optional file filters, defaults to citation library selection only
|
|
1060
1059
|
* `options` **...any?** Additional options - see `getProjectLibrary()`
|
|
@@ -1075,7 +1074,7 @@ Fetch + convert a project file into a library of citations
|
|
|
1075
1074
|
* `options.filter` **[Function][178]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
1076
1075
|
* `options.find` **[Function][178]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
1077
1076
|
|
|
1078
|
-
Returns **([Promise][174]<[Array][173]\<Ref>> | [Promise][174]\<any>)** A collection of references (default
|
|
1077
|
+
Returns **([Promise][174]<[Array][173]\<Ref>> | [Promise][174]\<any>)** A collection of references (default behaviour) or a whatever format was requested
|
|
1079
1078
|
|
|
1080
1079
|
## setProjectLibrary
|
|
1081
1080
|
|
|
@@ -1118,7 +1117,7 @@ This is usually called by a tool nested within the tera-tools.com embed
|
|
|
1118
1117
|
|
|
1119
1118
|
### Parameters
|
|
1120
1119
|
|
|
1121
|
-
* `options` **([Object][169] | [String][168])** Context information about the page, if this is a string, its assumed to
|
|
1120
|
+
* `options` **([Object][169] | [String][168])** Context information about the page, if this is a string, its assumed to populate `url`
|
|
1122
1121
|
|
|
1123
1122
|
* `options.path` **[String][168]?** The URL path segment to restore on next refresh
|
|
1124
1123
|
* `options.title` **[String][168]?** The page title associated with the path
|
|
@@ -1412,7 +1411,7 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1412
1411
|
|
|
1413
1412
|
[79]: #parameters-19
|
|
1414
1413
|
|
|
1415
|
-
[80]: #actual-namespace-mounting-function-designed-to-be-
|
|
1414
|
+
[80]: #actual-namespace-mounting-function-designed-to-be-overridden-by-plugins
|
|
1416
1415
|
|
|
1417
1416
|
[81]: #parameters-20
|
|
1418
1417
|
|
|
@@ -1420,7 +1419,7 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
1420
1419
|
|
|
1421
1420
|
[83]: #parameters-21
|
|
1422
1421
|
|
|
1423
|
-
[84]: #actual-namespace-unmounting-function-designed-to-be-
|
|
1422
|
+
[84]: #actual-namespace-unmounting-function-designed-to-be-overridden-by-plugins
|
|
1424
1423
|
|
|
1425
1424
|
[85]: #parameters-22
|
|
1426
1425
|
|
|
@@ -60,7 +60,7 @@ export default class ProjectFile {
|
|
|
60
60
|
/**
|
|
61
61
|
* An object representing meta file parts of a file name
|
|
62
62
|
* @type {Object}
|
|
63
|
-
* @property {String} basename The filename +
|
|
63
|
+
* @property {String} basename The filename + extension (i.e. everything without directory name)
|
|
64
64
|
* @property {String} filename The file portion of the name (basename without the extension)
|
|
65
65
|
* @property {String} ext The extension portion of the name (always lower case)
|
|
66
66
|
* @property {String} dirName The directory path portion of the name
|
|
@@ -134,7 +134,7 @@ export default class ProjectFile {
|
|
|
134
134
|
/**
|
|
135
135
|
* Fetch the raw file contents as a Blob
|
|
136
136
|
*
|
|
137
|
-
* @param {Object} [options]
|
|
137
|
+
* @param {Object} [options] Additional options to mutate behaviour
|
|
138
138
|
*
|
|
139
139
|
* @returns {Promise<Blob>} The eventual raw file contents as a Blob
|
|
140
140
|
*
|
|
@@ -183,7 +183,7 @@ export default class ProjectFile {
|
|
|
183
183
|
* as it's not included in the serialized output.
|
|
184
184
|
*
|
|
185
185
|
* @param {Object} data An input object created via `ProjectFiles.serialize()` (MUST include a 'tera' property added manually)
|
|
186
|
-
* @returns {ProjectFile} A ProjectFile instance setup against the
|
|
186
|
+
* @returns {ProjectFile} A ProjectFile instance setup against the deserialized data
|
|
187
187
|
*/
|
|
188
188
|
static deserialize(data: any): ProjectFile;
|
|
189
189
|
}
|
package/dist/lib/projectFile.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
1
2
|
import { filesize } from 'filesize';
|
|
2
3
|
import { pick, omit } from 'lodash-es';
|
|
3
4
|
;
|
|
@@ -52,7 +53,7 @@ export default class ProjectFile {
|
|
|
52
53
|
if (this.isFolder) {
|
|
53
54
|
// Process all files in the folder
|
|
54
55
|
this.files = this.files?.map(file => {
|
|
55
|
-
|
|
56
|
+
const path = file.path.split(/\//).slice(3).join('/');
|
|
56
57
|
let url = this.url + '/' + file.name; // Add file name to url
|
|
57
58
|
// Parse url to show library instead of download if reflib file
|
|
58
59
|
if (file.meta.reflib) {
|
|
@@ -81,7 +82,7 @@ export default class ProjectFile {
|
|
|
81
82
|
/**
|
|
82
83
|
* Fetch the raw file contents as a Blob
|
|
83
84
|
*
|
|
84
|
-
* @param {Object} [options]
|
|
85
|
+
* @param {Object} [options] Additional options to mutate behaviour
|
|
85
86
|
*
|
|
86
87
|
* @returns {Promise<Blob>} The eventual raw file contents as a Blob
|
|
87
88
|
*
|
|
@@ -159,7 +160,7 @@ export default class ProjectFile {
|
|
|
159
160
|
* as it's not included in the serialized output.
|
|
160
161
|
*
|
|
161
162
|
* @param {Object} data An input object created via `ProjectFiles.serialize()` (MUST include a 'tera' property added manually)
|
|
162
|
-
* @returns {ProjectFile} A ProjectFile instance setup against the
|
|
163
|
+
* @returns {ProjectFile} A ProjectFile instance setup against the deserialized data
|
|
163
164
|
*/
|
|
164
165
|
static deserialize(data) {
|
|
165
166
|
// TODO: Check the below
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectFile.js","sourceRoot":"","sources":["../../lib/projectFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAStC,CAAC;AAIF;;;EAGE;AACF,MAAM,CAAC,OAAO,OAAO,WAAW;IA+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no-unused-vars */
|
|
2
|
+
// @ts-expect-error TODO: Remove when reflib gets declaration file
|
|
2
3
|
import Reflib from '@iebh/reflib';
|
|
3
4
|
import { v4 as uuid4 } from 'uuid';
|
|
4
5
|
import { nanoid } from 'nanoid';
|
|
@@ -15,7 +16,7 @@ const syncroConfig = {
|
|
|
15
16
|
institutes: {
|
|
16
17
|
singular: 'institute',
|
|
17
18
|
async initState({ supabasey, id }) {
|
|
18
|
-
|
|
19
|
+
const institute = await supabasey((supabase) => supabase
|
|
19
20
|
.from('institutes')
|
|
20
21
|
.select('data')
|
|
21
22
|
.eq('id', id)
|
|
@@ -24,7 +25,7 @@ const syncroConfig = {
|
|
|
24
25
|
return institute.data; // institute is valid and already exists
|
|
25
26
|
},
|
|
26
27
|
flushState({ supabasey, state, id }) {
|
|
27
|
-
// @ts-
|
|
28
|
+
// @ts-expect-error Typescript struggles to resolve supabasey import correctly
|
|
28
29
|
return supabasey.rpc('syncro_merge_data', {
|
|
29
30
|
table_name: 'institutes',
|
|
30
31
|
entity_id: id,
|
|
@@ -35,14 +36,14 @@ const syncroConfig = {
|
|
|
35
36
|
projects: {
|
|
36
37
|
singular: 'project',
|
|
37
38
|
async initState({ supabasey, id }) {
|
|
38
|
-
|
|
39
|
+
const projectData = await supabasey((supabase) => supabase
|
|
39
40
|
.from('projects')
|
|
40
41
|
.select('data')
|
|
41
42
|
.eq('id', id)
|
|
42
43
|
.maybeSingle());
|
|
43
44
|
if (!projectData)
|
|
44
45
|
throw new Error(`Syncro project "${id}" not found`);
|
|
45
|
-
|
|
46
|
+
const data = projectData.data;
|
|
46
47
|
// MIGRATION - Move data.temp{} into Supabase files + add pointer to filename {{{
|
|
47
48
|
if (data.temp // Project contains temp subkey
|
|
48
49
|
&& Object.values(data.temp).some((t) => typeof t == 'object') // Some of the temp keys are objects
|
|
@@ -95,7 +96,7 @@ const syncroConfig = {
|
|
|
95
96
|
async initState({ supabasey, id, relation }) {
|
|
96
97
|
if (!relation || !/_\*$/.test(relation))
|
|
97
98
|
throw new Error('Project library relation missing, path should resemble "project_library::${PROJECT}::${LIBRARY_FILE_ID}_*"');
|
|
98
|
-
|
|
99
|
+
const fileId = relation.replace(/_\*$/, '');
|
|
99
100
|
const files = await supabasey((supabase) => supabase
|
|
100
101
|
.storage
|
|
101
102
|
.from('projects')
|
|
@@ -127,7 +128,7 @@ const syncroConfig = {
|
|
|
127
128
|
async initState({ supabasey, id, relation }) {
|
|
128
129
|
if (!relation)
|
|
129
130
|
throw new Error('Project namespace relation missing, path should resemble "project_namespaces::${PROJECT}::${RELATION}"');
|
|
130
|
-
|
|
131
|
+
const rows = await supabasey((supabase) => supabase
|
|
131
132
|
.from('project_namespaces')
|
|
132
133
|
.select('data')
|
|
133
134
|
.eq('project', id)
|
|
@@ -166,7 +167,7 @@ const syncroConfig = {
|
|
|
166
167
|
test: {
|
|
167
168
|
singular: 'test',
|
|
168
169
|
async initState({ supabasey, id }) {
|
|
169
|
-
|
|
170
|
+
const rows = await supabasey((supabase) => supabase
|
|
170
171
|
.from('test')
|
|
171
172
|
.select('data')
|
|
172
173
|
.eq('id', id)
|
|
@@ -186,7 +187,7 @@ const syncroConfig = {
|
|
|
186
187
|
users: {
|
|
187
188
|
singular: 'user',
|
|
188
189
|
async initState({ supabasey, id }) {
|
|
189
|
-
|
|
190
|
+
const user = await supabasey((supabase) => supabase
|
|
190
191
|
.from('users')
|
|
191
192
|
.select('data')
|
|
192
193
|
.eq('id', id)
|
|
@@ -194,7 +195,7 @@ const syncroConfig = {
|
|
|
194
195
|
if (user)
|
|
195
196
|
return user.data; // User is valid and already exists
|
|
196
197
|
// User row doesn't already exist - need to create stub
|
|
197
|
-
|
|
198
|
+
const newUser = await supabasey((supabase) => supabase
|
|
198
199
|
.from('users')
|
|
199
200
|
.insert({
|
|
200
201
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../../lib/syncro/entities.ts"],"names":[],"mappings":"AAAA,
|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SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ;iBACjD,IAAI,CAAC,OAAO,CAAC;iBACb,MAAM,CAAC,MAAM,CAAC;iBACd,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;iBACZ,WAAW,EAAW,CACvB,CAAC;YACF,IAAI,IAAI;gBAAE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,mCAAmC;YAE/D,uDAAuD;YACvD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ;iBACpD,IAAI,CAAC,OAAO,CAAC;iBACb,MAAM,CAAU;gBAChB,EAAE;gBACF,IAAI,EAAE;oBACL,EAAE;oBACF,OAAO,EAAE,IAAI;iBACb;aACD,CAAC;iBACD,MAAM,CAAC,MAAM,CAAC;iBACd,MAAM,EAAW,CAAC,kDAAkD;aACrE,CAAC;YACF,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YACvD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,+GAA+G;QAErI,CAAC;QACD,UAAU,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAC;YAClC,OAAO,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,mBAAmB,EAAE;gBAC9D,UAAU,EAAE,OAAO;gBACnB,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,KAAK;aACf,CAAC,CAAC,CAAC;QACL,CAAC;KACD,EAAE,MAAM;CACT,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -5,7 +5,7 @@ interface FlushOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* @class SyncroKeyed
|
|
7
7
|
* TERA Isomorphic SyncroKeyed class
|
|
8
|
-
* Collate a single (
|
|
8
|
+
* Collate a single (potentially very large) single Syncro object by splitting it across multiple Syncros
|
|
9
9
|
* This makes the assumption that the Syncro content is a large object collection of objects - a keyed map collection
|
|
10
10
|
* The original impetus is to allow TERA citation libraries to be held in a Syncro object and flushed back to Supabase when editing has completed
|
|
11
11
|
*/
|
|
@@ -78,7 +78,7 @@ export default class SyncroKeyed extends Syncro {
|
|
|
78
78
|
keyedSet(key: string, value: any): Promise<any>;
|
|
79
79
|
/**
|
|
80
80
|
* Assign an entire in-memory object to members
|
|
81
|
-
* This can be thought of as the optimized
|
|
81
|
+
* This can be thought of as the optimized equivalent of Object.assign()
|
|
82
82
|
* Use this when merging large objects as it can make optimizations
|
|
83
83
|
*
|
|
84
84
|
* @param {Object} state The value to merge
|