@@ -2,27 +2,14 @@ module BW.Types where
22
33import Prelude
44
5−import Bridge as Bridge
65import Data.Argonaut (class DecodeJson, class EncodeJson)
7−import Data.Either (Either)
8−import Data.Either as Either
9−import Data.Int as Int
106import Data.JNullable (JNullable)
117import Data.JOpt (JOpt)
12−import Data.Maybe (Maybe(..))
13−import Data.Nullable (Nullable)
148import Data.ShowableJson (ShowableJson)
159import Data.Timestamp (Timestamp)
16−import Data.Traversable (for)
17−import Data.Tuple.Nested ((/\))
18−import Foreign as Foreign
19−import Literals.Undefined (Undefined)
20−import Type.Prelude (Proxy(..))
21−import Untagged.TypeCheck (class HasRuntimeType)
22−import Untagged.Union (type (|+|))
23−import Untagged.Union as Union
2410
25−newtype EncryptedString = EncryptedString String
11+newtype EncryptedString
12+ = EncryptedString String
2613
2714derive newtype instance Show EncryptedString
2815derive newtype instance Ord EncryptedString
@@ -31,86 +18,78 @@ derive newtype instance EncodeJson EncryptedString
3118derive newtype instance DecodeJson EncryptedString
3219
3320kdfPBKDF2_SHA256 = 0 :: KDF
34−kdfArgon2id = 1 :: KDF
3521
36−type KDF = Int
37−
38−type PreloginResponse =
39− { kdf :: KDF
40− , kdfIterations :: Int
41− , kdfMemory :: JNullable Int
42− , kdfParallelism :: JNullable Int
43− }
44−
45−type KdfConfig =
46− { iterations :: Int
47− , memory :: JNullable Int
48− , parallelism :: JNullable Int
49− }
50−
51−type PreloginRequest =
52− { email :: Email
53− }
54−
55−type ProfileResponse =
56− { id :: String
57− , name :: JNullable String
58− , email :: String
59− , emailVerified :: Boolean
60− , masterPasswordHint :: JNullable String
61− -- , premiumPersonally :: Boolean
62− -- , premiumFromOrganization :: Boolean
63− , culture :: JNullable String
64− , twoFactorEnabled :: Boolean
65− , key :: EncryptedString
66− , privateKey :: EncryptedString
67− , securityStamp :: JNullable String
68− , forcePasswordReset :: Boolean
69− , usesKeyConnector :: Boolean
70− -- , organizations :: Array ProfileOrganizationResponse
71− , providers :: Array ProfileProviderResponse
72− , providerOrganizations :: Array ProfileProviderOrganizationResponse
73− }
74−
75−type ProfileOrganizationResponse =
76− { id :: String
77− , name :: JNullable String
78− , usePolicies :: JNullable Boolean
79− , useGroups :: JNullable Boolean
80− , useDirectory :: JNullable Boolean
81− , useEvents :: JNullable Boolean
82− , useTotp :: JNullable Boolean
83− , use2fa :: JNullable Boolean
84− , useApi :: JNullable Boolean
85− , useSso :: JNullable Boolean
86− , useKeyConnector :: JNullable Boolean
87− , useResetPassword :: JNullable Boolean
88− , selfHost :: JNullable Boolean
89− , usersGetPremium :: JNullable Boolean
90− , seats :: JNullable Int
91− , maxCollections :: JNullable Int
92− , maxStorageGb :: JNullable Int
93− , key :: JNullable String
94− , hasPublicAndPrivateKeys :: JNullable Boolean
95− , status :: JNullable OrganizationUserStatusType
96− , type :: JNullable OrganizationUserType
97− , enabled :: JNullable Boolean
98− , ssoBound :: JNullable Boolean
99− , identifier :: JNullable String
100− , permissions :: JNullable PermissionsApi
101− , resetPasswordEnrolled :: JNullable Boolean
102− , userId :: JNullable String
103− , providerId :: JNullable String
104− , providerName :: JNullable String
105− , familySponsorshipFriendlyName :: JNullable String
106− , familySponsorshipAvailable :: JNullable Boolean
107− , planProductType :: JNullable ProductType
108− , keyConnectorEnabled :: JNullable Boolean
109− , keyConnectorUrl :: JNullable String
110− , familySponsorshipLastSyncDate :: JNullable Timestamp
111− , familySponsorshipValidUntil :: JNullable Timestamp
112− , familySponsorshipToDelete :: JNullable Boolean
113− }
22+type KDF
23+ = Int
24+
25+type PreloginResponse
26+ = { kdf :: KDF
27+ , kdfIterations :: Int
28+ }
29+
30+type PreloginRequest
31+ = { email :: String
32+ }
33+
34+type ProfileResponse
35+ = { id :: String
36+ , name :: JNullable String
37+ , email :: String
38+ , emailVerified :: Boolean
39+ , masterPasswordHint :: JNullable String
40+ , premiumPersonally :: Boolean
41+ -- , premiumFromOrganization :: Boolean
42+ , culture :: JNullable String
43+ , twoFactorEnabled :: Boolean
44+ , key :: EncryptedString
45+ , privateKey :: EncryptedString
46+ , securityStamp :: JNullable String
47+ , forcePasswordReset :: Boolean
48+ , usesKeyConnector :: Boolean
49+ , organizations :: Array ProfileOrganizationResponse
50+ , providers :: Array ProfileProviderResponse
51+ , providerOrganizations :: Array ProfileProviderOrganizationResponse
52+ }
53+
54+type ProfileOrganizationResponse
55+ = { id :: String
56+ , name :: JNullable String
57+ , usePolicies :: JNullable Boolean
58+ , useGroups :: JNullable Boolean
59+ , useDirectory :: JNullable Boolean
60+ , useEvents :: JNullable Boolean
61+ , useTotp :: JNullable Boolean
62+ , use2fa :: JNullable Boolean
63+ , useApi :: JNullable Boolean
64+ , useSso :: JNullable Boolean
65+ , useKeyConnector :: JNullable Boolean
66+ , useResetPassword :: JNullable Boolean
67+ , selfHost :: JNullable Boolean
68+ , usersGetPremium :: JNullable Boolean
69+ , seats :: JNullable Int
70+ , maxCollections :: JNullable Int
71+ , maxStorageGb :: JNullable Int
72+ , key :: JNullable String
73+ , hasPublicAndPrivateKeys :: JNullable Boolean
74+ , status :: JNullable OrganizationUserStatusType
75+ , type :: JNullable OrganizationUserType
76+ , enabled :: JNullable Boolean
77+ , ssoBound :: JNullable Boolean
78+ , identifier :: JNullable String
79+ , permissions :: JNullable PermissionsApi
80+ , resetPasswordEnrolled :: JNullable Boolean
81+ , userId :: JNullable String
82+ , providerId :: JNullable String
83+ , providerName :: JNullable String
84+ , familySponsorshipFriendlyName :: JNullable String
85+ , familySponsorshipAvailable :: JNullable Boolean
86+ , planProductType :: JNullable ProductType
87+ , keyConnectorEnabled :: JNullable Boolean
88+ , keyConnectorUrl :: JNullable String
89+ , familySponsorshipLastSyncDate :: JNullable Timestamp
90+ , familySponsorshipValidUntil :: JNullable Timestamp
91+ , familySponsorshipToDelete :: JNullable Boolean
92+ }
11493
11594organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
11695
@@ -118,7 +97,8 @@ organizationUserStatusTypeAccepted = 0 :: OrganizationUserStatusType
11897
11998organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
12099
121−type OrganizationUserStatusType = Int
100+type OrganizationUserStatusType
101+ = Int
122102
123103organizationUserTypeOwner = 0 :: OrganizationUserType
124104
@@ -130,26 +110,27 @@ organizationUserTypeManager = 3 :: OrganizationUserType
130110
131111organizationUserTypeCustom = 4 :: OrganizationUserType
132112
133−type OrganizationUserType = Int
134−
135−type PermissionsApi =
136− { accessEventLogs :: Boolean
137− , accessImportExport :: Boolean
138− , accessReports :: Boolean
139− , manageAllCollections :: Boolean
140− , createNewCollections :: Boolean
141− , editAnyCollection :: Boolean
142− , deleteAnyCollection :: Boolean
143− , manageAssignedCollections :: Boolean
144− , editAssignedCollections :: Boolean
145− , deleteAssignedCollections :: Boolean
146− , manageCiphers :: Boolean
147− , manageGroups :: Boolean
148− , manageSso :: Boolean
149− , managePolicies :: Boolean
150− , manageUsers :: Boolean
151− , manageResetPassword :: Boolean
152− }
113+type OrganizationUserType
114+ = Int
115+
116+type PermissionsApi
117+ = { accessEventLogs :: Boolean
118+ , accessImportExport :: Boolean
119+ , accessReports :: Boolean
120+ , manageAllCollections :: Boolean
121+ , createNewCollections :: Boolean
122+ , editAnyCollection :: Boolean
123+ , deleteAnyCollection :: Boolean
124+ , manageAssignedCollections :: Boolean
125+ , editAssignedCollections :: Boolean
126+ , deleteAssignedCollections :: Boolean
127+ , manageCiphers :: Boolean
128+ , manageGroups :: Boolean
129+ , manageSso :: Boolean
130+ , managePolicies :: Boolean
131+ , manageUsers :: Boolean
132+ , manageResetPassword :: Boolean
133+ }
153134
154135productTypeFree = 0 :: ProductType
155136
@@ -159,19 +140,20 @@ productTypeTeams = 2 :: ProductType
159140
160141productTypeEnterprise = 3 :: ProductType
161142
162−type ProductType = Int
163−
164−type ProfileProviderResponse =
165− { id :: String
166− , name :: JNullable String
167− , key :: JNullable String
168− , status :: JNullable ProviderUserStatusType
169− , type :: JNullable ProviderUserType
170− , enabled :: Boolean
171− , permissions :: PermissionsApi
172− , userId :: JNullable String
173− , useEvents :: Boolean
174− }
143+type ProductType
144+ = Int
145+
146+type ProfileProviderResponse
147+ = { id :: String
148+ , name :: JNullable String
149+ , key :: JNullable String
150+ , status :: JNullable ProviderUserStatusType
151+ , type :: JNullable ProviderUserType
152+ , enabled :: Boolean
153+ , permissions :: PermissionsApi
154+ , userId :: JNullable String
155+ , useEvents :: Boolean
156+ }
175157
176158providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
177159
@@ -179,79 +161,81 @@ providerUserStatusTypeAccepted = 1 :: ProviderUserStatusType
179161
180162providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
181163
182−type ProviderUserStatusType = Int
164+type ProviderUserStatusType
165+ = Int
183166
184167providerUserTypeProviderAdmin = 0 :: ProviderUserType
185168
186169providerUserTypeServiceUser = 1 :: ProviderUserType
187170
188−type ProviderUserType = Int
189−
190−type ProfileProviderOrganizationResponse =
191− { id :: String
192− , name :: JNullable String
193− , usePolicies :: Boolean
194− , useGroups :: Boolean
195− , useDirectory :: Boolean
196− , useEvents :: Boolean
197− , useTotp :: Boolean
198− , use2fa :: Boolean
199− , useApi :: Boolean
200− , useSso :: Boolean
201− , useKeyConnector :: Boolean
202− , useResetPassword :: Boolean
203− , selfHost :: Boolean
204− , usersGetPremium :: Boolean
205− , seats :: Int
206− , maxCollections :: Int
207− , maxStorageGb :: JNullable Int
208− , key :: JNullable String
209− , hasPublicAndPrivateKeys :: Boolean
210− , status :: OrganizationUserStatusType
211− , type :: OrganizationUserType
212− , enabled :: Boolean
213− , ssoBound :: Boolean
214− , identifier :: JNullable String
215− , permissions :: PermissionsApi
216− , resetPasswordEnrolled :: Boolean
217− , userId :: JNullable String
218− , providerId :: JNullable String
219− , providerName :: JNullable String
220− , familySponsorshipFriendlyName :: JNullable String
221− , familySponsorshipAvailable :: Boolean
222− , planProductType :: ProductType
223− , keyConnectorEnabled :: Boolean
224− , keyConnectorUrl :: JNullable String
225− , familySponsorshipLastSyncDate :: JNullable Timestamp
226− , familySponsorshipValidUntil :: JNullable Timestamp
227− , familySponsorshipToDelete :: JNullable Boolean
228− }
229−
230−type Urls =
231− { base :: JNullable String
232− , webVault :: JNullable String
233− , api :: JNullable String
234− , identity :: JNullable String
235− , icons :: JNullable String
236− , notifications :: JNullable String
237− , events :: JNullable String
238− , keyConnector :: JNullable String
239− }
240−
241−type PasswordTokenRequest =
242− { email :: Email
243− , masterPasswordHash :: String
244− , captchaResponse :: String
245− , twoFactor :: TokenRequestTwoFactor
246− , device :: DeviceRequest
247− }
248−
249−type DeviceRequest =
250− { type :: DeviceType
251− , name :: String
252− , identifier :: String
253− , pushToken :: JNullable String
254− }
171+type ProviderUserType
172+ = Int
173+
174+type ProfileProviderOrganizationResponse
175+ = { id :: String
176+ , name :: JNullable String
177+ , usePolicies :: Boolean
178+ , useGroups :: Boolean
179+ , useDirectory :: Boolean
180+ , useEvents :: Boolean
181+ , useTotp :: Boolean
182+ , use2fa :: Boolean
183+ , useApi :: Boolean
184+ , useSso :: Boolean
185+ , useKeyConnector :: Boolean
186+ , useResetPassword :: Boolean
187+ , selfHost :: Boolean
188+ , usersGetPremium :: Boolean
189+ , seats :: Int
190+ , maxCollections :: Int
191+ , maxStorageGb :: JNullable Int
192+ , key :: JNullable String
193+ , hasPublicAndPrivateKeys :: Boolean
194+ , status :: OrganizationUserStatusType
195+ , type :: OrganizationUserType
196+ , enabled :: Boolean
197+ , ssoBound :: Boolean
198+ , identifier :: JNullable String
199+ , permissions :: PermissionsApi
200+ , resetPasswordEnrolled :: Boolean
201+ , userId :: JNullable String
202+ , providerId :: JNullable String
203+ , providerName :: JNullable String
204+ , familySponsorshipFriendlyName :: JNullable String
205+ , familySponsorshipAvailable :: Boolean
206+ , planProductType :: ProductType
207+ , keyConnectorEnabled :: Boolean
208+ , keyConnectorUrl :: JNullable String
209+ , familySponsorshipLastSyncDate :: JNullable Timestamp
210+ , familySponsorshipValidUntil :: JNullable Timestamp
211+ , familySponsorshipToDelete :: JNullable Boolean
212+ }
213+
214+type Urls
215+ = { base :: JNullable String
216+ , webVault :: JNullable String
217+ , api :: JNullable String
218+ , identity :: JNullable String
219+ , icons :: JNullable String
220+ , notifications :: JNullable String
221+ , events :: JNullable String
222+ , keyConnector :: JNullable String
223+ }
224+
225+type PasswordTokenRequest
226+ = { email :: Email
227+ , masterPasswordHash :: String
228+ , captchaResponse :: String
229+ , twoFactor :: TokenRequestTwoFactor
230+ , device :: DeviceRequest
231+ }
232+
233+type DeviceRequest
234+ = { type :: DeviceType
235+ , name :: String
236+ , identifier :: String
237+ , pushToken :: JNullable String
238+ }
255239
256240deviceTypeAndroid = 0 :: DeviceType
257241
@@ -295,13 +279,14 @@ deviceTypeVivaldiExtension = 19 :: DeviceType
295279
296280deviceTypeSafariExtension = 20 :: DeviceType
297281
298−type DeviceType = Int
282+type DeviceType
283+ = Int
299284
300−type TokenRequestTwoFactor =
301− { provider :: TwoFactorProviderType
302− , token :: String
303− , remember :: Boolean
304− }
285+type TokenRequestTwoFactor
286+ = { provider :: TwoFactorProviderType
287+ , token :: String
288+ , remember :: Boolean
289+ }
305290
306291twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
307292
@@ -319,51 +304,24 @@ twoFactorProviderTypeOrganizationDuo = 6 :: TwoFactorProviderType
319304
320305twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
321306
322−type TwoFactorProviderType = Int
323−
324−secondFactorTypeToBridge
325− :: TwoFactorProviderType
326− -> Maybe Bridge.TwoFactorProviderType
327−secondFactorTypeToBridge x = case x of
328− n
329− | n == twoFactorProviderTypeAuthenticator -> Just Bridge.Authenticator
330− n
331− | n == twoFactorProviderTypeEmail -> Just Bridge.Email
332− n
333− | n == twoFactorProviderTypeDuo -> Just Bridge.Duo
334− n
335− | n == twoFactorProviderTypeYubikey -> Just Bridge.Yubikey
336− n
337− | n == twoFactorProviderTypeU2f -> Just Bridge.U2f
338− n
339− | n == twoFactorProviderTypeRemember -> Just Bridge.Remember
340− n
341− | n == twoFactorProviderTypeOrganizationDuo -> Just Bridge.OrganizationDuo
342− n
343− | n == twoFactorProviderTypeWebAuthn -> Just Bridge.WebAuthn
344− _ -> Nothing
345−
346−bridgeToSecondFactorType :: Bridge.TwoFactorProviderType -> TwoFactorProviderType
347−bridgeToSecondFactorType Bridge.Authenticator = twoFactorProviderTypeAuthenticator
348−bridgeToSecondFactorType Bridge.Email = twoFactorProviderTypeEmail
349−bridgeToSecondFactorType Bridge.Duo = twoFactorProviderTypeDuo
350−bridgeToSecondFactorType Bridge.Yubikey = twoFactorProviderTypeYubikey
351−bridgeToSecondFactorType Bridge.U2f = twoFactorProviderTypeU2f
352−bridgeToSecondFactorType Bridge.Remember = twoFactorProviderTypeRemember
353−bridgeToSecondFactorType Bridge.OrganizationDuo = twoFactorProviderTypeOrganizationDuo
354−bridgeToSecondFactorType Bridge.WebAuthn = twoFactorProviderTypeWebAuthn
355−
356−newtype Password = Password String
307+type TwoFactorProviderType
308+ = Int
309+
310+newtype Password
311+ = Password String
357312
358313hashPurposeServerAuthorization = 1 :: HashPurpose
359314
360315hashPurposeLocalAuthorization = 2 :: HashPurpose
361316
362−type HashPurpose = Int
317+type HashPurpose
318+ = Int
363319
364−newtype StringHash = StringHash String
320+newtype StringHash
321+ = StringHash String
365322
366−newtype AccessToken = AccessToken String
323+newtype AccessToken
324+ = AccessToken String
367325
368326derive newtype instance Show AccessToken
369327derive newtype instance Eq AccessToken
@@ -371,7 +329,8 @@ derive newtype instance Ord AccessToken
371329derive newtype instance EncodeJson AccessToken
372330derive newtype instance DecodeJson AccessToken
373331
374−newtype RefreshToken = RefreshToken String
332+newtype RefreshToken
333+ = RefreshToken String
375334
376335derive newtype instance Show RefreshToken
377336derive newtype instance Eq RefreshToken
@@ -383,91 +342,75 @@ type IdentityCaptchaResponse =
383342 { siteKey :: String
384343 }
385344
386−type IdentityTokenResponse =
387− { accessToken :: AccessToken
388− , expiresIn :: Int
389− , refreshToken :: RefreshToken
390− , tokenType :: String
391− , resetMasterPassword :: Boolean
392− , privateKey :: EncryptedString
393− , key :: EncryptedString
394− , twoFactorToken :: JNullable String
395− , kdf :: KDF
396− , kdfIterations :: Int
397− , forcePasswordReset :: JNullable Boolean
398− , apiUseKeyConnector :: JNullable Boolean
399− , keyConnectorUrl :: JNullable String
400− }
401−
402−newtype TwoFactorProviderTypes = TwoFactorProviderTypes (Array (Int |+| String))
403−
404−instance HasRuntimeType TwoFactorProviderTypes where
405− hasRuntimeType Proxy = Foreign.isArray
406−
407−fromTwoFactorProviderType :: TwoFactorProviderTypes -> Either String (Array Bridge.TwoFactorProviderType)
408−fromTwoFactorProviderType (TwoFactorProviderTypes xs) =
409− for xs $ \rawProvider -> do
410− providerInt <- Union.reduce (Either.Right /\ (\x -> Either.note x $ Int.fromString x)) rawProvider
411− Either.note (show providerInt) $ secondFactorTypeToBridge providerInt
412−
413−type IdentityTwoFactorResponse =
414− { twoFactorProviders :: TwoFactorProviderTypes
415− -- it is a Map type and untaged unions gets confused
416− -- , twoFactorProviders2 :: Object (Object String)
417− , captchaToken :: String |+| Undefined
418− }
419−
420−newtype Email = Email String
421−
422−type SyncResponse =
423− { profile :: ProfileResponse
424− , folders :: Array FolderResponse
425− , collections :: Array CollectionDetailsResponse
426− , ciphers :: Array CipherResponse
427− , domains :: JNullable DomainsResponse
428− , policies :: JNullable (Array PolicyResponse)
429− , sends :: Array SendResponse
430− }
345+type IdentityTokenResponse
346+ = { accessToken :: AccessToken
347+ , expiresIn :: Int
348+ , refreshToken :: RefreshToken
349+ , tokenType :: String
350+ , resetMasterPassword :: Boolean
351+ , privateKey :: EncryptedString
352+ , key :: EncryptedString
353+ , twoFactorToken :: JNullable String
354+ , kdf :: KDF
355+ , kdfIterations :: Int
356+ , forcePasswordReset :: JNullable Boolean
357+ , apiUseKeyConnector :: JNullable Boolean
358+ , keyConnectorUrl :: JNullable String
359+ }
360+
361+newtype Email
362+ = Email String
363+
364+type SyncResponse
365+ = { profile :: ProfileResponse
366+ , folders :: Array FolderResponse
367+ , collections :: Array CollectionDetailsResponse
368+ , ciphers :: Array CipherResponse
369+ , domains :: JNullable DomainsResponse
370+ , policies :: JNullable (Array PolicyResponse)
371+ , sends :: Array SendResponse
372+ }
373+
374+type FolderResponse
375+ = { id :: String
376+ , name :: JNullable String
377+ , revisionDate :: JNullable String
378+ }
379+
380+type CollectionDetailsResponse
381+ = { id :: String
382+ , organizationId :: JNullable String
383+ , name :: JNullable String
384+ , externalId :: JNullable String
385+ , readOnly :: Boolean
386+ }
431387
432−type FolderResponse =
433− { id :: String
434− , name :: JNullable String
435− , revisionDate :: JNullable String
436− }
437−
438−type CollectionDetailsResponse =
439− { id :: String
440− , organizationId :: JNullable String
441− , name :: JNullable String
442− , externalId :: JNullable String
443− , readOnly :: Boolean
444− }
445388
446389type CipherId = String
447390
448−type CipherResponse =
449− { id :: CipherId
450− , organizationId :: JNullable String
451− , folderId :: JNullable String
452− , type :: CipherType
453− , name :: EncryptedString
454− , notes :: JNullable EncryptedString
455− , fields :: JNullable (Array FieldApi)
456− , login :: JNullable LoginApi
457− , card :: JNullable CardApi
458− , identity :: JNullable IdentityApi
459− , secureNote :: JNullable SecureNoteApi
460− , favorite :: Boolean
461− , edit :: JNullable Boolean
462− , viewPassword :: JNullable Boolean
463− , organizationUseTotp :: JNullable Boolean
464− , revisionDate :: JNullable Timestamp
465− , attachments :: JNullable (Array AttachmentResponse)
466− , passwordHistory :: JNullable (Array PasswordHistoryResponse)
467− , collectionIds :: JNullable (Array String)
468− , deletedDate :: JNullable String
469− , reprompt :: CipherRepromptType
470− }
391+type CipherResponse
392+ = { id :: CipherId
393+ , organizationId :: JNullable String
394+ , folderId :: JNullable String
395+ , type :: CipherType
396+ , name :: EncryptedString
397+ , notes :: JNullable EncryptedString
398+ , fields :: JNullable (Array FieldApi)
399+ , login :: JNullable LoginApi
400+ , card :: JNullable CardApi
401+ , identity :: JNullable IdentityApi
402+ , secureNote :: JNullable SecureNoteApi
403+ , favorite :: Boolean
404+ , edit :: JNullable Boolean
405+ , viewPassword :: JNullable Boolean
406+ , organizationUseTotp :: JNullable Boolean
407+ , revisionDate :: JNullable Timestamp
408+ , attachments :: JNullable (Array AttachmentResponse)
409+ , passwordHistory :: JNullable (Array PasswordHistoryResponse)
410+ , collectionIds :: JNullable (Array String)
411+ , deletedDate :: JNullable String
412+ , reprompt :: CipherRepromptType
413+ }
471414
472415cipherTypeLogin = 1 :: CipherType
473416
@@ -477,14 +420,15 @@ cipherTypeCard = 3 :: CipherType
477420
478421cipherTypeIdentity = 4 :: CipherType
479422
480−type CipherType = Int
423+type CipherType
424+ = Int
481425
482−type FieldApi =
483− { name :: JNullable String
484− , value :: JNullable String
485− , type :: FieldType
486− , linkedId :: JNullable LinkedIdType
487− }
426+type FieldApi
427+ = { name :: JNullable String
428+ , value :: JNullable String
429+ , type :: FieldType
430+ , linkedId :: JNullable LinkedIdType
431+ }
488432
489433fieldTypeText = 0 :: FieldType
490434
@@ -494,7 +438,8 @@ fieldTypeBoolean = 2 :: FieldType
494438
495439fieldTypeLinked = 3 :: FieldType
496440
497−type FieldType = Int
441+type FieldType
442+ = Int
498443
499444linkedIdTypeLoginLinkedIdUsername = 100 :: LinkedIdType
500445
@@ -550,22 +495,23 @@ linkedIdTypeIdentityLinkedIdLastName = 417 :: LinkedIdType
550495
551496linkedIdTypeIdentityLinkedIdFullName = 418 :: LinkedIdType
552497
553−type LinkedIdType = Int
498+type LinkedIdType
499+ = Int
554500
555−type LoginApi =
556− { uris :: JOpt (Array LoginUriApi)
557− , username :: JNullable EncryptedString
558− , password :: JNullable EncryptedString
559− , passwordRevisionDate :: JNullable String
560− , totp :: JNullable EncryptedString
561− -- This thing is undefined in some cases for some reson. Just ignoring it
562− , autofillOnPageLoad :: JOpt (JNullable Boolean)
563− }
501+type LoginApi
502+ = { uris :: JOpt (Array LoginUriApi)
503+ , username :: JNullable EncryptedString
504+ , password :: JNullable EncryptedString
505+ , passwordRevisionDate :: JNullable String
506+ , totp :: JNullable EncryptedString
507+ -- This thing is undefined in some cases for some reson. Just ignoring it
508+ , autofillOnPageLoad :: JOpt (JNullable Boolean)
509+ }
564510
565−type LoginUriApi =
566− { uri :: JNullable EncryptedString
567− , match :: JNullable UriMatchType
568− }
511+type LoginUriApi
512+ = { uri :: EncryptedString
513+ , match :: JNullable UriMatchType
514+ }
569515
570516uriMatchTypeDomain = 0 :: UriMatchType
571517
@@ -579,85 +525,87 @@ uriMatchTypeRegularExpression = 4 :: UriMatchType
579525
580526uriMatchTypeNever = 5 :: UriMatchType
581527
582−type UriMatchType = Int
583−
584−type CardApi =
585− { cardholderName :: JNullable EncryptedString
586− , brand :: JNullable EncryptedString
587− , number :: JNullable EncryptedString
588− , expMonth :: JNullable EncryptedString
589− , expYear :: JNullable EncryptedString
590− , code :: JNullable EncryptedString
591− }
592−
593−type IdentityApi =
594− { title :: JNullable EncryptedString
595− , firstName :: JNullable EncryptedString
596− , middleName :: JNullable EncryptedString
597− , lastName :: JNullable EncryptedString
598− , address1 :: JNullable EncryptedString
599− , address2 :: JNullable EncryptedString
600− , address3 :: JNullable EncryptedString
601− , city :: JNullable EncryptedString
602− , state :: JNullable EncryptedString
603− , postalCode :: JNullable EncryptedString
604− , country :: JNullable EncryptedString
605− , company :: JNullable EncryptedString
606− , email :: JNullable EncryptedString
607− , phone :: JNullable EncryptedString
608− , ssn :: JNullable EncryptedString
609− , username :: JNullable EncryptedString
610− , passportNumber :: JNullable EncryptedString
611− , licenseNumber :: JNullable EncryptedString
612− }
528+type UriMatchType
529+ = Int
530+
531+type CardApi
532+ = { cardholderName :: JNullable EncryptedString
533+ , brand :: JNullable EncryptedString
534+ , number :: JNullable EncryptedString
535+ , expMonth :: JNullable EncryptedString
536+ , expYear :: JNullable EncryptedString
537+ , code :: JNullable EncryptedString
538+ }
539+
540+type IdentityApi
541+ = { title :: JNullable EncryptedString
542+ , firstName :: JNullable EncryptedString
543+ , middleName :: JNullable EncryptedString
544+ , lastName :: JNullable EncryptedString
545+ , address1 :: JNullable EncryptedString
546+ , address2 :: JNullable EncryptedString
547+ , address3 :: JNullable EncryptedString
548+ , city :: JNullable EncryptedString
549+ , state :: JNullable EncryptedString
550+ , postalCode :: JNullable EncryptedString
551+ , country :: JNullable EncryptedString
552+ , company :: JNullable EncryptedString
553+ , email :: JNullable EncryptedString
554+ , phone :: JNullable EncryptedString
555+ , ssn :: JNullable EncryptedString
556+ , username :: JNullable EncryptedString
557+ , passportNumber :: JNullable EncryptedString
558+ , licenseNumber :: JNullable EncryptedString
559+ }
613560
614561secureNoteTypeGeneric = 0 :: SecureNoteType
615562
616−type SecureNoteType = Int
563+type SecureNoteType
564+ = Int
617565
618−type SecureNoteApi =
619− {
620− -- type :: SecureNoteType
621− }
566+type SecureNoteApi = {
567+ type :: SecureNoteType
568+}
622569
623−type AttachmentResponse =
624− { id :: String
625− , url :: JNullable String
626− , fileName :: JNullable String
627− , key :: JNullable String
628− , size :: JNullable String
629− , sizeName :: JNullable String
630− }
570+type AttachmentResponse
571+ = { id :: String
572+ , url :: JNullable String
573+ , fileName :: JNullable String
574+ , key :: JNullable String
575+ , size :: JNullable String
576+ , sizeName :: JNullable String
577+ }
631578
632−type PasswordHistoryResponse =
633− { password :: String
634− , lastUsedDate :: JNullable String
635− }
579+type PasswordHistoryResponse
580+ = { password :: String
581+ , lastUsedDate :: JNullable String
582+ }
636583
637584cipherRepromptTypeNone = 0 :: CipherRepromptType
638585
639586cipherRepromptTypePassword = 1 :: CipherRepromptType
640587
641−type CipherRepromptType = Int
588+type CipherRepromptType
589+ = Int
642590
643−type DomainsResponse =
644− { equivalentDomains :: Array (Array String)
645− , globalEquivalentDomains :: Array GlobalDomainResponse
646− }
591+type DomainsResponse
592+ = { equivalentDomains :: Array (Array String)
593+ , globalEquivalentDomains :: Array GlobalDomainResponse
594+ }
647595
648−type GlobalDomainResponse =
649− { type :: Int
650− , domains :: Array String
651− , excluded :: Boolean
652− }
596+type GlobalDomainResponse
597+ = { type :: Int
598+ , domains :: Array String
599+ , excluded :: Boolean
600+ }
653601
654−type PolicyResponse =
655− { id :: String
656− , organizationId :: JNullable String
657− , type :: PolicyType
658− , data :: ShowableJson
659− , enabled :: Boolean
660− }
602+type PolicyResponse
603+ = { id :: String
604+ , organizationId :: JNullable String
605+ , type :: PolicyType
606+ , data :: ShowableJson
607+ , enabled :: Boolean
608+ }
661609
662610policyTypeTwoFactorAuthentication = 0 :: PolicyType -- Requires users to have 2fa enabled
663611
@@ -681,46 +629,43 @@ policyTypeMaximumVaultTimeout = 9 :: PolicyType -- Sets the maximum allowed vaul
681629
682630policyTypeDisablePersonalVaultExport = 10 :: PolicyType -- Disable personal vault export
683631
684−type PolicyType = Int
685−
686−type SendResponse =
687− { id :: String
688− , accessId :: JNullable String
689− , type :: SendType
690− , name :: JNullable String
691− , notes :: JNullable String
692− , file :: JNullable SendFileApi
693− , text :: JNullable SendTextApi
694− , key :: JNullable String
695− , maxAccessCount :: JNullable Int
696− , accessCount :: JNullable Int
697− , revisionDate :: JNullable String
698− , expirationDate :: JNullable String
699− , deletionDate :: JNullable String
700− , password :: JNullable String
701− , disable :: Boolean
702− , hideEmail :: Boolean
703− }
632+type PolicyType
633+ = Int
634+
635+type SendResponse
636+ = { id :: String
637+ , accessId :: JNullable String
638+ , type :: SendType
639+ , name :: JNullable String
640+ , notes :: JNullable String
641+ , file :: JNullable SendFileApi
642+ , text :: JNullable SendTextApi
643+ , key :: JNullable String
644+ , maxAccessCount :: JNullable Int
645+ , accessCount :: JNullable Int
646+ , revisionDate :: JNullable String
647+ , expirationDate :: JNullable String
648+ , deletionDate :: JNullable String
649+ , password :: JNullable String
650+ , disable :: Boolean
651+ , hideEmail :: Boolean
652+ }
704653
705654sendTypeText = 0 :: SendType
706655
707656sendTypeFile = 1 :: SendType
708657
709−type SendType = Int
710−
711−type SendFileApi =
712− { id :: String
713− , fileName :: JNullable String
714− , size :: JNullable String
715− , sizeName :: JNullable String
716− }
658+type SendType
659+ = Int
717660
718−type SendTextApi =
719− { text :: JNullable String
720− , hidden :: Boolean
721− }
661+type SendFileApi
662+ = { id :: String
663+ , fileName :: JNullable String
664+ , size :: JNullable String
665+ , sizeName :: JNullable String
666+ }
722667
723−type TwoFactorEmailRequest =
724− { email :: Email
725− , masterPasswordHash :: StringHash
726− }
668+type SendTextApi
669+ = { text :: JNullable String
670+ , hidden :: Boolean
671+ }