chayns-api 1.0.61 → 1.0.63

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.
@@ -33,6 +33,7 @@ class AppWrapper {
33
33
  const urlParamsLowerCase = new URLSearchParams(location.search.toLowerCase());
34
34
  let tappId = urlParamsLowerCase.get('tappid');
35
35
  let colorMode = urlParamsLowerCase.get('colormode');
36
+ let color = AppInfo.color;
36
37
  if (colorMode) {
37
38
  try {
38
39
  colorMode = Number.parseInt(colorMode, 10);
@@ -45,6 +46,20 @@ class AppWrapper {
45
46
  // ignore
46
47
  }
47
48
  }
49
+ if (!color && urlParamsLowerCase.has('color')) {
50
+ color = urlParamsLowerCase.get('color');
51
+ if (!color.startsWith('#')) {
52
+ color = `#${color}`;
53
+ }
54
+ }
55
+ let userId = AppUser.TobitUserID;
56
+ if (typeof userId === 'string') {
57
+ try {
58
+ userId = Number.parseInt(userId, 10);
59
+ } catch {
60
+ // ignore
61
+ }
62
+ }
48
63
  return {
49
64
  device: (0, _deviceHelper.default)(navigator.userAgent, 'image/webp'),
50
65
  environment: {
@@ -73,7 +88,7 @@ class AppWrapper {
73
88
  },
74
89
  title: AppInfo.Title,
75
90
  colorMode: (_colorMode = colorMode) !== null && _colorMode !== void 0 ? _colorMode : AppInfo.colorMode,
76
- color: AppInfo.color,
91
+ color,
77
92
  domain: AppInfo.domain,
78
93
  font: {
79
94
  id: _IChaynsReact.Font.Roboto,
@@ -89,7 +104,7 @@ class AppWrapper {
89
104
  firstName: AppUser.FirstName,
90
105
  lastName: AppUser.LastName,
91
106
  gender: _IChaynsReact.Gender.Unknown,
92
- userId: AppUser.TobitUserID,
107
+ userId: userId,
93
108
  personId: AppUser.PersonID,
94
109
  uacGroups: []
95
110
  },
@@ -25,6 +25,7 @@ export class AppWrapper {
25
25
  const urlParamsLowerCase = new URLSearchParams(location.search.toLowerCase());
26
26
  let tappId = urlParamsLowerCase.get('tappid');
27
27
  let colorMode = urlParamsLowerCase.get('colormode');
28
+ let color = AppInfo.color;
28
29
  if (colorMode) {
29
30
  try {
30
31
  colorMode = Number.parseInt(colorMode, 10);
@@ -37,6 +38,20 @@ export class AppWrapper {
37
38
  // ignore
38
39
  }
39
40
  }
41
+ if (!color && urlParamsLowerCase.has('color')) {
42
+ color = urlParamsLowerCase.get('color');
43
+ if (!color.startsWith('#')) {
44
+ color = `#${color}`;
45
+ }
46
+ }
47
+ let userId = AppUser.TobitUserID;
48
+ if (typeof userId === 'string') {
49
+ try {
50
+ userId = Number.parseInt(userId, 10);
51
+ } catch {
52
+ // ignore
53
+ }
54
+ }
40
55
  return {
41
56
  device: getDeviceInfo(navigator.userAgent, 'image/webp'),
42
57
  environment: {
@@ -65,7 +80,7 @@ export class AppWrapper {
65
80
  },
66
81
  title: AppInfo.Title,
67
82
  colorMode: (_colorMode = colorMode) !== null && _colorMode !== void 0 ? _colorMode : AppInfo.colorMode,
68
- color: AppInfo.color,
83
+ color,
69
84
  domain: AppInfo.domain,
70
85
  font: {
71
86
  id: Font.Roboto,
@@ -81,7 +96,7 @@ export class AppWrapper {
81
96
  firstName: AppUser.FirstName,
82
97
  lastName: AppUser.LastName,
83
98
  gender: Gender.Unknown,
84
- userId: AppUser.TobitUserID,
99
+ userId: userId,
85
100
  personId: AppUser.PersonID,
86
101
  uacGroups: []
87
102
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",