chayns-api 2.2.0-beta.2 → 2.2.0-beta.3

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.Language = exports.IconType = exports.IconStyle = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
6
+ exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.Language = exports.IconType = exports.IconStyle = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AppFlavor = exports.AccessMode = void 0;
7
7
  let DateType = exports.DateType = function (DateType) {
8
8
  DateType[DateType["DATE"] = 0] = "DATE";
9
9
  DateType[DateType["TIME"] = 1] = "TIME";
@@ -64,6 +64,11 @@ let ScreenSize = exports.ScreenSize = function (ScreenSize) {
64
64
  ScreenSize[ScreenSize["XL"] = 4] = "XL";
65
65
  return ScreenSize;
66
66
  }({});
67
+ let AppFlavor = exports.AppFlavor = function (AppFlavor) {
68
+ AppFlavor["None"] = "none";
69
+ AppFlavor["Chayns"] = "chayns";
70
+ return AppFlavor;
71
+ }({});
67
72
  let AccessMode = exports.AccessMode = function (AccessMode) {
68
73
  AccessMode[AccessMode["public"] = 0] = "public";
69
74
  AccessMode[AccessMode["protected"] = 1] = "protected";
@@ -45,6 +45,7 @@ const getDeviceInfo = (userAgent, acceptHeader, {
45
45
  };
46
46
  result.app = {
47
47
  name: appName,
48
+ flavor: appName === _IChaynsReact.AppName.Unknown ? _IChaynsReact.AppFlavor.None : _IChaynsReact.AppFlavor.Chayns,
48
49
  version: match !== null && match !== void 0 && match.groups ? Number.parseInt(match.groups.version, 10) : NaN,
49
50
  appVersion,
50
51
  callVersion: match !== null && match !== void 0 && match.groups ? Number.parseInt(match.groups.version, 10) : NaN
@@ -124,6 +124,7 @@ class AppWrapper {
124
124
  gender: _IChaynsReact.Gender.Unknown,
125
125
  userId: userId,
126
126
  personId: AppUser.PersonID,
127
+ isAnonymous: AppUser.IsAnonymous,
127
128
  uacGroups: []
128
129
  },
129
130
  customData: null,
@@ -624,9 +625,12 @@ class AppWrapper {
624
625
  callback: ({
625
626
  colorMode
626
627
  }) => {
627
- this.values.site = {
628
- ...this.values.site,
629
- colorMode
628
+ this.values = {
629
+ ...this.values,
630
+ site: {
631
+ ...this.values.site,
632
+ colorMode
633
+ }
630
634
  };
631
635
  document.dispatchEvent(new CustomEvent('chayns_api_data', {
632
636
  detail: {
@@ -58,6 +58,11 @@ export let ScreenSize = function (ScreenSize) {
58
58
  ScreenSize[ScreenSize["XL"] = 4] = "XL";
59
59
  return ScreenSize;
60
60
  }({});
61
+ export let AppFlavor = function (AppFlavor) {
62
+ AppFlavor["None"] = "none";
63
+ AppFlavor["Chayns"] = "chayns";
64
+ return AppFlavor;
65
+ }({});
61
66
  export let AccessMode = function (AccessMode) {
62
67
  AccessMode[AccessMode["public"] = 0] = "public";
63
68
  AccessMode[AccessMode["protected"] = 1] = "protected";
@@ -1,5 +1,5 @@
1
1
  import { UAParser } from 'ua-parser-js';
2
- import { AppName, ScreenSize } from '../types/IChaynsReact';
2
+ import { AppFlavor, AppName, ScreenSize } from '../types/IChaynsReact';
3
3
  const getDeviceInfo = function (userAgent, acceptHeader) {
4
4
  var _match$groups, _match$groups2, _customMatch$groups, _browser$version$spli, _browser$version, _uaParser$getOS, _uaParser$getOS2, _uaParser$getOS3;
5
5
  let {
@@ -40,6 +40,7 @@ const getDeviceInfo = function (userAgent, acceptHeader) {
40
40
  };
41
41
  result.app = {
42
42
  name: appName,
43
+ flavor: appName === AppName.Unknown ? AppFlavor.None : AppFlavor.Chayns,
43
44
  version: match !== null && match !== void 0 && match.groups ? Number.parseInt(match.groups.version, 10) : NaN,
44
45
  appVersion,
45
46
  callVersion: match !== null && match !== void 0 && match.groups ? Number.parseInt(match.groups.version, 10) : NaN
@@ -114,6 +114,7 @@ export class AppWrapper {
114
114
  gender: Gender.Unknown,
115
115
  userId: userId,
116
116
  personId: AppUser.PersonID,
117
+ isAnonymous: AppUser.IsAnonymous,
117
118
  uacGroups: []
118
119
  },
119
120
  customData: null,
@@ -635,9 +636,12 @@ export class AppWrapper {
635
636
  let {
636
637
  colorMode
637
638
  } = _ref3;
638
- this.values.site = {
639
- ...this.values.site,
640
- colorMode
639
+ this.values = {
640
+ ...this.values,
641
+ site: {
642
+ ...this.values.site,
643
+ colorMode
644
+ }
641
645
  };
642
646
  document.dispatchEvent(new CustomEvent('chayns_api_data', {
643
647
  detail: {
@@ -165,6 +165,7 @@ export type ChaynsApiUser = {
165
165
  uacGroups?: UacGroup[];
166
166
  userId?: number;
167
167
  personId?: string;
168
+ isAnonymous?: boolean;
168
169
  };
169
170
  export type ChaynsApiSite = {
170
171
  id: string;
@@ -236,6 +237,10 @@ export declare enum ScreenSize {
236
237
  /** screen width larger than 1200px */
237
238
  XL = 4
238
239
  }
240
+ export declare enum AppFlavor {
241
+ None = "none",
242
+ Chayns = "chayns"
243
+ }
239
244
  export type ChaynsApiDevice = {
240
245
  app?: {
241
246
  name: AppName;
@@ -246,6 +251,8 @@ export type ChaynsApiDevice = {
246
251
  /** the version of the chayns call interface */
247
252
  callVersion: number;
248
253
  storePackageName?: string;
254
+ /** the flavor of the app, e. g. all chayns apps including chat app, sidekick, team */
255
+ flavor: AppFlavor;
249
256
  };
250
257
  browser?: {
251
258
  name?: IBrowser["name"] | 'bot' | null;
@@ -435,7 +442,6 @@ export interface RefreshData {
435
442
  user?: boolean;
436
443
  chaynsProData?: boolean;
437
444
  ignoreUacCache?: boolean;
438
- styleSettings?: boolean;
439
445
  chaynsInfo?: boolean;
440
446
  }
441
447
  export type IntercomMessage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.2.0-beta.2",
3
+ "version": "2.2.0-beta.3",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",