@gls_spain/gps-common 34.31.8 → 35.0.1
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 +43 -24
- package/errors/AgenciaTributariaDNI.js +1 -1
- package/errors/CountersDoNotExistError.js +1 -1
- package/errors/DatabaseError.js +9 -0
- package/errors/DatabaseNotEmptyError.js +1 -1
- package/errors/DefaultsDoNotExistError.js +1 -1
- package/errors/ExpeditionAlreadyExistsError.js +1 -1
- package/errors/ExpeditionCannotBeDeletedError.js +1 -1
- package/errors/ExpeditionCannotBeUpdatedError.js +1 -1
- package/errors/ExpeditionDoesNotExistError.js +1 -1
- package/errors/GLSRecordingError.js +1 -1
- package/errors/GLSSpainError.js +1 -1
- package/errors/IbanNotCorrectError.js +1 -1
- package/errors/InconsistentSalesSettingsError.js +1 -1
- package/errors/InvalidSaleDestinationError.js +1 -1
- package/errors/LabelDoesNotExistError.js +1 -1
- package/errors/NetworkAlreadyExistsError.js +1 -1
- package/errors/NetworkCannotBeDeletedError.js +1 -1
- package/errors/NetworkCannotBeUpdatedError.js +1 -1
- package/errors/NetworkDoesNotExistError.js +1 -1
- package/errors/NifNotCorrectError.js +1 -1
- package/errors/RepresentativeAlreadyExistsError.js +1 -1
- package/errors/RepresentativeCannotBeDeletedError.js +1 -1
- package/errors/RepresentativeDoesNotExistError.js +1 -1
- package/errors/SaleAlreadyExistsError.js +1 -1
- package/errors/SaleDoesNotExistError.js +1 -1
- package/errors/ShopAlreadyExistsError.js +1 -1
- package/errors/ShopCannotBeDeletedError.js +1 -1
- package/errors/ShopCannotBeUpdatedError.js +1 -1
- package/errors/ShopCannotSellError.js +1 -1
- package/errors/ShopDoesNotExistError.js +1 -1
- package/errors/ShopNotEnabledError.js +1 -1
- package/errors/UserAlreadyExistsError.js +1 -1
- package/errors/UserCannotBeDeletedError.js +1 -1
- package/errors/UserCannotBeUpdatedError.js +1 -1
- package/errors/UserDoesNotExistError.js +1 -1
- package/errors/WrongNetworkError.js +1 -1
- package/errors/WrongPasswordError.js +1 -1
- package/errors/WrongShopError.js +1 -1
- package/errors/ZoneAlreadyExistsError.js +1 -1
- package/errors/ZoneCannotBeDeletedError.js +1 -1
- package/errors/ZoneDoesNotExistError.js +1 -1
- package/package.json +1 -4
- package/schemas/index.js +14 -7
- package/scripts/build-documentation.js +2 -2
- package/scripts/build-json-schemas.js +6 -5
- package/scripts/color-console-transport.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,39 +1,58 @@
|
|
|
1
|
-
## [
|
|
1
|
+
## [35.0.1](https://github.com/GLS-Spain/gps-common/compare/v35.0.0...v35.0.1) (2024-04-05)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* export user json-schema ([4f93351](https://github.com/GLS-Spain/gps-common/commit/4f93351a8bcab2ee87190f32f0e1967defa384eb))
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# [35.0.0](https://github.com/GLS-Spain/gps-common/compare/v34.31.8...v35.0.0) (2024-04-04)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
* add new properties to json schema ([462bbbb](https://github.com/GLS-Spain/gps-common/commit/462bbbb8ed91ba9d206508e0a49a40b5384323fc))
|
|
14
|
-
* change parcelShopId type from number to string ([0cdae51](https://github.com/GLS-Spain/gps-common/commit/0cdae5183c12381c163d57ff75996139882ef598))
|
|
15
|
-
|
|
16
|
-
## [34.31.6](https://github.com/GLS-Spain/gps-common/compare/v34.31.5...v34.31.6) (2023-11-07)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Bug Fixes
|
|
20
|
-
|
|
21
|
-
* mdify supplierSHop ([d4ea59d](https://github.com/GLS-Spain/gps-common/commit/d4ea59d24f3a5257603a785d3830b80fadbf676b))
|
|
22
|
-
|
|
23
|
-
## [34.31.5](https://github.com/GLS-Spain/gps-common/compare/v34.31.4...v34.31.5) (2023-10-03)
|
|
11
|
+
### Features
|
|
24
12
|
|
|
13
|
+
* nodejs 20 support ([782917a](https://github.com/GLS-Spain/gps-common/commit/782917a6cbfee5c87da008b1bfa9bb48c4bf1c8a))
|
|
25
14
|
|
|
26
|
-
### Bug Fixes
|
|
27
|
-
|
|
28
|
-
* fix last update validation event supplier ([474d6be](https://github.com/GLS-Spain/gps-common/commit/474d6be01cb954c0ba05ba37d9425b919cb2a673))
|
|
29
15
|
|
|
30
|
-
|
|
16
|
+
### BREAKING CHANGES
|
|
31
17
|
|
|
18
|
+
* nodejs 20 support
|
|
32
19
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
## [34.31.8](https://github.com/GLS-Spain/gps-common/compare/v34.31.7...v34.31.8) (2023-11-22)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* fix array excludes to array of string array ([7d2c3ea](https://github.com/GLS-Spain/gps-common/commit/7d2c3ea72162d9994e9ef0dc0b49d7dc273c36eb))
|
|
26
|
+
|
|
27
|
+
## [34.31.7](https://github.com/GLS-Spain/gps-common/compare/v34.31.6...v34.31.7) (2023-11-21)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* add new properties to json schema ([462bbbb](https://github.com/GLS-Spain/gps-common/commit/462bbbb8ed91ba9d206508e0a49a40b5384323fc))
|
|
33
|
+
* change parcelShopId type from number to string ([0cdae51](https://github.com/GLS-Spain/gps-common/commit/0cdae5183c12381c163d57ff75996139882ef598))
|
|
34
|
+
|
|
35
|
+
## [34.31.6](https://github.com/GLS-Spain/gps-common/compare/v34.31.5...v34.31.6) (2023-11-07)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* mdify supplierSHop ([d4ea59d](https://github.com/GLS-Spain/gps-common/commit/d4ea59d24f3a5257603a785d3830b80fadbf676b))
|
|
41
|
+
|
|
42
|
+
## [34.31.5](https://github.com/GLS-Spain/gps-common/compare/v34.31.4...v34.31.5) (2023-10-03)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* fix last update validation event supplier ([474d6be](https://github.com/GLS-Spain/gps-common/commit/474d6be01cb954c0ba05ba37d9425b919cb2a673))
|
|
48
|
+
|
|
49
|
+
## [34.31.4](https://github.com/GLS-Spain/gps-common/compare/v34.31.3...v34.31.4) (2023-10-03)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* fix validation ([89acbf3](https://github.com/GLS-Spain/gps-common/commit/89acbf3899efdbd9b4f8daa1bbd49acfd9d87dac))
|
|
55
|
+
|
|
37
56
|
## [34.31.3](https://github.com/GLS-Spain/gps-common/compare/v34.31.2...v34.31.3) (2023-10-03)
|
|
38
57
|
|
|
39
58
|
|
package/errors/GLSSpainError.js
CHANGED
package/errors/WrongShopError.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gls_spain/gps-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.1",
|
|
4
4
|
"description": "Errors, schemas and documentation for the Parcel Shops project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gls"
|
|
@@ -46,9 +46,6 @@
|
|
|
46
46
|
"@gls_spain/ajv-options": "^1.1.2",
|
|
47
47
|
"@gls_spain/common-errors": "^1.1.0",
|
|
48
48
|
"@gls_spain/common-json-schemas": "^1.2.4",
|
|
49
|
-
"@gls_spain/gps-common": "^34.30.5",
|
|
50
|
-
"@gls_spain/mongodb": "^1.2.0",
|
|
51
|
-
"@gls_spain/winston-transports": "^1.0.2",
|
|
52
49
|
"lodash": "^4.17.21",
|
|
53
50
|
"winston": "^3.3.3",
|
|
54
51
|
"yargs": "^15.4.1"
|
package/schemas/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { addMetadata, errorResponse: sourceErrorResponse
|
|
1
|
+
const { addMetadata, errorResponse: sourceErrorResponse } = require('@gls_spain/common-json-schemas');
|
|
2
2
|
const { getDefaultsResponse, updateDefaultsRequest, updateDefaultsResponse } = require('./definitions/defaults');
|
|
3
3
|
const { getCountersResponse } = require('./definitions/counters');
|
|
4
4
|
const { loginResponse: sourceLoginResponse } = require('./definitions/login');
|
|
@@ -32,6 +32,9 @@ const {
|
|
|
32
32
|
updateShopUserResponse,
|
|
33
33
|
deleteShopUserRequest,
|
|
34
34
|
deleteShopUserResponse,
|
|
35
|
+
networkAdmin,
|
|
36
|
+
shopUser,
|
|
37
|
+
superAdmin,
|
|
35
38
|
} = require('./definitions/users');
|
|
36
39
|
const {
|
|
37
40
|
createNetworkRequest,
|
|
@@ -55,7 +58,7 @@ const {
|
|
|
55
58
|
deleteShopRequest,
|
|
56
59
|
deleteShopResponse,
|
|
57
60
|
upsertShopRequest,
|
|
58
|
-
upsertShopResponse
|
|
61
|
+
upsertShopResponse,
|
|
59
62
|
} = require('./definitions/shops');
|
|
60
63
|
const {
|
|
61
64
|
createExpeditionRequest,
|
|
@@ -83,8 +86,8 @@ const {
|
|
|
83
86
|
unexpireExpeditionRequest,
|
|
84
87
|
updateExpeditionDerivationRequest,
|
|
85
88
|
reminderResponse,
|
|
86
|
-
notNotificationResponse,
|
|
87
|
-
processExpeditionsDepositedFromRequest
|
|
89
|
+
// notNotificationResponse,
|
|
90
|
+
processExpeditionsDepositedFromRequest,
|
|
88
91
|
} = require('./definitions/expeditions');
|
|
89
92
|
const { findPodsRequest, findPodsResponse } = require('./definitions/pods');
|
|
90
93
|
const {
|
|
@@ -128,10 +131,10 @@ const {
|
|
|
128
131
|
downloadSaleLabelRequest,
|
|
129
132
|
downloadSaleLabelResponse,
|
|
130
133
|
paymentRequest,
|
|
131
|
-
paymentResponse
|
|
134
|
+
paymentResponse,
|
|
132
135
|
} = require('./definitions/sales');
|
|
133
136
|
|
|
134
|
-
const { findParcelShopsRequest, findParcelShopsResponse } = require('./definitions/findParcelShops')
|
|
137
|
+
const { findParcelShopsRequest, findParcelShopsResponse } = require('./definitions/findParcelShops');
|
|
135
138
|
|
|
136
139
|
function request(schema, $id) {
|
|
137
140
|
return addMetadata(schema, $id);
|
|
@@ -284,6 +287,8 @@ const salesPaymentResponse = request(paymentResponse(), 'salesPaymentResponse');
|
|
|
284
287
|
const parcelShopsRequest = request(findParcelShopsRequest(), 'parcelShopsRequest');
|
|
285
288
|
const parcelShopsResponse = request(findParcelShopsResponse(), 'parcelShopsResponse');
|
|
286
289
|
|
|
290
|
+
const user = addMetadata({ oneOf: [superAdmin(), networkAdmin(), shopUser()] }, 'user');
|
|
291
|
+
|
|
287
292
|
module.exports = {
|
|
288
293
|
errorResponse,
|
|
289
294
|
|
|
@@ -423,5 +428,7 @@ module.exports = {
|
|
|
423
428
|
salesPaymentResponse,
|
|
424
429
|
|
|
425
430
|
parcelShopsRequest,
|
|
426
|
-
parcelShopsResponse
|
|
431
|
+
parcelShopsResponse,
|
|
432
|
+
|
|
433
|
+
user
|
|
427
434
|
};
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const util = require('util');
|
|
6
|
-
const os = require('os');
|
|
6
|
+
// const os = require('os');
|
|
7
7
|
const childProcess = require('child_process');
|
|
8
8
|
const winston = require('winston');
|
|
9
|
-
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
10
9
|
const yargs = require('yargs');
|
|
11
10
|
const openApiSpec = require('../open-api-spec');
|
|
11
|
+
const { ColorConsoleTransport } = require('./color-console-transport');
|
|
12
12
|
|
|
13
13
|
const exec = util.promisify(childProcess.exec);
|
|
14
14
|
|
|
@@ -4,14 +4,15 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const winston = require('winston');
|
|
6
6
|
const kebabCase = require('lodash/kebabCase');
|
|
7
|
-
const yargs = require('yargs');
|
|
8
|
-
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
7
|
+
// const yargs = require('yargs');
|
|
8
|
+
// const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
9
9
|
const schemas = require('../schemas');
|
|
10
10
|
const openapispec = require('../open-api-spec');
|
|
11
|
+
const { ColorConsoleTransport } = require('./color-console-transport');
|
|
11
12
|
|
|
12
|
-
const { argv } = yargs
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// const { argv } = yargs
|
|
14
|
+
// .option('output', { string: true, required: true, describe: 'directory path to put the json schemas in' })
|
|
15
|
+
// .usage('Usage: build-schemas --output output_dir');
|
|
15
16
|
|
|
16
17
|
const logger = winston.createLogger({ transports: new ColorConsoleTransport() });
|
|
17
18
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// eslint-disable-next-line camelcase
|
|
2
|
+
const winston_1 = require('winston');
|
|
3
|
+
|
|
4
|
+
exports.defaultOptions = {
|
|
5
|
+
format: winston_1.format.combine(
|
|
6
|
+
winston_1.format.colorize({ all: true }),
|
|
7
|
+
winston_1.format.timestamp(),
|
|
8
|
+
winston_1.format.printf(info => {
|
|
9
|
+
const { level, message, timestamp, label } = info;
|
|
10
|
+
return label !== undefined ? `${timestamp} [${label}] ${level}: ${message}` : `${timestamp} ${level}: ${message}`;
|
|
11
|
+
}),
|
|
12
|
+
),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
class ColorConsoleTransport extends winston_1.transports.Console {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super({ ...options, ...exports.defaultOptions });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { ColorConsoleTransport };
|