@spotto/contract 0.0.12 → 0.0.14

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,5 +1,7 @@
1
1
  export interface GetAssetSuggestionsQuery {
2
2
  search: string;
3
+ maxSuggestions?: number;
4
+ maxMatches?: number;
3
5
  }
4
6
  export declare const getAssetSuggestionsQuerySchema: import("joi").ObjectSchema<GetAssetSuggestionsQuery>;
5
7
  export declare const validateGetAssetSuggestionsQuery: (payload: any) => GetAssetSuggestionsQuery;
@@ -5,6 +5,8 @@ const joi_1 = require("joi");
5
5
  const shared_1 = require("../../shared");
6
6
  exports.getAssetSuggestionsQuerySchema = joi_1.object({
7
7
  search: shared_1.xString.required().lowercase(),
8
+ maxSuggestions: shared_1.xInt.max(10),
9
+ maxMatches: shared_1.xInt.max(10),
8
10
  });
9
11
  const validateGetAssetSuggestionsQuery = (payload) => shared_1.validateJoiSchema(exports.getAssetSuggestionsQuerySchema, payload);
10
12
  exports.validateGetAssetSuggestionsQuery = validateGetAssetSuggestionsQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/assets/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAA0D;AAO7C,QAAA,8BAA8B,GAAG,YAAM,CAA2B;IAC7E,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;CACvC,CAAC,CAAC;AAEI,MAAM,gCAAgC,GAAG,CAAC,OAAY,EAAE,EAAE,CAC/D,0BAAiB,CACf,sCAA8B,EAC9B,OAAO,CACR,CAAC;AAJS,QAAA,gCAAgC,oCAIzC"}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/assets/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAAgE;AAanD,QAAA,8BAA8B,GAAG,YAAM,CAA2B;IAC7E,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;IACtC,cAAc,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,UAAU,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEI,MAAM,gCAAgC,GAAG,CAAC,OAAY,EAAE,EAAE,CAC/D,0BAAiB,CACf,sCAA8B,EAC9B,OAAO,CACR,CAAC;AAJS,QAAA,gCAAgC,oCAIzC"}
