Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188809
root-subject.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
root-subject.ts
View Options
import
*
as
Errors
from
"../../response/errors"
;
import
Subject
from
"../subject"
;
import
CollectionsSubjectFn
from
"./collections-subject"
;
import
SessionsSubjectFn
from
"./sessions-subject"
;
import
UsersSubjectFn
from
"./users-subject"
;
import
UploadedFilesSubjectFn
from
"./uploaded-files"
;
import
SpecificationsSubjectFn
from
"./specifications"
;
import
FormattedImagesSubjectFn
from
"./formatted-images"
;
import
App
from
"../../app/app"
;
const
child_subjects_generators
=
[
CollectionsSubjectFn
,
SessionsSubjectFn
,
UsersSubjectFn
,
UploadedFilesSubjectFn
,
SpecificationsSubjectFn
,
FormattedImagesSubjectFn
,
];
export
default
class
RootSubject
extends
Subject
{
child_subjects
:
{
[
subject_name
:
string
]
:
Subject
};
constructor
(
app
:
App
)
{
super
(
app
);
this
.
child_subjects
=
{};
child_subjects_generators
.
forEach
((
subjectFn
)
=>
{
const
subject
=
new
subjectFn
(
app
);
this
.
child_subjects
[
subject
.
getName
()]
=
subject
;
});
}
getName
=
()
=>
"root"
;
async
getChildSubject
(
path_element
:
string
)
{
const
ret
=
this
.
child_subjects
[
path_element
];
if
(
ret
===
undefined
)
{
throw
new
Errors
.
BadSubjectPath
(
`No child subject with key '
${
path_element
}
' in RootSubject`
);
}
else
{
return
ret
;
}
}
async
performAction
()
{
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 08:32 (12 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
807926
Default Alt Text
root-subject.ts (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment