@fragus/sam-types 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.4",
2
+ "version": "1.2.6",
3
3
  "name": "@fragus/sam-types",
4
4
  "description": "Typescript interfaces for all types used to communicate between SAM client(s) and the SAM API",
5
5
  "author": "Fragus",
@@ -1,4 +1,3 @@
1
- import { IAdminCustomer } from '../../admin/customer/customer'
2
1
  import { IApiOtherWithContracts } from '../../admin/product'
3
2
  import { IApiVehicleWithContracts } from '../../admin/vehicle'
4
3
  import { IsoLocale } from '../../locale'
@@ -35,8 +34,6 @@ export interface IContractProviderInfo extends IEssentialContractProviderInfo {
35
34
  isUseV4PTOnlyForSigning: boolean
36
35
  fragusInvoicing?: boolean
37
36
  isInternalUse?: boolean
38
- /** Set only while internal use is on. */
39
- fixedCustomer?: IAdminCustomer | null
40
37
  }
41
38
 
42
39
  export interface ICreateTestContractProvider {
@@ -7,6 +7,15 @@ export interface IAdminUserInfo {
7
7
  email: string
8
8
  }
9
9
 
10
+ /**
11
+ * When the logged-in user's password was last set and when it expires, as ISO dates. Both are null for a password
12
+ * set before expiry was introduced and not dated yet, which never expires.
13
+ */
14
+ export interface IPasswordStatus {
15
+ changedAt: string | null
16
+ expiresAt: string | null
17
+ }
18
+
10
19
  export interface IUserPasswordChangeRequest {
11
20
  password: string
12
21
  newPassword: string
@@ -9,6 +9,15 @@ export interface ApiError {
9
9
  messageReplacements?: { [key in string]: string }
10
10
  }
11
11
 
12
+ /**
13
+ * The answer to a login whose password has expired. The token is a reset-password token, so the app can send the user
14
+ * to its reset-password page to choose a new one.
15
+ */
16
+ export interface IPasswordExpiredError {
17
+ message: 'PASSWORD_EXPIRED'
18
+ resetToken: string
19
+ }
20
+
12
21
  export interface INoContractsAvailableErrorParams {
13
22
  matchedData: VehiclePartial
14
23
  lookupCountry: null | {
@@ -4,3 +4,9 @@ export type PasswordErrors =
4
4
  | 'WRONG_CURRENT_PASSWORD'
5
5
  | 'WRONG_PASSWORD'
6
6
  | 'MISSING_PASSWORD'
7
+ /** Login refused because the password is over a year old; see IPasswordExpiredError. */
8
+ | 'PASSWORD_EXPIRED'
9
+ /** A new password refused for being a common one, or for containing the user's email or name. */
10
+ | 'PASSWORD_TOO_COMMON'
11
+ /** A new password refused for being the same as the current one. */
12
+ | 'PASSWORD_UNCHANGED'
package/types/user.d.ts CHANGED
@@ -7,4 +7,6 @@ export interface IUserResponse {
7
7
  contactPerson: IContactPersonResponse
8
8
  userRole: UserRole
9
9
  disabledAt: Date | null
10
+ /** Failed logins since the last successful one. */
11
+ failedLoginAttempts?: number
10
12
  }