Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995349
secret-token.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
706 B
Referenced Files
None
Subscribers
None
secret-token.ts
View Options
import
{
Field
,
Context
}
from
"../../../main"
;
import
{
v4
as
uuid
}
from
"uuid"
;
export
default
class
SecretToken
extends
Field
{
typeName
=
"secret-token"
;
isOldValueSensitive
=
()
=>
true
;
async
isProperValue
()
{
return
Field
.
valid
();
}
async
encode
(
_
:
Context
,
__
:
any
,
old_value
:
string
)
{
const
ret
=
old_value
?
old_value
:
uuid
();
return
ret
;
}
async
decode
(
context
:
Context
,
value
:
string
)
{
return
context
.
is_super
?
value
:
"it's a secret to everybody"
;
}
async
getMatchQueryValue
(
context
:
Context
,
filter
:
unknown
)
{
if
(
context
.
is_super
)
{
return
{
$eq
:
filter
};
}
else
{
return
{
$eq
:
"nice try"
};
}
}
async
getDefaultValue
()
{
return
uuid
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Dec 23, 01:01 (2 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556791
Default Alt Text
secret-token.ts (706 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment