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