react-native-radar 3.10.0-beta.1 → 3.10.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.
@@ -18,7 +18,7 @@ android {
18
18
  minSdkVersion 16
19
19
  targetSdkVersion 31
20
20
  versionCode 1
21
- versionName '3.10.0-beta.1'
21
+ versionName '3.10.0-beta.2'
22
22
  }
23
23
  lintOptions {
24
24
  abortOnError false
package/dist/package.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "description": "React Native module for Radar, the leading geofencing and location tracking platform",
4
4
  "homepage": "https://radar.com",
5
5
  "license": "Apache-2.0",
6
- "version": "3.10.0-beta.1",
7
- "main": "dist/src/index.ts",
6
+ "version": "3.10.0-beta.2",
7
+ "main": "dist/src/index.js",
8
8
  "files": [
9
9
  "android",
10
10
  "ios",
@@ -18,7 +18,8 @@
18
18
  "test": "jest ./test/*.test.js",
19
19
  "check-latest-tag": "node ./scripts/check-latest-tag.cjs",
20
20
  "check-beta-tag": "node ./scripts/check-beta-tag.cjs",
21
- "build": "tsc"
21
+ "build": "tsc",
22
+ "copy-assets": "./copyAssets.sh"
22
23
  },
23
24
  "jest": {
24
25
  "preset": "react-native",
@@ -1,4 +1,4 @@
1
- import { Location, RadarAutocompleteOptions, RadarContextCallback, RadarGeocodeCallback, RadarGetDistanceOptions, RadarLocationCallback, RadarLogConversionCallback, RadarLogConversionOptions, RadarLogLevel, RadarMockTrackingOptions, RadarNotificationOptions, RadarPermissionsStatus, RadarRouteCallback, RadarRouteMatrix, RadarSearchGeofencesCallback, RadarSearchGeofencesOptions, RadarSearchPlacesCallback, RadarSearchPlacesOptions, RadarStartTripOptions, RadarTrackCallback, RadarTrackOnceOptions, RadarTrackTokenCallback, RadarTrackingOptions, RadarTrackingOptionsDesiredAccuracy, RadarTrackingOptionsForegroundService, RadarTripCallback, RadarTripOptions, RadarUpdateTripOptions, Event } from "./types";
1
+ import { Location, RadarAutocompleteOptions, RadarContextCallback, RadarGeocodeCallback, RadarGetDistanceOptions, RadarLocationCallback, RadarLogConversionCallback, RadarLogConversionOptions, RadarLogLevel, RadarMockTrackingOptions, RadarNotificationOptions, RadarPermissionsStatus, RadarRouteCallback, RadarRouteMatrix, RadarSearchGeofencesCallback, RadarSearchGeofencesOptions, RadarSearchPlacesCallback, RadarSearchPlacesOptions, RadarStartTripOptions, RadarTrackCallback, RadarTrackOnceOptions, RadarTrackTokenCallback, RadarTrackingOptions, RadarTrackingOptionsDesiredAccuracy, RadarTrackingOptionsForegroundService, RadarTripCallback, RadarTripOptions, RadarUpdateTripOptions, Event, RadarListenerCallback, RadarGetMatrixOptions } from "./types";
2
2
  export interface RadarNativeInterface {
3
3
  initialize: (publishableKey: string, fraud: boolean) => void;
4
4
  setLogLevel: (level: RadarLogLevel) => void;
@@ -41,10 +41,10 @@ export interface RadarNativeInterface {
41
41
  reverseGeocode: (location: any) => Promise<RadarGeocodeCallback>;
42
42
  ipGeocode: () => Promise<RadarGeocodeCallback>;
43
43
  getDistance: (option: RadarGetDistanceOptions) => Promise<RadarRouteCallback>;
44
- getMatrix: (option: RadarGetDistanceOptions) => Promise<RadarRouteMatrix>;
44
+ getMatrix: (option: RadarGetMatrixOptions) => Promise<RadarRouteMatrix>;
45
45
  logConversion: (options: RadarLogConversionOptions) => Promise<RadarLogConversionCallback>;
46
- sendEvent: (name: string, metadata: Object) => void;
47
- on: (event: Event, callback: Function | undefined) => void;
46
+ sendEvent: (name: string, metadata: object) => void;
47
+ on: (event: Event, callback: RadarListenerCallback) => void;
48
48
  off: (event: Event, callback: Function | undefined) => void;
49
49
  nativeSdkVersion: () => Promise<string>;
50
50
  rnSdkVersion: () => string;
@@ -6,8 +6,14 @@ export interface RadarTrackOnceOptions {
6
6
  export interface RadarGetDistanceOptions {
7
7
  origin?: Location;
8
8
  destination?: Location;
9
- modes: string[];
10
- units: string;
9
+ modes?: RadarRouteMode[];
10
+ units?: "metric" | "imperial";
11
+ }
12
+ export interface RadarGetMatrixOptions {
13
+ origins?: Location[];
14
+ destinations?: Location[];
15
+ mode?: RadarRouteMode;
16
+ units?: "metric" | "imperial";
11
17
  }
12
18
  export interface RadarUpdateTripOptions {
13
19
  options: RadarTripOptions;
@@ -15,12 +21,12 @@ export interface RadarUpdateTripOptions {
15
21
  }
16
22
  export interface RadarStartTripOptions {
17
23
  tripOptions: RadarTripOptions;
18
- trackingOptions: RadarTrackingOptions;
24
+ trackingOptions?: RadarTrackingOptions;
19
25
  }
20
26
  export interface RadarLocationCallback {
21
27
  status: string;
22
28
  location?: Location;
23
- stopped?: boolean;
29
+ stopped: boolean;
24
30
  }
25
31
  export interface RadarTrackCallback {
26
32
  status: string;
@@ -57,10 +63,10 @@ export interface RadarSearchGeofencesCallback {
57
63
  }
58
64
  export interface RadarSearchGeofencesOptions {
59
65
  near?: Location;
60
- radius: number;
66
+ radius?: number;
61
67
  metadata?: object;
62
68
  tags?: string[];
63
- limit: number;
69
+ limit?: number;
64
70
  }
65
71
  export interface RadarGeocodeCallback {
66
72
  status: string;
@@ -74,6 +80,7 @@ export interface RadarValidateAddressCallback {
74
80
  export interface RadarIPGeocodeCallback {
75
81
  status: string;
76
82
  address?: RadarAddress;
83
+ proxy?: boolean;
77
84
  }
78
85
  export interface RadarTrackingOptionsForegroundServiceOptions {
79
86
  text?: string;
@@ -96,16 +103,16 @@ export interface RadarLogConversionCallback {
96
103
  }
97
104
  export interface RadarRouteMatrix {
98
105
  status: string;
99
- matrix?: object;
106
+ matrix?: object[];
100
107
  }
101
108
  export interface RadarSearchPlacesOptions {
102
109
  near?: Location;
103
- radius: number;
110
+ radius?: number;
104
111
  chains?: string[];
105
112
  chainMetadata?: object;
106
113
  categories?: string[];
107
114
  groups?: string[];
108
- limit: number;
115
+ limit?: number;
109
116
  }
110
117
  export interface Location {
111
118
  latitude: number;
@@ -117,6 +124,7 @@ export interface Location {
117
124
  verticalAccuracy?: number;
118
125
  speedAccuracy?: number;
119
126
  courseAccuracy?: number;
127
+ mocked?: boolean;
120
128
  }
121
129
  export interface RadarUser {
122
130
  _id: string;
@@ -269,16 +277,21 @@ export interface RadarAddress {
269
277
  county?: string;
270
278
  neighborhood?: string;
271
279
  number?: string;
280
+ street?: string;
281
+ unit?: string;
272
282
  distance?: number;
273
283
  confidence?: string;
274
284
  layer?: string;
275
285
  plus4?: string;
286
+ dmaCode?: string;
287
+ dma?: string;
288
+ metadata?: object;
276
289
  }
277
290
  export interface RadarAddressVerificationStatus {
278
291
  status: string;
279
292
  }
280
293
  export interface RadarRoutes {
281
- geodesic: RadarRoute;
294
+ geodesic?: RadarRouteDistance;
282
295
  foot?: RadarRoute;
283
296
  bike?: RadarRoute;
284
297
  car?: RadarRoute;
@@ -327,26 +340,29 @@ export type RadarTrackingOptionsReplay = "all" | "stops" | "none";
327
340
  export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all";
328
341
  export interface RadarTrackingOptions {
329
342
  desiredStoppedUpdateInterval: number;
330
- fastestStoppedUpdateInterval: number;
343
+ fastestStoppedUpdateInterval?: number;
331
344
  desiredMovingUpdateInterval: number;
332
- fastestMovingUpdateInterval: number;
345
+ fastestMovingUpdateInterval?: number;
333
346
  desiredSyncInterval: number;
334
- desiredAccuracy: RadarTrackingOptionsDesiredAccuracy;
347
+ desiredAccuracy: String;
335
348
  stopDuration: number;
336
349
  stopDistance: number;
337
- startTrackingAfter?: Date;
338
- stopTrackingAfter?: Date;
339
- replay: RadarTrackingOptionsReplay;
340
- sync: RadarTrackingOptionsSync;
341
- showBlueBar: boolean;
350
+ sync: String;
351
+ replay: String;
342
352
  useStoppedGeofence: boolean;
353
+ showBlueBar?: boolean;
354
+ foregroundServiceEnabled?: boolean;
355
+ startTrackingAfter?: number | undefined;
356
+ stopTrackingAfter?: number | undefined;
357
+ syncLocations?: String;
343
358
  stoppedGeofenceRadius: number;
344
359
  useMovingGeofence: boolean;
345
360
  movingGeofenceRadius: number;
346
361
  syncGeofences: boolean;
347
- syncGeofencesLimit: number;
348
- foregroundServiceEnabled: boolean;
362
+ useVisits?: boolean;
363
+ useSignificantLocationChanges?: boolean;
349
364
  beacons: boolean;
365
+ syncGeofencesLimit?: number;
350
366
  }
351
367
  export interface RadarLogConversionOptions {
352
368
  name: string;
@@ -377,3 +393,33 @@ export interface RadarTripOptions {
377
393
  approachingThreshold?: number;
378
394
  }
379
395
  export type RadarTripStatus = "unknown" | "started" | "approaching" | "arrived" | "expired" | "completed" | "canceled";
396
+ interface RadarEventUpdate {
397
+ user: RadarUser;
398
+ events: RadarEvent[];
399
+ }
400
+ interface RadarEventUpdateCallback {
401
+ (args: RadarEventUpdate): void;
402
+ }
403
+ interface RadarLocationUpdate {
404
+ location: Location;
405
+ user: RadarUser;
406
+ }
407
+ interface RadarLocationUpdateCallback {
408
+ (args: RadarLocationUpdate): void;
409
+ }
410
+ interface RadarClientLocationUpdate {
411
+ location: Location;
412
+ stopped: boolean;
413
+ source: string;
414
+ }
415
+ interface RadarClientLocationUpdateCallback {
416
+ (args: RadarClientLocationUpdate): void;
417
+ }
418
+ interface RadarErrorCallback {
419
+ (status: string): void;
420
+ }
421
+ interface RadarLogUpdateCallback {
422
+ (status: string): void;
423
+ }
424
+ export type RadarListenerCallback = RadarEventUpdateCallback | RadarLocationUpdateCallback | RadarClientLocationUpdateCallback | RadarErrorCallback | RadarLogUpdateCallback;
425
+ export {};
@@ -53,6 +53,7 @@ const isUsingRemoteTrackingOptions = () => react_native_1.NativeModules.RNRadar.
53
53
  const isTracking = () => react_native_1.NativeModules.RNRadar.isTracking();
54
54
  const setForegroundServiceOptions = (options) => react_native_1.NativeModules.RNRadar.setForegroundServiceOptions(options);
55
55
  const setNotificationOptions = (options) => react_native_1.NativeModules.RNRadar.setNotificationOptions(options);
56
+ // Take a closer look?
56
57
  const getTripOptions = () => react_native_1.NativeModules.RNRadar.getTripOptions();
57
58
  const startTrip = (options) => react_native_1.NativeModules.RNRadar.startTrip(options);
58
59
  const completeTrip = () => react_native_1.NativeModules.RNRadar.completeTrip();
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "description": "React Native module for Radar, the leading geofencing and location tracking platform",
4
4
  "homepage": "https://radar.com",
5
5
  "license": "Apache-2.0",
6
- "version": "3.10.0-beta.1",
7
- "main": "dist/src/index.ts",
6
+ "version": "3.10.0-beta.2",
7
+ "main": "dist/src/index.js",
8
8
  "files": [
9
9
  "android",
10
10
  "ios",
@@ -18,7 +18,8 @@
18
18
  "test": "jest ./test/*.test.js",
19
19
  "check-latest-tag": "node ./scripts/check-latest-tag.cjs",
20
20
  "check-beta-tag": "node ./scripts/check-beta-tag.cjs",
21
- "build": "tsc"
21
+ "build": "tsc",
22
+ "copy-assets": "./copyAssets.sh"
22
23
  },
23
24
  "jest": {
24
25
  "preset": "react-native",
@@ -28,6 +28,8 @@ import {
28
28
  RadarTripOptions,
29
29
  RadarUpdateTripOptions,
30
30
  Event,
31
+ RadarListenerCallback,
32
+ RadarGetMatrixOptions,
31
33
  } from "./types";
32
34
 
33
35
  export interface RadarNativeInterface {
@@ -84,12 +86,12 @@ export interface RadarNativeInterface {
84
86
  reverseGeocode: (location: any) => Promise<RadarGeocodeCallback>;
85
87
  ipGeocode: () => Promise<RadarGeocodeCallback>;
86
88
  getDistance: (option: RadarGetDistanceOptions) => Promise<RadarRouteCallback>;
87
- getMatrix: (option: RadarGetDistanceOptions) => Promise<RadarRouteMatrix>;
89
+ getMatrix: (option: RadarGetMatrixOptions) => Promise<RadarRouteMatrix>;
88
90
  logConversion: (
89
91
  options: RadarLogConversionOptions
90
92
  ) => Promise<RadarLogConversionCallback>;
91
- sendEvent: (name: string, metadata: Object) => void;
92
- on: (event: Event, callback: Function | undefined) => void;
93
+ sendEvent: (name: string, metadata: object) => void;
94
+ on: (event: Event, callback: RadarListenerCallback) => void;
93
95
  off: (event: Event, callback: Function | undefined) => void;
94
96
  nativeSdkVersion: () => Promise<string>;
95
97
  rnSdkVersion: () => string;
@@ -7,8 +7,15 @@ export interface RadarTrackOnceOptions {
7
7
  export interface RadarGetDistanceOptions {
8
8
  origin?: Location;
9
9
  destination?: Location;
10
- modes: string[];
11
- units: string;
10
+ modes?: RadarRouteMode[];
11
+ units?: "metric" | "imperial";
12
+ }
13
+
14
+ export interface RadarGetMatrixOptions {
15
+ origins?: Location[];
16
+ destinations?: Location[];
17
+ mode?: RadarRouteMode;
18
+ units?: "metric" | "imperial";
12
19
  }
13
20
 
14
21
  export interface RadarUpdateTripOptions {
@@ -18,13 +25,13 @@ export interface RadarUpdateTripOptions {
18
25
 
19
26
  export interface RadarStartTripOptions {
20
27
  tripOptions: RadarTripOptions;
21
- trackingOptions: RadarTrackingOptions;
28
+ trackingOptions?: RadarTrackingOptions;
22
29
  }
23
30
 
24
31
  export interface RadarLocationCallback {
25
32
  status: string;
26
33
  location?: Location;
27
- stopped?: boolean;
34
+ stopped: boolean;
28
35
  }
29
36
 
30
37
  export interface RadarTrackCallback {
@@ -76,10 +83,10 @@ export interface RadarSearchGeofencesCallback {
76
83
 
77
84
  export interface RadarSearchGeofencesOptions {
78
85
  near?: Location;
79
- radius: number;
86
+ radius?: number;
80
87
  metadata?: object;
81
88
  tags?: string[];
82
- limit: number;
89
+ limit?: number;
83
90
  }
84
91
 
85
92
  export interface RadarGeocodeCallback {
@@ -96,8 +103,10 @@ export interface RadarValidateAddressCallback {
96
103
  export interface RadarIPGeocodeCallback {
97
104
  status: string;
98
105
  address?: RadarAddress;
106
+ proxy?: boolean;
99
107
  }
100
108
 
109
+
101
110
  export interface RadarTrackingOptionsForegroundServiceOptions {
102
111
  text?: string;
103
112
  title?: string;
@@ -122,17 +131,17 @@ export interface RadarLogConversionCallback {
122
131
 
123
132
  export interface RadarRouteMatrix {
124
133
  status: string;
125
- matrix?: object;
134
+ matrix?: object[];
126
135
  }
127
136
 
128
137
  export interface RadarSearchPlacesOptions {
129
138
  near?: Location;
130
- radius: number;
139
+ radius?: number;
131
140
  chains?: string[];
132
141
  chainMetadata?: object;
133
142
  categories?: string[];
134
143
  groups?: string[];
135
- limit: number;
144
+ limit?: number;
136
145
  }
137
146
 
138
147
  export interface Location {
@@ -145,6 +154,7 @@ export interface Location {
145
154
  verticalAccuracy?: number;
146
155
  speedAccuracy?: number;
147
156
  courseAccuracy?: number;
157
+ mocked?: boolean;
148
158
  }
149
159
 
150
160
  export interface RadarUser {
@@ -354,10 +364,15 @@ export interface RadarAddress {
354
364
  county?: string;
355
365
  neighborhood?: string;
356
366
  number?: string;
367
+ street?: string;
368
+ unit?: string;
357
369
  distance?: number;
358
370
  confidence?: string;
359
371
  layer?: string;
360
372
  plus4?: string;
373
+ dmaCode?: string;
374
+ dma?: string;
375
+ metadata?: object;
361
376
  }
362
377
 
363
378
  export interface RadarAddressVerificationStatus {
@@ -365,7 +380,7 @@ export interface RadarAddressVerificationStatus {
365
380
  }
366
381
 
367
382
  export interface RadarRoutes {
368
- geodesic: RadarRoute;
383
+ geodesic?: RadarRouteDistance;
369
384
  foot?: RadarRoute;
370
385
  bike?: RadarRoute;
371
386
  car?: RadarRoute;
@@ -424,26 +439,29 @@ export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all";
424
439
 
425
440
  export interface RadarTrackingOptions {
426
441
  desiredStoppedUpdateInterval: number;
427
- fastestStoppedUpdateInterval: number;
442
+ fastestStoppedUpdateInterval?: number;
428
443
  desiredMovingUpdateInterval: number;
429
- fastestMovingUpdateInterval: number;
444
+ fastestMovingUpdateInterval?: number;
430
445
  desiredSyncInterval: number;
431
- desiredAccuracy: RadarTrackingOptionsDesiredAccuracy;
446
+ desiredAccuracy: String;
432
447
  stopDuration: number;
433
448
  stopDistance: number;
434
- startTrackingAfter?: Date;
435
- stopTrackingAfter?: Date;
436
- replay: RadarTrackingOptionsReplay;
437
- sync: RadarTrackingOptionsSync;
438
- showBlueBar: boolean;
449
+ sync: String;
450
+ replay: String;
439
451
  useStoppedGeofence: boolean;
452
+ showBlueBar?: boolean;
453
+ foregroundServiceEnabled?: boolean;
454
+ startTrackingAfter?: number | undefined;
455
+ stopTrackingAfter?: number | undefined;
456
+ syncLocations?: String;
440
457
  stoppedGeofenceRadius: number;
441
458
  useMovingGeofence: boolean;
442
459
  movingGeofenceRadius: number;
443
460
  syncGeofences: boolean;
444
- syncGeofencesLimit: number;
445
- foregroundServiceEnabled: boolean;
461
+ useVisits?: boolean;
462
+ useSignificantLocationChanges?: boolean;
446
463
  beacons: boolean;
464
+ syncGeofencesLimit?: number;
447
465
  }
448
466
 
449
467
  export interface RadarLogConversionOptions {
@@ -487,3 +505,43 @@ export type RadarTripStatus =
487
505
  | "expired"
488
506
  | "completed"
489
507
  | "canceled";
508
+
509
+ interface RadarEventUpdate {
510
+ user: RadarUser;
511
+ events: RadarEvent[];
512
+ }
513
+
514
+ interface RadarEventUpdateCallback {
515
+ (args: RadarEventUpdate): void;
516
+ }
517
+
518
+
519
+
520
+ interface RadarLocationUpdate{
521
+ location: Location;
522
+ user: RadarUser;
523
+ }
524
+
525
+ interface RadarLocationUpdateCallback{
526
+ (args: RadarLocationUpdate): void;
527
+ }
528
+
529
+ interface RadarClientLocationUpdate {
530
+ location: Location;
531
+ stopped: boolean;
532
+ source: string;
533
+ }
534
+
535
+ interface RadarClientLocationUpdateCallback{
536
+ (args: RadarClientLocationUpdate): void;
537
+ }
538
+
539
+ interface RadarErrorCallback{
540
+ (status: string): void;
541
+ }
542
+
543
+ interface RadarLogUpdateCallback{
544
+ (status: string): void;
545
+ }
546
+
547
+ export type RadarListenerCallback = RadarEventUpdateCallback | RadarLocationUpdateCallback | RadarClientLocationUpdateCallback | RadarErrorCallback | RadarLogUpdateCallback;
@@ -31,6 +31,8 @@ import {
31
31
  RadarTripOptions,
32
32
  RadarUpdateTripOptions,
33
33
  Event,
34
+ RadarListenerCallback,
35
+ RadarGetMatrixOptions,
34
36
  } from "./@types/types";
35
37
 
36
38
  if (
@@ -136,7 +138,8 @@ const setForegroundServiceOptions = (
136
138
  const setNotificationOptions = (options: RadarNotificationOptions): void =>
137
139
  NativeModules.RNRadar.setNotificationOptions(options);
138
140
 
139
- const getTripOptions = (): Promise<RadarTripOptions> =>
141
+ // Take a closer look?
142
+ const getTripOptions = (): Promise<RadarTripOptions> =>
140
143
  NativeModules.RNRadar.getTripOptions();
141
144
 
142
145
  const startTrip = (
@@ -190,7 +193,7 @@ const getDistance = (
190
193
  ): Promise<RadarRouteCallback> => NativeModules.RNRadar.getDistance(options);
191
194
 
192
195
  const getMatrix = (
193
- options: RadarGetDistanceOptions
196
+ options: RadarGetMatrixOptions
194
197
  ): Promise<RadarRouteMatrix> => NativeModules.RNRadar.getMatrix(options);
195
198
 
196
199
  const logConversion = (
@@ -198,10 +201,10 @@ const logConversion = (
198
201
  ): Promise<RadarLogConversionCallback> =>
199
202
  NativeModules.RNRadar.logConversion(options);
200
203
 
201
- const sendEvent = (name: string, metadata: Object): void =>
204
+ const sendEvent = (name: string, metadata: object): void =>
202
205
  NativeModules.RNRadar.sendEvent(name, metadata);
203
206
 
204
- const on = (event: Event, callback: Function | undefined): void =>
207
+ const on = (event: Event, callback: RadarListenerCallback): void =>
205
208
  eventEmitter.addListener(event, callback);
206
209
 
207
210
  const off = (event: Event, callback: Function | undefined): void => {