@lysaab/lysa-pep 1.0.4-0 → 1.0.6-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.
Files changed (90) hide show
  1. package/{lib/Exports.d.ts → Exports.d.ts} +7 -7
  2. package/{lib/Exports.js → Exports.js} +7 -7
  3. package/{lib/components → components}/CountrySelect.d.ts +15 -15
  4. package/{lib/components → components}/CountrySelect.js +30 -30
  5. package/{lib/components → components}/PepAnswers.d.ts +8 -8
  6. package/{lib/components → components}/PepAnswers.js +131 -131
  7. package/{lib/components → components}/PepAnswers.scss +7 -7
  8. package/messages/src/components/CountrySelect.json +1 -0
  9. package/messages/src/components/PepAnswers.json +1 -0
  10. package/messages/src/pages/IsPep/IsPepMessages.json +1 -0
  11. package/messages/src/pages/IsPep/IsPepPage.json +1 -0
  12. package/messages/src/pages/RelationPage/RelationMessages.json +1 -0
  13. package/messages/src/pages/RelationPage/RelationPage.json +1 -0
  14. package/messages/src/pages/RolePage/RoleMessages.json +1 -0
  15. package/messages/src/pages/RolePage/RolePage.json +1 -0
  16. package/messages/src/pages/StatusPage/StatusMessages.json +1 -0
  17. package/messages/src/pages/StatusPage/StatusPage.json +1 -0
  18. package/{lib/model → model}/Countries.d.ts +4 -4
  19. package/{lib/model → model}/Countries.js +1002 -1002
  20. package/model/PepModel.d.ts +7 -0
  21. package/{lib/model → model}/PepModel.js +40 -40
  22. package/{lib/model → model}/PepTexts.d.ts +380 -322
  23. package/{lib/model → model}/PepTexts.js +552 -467
  24. package/package.json +71 -57
  25. package/{lib/pages → pages}/IsPep/IsPepMessages.d.ts +32 -32
  26. package/{lib/pages → pages}/IsPep/IsPepMessages.js +66 -66
  27. package/{lib/pages → pages}/IsPep/IsPepPage.d.ts +14 -14
  28. package/{lib/pages → pages}/IsPep/IsPepPage.js +60 -60
  29. package/{lib/pages → pages}/PepContext.d.ts +80 -80
  30. package/{lib/pages → pages}/PepContext.js +88 -88
  31. package/pages/PepIsPepPage.d.ts +15 -0
  32. package/{lib/pages → pages}/PepIsPepPage.js +59 -57
  33. package/{lib/pages → pages}/PepRelationPage.d.ts +6 -6
  34. package/{lib/pages → pages}/PepRelationPage.js +79 -83
  35. package/{lib/pages → pages}/PepRolePage.d.ts +10 -9
  36. package/{lib/pages → pages}/PepRolePage.js +127 -127
  37. package/{lib/pages → pages}/PepStatusPage.d.ts +6 -6
  38. package/pages/PepStatusPage.js +58 -0
  39. package/{lib/pages → pages}/RelationPage/RelationMessages.d.ts +105 -105
  40. package/{lib/pages → pages}/RelationPage/RelationMessages.js +283 -283
  41. package/{lib/pages → pages}/RelationPage/RelationPage.d.ts +6 -6
  42. package/{lib/pages → pages}/RelationPage/RelationPage.js +154 -154
  43. package/{lib/pages → pages}/RolePage/RoleMessages.d.ts +185 -185
  44. package/{lib/pages → pages}/RolePage/RoleMessages.js +385 -385
  45. package/{lib/pages → pages}/RolePage/RolePage.d.ts +11 -11
  46. package/{lib/pages → pages}/RolePage/RolePage.js +223 -223
  47. package/{lib/pages → pages}/StatusPage/StatusMessages.d.ts +72 -72
  48. package/{lib/pages → pages}/StatusPage/StatusMessages.js +266 -266
  49. package/{lib/pages → pages}/StatusPage/StatusPage.d.ts +8 -6
  50. package/{lib/pages → pages}/StatusPage/StatusPage.js +103 -98
  51. package/{lib/utils → utils}/Possession.d.ts +1 -1
  52. package/{lib/utils → utils}/Possession.js +18 -18
  53. package/.vscode/settings.json +0 -4
  54. package/lib/model/PepModel.d.ts +0 -7
  55. package/lib/pages/PepIsPepPage.d.ts +0 -6
  56. package/lib/pages/PepStatusPage.js +0 -57
  57. package/public/favicon.ico +0 -0
  58. package/public/index.html +0 -43
  59. package/public/logo192.png +0 -0
  60. package/public/logo512.png +0 -0
  61. package/public/manifest.json +0 -25
  62. package/public/robots.txt +0 -2
  63. package/src/App.css +0 -3
  64. package/src/App.test.tsx +0 -9
  65. package/src/App.tsx +0 -25
  66. package/src/Exports.ts +0 -12
  67. package/src/components/CountrySelect.tsx +0 -47
  68. package/src/components/PepAnswers.scss +0 -7
  69. package/src/components/PepAnswers.tsx +0 -252
  70. package/src/demo/Done.tsx +0 -16
  71. package/src/demo/Pep.tsx +0 -112
  72. package/src/index.css +0 -13
  73. package/src/index.tsx +0 -12
  74. package/src/logo.svg +0 -1
  75. package/src/model/Countries.ts +0 -1002
  76. package/src/model/PepModel.ts +0 -52
  77. package/src/pages/IsPep/IsPepMessages.ts +0 -67
  78. package/src/pages/IsPep/IsPepPage.tsx +0 -118
  79. package/src/pages/PepContext.tsx +0 -144
  80. package/src/pages/RelationPage/RelationMessages.ts +0 -288
  81. package/src/pages/RelationPage/RelationPage.tsx +0 -304
  82. package/src/pages/RolePage/RoleMessages.ts +0 -393
  83. package/src/pages/RolePage/RolePage.tsx +0 -361
  84. package/src/pages/StatusPage/StatusMessages.ts +0 -272
  85. package/src/pages/StatusPage/StatusPage.tsx +0 -213
  86. package/src/react-app-env.d.ts +0 -1
  87. package/src/serviceWorker.ts +0 -143
  88. package/src/utils/Possession.ts +0 -21
  89. package/tsconfig.json +0 -25
  90. package/tsconfig_build.json +0 -19
