@@ -26,6 +26,7 @@ export interface ICollection {
2626 last : number ;
2727 used : number ;
2828 uuid : string ;
29+ applied_sessions : Set < string > ;
2930 preset : boolean ;
3031 relations : string [ ] ;
3132 entries : JsonSet ;
@@ -47,6 +48,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
4748 created : Date . now ( ) ,
4849 used : 1 ,
4950 uuid : smth . uuid ( ) ,
51+ applied_sessions : new Set ( [ smth . uuid ( ) ] ) ,
5052 preset : false ,
5153 relations : [ ] ,
5254 origin : undefined ,
@@ -98,6 +100,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
98100 created : Date . now ( ) ,
99101 used : 1 ,
100102 uuid : uuid ,
103+ applied_sessions : new Set ( ) ,
101104 preset : false ,
102105 relations : [ ] ,
103106 origin : undefined ,
@@ -117,6 +120,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
117120 last : obj . getAsValidNumber ( src , 'l' ) ,
118121 preset : obj . getAsBool ( src , 'p' ) ,
119122 uuid : obj . getAsNotEmptyString ( src , 'uu' ) ,
123+ applied_sessions : obj . getAsSetOfStringsOrEmpty ( src , 'as' ) ,
120124 relations : obj . getAsArray ( src , 'r' ) ,
121125 origin : obj . getAsNotEmptyStringOrAsUndefined ( src , 'o' ) ,
122126 entries : obj . getAsObj ( src , 'e' ) ,
@@ -130,6 +134,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
130134 public used : number ;
131135 public last : number ;
132136 public uuid : string ;
137+ public applied_sessions : Set < string > ;
133138 public preset : boolean ;
134139 public relations : string [ ] ;
135140 public origin : string | undefined ;
@@ -156,6 +161,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
156161 this . last = definition . last ;
157162 this . created = definition . created ;
158163 this . uuid = definition . uuid ;
164+ this . applied_sessions = definition . applied_sessions ;
159165 this . relations = definition . relations ;
160166 this . origin = definition . origin ;
161167 this . preset = definition . preset ;
@@ -182,6 +188,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
182188 used : this . used ,
183189 created : this . created ,
184190 uuid : this . uuid ,
191+ applied_sessions : this . applied_sessions ,
185192 relations : this . relations ,
186193 preset : this . preset ,
187194 last : this . last ,
@@ -194,27 +201,6 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
194201 ) ;
195202 }
196203
197- public copy ( ) : Collections {
198- const uuid = unique ( ) ;
199- return new Collections (
200- `Collections:${ uuid } ` ,
201- {
202- name : this . name ,
203- last : Date . now ( ) ,
204- created : Date . now ( ) ,
205- used : 1 ,
206- uuid,
207- preset : false ,
208- relations : [ ] ,
209- origin : undefined ,
210- entries : this . asCollectionsArray ( )
211- . map ( ( c ) => c . as ( ) . jsonSet ( ) )
212- . flat ( ) ,
213- } ,
214- this . storage ,
215- ) ;
216- }
217-
218204 public delete ( ) {
219205 this . storage . delete ( this ) ;
220206 }
@@ -290,6 +276,7 @@ export class Collections implements EntryConvertable, Equal<Collections>, Empty
290276 this . last = definition . last ;
291277 this . created = definition . created ;
292278 this . uuid = definition . uuid ;
279+ this . applied_sessions = definition . applied_sessions ;
293280 this . relations = definition . relations ;
294281 this . origin = definition . origin ;
295282 this . preset = definition . preset ;
0 commit comments