@situm/react-native 3.15.0-beta.1 → 3.15.0-beta.2

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 (145) hide show
  1. package/android/src/main/java/com/situm/plugin/PluginHelper.java +1 -1
  2. package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +1 -1
  3. package/ios/SitumPlugin.m +14 -7
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/package.json +1 -0
  6. package/lib/commonjs/sdk/index.js.map +1 -1
  7. package/lib/commonjs/sdk/internaDelegatedState.js.map +1 -0
  8. package/lib/commonjs/sdk/nativeInterface.js.map +1 -1
  9. package/lib/commonjs/sdk/types/constants.js.map +1 -1
  10. package/lib/commonjs/sdk/types/index.js.map +1 -1
  11. package/lib/commonjs/sdk/utils.js.map +1 -1
  12. package/lib/commonjs/utils/index.js.map +1 -1
  13. package/lib/commonjs/utils/logError.js.map +1 -1
  14. package/lib/commonjs/wayfinding/index.js.map +1 -1
  15. package/lib/commonjs/wayfinding/types/index.js.map +1 -1
  16. package/lib/commonjs/wayfinding/utils/index.js.map +1 -1
  17. package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/module/package.json +1 -0
  20. package/lib/module/sdk/index.js.map +0 -1
  21. package/lib/module/sdk/internaDelegatedState.js.map +1 -0
  22. package/lib/module/sdk/nativeInterface.js.map +1 -1
  23. package/lib/module/sdk/types/constants.js.map +1 -1
  24. package/lib/module/sdk/types/index.js.map +1 -1
  25. package/lib/module/sdk/utils.js.map +1 -1
  26. package/lib/module/utils/index.js.map +1 -1
  27. package/lib/module/utils/logError.js.map +0 -1
  28. package/lib/module/wayfinding/index.js.map +1 -1
  29. package/lib/module/wayfinding/types/constants.js.map +1 -1
  30. package/lib/module/wayfinding/types/index.js.map +0 -1
  31. package/lib/module/wayfinding/utils/index.js.map +1 -1
  32. package/lib/module/wayfinding/utils/mapper.js.map +1 -1
  33. package/lib/typescript/index.d.ts.map +1 -0
  34. package/lib/typescript/{src/sdk → sdk}/index.d.ts +25 -32
  35. package/lib/typescript/sdk/index.d.ts.map +1 -0
  36. package/lib/typescript/sdk/internaDelegatedState.d.ts +17 -0
  37. package/lib/typescript/sdk/internaDelegatedState.d.ts.map +1 -0
  38. package/lib/typescript/{src/sdk → sdk}/nativeInterface.d.ts +4 -2
  39. package/lib/typescript/sdk/nativeInterface.d.ts.map +1 -0
  40. package/lib/typescript/sdk/types/constants.d.ts.map +1 -0
  41. package/lib/typescript/{src/sdk → sdk}/types/index.d.ts +2 -1
  42. package/lib/typescript/sdk/types/index.d.ts.map +1 -0
  43. package/lib/typescript/{src/sdk → sdk}/utils.d.ts +1 -1
  44. package/lib/typescript/sdk/utils.d.ts.map +1 -0
  45. package/lib/typescript/utils/index.d.ts.map +1 -0
  46. package/lib/typescript/utils/logError.d.ts.map +1 -0
  47. package/lib/typescript/{src/wayfinding → wayfinding}/components/MapView.d.ts +1 -1
  48. package/lib/typescript/wayfinding/components/MapView.d.ts.map +1 -0
  49. package/lib/typescript/wayfinding/hooks/index.d.ts.map +1 -0
  50. package/lib/typescript/wayfinding/index.d.ts.map +1 -0
  51. package/lib/typescript/{src/wayfinding → wayfinding}/store/index.d.ts +13 -13
  52. package/lib/typescript/wayfinding/store/index.d.ts.map +1 -0
  53. package/lib/typescript/{src/wayfinding → wayfinding}/store/utils.d.ts +0 -1
  54. package/lib/typescript/wayfinding/store/utils.d.ts.map +1 -0
  55. package/lib/typescript/wayfinding/types/constants.d.ts.map +1 -0
  56. package/lib/typescript/{src/wayfinding → wayfinding}/types/index.d.ts +1 -1
  57. package/lib/typescript/wayfinding/types/index.d.ts.map +1 -0
  58. package/lib/typescript/wayfinding/utils/index.d.ts +3 -0
  59. package/lib/typescript/wayfinding/utils/index.d.ts.map +1 -0
  60. package/lib/typescript/wayfinding/utils/mapper.d.ts.map +1 -0
  61. package/package.json +24 -35
  62. package/src/sdk/index.ts +67 -52
  63. package/src/sdk/internaDelegatedState.ts +54 -0
  64. package/src/sdk/nativeInterface.ts +31 -27
  65. package/src/sdk/types/index.ts +7 -6
  66. package/src/sdk/utils.ts +12 -9
  67. package/src/utils/logError.ts +1 -1
  68. package/src/wayfinding/components/MapView.tsx +103 -104
  69. package/src/wayfinding/hooks/index.ts +94 -91
  70. package/src/wayfinding/store/index.tsx +4 -4
  71. package/src/wayfinding/types/index.ts +1 -1
  72. package/src/wayfinding/utils/index.ts +2 -1
  73. package/LICENSE +0 -21
  74. package/README.md +0 -200
  75. package/SECURITY-POLICY.md +0 -9
  76. package/lib/commonjs/index.js +0 -73
  77. package/lib/commonjs/sdk/index.js +0 -932
  78. package/lib/commonjs/sdk/nativeInterface.js +0 -20
  79. package/lib/commonjs/sdk/types/constants.js +0 -68
  80. package/lib/commonjs/sdk/types/index.js +0 -405
  81. package/lib/commonjs/sdk/utils.js +0 -156
  82. package/lib/commonjs/utils/index.js +0 -17
  83. package/lib/commonjs/utils/logError.js +0 -21
  84. package/lib/commonjs/wayfinding/components/MapView.js +0 -389
  85. package/lib/commonjs/wayfinding/components/MapView.js.map +0 -1
  86. package/lib/commonjs/wayfinding/hooks/index.js +0 -229
  87. package/lib/commonjs/wayfinding/hooks/index.js.map +0 -1
  88. package/lib/commonjs/wayfinding/index.js +0 -57
  89. package/lib/commonjs/wayfinding/store/index.js +0 -242
  90. package/lib/commonjs/wayfinding/store/index.js.map +0 -1
  91. package/lib/commonjs/wayfinding/store/utils.js +0 -49
  92. package/lib/commonjs/wayfinding/store/utils.js.map +0 -1
  93. package/lib/commonjs/wayfinding/types/constants.js +0 -13
  94. package/lib/commonjs/wayfinding/types/constants.js.map +0 -1
  95. package/lib/commonjs/wayfinding/types/index.js +0 -6
  96. package/lib/commonjs/wayfinding/utils/index.js +0 -11
  97. package/lib/commonjs/wayfinding/utils/mapper.js +0 -206
  98. package/lib/module/index.js +0 -12
  99. package/lib/module/sdk/index.js +0 -903
  100. package/lib/module/sdk/nativeInterface.js +0 -18
  101. package/lib/module/sdk/types/constants.js +0 -63
  102. package/lib/module/sdk/types/index.js +0 -434
  103. package/lib/module/sdk/utils.js +0 -144
  104. package/lib/module/utils/index.js +0 -2
  105. package/lib/module/utils/logError.js +0 -15
  106. package/lib/module/wayfinding/components/MapView.js +0 -379
  107. package/lib/module/wayfinding/components/MapView.js.map +0 -1
  108. package/lib/module/wayfinding/hooks/index.js +0 -220
  109. package/lib/module/wayfinding/hooks/index.js.map +0 -1
  110. package/lib/module/wayfinding/index.js +0 -13
  111. package/lib/module/wayfinding/store/index.js +0 -206
  112. package/lib/module/wayfinding/store/index.js.map +0 -1
  113. package/lib/module/wayfinding/store/utils.js +0 -38
  114. package/lib/module/wayfinding/store/utils.js.map +0 -1
  115. package/lib/module/wayfinding/types/constants.js +0 -7
  116. package/lib/module/wayfinding/types/index.js +0 -2
  117. package/lib/module/wayfinding/utils/index.js +0 -4
  118. package/lib/module/wayfinding/utils/mapper.js +0 -195
  119. package/lib/typescript/src/index.d.ts.map +0 -1
  120. package/lib/typescript/src/sdk/index.d.ts.map +0 -1
  121. package/lib/typescript/src/sdk/nativeInterface.d.ts.map +0 -1
  122. package/lib/typescript/src/sdk/types/constants.d.ts.map +0 -1
  123. package/lib/typescript/src/sdk/types/index.d.ts.map +0 -1
  124. package/lib/typescript/src/sdk/utils.d.ts.map +0 -1
  125. package/lib/typescript/src/utils/index.d.ts.map +0 -1
  126. package/lib/typescript/src/utils/logError.d.ts.map +0 -1
  127. package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +0 -1
  128. package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +0 -1
  129. package/lib/typescript/src/wayfinding/index.d.ts.map +0 -1
  130. package/lib/typescript/src/wayfinding/store/index.d.ts.map +0 -1
  131. package/lib/typescript/src/wayfinding/store/utils.d.ts.map +0 -1
  132. package/lib/typescript/src/wayfinding/types/constants.d.ts.map +0 -1
  133. package/lib/typescript/src/wayfinding/types/index.d.ts.map +0 -1
  134. package/lib/typescript/src/wayfinding/utils/index.d.ts +0 -3
  135. package/lib/typescript/src/wayfinding/utils/index.d.ts.map +0 -1
  136. package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +0 -1
  137. package/security.txt +0 -4
  138. /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
  139. /package/lib/typescript/{src/sdk → sdk}/types/constants.d.ts +0 -0
  140. /package/lib/typescript/{src/utils → utils}/index.d.ts +0 -0
  141. /package/lib/typescript/{src/utils → utils}/logError.d.ts +0 -0
  142. /package/lib/typescript/{src/wayfinding → wayfinding}/hooks/index.d.ts +0 -0
  143. /package/lib/typescript/{src/wayfinding → wayfinding}/index.d.ts +0 -0
  144. /package/lib/typescript/{src/wayfinding → wayfinding}/types/constants.d.ts +0 -0
  145. /package/lib/typescript/{src/wayfinding → wayfinding}/utils/mapper.d.ts +0 -0