@@ -0,0 +1,7 @@
1
+ import { PepState } from "../pages/PepContext";
2
+ export interface PepRequest extends Omit<PepState, "isLocalCountry" | "isOngoing" | "ended" | "birthdayOfPEP"> {
3
+ ended?: string;
4
+ birthdayOfPEP?: string;
5
+ }
6
+ export declare function stateToRequest(pepState: PepState): PepRequest;
7
+ export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest, countryCode: string): PepState;
@@ -1,40 +1,40 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
- import { DateTime } from "luxon";
14
- export function stateToRequest(pepData) {
15
- const data = Object.assign({}, pepData);
16
- delete data.isSweden;
17
- delete data.isOngoing;
18
- delete data.ownerName;
19
- if (data.legalEntityType === EntityType.PERSON) {
20
- delete data.tin;
21
- }
22
- return Object.assign(Object.assign({}, data), { country: data.type !== PepType.NOT_PEP ? data.country || "SE" : undefined, ended: data.ended
23
- ? DateTime.fromJSDate(data.ended).toFormat("yyyy-MM")
24
- : undefined, birthdayOfPEP: data.birthdayOfPEP
25
- ? DateTime.fromJSDate(data.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
- : undefined });
27
- }
28
- export function requestToState(_a) {
29
- var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
- const state = Object.assign({}, serverData);
31
- if (ended) {
32
- state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
- }
34
- if (birthdayOfPEP) {
35
- state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
- }
37
- state.isSweden = state.country === "SE" ? "sweden" : "other";
38
- state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
- return state;
40
- }
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
+ import { DateTime } from "luxon";
14
+ export function stateToRequest(pepState) {
15
+ const state = Object.assign({}, pepState);
16
+ delete state.isLocalCountry;
17
+ delete state.isOngoing;
18
+ delete state.ownerName;
19
+ if (state.legalEntityType === EntityType.PERSON) {
20
+ delete state.tin;
21
+ }
22
+ return Object.assign(Object.assign({}, state), { country: state.type === PepType.NOT_PEP ? undefined : state.country, ended: state.ended
23
+ ? DateTime.fromJSDate(state.ended).toFormat("yyyy-MM")
24
+ : undefined, birthdayOfPEP: state.birthdayOfPEP
25
+ ? DateTime.fromJSDate(state.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
+ : undefined });
27
+ }
28
+ export function requestToState(_a, countryCode) {
29
+ var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
+ const state = Object.assign({}, serverData);
31
+ if (ended) {
32
+ state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
+ }
34
+ if (birthdayOfPEP) {
35
+ state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
+ }
37
+ state.isLocalCountry = state.country === countryCode ? "local" : "other";
38
+ state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
+ return state;
40
+ }