on master help sign in
Fixed cannot read property length of null (#41)
commit74fff625709d96a60cc6d830baf342ada324212e authoriko <ilyakooo0@gmail.com> dateMon 28 Nov 2022, 10:47 (4 years ago) parentda0875f
2 files changed+614−633
backend/BW/Logic.purs+247−243 backend/BW/Types.purs+367−390
backend/BW/Logic.purs+247−243
@@ -3,6 +3,7 @@ module BW.Logic where
33import BW
44import BW.Types
55import Prelude
6+
67import Bridge as Bridge
78import Control.Monad.Error.Class (throwError)
89import Control.Promise (Promise)
@@ -31,37 +32,38 @@ import Type.Prelude (Proxy(..))
3132import Untagged.Union (type (|+|))
3233
3334-- | Creates the master key
34−makePreloginKey ::
35− forall r.
36− PreloginResponse ->
37− Email ->
38− Password ->
39− Run
40− ( crypto ::
41− Reader CryptoService
42− , effect :: Effect
43− , aff :: Aff
44− | r
45− )
46− SymmetricCryptoKey
35+makePreloginKey
36+ :: forall r
37+ . PreloginResponse
38+ -> Email
39+ -> Password
40+ -> Run
41+ ( crypto ::
42+ Reader CryptoService
43+ , effect :: Effect
44+ , aff :: Aff
45+ | r
46+ )
47+ SymmetricCryptoKey
4748makePreloginKey { kdf, kdfIterations } (Email email') password = do
4849 crypto <- askAt (Proxy :: _ "crypto")
4950 let
5051 email = (String.trim >>> String.toLower) email'
5152 liftPromise $ runFn4 crypto.makeKey password email kdf kdfIterations
5253
53−makeDecryptionKey ::
54− forall r.
54+makeDecryptionKey
55+ :: forall r
56+ .
5557 -- | Matser key (prelogin key)
56− SymmetricCryptoKey ->
57− EncryptedString ->
58− Run
59− ( crypto :: Reader CryptoService
60− , effect :: Effect
61− , aff :: Aff
62− | r
63− )
64− SymmetricCryptoKey
58+ SymmetricCryptoKey
59+ -> EncryptedString
60+ -> Run
61+ ( crypto :: Reader CryptoService
62+ , effect :: Effect
63+ , aff :: Aff
64+ | r
65+ )
66+ SymmetricCryptoKey
6567makeDecryptionKey masterKey str = do
6668 crypto <- askAt (Proxy :: _ "crypto")
6769 let
@@ -78,28 +80,29 @@ makeDecryptionKey masterKey str = do
7880 liftEffect $ Exc.throw $ "Unsupported key encryption type: " <> show encType
7981 pure $ SymmetricCryptoKey.fromArrayBuffer key
8082
81−getLogInRequestToken ::
82− forall r.
83− { prelogin :: PreloginResponse
84− , email :: Email
85− , password :: Password
86− , captchaResponse :: Maybe String
87− , secondFactor :: Bridge.Cmd_Login_secondFactor_Maybe
88− } ->
89− Run
90− ( api :: Reader ApiService
91− , crypto :: Reader CryptoService
92− , effect :: Effect
93− , aff :: Aff
94− | r
95− )
96− (IdentityCaptchaResponse |+| IdentityTwoFactorResponse |+| IdentityTokenResponse)
97−getLogInRequestToken { prelogin
98−, email
99−, password
100−, captchaResponse
101−, secondFactor: Bridge.Cmd_Login_secondFactor_Maybe secondFactor
102−} = do
83+getLogInRequestToken
84+ :: forall r
85+ . { prelogin :: PreloginResponse
86+ , email :: Email
87+ , password :: Password
88+ , captchaResponse :: Maybe String
89+ , secondFactor :: Bridge.Cmd_Login_secondFactor_Maybe
90+ }
91+ -> Run
92+ ( api :: Reader ApiService
93+ , crypto :: Reader CryptoService
94+ , effect :: Effect
95+ , aff :: Aff
96+ | r
97+ )
98+ (IdentityCaptchaResponse |+| IdentityTwoFactorResponse |+| IdentityTokenResponse)
99+getLogInRequestToken
100+ { prelogin
101+ , email
102+ , password
103+ , captchaResponse
104+ , secondFactor: Bridge.Cmd_Login_secondFactor_Maybe secondFactor
105+ } = do
103106 let
104107 twoFactor =
105108 maybe
@@ -127,18 +130,18 @@ getLogInRequestToken { prelogin
127130 }
128131 }
129132
130−bwPasswordStringHash ::
131− forall r.
132− PreloginResponse ->
133− Email ->
134− Password ->
135− Run
136− ( crypto :: Reader CryptoService
137− , effect :: Effect
138− , aff :: Aff
139− | r
140− )
141− StringHash
133+bwPasswordStringHash
134+ :: forall r
135+ . PreloginResponse
136+ -> Email
137+ -> Password
138+ -> Run
139+ ( crypto :: Reader CryptoService
140+ , effect :: Effect
141+ , aff :: Aff
142+ | r
143+ )
144+ StringHash
142145bwPasswordStringHash prelogin email password = do
143146 key <- makePreloginKey prelogin email password
144147 crypto <- askAt (Proxy :: _ "crypto")
@@ -147,47 +150,47 @@ bwPasswordStringHash prelogin email password = do
147150 $ runFn3 crypto.hashPassword password key (nullify hashPurposeLocalAuthorization)
148151 liftPromise $ runFn3 crypto.hashPassword password key jnull
149152
150−hashPassword ::
151− forall r.
152− Password ->
153− Run
154− ( cryptoFunctions :: Reader CryptoFunctions
155− , aff :: Aff
156− , effect :: Effect
157− | r
158− )
159− Hash
153+hashPassword
154+ :: forall r
155+ . Password
156+ -> Run
157+ ( cryptoFunctions :: Reader CryptoFunctions
158+ , aff :: Aff
159+ , effect :: Effect
160+ | r
161+ )
162+ Hash
160163hashPassword (Password password) = do
161164 cryptoFunctions <- askAt (Proxy :: _ "cryptoFunctions")
162165 liftPromise $ runFn2 cryptoFunctions.hash password cryptoFunctionsTypeSha512
163166
164−decrypt ::
165− forall r.
166− EncryptedString ->
167− Run
168− ( key :: Reader SymmetricCryptoKey
169− , crypto :: Reader CryptoService
170− , aff :: Aff
171− , effect :: Effect
172− | r
173− )
174− String
167+decrypt
168+ :: forall r
169+ . EncryptedString
170+ -> Run
171+ ( key :: Reader SymmetricCryptoKey
172+ , crypto :: Reader CryptoService
173+ , aff :: Aff
174+ , effect :: Effect
175+ | r
176+ )
177+ String
175178decrypt input = do
176179 crypto <- askAt (Proxy :: _ "crypto")
177180 key <- askAt (Proxy :: _ "key")
178181 liftPromise $ runFn2 crypto.decryptToUtf8 (EncString.fromString input) key
179182
180−encrypt ::
181− forall r.
182− String ->
183− Run
184− ( key :: Reader SymmetricCryptoKey
185− , crypto :: Reader CryptoService
186− , aff :: Aff
187− , effect :: Effect
188− | r
189− )
190− EncryptedString
183+encrypt
184+ :: forall r
185+ . String
186+ -> Run
187+ ( key :: Reader SymmetricCryptoKey
188+ , crypto :: Reader CryptoService
189+ , aff :: Aff
190+ , effect :: Effect
191+ | r
192+ )
193+ EncryptedString
191194encrypt input = do
192195 crypto <- askAt (Proxy :: _ "crypto")
193196 key <- askAt (Proxy :: _ "key")
@@ -196,17 +199,17 @@ encrypt input = do
196199liftPromise :: forall m a. MonadAff m => Promise a -> m a
197200liftPromise = liftAff <<< Promise.toAff
198201
199−encodeCipher ::
200− forall r.
201− Bridge.FullCipher ->
202− Run
203− ( key :: Reader SymmetricCryptoKey
204− , crypto :: Reader CryptoService
205− , aff :: Aff
206− , effect :: Effect
207− | r
208− )
209− CipherResponse
202+encodeCipher
203+ :: forall r
204+ . Bridge.FullCipher
205+ -> Run
206+ ( key :: Reader SymmetricCryptoKey
207+ , crypto :: Reader CryptoService
208+ , aff :: Aff
209+ , effect :: Effect
210+ | r
211+ )
212+ CipherResponse
210213encodeCipher
211214 (Bridge.FullCipher { name, cipher, id, favorite, reprompt, collectionIds }) = do
212215 let
@@ -222,14 +225,14 @@ encodeCipher
222225 pure
223226 x
224227 { card =
225− nullify
226− { cardholderName
227− , brand
228− , number
229− , expMonth
230− , expYear
231− , code
232− }
228+ nullify
229+ { cardholderName
230+ , brand
231+ , number
232+ , expMonth
233+ , expYear
234+ , code
235+ }
233236 , type = cipherTypeCard
234237 }
235238 Bridge.IdentityCipher (Bridge.Cipher_IdentityCipher identity) -> do
@@ -254,26 +257,26 @@ encodeCipher
254257 pure
255258 x
256259 { identity =
257− nullify
258− { address1
259− , address2
260− , address3
261− , city
262− , company
263− , country
264− , email
265− , firstName
266− , lastName
267− , licenseNumber
268− , middleName
269− , passportNumber
270− , phone
271− , postalCode
272− , ssn
273− , state
274− , title
275− , username
276− }
260+ nullify
261+ { address1
262+ , address2
263+ , address3
264+ , city
265+ , company
266+ , country
267+ , email
268+ , firstName
269+ , lastName
270+ , licenseNumber
271+ , middleName
272+ , passportNumber
273+ , phone
274+ , postalCode
275+ , ssn
276+ , state
277+ , title
278+ , username
279+ }
277280 , type = cipherTypeIdentity
278281 }
279282 Bridge.LoginCipher (Bridge.Cipher_LoginCipher login) -> do
@@ -281,7 +284,7 @@ encodeCipher
281284 uris <-
282285 traverse
283286 ( \uri -> do
284− uriEnc <- encrypt uri
287+ uriEnc <- nullify <$> encrypt uri
285288 pure { uri: uriEnc, match: jnull }
286289 )
287290 (unwrap login.uris)
@@ -290,14 +293,14 @@ encodeCipher
290293 pure
291294 x
292295 { login =
293− nullify
294− { password
295− , uris: JOpt $ opt uris
296− , username
297− , passwordRevisionDate: jnull
298− , totp: totp
299− , autofillOnPageLoad: JOpt undefined
300− }
296+ nullify
297+ { password
298+ , uris: JOpt $ opt uris
299+ , username
300+ , passwordRevisionDate: jnull
301+ , totp: totp
302+ , autofillOnPageLoad: JOpt undefined
303+ }
301304 , type = cipherTypeLogin
302305 }
303306 Bridge.NoteCipher note -> do
@@ -332,98 +335,99 @@ encodeCipher
332335 , reprompt
333336 }
334337
335−decodeCipher ::
336− forall r.
337− CipherResponse ->
338− Run
339− ( key :: Reader SymmetricCryptoKey
340− , crypto :: Reader CryptoService
341− , aff :: Aff
342− , effect :: Effect
343− | r
344− )
345− Bridge.FullCipher
338+decodeCipher
339+ :: forall r
340+ . CipherResponse
341+ -> Run
342+ ( key :: Reader SymmetricCryptoKey
343+ , crypto :: Reader CryptoService
344+ , aff :: Aff
345+ , effect :: Effect
346+ | r
347+ )
348+ Bridge.FullCipher
346349decodeCipher cipher = do
347350 name <- decrypt cipher.name
348351 cipherType <- case cipher.type of
349352 n
350353 | cipherTypeSecureNote == n -> do
351− note <- fromJNullable "" <$> (traverse decrypt cipher.notes)
352− pure $ Bridge.NoteCipher note
354+ note <- fromJNullable "" <$> (traverse decrypt cipher.notes)
355+ pure $ Bridge.NoteCipher note
353356 n
354357 | cipherTypeLogin == n -> do
355− case JNullable.toMaybe cipher.login of
356− Nothing -> liftEffect $ throwError $ error "Login data is missing"
357− Just login -> do
358− username <- decryptNullable login.username
359− password <- decryptNullable login.password
360− totp <- decryptNullable login.totp
361− uris <- fromJOpt [] <$> ((traverse >>> traverse) (_.uri >>> decrypt) login.uris)
362− pure $ Bridge.LoginCipher
363− $ Bridge.Cipher_LoginCipher
364− { username
365− , password
366− , uris: wrap uris
367− , totp
368− }
358+ case JNullable.toMaybe cipher.login of
359+ Nothing -> liftEffect $ throwError $ error "Login data is missing"
360+ Just login -> do
361+ username <- decryptNullable login.username
362+ password <- decryptNullable login.password
363+ totp <- decryptNullable login.totp
364+ uris <- fromJOpt [] <$>
365+ ((traverse >>> traverse) (_.uri >>> JNullable.toMaybe >>> maybe (pure "") decrypt) login.uris)
366+ pure $ Bridge.LoginCipher
367+ $ Bridge.Cipher_LoginCipher
368+ { username
369+ , password
370+ , uris: wrap uris
371+ , totp
372+ }
369373 n
370374 | cipherTypeCard == n -> do
371− case JNullable.toMaybe cipher.card of
372− Nothing -> liftEffect $ throwError $ error "Card data is missing"
373− Just card -> do
374− cardholderName <- decryptNullable card.cardholderName
375− number <- decryptNullable card.number
376− code <- decryptNullable card.code
377− brand <- decryptNullable card.brand
378− expMonth <- decryptNullable card.expMonth
379− expYear <- decryptNullable card.expYear
380− pure $ Bridge.CardCipher
381− $ Bridge.Cipher_CardCipher
382− { brand, cardholderName, code, expMonth, expYear, number }
375+ case JNullable.toMaybe cipher.card of
376+ Nothing -> liftEffect $ throwError $ error "Card data is missing"
377+ Just card -> do
378+ cardholderName <- decryptNullable card.cardholderName
379+ number <- decryptNullable card.number
380+ code <- decryptNullable card.code
381+ brand <- decryptNullable card.brand
382+ expMonth <- decryptNullable card.expMonth
383+ expYear <- decryptNullable card.expYear
384+ pure $ Bridge.CardCipher
385+ $ Bridge.Cipher_CardCipher
386+ { brand, cardholderName, code, expMonth, expYear, number }
383387 n
384388 | cipherTypeIdentity == n -> do
385− case JNullable.toMaybe cipher.identity of
386− Nothing -> liftEffect $ throwError $ error "Identity data is missing"
387− Just identity -> do
388− firstName <- decryptNullable identity.firstName
389− middleName <- decryptNullable identity.middleName
390− lastName <- decryptNullable identity.lastName
391− address1 <- decryptNullable identity.address1
392− address2 <- decryptNullable identity.address2
393− address3 <- decryptNullable identity.address3
394− city <- decryptNullable identity.city
395− company <- decryptNullable identity.company
396− country <- decryptNullable identity.country
397− email <- decryptNullable identity.email
398− licenseNumber <- decryptNullable identity.licenseNumber
399− passportNumber <- decryptNullable identity.passportNumber
400− phone <- decryptNullable identity.phone
401− postalCode <- decryptNullable identity.postalCode
402− ssn <- decryptNullable identity.ssn
403− state <- decryptNullable identity.state
404− title <- decryptNullable identity.title
405− username <- decryptNullable identity.username
406− pure $ Bridge.IdentityCipher
407− $ wrap
408− { firstName
409− , middleName
410− , lastName
411− , address1
412− , address2
413− , address3
414− , city
415− , company
416− , country
417− , email
418− , licenseNumber
419− , passportNumber
420− , phone
421− , postalCode
422− , ssn
423− , state
424− , title
425− , username
426− }
389+ case JNullable.toMaybe cipher.identity of
390+ Nothing -> liftEffect $ throwError $ error "Identity data is missing"
391+ Just identity -> do
392+ firstName <- decryptNullable identity.firstName
393+ middleName <- decryptNullable identity.middleName
394+ lastName <- decryptNullable identity.lastName
395+ address1 <- decryptNullable identity.address1
396+ address2 <- decryptNullable identity.address2
397+ address3 <- decryptNullable identity.address3
398+ city <- decryptNullable identity.city
399+ company <- decryptNullable identity.company
400+ country <- decryptNullable identity.country
401+ email <- decryptNullable identity.email
402+ licenseNumber <- decryptNullable identity.licenseNumber
403+ passportNumber <- decryptNullable identity.passportNumber
404+ phone <- decryptNullable identity.phone
405+ postalCode <- decryptNullable identity.postalCode
406+ ssn <- decryptNullable identity.ssn
407+ state <- decryptNullable identity.state
408+ title <- decryptNullable identity.title
409+ username <- decryptNullable identity.username
410+ pure $ Bridge.IdentityCipher
411+ $ wrap
412+ { firstName
413+ , middleName
414+ , lastName
415+ , address1
416+ , address2
417+ , address3
418+ , city
419+ , company
420+ , country
421+ , email
422+ , licenseNumber
423+ , passportNumber
424+ , phone
425+ , postalCode
426+ , ssn
427+ , state
428+ , title
429+ , username
430+ }
427431 n -> liftEffect $ throwError $ error $ "Unsupported cipher type: " <> show n
428432 pure
429433 $ wrap
@@ -435,32 +439,32 @@ decodeCipher cipher = do
435439 , collectionIds: wrap <<< fromJNullable [] $ cipher.collectionIds
436440 }
437441
438−decryptNullable ::
439− forall x r.
440− Newtype x (Maybe String) =>
441− JNullable EncryptedString ->
442− Run
443− ( key :: Reader SymmetricCryptoKey
444− , crypto :: Reader CryptoService
445− , aff :: Aff
446− , effect :: Effect
447− | r
448− )
449− x
442+decryptNullable
443+ :: forall x r
444+ . Newtype x (Maybe String)
445+ => JNullable EncryptedString
446+ -> Run
447+ ( key :: Reader SymmetricCryptoKey
448+ , crypto :: Reader CryptoService
449+ , aff :: Aff
450+ , effect :: Effect
451+ | r
452+ )
453+ x
450454decryptNullable x = wrap <<< fromJNullable Nothing <<< map Just <$> (traverse decrypt x)
451455
452−encryptNullable ::
453− forall x r.
454− Newtype x (Maybe String) =>
455− x ->
456− Run
457− ( key :: Reader SymmetricCryptoKey
458− , crypto :: Reader CryptoService
459− , aff :: Aff
460− , effect :: Effect
461− | r
462− )
463− (JNullable EncryptedString)
456+encryptNullable
457+ :: forall x r
458+ . Newtype x (Maybe String)
459+ => x
460+ -> Run
461+ ( key :: Reader SymmetricCryptoKey
462+ , crypto :: Reader CryptoService
463+ , aff :: Aff
464+ , effect :: Effect
465+ | r
466+ )
467+ (JNullable EncryptedString)
464468encryptNullable x = case unwrap x of
465469 Nothing -> pure jnull
466470 Just y -> nullify <$> encrypt y
backend/BW/Types.purs+367−390
@@ -21,8 +21,7 @@ import Untagged.TypeCheck (class HasRuntimeType)
2121import Untagged.Union (type (|+|))
2222import Untagged.Union as Union
2323
24−newtype EncryptedString
25− = EncryptedString String
24+newtype EncryptedString = EncryptedString String
2625
2726derive newtype instance Show EncryptedString
2827derive newtype instance Ord EncryptedString
@@ -32,77 +31,76 @@ derive newtype instance DecodeJson EncryptedString
3231
3332kdfPBKDF2_SHA256 = 0 :: KDF
3433
35−type KDF
36− = Int
37−
38−type PreloginResponse
39− = { kdf :: KDF
40− , kdfIterations :: Int
41− }
42−
43−type PreloginRequest
44− = { email :: Email
45− }
46−
47−type ProfileResponse
48− = { id :: String
49− , name :: JNullable String
50− , email :: String
51− , emailVerified :: Boolean
52− , masterPasswordHint :: JNullable String
53− , premiumPersonally :: Boolean
54− -- , premiumFromOrganization :: Boolean
55− , culture :: JNullable String
56− , twoFactorEnabled :: Boolean
57− , key :: EncryptedString
58− , privateKey :: EncryptedString
59− , securityStamp :: JNullable String
60− , forcePasswordReset :: Boolean
61− , usesKeyConnector :: Boolean
62− , organizations :: Array ProfileOrganizationResponse
63− , providers :: Array ProfileProviderResponse
64− , providerOrganizations :: Array ProfileProviderOrganizationResponse
65− }
66−
67−type ProfileOrganizationResponse
68− = { id :: String
69− , name :: JNullable String
70− , usePolicies :: JNullable Boolean
71− , useGroups :: JNullable Boolean
72− , useDirectory :: JNullable Boolean
73− , useEvents :: JNullable Boolean
74− , useTotp :: JNullable Boolean
75− , use2fa :: JNullable Boolean
76− , useApi :: JNullable Boolean
77− , useSso :: JNullable Boolean
78− , useKeyConnector :: JNullable Boolean
79− , useResetPassword :: JNullable Boolean
80− , selfHost :: JNullable Boolean
81− , usersGetPremium :: JNullable Boolean
82− , seats :: JNullable Int
83− , maxCollections :: JNullable Int
84− , maxStorageGb :: JNullable Int
85− , key :: JNullable String
86− , hasPublicAndPrivateKeys :: JNullable Boolean
87− , status :: JNullable OrganizationUserStatusType
88− , type :: JNullable OrganizationUserType
89− , enabled :: JNullable Boolean
90− , ssoBound :: JNullable Boolean
91− , identifier :: JNullable String
92− , permissions :: JNullable PermissionsApi
93− , resetPasswordEnrolled :: JNullable Boolean
94− , userId :: JNullable String
95− , providerId :: JNullable String
96− , providerName :: JNullable String
97− , familySponsorshipFriendlyName :: JNullable String
98− , familySponsorshipAvailable :: JNullable Boolean
99− , planProductType :: JNullable ProductType
100− , keyConnectorEnabled :: JNullable Boolean
101− , keyConnectorUrl :: JNullable String
102− , familySponsorshipLastSyncDate :: JNullable Timestamp
103− , familySponsorshipValidUntil :: JNullable Timestamp
104− , familySponsorshipToDelete :: JNullable Boolean
105− }
34+type KDF = Int
35+
36+type PreloginResponse =
37+ { kdf :: KDF
38+ , kdfIterations :: Int
39+ }
40+
41+type PreloginRequest =
42+ { email :: Email
43+ }
44+
45+type ProfileResponse =
46+ { id :: String
47+ , name :: JNullable String
48+ , email :: String
49+ , emailVerified :: Boolean
50+ , masterPasswordHint :: JNullable String
51+ , premiumPersonally :: Boolean
52+ -- , premiumFromOrganization :: Boolean
53+ , culture :: JNullable String
54+ , twoFactorEnabled :: Boolean
55+ , key :: EncryptedString
56+ , privateKey :: EncryptedString
57+ , securityStamp :: JNullable String
58+ , forcePasswordReset :: Boolean
59+ , usesKeyConnector :: Boolean
60+ , organizations :: Array ProfileOrganizationResponse
61+ , providers :: Array ProfileProviderResponse
62+ , providerOrganizations :: Array ProfileProviderOrganizationResponse
63+ }
64+
65+type ProfileOrganizationResponse =
66+ { id :: String
67+ , name :: JNullable String
68+ , usePolicies :: JNullable Boolean
69+ , useGroups :: JNullable Boolean
70+ , useDirectory :: JNullable Boolean
71+ , useEvents :: JNullable Boolean
72+ , useTotp :: JNullable Boolean
73+ , use2fa :: JNullable Boolean
74+ , useApi :: JNullable Boolean
75+ , useSso :: JNullable Boolean
76+ , useKeyConnector :: JNullable Boolean
77+ , useResetPassword :: JNullable Boolean
78+ , selfHost :: JNullable Boolean
79+ , usersGetPremium :: JNullable Boolean
80+ , seats :: JNullable Int
81+ , maxCollections :: JNullable Int
82+ , maxStorageGb :: JNullable Int
83+ , key :: JNullable String
84+ , hasPublicAndPrivateKeys :: JNullable Boolean
85+ , status :: JNullable OrganizationUserStatusType
86+ , type :: JNullable OrganizationUserType
87+ , enabled :: JNullable Boolean
88+ , ssoBound :: JNullable Boolean
89+ , identifier :: JNullable String
90+ , permissions :: JNullable PermissionsApi
91+ , resetPasswordEnrolled :: JNullable Boolean
92+ , userId :: JNullable String
93+ , providerId :: JNullable String
94+ , providerName :: JNullable String
95+ , familySponsorshipFriendlyName :: JNullable String
96+ , familySponsorshipAvailable :: JNullable Boolean
97+ , planProductType :: JNullable ProductType
98+ , keyConnectorEnabled :: JNullable Boolean
99+ , keyConnectorUrl :: JNullable String
100+ , familySponsorshipLastSyncDate :: JNullable Timestamp
101+ , familySponsorshipValidUntil :: JNullable Timestamp
102+ , familySponsorshipToDelete :: JNullable Boolean
103+ }
106104
107105organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
108106
@@ -110,8 +108,7 @@ organizationUserStatusTypeAccepted = 0 :: OrganizationUserStatusType
110108
111109organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
112110
113−type OrganizationUserStatusType
114− = Int
111+type OrganizationUserStatusType = Int
115112
116113organizationUserTypeOwner = 0 :: OrganizationUserType
117114
@@ -123,27 +120,26 @@ organizationUserTypeManager = 3 :: OrganizationUserType
123120
124121organizationUserTypeCustom = 4 :: OrganizationUserType
125122
126−type OrganizationUserType
127− = Int
128−
129−type PermissionsApi
130− = { accessEventLogs :: Boolean
131− , accessImportExport :: Boolean
132− , accessReports :: Boolean
133− , manageAllCollections :: Boolean
134− , createNewCollections :: Boolean
135− , editAnyCollection :: Boolean
136− , deleteAnyCollection :: Boolean
137− , manageAssignedCollections :: Boolean
138− , editAssignedCollections :: Boolean
139− , deleteAssignedCollections :: Boolean
140− , manageCiphers :: Boolean
141− , manageGroups :: Boolean
142− , manageSso :: Boolean
143− , managePolicies :: Boolean
144− , manageUsers :: Boolean
145− , manageResetPassword :: Boolean
146− }
123+type OrganizationUserType = Int
124+
125+type PermissionsApi =
126+ { accessEventLogs :: Boolean
127+ , accessImportExport :: Boolean
128+ , accessReports :: Boolean
129+ , manageAllCollections :: Boolean
130+ , createNewCollections :: Boolean
131+ , editAnyCollection :: Boolean
132+ , deleteAnyCollection :: Boolean
133+ , manageAssignedCollections :: Boolean
134+ , editAssignedCollections :: Boolean
135+ , deleteAssignedCollections :: Boolean
136+ , manageCiphers :: Boolean
137+ , manageGroups :: Boolean
138+ , manageSso :: Boolean
139+ , managePolicies :: Boolean
140+ , manageUsers :: Boolean
141+ , manageResetPassword :: Boolean
142+ }
147143
148144productTypeFree = 0 :: ProductType
149145
@@ -153,20 +149,19 @@ productTypeTeams = 2 :: ProductType
153149
154150productTypeEnterprise = 3 :: ProductType
155151
156−type ProductType
157− = Int
158−
159−type ProfileProviderResponse
160− = { id :: String
161− , name :: JNullable String
162− , key :: JNullable String
163− , status :: JNullable ProviderUserStatusType
164− , type :: JNullable ProviderUserType
165− , enabled :: Boolean
166− , permissions :: PermissionsApi
167− , userId :: JNullable String
168− , useEvents :: Boolean
169− }
152+type ProductType = Int
153+
154+type ProfileProviderResponse =
155+ { id :: String
156+ , name :: JNullable String
157+ , key :: JNullable String
158+ , status :: JNullable ProviderUserStatusType
159+ , type :: JNullable ProviderUserType
160+ , enabled :: Boolean
161+ , permissions :: PermissionsApi
162+ , userId :: JNullable String
163+ , useEvents :: Boolean
164+ }
170165
171166providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
172167
@@ -174,81 +169,79 @@ providerUserStatusTypeAccepted = 1 :: ProviderUserStatusType
174169
175170providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
176171
177−type ProviderUserStatusType
178− = Int
172+type ProviderUserStatusType = Int
179173
180174providerUserTypeProviderAdmin = 0 :: ProviderUserType
181175
182176providerUserTypeServiceUser = 1 :: ProviderUserType
183177
184−type ProviderUserType
185− = Int
186−
187−type ProfileProviderOrganizationResponse
188− = { id :: String
189− , name :: JNullable String
190− , usePolicies :: Boolean
191− , useGroups :: Boolean
192− , useDirectory :: Boolean
193− , useEvents :: Boolean
194− , useTotp :: Boolean
195− , use2fa :: Boolean
196− , useApi :: Boolean
197− , useSso :: Boolean
198− , useKeyConnector :: Boolean
199− , useResetPassword :: Boolean
200− , selfHost :: Boolean
201− , usersGetPremium :: Boolean
202− , seats :: Int
203− , maxCollections :: Int
204− , maxStorageGb :: JNullable Int
205− , key :: JNullable String
206− , hasPublicAndPrivateKeys :: Boolean
207− , status :: OrganizationUserStatusType
208− , type :: OrganizationUserType
209− , enabled :: Boolean
210− , ssoBound :: Boolean
211− , identifier :: JNullable String
212− , permissions :: PermissionsApi
213− , resetPasswordEnrolled :: Boolean
214− , userId :: JNullable String
215− , providerId :: JNullable String
216− , providerName :: JNullable String
217− , familySponsorshipFriendlyName :: JNullable String
218− , familySponsorshipAvailable :: Boolean
219− , planProductType :: ProductType
220− , keyConnectorEnabled :: Boolean
221− , keyConnectorUrl :: JNullable String
222− , familySponsorshipLastSyncDate :: JNullable Timestamp
223− , familySponsorshipValidUntil :: JNullable Timestamp
224− , familySponsorshipToDelete :: JNullable Boolean
225− }
226−
227−type Urls
228− = { base :: JNullable String
229− , webVault :: JNullable String
230− , api :: JNullable String
231− , identity :: JNullable String
232− , icons :: JNullable String
233− , notifications :: JNullable String
234− , events :: JNullable String
235− , keyConnector :: JNullable String
236− }
237−
238−type PasswordTokenRequest
239− = { email :: Email
240− , masterPasswordHash :: String
241− , captchaResponse :: String
242− , twoFactor :: TokenRequestTwoFactor
243− , device :: DeviceRequest
244− }
245−
246−type DeviceRequest
247− = { type :: DeviceType
248− , name :: String
249− , identifier :: String
250− , pushToken :: JNullable String
251− }
178+type ProviderUserType = Int
179+
180+type ProfileProviderOrganizationResponse =
181+ { id :: String
182+ , name :: JNullable String
183+ , usePolicies :: Boolean
184+ , useGroups :: Boolean
185+ , useDirectory :: Boolean
186+ , useEvents :: Boolean
187+ , useTotp :: Boolean
188+ , use2fa :: Boolean
189+ , useApi :: Boolean
190+ , useSso :: Boolean
191+ , useKeyConnector :: Boolean
192+ , useResetPassword :: Boolean
193+ , selfHost :: Boolean
194+ , usersGetPremium :: Boolean
195+ , seats :: Int
196+ , maxCollections :: Int
197+ , maxStorageGb :: JNullable Int
198+ , key :: JNullable String
199+ , hasPublicAndPrivateKeys :: Boolean
200+ , status :: OrganizationUserStatusType
201+ , type :: OrganizationUserType
202+ , enabled :: Boolean
203+ , ssoBound :: Boolean
204+ , identifier :: JNullable String
205+ , permissions :: PermissionsApi
206+ , resetPasswordEnrolled :: Boolean
207+ , userId :: JNullable String
208+ , providerId :: JNullable String
209+ , providerName :: JNullable String
210+ , familySponsorshipFriendlyName :: JNullable String
211+ , familySponsorshipAvailable :: Boolean
212+ , planProductType :: ProductType
213+ , keyConnectorEnabled :: Boolean
214+ , keyConnectorUrl :: JNullable String
215+ , familySponsorshipLastSyncDate :: JNullable Timestamp
216+ , familySponsorshipValidUntil :: JNullable Timestamp
217+ , familySponsorshipToDelete :: JNullable Boolean
218+ }
219+
220+type Urls =
221+ { base :: JNullable String
222+ , webVault :: JNullable String
223+ , api :: JNullable String
224+ , identity :: JNullable String
225+ , icons :: JNullable String
226+ , notifications :: JNullable String
227+ , events :: JNullable String
228+ , keyConnector :: JNullable String
229+ }
230+
231+type PasswordTokenRequest =
232+ { email :: Email
233+ , masterPasswordHash :: String
234+ , captchaResponse :: String
235+ , twoFactor :: TokenRequestTwoFactor
236+ , device :: DeviceRequest
237+ }
238+
239+type DeviceRequest =
240+ { type :: DeviceType
241+ , name :: String
242+ , identifier :: String
243+ , pushToken :: JNullable String
244+ }
252245
253246deviceTypeAndroid = 0 :: DeviceType
254247
@@ -292,14 +285,13 @@ deviceTypeVivaldiExtension = 19 :: DeviceType
292285
293286deviceTypeSafariExtension = 20 :: DeviceType
294287
295−type DeviceType
296− = Int
288+type DeviceType = Int
297289
298−type TokenRequestTwoFactor
299− = { provider :: TwoFactorProviderType
300− , token :: String
301− , remember :: Boolean
302− }
290+type TokenRequestTwoFactor =
291+ { provider :: TwoFactorProviderType
292+ , token :: String
293+ , remember :: Boolean
294+ }
303295
304296twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
305297
@@ -317,12 +309,11 @@ twoFactorProviderTypeOrganizationDuo = 6 :: TwoFactorProviderType
317309
318310twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
319311
320−type TwoFactorProviderType
321− = Int
312+type TwoFactorProviderType = Int
322313
323−secondFactorTypeToBridge ::
324− TwoFactorProviderType ->
325− Maybe Bridge.TwoFactorProviderType
314+secondFactorTypeToBridge
315+ :: TwoFactorProviderType
316+ -> Maybe Bridge.TwoFactorProviderType
326317secondFactorTypeToBridge x = case x of
327318 n
328319 | n == twoFactorProviderTypeAuthenticator -> Just Bridge.Authenticator
@@ -352,21 +343,17 @@ bridgeToSecondFactorType Bridge.Remember = twoFactorProviderTypeRemember
352343bridgeToSecondFactorType Bridge.OrganizationDuo = twoFactorProviderTypeOrganizationDuo
353344bridgeToSecondFactorType Bridge.WebAuthn = twoFactorProviderTypeWebAuthn
354345
355−newtype Password
356− = Password String
346+newtype Password = Password String
357347
358348hashPurposeServerAuthorization = 1 :: HashPurpose
359349
360350hashPurposeLocalAuthorization = 2 :: HashPurpose
361351
362−type HashPurpose
363− = Int
352+type HashPurpose = Int
364353
365−newtype StringHash
366− = StringHash String
354+newtype StringHash = StringHash String
367355
368−newtype AccessToken
369− = AccessToken String
356+newtype AccessToken = AccessToken String
370357
371358derive newtype instance Show AccessToken
372359derive newtype instance Eq AccessToken
@@ -374,8 +361,7 @@ derive newtype instance Ord AccessToken
374361derive newtype instance EncodeJson AccessToken
375362derive newtype instance DecodeJson AccessToken
376363
377−newtype RefreshToken
378− = RefreshToken String
364+newtype RefreshToken = RefreshToken String
379365
380366derive newtype instance Show RefreshToken
381367derive newtype instance Eq RefreshToken
@@ -387,21 +373,21 @@ type IdentityCaptchaResponse =
387373 { siteKey :: String
388374 }
389375
390−type IdentityTokenResponse
391− = { accessToken :: AccessToken
392− , expiresIn :: Int
393− , refreshToken :: RefreshToken
394− , tokenType :: String
395− , resetMasterPassword :: Boolean
396− , privateKey :: EncryptedString
397− , key :: EncryptedString
398− , twoFactorToken :: JNullable String
399− , kdf :: KDF
400− , kdfIterations :: Int
401− , forcePasswordReset :: JNullable Boolean
402− , apiUseKeyConnector :: JNullable Boolean
403− , keyConnectorUrl :: JNullable String
404− }
376+type IdentityTokenResponse =
377+ { accessToken :: AccessToken
378+ , expiresIn :: Int
379+ , refreshToken :: RefreshToken
380+ , tokenType :: String
381+ , resetMasterPassword :: Boolean
382+ , privateKey :: EncryptedString
383+ , key :: EncryptedString
384+ , twoFactorToken :: JNullable String
385+ , kdf :: KDF
386+ , kdfIterations :: Int
387+ , forcePasswordReset :: JNullable Boolean
388+ , apiUseKeyConnector :: JNullable Boolean
389+ , keyConnectorUrl :: JNullable String
390+ }
405391
406392newtype TwoFactorProviderTypes = TwoFactorProviderTypes (Array (Int |+| String))
407393
@@ -421,59 +407,57 @@ type IdentityTwoFactorResponse =
421407 , captchaToken :: String |+| Undefined
422408 }
423409
424−newtype Email
425− = Email String
426−
427−type SyncResponse
428− = { profile :: ProfileResponse
429− , folders :: Array FolderResponse
430− , collections :: Array CollectionDetailsResponse
431− , ciphers :: Array CipherResponse
432− , domains :: JNullable DomainsResponse
433− , policies :: JNullable (Array PolicyResponse)
434− , sends :: Array SendResponse
435− }
410+newtype Email = Email String
436411
437−type FolderResponse
438− = { id :: String
439− , name :: JNullable String
440− , revisionDate :: JNullable String
441− }
412+type SyncResponse =
413+ { profile :: ProfileResponse
414+ , folders :: Array FolderResponse
415+ , collections :: Array CollectionDetailsResponse
416+ , ciphers :: Array CipherResponse
417+ , domains :: JNullable DomainsResponse
418+ , policies :: JNullable (Array PolicyResponse)
419+ , sends :: Array SendResponse
420+ }
442421
443−type CollectionDetailsResponse
444− = { id :: String
445− , organizationId :: JNullable String
446− , name :: JNullable String
447− , externalId :: JNullable String
448− , readOnly :: Boolean
449− }
422+type FolderResponse =
423+ { id :: String
424+ , name :: JNullable String
425+ , revisionDate :: JNullable String
426+ }
450427
428+type CollectionDetailsResponse =
429+ { id :: String
430+ , organizationId :: JNullable String
431+ , name :: JNullable String
432+ , externalId :: JNullable String
433+ , readOnly :: Boolean
434+ }
451435
452436type CipherId = String
453437
454−type CipherResponse
455− = { id :: CipherId
456− , organizationId :: JNullable String
457− , folderId :: JNullable String
458− , type :: CipherType
459− , name :: EncryptedString
460− , notes :: JNullable EncryptedString
461− , fields :: JNullable (Array FieldApi)
462− , login :: JNullable LoginApi
463− , card :: JNullable CardApi
464− , identity :: JNullable IdentityApi
465− , secureNote :: JNullable SecureNoteApi
466− , favorite :: Boolean
467− , edit :: JNullable Boolean
468− , viewPassword :: JNullable Boolean
469− , organizationUseTotp :: JNullable Boolean
470− , revisionDate :: JNullable Timestamp
471− , attachments :: JNullable (Array AttachmentResponse)
472− , passwordHistory :: JNullable (Array PasswordHistoryResponse)
473− , collectionIds :: JNullable (Array String)
474− , deletedDate :: JNullable String
475− , reprompt :: CipherRepromptType
476− }
438+type CipherResponse =
439+ { id :: CipherId
440+ , organizationId :: JNullable String
441+ , folderId :: JNullable String
442+ , type :: CipherType
443+ , name :: EncryptedString
444+ , notes :: JNullable EncryptedString
445+ , fields :: JNullable (Array FieldApi)
446+ , login :: JNullable LoginApi
447+ , card :: JNullable CardApi
448+ , identity :: JNullable IdentityApi
449+ , secureNote :: JNullable SecureNoteApi
450+ , favorite :: Boolean
451+ , edit :: JNullable Boolean
452+ , viewPassword :: JNullable Boolean
453+ , organizationUseTotp :: JNullable Boolean
454+ , revisionDate :: JNullable Timestamp
455+ , attachments :: JNullable (Array AttachmentResponse)
456+ , passwordHistory :: JNullable (Array PasswordHistoryResponse)
457+ , collectionIds :: JNullable (Array String)
458+ , deletedDate :: JNullable String
459+ , reprompt :: CipherRepromptType
460+ }
477461
478462cipherTypeLogin = 1 :: CipherType
479463
@@ -483,15 +467,14 @@ cipherTypeCard = 3 :: CipherType
483467
484468cipherTypeIdentity = 4 :: CipherType
485469
486−type CipherType
487− = Int
470+type CipherType = Int
488471
489−type FieldApi
490− = { name :: JNullable String
491− , value :: JNullable String
492− , type :: FieldType
493− , linkedId :: JNullable LinkedIdType
494− }
472+type FieldApi =
473+ { name :: JNullable String
474+ , value :: JNullable String
475+ , type :: FieldType
476+ , linkedId :: JNullable LinkedIdType
477+ }
495478
496479fieldTypeText = 0 :: FieldType
497480
@@ -501,8 +484,7 @@ fieldTypeBoolean = 2 :: FieldType
501484
502485fieldTypeLinked = 3 :: FieldType
503486
504−type FieldType
505− = Int
487+type FieldType = Int
506488
507489linkedIdTypeLoginLinkedIdUsername = 100 :: LinkedIdType
508490
@@ -558,23 +540,22 @@ linkedIdTypeIdentityLinkedIdLastName = 417 :: LinkedIdType
558540
559541linkedIdTypeIdentityLinkedIdFullName = 418 :: LinkedIdType
560542
561−type LinkedIdType
562− = Int
543+type LinkedIdType = Int
563544
564−type LoginApi
565− = { uris :: JOpt (Array LoginUriApi)
566− , username :: JNullable EncryptedString
567− , password :: JNullable EncryptedString
568− , passwordRevisionDate :: JNullable String
569− , totp :: JNullable EncryptedString
570− -- This thing is undefined in some cases for some reson. Just ignoring it
571− , autofillOnPageLoad :: JOpt (JNullable Boolean)
572− }
545+type LoginApi =
546+ { uris :: JOpt (Array LoginUriApi)
547+ , username :: JNullable EncryptedString
548+ , password :: JNullable EncryptedString
549+ , passwordRevisionDate :: JNullable String
550+ , totp :: JNullable EncryptedString
551+ -- This thing is undefined in some cases for some reson. Just ignoring it
552+ , autofillOnPageLoad :: JOpt (JNullable Boolean)
553+ }
573554
574−type LoginUriApi
575− = { uri :: EncryptedString
576− , match :: JNullable UriMatchType
577− }
555+type LoginUriApi =
556+ { uri :: JNullable EncryptedString
557+ , match :: JNullable UriMatchType
558+ }
578559
579560uriMatchTypeDomain = 0 :: UriMatchType
580561
@@ -588,87 +569,85 @@ uriMatchTypeRegularExpression = 4 :: UriMatchType
588569
589570uriMatchTypeNever = 5 :: UriMatchType
590571
591−type UriMatchType
592− = Int
593−
594−type CardApi
595− = { cardholderName :: JNullable EncryptedString
596− , brand :: JNullable EncryptedString
597− , number :: JNullable EncryptedString
598− , expMonth :: JNullable EncryptedString
599− , expYear :: JNullable EncryptedString
600− , code :: JNullable EncryptedString
601− }
602−
603−type IdentityApi
604− = { title :: JNullable EncryptedString
605− , firstName :: JNullable EncryptedString
606− , middleName :: JNullable EncryptedString
607− , lastName :: JNullable EncryptedString
608− , address1 :: JNullable EncryptedString
609− , address2 :: JNullable EncryptedString
610− , address3 :: JNullable EncryptedString
611− , city :: JNullable EncryptedString
612− , state :: JNullable EncryptedString
613− , postalCode :: JNullable EncryptedString
614− , country :: JNullable EncryptedString
615− , company :: JNullable EncryptedString
616− , email :: JNullable EncryptedString
617− , phone :: JNullable EncryptedString
618− , ssn :: JNullable EncryptedString
619− , username :: JNullable EncryptedString
620− , passportNumber :: JNullable EncryptedString
621− , licenseNumber :: JNullable EncryptedString
622− }
572+type UriMatchType = Int
573+
574+type CardApi =
575+ { cardholderName :: JNullable EncryptedString
576+ , brand :: JNullable EncryptedString
577+ , number :: JNullable EncryptedString
578+ , expMonth :: JNullable EncryptedString
579+ , expYear :: JNullable EncryptedString
580+ , code :: JNullable EncryptedString
581+ }
582+
583+type IdentityApi =
584+ { title :: JNullable EncryptedString
585+ , firstName :: JNullable EncryptedString
586+ , middleName :: JNullable EncryptedString
587+ , lastName :: JNullable EncryptedString
588+ , address1 :: JNullable EncryptedString
589+ , address2 :: JNullable EncryptedString
590+ , address3 :: JNullable EncryptedString
591+ , city :: JNullable EncryptedString
592+ , state :: JNullable EncryptedString
593+ , postalCode :: JNullable EncryptedString
594+ , country :: JNullable EncryptedString
595+ , company :: JNullable EncryptedString
596+ , email :: JNullable EncryptedString
597+ , phone :: JNullable EncryptedString
598+ , ssn :: JNullable EncryptedString
599+ , username :: JNullable EncryptedString
600+ , passportNumber :: JNullable EncryptedString
601+ , licenseNumber :: JNullable EncryptedString
602+ }
623603
624604secureNoteTypeGeneric = 0 :: SecureNoteType
625605
626−type SecureNoteType
627− = Int
606+type SecureNoteType = Int
628607
629−type SecureNoteApi = {
608+type SecureNoteApi =
609+ {
630610 -- type :: SecureNoteType
631−}
632−
633−type AttachmentResponse
634− = { id :: String
635− , url :: JNullable String
636− , fileName :: JNullable String
637− , key :: JNullable String
638− , size :: JNullable String
639− , sizeName :: JNullable String
640− }
641−
642−type PasswordHistoryResponse
643− = { password :: String
644− , lastUsedDate :: JNullable String
645− }
611+ }
612+
613+type AttachmentResponse =
614+ { id :: String
615+ , url :: JNullable String
616+ , fileName :: JNullable String
617+ , key :: JNullable String
618+ , size :: JNullable String
619+ , sizeName :: JNullable String
620+ }
621+
622+type PasswordHistoryResponse =
623+ { password :: String
624+ , lastUsedDate :: JNullable String
625+ }
646626
647627cipherRepromptTypeNone = 0 :: CipherRepromptType
648628
649629cipherRepromptTypePassword = 1 :: CipherRepromptType
650630
651−type CipherRepromptType
652− = Int
631+type CipherRepromptType = Int
653632
654−type DomainsResponse
655− = { equivalentDomains :: Array (Array String)
656− , globalEquivalentDomains :: Array GlobalDomainResponse
657− }
633+type DomainsResponse =
634+ { equivalentDomains :: Array (Array String)
635+ , globalEquivalentDomains :: Array GlobalDomainResponse
636+ }
658637
659−type GlobalDomainResponse
660− = { type :: Int
661− , domains :: Array String
662− , excluded :: Boolean
663− }
638+type GlobalDomainResponse =
639+ { type :: Int
640+ , domains :: Array String
641+ , excluded :: Boolean
642+ }
664643
665−type PolicyResponse
666− = { id :: String
667− , organizationId :: JNullable String
668− , type :: PolicyType
669− , data :: ShowableJson
670− , enabled :: Boolean
671− }
644+type PolicyResponse =
645+ { id :: String
646+ , organizationId :: JNullable String
647+ , type :: PolicyType
648+ , data :: ShowableJson
649+ , enabled :: Boolean
650+ }
672651
673652policyTypeTwoFactorAuthentication = 0 :: PolicyType -- Requires users to have 2fa enabled
674653
@@ -692,46 +671,44 @@ policyTypeMaximumVaultTimeout = 9 :: PolicyType -- Sets the maximum allowed vaul
692671
693672policyTypeDisablePersonalVaultExport = 10 :: PolicyType -- Disable personal vault export
694673
695−type PolicyType
696− = Int
697−
698−type SendResponse
699− = { id :: String
700− , accessId :: JNullable String
701− , type :: SendType
702− , name :: JNullable String
703− , notes :: JNullable String
704− , file :: JNullable SendFileApi
705− , text :: JNullable SendTextApi
706− , key :: JNullable String
707− , maxAccessCount :: JNullable Int
708− , accessCount :: JNullable Int
709− , revisionDate :: JNullable String
710− , expirationDate :: JNullable String
711− , deletionDate :: JNullable String
712− , password :: JNullable String
713− , disable :: Boolean
714− , hideEmail :: Boolean
715− }
674+type PolicyType = Int
675+
676+type SendResponse =
677+ { id :: String
678+ , accessId :: JNullable String
679+ , type :: SendType
680+ , name :: JNullable String
681+ , notes :: JNullable String
682+ , file :: JNullable SendFileApi
683+ , text :: JNullable SendTextApi
684+ , key :: JNullable String
685+ , maxAccessCount :: JNullable Int
686+ , accessCount :: JNullable Int
687+ , revisionDate :: JNullable String
688+ , expirationDate :: JNullable String
689+ , deletionDate :: JNullable String
690+ , password :: JNullable String
691+ , disable :: Boolean
692+ , hideEmail :: Boolean
693+ }
716694
717695sendTypeText = 0 :: SendType
718696
719697sendTypeFile = 1 :: SendType
720698
721−type SendType
722− = Int
699+type SendType = Int
723700
724−type SendFileApi
725− = { id :: String
726− , fileName :: JNullable String
727− , size :: JNullable String
728− , sizeName :: JNullable String
729− }
701+type SendFileApi =
702+ { id :: String
703+ , fileName :: JNullable String
704+ , size :: JNullable String
705+ , sizeName :: JNullable String
706+ }
730707
731−type SendTextApi
732− = { text :: JNullable String
733− , hidden :: Boolean
734− }
708+type SendTextApi =
709+ { text :: JNullable String
710+ , hidden :: Boolean
711+ }
735712
736713type TwoFactorEmailRequest =
737714 { email :: Email