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