@gls_spain/gps-common 35.1.9 → 35.1.11

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [35.1.11](https://github.com/GLS-Spain/gps-common/compare/v35.1.10...v35.1.11) (2024-06-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add new field to create and update passwordExpired ([46b9377](https://github.com/GLS-Spain/gps-common/commit/46b937794278182051b912bbaea1e5009011d662))
7
+
8
+ ## [35.1.10](https://github.com/GLS-Spain/gps-common/compare/v35.1.9...v35.1.10) (2024-06-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add new error "password must be diferent from the previus" for force change pass PS ([86c918e](https://github.com/GLS-Spain/gps-common/commit/86c918e73c19f406ee938a33d2db5754f60cd52a))
14
+
1
15
  ## [35.1.9](https://github.com/GLS-Spain/gps-common/compare/v35.1.8...v35.1.9) (2024-06-11)
2
16
 
3
17
 
@@ -0,0 +1,11 @@
1
+ const { DatabaseError } = require('./DatabaseError');
2
+
3
+ class WrongSamePasswordBefore extends DatabaseError {
4
+ constructor(message = 'The password must be different from the previous password') {
5
+ // noinspection JSCheckFunctionSignatures
6
+ super(message);
7
+ this.name = 'WrongSamePasswordBefore';
8
+ }
9
+ }
10
+
11
+ module.exports = WrongSamePasswordBefore;
package/errors/index.js CHANGED
@@ -16,6 +16,7 @@ const ShopCannotSellError = require('./ShopCannotSellError');
16
16
  const ShopNotEnabledError = require('./ShopNotEnabledError');
17
17
  const WrongShopError = require('./WrongShopError');
18
18
  const WrongPasswordError = require('./WrongPasswordError');
19
+ const WrongSamePasswordBefore = require('./WrongSamePasswordBefore');
19
20
  const ExpeditionDoesNotExistError = require('./ExpeditionDoesNotExistError');
20
21
  const ExpeditionAlreadyExistsError = require('./ExpeditionAlreadyExistsError');
21
22
  const ExpeditionCannotBeUpdatedError = require('./ExpeditionCannotBeUpdatedError');
@@ -58,6 +59,7 @@ const errorsNames = {
58
59
  ShopNotEnabledError: 'ShopNotEnabledError',
59
60
  WrongShopError: 'WrongShopError',
60
61
  WrongPasswordError: 'WrongPasswordError',
62
+ WrongSamePasswordBefore: 'WrongSamePasswordBefore',
61
63
  ExpeditionDoesNotExistError: 'ExpeditionDoesNotExistError',
62
64
  ExpeditionAlreadyExistsError: 'ExpeditionAlreadyExistsError',
63
65
  ExpeditionCannotBeUpdatedError: 'ExpeditionCannotBeUpdatedError',
@@ -101,6 +103,7 @@ module.exports = {
101
103
  ShopNotEnabledError,
102
104
  WrongShopError,
103
105
  WrongPasswordError,
106
+ WrongSamePasswordBefore,
104
107
  ExpeditionDoesNotExistError,
105
108
  ExpeditionAlreadyExistsError,
106
109
  ExpeditionCannotBeUpdatedError,
@@ -27,6 +27,7 @@ const {
27
27
  ShopCannotSellError,
28
28
  ShopNotEnabledError,
29
29
  WrongPasswordError,
30
+ WrongSamePasswordBefore,
30
31
  ExpeditionDoesNotExistError,
31
32
  ExpeditionAlreadyExistsError,
32
33
  ExpeditionCannotBeUpdatedError,
@@ -915,6 +916,7 @@ const errors = {
915
916
  shopCannotSell: new ShopCannotSellError(),
916
917
  shopNotEnabled: new ShopNotEnabledError(),
917
918
  wrongPassword: new WrongPasswordError(),
919
+ wrongSamePasswordBefore: new WrongSamePasswordBefore(),
918
920
  expeditionDoesNotExist: new ExpeditionDoesNotExistError(),
919
921
  expeditionAlreadyExists: new ExpeditionAlreadyExistsError(),
920
922
  expeditionCannotBeUpdated: new ExpeditionCannotBeUpdatedError(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gls_spain/gps-common",
3
- "version": "35.1.9",
3
+ "version": "35.1.11",
4
4
  "description": "Errors, schemas and documentation for the Parcel Shops project",
5
5
  "keywords": [
6
6
  "gls"
@@ -214,6 +214,7 @@ const createShopUserRequest = () =>
214
214
  properties: {
215
215
  ...pickProperties(shopUser(), ['_id', 'createdAt', 'username', 'loginEnabled', 'name', 'emails', 'phones', 'nif', 'address']),
216
216
  password: password(),
217
+ passwordExpired: { type: 'string', trim: true },
217
218
  },
218
219
  required: ['username', 'loginEnabled', 'name', 'password'],
219
220
  additionalProperties: false,
@@ -260,6 +261,7 @@ const updateShopUserRequest = () =>
260
261
  properties: {
261
262
  ...pickProperties(shopUser(), ['loginEnabled', 'name', 'emails', 'phones'], ['nif', 'address']),
262
263
  password: password(),
264
+ passwordExpired: { type: 'string',trim: true },
263
265
  },
264
266
  minProperties: 1,
265
267
  additionalProperties: false,