@spotto/contract 0.0.18 → 0.0.20
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/download/query.d.ts +1 -4
- package/dist/types/events/download/query.js +1 -4
- package/dist/types/events/download/query.js.map +1 -1
- package/dist/types/events/get/query.d.ts +0 -5
- package/dist/types/events/get/query.js +1 -9
- package/dist/types/events/get/query.js.map +1 -1
- package/dist/types/events/get/response.d.ts +3 -3
- package/dist/types/events/get/response.js +3 -3
- package/dist/types/events/get/response.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SortOrders } from '../../shared';
|
|
2
2
|
import { EventType } from '../constants';
|
|
3
|
-
|
|
4
|
-
export declare type TimestampFormat = 'epoch' | 'iso';
|
|
3
|
+
export declare type TimestampFormat = 'epoch' | 'iso' | 'human';
|
|
5
4
|
export declare const timestampFormats: TimestampFormat[];
|
|
6
5
|
export interface DownloadEventsQuery {
|
|
7
6
|
limit?: number;
|
|
@@ -11,9 +10,7 @@ export interface DownloadEventsQuery {
|
|
|
11
10
|
type?: Array<EventType>;
|
|
12
11
|
timeFrom?: number;
|
|
13
12
|
timeTo?: number;
|
|
14
|
-
sort?: EventSortField;
|
|
15
13
|
sortOrder?: SortOrders;
|
|
16
|
-
embed?: Array<EventEmbedField>;
|
|
17
14
|
timestampFormat?: TimestampFormat;
|
|
18
15
|
withEntityLinks?: boolean;
|
|
19
16
|
}
|
|
@@ -4,8 +4,7 @@ exports.validateDownloadEventsQuery = exports.downloadEventsQuerySchema = export
|
|
|
4
4
|
const joi_1 = require("joi");
|
|
5
5
|
const shared_1 = require("../../shared");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
|
-
|
|
8
|
-
exports.timestampFormats = ['epoch', 'iso'];
|
|
7
|
+
exports.timestampFormats = ['epoch', 'iso', 'human'];
|
|
9
8
|
exports.downloadEventsQuerySchema = joi_1.object({
|
|
10
9
|
readers: shared_1.xArrayOfObjectIds(true),
|
|
11
10
|
locations: shared_1.xArrayOfObjectIds(true),
|
|
@@ -13,9 +12,7 @@ exports.downloadEventsQuerySchema = joi_1.object({
|
|
|
13
12
|
timeFrom: shared_1.xTime,
|
|
14
13
|
timeTo: shared_1.xTime,
|
|
15
14
|
type: shared_1.xArrayOfRequiredStrings(...constants_1.EVENT_TYPES),
|
|
16
|
-
sort: shared_1.xStringIsOneOf(...query_1.eventSortFields),
|
|
17
15
|
sortOrder: shared_1.xSortOrder,
|
|
18
|
-
embed: shared_1.xArrayOfRequiredStrings('asset', 'location', 'reader'),
|
|
19
16
|
limit: shared_1.xInt,
|
|
20
17
|
timestampFormat: shared_1.xStringIsOneOf(...exports.timestampFormats),
|
|
21
18
|
withEntityLinks: shared_1.xBool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/events/download/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAUsB;AACtB,4CAAsD;
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/events/download/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAUsB;AACtB,4CAAsD;AAGzC,QAAA,gBAAgB,GAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAkDhE,QAAA,yBAAyB,GAAG,YAAM,CAAsB;IAEnE,OAAO,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAChC,SAAS,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAClC,MAAM,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAK;IACf,MAAM,EAAE,cAAK;IACb,IAAI,EAAE,gCAAuB,CAAC,GAAG,uBAAW,CAAC;IAG7C,SAAS,EAAE,mBAAU;IAGrB,KAAK,EAAE,aAAI;IACX,eAAe,EAAE,uBAAc,CAAC,GAAG,wBAAgB,CAAC;IACpD,eAAe,EAAE,cAAK;CACvB,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAG,CAAC,OAAY,EAAE,EAAE,CAC1D,kCAAyB,CACvB,iCAAyB,EACzB,OAAO,CACR,CAAC;AAJS,QAAA,2BAA2B,+BAIpC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { SortOrders } from '../../shared';
|
|
2
2
|
import { EventType } from '../constants';
|
|
3
|
-
export declare type EventEmbedField = 'asset' | 'location' | 'reader';
|
|
4
|
-
export declare type EventSortField = 'timestamp' | 'asset' | 'location' | 'reader';
|
|
5
|
-
export declare const eventSortFields: Array<EventSortField>;
|
|
6
3
|
export interface GetEventsQuery {
|
|
7
4
|
page?: number;
|
|
8
5
|
limit?: number;
|
|
@@ -12,9 +9,7 @@ export interface GetEventsQuery {
|
|
|
12
9
|
type?: Array<EventType>;
|
|
13
10
|
timeFrom?: number;
|
|
14
11
|
timeTo?: number;
|
|
15
|
-
sort?: EventSortField;
|
|
16
12
|
sortOrder?: SortOrders;
|
|
17
|
-
embed?: Array<EventEmbedField>;
|
|
18
13
|
}
|
|
19
14
|
export declare const getEventsQuerySchema: import("joi").ObjectSchema<GetEventsQuery>;
|
|
20
15
|
export declare const validateGetEventsQuery: (payload: any) => GetEventsQuery | null;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateGetEventsQuery = exports.getEventsQuerySchema =
|
|
3
|
+
exports.validateGetEventsQuery = exports.getEventsQuerySchema = void 0;
|
|
4
4
|
const joi_1 = require("joi");
|
|
5
5
|
const shared_1 = require("../../shared");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
|
-
exports.eventSortFields = [
|
|
8
|
-
'timestamp',
|
|
9
|
-
'asset',
|
|
10
|
-
'location',
|
|
11
|
-
'reader',
|
|
12
|
-
];
|
|
13
7
|
exports.getEventsQuerySchema = joi_1.object({
|
|
14
8
|
page: shared_1.xInt,
|
|
15
9
|
limit: shared_1.xInt,
|
|
@@ -19,9 +13,7 @@ exports.getEventsQuerySchema = joi_1.object({
|
|
|
19
13
|
timeFrom: shared_1.xTime,
|
|
20
14
|
timeTo: shared_1.xTime,
|
|
21
15
|
type: shared_1.xArrayOfRequiredStrings(...constants_1.EVENT_TYPES),
|
|
22
|
-
sort: shared_1.xStringIsOneOf(...exports.eventSortFields),
|
|
23
16
|
sortOrder: shared_1.xSortOrder,
|
|
24
|
-
embed: shared_1.xArrayOfRequiredStrings('asset', 'location', 'reader'),
|
|
25
17
|
});
|
|
26
18
|
const validateGetEventsQuery = (payload) => shared_1.validateOptionalJoiSchema(exports.getEventsQuerySchema, payload);
|
|
27
19
|
exports.validateGetEventsQuery = validateGetEventsQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/events/get/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/events/get/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAQsB;AACtB,4CAAsD;AA+CzC,QAAA,oBAAoB,GAAG,YAAM,CAAiB;IAEzD,IAAI,EAAE,aAAI;IACV,KAAK,EAAE,aAAI;IAGX,OAAO,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAChC,SAAS,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAClC,MAAM,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAC/B,QAAQ,EAAE,cAAK;IACf,MAAM,EAAE,cAAK;IACb,IAAI,EAAE,gCAAuB,CAAC,GAAG,uBAAW,CAAC;IAG7C,SAAS,EAAE,mBAAU;CACtB,CAAC,CAAC;AAEI,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAE,EAAE,CACrD,kCAAyB,CAAiB,4BAAoB,EAAE,OAAO,CAAC,CAAC;AAD9D,QAAA,sBAAsB,0BACwC"}
|
|
@@ -5,9 +5,9 @@ export interface GetEventResponse {
|
|
|
5
5
|
id: string;
|
|
6
6
|
timestamp: number;
|
|
7
7
|
type: EventType;
|
|
8
|
-
asset?:
|
|
9
|
-
location?:
|
|
10
|
-
reader?:
|
|
8
|
+
asset?: IEmbeddedEntity;
|
|
9
|
+
location?: IEmbeddedEntity;
|
|
10
|
+
reader?: IEmbeddedEntity;
|
|
11
11
|
}
|
|
12
12
|
export declare const getEventResponseSchema: import("joi").ObjectSchema<GetEventResponse>;
|
|
13
13
|
export interface GetEventsResponse {
|
|
@@ -9,9 +9,9 @@ exports.getEventResponseSchema = joi_1.object({
|
|
|
9
9
|
id: shared_1.xObjectId.required(),
|
|
10
10
|
timestamp: shared_1.xTime.required(),
|
|
11
11
|
type: shared_1.xStringIsOneOf(...constants_1.EVENT_TYPES).required(),
|
|
12
|
-
asset:
|
|
13
|
-
location:
|
|
14
|
-
reader:
|
|
12
|
+
asset: shared_1.embeddedEntitySchema(),
|
|
13
|
+
location: shared_1.embeddedEntitySchema(),
|
|
14
|
+
reader: shared_1.embeddedEntitySchema(),
|
|
15
15
|
});
|
|
16
16
|
exports.getEventsResponseSchema = joi_1.object({
|
|
17
17
|
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,6BAA6B;AAC7B,mCAA+D;AAC/D,yCASsB;AACtB,4CAAsD;AAqBzC,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,
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/types/events/get/response.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,mCAA+D;AAC/D,yCASsB;AACtB,4CAAsD;AAqBzC,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;CAC/B,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.0.
|
|
4
|
+
"version": "0.0.20",
|
|
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.0.
|
|
20
|
+
"@spotto/core-lib": "^0.0.20",
|
|
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": "2cb948b2e6235e1f2a0c0412376ec44b271f25dc"
|
|
30
30
|
}
|