@@ -2,14 +2,27 @@ module BW.Types where
3import Prelude
3import Prelude
5+import Bridge as Bridge
5import Data.Argonaut (class DecodeJson, class EncodeJson)
6import Data.Argonaut (class DecodeJson, class EncodeJson)
7+import Data.Either (Either)
8+import Data.Either as Either
6import Data.JNullable (JNullable)
10import Data.JNullable (JNullable)
7import Data.JOpt (JOpt)
11import Data.JOpt (JOpt)
12+import Data.Maybe (Maybe(..))
13+import Data.Nullable (Nullable)
8import Data.ShowableJson (ShowableJson)
14import Data.ShowableJson (ShowableJson)
9import Data.Timestamp (Timestamp)
15import 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
11−newtype EncryptedString
25+newtype EncryptedString = EncryptedString String
12− = EncryptedString String
14derive newtype instance Show EncryptedString
27derive newtype instance Show EncryptedString
15derive newtype instance Ord EncryptedString
28derive newtype instance Ord EncryptedString
@@ -18,78 +31,86 @@ derive newtype instance EncodeJson EncryptedString
18derive newtype instance DecodeJson EncryptedString
31derive newtype instance DecodeJson EncryptedString
20kdfPBKDF2_SHA256 = 0 :: KDF
33kdfPBKDF2_SHA256 = 0 :: KDF
34+kdfArgon2id = 1 :: KDF
22−type KDF
36+type KDF = Int
25−type PreloginResponse
38+type PreloginResponse =
26− = { kdf :: KDF
39+ { kdf :: KDF
27− , kdfIterations :: Int
40+ , kdfIterations :: Int
41+ , kdfMemory :: JNullable Int
42+ , kdfParallelism :: JNullable Int
47+ , memory :: JNullable Int
48+ , parallelism :: JNullable Int
30−type PreloginRequest
51+type PreloginRequest =
31− = { email :: String
52+ { email :: Email
34−type ProfileResponse
55+type ProfileResponse =
35− = { id :: String
56+ { id :: String
36− , name :: JNullable String
57+ , name :: JNullable String
37− , email :: String
58+ , email :: String
38− , emailVerified :: Boolean
59+ , emailVerified :: Boolean
39− , masterPasswordHint :: JNullable String
60+ , masterPasswordHint :: JNullable String
40− , premiumPersonally :: Boolean
61+ -- , premiumPersonally :: Boolean
41− -- , premiumFromOrganization :: Boolean
62+ -- , premiumFromOrganization :: Boolean
42− , culture :: JNullable String
63+ , culture :: JNullable String
43− , twoFactorEnabled :: Boolean
64+ , twoFactorEnabled :: Boolean
44− , key :: EncryptedString
65+ , key :: EncryptedString
45− , privateKey :: EncryptedString
66+ , privateKey :: EncryptedString
46− , securityStamp :: JNullable String
67+ , securityStamp :: JNullable String
47− , forcePasswordReset :: Boolean
68+ , forcePasswordReset :: Boolean
48− , usesKeyConnector :: Boolean
69+ , usesKeyConnector :: Boolean
49− , organizations :: Array ProfileOrganizationResponse
70+ -- , organizations :: Array ProfileOrganizationResponse
50− , providers :: Array ProfileProviderResponse
71+ , providers :: Array ProfileProviderResponse
51− , providerOrganizations :: Array ProfileProviderOrganizationResponse
72+ , providerOrganizations :: Array ProfileProviderOrganizationResponse
54−type ProfileOrganizationResponse
75+type ProfileOrganizationResponse =
55− = { id :: String
76+ { id :: String
56− , name :: JNullable String
77+ , name :: JNullable String
57− , usePolicies :: JNullable Boolean
78+ , usePolicies :: JNullable Boolean
58− , useGroups :: JNullable Boolean
79+ , useGroups :: JNullable Boolean
59− , useDirectory :: JNullable Boolean
80+ , useDirectory :: JNullable Boolean
60− , useEvents :: JNullable Boolean
81+ , useEvents :: JNullable Boolean
61− , useTotp :: JNullable Boolean
82+ , useTotp :: JNullable Boolean
62− , use2fa :: JNullable Boolean
83+ , use2fa :: JNullable Boolean
63− , useApi :: JNullable Boolean
84+ , useApi :: JNullable Boolean
64− , useSso :: JNullable Boolean
85+ , useSso :: JNullable Boolean
65− , useKeyConnector :: JNullable Boolean
86+ , useKeyConnector :: JNullable Boolean
66− , useResetPassword :: JNullable Boolean
87+ , useResetPassword :: JNullable Boolean
67− , selfHost :: JNullable Boolean
88+ , selfHost :: JNullable Boolean
68− , usersGetPremium :: JNullable Boolean
89+ , usersGetPremium :: JNullable Boolean
69− , seats :: JNullable Int
90+ , seats :: JNullable Int
70− , maxCollections :: JNullable Int
91+ , maxCollections :: JNullable Int
71− , maxStorageGb :: JNullable Int
92+ , maxStorageGb :: JNullable Int
72− , key :: JNullable String
93+ , key :: JNullable String
73− , hasPublicAndPrivateKeys :: JNullable Boolean
94+ , hasPublicAndPrivateKeys :: JNullable Boolean
74− , status :: JNullable OrganizationUserStatusType
95+ , status :: JNullable OrganizationUserStatusType
75− , type :: JNullable OrganizationUserType
96+ , type :: JNullable OrganizationUserType
76− , enabled :: JNullable Boolean
97+ , enabled :: JNullable Boolean
77− , ssoBound :: JNullable Boolean
98+ , ssoBound :: JNullable Boolean
78− , identifier :: JNullable String
99+ , identifier :: JNullable String
79− , permissions :: JNullable PermissionsApi
100+ , permissions :: JNullable PermissionsApi
80− , resetPasswordEnrolled :: JNullable Boolean
101+ , resetPasswordEnrolled :: JNullable Boolean
81− , userId :: JNullable String
102+ , userId :: JNullable String
82− , providerId :: JNullable String
103+ , providerId :: JNullable String
83− , providerName :: JNullable String
104+ , providerName :: JNullable String
84− , familySponsorshipFriendlyName :: JNullable String
105+ , familySponsorshipFriendlyName :: JNullable String
85− , familySponsorshipAvailable :: JNullable Boolean
106+ , familySponsorshipAvailable :: JNullable Boolean
86− , planProductType :: JNullable ProductType
107+ , planProductType :: JNullable ProductType
87− , keyConnectorEnabled :: JNullable Boolean
108+ , keyConnectorEnabled :: JNullable Boolean
88− , keyConnectorUrl :: JNullable String
109+ , keyConnectorUrl :: JNullable String
89− , familySponsorshipLastSyncDate :: JNullable Timestamp
110+ , familySponsorshipLastSyncDate :: JNullable Timestamp
90− , familySponsorshipValidUntil :: JNullable Timestamp
111+ , familySponsorshipValidUntil :: JNullable Timestamp
91− , familySponsorshipToDelete :: JNullable Boolean
112+ , familySponsorshipToDelete :: JNullable Boolean
94organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
115organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
@@ -97,8 +118,7 @@ organizationUserStatusTypeAccepted = 0 :: OrganizationUserStatusType
98organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
119organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
100−type OrganizationUserStatusType
121+type OrganizationUserStatusType = Int
103organizationUserTypeOwner = 0 :: OrganizationUserType
123organizationUserTypeOwner = 0 :: OrganizationUserType
@@ -110,27 +130,26 @@ organizationUserTypeManager = 3 :: OrganizationUserType
111organizationUserTypeCustom = 4 :: OrganizationUserType
131organizationUserTypeCustom = 4 :: OrganizationUserType
113−type OrganizationUserType
133+type OrganizationUserType = Int
116−type PermissionsApi
135+type PermissionsApi =
117− = { accessEventLogs :: Boolean
136+ { accessEventLogs :: Boolean
118− , accessImportExport :: Boolean
137+ , accessImportExport :: Boolean
119− , accessReports :: Boolean
138+ , accessReports :: Boolean
120− , manageAllCollections :: Boolean
139+ , manageAllCollections :: Boolean
121− , createNewCollections :: Boolean
140+ , createNewCollections :: Boolean
122− , editAnyCollection :: Boolean
141+ , editAnyCollection :: Boolean
123− , deleteAnyCollection :: Boolean
142+ , deleteAnyCollection :: Boolean
124− , manageAssignedCollections :: Boolean
143+ , manageAssignedCollections :: Boolean
125− , editAssignedCollections :: Boolean
144+ , editAssignedCollections :: Boolean
126− , deleteAssignedCollections :: Boolean
145+ , deleteAssignedCollections :: Boolean
127− , manageCiphers :: Boolean
146+ , manageCiphers :: Boolean
128− , manageGroups :: Boolean
147+ , manageGroups :: Boolean
129− , manageSso :: Boolean
148+ , manageSso :: Boolean
130− , managePolicies :: Boolean
149+ , managePolicies :: Boolean
131− , manageUsers :: Boolean
150+ , manageUsers :: Boolean
132− , manageResetPassword :: Boolean
151+ , manageResetPassword :: Boolean
135productTypeFree = 0 :: ProductType
154productTypeFree = 0 :: ProductType
@@ -140,20 +159,19 @@ productTypeTeams = 2 :: ProductType
141productTypeEnterprise = 3 :: ProductType
160productTypeEnterprise = 3 :: ProductType
143−type ProductType
162+type ProductType = Int
146−type ProfileProviderResponse
164+type ProfileProviderResponse =
147− = { id :: String
165+ { id :: String
148− , name :: JNullable String
166+ , name :: JNullable String
149− , key :: JNullable String
167+ , key :: JNullable String
150− , status :: JNullable ProviderUserStatusType
168+ , status :: JNullable ProviderUserStatusType
151− , type :: JNullable ProviderUserType
169+ , type :: JNullable ProviderUserType
152− , enabled :: Boolean
170+ , enabled :: Boolean
153− , permissions :: PermissionsApi
171+ , permissions :: PermissionsApi
154− , userId :: JNullable String
172+ , userId :: JNullable String
155− , useEvents :: Boolean
173+ , useEvents :: Boolean
158providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
176providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
@@ -161,81 +179,79 @@ providerUserStatusTypeAccepted = 1 :: ProviderUserStatusType
162providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
180providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
164−type ProviderUserStatusType
182+type ProviderUserStatusType = Int
167providerUserTypeProviderAdmin = 0 :: ProviderUserType
184providerUserTypeProviderAdmin = 0 :: ProviderUserType
169providerUserTypeServiceUser = 1 :: ProviderUserType
186providerUserTypeServiceUser = 1 :: ProviderUserType
171−type ProviderUserType
188+type ProviderUserType = Int
174−type ProfileProviderOrganizationResponse
190+type ProfileProviderOrganizationResponse =
175− = { id :: String
191+ { id :: String
176− , name :: JNullable String
192+ , name :: JNullable String
177− , usePolicies :: Boolean
193+ , usePolicies :: Boolean
178− , useGroups :: Boolean
194+ , useGroups :: Boolean
179− , useDirectory :: Boolean
195+ , useDirectory :: Boolean
180− , useEvents :: Boolean
196+ , useEvents :: Boolean
181− , useTotp :: Boolean
197+ , useTotp :: Boolean
182− , use2fa :: Boolean
198+ , use2fa :: Boolean
183− , useApi :: Boolean
199+ , useApi :: Boolean
184− , useSso :: Boolean
200+ , useSso :: Boolean
185− , useKeyConnector :: Boolean
201+ , useKeyConnector :: Boolean
186− , useResetPassword :: Boolean
202+ , useResetPassword :: Boolean
187− , selfHost :: Boolean
203+ , selfHost :: Boolean
188− , usersGetPremium :: Boolean
204+ , usersGetPremium :: Boolean
189− , seats :: Int
205+ , seats :: Int
190− , maxCollections :: Int
206+ , maxCollections :: Int
191− , maxStorageGb :: JNullable Int
207+ , maxStorageGb :: JNullable Int
192− , key :: JNullable String
208+ , key :: JNullable String
193− , hasPublicAndPrivateKeys :: Boolean
209+ , hasPublicAndPrivateKeys :: Boolean
194− , status :: OrganizationUserStatusType
210+ , status :: OrganizationUserStatusType
195− , type :: OrganizationUserType
211+ , type :: OrganizationUserType
196− , enabled :: Boolean
212+ , enabled :: Boolean
197− , ssoBound :: Boolean
213+ , ssoBound :: Boolean
198− , identifier :: JNullable String
214+ , identifier :: JNullable String
199− , permissions :: PermissionsApi
215+ , permissions :: PermissionsApi
200− , resetPasswordEnrolled :: Boolean
216+ , resetPasswordEnrolled :: Boolean
201− , userId :: JNullable String
217+ , userId :: JNullable String
202− , providerId :: JNullable String
218+ , providerId :: JNullable String
203− , providerName :: JNullable String
219+ , providerName :: JNullable String
204− , familySponsorshipFriendlyName :: JNullable String
220+ , familySponsorshipFriendlyName :: JNullable String
205− , familySponsorshipAvailable :: Boolean
221+ , familySponsorshipAvailable :: Boolean
206− , planProductType :: ProductType
222+ , planProductType :: ProductType
207− , keyConnectorEnabled :: Boolean
223+ , keyConnectorEnabled :: Boolean
208− , keyConnectorUrl :: JNullable String
224+ , keyConnectorUrl :: JNullable String
209− , familySponsorshipLastSyncDate :: JNullable Timestamp
225+ , familySponsorshipLastSyncDate :: JNullable Timestamp
210− , familySponsorshipValidUntil :: JNullable Timestamp
226+ , familySponsorshipValidUntil :: JNullable Timestamp
211− , familySponsorshipToDelete :: JNullable Boolean
227+ , familySponsorshipToDelete :: JNullable Boolean
214−type Urls
230+type Urls =
215− = { base :: JNullable String
231+ { base :: JNullable String
216− , webVault :: JNullable String
232+ , webVault :: JNullable String
217− , api :: JNullable String
233+ , api :: JNullable String
218− , identity :: JNullable String
234+ , identity :: JNullable String
219− , icons :: JNullable String
235+ , icons :: JNullable String
220− , notifications :: JNullable String
236+ , notifications :: JNullable String
221− , events :: JNullable String
237+ , events :: JNullable String
222− , keyConnector :: JNullable String
238+ , keyConnector :: JNullable String
225−type PasswordTokenRequest
241+type PasswordTokenRequest =
226− = { email :: Email
242+ { email :: Email
227− , masterPasswordHash :: String
243+ , masterPasswordHash :: String
228− , captchaResponse :: String
244+ , captchaResponse :: String
229− , twoFactor :: TokenRequestTwoFactor
245+ , twoFactor :: TokenRequestTwoFactor
230− , device :: DeviceRequest
246+ , device :: DeviceRequest
233−type DeviceRequest
249+type DeviceRequest =
234− = { type :: DeviceType
250+ { type :: DeviceType
235− , name :: String
251+ , name :: String
236− , identifier :: String
252+ , identifier :: String
237− , pushToken :: JNullable String
253+ , pushToken :: JNullable String
240deviceTypeAndroid = 0 :: DeviceType
256deviceTypeAndroid = 0 :: DeviceType
@@ -279,14 +295,13 @@ deviceTypeVivaldiExtension = 19 :: DeviceType
280deviceTypeSafariExtension = 20 :: DeviceType
296deviceTypeSafariExtension = 20 :: DeviceType
282−type DeviceType
298+type DeviceType = Int
285−type TokenRequestTwoFactor
300+type TokenRequestTwoFactor =
286− = { provider :: TwoFactorProviderType
301+ { provider :: TwoFactorProviderType
287− , token :: String
302+ , token :: String
288− , remember :: Boolean
303+ , remember :: Boolean
291twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
306twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
@@ -304,24 +319,51 @@ twoFactorProviderTypeOrganizationDuo = 6 :: TwoFactorProviderType
305twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
320twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
307−type TwoFactorProviderType
322+type TwoFactorProviderType = Int
309−
324+secondFactorTypeToBridge
325+ :: TwoFactorProviderType
326+ -> Maybe Bridge.TwoFactorProviderType
327+secondFactorTypeToBridge x = case x of
329+ | n == twoFactorProviderTypeAuthenticator -> Just Bridge.Authenticator
331+ | n == twoFactorProviderTypeEmail -> Just Bridge.Email
333+ | n == twoFactorProviderTypeDuo -> Just Bridge.Duo
335+ | n == twoFactorProviderTypeYubikey -> Just Bridge.Yubikey
337+ | n == twoFactorProviderTypeU2f -> Just Bridge.U2f
339+ | n == twoFactorProviderTypeRemember -> Just Bridge.Remember
341+ | n == twoFactorProviderTypeOrganizationDuo -> Just Bridge.OrganizationDuo
343+ | n == twoFactorProviderTypeWebAuthn -> Just Bridge.WebAuthn
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
310−newtype Password
356+newtype Password = Password String
313hashPurposeServerAuthorization = 1 :: HashPurpose
358hashPurposeServerAuthorization = 1 :: HashPurpose
315hashPurposeLocalAuthorization = 2 :: HashPurpose
360hashPurposeLocalAuthorization = 2 :: HashPurpose
317−type HashPurpose
362+type HashPurpose = Int
320−newtype StringHash
364+newtype StringHash = StringHash String
323−newtype AccessToken
366+newtype AccessToken = AccessToken String
324− = AccessToken String
326derive newtype instance Show AccessToken
368derive newtype instance Show AccessToken
327derive newtype instance Eq AccessToken
369derive newtype instance Eq AccessToken
@@ -329,8 +371,7 @@ derive newtype instance Ord AccessToken
329derive newtype instance EncodeJson AccessToken
371derive newtype instance EncodeJson AccessToken
330derive newtype instance DecodeJson AccessToken
372derive newtype instance DecodeJson AccessToken
332−newtype RefreshToken
374+newtype RefreshToken = RefreshToken String
333− = RefreshToken String
335derive newtype instance Show RefreshToken
376derive newtype instance Show RefreshToken
336derive newtype instance Eq RefreshToken
377derive newtype instance Eq RefreshToken
@@ -342,75 +383,91 @@ type IdentityCaptchaResponse =
342 { siteKey :: String
383 { siteKey :: String
345−type IdentityTokenResponse
386+type IdentityTokenResponse =
346− = { accessToken :: AccessToken
387+ { accessToken :: AccessToken
347− , expiresIn :: Int
388+ , expiresIn :: Int
348− , refreshToken :: RefreshToken
389+ , refreshToken :: RefreshToken
349− , tokenType :: String
390+ , tokenType :: String
350− , resetMasterPassword :: Boolean
391+ , resetMasterPassword :: Boolean
351− , privateKey :: EncryptedString
392+ , privateKey :: EncryptedString
352− , key :: EncryptedString
393+ , key :: EncryptedString
353− , twoFactorToken :: JNullable String
394+ , twoFactorToken :: JNullable String
354− , kdf :: KDF
395+ , kdf :: KDF
355− , kdfIterations :: Int
396+ , kdfIterations :: Int
356− , forcePasswordReset :: JNullable Boolean
397+ , forcePasswordReset :: JNullable Boolean
357− , apiUseKeyConnector :: JNullable Boolean
398+ , apiUseKeyConnector :: JNullable Boolean
358− , keyConnectorUrl :: JNullable String
399+ , keyConnectorUrl :: JNullable String
361−newtype Email
402+newtype TwoFactorProviderTypes = TwoFactorProviderTypes (Array (Int |+| String))
404+instance HasRuntimeType TwoFactorProviderTypes where
405+ hasRuntimeType Proxy = Foreign.isArray
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
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
362− = Email String
420+newtype Email = Email String
364−type SyncResponse
422+type SyncResponse =
365− = { profile :: ProfileResponse
423+ { profile :: ProfileResponse
366− , folders :: Array FolderResponse
424+ , folders :: Array FolderResponse
367− , collections :: Array CollectionDetailsResponse
425+ , collections :: Array CollectionDetailsResponse
368− , ciphers :: Array CipherResponse
426+ , ciphers :: Array CipherResponse
369− , domains :: JNullable DomainsResponse
427+ , domains :: JNullable DomainsResponse
370− , policies :: JNullable (Array PolicyResponse)
428+ , policies :: JNullable (Array PolicyResponse)
371− , sends :: Array SendResponse
429+ , sends :: Array SendResponse
376− , name :: JNullable String
377− , revisionDate :: JNullable String
380−type CollectionDetailsResponse
382− , organizationId :: JNullable String
383− , name :: JNullable String
384− , externalId :: JNullable String
385− , readOnly :: Boolean
432+type FolderResponse =
434+ , name :: JNullable String
435+ , revisionDate :: JNullable String
438+type CollectionDetailsResponse =
440+ , organizationId :: JNullable String
441+ , name :: JNullable String
442+ , externalId :: JNullable String
443+ , readOnly :: Boolean
389type CipherId = String
446type CipherId = String
391−type CipherResponse
448+type CipherResponse =
392− = { id :: CipherId
449+ { id :: CipherId
393− , organizationId :: JNullable String
450+ , organizationId :: JNullable String
394− , folderId :: JNullable String
451+ , folderId :: JNullable String
395− , type :: CipherType
452+ , type :: CipherType
396− , name :: EncryptedString
453+ , name :: EncryptedString
397− , notes :: JNullable EncryptedString
454+ , notes :: JNullable EncryptedString
398− , fields :: JNullable (Array FieldApi)
455+ , fields :: JNullable (Array FieldApi)
399− , login :: JNullable LoginApi
456+ , login :: JNullable LoginApi
400− , card :: JNullable CardApi
457+ , card :: JNullable CardApi
401− , identity :: JNullable IdentityApi
458+ , identity :: JNullable IdentityApi
402− , secureNote :: JNullable SecureNoteApi
459+ , secureNote :: JNullable SecureNoteApi
403− , favorite :: Boolean
460+ , favorite :: Boolean
404− , edit :: JNullable Boolean
461+ , edit :: JNullable Boolean
405− , viewPassword :: JNullable Boolean
462+ , viewPassword :: JNullable Boolean
406− , organizationUseTotp :: JNullable Boolean
463+ , organizationUseTotp :: JNullable Boolean
407− , revisionDate :: JNullable Timestamp
464+ , revisionDate :: JNullable Timestamp
408− , attachments :: JNullable (Array AttachmentResponse)
465+ , attachments :: JNullable (Array AttachmentResponse)
409− , passwordHistory :: JNullable (Array PasswordHistoryResponse)
466+ , passwordHistory :: JNullable (Array PasswordHistoryResponse)
410− , collectionIds :: JNullable (Array String)
467+ , collectionIds :: JNullable (Array String)
411− , deletedDate :: JNullable String
468+ , deletedDate :: JNullable String
412− , reprompt :: CipherRepromptType
469+ , reprompt :: CipherRepromptType
415cipherTypeLogin = 1 :: CipherType
472cipherTypeLogin = 1 :: CipherType
@@ -420,15 +477,14 @@ cipherTypeCard = 3 :: CipherType
421cipherTypeIdentity = 4 :: CipherType
478cipherTypeIdentity = 4 :: CipherType
423−type CipherType
480+type CipherType = Int
426−type FieldApi
482+type FieldApi =
427− = { name :: JNullable String
483+ { name :: JNullable String
428− , value :: JNullable String
484+ , value :: JNullable String
429− , type :: FieldType
485+ , type :: FieldType
430− , linkedId :: JNullable LinkedIdType
486+ , linkedId :: JNullable LinkedIdType
433fieldTypeText = 0 :: FieldType
489fieldTypeText = 0 :: FieldType
@@ -438,8 +494,7 @@ fieldTypeBoolean = 2 :: FieldType
439fieldTypeLinked = 3 :: FieldType
495fieldTypeLinked = 3 :: FieldType
441−type FieldType
497+type FieldType = Int
444linkedIdTypeLoginLinkedIdUsername = 100 :: LinkedIdType
499linkedIdTypeLoginLinkedIdUsername = 100 :: LinkedIdType
@@ -495,23 +550,22 @@ linkedIdTypeIdentityLinkedIdLastName = 417 :: LinkedIdType
496linkedIdTypeIdentityLinkedIdFullName = 418 :: LinkedIdType
551linkedIdTypeIdentityLinkedIdFullName = 418 :: LinkedIdType
498−type LinkedIdType
553+type LinkedIdType = Int
501−type LoginApi
555+type LoginApi =
502− = { uris :: JOpt (Array LoginUriApi)
556+ { uris :: JOpt (Array LoginUriApi)
503− , username :: JNullable EncryptedString
557+ , username :: JNullable EncryptedString
504− , password :: JNullable EncryptedString
558+ , password :: JNullable EncryptedString
505− , passwordRevisionDate :: JNullable String
559+ , passwordRevisionDate :: JNullable String
506− , totp :: JNullable EncryptedString
560+ , totp :: JNullable EncryptedString
507− -- This thing is undefined in some cases for some reson. Just ignoring it
561+ -- This thing is undefined in some cases for some reson. Just ignoring it
508− , autofillOnPageLoad :: JOpt (JNullable Boolean)
562+ , autofillOnPageLoad :: JOpt (JNullable Boolean)
511−type LoginUriApi
565+type LoginUriApi =
512− = { uri :: EncryptedString
566+ { uri :: JNullable EncryptedString
513− , match :: JNullable UriMatchType
567+ , match :: JNullable UriMatchType
516uriMatchTypeDomain = 0 :: UriMatchType
570uriMatchTypeDomain = 0 :: UriMatchType
@@ -525,87 +579,85 @@ uriMatchTypeRegularExpression = 4 :: UriMatchType
526uriMatchTypeNever = 5 :: UriMatchType
580uriMatchTypeNever = 5 :: UriMatchType
528−type UriMatchType
582+type UriMatchType = Int
531−type CardApi
584+type CardApi =
532− = { cardholderName :: JNullable EncryptedString
585+ { cardholderName :: JNullable EncryptedString
533− , brand :: JNullable EncryptedString
586+ , brand :: JNullable EncryptedString
534− , number :: JNullable EncryptedString
587+ , number :: JNullable EncryptedString
535− , expMonth :: JNullable EncryptedString
588+ , expMonth :: JNullable EncryptedString
536− , expYear :: JNullable EncryptedString
589+ , expYear :: JNullable EncryptedString
537− , code :: JNullable EncryptedString
590+ , code :: JNullable EncryptedString
540−type IdentityApi
593+type IdentityApi =
541− = { title :: JNullable EncryptedString
594+ { title :: JNullable EncryptedString
542− , firstName :: JNullable EncryptedString
595+ , firstName :: JNullable EncryptedString
543− , middleName :: JNullable EncryptedString
596+ , middleName :: JNullable EncryptedString
544− , lastName :: JNullable EncryptedString
597+ , lastName :: JNullable EncryptedString
545− , address1 :: JNullable EncryptedString
598+ , address1 :: JNullable EncryptedString
546− , address2 :: JNullable EncryptedString
599+ , address2 :: JNullable EncryptedString
547− , address3 :: JNullable EncryptedString
600+ , address3 :: JNullable EncryptedString
548− , city :: JNullable EncryptedString
601+ , city :: JNullable EncryptedString
549− , state :: JNullable EncryptedString
602+ , state :: JNullable EncryptedString
550− , postalCode :: JNullable EncryptedString
603+ , postalCode :: JNullable EncryptedString
551− , country :: JNullable EncryptedString
604+ , country :: JNullable EncryptedString
552− , company :: JNullable EncryptedString
605+ , company :: JNullable EncryptedString
553− , email :: JNullable EncryptedString
606+ , email :: JNullable EncryptedString
554− , phone :: JNullable EncryptedString
607+ , phone :: JNullable EncryptedString
555− , ssn :: JNullable EncryptedString
608+ , ssn :: JNullable EncryptedString
556− , username :: JNullable EncryptedString
609+ , username :: JNullable EncryptedString
557− , passportNumber :: JNullable EncryptedString
610+ , passportNumber :: JNullable EncryptedString
558− , licenseNumber :: JNullable EncryptedString
611+ , licenseNumber :: JNullable EncryptedString
561secureNoteTypeGeneric = 0 :: SecureNoteType
614secureNoteTypeGeneric = 0 :: SecureNoteType
563−type SecureNoteType
616+type SecureNoteType = Int
566−type SecureNoteApi = {
618+type SecureNoteApi =
567− type :: SecureNoteType
620+ -- type :: SecureNoteType
570−type AttachmentResponse
623+type AttachmentResponse =
571− = { id :: String
624+ { id :: String
572− , url :: JNullable String
625+ , url :: JNullable String
573− , fileName :: JNullable String
626+ , fileName :: JNullable String
574− , key :: JNullable String
627+ , key :: JNullable String
575− , size :: JNullable String
628+ , size :: JNullable String
576− , sizeName :: JNullable String
629+ , sizeName :: JNullable String
579−type PasswordHistoryResponse
632+type PasswordHistoryResponse =
580− = { password :: String
633+ { password :: String
581− , lastUsedDate :: JNullable String
634+ , lastUsedDate :: JNullable String
584cipherRepromptTypeNone = 0 :: CipherRepromptType
637cipherRepromptTypeNone = 0 :: CipherRepromptType
586cipherRepromptTypePassword = 1 :: CipherRepromptType
639cipherRepromptTypePassword = 1 :: CipherRepromptType
588−type CipherRepromptType
641+type CipherRepromptType = Int
591−type DomainsResponse
643+type DomainsResponse =
592− = { equivalentDomains :: Array (Array String)
644+ { equivalentDomains :: Array (Array String)
593− , globalEquivalentDomains :: Array GlobalDomainResponse
645+ , globalEquivalentDomains :: Array GlobalDomainResponse
596−type GlobalDomainResponse
648+type GlobalDomainResponse =
597− = { type :: Int
649+ { type :: Int
598− , domains :: Array String
650+ , domains :: Array String
599− , excluded :: Boolean
651+ , excluded :: Boolean
602−type PolicyResponse
654+type PolicyResponse =
603− = { id :: String
655+ { id :: String
604− , organizationId :: JNullable String
656+ , organizationId :: JNullable String
605− , type :: PolicyType
657+ , type :: PolicyType
606− , data :: ShowableJson
658+ , data :: ShowableJson
607− , enabled :: Boolean
659+ , enabled :: Boolean
610policyTypeTwoFactorAuthentication = 0 :: PolicyType -- Requires users to have 2fa enabled
662policyTypeTwoFactorAuthentication = 0 :: PolicyType -- Requires users to have 2fa enabled
@@ -629,43 +681,46 @@ policyTypeMaximumVaultTimeout = 9 :: PolicyType -- Sets the maximum allowed vaul
630policyTypeDisablePersonalVaultExport = 10 :: PolicyType -- Disable personal vault export
682policyTypeDisablePersonalVaultExport = 10 :: PolicyType -- Disable personal vault export
632−type PolicyType
684+type PolicyType = Int
635−type SendResponse
686+type SendResponse =
636− = { id :: String
687+ { id :: String
637− , accessId :: JNullable String
688+ , accessId :: JNullable String
638− , type :: SendType
689+ , type :: SendType
639− , name :: JNullable String
690+ , name :: JNullable String
640− , notes :: JNullable String
691+ , notes :: JNullable String
641− , file :: JNullable SendFileApi
692+ , file :: JNullable SendFileApi
642− , text :: JNullable SendTextApi
693+ , text :: JNullable SendTextApi
643− , key :: JNullable String
694+ , key :: JNullable String
644− , maxAccessCount :: JNullable Int
695+ , maxAccessCount :: JNullable Int
645− , accessCount :: JNullable Int
696+ , accessCount :: JNullable Int
646− , revisionDate :: JNullable String
697+ , revisionDate :: JNullable String
647− , expirationDate :: JNullable String
698+ , expirationDate :: JNullable String
648− , deletionDate :: JNullable String
699+ , deletionDate :: JNullable String
649− , password :: JNullable String
700+ , password :: JNullable String
650− , disable :: Boolean
701+ , disable :: Boolean
651− , hideEmail :: Boolean
702+ , hideEmail :: Boolean
654sendTypeText = 0 :: SendType
705sendTypeText = 0 :: SendType
656sendTypeFile = 1 :: SendType
707sendTypeFile = 1 :: SendType
658−type SendType
709+type SendType = Int
713+ , fileName :: JNullable String
714+ , size :: JNullable String
715+ , sizeName :: JNullable String
661−type SendFileApi
718+type SendTextApi =
663− , fileName :: JNullable String
719+ { text :: JNullable String
664− , size :: JNullable String
720+ , hidden :: Boolean
665− , sizeName :: JNullable String
668−type SendTextApi
723+type TwoFactorEmailRequest =
669− = { text :: JNullable String
724+ { email :: Email
670− , hidden :: Boolean
725+ , masterPasswordHash :: StringHash