@spotto/contract 1.0.23 → 1.0.25
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.
- package/dist/assets/[id]/get.d.ts +3 -0
- package/dist/events/constants.d.ts +5 -1
- package/dist/events/constants.js.map +1 -1
- package/dist/events/get/response.d.ts +90 -20
- package/dist/locations/[id]/get.d.ts +1 -2
- package/dist/locations/[id]/get.js +0 -2
- package/dist/locations/[id]/get.js.map +1 -1
- package/dist/locations/[id]/patch/request.d.ts +1 -1
- package/dist/locations/constants.d.ts +2 -0
- package/dist/locations/constants.js +5 -0
- package/dist/locations/constants.js.map +1 -0
- package/dist/locations/get/query.d.ts +1 -1
- package/dist/locations/index.d.ts +1 -0
- package/dist/locations/index.js +1 -0
- package/dist/locations/index.js.map +1 -1
- package/dist/locations/post/request.d.ts +1 -1
- package/dist/locations/suggestions/query.d.ts +1 -1
- package/dist/readers/constants/types.js +6 -6
- package/dist/readers/constants/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { IEmbeddedLabel } from '../../labels';
|
|
2
|
+
import { LocationType } from '../../locations/constants';
|
|
2
3
|
import { IEntityMeta, IEmbeddedEntity } from '../../shared';
|
|
3
4
|
import { IAssetTelemetry } from '../../telemetry';
|
|
4
5
|
export interface ILastLocation extends IEmbeddedEntity {
|
|
6
|
+
type: LocationType;
|
|
5
7
|
firstSeen: number;
|
|
6
8
|
lastSeen: number;
|
|
7
9
|
distance: number;
|
|
8
10
|
organisation?: IEmbeddedEntity;
|
|
9
11
|
}
|
|
10
12
|
export interface ICandidateLocation extends IEmbeddedEntity {
|
|
13
|
+
type: LocationType;
|
|
11
14
|
distance: number;
|
|
12
15
|
organisation?: IEmbeddedEntity;
|
|
13
16
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare type EventCountBreakdown = 'year' | 'week' | 'month' | 'day' | 'hour';
|
|
2
2
|
export declare const EVENT_COUNT_BREAKDOWN: EventCountBreakdown[];
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type AssetCrudEventType = 'AssetCreated' | 'AssetUpdated' | 'AssetDeleted';
|
|
4
|
+
export declare type LocationCrudEventType = 'LocationCreated' | 'LocationUpdated' | 'LocationDeleted';
|
|
5
|
+
export declare type ReaderCrudEventType = 'ReaderCreated' | 'ReaderUpdated' | 'ReaderDeleted';
|
|
6
|
+
export declare type SlateEventType = 'ReaderArrived' | 'ReaderExited' | 'Arrived' | 'Moved' | 'ExplicitArrived' | 'Exited' | 'ReaderOnline' | 'ReaderOffline';
|
|
7
|
+
export declare type EventType = SlateEventType | AssetCrudEventType | LocationCrudEventType | ReaderCrudEventType | 'UserSearch';
|
|
4
8
|
export declare const EVENT_TYPES: EventType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAC;AAkCW,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,OAAO;IACP,iBAAiB;IACjB,QAAQ;IACR,cAAc;IACd,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,YAAY;CACb,CAAC"}
|
|
@@ -1,33 +1,103 @@
|
|
|
1
1
|
import { IEmbeddedEntity } from '../../shared';
|
|
2
|
-
import { EventType } from '../constants';
|
|
2
|
+
import { AssetCrudEventType, EventType, LocationCrudEventType, ReaderCrudEventType } from '../constants';
|
|
3
3
|
import { GetEventsQuery } from './query';
|
|
4
4
|
import { DeviceType, ReaderType } from '../../readers/constants';
|
|
5
|
+
import { LocationType } from '../../locations/constants';
|
|
5
6
|
export interface EventLocation extends IEmbeddedEntity {
|
|
7
|
+
type: LocationType;
|
|
6
8
|
organisation?: IEmbeddedEntity;
|
|
7
9
|
}
|
|
8
|
-
export interface
|
|
10
|
+
export interface IBaseEvent {
|
|
9
11
|
id: string;
|
|
10
12
|
timestamp: number;
|
|
11
13
|
type: EventType;
|
|
12
|
-
asset?: IEmbeddedEntity;
|
|
13
|
-
location?: EventLocation;
|
|
14
|
-
reader?: IEmbeddedEntity;
|
|
15
|
-
user?: IEmbeddedEntity;
|
|
16
|
-
entity?: string;
|
|
17
|
-
term?: string;
|
|
18
|
-
payload?: {
|
|
19
|
-
name?: string;
|
|
20
|
-
tagIds?: string[];
|
|
21
|
-
type?: ReaderType;
|
|
22
|
-
deviceType?: DeviceType;
|
|
23
|
-
network?: string;
|
|
24
|
-
deviceId?: string;
|
|
25
|
-
location?: IEmbeddedEntity;
|
|
26
|
-
typeId?: string;
|
|
27
|
-
nameSuffix?: string;
|
|
28
|
-
manifestId?: string;
|
|
29
|
-
};
|
|
30
14
|
}
|
|
15
|
+
export interface IAssetEventPayload {
|
|
16
|
+
name?: string;
|
|
17
|
+
nameSuffix?: string;
|
|
18
|
+
tagIds?: string[];
|
|
19
|
+
typeId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ILocationEventPayload {
|
|
22
|
+
name?: string;
|
|
23
|
+
tagIds?: string[];
|
|
24
|
+
type?: LocationType;
|
|
25
|
+
manifestId?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IReaderEventPayload {
|
|
28
|
+
name?: string;
|
|
29
|
+
type?: ReaderType;
|
|
30
|
+
deviceType?: DeviceType;
|
|
31
|
+
network?: string;
|
|
32
|
+
deviceId?: string;
|
|
33
|
+
location?: IEmbeddedEntity;
|
|
34
|
+
}
|
|
35
|
+
export interface IAssetCrudEvent extends IBaseEvent {
|
|
36
|
+
type: AssetCrudEventType;
|
|
37
|
+
asset: IEmbeddedEntity;
|
|
38
|
+
user: IEmbeddedEntity;
|
|
39
|
+
payload: IAssetEventPayload;
|
|
40
|
+
}
|
|
41
|
+
export interface ILocationCrudEvent extends IBaseEvent {
|
|
42
|
+
type: LocationCrudEventType;
|
|
43
|
+
location: EventLocation;
|
|
44
|
+
user: IEmbeddedEntity;
|
|
45
|
+
payload: ILocationEventPayload;
|
|
46
|
+
}
|
|
47
|
+
export interface IReaderCrudEvent extends IBaseEvent {
|
|
48
|
+
type: ReaderCrudEventType;
|
|
49
|
+
reader: IEmbeddedEntity;
|
|
50
|
+
user: IEmbeddedEntity;
|
|
51
|
+
payload: IReaderEventPayload;
|
|
52
|
+
}
|
|
53
|
+
export interface IUserSearchEvent extends IBaseEvent {
|
|
54
|
+
type: 'UserSearch';
|
|
55
|
+
entity: string;
|
|
56
|
+
term: string;
|
|
57
|
+
user: IEmbeddedEntity;
|
|
58
|
+
}
|
|
59
|
+
export interface IArrivedEvent extends IBaseEvent {
|
|
60
|
+
type: 'Arrived';
|
|
61
|
+
asset: IEmbeddedEntity;
|
|
62
|
+
location: EventLocation;
|
|
63
|
+
reader: IEmbeddedEntity;
|
|
64
|
+
}
|
|
65
|
+
export interface IExitedEvent extends IBaseEvent {
|
|
66
|
+
type: 'Exited';
|
|
67
|
+
asset: IEmbeddedEntity;
|
|
68
|
+
location: EventLocation;
|
|
69
|
+
reader: IEmbeddedEntity;
|
|
70
|
+
}
|
|
71
|
+
export interface IReaderArrivedEvent extends IBaseEvent {
|
|
72
|
+
type: 'ReaderArrived';
|
|
73
|
+
location: EventLocation;
|
|
74
|
+
reader: IEmbeddedEntity;
|
|
75
|
+
}
|
|
76
|
+
export interface IReaderExitedEvent extends IBaseEvent {
|
|
77
|
+
type: 'ReaderExited';
|
|
78
|
+
location: EventLocation;
|
|
79
|
+
reader: IEmbeddedEntity;
|
|
80
|
+
}
|
|
81
|
+
export interface IMovedEvent extends IBaseEvent {
|
|
82
|
+
type: 'Moved';
|
|
83
|
+
asset: IEmbeddedEntity;
|
|
84
|
+
location: EventLocation;
|
|
85
|
+
reader: IEmbeddedEntity;
|
|
86
|
+
}
|
|
87
|
+
export interface IExplicitArrivedEvent extends IBaseEvent {
|
|
88
|
+
type: 'ExplicitArrived';
|
|
89
|
+
asset: IEmbeddedEntity;
|
|
90
|
+
location: EventLocation;
|
|
91
|
+
}
|
|
92
|
+
export interface IReaderOnlineEvent extends IBaseEvent {
|
|
93
|
+
type: 'ReaderOnline';
|
|
94
|
+
reader: IEmbeddedEntity;
|
|
95
|
+
}
|
|
96
|
+
export interface IReaderOfflineEvent extends IBaseEvent {
|
|
97
|
+
type: 'ReaderOffline';
|
|
98
|
+
reader: IEmbeddedEntity;
|
|
99
|
+
}
|
|
100
|
+
export declare type GetEventResponse = IAssetCrudEvent | ILocationCrudEvent | IReaderCrudEvent | IUserSearchEvent | IReaderArrivedEvent | IReaderExitedEvent | IArrivedEvent | IMovedEvent | IExplicitArrivedEvent | IExitedEvent | IReaderOnlineEvent | IReaderOfflineEvent;
|
|
31
101
|
export interface GetEventsResponse {
|
|
32
102
|
query: GetEventsQuery | null;
|
|
33
103
|
items: GetEventResponse[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Polygon, type Point } from 'geojson';
|
|
2
2
|
import { IEntityMeta, IEmbeddedEntity } from '../../shared';
|
|
3
3
|
import { IAssetTelemetry } from '../../telemetry';
|
|
4
|
+
import { LocationType } from '../constants';
|
|
4
5
|
export interface IEmbeddedReader extends IEmbeddedEntity {
|
|
5
6
|
displayName: string;
|
|
6
7
|
}
|
|
@@ -15,8 +16,6 @@ export interface ILocationStatusLocation {
|
|
|
15
16
|
export interface ILocationStatus {
|
|
16
17
|
location?: ILocationStatusLocation;
|
|
17
18
|
}
|
|
18
|
-
export declare type LocationType = 'MOVING' | 'FIXED';
|
|
19
|
-
export declare const LOCATION_TYPES: LocationType[];
|
|
20
19
|
export interface GetLocationResponse {
|
|
21
20
|
id: string;
|
|
22
21
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/locations/[id]/get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/locations/[id]/get.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/locations/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,cAAc,GAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchableSortFields, SortOrders } from '../../shared';
|
|
2
|
-
import { LocationType } from '../
|
|
2
|
+
import { LocationType } from '../constants';
|
|
3
3
|
export declare type LocationSearchField = 'name';
|
|
4
4
|
export declare type LocationEmbedField = 'meta' | 'tagIds' | 'readers' | 'telemetry' | 'status';
|
|
5
5
|
export interface LocationFilters {
|
package/dist/locations/index.js
CHANGED
|
@@ -21,4 +21,5 @@ __exportStar(require("./get"), exports);
|
|
|
21
21
|
__exportStar(require("./post"), exports);
|
|
22
22
|
__exportStar(require("./suggestions"), exports);
|
|
23
23
|
__exportStar(require("./errors"), exports);
|
|
24
|
+
__exportStar(require("./constants"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,6CAA2B;AAC3B,wCAAsB;AACtB,yCAAuB;AACvB,gDAA8B;AAC9B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,6CAA2B;AAC3B,wCAAsB;AACtB,yCAAuB;AACvB,gDAA8B;AAC9B,2CAAyB;AACzB,8CAA4B"}
|
|
@@ -5,20 +5,20 @@ exports.READER_TYPES = ['FIXED', 'ROVING', 'MOVING'];
|
|
|
5
5
|
exports.READER_TYPE_DETAILS = [
|
|
6
6
|
{
|
|
7
7
|
id: 'FIXED',
|
|
8
|
-
name: '
|
|
9
|
-
description: '
|
|
8
|
+
name: 'Fixed',
|
|
9
|
+
description: 'Plugged in with a Spotto location assigned. These readers are fixed in place and do not move unless the Spotto location is manually reassigned.',
|
|
10
10
|
visible: true,
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
id: 'ROVING',
|
|
14
|
-
name: '
|
|
15
|
-
description: '
|
|
14
|
+
name: 'Handheld',
|
|
15
|
+
description: 'Typically RFID handheld scanners or a BLE phone applications. These readers detect location tags or use GPS to locate assets instead of being linked to a Spotto location',
|
|
16
16
|
visible: true,
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
id: 'MOVING',
|
|
20
|
-
name: '
|
|
21
|
-
description: '
|
|
20
|
+
name: 'Vehicle',
|
|
21
|
+
description: 'GPS enabled readers attached to a vehicle will detect the location and any assets that are travelling with it',
|
|
22
22
|
visible: true,
|
|
23
23
|
},
|
|
24
24
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/readers/constants/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAU3D,QAAA,mBAAmB,GAAwB;IACtD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/readers/constants/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAU3D,QAAA,mBAAmB,GAAwB;IACtD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EACT,iJAAiJ;QACnJ,OAAO,EAAE,IAAI;KACd;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,2KAA2K;QAC7K,OAAO,EAAE,IAAI;KACd;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,SAAS;QACf,WAAW,EACT,+GAA+G;QACjH,OAAO,EAAE,IAAI;KACd;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotto/contract",
|
|
3
3
|
"license": "ISC",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.25",
|
|
5
5
|
"description": "Spotto's API Contract type definitions",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/geojson": "^7946.0.11"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "a0c0e3b90526d2fa45eb08221fcf8d7530a21bbf"
|
|
18
18
|
}
|