@gls_spain/gps-common 31.0.2 → 32.0.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/.idea/workspace.xml +21 -10
- package/CHANGELOG.md +19 -0
- package/open-api-spec/index.js +5 -8
- package/package.json +1 -1
- package/schemas/definitions/historic-records.js +6 -17
package/.idea/workspace.xml
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
4
|
<list default="true" id="c2833e40-3178-44f3-9bc5-203849985c7f" name="Default Changelist" comment="">
|
|
5
|
-
<change beforePath="$PROJECT_DIR$/
|
|
5
|
+
<change beforePath="$PROJECT_DIR$/open-api-spec/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/open-api-spec/index.js" afterDir="false" />
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/schemas/definitions/historic-records.js" beforeDir="false" afterPath="$PROJECT_DIR$/schemas/definitions/historic-records.js" afterDir="false" />
|
|
6
7
|
</list>
|
|
7
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
8
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -533,7 +534,17 @@
|
|
|
533
534
|
<workItem from="1585071898721" duration="603000" />
|
|
534
535
|
<workItem from="1585076315474" duration="929000" />
|
|
535
536
|
<workItem from="1585115696576" duration="1386000" />
|
|
536
|
-
<workItem from="1585152558330" duration="
|
|
537
|
+
<workItem from="1585152558330" duration="1482000" />
|
|
538
|
+
<workItem from="1585156263619" duration="877000" />
|
|
539
|
+
<workItem from="1585165942742" duration="1422000" />
|
|
540
|
+
<workItem from="1585171020202" duration="389000" />
|
|
541
|
+
<workItem from="1585200026785" duration="2273000" />
|
|
542
|
+
<workItem from="1585233345225" duration="1174000" />
|
|
543
|
+
<workItem from="1585251412197" duration="856000" />
|
|
544
|
+
<workItem from="1585290769759" duration="503000" />
|
|
545
|
+
<workItem from="1585309502233" duration="144000" />
|
|
546
|
+
<workItem from="1585319154346" duration="599000" />
|
|
547
|
+
<workItem from="1585377577645" duration="2447000" />
|
|
537
548
|
</task>
|
|
538
549
|
<servers />
|
|
539
550
|
</component>
|
|
@@ -589,22 +600,22 @@
|
|
|
589
600
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
590
601
|
</state>
|
|
591
602
|
<state x="606" y="280" key="EditFileWatcherDialog/0.23.2048.1129@0.23.2048.1129" timestamp="1580283934403" />
|
|
592
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="
|
|
603
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom" timestamp="1585380996925">
|
|
593
604
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
594
605
|
</state>
|
|
595
|
-
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
596
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="
|
|
606
|
+
<state width="2006" height="269" key="GridCell.Tab.0.bottom/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996925" />
|
|
607
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center" timestamp="1585380996924">
|
|
597
608
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
598
609
|
</state>
|
|
599
|
-
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
600
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="
|
|
610
|
+
<state width="2006" height="269" key="GridCell.Tab.0.center/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996924" />
|
|
611
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left" timestamp="1585380996924">
|
|
601
612
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
602
613
|
</state>
|
|
603
|
-
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
604
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="
|
|
614
|
+
<state width="2006" height="269" key="GridCell.Tab.0.left/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996924" />
|
|
615
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right" timestamp="1585380996925">
|
|
605
616
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
606
617
|
</state>
|
|
607
|
-
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="
|
|
618
|
+
<state width="2006" height="269" key="GridCell.Tab.0.right/0.23.2048.1129@0.23.2048.1129" timestamp="1585380996925" />
|
|
608
619
|
<state x="0" y="23" width="2048" height="1129" key="SettingsEditor" timestamp="1580283935326">
|
|
609
620
|
<screen x="0" y="23" width="2048" height="1129" />
|
|
610
621
|
</state>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [32.0.0](https://github.com/GLS-Spain/gps-common/compare/v31.0.3...v32.0.0) (2020-03-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* change historic record actionDetails for actionKeys ([7f9acc5](https://github.com/GLS-Spain/gps-common/commit/7f9acc5f746a16b42a58bbc99379381a84ac9f49))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* historic records schema has changed
|
|
12
|
+
|
|
13
|
+
## [31.0.3](https://github.com/GLS-Spain/gps-common/compare/v31.0.2...v31.0.3) (2020-03-26)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* fix typo in expire action detail of historic records ([a484484](https://github.com/GLS-Spain/gps-common/commit/a484484a6082fb68a340ecc51cd13190142939a5))
|
|
19
|
+
|
|
1
20
|
## [31.0.2](https://github.com/GLS-Spain/gps-common/compare/v31.0.1...v31.0.2) (2020-03-25)
|
|
2
21
|
|
|
3
22
|
|
package/open-api-spec/index.js
CHANGED
|
@@ -441,24 +441,21 @@ expeditions they have access to.
|
|
|
441
441
|
name: 'Historic records introduction',
|
|
442
442
|
'x-displayName': 'Historic records',
|
|
443
443
|
description: `
|
|
444
|
-
Every time the API creates, updates or deletes a resource
|
|
444
|
+
Every time the API creates, updates or deletes a resource it stores a historic record of the action, the full document as it was after
|
|
445
445
|
the action, the time it occurred and the user that made it.
|
|
446
446
|
|
|
447
447
|
The only exception are \`pods\` which have no records because they are created when their expeditions are delivered and they are never
|
|
448
|
-
updated
|
|
448
|
+
updated. They are also never deleted because they need to remain accessible via the historic records of expeditions.
|
|
449
449
|
|
|
450
450
|
These historic records serve two purposes:
|
|
451
451
|
|
|
452
452
|
- They allow to track the full history of a document.
|
|
453
453
|
- They are the basis for the [integrations](#tag/Integrations-introduction) with other systems.
|
|
454
454
|
|
|
455
|
-
The \`
|
|
455
|
+
The \`actionKeys\` lists the paths of the updated fields for an \`update\` action. The depth of the paths may vary:
|
|
456
456
|
|
|
457
|
-
-
|
|
458
|
-
-
|
|
459
|
-
- An automatic background expiration of an expedition is an \`update\` action with an \`expired\` detail.
|
|
460
|
-
|
|
461
|
-
The values in \`actionDetails\` only apply to certain combinations of \`type\` and \`action\`.
|
|
457
|
+
- Usually it is just the root key, for example an update of any field in a shop address is just \`address\`.
|
|
458
|
+
- Some updated are more specific, for example delivering an expedition is \`status.code\` and \`status.givenTo\`.
|
|
462
459
|
|
|
463
460
|
The \`integrations\` field is where each integration stores what it did with it. Its properties are the names of the integrations and
|
|
464
461
|
their values the result of that integration for that record.
|
package/package.json
CHANGED
|
@@ -20,25 +20,14 @@ const historicRecord = () => ({
|
|
|
20
20
|
type: 'string',
|
|
21
21
|
enum: ['defaults', 'superAdmin', 'network', 'networkAdmin', 'zone', 'representative', 'shop', 'shopUser', 'expedition'],
|
|
22
22
|
},
|
|
23
|
+
document: { oneOf: [defaults(), superAdmin(), network(), networkAdmin(), zone(), representative(), shop(), shopUser(), expedition()] },
|
|
23
24
|
action: { type: 'string', enum: ['create', 'update', 'delete'] },
|
|
24
|
-
|
|
25
|
+
actionKeys: {
|
|
25
26
|
type: 'array',
|
|
26
|
-
items: {
|
|
27
|
-
|
|
28
|
-
enum: [
|
|
29
|
-
'receiveFromDriver',
|
|
30
|
-
'receiveFromCustomer',
|
|
31
|
-
'giveToDriver',
|
|
32
|
-
'giveToCustomer',
|
|
33
|
-
'redirect',
|
|
34
|
-
'expirationReminder',
|
|
35
|
-
'expired',
|
|
36
|
-
'price',
|
|
37
|
-
],
|
|
38
|
-
},
|
|
27
|
+
items: { type: 'string' },
|
|
28
|
+
description: 'the list of updated keys in an update action, e.g ["name", "status.code"]',
|
|
39
29
|
},
|
|
40
|
-
actor: { type: 'string', description: 'the username of the user
|
|
41
|
-
document: { oneOf: [defaults(), superAdmin(), network(), networkAdmin(), zone(), representative(), shop(), shopUser(), expedition()] },
|
|
30
|
+
actor: { type: 'string', description: 'who made the action, e.g. username of the user, name of the script' },
|
|
42
31
|
integrations: {
|
|
43
32
|
type: 'object',
|
|
44
33
|
additionalProperties: {
|
|
@@ -54,7 +43,7 @@ const historicRecord = () => ({
|
|
|
54
43
|
description: 'one property per integration where the property name is the name of the integration',
|
|
55
44
|
},
|
|
56
45
|
},
|
|
57
|
-
required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'type', '
|
|
46
|
+
required: ['_id', 'createdAt', 'updatedAt', 'deletable', 'type', 'document', 'action', 'actionKeys', 'actor', 'integrations'],
|
|
58
47
|
additionalProperties: false,
|
|
59
48
|
});
|
|
60
49
|
|