@spotto/contract 0.2.8-alpha.0 → 0.2.9-alpha.0

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.
@@ -1,6 +1,6 @@
1
1
  import Joi from 'joi';
2
2
  import { IEntityMeta, IEmbeddedEntity } from '../../shared';
3
- import { Point } from '../../geo-location';
3
+ import { IAssetTelemetry } from '../../telemetry';
4
4
  export interface ILastLocation extends IEmbeddedEntity {
5
5
  firstSeen: number;
6
6
  lastSeen: number;
@@ -8,17 +8,6 @@ export interface ILastLocation extends IEmbeddedEntity {
8
8
  export interface ICandidateLocation extends IEmbeddedEntity {
9
9
  confidence: number;
10
10
  }
11
- export interface ITagTelemetry {
12
- id: string;
13
- battery?: number;
14
- voltage?: number;
15
- temperature?: number;
16
- }
17
- export interface IAssetTelemetry {
18
- battery?: number;
19
- geolocation?: Point;
20
- tags?: ITagTelemetry[];
21
- }
22
11
  export interface GetAssetResponse {
23
12
  id: string;
24
13
  name: string;
@@ -29,8 +18,6 @@ export interface GetAssetResponse {
29
18
  lastLocation?: ILastLocation;
30
19
  candidateLocations?: ICandidateLocation[];
31
20
  }
32
- export declare const tagTelemetrySchema: Joi.ObjectSchema<ITagTelemetry>;
33
- export declare const telemetrySchema: Joi.ObjectSchema<IAssetTelemetry>;
34
21
  export declare const candidateLocationSchema: Joi.ObjectSchema<IEmbeddedEntity & ICandidateLocation>;
35
22
  export declare const getAssetResponseSchema: Joi.ObjectSchema<GetAssetResponse>;
36
23
  export declare const validateGetAssetResponse: (payload: any) => GetAssetResponse;
@@ -3,21 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateGetAssetResponse = exports.getAssetResponseSchema = exports.candidateLocationSchema = exports.telemetrySchema = exports.tagTelemetrySchema = void 0;
6
+ exports.validateGetAssetResponse = exports.getAssetResponseSchema = exports.candidateLocationSchema = void 0;
7
7
  const joi_1 = __importDefault(require("joi"));
8
8
  const shared_1 = require("../../shared");
9
- const geo_location_1 = require("../../geo-location");
10
- exports.tagTelemetrySchema = joi_1.default.object({
11
- id: shared_1.xString,
12
- battery: shared_1.xPercentage,
13
- voltage: joi_1.default.number(),
14
- temperature: joi_1.default.number(),
15
- });
16
- exports.telemetrySchema = joi_1.default.object({
17
- battery: shared_1.xPercentage,
18
- geolocation: geo_location_1.pointSchema,
19
- tags: (0, shared_1.xArray)(exports.tagTelemetrySchema),
20
- });
9
+ const telemetry_1 = require("../../telemetry");
21
10
  exports.candidateLocationSchema = (0, shared_1.embeddedEntitySchema)().append({
22
11
  confidence: shared_1.xPercentage.required(),
23
12
  });
@@ -31,7 +20,7 @@ exports.getAssetResponseSchema = joi_1.default.object({
31
20
  firstSeen: shared_1.xTime.required(),
32
21
  lastSeen: shared_1.xTime.required(),
33
22
  }),
34
- telemetry: exports.telemetrySchema,
23
+ telemetry: telemetry_1.assetTelemetrySchema,
35
24
  candidateLocations: (0, shared_1.xArray)(exports.candidateLocationSchema),
36
25
  });
37
26
  const validateGetAssetResponse = (payload) => (0, shared_1.validateJoiSchema)(exports.getAssetResponseSchema, payload);
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/types/assets/[id]/get.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,yCAYsB;AACtB,qDAAwD;AAsD3C,QAAA,kBAAkB,GAAG,aAAG,CAAC,MAAM,CAAsB;IAChE,EAAE,EAAE,gBAAO;IACX,OAAO,EAAE,oBAAW;IACpB,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,aAAG,CAAC,MAAM,CAAwB;IAC/D,OAAO,EAAE,oBAAW;IACpB,WAAW,EAAE,0BAAW;IACxB,IAAI,EAAE,IAAA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IAAI,EAAE,gBAAO,CAAC,QAAQ,EAAE;IAGxB,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,IAAI,EAAE,yBAAgB;IACtB,MAAM,EAAE,IAAA,wBAAe,GAAE;IACzB,YAAY,EAAE,IAAA,6BAAoB,GAAiB,CAAC,MAAM,CAAC;QACzD,SAAS,EAAE,cAAK,CAAC,QAAQ,EAAE;QAC3B,QAAQ,EAAE,cAAK,CAAC,QAAQ,EAAE;KAC3B,CAAC;IACF,SAAS,EAAE,gCAAoB;IAC/B,kBAAkB,EAAE,IAAA,eAAM,EAAC,+BAAuB,CAAC;CACpD,CAAC,CAAC;AAEI,MAAM,wBAAwB,GAAG,CAAC,OAAY,EAAE,EAAE,CACvD,IAAA,0BAAiB,EAAmB,8BAAsB,EAAE,OAAO,CAAC,CAAC;AAD1D,QAAA,wBAAwB,4BACkC"}
@@ -10,6 +10,7 @@ export * from './organisations';
10
10
  export * from './readers';
11
11
  export * from './roles';
12
12
  export * from './tags';
13
+ export * from './telemetry';
13
14
  export * from './triggers';
14
15
  export * from './users';
15
16
  export * from './errors';
@@ -22,6 +22,7 @@ __exportStar(require("./organisations"), exports);
22
22
  __exportStar(require("./readers"), exports);
23
23
  __exportStar(require("./roles"), exports);
24
24
  __exportStar(require("./tags"), exports);
25
+ __exportStar(require("./telemetry"), exports);
25
26
  __exportStar(require("./triggers"), exports);
26
27
  __exportStar(require("./users"), exports);
27
28
  __exportStar(require("./errors"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
@@ -1,5 +1,6 @@
1
1
  import Joi from 'joi';
2
2
  import { IEntityMeta, IEmbeddedEntity } from '../../shared';
3
+ import { IAssetTelemetry } from '../../telemetry';
3
4
  export interface IEmbeddedReader extends IEmbeddedEntity {
4
5
  displayName: string;
5
6
  }
@@ -9,6 +10,7 @@ export interface GetLocationResponse {
9
10
  tagIds?: string[];
10
11
  readers?: IEmbeddedReader[];
11
12
  level?: string;
13
+ telemetry?: IAssetTelemetry;
12
14
  meta?: IEntityMeta;
13
15
  }
14
16
  export declare const embeddedReaderSchema: Joi.ObjectSchema<IEmbeddedReader>;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.validateGetLocationResponse = exports.getLocationResponseSchema = exports.embeddedReaderSchema = void 0;
7
7
  const joi_1 = __importDefault(require("joi"));
8
8
  const shared_1 = require("../../shared");
9
+ const telemetry_1 = require("../../telemetry");
9
10
  exports.embeddedReaderSchema = joi_1.default.object({
10
11
  id: shared_1.xObjectId.required(),
11
12
  name: shared_1.xEmptyString.required(),
@@ -17,6 +18,7 @@ exports.getLocationResponseSchema = joi_1.default.object({
17
18
  level: shared_1.xString,
18
19
  tagIds: (0, shared_1.xArrayOfStrings)(),
19
20
  readers: (0, shared_1.xArray)((0, shared_1.embeddedEntitySchema)()),
21
+ telemetry: telemetry_1.assetTelemetrySchema,
20
22
  meta: shared_1.entityMetaSchema,
21
23
  });
22
24
  const validateGetLocationResponse = (payload) => (0, shared_1.validateJoiSchema)(exports.getLocationResponseSchema, payload);
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/types/locations/[id]/get.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,yCAWsB;AAyBT,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,CAAwB;IACpE,EAAE,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACxB,IAAI,EAAE,qBAAY,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,gBAAO,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,aAAG,CAAC,MAAM,CAA4B;IAE7E,EAAE,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACxB,IAAI,EAAE,gBAAO,CAAC,QAAQ,EAAE;IAGxB,KAAK,EAAE,gBAAO;IACd,MAAM,EAAE,IAAA,wBAAe,GAAE;IACzB,OAAO,EAAE,IAAA,eAAM,EAAC,IAAA,6BAAoB,GAAE,CAAC;IACvC,IAAI,EAAE,yBAAgB;CACvB,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAG,CAAC,OAAY,EAAE,EAAE,CAC1D,IAAA,0BAAiB,EAAsB,iCAAyB,EAAE,OAAO,CAAC,CAAC;AADhE,QAAA,2BAA2B,+BACqC"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/types/locations/[id]/get.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,yCAWsB;AACtB,+CAAwE;AA4B3D,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,CAAwB;IACpE,EAAE,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACxB,IAAI,EAAE,qBAAY,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,gBAAO,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,aAAG,CAAC,MAAM,CAA4B;IAE7E,EAAE,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACxB,IAAI,EAAE,gBAAO,CAAC,QAAQ,EAAE;IAGxB,KAAK,EAAE,gBAAO;IACd,MAAM,EAAE,IAAA,wBAAe,GAAE;IACzB,OAAO,EAAE,IAAA,eAAM,EAAC,IAAA,6BAAoB,GAAE,CAAC;IACvC,SAAS,EAAE,gCAAoB;IAC/B,IAAI,EAAE,yBAAgB;CACvB,CAAC,CAAC;AAEI,MAAM,2BAA2B,GAAG,CAAC,OAAY,EAAE,EAAE,CAC1D,IAAA,0BAAiB,EAAsB,iCAAyB,EAAE,OAAO,CAAC,CAAC;AADhE,QAAA,2BAA2B,+BACqC"}
@@ -1,7 +1,7 @@
1
1
  import Joi from 'joi';
2
2
  import { SearchableSortFields, SortOrders } from '../../shared';
3
3
  export declare type LocationSearchField = 'name';
4
- export declare type LocationEmbedField = 'meta' | 'tagIds' | 'readers';
4
+ export declare type LocationEmbedField = 'meta' | 'tagIds' | 'readers' | 'telemetry';
5
5
  export interface GetLocationsQuery {
6
6
  page?: number;
7
7
  limit?: number;
@@ -1,5 +1,6 @@
1
1
  import Joi from 'joi';
2
2
  import { IEntityMeta, IEmbeddedEntity } from '../../shared';
3
+ import { IReaderTelemetry } from '../../telemetry';
3
4
  import { ReaderType, DeviceType } from '../constants';
4
5
  export interface IReaderStatus {
5
6
  online: boolean;
@@ -25,6 +26,7 @@ export interface GetReaderResponse {
25
26
  endpoint: string;
26
27
  network?: string;
27
28
  location?: ReaderLocation;
29
+ telemetry?: IReaderTelemetry;
28
30
  meta?: IEntityMeta;
29
31
  status?: IReaderStatus;
30
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/types/readers/[id]/get.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,yCAasB;AACtB,4CAMsB;AA+ET,QAAA,kBAAkB,GAAG,aAAG,CAAC,MAAM,CAAsB;IAChE,MAA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EAAE;QAC/B,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,IAAA,uBAAc,EAAC,GAAG,IAAA,mCAAuB,EAAC,KAAK,CAAC,CAAC;gBACrD,IAAI,EAAE,oBAAW;aAClB;YACD;gBACE,EAAE,EAAE,IAAA,uBAAc,EAAC,GAAG,IAAA,mCAAuB,EAAC,QAAQ,CAAC,CAAC;gBACxD,IAAI,EAAE,gBAAO;aACd;SACF;QACD,SAAS,EAAE,aAAG,CAAC,SAAS,EAAE;KAC3B,CAAC;IACF,OAAO,EAAE,gBAAO;IAChB,QAAQ,EAAE,IAAA,6BAAoB,GAAkB,CAAC,MAAM,CAAC;QACtD,IAAI,EAAE,IAAA,uBAAc,EAAC,OAAO,EAAE,QAAQ,CAAC;QACvC,SAAS,EAAE,aAAG,CAAC,IAAI,CAAC,MAAM,EAAE;YAC1B,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,cAAK,CAAC,QAAQ,EAAE;YACtB,SAAS,EAAE,aAAG,CAAC,SAAS,EAAE;SAC3B,CAAC;QACF,QAAQ,EAAE,aAAG,CAAC,IAAI,CAAC,MAAM,EAAE;YACzB,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,cAAK,CAAC,QAAQ,EAAE;YACtB,SAAS,EAAE,aAAG,CAAC,SAAS,EAAE;SAC3B,CAAC;KACH,CAAC;IACF,IAAI,EAAE,yBAAgB;IACtB,MAAM,EAAE,0BAAkB;CAC3B,CAAC,CAAC;AAEI,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAE,EAAE,CACxD,IAAA,0BAAiB,EAAoB,+BAAuB,EAAE,OAAO,CAAC,CAAC;AAD5D,QAAA,yBAAyB,6BACmC"}
@@ -2,7 +2,7 @@ import Joi from 'joi';
2
2
  import { SearchableSortFields, SortOrders } from '../../shared';
3
3
  import { ReaderType, DeviceType } from '../constants';
4
4
  export declare type ReaderSearchField = 'name' | 'deviceId';
5
- export declare type ReaderEmbedField = 'meta' | 'status';
5
+ export declare type ReaderEmbedField = 'meta' | 'status' | 'telemetry';
6
6
  export interface GetReadersQuery {
7
7
  page?: number;
8
8
  limit?: number;
@@ -0,0 +1,19 @@
1
+ import Joi from 'joi';
2
+ import { Point } from './geo-location';
3
+ export interface ITagTelemetry {
4
+ id: string;
5
+ battery?: number;
6
+ voltage?: number;
7
+ temperature?: number;
8
+ }
9
+ export interface IAssetTelemetry {
10
+ battery?: number;
11
+ geolocation?: Point;
12
+ tags?: ITagTelemetry[];
13
+ }
14
+ export interface IReaderTelemetry {
15
+ geolocation?: Point;
16
+ }
17
+ export declare const tagTelemetrySchema: Joi.ObjectSchema<ITagTelemetry>;
18
+ export declare const assetTelemetrySchema: Joi.ObjectSchema<IAssetTelemetry>;
19
+ export declare const readerTelemetrySchema: Joi.ObjectSchema<IReaderTelemetry>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.readerTelemetrySchema = exports.assetTelemetrySchema = exports.tagTelemetrySchema = void 0;
7
+ const joi_1 = __importDefault(require("joi"));
8
+ const shared_1 = require("./shared");
9
+ const geo_location_1 = require("./geo-location");
10
+ exports.tagTelemetrySchema = joi_1.default.object({
11
+ id: shared_1.xString,
12
+ battery: shared_1.xPercentage,
13
+ voltage: joi_1.default.number(),
14
+ temperature: joi_1.default.number(),
15
+ });
16
+ exports.assetTelemetrySchema = joi_1.default.object({
17
+ battery: shared_1.xPercentage,
18
+ geolocation: geo_location_1.pointSchema,
19
+ tags: (0, shared_1.xArray)(exports.tagTelemetrySchema),
20
+ });
21
+ exports.readerTelemetrySchema = joi_1.default.object({
22
+ geolocation: geo_location_1.pointSchema,
23
+ });
24
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,qCAAwD;AACxD,iDAAoD;AAsBvC,QAAA,kBAAkB,GAAG,aAAG,CAAC,MAAM,CAAsB;IAChE,EAAE,EAAE,gBAAO;IACX,OAAO,EAAE,oBAAW;IACpB,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,CAAwB;IACpE,OAAO,EAAE,oBAAW;IACpB,WAAW,EAAE,0BAAW;IACxB,IAAI,EAAE,IAAA,eAAM,EAAC,0BAAkB,CAAC;CACjC,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,aAAG,CAAC,MAAM,CAAyB;IACtE,WAAW,EAAE,0BAAW;CACzB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "0.2.8-alpha.0",
4
+ "version": "0.2.9-alpha.0",
5
5
  "description": "Spotto's API Contract",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -10,14 +10,14 @@
10
10
  "scripts": {
11
11
  "build": "rm -rf dist && tsc --project tsconfig.types.json",
12
12
  "clean": "rm -rf node_modules && rm -rf yarn.lock",
13
- "test": "jest src -w 1",
13
+ "test": "jest -w 1",
14
14
  "internal": "spot docs src/api.internal.ts",
15
15
  "public": "spot docs src/api.public.ts",
16
16
  "generate": "spot generate -c src/api.public.ts --language json --generator openapi3 --out ../docs/constants"
17
17
  },
18
18
  "dependencies": {
19
19
  "@airtasker/spot": "^1.4.0",
20
- "@spotto/core-lib": "^0.2.7-alpha.0",
20
+ "@spotto/core-lib": "^0.2.9-alpha.0",
21
21
  "geojson-validation": "^1.0.2",
22
22
  "joi": "^17.4.2",
23
23
  "qs": "^6.9.4"
@@ -30,5 +30,5 @@
30
30
  "@babel/preset-typescript": "^7.12.7",
31
31
  "jest": "^27.3.0"
32
32
  },
33
- "gitHead": "2951dcd3867523dcb4c4e21de208179f6d5db9b1"
33
+ "gitHead": "a159efa5f3b719a2adaa00795df791a7b1d2128d"
34
34
  }