@@ -1,18 +0,0 @@
1
- import { NativeEventEmitter, NativeModules } from "react-native";
2
- const {
3
- RNCSitumPlugin
4
- } = NativeModules;
5
- if (!RNCSitumPlugin) {
6
- throw new Error("react-native-situm-plugin: NativeModule is null");
7
- }
8
- let nativeEventEmitter = null;
9
- module.exports = {
10
- RNCSitumPlugin,
11
- get SitumPluginEventEmitter() {
12
- if (!nativeEventEmitter) {
13
- nativeEventEmitter = new NativeEventEmitter(RNCSitumPlugin);
14
- }
15
- return nativeEventEmitter;
16
- }
17
- };
18
- //# sourceMappingURL=nativeInterface.js.map
@@ -1,63 +0,0 @@
1
- export let NavigationStatus = /*#__PURE__*/function (NavigationStatus) {
2
- NavigationStatus["START"] = "start";
3
- NavigationStatus["STOP"] = "stop";
4
- NavigationStatus["OUT_OF_ROUTE"] = "outOfRoute";
5
- NavigationStatus["UPDATE"] = "update";
6
- return NavigationStatus;
7
- }({});
8
- export let NavigationUpdateType = /*#__PURE__*/function (NavigationUpdateType) {
9
- NavigationUpdateType["PROGRESS"] = "PROGRESS";
10
- NavigationUpdateType["OUT_OF_ROUTE"] = "OUT_OF_ROUTE";
11
- NavigationUpdateType["DESTINATION_REACHED"] = "DESTINATION_REACHED";
12
- NavigationUpdateType["CANCELLED"] = "CANCELLED";
13
- return NavigationUpdateType;
14
- }({});
15
- export let SdkNavigationUpdateType = /*#__PURE__*/function (SdkNavigationUpdateType) {
16
- SdkNavigationUpdateType["START"] = "onNavigationStart";
17
- SdkNavigationUpdateType["PROGRESS"] = "onNavigationProgress";
18
- SdkNavigationUpdateType["FINISHED"] = "onNavigationFinished";
19
- SdkNavigationUpdateType["DESTINATION_REACHED"] = "onNavigationDestinationReached";
20
- SdkNavigationUpdateType["OUTSIDE_ROUTE"] = "onUserOutsideRoute";
21
- SdkNavigationUpdateType["CANCELLATION"] = "onNavigationCancellation";
22
- SdkNavigationUpdateType["ERROR"] = "onNavigationError";
23
- return SdkNavigationUpdateType;
24
- }({});
25
- export let LocationStatusName = /*#__PURE__*/function (LocationStatusName) {
26
- LocationStatusName["STARTING"] = "STARTING";
27
- LocationStatusName["USER_NOT_IN_BUILDING"] = "USER_NOT_IN_BUILDING";
28
- LocationStatusName["STOPPED"] = "STOPPED";
29
- return LocationStatusName;
30
- }({});
31
-
32
- /**
33
- * Available accessibility modes used in the {@link DirectionsRequest}.
34
- *
35
- * @property CHOOSE_SHORTEST The route should choose the best route, without taking into account if it is accessible or not.
36
- * This option is the default so you don't have to do anything in order to use it
37
- * @property ONLY_ACCESSIBLE The route should always use accessible nodes.
38
- * @property ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES The route should never use accessible floor changes (use this to force routes not to use lifts).
39
- */
40
- export let AccessibilityMode = /*#__PURE__*/function (AccessibilityMode) {
41
- AccessibilityMode["CHOOSE_SHORTEST"] = "CHOOSE_SHORTEST";
42
- AccessibilityMode["ONLY_ACCESSIBLE"] = "ONLY_ACCESSIBLE";
43
- AccessibilityMode["ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES"] = "ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES";
44
- return AccessibilityMode;
45
- }({});
46
- export let InternalCallType = /*#__PURE__*/function (InternalCallType) {
47
- InternalCallType["LOCATION"] = "LOCATION";
48
- InternalCallType["LOCATION_STATUS"] = "LOCATION_STATUS";
49
- InternalCallType["LOCATION_ERROR"] = "LOCATION_ERROR";
50
- InternalCallType["LOCATION_STOPPED"] = "LOCATION_STOPPED";
51
- InternalCallType["NAVIGATION_START"] = "NAVIGATION_START";
52
- InternalCallType["NAVIGATION_DESTINATION_REACHED"] = "NAVIGATION_DESTINATION_REACHED";
53
- InternalCallType["NAVIGATION_PROGRESS"] = "NAVIGATION_PROGRESS";
54
- InternalCallType["NAVIGATION_OUT_OF_ROUTE"] = "NAVIGATION_OUT_OF_ROUTE";
55
- InternalCallType["NAVIGATION_CANCELLATION"] = "NAVIGATION_CANCELLATION";
56
- InternalCallType["NAVIGATION_ERROR"] = "NAVIGATION_ERROR";
57
- InternalCallType["GEOFENCES_ENTER"] = "GEOFENCES_ENTER";
58
- InternalCallType["GEOFENCES_EXIT"] = "GEOFENCES_EXIT";
59
- return InternalCallType;
60
- }({});
61
- export const CURRENT_USER_LOCATION_ID = -1;
62
- export const CUSTOM_DESTINATION_LOCATION_ID = -2;
63
- //# sourceMappingURL=constants.js.map
@@ -1,434 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- /**
4
- * @name Building
5
- * @description A Building object definition
6
- *
7
- * @property {string} buildingIdentifier - The unique identifier of the resource
8
- * @property {string} name - The building name that is appropriate for display to the user.
9
- * @property {string} address - Te building address.
10
- * @property {Bounds} bounds - Compute corners of this building, without rotation, in earth coordinates.
11
- * @property {Bounds} boundsRotated - Compute corners of this building, with rotation, in earth coordinates.
12
- * @property {Coordinate} center - Center of the building's base, as geographical coordinate.
13
- * @property {Dimensions} Dimensions - Dimensions of building's base (height and width) in meters.
14
- * @property {string} infoHtml - Additional information about building, formatted with HTML
15
- * @property {string} pictureThumbUrl - The URL of building thumbnail image
16
- * @property {string} pictureUrl - The URL of building image
17
- * @property {number} rotation - Rotation angle of the building's base, relative to the west-east axis, increasing in counter-clockwise, being 0 the west-east axis.
18
- * @property {string} userIdentifier - Unique identifier of the owner user of the building
19
- * @property {object} customFields - Map of custom fields, indexed by their name.
20
- */
21
-
22
- /**
23
- * @name BuildingInfo
24
- * @description Full information of a building
25
- *
26
- * @property {Building} building - Building basic information
27
- * @property {Floor[]} floors - Array with the information of each floor
28
- * @property {Poi[]} indoorPOIs - Array with the information of each indoor POI
29
- * @property {Poi[]} outdoorPOIs - Array with the information of each outdoor POI
30
- * @property {Geofence} geofences - Array with the information of each geofence
31
- */
32
-
33
- /** @name Bounds
34
- * @description Represents a rectangle bounds in a greographic 2D space.
35
- *
36
- * @property {Coordinate} northEast - The coordinate of the north-east corner of the bound.
37
- * @property {Coordinate} northWest - The coordinate of the north-west corner of the bound.
38
- * @property {Coordinate} southEast - The coordinate of the south-east corner of the bound.
39
- * @property {Coordinate} southWest - The coordinate of the south-east corner of the bound.
40
- */
41
-
42
- /** @name Dimensions
43
- * @description Define 2D dimensions of a rectangular area.
44
- *
45
- * @property {number} width - Width of rectangle in meters
46
- * @property {number} height - Height of rectangle in meters.
47
- */
48
-
49
- /**
50
- * @name Coordinate
51
- * @description A structure that contains geographical coordinate.
52
- *
53
- * @property {number} latitude - Latitude in degrees
54
- * @property {number} longitude - Longitude in degrees
55
- */
56
-
57
- /**
58
- * @name CartesianCoordinate
59
- * @description A structure that contains cartesian coordinate.
60
- *
61
- * @property {number} x - Value of coordinate at x-axis
62
- * @property {number} y - Value of coordinate at y-axis
63
- */
64
-
65
- /**
66
- * @name Floor
67
- * @description Floor of a building.
68
- *
69
- * @property {number} altitude - Altitude of the floor above ground level, in meters.
70
- * @property {string} buildingIdentifier - The identifier of building which this floor belongs.
71
- * @property {number} level - The number of the floor.
72
- * @property {string} name - The name of the floor
73
- * @property {string} mapUrl - The floor map image url
74
- * @property {number} scale - The scale of the floor image, in px/meters
75
- * @property {string} floorIdentifier - The unique identifier of the resource
76
- */
77
-
78
- /**
79
- * @name POI
80
- * @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
81
- *
82
- * @property {string} identifier - The unique identifier of the resource
83
- * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
84
- * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate of this position, relative to building {@link Bounds}.
85
- * @property {Coordinate} coordinate - Geographical coordinate of this position
86
- * @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
87
- * @property {string} poiName - A name for the POI, appropriate for display to the user.
88
- * @property {Point} position - {@link Point} where the point is located.
89
- * @property {boolean} isIndoor - Whether the POI is placed outside the building or not.
90
- * @property {boolean} isOutdoor - Whether the POI is placed outside the building or not.
91
- * @property {PoiCategory} category - Category of the POI
92
- * @property {string} infoHtml - Additional information about POI, in HTML
93
- * @property {object} customFields - Map of custom fields, indexed by their name.
94
- */
95
-
96
- /**
97
- * @name Geofence
98
- * @description Point of Interest, associated to a building, regardless of whether it's place inside or outside the building.
99
- *
100
- * @property {string} identifier - The unique identifier of the resource
101
- * @property {string} buildingIdentifier - Identifier of building to which the POI belongs.
102
- * @property {string} floorIdentifier - If this POI is outside the building (isOutdoor == true), this field has no meaning.
103
- * @property {string} name - A name for the geofence, appropriate for display to the user.
104
- * @property {string} infoHtml - Additional information about POI, in HTML
105
- * @property {Point[]} polygonPoints - List of points of that define the area of the geofence
106
- * @property {object} customFields - Map of custom fields, indexed by their name.
107
- */
108
-
109
- /**
110
- * @name PoiCategory
111
- * @description Category of Point of Interest.
112
- *
113
- * @property {string} poiCategoryCode - Unique code of the category
114
- * @property {string} poiCategoryName - The category name appropriate for display to the user
115
- * @property {string} icon_selected - The selected icon url
116
- * @property {string} icon_unselected - The unselected icon url
117
- * @property {boolean} public - Whether the category is public or not
118
- */
119
-
120
- /**
121
- * @name PoiIcon
122
- * @description Category of Point of Interest.
123
- *
124
- * @property {string} data - Base64 POI icon image
125
- */
126
-
127
- /**
128
- * @name Point
129
- * @description Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.
130
- *
131
- * @property {string} buildingIdentifier - Unique identifier for the building to which this point belongs
132
- * @property {CartesianCoordinate} cartesianCoordinate - Cartesian coordinate (in meters) relative to the Bounds of building's base.
133
- * @property {Coordinate} coordinate - Geographic coordinate (latitude, longitude) of the point, regardless of whether it's placed inside or outside the building.
134
- * @property {string} floorIdentifier - Floor identifier (inside the building) where this point is placed.
135
- * @property {boolean} isIndoor - If the POI is inside the building.
136
- * @property {boolean} idOutdoor - If the POI is outside the building.
137
- */
138
-
139
- /**
140
- * @name Route
141
- * @description Route between two points.
142
- *
143
- * @property {Poi} poiTo - The destination Poi the user is currently navigating to.
144
- * @property {RouteStep[]} edges - Ordered list of steps to go to the goal point
145
- * @property {RouteStep} firstStep - First step
146
- * @property {Point} from - Point where the route starts.
147
- * @property {Indication} indications - Ordered list of instructions to go to the destination
148
- * @property {RouteStep} lastStep - Last step
149
- * @property {Point[]} nodes - A collection of points of the route (not ordered)
150
- * @property {Point[]} points - List of ordered points of the route
151
- * @property {Point} to - Last point and goal of the route.
152
- * @property {RouteStep[]} steps - Ordered list of steps to go to the goal point
153
- * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
154
- */
155
-
156
- /**
157
- * @name RouteStep
158
- * @description A fragment of a route, described by the initial point from and the last point to of the fragment, and some information about the step within the route.
159
- *
160
- * @property {number} distance - Distance between from and to in meters.
161
- * @property {number} distanceToGoal - Distance in meters between the start point of this step (from) and the last point in the route ('to' of the last step).
162
- * @property {Point} from - Start point of this step.
163
- * @property {number} id - Position of this RouteStep in the list of steps (Route.steps) of the route to which it belongs.
164
- * @property {Point} to - End point of this step.
165
- * @property {boolean} isFirst - Returns true if this is the first step in the route.
166
- * @property {boolean} isLast - Returns true if this is the last step in the route.
167
- */
168
-
169
- /**
170
- * @name RouteSegment
171
- * @description A fragment of a route, described by a floor identifier and a list of consecutive points from the same floor
172
- *
173
- * @property {string} floorIdentifier - Identifier of the floor containing the points in this segment
174
- * @property {Point[]} points - Consecutive points in the same floor forming a path
175
- */
176
-
177
- /**
178
- * @name Indication
179
- * @description Represents the instruction that a user should follow when on a RouteStep to continue the route.
180
- *
181
- * @property {number} distance - The distance between the origin and destination
182
- * @property {number} distanceToNextLevel - The number of levels between the origin and destination
183
- * @property {string} indicationType - The Indication.Action of the instruction as String
184
- * @property {number} orientation - The angle a user should change his direction in order to go from the origin to the destination.
185
- * @property {string} orientationType - The Indication.Orientation of the instruction as String
186
- * @property {number} stepIdxDestination - The index of the indication's step of destination.
187
- * @property {number} stepIdxOrigin - The index of the indication's step of origin
188
- * @property {boolean} neededLevelChange - If the user should change the level in order to arrive at the destination.
189
- */
190
-
191
- /**
192
- * @name NavigationProgress
193
- * @description Provides information of the progress of a user while following a route.
194
- *
195
- * @property {Location} closestLocationInRoute - Closest location in the route from the user location provided .
196
- * @property {number} distanceToClosestPointInRoute - Distance between the real user location (provided to updateWithLocation(Location)) and the closest route location.
197
- * @property {Indication} currentIndication - The current indication.
198
- * @property {Indication} nextIndication - The next indication.
199
- * @property {number} currentStepIndex - The index of the closest route step to the user, where closestLocationInRoute is.
200
- * @property {number} distanceToGoal - The distance in meters from closestLocationInRoute to route's goal point.
201
- * @property {number} distanceToEndStep - The distance in meters to go from closestLocationInRoute to the end of the current step.
202
- * @property {number} timeToEndStep - The estimated time to go from closestLocationInRoute to the end of the current route step, considering a speed of 1 meter/second.
203
- * @property {number} timeToGoal - The estimated time to go from closestLocationInRoute to the goal/end of route, considering a speed of 1 meter/second.
204
- * @property {RouteStep} routeStep - The closest route step to the user, where closestLocationInRoute is.
205
- * @property {Point[]} points - List of ordered points of the remaining route
206
- * @property {RouteSegment[]} segments - List of segments formed by consecutive points and a floor identifier
207
- */
208
-
209
- /**
210
- * @name LocationRequest
211
- * @description A data object that contains parameters for the location service, LocationManager.
212
- *
213
- * @property {number} buildingIdentifier - Identifier of the building on which the positioning will be started
214
- * @property {number} interval - Default interval (in milliseconds) to notify location updates
215
- * @property {string} indoorProvider - Default indoor provider. Possible values are INPHONE and SUPPORT
216
- * @property {boolean} useBle - Defines whether or not to use BLE for positioning
217
- * @property {boolean} useWifi - Defines whether or not to use Wi-Fi for positioning
218
- * @property {boolean} useGps - Defines whether or not to use GPS for indoor positioning
219
- * @property {boolean} useBarometer - Defines whether or not to use the barometer for indoor positioning
220
- * @property {string} motionMode - Default motion mode. Possible values are BY_CAR, BY_FOOT, and RADIOMAX
221
- * @property {boolean} useForegroundService - Defines whether or not to activate the {@link http://developers.situm.es/pages/android/using_situm_sdk_background.html foreground service}
222
- * @property {boolean} useDeadReckoning - Defines whether or not to use dead reckoning to get fast position updates using only the inertial sensors, between the server position updates.
223
- * @property {OutdoorLocationOptions} outdoorLocationOptions - Outdoor location options. Only used in an indoor/outdoor request
224
- * @property {BeaconFilter[]} beaconFilters - Deprecated - Beacon filters to be handled during scan time, otherwise only Situm beacons will be scanned. Can be invoked multiple times to add as much beacon filters as you want. The SitumSDK now does it automatically
225
- * @property {number} smallestDisplacement - Default smallest displacement to notify location updates
226
- * @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW, and BATTERY_SAVER
227
- * @property {ForegroundServiceNotificationOptions} foregroundServiceNotificationOptions - Used to configure the notification options for a foreground service, allowing the definition of the title, message, stop button, button text, and the {@link ForegroundServiceNotificationsTapAction}.
228
- */
229
-
230
- /**
231
- * A data object that let you customize the Foreground Service Notification
232
- * that will be shown in the system's tray when the app is running as a
233
- * Foreground Service.
234
- * To be used with {@link LocationRequest}.
235
- * Only applies for Android.
236
- * @property {ForegroundServiceNotificationOptions} foregroundServiceNotificationOptions
237
- */
238
-
239
- /**
240
- * @name ForegroundServiceNotificationsTapAction
241
- * @description Predefined actions performed when tapping the Situm Foreground Service Notification.
242
- */
243
- export let ForegroundServiceNotificationsTapAction = /*#__PURE__*/function (ForegroundServiceNotificationsTapAction) {
244
- ForegroundServiceNotificationsTapAction["LaunchApp"] = "LAUNCH_APP";
245
- ForegroundServiceNotificationsTapAction["LaunchSettings"] = "LAUNCH_SETTINGS";
246
- ForegroundServiceNotificationsTapAction["DoNothing"] = "DO_NOTHING";
247
- return ForegroundServiceNotificationsTapAction;
248
- }({});
249
-
250
- /**
251
- * @name NavigationRequest
252
- * @description A data object that contains the request for navigation.
253
- *
254
- * @property {number} distanceToGoalThreshold - Distance threshold to consider reaching the goal (meters).
255
- * @property {number} distanceToIgnoreFirstIndication - Maximum distance to ignore the first indication when navigating (meters).
256
- * @property {number} distanceToFloorChangeThreshold - Distance threshold from when a floor change is considered reached (meters).
257
- * @property {number} distanceToChangeIndicationThreshold - Distance threshold to change the indication (meters).
258
- * @property {boolean} ignoreLowQualityLocations - Ignore low-quality locations.
259
- * @property {number} indicationsInterval - Interval between indications (milliseconds).
260
- * @property {number} outsideRouteThreshold - Distance threshold to consider being outside the route (meters).
261
- * @property {number} roundIndicationsStep - Step to round indications (meters).
262
- * @property {number} timeToFirstIndication - Time to wait until the first indication is returned (milliseconds).
263
- * @property {number} timeToIgnoreUnexpectedFloorChanges - Time to ignore the locations received during navigation, when the next indication is a floor change,
264
- * if the locations are on a wrong floor (not in origin or destination floors) (milliseconds).
265
- */
266
-
267
- /**
268
- * @name DirectionsRequest
269
- * @description A data object that contains the request for directions.
270
- *
271
- * @property {Building} positioningBuilding
272
- * @property {Point|Location} from - Current user's position as the starting point of the route.
273
- * @property {Point|Poi} to - Point to, where the route should end.
274
- * @property {DirectionsOptions} options - Options that can be added to the request.
275
- */
276
-
277
- /**
278
- * @name DirectionsOptions
279
- * @description A data object that contains the directions options.
280
- *
281
- * @property {boolean} minimizeFloorChanges - Defines wheter or not the route should be calculated minimizing the floor changes even if the result is longer.
282
- * @property {string} accessibilityMode - Defines the accessibility mode of the route. Possible values are: CHOOSE_SHORTEST, ONLY_NOT_ACCESSIBLE_FLOOR_CHANGES, ONLY_ACCESSIBLE
283
- * @property {number} startingAngle - Current user's orientation in degrees.
284
- * @property {String[]} includedTags List of tags that you want to use when calculating a route. Only the tags added here will be used. If there are other tags in the graph they won't be used. The edges without a tag will be used. If you don't set nothing all the graph will be used to calculate the route. You can learn more about this topic on https://situm.com/docs/cartography-management/#tags
285
- * @property {String[]} excludedTags List of tags that you want your route to avoid. If you exclude a tag the route will never pass through an edge that have this tag. If the route can only be generated passing through an edge with this tag the route calculation will fail. You can learn more about this topic on https://situm.com/docs/cartography-management/#tags.
286
- */
287
-
288
- /**
289
- * @name OutdoorLocationOptions
290
- * @description Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
291
- *
292
- * @property {boolean} continuousMode - Environment detection continuous mode (true) or burst mode (false).
293
- * @property {boolean} userDefinedThreshold
294
- * @property {number} burstInterval - Interval to scan for GPS and detect the environment (in seconds).
295
- * @property {number} averageSnrThreshold
296
- */
297
-
298
- /**
299
- * @name BeaconFilter
300
- * @description Represents a BLE filter. Now the only field is the BLE proximity UUID
301
- *
302
- * @property {string} uuid - Assigns the proximity UUID
303
- */
304
-
305
- /**
306
- * @name RealTimeRequest
307
- * @description A data object that contains the parameters to process realtime data of the users.
308
- *
309
- * @property {Building} building object
310
- * @property {int} pollTime - Interval in milliseconds (minimum is 3000ms).
311
- */
312
-
313
- /**
314
- * @name RealTimeData
315
- * @description A data object that contains information of the location of users in realtime.
316
- *
317
- * @property {Array<Location>} locations object
318
- */
319
-
320
- /**
321
- * @name SdkVersion
322
- * @description Represents the version information of the SDK and its compatibility with different platforms.
323
- *
324
- * @type
325
- * @property {string} react_native - The version of React Native used in the SDK.
326
- * @property {string} [ios] - Optional. The specific version of the Situm SDK for the iOS platform.
327
- * @property {string} [android] - Optional. The specific version of the Situm SDK for the Android platform.
328
- */
329
-
330
- /**
331
- * @name ConfigurationOptions
332
- * @description Configuration options for initializing the SDK or other modules.
333
- *
334
- * @type
335
- * @property {boolean} [useRemoteConfig] - Optional. Determines whether to use Remote Configuration settings.
336
- * @property {number} [cacheMaxAge] - Optional. The maximum age of the cache in seconds.
337
- */
338
-
339
- /**
340
- * @name Location
341
- * @description Represents a location with various attributes including position, accuracy, and bearing.
342
- *
343
- * @interface
344
- * @property {Position} [position] - Optional. The position information of the location.
345
- * @property {number} [accuracy] - Optional. The accuracy of the location information in meters.
346
- * @property {Object} [bearing] - Optional. Bearing information including degrees and degreesClockwise.
347
- * @property {boolean} [hasBearing] - Optional. Indicates if bearing information is available.
348
- */
349
-
350
- /**
351
- * @name LocationStatus
352
- * @description Represents the status of a location, including a name and a numeric code.
353
- *
354
- * @interface
355
- * @property {LocationStatusName} statusName - The name of the location status.
356
- * @property {number} statusCode - The numeric code representing the location status.
357
- */
358
-
359
- /**
360
- * @name ErrorType
361
- * @description Enumeration of error types to categorize the severity of errors.
362
- *
363
- * @enum {string}
364
- * @property {string} CRITICAL - Represents critical errors that will cause the system not to work (e.g. positioning will be stopped).
365
- * @property {string} NON_CRITICAL - Represents non-critical errors that are less severe.
366
- */
367
- export let ErrorType = /*#__PURE__*/function (ErrorType) {
368
- ErrorType["CRITICAL"] = "CRITICAL";
369
- ErrorType["NON_CRITICAL"] = "NON_CRITICAL";
370
- return ErrorType;
371
- }({});
372
-
373
- /**
374
- * @name ErrorCode
375
- * @description Enumeration of error codes provided by Situm SDK.
376
- *
377
- * @enum {string}
378
- * @property {string} LOCATION_PERMISSION_DENIED - Indicates that location permissions were not granted by the user.
379
- * @property {string} BLUETOOTH_PERMISSION_DENIED - Indicates that Bluetooth permissions were not granted.
380
- * @property {string} BLUETOOTH_DISABLED - Indicates that Bluetooth is disabled on the device.
381
- * @property {string} LOCATION_DISABLED - Indicates that the location services are disabled on the device.
382
- * @property {string} REDUCED_ACCURACY - Indicates that the precise location has been turned off on the device.
383
- * @property {string} UNKNOWN - Represents an unknown error or an error that does not fit other categories.
384
- */
385
- export let ErrorCode = /*#__PURE__*/function (ErrorCode) {
386
- ErrorCode["LOCATION_PERMISSION_DENIED"] = "LOCATION_PERMISSION_DENIED";
387
- ErrorCode["BLUETOOTH_PERMISSION_DENIED"] = "BLUETOOTH_PERMISSION_DENIED";
388
- ErrorCode["BLUETOOTH_DISABLED"] = "BLUETOOTH_DISABLED";
389
- ErrorCode["LOCATION_DISABLED"] = "LOCATION_DISABLED";
390
- ErrorCode["REDUCED_ACCURACY"] = "REDUCED_ACCURACY";
391
- ErrorCode["UNKNOWN"] = "UNKNOWN";
392
- return ErrorCode;
393
- }({});
394
-
395
- /**
396
- * @name Error
397
- * @description Represents an error with a specific code, message, and type.
398
- *
399
- * @interface
400
- * @property {ErrorCode} code - The specific error code associated with this error.
401
- * @property {string} message - A descriptive message providing more details about the error.
402
- * @property {ErrorType} type - The type of the error indicating its severity (critical or non-critical).
403
- */
404
-
405
- // TODO: add types
406
-
407
- export class InternalCall {
408
- constructor(type, data) {
409
- this.type = type;
410
- this.data = data;
411
- }
412
- get() {
413
- return this.data;
414
- }
415
- }
416
-
417
- /**
418
- * @name
419
- * UserHelperColorScheme
420
- * @description
421
- * Color scheme for the user helper UI.
422
- * @property {string} primaryColor - Primary color for the user helper UI. Use HEX color code (e.g. "#ff5733").
423
- * @property {string} secondaryColor - Secondary color for the user helper UI. Use HEX color code (e.g. "#ff5733").
424
- */
425
-
426
- /**
427
- * @name
428
- * UserHelperOptions
429
- * @description
430
- * Configuration options for the user helper.
431
- * @property {boolean} enabled - Whether the user helper is enabled. Equivalent to the underlying native SitumSdk.userHelperManager#autoManage(true).
432
- * @property {UserHelperColorScheme} colorScheme - Color scheme for the user helper UI.
433
- */
434
- //# sourceMappingURL=index.js.map
@@ -1,144 +0,0 @@
1
- import { LocationStatusName, logError } from "..";
2
- import { ErrorCode, ErrorType } from "./types";
3
- /**
4
- * Handles callbacks coming from SDKs asynchronously
5
- *
6
- * @param response
7
- * @param resolve
8
- * @param reject
9
- * @param errorMessage
10
- */
11
-
12
- export const handleAsyncCallback = (response, resolve, reject, errorMessage) => {
13
- if (response !== null && response !== void 0 && response.success) {
14
- resolve();
15
- } else {
16
- reject({
17
- code: ErrorCode.UNKNOWN,
18
- message: errorMessage || "Unknown error.",
19
- type: ErrorType.NON_CRITICAL
20
- });
21
- }
22
- };
23
-
24
- /**
25
- * Handles callbacks coming from SDKs synchronously
26
- *
27
- * @param response
28
- * @param errorMessage
29
- */
30
-
31
- export const handleSyncCallback = (r, errorMessage) => {
32
- if (r !== null && r !== void 0 && r.success) {
33
- return;
34
- } else {
35
- throw {
36
- code: -1,
37
- message: errorMessage || "Unknown error."
38
- };
39
- }
40
- };
41
-
42
- /**
43
- * Wraps all SDK API methods with a exception handling code, and defines helper functions.
44
- *
45
- * @param fn
46
- * @returns
47
- */
48
- export const exceptionWrapper = fn => {
49
- let returnValue;
50
- try {
51
- fn({
52
- onCallback: handleSyncCallback,
53
- onSuccess: response => {
54
- returnValue = response;
55
- },
56
- onError: error => {
57
- logError(error);
58
- throw error;
59
- }
60
- });
61
- } catch (error) {
62
- logError(error);
63
- throw error;
64
- }
65
- return returnValue;
66
- };
67
-
68
- /**
69
- * Wraps all SDK API methods with a promise, and defines helper functions.
70
- *
71
- * @param fn
72
- * @returns
73
- */
74
- export const promiseWrapper = fn => {
75
- return new Promise((resolve, reject) => {
76
- try {
77
- return fn({
78
- resolve,
79
- reject,
80
- onCallback: (r, errorMessage) => handleAsyncCallback(r, resolve, reject, errorMessage),
81
- onSuccess: response => resolve(response),
82
- onError: error => {
83
- logError(error);
84
- reject(error);
85
- }
86
- });
87
- } catch (error) {
88
- logError(error);
89
- reject({
90
- code: ErrorCode.UNKNOWN,
91
- message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error.",
92
- type: ErrorType.NON_CRITICAL
93
- });
94
- }
95
- });
96
- };
97
- export function locationStatusAdapter(statusName) {
98
- // The MapView will only understand status names declared at LocationStatusName and CALCULATING
99
- // is not one of them.
100
- // TODO: implement status & error adapter on native SDKs.
101
- if (statusName === "CALCULATING") {
102
- statusName = LocationStatusName.STARTING;
103
- }
104
- return statusName;
105
- }
106
- export function locationErrorAdapter(error) {
107
- let adaptedCode = ErrorCode.UNKNOWN;
108
- const adaptedMessage = error.message;
109
- const adaptedType = ErrorType.CRITICAL;
110
- switch (error.code.toString()) {
111
- case "8001": // MISSING_LOCATION_PERMISSION
112
- case "8": // kSITLocationErrorLocationDisabled
113
- case "9": // kSITLocationErrorLocationRestricted
114
- case "10":
115
- // kSITLocationErrorLocationAuthStatusNotDetermined
116
- adaptedCode = ErrorCode.LOCATION_PERMISSION_DENIED;
117
- break;
118
- case "8002":
119
- // LOCATION_DISABLED
120
- adaptedCode = ErrorCode.LOCATION_DISABLED;
121
- break;
122
- case "8012":
123
- // MISSING_BLUETOOTH_PERMISSION
124
- adaptedCode = ErrorCode.BLUETOOTH_PERMISSION_DENIED;
125
- break;
126
- case "8100": //BLUETOOTH_DISABLED. 8100 ->This number does not exist in Situm SDK. We made it up in SitumMapper.java (RN adapter)
127
- case "6":
128
- // kSITLocationErrorBluetoothisOff
129
- adaptedCode = ErrorCode.BLUETOOTH_DISABLED;
130
- break;
131
- case "11":
132
- //kSITLocationErrorLocationAccuracyAuthorizationStatusReducedAccuracy
133
- adaptedCode = ErrorCode.REDUCED_ACCURACY;
134
- break;
135
- // Add more cases as needed
136
- }
137
- const returnError = {
138
- code: adaptedCode,
139
- message: adaptedMessage,
140
- type: adaptedType
141
- };
142
- return returnError;
143
- }
144
- //# sourceMappingURL=utils.js.map
@@ -1,2 +0,0 @@
1
- export * from "./logError";
2
- //# sourceMappingURL=index.js.map
@@ -1,15 +0,0 @@
1
- /**
2
- * Small utility that can be used as an error handler. You cannot just pass
3
- * `console.error` as a failure callback - it's not properly bound. If passes an
4
- * `Error` object, it will print the message and stack.
5
- */
6
- export const logError = __DEV__ ? function (response) {
7
- if (response instanceof String) {
8
- console.log(response);
9
- } else {
10
- console.log(JSON.stringify(response));
11
- }
12
- } : function (_response) {
13
- // do nothing
14
- };
15
- //# sourceMappingURL=logError.js.map