@gls_spain/gps-common 35.18.0 → 35.19.0
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 +21 -0
- package/CLAUDE.md +60 -0
- package/package.json +1 -1
- package/schemas/definitions/become.js +1 -1
- package/schemas/definitions/common.js +14 -1
- package/schemas/definitions/shops.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [35.19.0](https://github.com/GLS-Spain/gps-common/compare/v35.18.2...v35.19.0) (2026-09-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* añadir nuevas propiedades opcionales en address ([9b72b82](https://github.com/GLS-Spain/gps-common/commit/9b72b82086ffba2f296392a4ba2c44669b3afb58))
|
|
7
|
+
|
|
8
|
+
## [35.18.2](https://github.com/GLS-Spain/gps-common/compare/v35.18.1...v35.18.2) (2026-08-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* update version minor ([a65e971](https://github.com/GLS-Spain/gps-common/commit/a65e9711e6472ca99505d06b33ef5ed2590b3888))
|
|
14
|
+
|
|
15
|
+
## [35.18.1](https://github.com/GLS-Spain/gps-common/compare/v35.18.0...v35.18.1) (2026-08-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add Sunday in shopSchedule schema ([6ea0d8a](https://github.com/GLS-Spain/gps-common/commit/6ea0d8a9e3a0e0f591c82ca7f3c7791f64876112))
|
|
21
|
+
|
|
1
22
|
# [35.18.0](https://github.com/GLS-Spain/gps-common/compare/v35.17.1...v35.18.0) (2026-06-17)
|
|
2
23
|
|
|
3
24
|
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Purpose
|
|
6
|
+
|
|
7
|
+
Shared library providing error classes, JSON schemas, and OpenAPI specifications for the GLS Parcel Shops (GPS) project. Published as `@gls_spain/gps-common`.
|
|
8
|
+
|
|
9
|
+
## Build Commands
|
|
10
|
+
|
|
11
|
+
Standard `npm test` runs jest. Non-obvious scripts:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run build-json-schemas # Compile schemas → build/schemas/
|
|
15
|
+
npm run build-documentation # Build HTML docs → build/documentation/documentation.html
|
|
16
|
+
npm run generate-documentation # rimraf build, then full rebuild of schemas + docs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Code Style
|
|
20
|
+
|
|
21
|
+
Prettier is configured with non-default settings — always respect these:
|
|
22
|
+
|
|
23
|
+
- **Print width:** 140 characters (not the typical 80/100)
|
|
24
|
+
- **Quotes:** single quotes
|
|
25
|
+
- **Trailing commas:** `all`
|
|
26
|
+
- **Arrow parens:** `avoid` (omit parens for single-arg arrow functions)
|
|
27
|
+
|
|
28
|
+
ESLint extends `airbnb-base` + `prettier` with two overrides:
|
|
29
|
+
- `no-underscore-dangle`: off (underscores are used for DB fields like `_id`)
|
|
30
|
+
- `import/extensions`: off (file extensions omitted in imports)
|
|
31
|
+
|
|
32
|
+
## Testing
|
|
33
|
+
|
|
34
|
+
Jest runs with `collectCoverage: true` by default. The `@gls_spain/*` scoped packages in `node_modules` are **not** excluded from transformation — they are transpiled as part of the test run.
|
|
35
|
+
|
|
36
|
+
## Commits and Branching
|
|
37
|
+
|
|
38
|
+
Use conventional commits. Run `npm run commit` (commitizen) instead of `git commit` directly to get the interactive prompt that formats the commit message correctly.
|
|
39
|
+
|
|
40
|
+
The pre-commit Husky hook runs all tests — commits will be blocked if tests fail.
|
|
41
|
+
|
|
42
|
+
Branches follow the pattern `<JIRA-TICKET>-<description>` (e.g., `INN-563-Schema-lockers`).
|
|
43
|
+
|
|
44
|
+
## Release
|
|
45
|
+
|
|
46
|
+
Releases are managed by semantic-release on the `master` branch, triggered manually:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm run semantic-release
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This publishes to npm, updates `CHANGELOG.md`, and creates a git tag. Requires `NPM_TOKEN` to be set.
|
|
53
|
+
|
|
54
|
+
## NPM Auth
|
|
55
|
+
|
|
56
|
+
The `@gls_spain` scoped packages require npm authentication. Set `NPM_TOKEN` in your environment or configure `.npmrc` with the registry token before installing dependencies.
|
|
57
|
+
|
|
58
|
+
## Adding Errors or Schemas
|
|
59
|
+
|
|
60
|
+
Mirror the structure of existing files in `errors/` and `schemas/definitions/`. Export new entries from the relevant `index.js` files.
|
package/package.json
CHANGED
|
@@ -294,7 +294,14 @@ const country = () => ({
|
|
|
294
294
|
|
|
295
295
|
const address = () =>
|
|
296
296
|
mergeSchemas(genericAddress(), {
|
|
297
|
-
properties: {
|
|
297
|
+
properties: {
|
|
298
|
+
country: country(),
|
|
299
|
+
// Nuevas propiedades opcionales para desglosar la dirección (lo pide El Corte Inglés) task "INN-1333"
|
|
300
|
+
streetType: { type: 'string', trim: true },
|
|
301
|
+
streetName: { type: 'string', trim: true },
|
|
302
|
+
streetNumber: { type: 'string', trim: true },
|
|
303
|
+
manuallyVerified: { type: 'boolean' },
|
|
304
|
+
},
|
|
298
305
|
});
|
|
299
306
|
|
|
300
307
|
const addressWithRequiredLocation = () => mergeSchemas(address(), { required: ['location'] });
|
|
@@ -488,6 +495,12 @@ const lockerAddress = () => ({
|
|
|
488
495
|
postalCode: { type: 'string', trim: true, maxLength: 15 }, // cp varchar(15)
|
|
489
496
|
locality: { type: 'string', trim: true, maxLength: 100 }, // Poblacion varchar(100)
|
|
490
497
|
country: { type: 'string', trim: true, maxLength: 3 }, // ISO 3166-1 alpha-2/3
|
|
498
|
+
// campos opcionales para desglosar la dirección (además de street)
|
|
499
|
+
streetType: { type: 'string', trim: true, maxLength: 50 },
|
|
500
|
+
streetName: { type: 'string', trim: true, maxLength: 255 },
|
|
501
|
+
streetNumber: { type: 'string', trim: true, maxLength: 20 },
|
|
502
|
+
notes: { type: 'string', trim: true, maxLength: 500 }, // observaciones
|
|
503
|
+
manuallyVerified: { type: 'boolean' },
|
|
491
504
|
// campo específico de locker
|
|
492
505
|
access_descript_locker: { type: 'string', trim: true, maxLength: 500 },
|
|
493
506
|
location: {
|
|
@@ -58,7 +58,7 @@ const shopSchedule = () => ({
|
|
|
58
58
|
saturday: shopDaySchedule(),
|
|
59
59
|
sunday: shopDaySchedule(),
|
|
60
60
|
},
|
|
61
|
-
required: ['type', 'weekly'
|
|
61
|
+
required: ['type', 'weekly'],// saturday and sunday are optional
|
|
62
62
|
additionalProperties: false,
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -74,7 +74,7 @@ const shopSchedule = () => ({
|
|
|
74
74
|
saturday: shopDaySchedule(),
|
|
75
75
|
sunday: shopDaySchedule(),
|
|
76
76
|
},
|
|
77
|
-
required: ['type', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday'
|
|
77
|
+
required: ['type', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday'], // saturday and sunday are optional
|
|
78
78
|
additionalProperties: false,
|
|
79
79
|
},
|
|
80
80
|
],
|