@@ -0,0 +1,212 @@
5+import Data.Date (Date)
6+import Data.List (List)
7+import Data.Nullable (Nullable)
9+kdfPBKDF2_SHA256 = 0 :: KDF
12+type PreloginResponse = {
17+type PreloginRequest = {
21+type ProfileResponse = {
25+ emailVerified :: Boolean,
26+ masterPasswordHint :: String,
27+ premiumPersonally :: Boolean,
28+ premiumFromOrganization :: Boolean,
30+ twoFactorEnabled :: Boolean,
32+ privateKey :: String,
33+ securityStamp :: String,
34+ forcePasswordReset :: Boolean,
35+ usesKeyConnector :: Boolean,
36+ organizations :: List ProfileOrganizationResponse,
37+ providers :: List ProfileProviderResponse,
38+ providerOrganizations :: List ProfileProviderOrganizationResponse
41+type ProfileOrganizationResponse = {
44+ usePolicies :: Boolean,
45+ useGroups :: Boolean,
46+ useDirectory :: Boolean,
47+ useEvents :: Boolean,
52+ useKeyConnector :: Boolean,
53+ useResetPassword :: Boolean,
55+ usersGetPremium :: Boolean,
57+ maxCollections :: Int,
58+ maxStorageGb :: Nullable Int,
60+ hasPublicAndPrivateKeys :: Boolean,
61+ status :: OrganizationUserStatusType,
62+ type :: OrganizationUserType,
65+ identifier :: String,
66+ permissions :: PermissionsApi,
67+ resetPasswordEnrolled :: Boolean,
69+ providerId :: String,
70+ providerName :: String,
71+ familySponsorshipFriendlyName :: String,
72+ familySponsorshipAvailable :: Boolean,
73+ planProductType :: ProductType,
74+ keyConnectorEnabled :: Boolean,
75+ keyConnectorUrl :: String,
76+ familySponsorshipLastSyncDate :: Nullable Date,
77+ familySponsorshipValidUntil :: Nullable Date,
78+ familySponsorshipToDelete :: Nullable Boolean
81+organizationUserStatusTypeInvited = 0 :: OrganizationUserStatusType
82+organizationUserStatusTypeAccepted = 0 :: OrganizationUserStatusType
83+organizationUserStatusTypeConfirmed = 0 :: OrganizationUserStatusType
84+type OrganizationUserStatusType = Int
86+organizationUserTypeOwner = 0 :: OrganizationUserType
87+organizationUserTypeAdmin = 1 :: OrganizationUserType
88+organizationUserTypeUser = 2 :: OrganizationUserType
89+organizationUserTypeManager = 3 :: OrganizationUserType
90+organizationUserTypeCustom = 4 :: OrganizationUserType
91+type OrganizationUserType = Int
93+type PermissionsApi = {
94+ accessEventLogs :: Boolean,
95+ accessImportExport :: Boolean,
96+ accessReports :: Boolean,
97+ manageAllCollections :: Boolean,
98+ createNewCollections :: Boolean,
99+ editAnyCollection :: Boolean,
100+ deleteAnyCollection :: Boolean,
101+ manageAssignedCollections :: Boolean,
102+ editAssignedCollections :: Boolean,
103+ deleteAssignedCollections :: Boolean,
104+ manageCiphers :: Boolean,
105+ manageGroups :: Boolean,
106+ manageSso :: Boolean,
107+ managePolicies :: Boolean,
108+ manageUsers :: Boolean,
109+ manageResetPassword :: Boolean
112+productTypeFree = 0 :: ProductType
113+productTypeFamilies = 1 :: ProductType
114+productTypeTeams = 2 :: ProductType
115+productTypeEnterprise = 3 :: ProductType
116+type ProductType = Int
118+type ProfileProviderResponse = {
122+ status :: ProviderUserStatusType,
123+ type :: ProviderUserType,
125+ permissions :: PermissionsApi,
127+ useEvents :: Boolean
130+providerUserStatusTypeInvited = 0 :: ProviderUserStatusType
131+providerUserStatusTypeAccepted = 1 :: ProviderUserStatusType
132+providerUserStatusTypeConfirmed = 2 :: ProviderUserStatusType
133+type ProviderUserStatusType = Int
135+providerUserTypeProviderAdmin = 0 :: ProviderUserType
136+providerUserTypeServiceUser = 1 :: ProviderUserType
137+type ProviderUserType = Int
139+type ProfileProviderOrganizationResponse = {
142+ usePolicies :: Boolean,
143+ useGroups :: Boolean,
144+ useDirectory :: Boolean,
145+ useEvents :: Boolean,
150+ useKeyConnector :: Boolean,
151+ useResetPassword :: Boolean,
152+ selfHost :: Boolean,
153+ usersGetPremium :: Boolean,
155+ maxCollections :: Int,
156+ maxStorageGb :: Nullable Int,
158+ hasPublicAndPrivateKeys :: Boolean,
159+ status :: OrganizationUserStatusType,
160+ type :: OrganizationUserType,
162+ ssoBound :: Boolean,
163+ identifier :: String,
164+ permissions :: PermissionsApi,
165+ resetPasswordEnrolled :: Boolean,
167+ providerId :: String,
168+ providerName :: String,
169+ familySponsorshipFriendlyName :: String,
170+ familySponsorshipAvailable :: Boolean,
171+ planProductType :: ProductType,
172+ keyConnectorEnabled :: Boolean,
173+ keyConnectorUrl :: String,
174+ familySponsorshipLastSyncDate :: Nullable Date,
175+ familySponsorshipValidUntil :: Nullable Date,
176+ familySponsorshipToDelete :: Nullable Boolean
180+ base :: Nullable String,
181+ webVault :: Nullable String,
182+ api :: Nullable String,
183+ identity :: Nullable String,
184+ icons :: Nullable String,
185+ notifications :: Nullable String,
186+ events :: Nullable String,
187+ keyConnector :: Nullable String
190+type PasswordTokenRequest = {
192+ masterPasswordHash :: String,
193+ captchaResponse :: String,
194+ twoFactor :: TokenRequestTwoFactor,
195+ device :: Nullable Unit -- we won't use this, so leave this null
198+type TokenRequestTwoFactor = {
199+ provider :: TwoFactorProviderType,
204+twoFactorProviderTypeAuthenticator = 0 :: TwoFactorProviderType
205+twoFactorProviderTypeEmail = 1 :: TwoFactorProviderType
206+twoFactorProviderTypeDuo = 2 :: TwoFactorProviderType
207+twoFactorProviderTypeYubikey = 3 :: TwoFactorProviderType
208+twoFactorProviderTypeU2f = 4 :: TwoFactorProviderType
209+twoFactorProviderTypeRemember = 5 :: TwoFactorProviderType
210+twoFactorProviderTypeOrganizationDuo = 6 :: TwoFactorProviderType
211+twoFactorProviderTypeWebAuthn = 7 :: TwoFactorProviderType
212+type TwoFactorProviderType = Int