@@ -4,25 +4,22 @@ import Prelude
44
55import Bridge as Bridge
66import Data.Argonaut (class DecodeJson, class EncodeJson)
7−import Data.Either (Either)
8−import Data.Either as Either
9−import Data.Int as Int
107import Data.JNullable (JNullable)
118import Data.JOpt (JOpt)
129import Data.Maybe (Maybe(..))
13−import Data.Nullable (Nullable)
1410import Data.ShowableJson (ShowableJson)
1511import Data.Timestamp (Timestamp)
16−import Data.Traversable (for)
17−import Data.Tuple.Nested ((/\))
12+import Data.Traversable (traverse)
13+import Foreign (Foreign)
1814import Foreign as Foreign
15+import Foreign.Object (Object)
1916import Literals.Undefined (Undefined)
2017import Type.Prelude (Proxy(..))
21−import Untagged.TypeCheck (class HasRuntimeType)
18+import Untagged.TypeCheck (class HasRuntimeType, hasRuntimeType)
2219import Untagged.Union (type (|+|))
23−import Untagged.Union as Union
2420
25−newtype EncryptedString = EncryptedString String
21+newtype EncryptedString
22+ = EncryptedString String
2623
2724derive newtype instance Show EncryptedString
2825derive newtype instance Ord EncryptedString
@@ -31,86 +28,78 @@ derive newtype instance EncodeJson EncryptedString
3128derive newtype instance DecodeJson EncryptedString
3229
3330kdfPBKDF2_SHA256 = 0 :: KDF
34−kdfArgon2id = 1 :: KDF
3531
36−type KDF = Int
37−
38−type PreloginResponse =
39− { kdf :: KDF
40− , kdfIterations :: Int
41− , kdfMemory :: JNullable Int
42− , kdfParallelism :: JNullable Int
43− }
44−
45−type KdfConfig =
46− { iterations :: Int
47− , memory :: JNullable Int
48− , parallelism :: JNullable Int
49− }
50−
51−type PreloginRequest =
52− { email :: Email
53− }
54−
55−type ProfileResponse =
56− { id :: String
57− , name :: JNullable String
58− , email :: String
59− , emailVerified :: Boolean
60− , masterPasswordHint :: JNullable String
61− -- , premiumPersonally :: Boolean
62− -- , premiumFromOrganization :: Boolean
63− , culture :: JNullable String
64− , twoFactorEnabled :: Boolean
65− , key :: EncryptedString
66− , privateKey :: EncryptedString
67− , securityStamp :: JNullable String
68− , forcePasswordReset :: Boolean
69− , usesKeyConnector :: Boolean
70− -- , organizations :: Array ProfileOrganizationResponse
71− , providers :: Array ProfileProviderResponse
72− , providerOrganizations :: Array ProfileProviderOrganizationResponse
73− }
74−
75−type ProfileOrganizationResponse =
76− { id :: String
77− , name :: JNullable String
78− , usePolicies :: JNullable Boolean
79− , useGroups :: JNullable Boolean
80− , useDirectory :: JNullable Boolean
81− , useEvents :: JNullable Boolean
82− , useTotp :: JNullable Boolean
83− , use2fa :: JNullable Boolean
84− , useApi :: JNullable Boolean
85− , useSso :: JNullable Boolean
86− , useKeyConnector :: JNullable Boolean
87− , useResetPassword :: JNullable Boolean
88− , selfHost :: JNullable Boolean
89− , usersGetPremium :: JNullable Boolean
90− , seats :: JNullable Int
91− , maxCollections :: JNullable Int
92− , maxStorageGb :: JNullable Int
93− , key :: JNullable String
94− , hasPublicAndPrivateKeys :: JNullable Boolean
95− , status :: JNullable OrganizationUserStatusType
96− , type :: JNullable OrganizationUserType
97− , enabled :: JNullable Boolean
98− , ssoBound :: JNullable Boolean
99− , identifier :: JNullable String
100− , permissions :: JNullable PermissionsApi
101− , resetPasswordEnrolled :: JNullable Boolean
102− , userId :: JNullable String
103− , providerId :: JNullable String
104− , providerName :: JNullable String
105− , familySponsorshipFriendlyName :: JNullable String
106− , familySponsorshipAvailable :: JNullable Boolean
107− , planProductType :: JNullable ProductType
108− , keyConnectorEnabled :: JNullable Boolean
109− , keyConnectorUrl :: JNullable String
110− , familySponsorshipLastSyncDate :: JNullable Timestamp
111− , familySponsorshipValidUntil :: JNullable Timestamp
112− , familySponsorshipToDelete :: JNullable Boolean
113− }
32+type KDF
33+ = Int
34+
35+type PreloginResponse
36+ = { kdf :: KDF
37+ , kdfIterations :: Int
38+ }
39+
40+type PreloginRequest
41+ = { email :: Email
42+ }
43+
44+type ProfileResponse
45+ = { id :: String
46+ , name :: JNullable String
47+ , email :: String
48+ , emailVerified :: Boolean
49+ , masterPasswordHint :: JNullable String
50+ , premiumPersonally :: Boolean
51+ -- , premiumFromOrganization :: Boolean
52+ , culture :: JNullable String
53+ , twoFactorEnabled :: Boolean
54+ , key :: EncryptedString
55+ , privateKey :: EncryptedString
56+ , securityStamp :: JNullable String
57+ , forcePasswordReset :: Boolean
58+ , usesKeyConnector :: Boolean
59+ , organizations :: Array ProfileOrganizationResponse
60+ , providers :: Array ProfileProviderResponse
61+ , providerOrganizations :: Array ProfileProviderOrganizationResponse
62+ }
63+
64+type ProfileOrganizationResponse
65+ = { id :: String
66+ , name :: JNullable String
67+ , usePolicies :: JNullable Boolean
68+ , useGroups :: JNullable Boolean
69+ , useDirectory :: JNullable Boolean
70+ , useEvents :: JNullable Boolean
71+ , useTotp :: JNullable Boolean
72+ , use2fa :: JNullable Boolean
73+ , useApi :: JNullable Boolean
74+ , useSso :: JNullable Boolean
75+ , useKeyConnector :: JNullable Boolean
76+ , useResetPassword :: JNullable Boolean
77+ , selfHost :: JNullable Boolean
78+ , usersGetPremium :: JNullable Boolean
79+ , seats :: JNullable Int
80+ , maxCollections :: JNullable Int
81+ , maxStorageGb :: JNullable Int
82+ , key :: JNullable String
83+ , hasPublicAndPrivateKeys :: JNullable Boolean
84+ , status :: JNullable OrganizationUserStatusType
85+ , type :: JNullable OrganizationUserType
86+ , enabled :: JNullable Boolean
87+ , ssoBound :: JNullable Boolean
88+ , identifier :: JNullable String
89+ , permissions :: JNullable PermissionsApi
90+ , resetPasswordEnrolled :: JNullable Boolean
91+ , userId :: JNullable String
92+ , providerId :: JNullable String
93+ , providerName :: JNullable String
94+ , familySponsorshipFriendlyName :: JNullable String
95+ , familySponsorshipAvailable :: JNullable Boolean
96+ , planProductType :: JNullable ProductType
97+ , keyConnectorEnabled :: JNullable Boolean
98+ , keyConnectorUrl :: JNullable String
99+ , familySponsorshipLastSyncDate :: JNullable Timestamp
100+ , familySponsorshipValidUntil :: JNullable Timestamp
101+ , familySponsorshipToDelete :: JNullable Boolean
102+ }
114103
115104organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
116105
@@ -118,7 +107,8 @@ organizationUserStatusTypeAccepted = 0 :: OrganizationUserStatusType
118107
119108organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
120109
121−type OrganizationUserStatusType = Int
110+type OrganizationUserStatusType
111+ = Int
122112
123113organizationUserTypeOwner = 0 :: OrganizationUserType
124114
@@ -130,26 +120,27 @@ organizationUserTypeManager = 3 :: OrganizationUserType
130120
131121organizationUserTypeCustom = 4 :: OrganizationUserType
132122
133−type OrganizationUserType = Int
134−
135−type PermissionsApi =
136− { accessEventLogs :: Boolean
137− , accessImportExport :: Boolean
138− , accessReports :: Boolean
139− , manageAllCollections :: Boolean
140− , createNewCollections :: Boolean
141− , editAnyCollection :: Boolean
142− , deleteAnyCollection :: Boolean
143− , manageAssignedCollections :: Boolean
144− , editAssignedCollections :: Boolean
145− , deleteAssignedCollections :: Boolean
146− , manageCiphers :: Boolean
147− , manageGroups :: Boolean
148− , manageSso :: Boolean
149− , managePolicies :: Boolean
150− , manageUsers :: Boolean
151− , manageResetPassword :: Boolean
152− }
123+type OrganizationUserType
124+ = Int
125+
126+type PermissionsApi
127+ = { accessEventLogs :: Boolean
128+ , accessImportExport :: Boolean
129+ , accessReports :: Boolean
130+ , manageAllCollections :: Boolean
131+ , createNewCollections :: Boolean
132+ , editAnyCollection :: Boolean
133+ , deleteAnyCollection :: Boolean
134+ , manageAssignedCollections :: Boolean
135+ , editAssignedCollections :: Boolean
136+ , deleteAssignedCollections :: Boolean
137+ , manageCiphers :: Boolean
138+ , manageGroups :: Boolean
139+ , manageSso :: Boolean
140+ , managePolicies :: Boolean
141+ , manageUsers :: Boolean
142+ , manageResetPassword :: Boolean
143+ }
153144
154145productTypeFree = 0 :: ProductType
155146
@@ -159,19 +150,20 @@ productTypeTeams = 2 :: ProductType
159150
160151productTypeEnterprise = 3 :: ProductType
161152
162−type ProductType = Int
163−
164−type ProfileProviderResponse =
165− { id :: String
166− , name :: JNullable String
167− , key :: JNullable String
168− , status :: JNullable ProviderUserStatusType
169− , type :: JNullable ProviderUserType
170− , enabled :: Boolean
171− , permissions :: PermissionsApi
172− , userId :: JNullable String
173− , useEvents :: Boolean
174− }
153+type ProductType
154+ = Int
155+
156+type ProfileProviderResponse
157+ = { id :: String
158+ , name :: JNullable String
159+ , key :: JNullable String
160+ , status :: JNullable ProviderUserStatusType
161+ , type :: JNullable ProviderUserType
162+ , enabled :: Boolean
163+ , permissions :: PermissionsApi
164+ , userId :: JNullable String
165+ , useEvents :: Boolean
166+ }
175167
176168providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
177169
@@ -179,79 +171,81 @@ providerUserStatusTypeAccepted = 1 :: ProviderUserStatusType
179171
180172providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
181173
182−type ProviderUserStatusType = Int
174+type ProviderUserStatusType
175+ = Int
183176
184177providerUserTypeProviderAdmin = 0 :: ProviderUserType
185178
186179providerUserTypeServiceUser = 1 :: ProviderUserType
187180
188−type ProviderUserType = Int
189−
190−type ProfileProviderOrganizationResponse =
191− { id :: String
192− , name :: JNullable String
193− , usePolicies :: Boolean
194− , useGroups :: Boolean
195− , useDirectory :: Boolean
196− , useEvents :: Boolean
197− , useTotp :: Boolean
198− , use2fa :: Boolean
199− , useApi :: Boolean
200− , useSso :: Boolean
201− , useKeyConnector :: Boolean
202− , useResetPassword :: Boolean
203− , selfHost :: Boolean
204− , usersGetPremium :: Boolean
205− , seats :: Int
206− , maxCollections :: Int
207− , maxStorageGb :: JNullable Int
208− , key :: JNullable String
209− , hasPublicAndPrivateKeys :: Boolean
210− , status :: OrganizationUserStatusType
211− , type :: OrganizationUserType
212− , enabled :: Boolean
213− , ssoBound :: Boolean
214− , identifier :: JNullable String
215− , permissions :: PermissionsApi
216− , resetPasswordEnrolled :: Boolean
217− , userId :: JNullable String
218− , providerId :: JNullable String
219− , providerName :: JNullable String
220− , familySponsorshipFriendlyName :: JNullable String
221− , familySponsorshipAvailable :: Boolean
222− , planProductType :: ProductType
223− , keyConnectorEnabled :: Boolean
224− , keyConnectorUrl :: JNullable String
225− , familySponsorshipLastSyncDate :: JNullable Timestamp
226− , familySponsorshipValidUntil :: JNullable Timestamp
227− , familySponsorshipToDelete :: JNullable Boolean
228− }
229−
230−type Urls =
231− { base :: JNullable String
232− , webVault :: JNullable String
233− , api :: JNullable String
234− , identity :: JNullable String
235− , icons :: JNullable String
236− , notifications :: JNullable String
237− , events :: JNullable String
238− , keyConnector :: JNullable String
239− }
240−
241−type PasswordTokenRequest =
242− { email :: Email
243− , masterPasswordHash :: String
244− , captchaResponse :: String
245− , twoFactor :: TokenRequestTwoFactor
246− , device :: DeviceRequest
247− }
248−
249−type DeviceRequest =
250− { type :: DeviceType
251− , name :: String
252− , identifier :: String
253− , pushToken :: JNullable String
254− }
181+type ProviderUserType
182+ = Int
183+
184+type ProfileProviderOrganizationResponse
185+ = { id :: String
186+ , name :: JNullable String
187+ , usePolicies :: Boolean
188+ , useGroups :: Boolean
189+ , useDirectory :: Boolean
190+ , useEvents :: Boolean
191+ , useTotp :: Boolean
192+ , use2fa :: Boolean
193+ , useApi :: Boolean
194+ , useSso :: Boolean
195+ , useKeyConnector :: Boolean
196+ , useResetPassword :: Boolean
197+ , selfHost :: Boolean
198+ , usersGetPremium :: Boolean
199+ , seats :: Int
200+ , maxCollections :: Int
201+ , maxStorageGb :: JNullable Int
202+ , key :: JNullable String
203+ , hasPublicAndPrivateKeys :: Boolean
204+ , status :: OrganizationUserStatusType
205+ , type :: OrganizationUserType
206+ , enabled :: Boolean
207+ , ssoBound :: Boolean
208+ , identifier :: JNullable String
209+ , permissions :: PermissionsApi
210+ , resetPasswordEnrolled :: Boolean
211+ , userId :: JNullable String
212+ , providerId :: JNullable String
213+ , providerName :: JNullable String
214+ , familySponsorshipFriendlyName :: JNullable String
215+ , familySponsorshipAvailable :: Boolean
216+ , planProductType :: ProductType
217+ , keyConnectorEnabled :: Boolean
218+ , keyConnectorUrl :: JNullable String
219+ , familySponsorshipLastSyncDate :: JNullable Timestamp
220+ , familySponsorshipValidUntil :: JNullable Timestamp
221+ , familySponsorshipToDelete :: JNullable Boolean
222+ }
223+
224+type Urls
225+ = { base :: JNullable String
226+ , webVault :: JNullable String
227+ , api :: JNullable String
228+ , identity :: JNullable String
229+ , icons :: JNullable String
230+ , notifications :: JNullable String
231+ , events :: JNullable String
232+ , keyConnector :: JNullable String
233+ }
234+
235+type PasswordTokenRequest
236+ = { email :: Email
237+ , masterPasswordHash :: String
238+ , captchaResponse :: String
239+ , twoFactor :: TokenRequestTwoFactor
240+ , device :: DeviceRequest
241+ }
242+
243+type DeviceRequest
244+ = { type :: DeviceType
245+ , name :: String
246+ , identifier :: String
247+ , pushToken :: JNullable String
248+ }
255249
256250deviceTypeAndroid = 0 :: DeviceType
257251
@@ -295,13 +289,14 @@ deviceTypeVivaldiExtension = 19 :: DeviceType
295289
296290deviceTypeSafariExtension = 20 :: DeviceType
297291
298−type DeviceType = Int
292+type DeviceType
293+ = Int
299294
300−type TokenRequestTwoFactor =
301− { provider :: TwoFactorProviderType
302− , token :: String
303− , remember :: Boolean
304− }
295+type TokenRequestTwoFactor
296+ = { provider :: TwoFactorProviderType
297+ , token :: String
298+ , remember :: Boolean
299+ }
305300
306301twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
307302
@@ -319,11 +314,12 @@ twoFactorProviderTypeOrganizationDuo = 6 :: TwoFactorProviderType
319314
320315twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
321316
322−type TwoFactorProviderType = Int
317+type TwoFactorProviderType
318+ = Int
323319
324−secondFactorTypeToBridge
325− :: TwoFactorProviderType
326− -> Maybe Bridge.TwoFactorProviderType
320+secondFactorTypeToBridge ::
321+ TwoFactorProviderType ->
322+ Maybe Bridge.TwoFactorProviderType
327323secondFactorTypeToBridge x = case x of
328324 n
329325 | n == twoFactorProviderTypeAuthenticator -> Just Bridge.Authenticator
@@ -353,17 +349,21 @@ bridgeToSecondFactorType Bridge.Remember = twoFactorProviderTypeRemember
353349bridgeToSecondFactorType Bridge.OrganizationDuo = twoFactorProviderTypeOrganizationDuo
354350bridgeToSecondFactorType Bridge.WebAuthn = twoFactorProviderTypeWebAuthn
355351
356−newtype Password = Password String
352+newtype Password
353+ = Password String
357354
358355hashPurposeServerAuthorization = 1 :: HashPurpose
359356
360357hashPurposeLocalAuthorization = 2 :: HashPurpose
361358
362−type HashPurpose = Int
359+type HashPurpose
360+ = Int
363361
364−newtype StringHash = StringHash String
362+newtype StringHash
363+ = StringHash String
365364
366−newtype AccessToken = AccessToken String
365+newtype AccessToken
366+ = AccessToken String
367367
368368derive newtype instance Show AccessToken
369369derive newtype instance Eq AccessToken
@@ -371,7 +371,8 @@ derive newtype instance Ord AccessToken
371371derive newtype instance EncodeJson AccessToken
372372derive newtype instance DecodeJson AccessToken
373373
374−newtype RefreshToken = RefreshToken String
374+newtype RefreshToken
375+ = RefreshToken String
375376
376377derive newtype instance Show RefreshToken
377378derive newtype instance Eq RefreshToken
@@ -383,33 +384,27 @@ type IdentityCaptchaResponse =
383384 { siteKey :: String
384385 }
385386
386−type IdentityTokenResponse =
387− { accessToken :: AccessToken
388− , expiresIn :: Int
389− , refreshToken :: RefreshToken
390− , tokenType :: String
391− , resetMasterPassword :: Boolean
392− , privateKey :: EncryptedString
393− , key :: EncryptedString
394− , twoFactorToken :: JNullable String
395− , kdf :: KDF
396− , kdfIterations :: Int
397− , forcePasswordReset :: JNullable Boolean
398− , apiUseKeyConnector :: JNullable Boolean
399− , keyConnectorUrl :: JNullable String
400− }
401−
402−newtype TwoFactorProviderTypes = TwoFactorProviderTypes (Array (Int |+| String))
387+type IdentityTokenResponse
388+ = { accessToken :: AccessToken
389+ , expiresIn :: Int
390+ , refreshToken :: RefreshToken
391+ , tokenType :: String
392+ , resetMasterPassword :: Boolean
393+ , privateKey :: EncryptedString
394+ , key :: EncryptedString
395+ , twoFactorToken :: JNullable String
396+ , kdf :: KDF
397+ , kdfIterations :: Int
398+ , forcePasswordReset :: JNullable Boolean
399+ , apiUseKeyConnector :: JNullable Boolean
400+ , keyConnectorUrl :: JNullable String
401+ }
402+
403+newtype TwoFactorProviderTypes = TwoFactorProviderTypes (Array TwoFactorProviderType)
403404
404405instance HasRuntimeType TwoFactorProviderTypes where
405406 hasRuntimeType Proxy = Foreign.isArray
406407
407−fromTwoFactorProviderType :: TwoFactorProviderTypes -> Either String (Array Bridge.TwoFactorProviderType)
408−fromTwoFactorProviderType (TwoFactorProviderTypes xs) =
409− for xs $ \rawProvider -> do
410− providerInt <- Union.reduce (Either.Right /\ (\x -> Either.note x $ Int.fromString x)) rawProvider
411− Either.note (show providerInt) $ secondFactorTypeToBridge providerInt
412−
413408type IdentityTwoFactorResponse =
414409 { twoFactorProviders :: TwoFactorProviderTypes
415410 -- it is a Map type and untaged unions gets confused
@@ -417,57 +412,59 @@ type IdentityTwoFactorResponse =
417412 , captchaToken :: String |+| Undefined
418413 }
419414
420−newtype Email = Email String
415+newtype Email
416+ = Email String
421417
422−type SyncResponse =
423− { profile :: ProfileResponse
424− , folders :: Array FolderResponse
425− , collections :: Array CollectionDetailsResponse
426− , ciphers :: Array CipherResponse
427− , domains :: JNullable DomainsResponse
428− , policies :: JNullable (Array PolicyResponse)
429− , sends :: Array SendResponse
430− }
418+type SyncResponse
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
426+ }
431427
432−type FolderResponse =
433− { id :: String
434− , name :: JNullable String
435− , revisionDate :: JNullable String
436− }
428+type FolderResponse
429+ = { id :: String
430+ , name :: JNullable String
431+ , revisionDate :: JNullable String
432+ }
433+
434+type CollectionDetailsResponse
435+ = { id :: String
436+ , organizationId :: JNullable String
437+ , name :: JNullable String
438+ , externalId :: JNullable String
439+ , readOnly :: Boolean
440+ }
437441
438−type CollectionDetailsResponse =
439− { id :: String
440− , organizationId :: JNullable String
441− , name :: JNullable String
442− , externalId :: JNullable String
443− , readOnly :: Boolean
444− }
445442
446443type CipherId = String
447444
448−type CipherResponse =
449− { id :: CipherId
450− , organizationId :: JNullable String
451− , folderId :: JNullable String
452− , type :: CipherType
453− , name :: EncryptedString
454− , notes :: JNullable EncryptedString
455− , fields :: JNullable (Array FieldApi)
456− , login :: JNullable LoginApi
457− , card :: JNullable CardApi
458− , identity :: JNullable IdentityApi
459− , secureNote :: JNullable SecureNoteApi
460− , favorite :: Boolean
461− , edit :: JNullable Boolean
462− , viewPassword :: JNullable Boolean
463− , organizationUseTotp :: JNullable Boolean
464− , revisionDate :: JNullable Timestamp
465− , attachments :: JNullable (Array AttachmentResponse)
466− , passwordHistory :: JNullable (Array PasswordHistoryResponse)
467− , collectionIds :: JNullable (Array String)
468− , deletedDate :: JNullable String
469− , reprompt :: CipherRepromptType
470− }
445+type CipherResponse
446+ = { id :: CipherId
447+ , organizationId :: JNullable String
448+ , folderId :: JNullable String
449+ , type :: CipherType
450+ , name :: EncryptedString
451+ , notes :: JNullable EncryptedString
452+ , fields :: JNullable (Array FieldApi)
453+ , login :: JNullable LoginApi
454+ , card :: JNullable CardApi
455+ , identity :: JNullable IdentityApi
456+ , secureNote :: JNullable SecureNoteApi
457+ , favorite :: Boolean
458+ , edit :: JNullable Boolean
459+ , viewPassword :: JNullable Boolean
460+ , organizationUseTotp :: JNullable Boolean
461+ , revisionDate :: JNullable Timestamp
462+ , attachments :: JNullable (Array AttachmentResponse)
463+ , passwordHistory :: JNullable (Array PasswordHistoryResponse)
464+ , collectionIds :: JNullable (Array String)
465+ , deletedDate :: JNullable String
466+ , reprompt :: CipherRepromptType
467+ }
471468
472469cipherTypeLogin = 1 :: CipherType
473470
@@ -477,14 +474,15 @@ cipherTypeCard = 3 :: CipherType
477474
478475cipherTypeIdentity = 4 :: CipherType
479476
480−type CipherType = Int
477+type CipherType
478+ = Int
481479
482−type FieldApi =
483− { name :: JNullable String
484− , value :: JNullable String
485− , type :: FieldType
486− , linkedId :: JNullable LinkedIdType
487− }
480+type FieldApi
481+ = { name :: JNullable String
482+ , value :: JNullable String
483+ , type :: FieldType
484+ , linkedId :: JNullable LinkedIdType
485+ }
488486
489487fieldTypeText = 0 :: FieldType
490488
@@ -494,7 +492,8 @@ fieldTypeBoolean = 2 :: FieldType
494492
495493fieldTypeLinked = 3 :: FieldType
496494
497−type FieldType = Int
495+type FieldType
496+ = Int
498497
499498linkedIdTypeLoginLinkedIdUsername = 100 :: LinkedIdType
500499
@@ -550,22 +549,23 @@ linkedIdTypeIdentityLinkedIdLastName = 417 :: LinkedIdType
550549
551550linkedIdTypeIdentityLinkedIdFullName = 418 :: LinkedIdType
552551
553−type LinkedIdType = Int
552+type LinkedIdType
553+ = Int
554554
555−type LoginApi =
556− { uris :: JOpt (Array LoginUriApi)
557− , username :: JNullable EncryptedString
558− , password :: JNullable EncryptedString
559− , passwordRevisionDate :: JNullable String
560− , totp :: JNullable EncryptedString
561− -- This thing is undefined in some cases for some reson. Just ignoring it
562− , autofillOnPageLoad :: JOpt (JNullable Boolean)
563− }
555+type LoginApi
556+ = { uris :: JOpt (Array LoginUriApi)
557+ , username :: JNullable EncryptedString
558+ , password :: JNullable EncryptedString
559+ , passwordRevisionDate :: JNullable String
560+ , totp :: JNullable EncryptedString
561+ -- This thing is undefined in some cases for some reson. Just ignoring it
562+ , autofillOnPageLoad :: JOpt (JNullable Boolean)
563+ }
564564
565−type LoginUriApi =
566− { uri :: JNullable EncryptedString
567− , match :: JNullable UriMatchType
568− }
565+type LoginUriApi
566+ = { uri :: EncryptedString
567+ , match :: JNullable UriMatchType
568+ }
569569
570570uriMatchTypeDomain = 0 :: UriMatchType
571571
@@ -579,85 +579,87 @@ uriMatchTypeRegularExpression = 4 :: UriMatchType
579579
580580uriMatchTypeNever = 5 :: UriMatchType
581581
582−type UriMatchType = Int
583−
584−type CardApi =
585− { cardholderName :: JNullable EncryptedString
586− , brand :: JNullable EncryptedString
587− , number :: JNullable EncryptedString
588− , expMonth :: JNullable EncryptedString
589− , expYear :: JNullable EncryptedString
590− , code :: JNullable EncryptedString
591− }
592−
593−type IdentityApi =
594− { title :: JNullable EncryptedString
595− , firstName :: JNullable EncryptedString
596− , middleName :: JNullable EncryptedString
597− , lastName :: JNullable EncryptedString
598− , address1 :: JNullable EncryptedString
599− , address2 :: JNullable EncryptedString
600− , address3 :: JNullable EncryptedString
601− , city :: JNullable EncryptedString
602− , state :: JNullable EncryptedString
603− , postalCode :: JNullable EncryptedString
604− , country :: JNullable EncryptedString
605− , company :: JNullable EncryptedString
606− , email :: JNullable EncryptedString
607− , phone :: JNullable EncryptedString
608− , ssn :: JNullable EncryptedString
609− , username :: JNullable EncryptedString
610− , passportNumber :: JNullable EncryptedString
611− , licenseNumber :: JNullable EncryptedString
612− }
582+type UriMatchType
583+ = Int
584+
585+type CardApi
586+ = { cardholderName :: JNullable EncryptedString
587+ , brand :: JNullable EncryptedString
588+ , number :: JNullable EncryptedString
589+ , expMonth :: JNullable EncryptedString
590+ , expYear :: JNullable EncryptedString
591+ , code :: JNullable EncryptedString
592+ }
593+
594+type IdentityApi
595+ = { title :: JNullable EncryptedString
596+ , firstName :: JNullable EncryptedString
597+ , middleName :: JNullable EncryptedString
598+ , lastName :: JNullable EncryptedString
599+ , address1 :: JNullable EncryptedString
600+ , address2 :: JNullable EncryptedString
601+ , address3 :: JNullable EncryptedString
602+ , city :: JNullable EncryptedString
603+ , state :: JNullable EncryptedString
604+ , postalCode :: JNullable EncryptedString
605+ , country :: JNullable EncryptedString
606+ , company :: JNullable EncryptedString
607+ , email :: JNullable EncryptedString
608+ , phone :: JNullable EncryptedString
609+ , ssn :: JNullable EncryptedString
610+ , username :: JNullable EncryptedString
611+ , passportNumber :: JNullable EncryptedString
612+ , licenseNumber :: JNullable EncryptedString
613+ }
613614
614615secureNoteTypeGeneric = 0 :: SecureNoteType
615616
616−type SecureNoteType = Int
617+type SecureNoteType
618+ = Int
617619
618−type SecureNoteApi =
619− {
620− -- type :: SecureNoteType
621− }
620+type SecureNoteApi = {
621+ type :: SecureNoteType
622+}
622623
623−type AttachmentResponse =
624− { id :: String
625− , url :: JNullable String
626− , fileName :: JNullable String
627− , key :: JNullable String
628− , size :: JNullable String
629− , sizeName :: JNullable String
630− }
624+type AttachmentResponse
625+ = { id :: String
626+ , url :: JNullable String
627+ , fileName :: JNullable String
628+ , key :: JNullable String
629+ , size :: JNullable String
630+ , sizeName :: JNullable String
631+ }
631632
632−type PasswordHistoryResponse =
633− { password :: String
634− , lastUsedDate :: JNullable String
635− }
633+type PasswordHistoryResponse
634+ = { password :: String
635+ , lastUsedDate :: JNullable String
636+ }
636637
637638cipherRepromptTypeNone = 0 :: CipherRepromptType
638639
639640cipherRepromptTypePassword = 1 :: CipherRepromptType
640641
641−type CipherRepromptType = Int
642+type CipherRepromptType
643+ = Int
642644
643−type DomainsResponse =
644− { equivalentDomains :: Array (Array String)
645− , globalEquivalentDomains :: Array GlobalDomainResponse
646− }
645+type DomainsResponse
646+ = { equivalentDomains :: Array (Array String)
647+ , globalEquivalentDomains :: Array GlobalDomainResponse
648+ }
647649
648−type GlobalDomainResponse =
649− { type :: Int
650− , domains :: Array String
651− , excluded :: Boolean
652− }
650+type GlobalDomainResponse
651+ = { type :: Int
652+ , domains :: Array String
653+ , excluded :: Boolean
654+ }
653655
654−type PolicyResponse =
655− { id :: String
656− , organizationId :: JNullable String
657− , type :: PolicyType
658− , data :: ShowableJson
659− , enabled :: Boolean
660− }
656+type PolicyResponse
657+ = { id :: String
658+ , organizationId :: JNullable String
659+ , type :: PolicyType
660+ , data :: ShowableJson
661+ , enabled :: Boolean
662+ }
661663
662664policyTypeTwoFactorAuthentication = 0 :: PolicyType -- Requires users to have 2fa enabled
663665
@@ -681,44 +683,46 @@ policyTypeMaximumVaultTimeout = 9 :: PolicyType -- Sets the maximum allowed vaul
681683
682684policyTypeDisablePersonalVaultExport = 10 :: PolicyType -- Disable personal vault export
683685
684−type PolicyType = Int
685−
686−type SendResponse =
687− { id :: String
688− , accessId :: JNullable String
689− , type :: SendType
690− , name :: JNullable String
691− , notes :: JNullable String
692− , file :: JNullable SendFileApi
693− , text :: JNullable SendTextApi
694− , key :: JNullable String
695− , maxAccessCount :: JNullable Int
696− , accessCount :: JNullable Int
697− , revisionDate :: JNullable String
698− , expirationDate :: JNullable String
699− , deletionDate :: JNullable String
700− , password :: JNullable String
701− , disable :: Boolean
702− , hideEmail :: Boolean
703− }
686+type PolicyType
687+ = Int
688+
689+type SendResponse
690+ = { id :: String
691+ , accessId :: JNullable String
692+ , type :: SendType
693+ , name :: JNullable String
694+ , notes :: JNullable String
695+ , file :: JNullable SendFileApi
696+ , text :: JNullable SendTextApi
697+ , key :: JNullable String
698+ , maxAccessCount :: JNullable Int
699+ , accessCount :: JNullable Int
700+ , revisionDate :: JNullable String
701+ , expirationDate :: JNullable String
702+ , deletionDate :: JNullable String
703+ , password :: JNullable String
704+ , disable :: Boolean
705+ , hideEmail :: Boolean
706+ }
704707
705708sendTypeText = 0 :: SendType
706709
707710sendTypeFile = 1 :: SendType
708711
709−type SendType = Int
712+type SendType
713+ = Int
710714
711−type SendFileApi =
712− { id :: String
713− , fileName :: JNullable String
714− , size :: JNullable String
715− , sizeName :: JNullable String
716− }
715+type SendFileApi
716+ = { id :: String
717+ , fileName :: JNullable String
718+ , size :: JNullable String
719+ , sizeName :: JNullable String
720+ }
717721
718−type SendTextApi =
719− { text :: JNullable String
720− , hidden :: Boolean
721− }
722+type SendTextApi
723+ = { text :: JNullable String
724+ , hidden :: Boolean
725+ }
722726
723727type TwoFactorEmailRequest =
724728 { email :: Email