@@ -9,6 +9,7 @@ export interface GetLocationsQuery {
9
9
  levels?: string[];
10
10
  hasTags?: boolean;
11
11
  hasReaders?: boolean;
12
+ setupComplete?: boolean;
12
13
  archived?: boolean;
13
14
  sort?: SearchableSortFields;
14
15
  sortOrder?: SortOrders;
@@ -11,6 +11,9 @@ exports.getLocationsQuerySchema = joi_1.object({
11
11
  levels: shared_1.xArrayOfStrings(true),
12
12
  hasTags: shared_1.xBool,
13
13
  hasReaders: shared_1.xBool,
14
+ setupComplete: shared_1.xBool
15
+ .when('hasTags', { is: joi_1.exist(), then: joi_1.forbidden() })
16
+ .when('hasReaders', { is: joi_1.exist(), then: joi_1.forbidden() }),
14
17
  archived: shared_1.xBool,
15
18
  sort: shared_1.xSearchableSortFields,
16
19
  sortOrder: shared_1.xSortOrder,
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/locations/get/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAYsB;AA8ET,QAAA,uBAAuB,GAAG,YAAM,CAAoB;IAE/D,IAAI,EAAE,aAAI;IACV,KAAK,EAAE,aAAI;IAGX,GAAG,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAC5B,MAAM,EAAE,wBAAe,CAAC,IAAI,CAAC;IAC7B,MAAM,EAAE,wBAAe,CAAC,IAAI,CAAC;IAC7B,OAAO,EAAE,cAAK;IACd,UAAU,EAAE,cAAK;IACjB,QAAQ,EAAE,cAAK;IAGf,IAAI,EAAE,8BAAqB;IA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AC5D,CAAC,CAAC;AAEI,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAE,EAAE,CACxD,kCAAyB,CACvB,+BAAuB,EACvB,OAAO,CACR,CAAC;AAJS,QAAA,yBAAyB,6BAIlC"}
@@ -1,5 +1,7 @@
1
1
  export interface GetLocationSuggestionsQuery {
2
2
  search: string;
3
+ maxSuggestions?: number;
4
+ maxMatches?: number;
3
5
  }
4
6
  export declare const getLocationSuggestionsQuerySchema: import("joi").ObjectSchema<GetLocationSuggestionsQuery>;
5
7
  export declare const validateGetLocationSuggestionsQuery: (payload: any) => GetLocationSuggestionsQuery;
@@ -5,6 +5,8 @@ const joi_1 = require("joi");
5
5
  const shared_1 = require("../../shared");
6
6
  exports.getLocationSuggestionsQuerySchema = joi_1.object({
7
7
  search: shared_1.xString.required().lowercase(),
8
+ maxSuggestions: shared_1.xInt.max(10),
9
+ maxMatches: shared_1.xInt.max(10),
8
10
  });
9
11
  const validateGetLocationSuggestionsQuery = (payload) => shared_1.validateJoiSchema(exports.getLocationSuggestionsQuerySchema, payload);
10
12
  exports.validateGetLocationSuggestionsQuery = validateGetLocationSuggestionsQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/locations/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAA0D;AAO7C,QAAA,iCAAiC,GAAG,YAAM,CACrD;IACE,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;CACvC,CACF,CAAC;AAEK,MAAM,mCAAmC,GAAG,CAAC,OAAY,EAAE,EAAE,CAClE,0BAAiB,CACf,yCAAiC,EACjC,OAAO,CACR,CAAC;AAJS,QAAA,mCAAmC,uCAI5C"}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/locations/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAAgE;AAanD,QAAA,iCAAiC,GAC5C,YAAM,CAA8B;IAClC,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;IACtC,cAAc,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,UAAU,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEE,MAAM,mCAAmC,GAAG,CAAC,OAAY,EAAE,EAAE,CAClE,0BAAiB,CACf,yCAAiC,EACjC,OAAO,CACR,CAAC;AAJS,QAAA,mCAAmC,uCAI5C"}
@@ -6,6 +6,7 @@ export interface GetReadersQuery {
6
6
  page?: number;
7
7
  limit?: number;
8
8
  ids?: string[];
9
+ locationIds?: string[];
9
10
  deviceIds?: string[];
10
11
  type?: ReaderType;
11
12
  manufacturer?: Manufacturer;
@@ -7,6 +7,7 @@ const constants_1 = require("../constants");
7
7
  exports.getReadersQuerySchema = joi_1.object({
8
8
  page: shared_1.xInt,
9
9
  limit: shared_1.xInt,
10
+ locationIds: shared_1.xArrayOfObjectIds(true),
10
11
  ids: shared_1.xArrayOfObjectIds(true),
11
12
  deviceIds: shared_1.xArrayOfStrings(true),
12
13
  type: shared_1.xStringIsOneOf(...constants_1.READER_TYPES),
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/readers/get/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAasB;AACtB,4CAKsB;AA8ET,QAAA,qBAAqB,GAAG,YAAM,CAAkB;IAE3D,IAAI,EAAE,aAAI;IACV,KAAK,EAAE,aAAI;IAGX,GAAG,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,wBAAe,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,uBAAc,CAAC,GAAG,wBAAY,CAAC;IACrC,YAAY,EAAE,uBAAc,CAAC,GAAG,yBAAa,CAAC;IAC9C,QAAQ,EAAE,cAAK;IAGf,IAAI,EAAE,8BAAqB;IAC3B,SAAS,EAAE,mBAAU;IAGrB,MAAM,EAAE,gBAAO,CAAC,SAAS,EAAE;IAC3B,WAAW,EAAE,cAAK;IAClB,YAAY,EAAE,gCAAuB,CAAC,MAAM,EAAE,UAAU,CAAC;IAGzD,KAAK,EAAE,gCAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC;CACjD,CAAC,CAAC;AAEI,MAAM,uBAAuB,GAAG,CAAC,OAAY,EAAE,EAAE,CACtD,kCAAyB,CAAkB,6BAAqB,EAAE,OAAO,CAAC,CAAC;AADhE,QAAA,uBAAuB,2BACyC"}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/readers/get/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAasB;AACtB,4CAKsB;AAiFT,QAAA,qBAAqB,GAAG,YAAM,CAAkB;IAE3D,IAAI,EAAE,aAAI;IACV,KAAK,EAAE,aAAI;IAGX,WAAW,EAAE,0BAAiB,CAAC,IAAI,CAAC;IACpC,GAAG,EAAE,0BAAiB,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,wBAAe,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,uBAAc,CAAC,GAAG,wBAAY,CAAC;IACrC,YAAY,EAAE,uBAAc,CAAC,GAAG,yBAAa,CAAC;IAC9C,QAAQ,EAAE,cAAK;IAGf,IAAI,EAAE,8BAAqB;IAC3B,SAAS,EAAE,mBAAU;IAGrB,MAAM,EAAE,gBAAO,CAAC,SAAS,EAAE;IAC3B,WAAW,EAAE,cAAK;IAClB,YAAY,EAAE,gCAAuB,CAAC,MAAM,EAAE,UAAU,CAAC;IAGzD,KAAK,EAAE,gCAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC;CACjD,CAAC,CAAC;AAEI,MAAM,uBAAuB,GAAG,CAAC,OAAY,EAAE,EAAE,CACtD,kCAAyB,CAAkB,6BAAqB,EAAE,OAAO,CAAC,CAAC;AADhE,QAAA,uBAAuB,2BACyC"}
@@ -1,5 +1,7 @@
1
1
  export interface GetReaderSuggestionsQuery {
2
2
  search: string;
3
+ maxSuggestions?: number;
4
+ maxMatches?: number;
3
5
  }
4
6
  export declare const getReaderSuggestionsQuerySchema: import("joi").ObjectSchema<GetReaderSuggestionsQuery>;
5
7
  export declare const validateGetReaderSuggestionsQuery: (payload: any) => GetReaderSuggestionsQuery;
@@ -5,6 +5,8 @@ const joi_1 = require("joi");
5
5
  const shared_1 = require("../../shared");
6
6
  exports.getReaderSuggestionsQuerySchema = joi_1.object({
7
7
  search: shared_1.xString.required().lowercase(),
8
+ maxSuggestions: shared_1.xInt.max(10),
9
+ maxMatches: shared_1.xInt.max(10),
8
10
  });
9
11
  const validateGetReaderSuggestionsQuery = (payload) => shared_1.validateJoiSchema(exports.getReaderSuggestionsQuerySchema, payload);
10
12
  exports.validateGetReaderSuggestionsQuery = validateGetReaderSuggestionsQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/readers/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAA0D;AAO7C,QAAA,+BAA+B,GAAG,YAAM,CACnD;IACE,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;CACvC,CACF,CAAC;AAEK,MAAM,iCAAiC,GAAG,CAAC,OAAY,EAAE,EAAE,CAChE,0BAAiB,CACf,uCAA+B,EAC/B,OAAO,CACR,CAAC;AAJS,QAAA,iCAAiC,qCAI1C"}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../src/types/readers/suggestions/query.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yCAAgE;AAanD,QAAA,+BAA+B,GAC1C,YAAM,CAA4B;IAChC,MAAM,EAAE,gBAAO,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE;IACtC,cAAc,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,UAAU,EAAE,aAAI,CAAC,GAAG,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEE,MAAM,iCAAiC,GAAG,CAAC,OAAY,EAAE,EAAE,CAChE,0BAAiB,CACf,uCAA+B,EAC/B,OAAO,CACR,CAAC;AAJS,QAAA,iCAAiC,qCAI1C"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
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.12",
20
+ "@spotto/core-lib": "^0.0.14",
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": "a4c0201ca60310fad0b7c0cf0f27e06aab123197"
29
+ "gitHead": "f11b8356490d253fa42ec8f85a4b2b5ca73beec6"
30
30
  }