typestack-authorizer
TypeScript icon, indicating that this package has built-in type declarations

0.0.15 • Public • Published
��# T y p e s t a c k A u t h o r i z e r > I n d e v e l o p m e n t O p i n i o n a t e d a u t h o r i z e r u s i n g t h e p o w e r o f t y p e s c r i p t a n n o t a t i o n t o a n n o t a t e ` C l a s s T y p e ` a n d ` M e t h o d s ` , * * [ I n s t a l l a t i o n ] ( / # i n s t a l a t i o n ) * * * * [ A u t h o r i z e r ] ( ) * * * * [ A l l o w A c c e s s ] ( ) * * * * [ D e n y A c c e s s ] ( ) * * * * [ T y p e G r a p h q l M i d d l e w a r e ] ( ) * * # # I n s t a l l a t i o n ` ` ` n p m i n s t a l l t y p e s t a c k - a u t h o r i z e r ` ` ` # # A u t h o r i z e r ` ` ` t s @ A u t h o r i z e r ( ) e x p o r t c l a s s P o s t R e s o l v e r { } ` ` ` # # A l l o w A c c e s s ` ` ` t s @ A l l o w ( ) c r e a t e P o s t ( ) { } ` ` ` # # D e n y A c c e s s ` ` ` t s @ D e n y ( ) d e l e t e P o s t ( ) { } ` ` ` # # T y p e G r a p h q l G l o b a l M i d d l e w a r e ` ` ` t s i m p o r t { N e x t F n } f r o m ' t y p e - g r a p h q l ' i m p o r t { E f f e c t , A u t h o r i z e r D a t a } f r o m ' t y p e s t a c k - a u t h o r i z e r ' a s y n c f u n c t i o n a u t h o r i z e r ( { a u t h o r i z e r } : A u t h o r i z e r D a t a , n e x t : N e x t F n ) { i f ( a u t h o r i z e r . e f f e c t = = = E f f e c t . A L L O W ) { r e t u r n a w a i t n e x t ( ) } e l s e i f ( a u t h o r i z e r . e f f e c t = = = E f f e c t . D E N Y ) { t h r o w n e w E r r o r ( ' U n a u t h o r i z e d ' ) } e l s e { / / e l s e } } r e g i s t e r T y p e G r a p h q l G l o b a l M i d d l e w a r e ( a u t h o r i z e r ) ` ` `

Readme

Keywords

none

Package Sidebar

Install

npm i typestack-authorizer

Weekly Downloads

1

Version

0.0.15

License

ISC

Unpacked Size

70.4 kB

Total Files

18

Last publish

Collaborators

  • wycliffe-peart