@spotto/contract 0.2.3 → 0.2.4-alpha.6
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/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" | "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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotto/contract",
|
|
3
3
|
"license": "ISC",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4-alpha.6",
|
|
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.
|
|
20
|
+
"@spotto/core-lib": "^0.2.4-alpha.0",
|
|
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": "5abb08bbe0adf43903a547fc8edf9dbd5ecba9f7"
|
|
30
30
|
}
|