@spotto/contract 0.2.4-alpha.0 → 0.2.4
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/types/events/constants.d.ts +1 -1
- package/dist/types/events/constants.js +9 -0
- package/dist/types/events/constants.js.map +1 -1
- package/dist/types/events/get/response.d.ts +21 -0
- package/dist/types/events/get/response.js +13 -1
- package/dist/types/events/get/response.js.map +1 -1
- package/dist/types/readers/constants/deviceTypes.d.ts +2 -2
- package/dist/types/readers/constants/deviceTypes.js +9 -0
- package/dist/types/readers/constants/deviceTypes.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type EventType = 'ReaderArrived' | 'ReaderExited' | 'Arrived' | 'ExplicitArrived' | 'Exited' | 'ReaderOnline' | 'ReaderOffline';
|
|
1
|
+
export declare type EventType = 'ReaderArrived' | 'ReaderExited' | 'Arrived' | 'ExplicitArrived' | 'Exited' | 'ReaderOnline' | 'ReaderOffline' | 'AssetCreated' | 'AssetUpdated' | 'AssetDeleted' | 'LocationCreated' | 'LocationUpdated' | 'LocationDeleted' | 'ReaderCreated' | 'ReaderUpdated' | 'ReaderDeleted';
|
|
2
2
|
export declare const EVENT_TYPES: EventType[];
|
|
3
3
|
export declare type TimestampFormat = 'epoch' | 'iso' | 'human';
|
|
4
4
|
export declare const timestampFormats: TimestampFormat[];
|
|
@@ -9,6 +9,15 @@ exports.EVENT_TYPES = [
|
|
|
9
9
|
'Exited',
|
|
10
10
|
'ReaderOnline',
|
|
11
11
|
'ReaderOffline',
|
|
12
|
+
'AssetCreated',
|
|
13
|
+
'AssetUpdated',
|
|
14
|
+
'AssetDeleted',
|
|
15
|
+
'LocationCreated',
|
|
16
|
+
'LocationUpdated',
|
|
17
|
+
'LocationDeleted',
|
|
18
|
+
'ReaderCreated',
|
|
19
|
+
'ReaderUpdated',
|
|
20
|
+
'ReaderDeleted',
|
|
12
21
|
];
|
|
13
22
|
exports.timestampFormats = ['epoch', 'iso', 'human'];
|
|
14
23
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/types/events/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/types/events/constants.ts"],"names":[],"mappings":";;;AAkBa,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,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;CAChB,CAAC;AAIW,QAAA,gBAAgB,GAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IEmbeddedEntity } from '../../shared';
|
|
2
2
|
import { EventType } from '../constants';
|
|
3
3
|
import { GetEventsQuery } from './query';
|
|
4
|
+
import { DeviceType, ReaderType } from '../../readers/constants';
|
|
4
5
|
export interface GetEventResponse {
|
|
5
6
|
id: string;
|
|
6
7
|
timestamp: number;
|
|
@@ -8,7 +9,27 @@ export interface GetEventResponse {
|
|
|
8
9
|
asset?: IEmbeddedEntity;
|
|
9
10
|
location?: IEmbeddedEntity;
|
|
10
11
|
reader?: IEmbeddedEntity;
|
|
12
|
+
payload?: {
|
|
13
|
+
name?: string;
|
|
14
|
+
tagIds?: string[];
|
|
15
|
+
type?: ReaderType;
|
|
16
|
+
deviceType?: DeviceType;
|
|
17
|
+
network?: string;
|
|
18
|
+
deviceId?: string;
|
|
19
|
+
location?: IEmbeddedEntity;
|
|
20
|
+
level?: string;
|
|
21
|
+
};
|
|
11
22
|
}
|
|
23
|
+
export declare const getEventPayloadResponseSchema: import("joi").ObjectSchema<{
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
tagIds?: string[] | undefined;
|
|
26
|
+
type?: "FIXED" | "ROVING" | "VIRTUAL" | "PORTAL" | undefined;
|
|
27
|
+
deviceType?: "B1" | "RF1A4" | "RF1F" | "HD1" | "ZEBRA" | "IMPINJ" | "TURCK" | "THINXTRA" | "OTHER" | "APPLICATION" | undefined;
|
|
28
|
+
network?: string | undefined;
|
|
29
|
+
deviceId?: string | undefined;
|
|
30
|
+
location?: IEmbeddedEntity | undefined;
|
|
31
|
+
level?: string | undefined;
|
|
32
|
+
} | undefined>;
|
|
12
33
|
export declare const getEventResponseSchema: import("joi").ObjectSchema<GetEventResponse>;
|
|
13
34
|
export interface GetEventsResponse {
|
|
14
35
|
query: GetEventsQuery | null;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateGetEventsResponse = exports.getEventsResponseSchema = exports.getEventResponseSchema = void 0;
|
|
3
|
+
exports.validateGetEventsResponse = exports.getEventsResponseSchema = exports.getEventResponseSchema = exports.getEventPayloadResponseSchema = void 0;
|
|
4
4
|
const joi_1 = require("joi");
|
|
5
5
|
const shared_1 = require("../../shared");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const query_1 = require("./query");
|
|
8
|
+
const constants_2 = require("../../readers/constants");
|
|
9
|
+
exports.getEventPayloadResponseSchema = joi_1.object({
|
|
10
|
+
name: joi_1.string(),
|
|
11
|
+
tagIds: shared_1.xArrayOfStrings(),
|
|
12
|
+
type: shared_1.xStringIsOneOf(...constants_2.READER_TYPES),
|
|
13
|
+
deviceType: shared_1.xStringIsOneOf(...constants_2.DEVICE_TYPES),
|
|
14
|
+
network: shared_1.xString,
|
|
15
|
+
deviceId: shared_1.xString,
|
|
16
|
+
location: shared_1.embeddedEntitySchema(),
|
|
17
|
+
level: shared_1.xString,
|
|
18
|
+
});
|
|
8
19
|
exports.getEventResponseSchema = joi_1.object({
|
|
9
20
|
id: shared_1.xObjectId.required(),
|
|
10
21
|
timestamp: shared_1.xTime.required(),
|
|
@@ -12,6 +23,7 @@ exports.getEventResponseSchema = joi_1.object({
|
|
|
12
23
|
asset: shared_1.embeddedEntitySchema(),
|
|
13
24
|
location: shared_1.embeddedEntitySchema(),
|
|
14
25
|
reader: shared_1.embeddedEntitySchema(),
|
|
26
|
+
payload: exports.getEventPayloadResponseSchema,
|
|
15
27
|
});
|
|
16
28
|
exports.getEventsResponseSchema = joi_1.object({
|
|
17
29
|
query: query_1.getEventsQuerySchema.allow(null).required(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/types/events/get/response.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/types/events/get/response.ts"],"names":[],"mappings":";;;AAAA,6BAAqC;AACrC,yCAWsB;AACtB,4CAAsD;AACtD,mCAA+D;AAC/D,uDAKiC;AAmCpB,QAAA,6BAA6B,GAAG,YAAM,CAEjD;IAEA,IAAI,EAAE,YAAM,EAAE;IACd,MAAM,EAAE,wBAAe,EAAE;IACzB,IAAI,EAAE,uBAAc,CAAC,GAAG,wBAAY,CAAC;IACrC,UAAU,EAAE,uBAAc,CAAC,GAAG,wBAAY,CAAC;IAC3C,OAAO,EAAE,gBAAO;IAChB,QAAQ,EAAE,gBAAO;IACjB,QAAQ,EAAE,6BAAoB,EAAE;IAChC,KAAK,EAAE,gBAAO;CACf,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,YAAM,CAAmB;IAE7D,EAAE,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACxB,SAAS,EAAE,cAAK,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,uBAAc,CAAC,GAAG,uBAAW,CAAC,CAAC,QAAQ,EAAE;IAG/C,KAAK,EAAE,6BAAoB,EAAE;IAC7B,QAAQ,EAAE,6BAAoB,EAAE;IAChC,MAAM,EAAE,6BAAoB,EAAE;IAC9B,OAAO,EAAE,qCAA6B;CACvC,CAAC,CAAC;AAgBU,QAAA,uBAAuB,GAAG,YAAM,CAAoB;IAE/D,KAAK,EAAE,4BAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClD,KAAK,EAAE,aAAI,CAAC,QAAQ,EAAE;IACtB,KAAK,EAAE,eAAM,CAAC,8BAAsB,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC;AAEI,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAE,EAAE,CACxD,0BAAiB,CAAoB,+BAAuB,EAAE,OAAO,CAAC,CAAC;AAD5D,QAAA,yBAAyB,6BACmC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare type DeviceType = 'B1' | 'RF1A4' | 'RF1F' | 'HD1' | 'ZEBRA' | 'IMPINJ' | 'TURCK' | 'OTHER' | 'APPLICATION';
|
|
1
|
+
export declare type DeviceType = 'B1' | 'RF1A4' | 'RF1F' | 'HD1' | 'ZEBRA' | 'IMPINJ' | 'TURCK' | 'THINXTRA' | 'OTHER' | 'APPLICATION';
|
|
2
2
|
export declare const DEVICE_TYPES: DeviceType[];
|
|
3
3
|
export declare type DeviceTechnologyType = 'BLE' | 'RFID' | 'HID';
|
|
4
|
-
export declare type ConnectorEndpoint = 'iotx3' | 'zebra' | 'impinj' | 'turck' | 'detector' | 'other' | 'zebra';
|
|
4
|
+
export declare type ConnectorEndpoint = 'iotx3' | 'zebra' | 'impinj' | 'turck' | 'thinxtra' | 'detector' | 'other' | 'zebra';
|
|
5
5
|
export declare type ConnectorProtocol = 'http' | 'mqtt';
|
|
6
6
|
export declare type DeviceIdFormat = 'mac' | 'string';
|
|
7
7
|
export interface IDeviceTypeDetail {
|
|
@@ -9,6 +9,7 @@ exports.DEVICE_TYPES = [
|
|
|
9
9
|
'ZEBRA',
|
|
10
10
|
'IMPINJ',
|
|
11
11
|
'TURCK',
|
|
12
|
+
'THINXTRA',
|
|
12
13
|
'OTHER',
|
|
13
14
|
'APPLICATION',
|
|
14
15
|
];
|
|
@@ -73,6 +74,14 @@ exports.DEVICE_TYPE_DETAILS = [
|
|
|
73
74
|
protocol: 'http',
|
|
74
75
|
visible: true,
|
|
75
76
|
},
|
|
77
|
+
{
|
|
78
|
+
id: 'THINXTRA',
|
|
79
|
+
name: 'Thinxtra BLE Reader',
|
|
80
|
+
technology: ['BLE'],
|
|
81
|
+
endpoint: 'thinxtra',
|
|
82
|
+
protocol: 'http',
|
|
83
|
+
visible: true,
|
|
84
|
+
},
|
|
76
85
|
{
|
|
77
86
|
id: 'OTHER',
|
|
78
87
|
name: 'Custom Reader (BYO Device)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTypes.js","sourceRoot":"","sources":["../../../../src/types/readers/constants/deviceTypes.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deviceTypes.js","sourceRoot":"","sources":["../../../../src/types/readers/constants/deviceTypes.ts"],"names":[],"mappings":";;;AAwBa,QAAA,YAAY,GAAiB;IACxC,IAAI;IACJ,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,aAAa;CACd,CAAC;AA+BW,QAAA,mBAAmB,GAAwB;IACtD;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,4BAA4B;QAClC,UAAU,EAAE,CAAC,KAAK,CAAC;QACnB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,MAAM;QAChB,cAAc,EAAE,KAAK;QACrB,OAAO,EAAE,IAAI;KACd;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,0BAA0B;QAChC,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,MAAM;QAChB,cAAc,EAAE,KAAK;QACrB,OAAO,EAAE,IAAI;KACd;IACD;QAC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AE,CAAC,CAAC;AAD5C,QAAA,uBAAuB,2BACqB;AAGlD,MAAM,yBAAyB,GAAG,CAAC,QAA2B,EAAE,EAAE,CACvE,sBAAc,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AADtC,QAAA,yBAAyB,6BACa;AAM5C,MAAM,OAAO,GAAG,CAAC,EAAc,EAAE,EAAE,CACxC,iCAAyB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AADrC,QAAA,OAAO,WAC8B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotto/contract",
|
|
3
3
|
"license": "ISC",
|
|
4
|
-
"version": "0.2.4
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"description": "Spotto's API Contract",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@airtasker/spot": "^1.4.0",
|
|
20
|
-
"@spotto/core-lib": "^0.2.4
|
|
20
|
+
"@spotto/core-lib": "^0.2.4",
|
|
21
21
|
"geojson-validation": "^1.0.2",
|
|
22
22
|
"joi": "^17.2.1",
|
|
23
23
|
"qs": "^6.9.4"
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"jest": "^26.6.3",
|
|
27
27
|
"ts-jest": "^26.5.3"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "6e01316d0b1044c0966f6b69095b6161c1fd3c00"
|
|
30
30
|
}
|