@spotto/contract 1.0.27 → 1.0.29-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.
Files changed (53) hide show
  1. package/dist/assets/[id]/get.d.ts +9 -3
  2. package/dist/assets/get/query.d.ts +1 -0
  3. package/dist/fields/[id]/get.d.ts +16 -0
  4. package/dist/fields/[id]/get.js +3 -0
  5. package/dist/fields/[id]/get.js.map +1 -0
  6. package/dist/fields/[id]/index.d.ts +2 -0
  7. package/dist/fields/[id]/index.js +19 -0
  8. package/dist/fields/[id]/index.js.map +1 -0
  9. package/dist/fields/[id]/patch/index.d.ts +2 -0
  10. package/dist/fields/[id]/patch/index.js +19 -0
  11. package/dist/fields/[id]/patch/index.js.map +1 -0
  12. package/dist/fields/[id]/patch/request.d.ts +13 -0
  13. package/dist/fields/[id]/patch/request.js +3 -0
  14. package/dist/fields/[id]/patch/request.js.map +1 -0
  15. package/dist/fields/[id]/patch/response.d.ts +1 -0
  16. package/dist/fields/[id]/patch/response.js +3 -0
  17. package/dist/fields/[id]/patch/response.js.map +1 -0
  18. package/dist/fields/constants.d.ts +4 -0
  19. package/dist/fields/constants.js +20 -0
  20. package/dist/fields/constants.js.map +1 -0
  21. package/dist/fields/get/index.d.ts +2 -0
  22. package/dist/fields/get/index.js +19 -0
  23. package/dist/fields/get/index.js.map +1 -0
  24. package/dist/fields/get/query.d.ts +11 -0
  25. package/dist/fields/get/query.js +3 -0
  26. package/dist/fields/get/query.js.map +1 -0
  27. package/dist/fields/get/response.d.ts +7 -0
  28. package/dist/fields/get/response.js +3 -0
  29. package/dist/fields/get/response.js.map +1 -0
  30. package/dist/fields/index.d.ts +4 -0
  31. package/dist/fields/index.js +21 -0
  32. package/dist/fields/index.js.map +1 -0
  33. package/dist/fields/post/index.d.ts +2 -0
  34. package/dist/fields/post/index.js +19 -0
  35. package/dist/fields/post/index.js.map +1 -0
  36. package/dist/fields/post/request.d.ts +17 -0
  37. package/dist/fields/post/request.js +8 -0
  38. package/dist/fields/post/request.js.map +1 -0
  39. package/dist/fields/post/response.d.ts +5 -0
  40. package/dist/fields/post/response.js +3 -0
  41. package/dist/fields/post/response.js.map +1 -0
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +1 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/locations/[id]/get.d.ts +1 -0
  46. package/dist/readers/[id]/get.d.ts +3 -0
  47. package/dist/readers/get/query.d.ts +1 -0
  48. package/dist/types/[id]/get.d.ts +23 -0
  49. package/dist/types/[id]/patch/request.d.ts +4 -0
  50. package/dist/types/post/request.d.ts +60 -0
  51. package/dist/types/post/request.js +12 -0
  52. package/dist/types/post/request.js.map +1 -1
  53. package/package.json +2 -2
@@ -1,12 +1,18 @@
1
+ import { type Point } from 'geojson';
1
2
  import { IEmbeddedLabel } from '../../labels';
2
3
  import { LocationType } from '../../locations/constants';
3
4
  import { IEntityMeta, IEmbeddedEntity } from '../../shared';
4
5
  import { IAssetTelemetry } from '../../telemetry';
5
- export interface ILastLocation extends IEmbeddedEntity {
6
- type: LocationType;
6
+ export interface ILastLocation {
7
+ id?: string;
8
+ name?: string;
9
+ type?: LocationType;
7
10
  firstSeen: number;
8
11
  lastSeen: number;
9
- distance: number;
12
+ distance?: number;
13
+ confidence?: number;
14
+ moving?: boolean;
15
+ geolocation?: Point;
10
16
  organisation?: IEmbeddedEntity;
11
17
  }
12
18
  export interface ICandidateLocation extends IEmbeddedEntity {
@@ -10,6 +10,7 @@ export interface AssetFilters {
10
10
  tagIds?: string[];
11
11
  hasTags?: boolean;
12
12
  hasReported?: boolean;
13
+ hasGeolocationState?: boolean;
13
14
  roamingStatus?: AssetRoamingStatus;
14
15
  battery?: AssetBatteryStatus;
15
16
  search?: string;
@@ -0,0 +1,16 @@
1
+ import { FieldDataType, FieldInputType } from '../constants';
2
+ export interface GetFieldResponse {
3
+ id: string;
4
+ name: string;
5
+ dataType: FieldDataType;
6
+ inputType?: FieldInputType;
7
+ label?: string;
8
+ required?: boolean;
9
+ regex?: string;
10
+ options?: string[];
11
+ integerMin?: number;
12
+ integerMax?: number;
13
+ decimalMin?: number;
14
+ decimalMax?: number;
15
+ decimalPlaces?: number;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/fields/[id]/get.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './patch';
2
+ export * from './get';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./patch"), exports);
18
+ __exportStar(require("./get"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fields/[id]/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,wCAAsB"}
@@ -0,0 +1,2 @@
1
+ export * from './request';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./request"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fields/[id]/patch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B"}
@@ -0,0 +1,13 @@
1
+ import { FieldInputType } from '../../constants';
2
+ export interface UpdateFieldRequest {
3
+ inputType?: FieldInputType;
4
+ label?: string;
5
+ required?: boolean;
6
+ regex?: string;
7
+ options?: string[];
8
+ integerMin?: number;
9
+ integerMax?: number;
10
+ decimalMin?: number;
11
+ decimalMax?: number;
12
+ decimalPlaces?: number;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/fields/[id]/patch/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { GetFieldResponse as UpdateFieldResponse } from '../get';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/fields/[id]/patch/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export declare type FieldDataType = 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN' | 'DATE';
2
+ export declare const FIELD_DATA_TYPES: FieldDataType[];
3
+ export declare type FieldInputType = 'SINGLELINE' | 'MULTILINE' | 'LINK' | 'RICHTEXT' | 'DROPDOWN' | 'RADIO' | 'CHECKBOXES';
4
+ export declare const FIELD_INPUT_TYPES: FieldInputType[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIELD_INPUT_TYPES = exports.FIELD_DATA_TYPES = void 0;
4
+ exports.FIELD_DATA_TYPES = [
5
+ 'STRING',
6
+ 'INTEGER',
7
+ 'DECIMAL',
8
+ 'BOOLEAN',
9
+ 'DATE',
10
+ ];
11
+ exports.FIELD_INPUT_TYPES = [
12
+ 'SINGLELINE',
13
+ 'MULTILINE',
14
+ 'LINK',
15
+ 'RICHTEXT',
16
+ 'DROPDOWN',
17
+ 'RADIO',
18
+ 'CHECKBOXES',
19
+ ];
20
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/fields/constants.ts"],"names":[],"mappings":";;;AAOa,QAAA,gBAAgB,GAAoB;IAC/C,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;CACP,CAAC;AAWW,QAAA,iBAAiB,GAAqB;IACjD,YAAY;IACZ,WAAW;IACX,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,YAAY;CACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './query';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./query"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fields/get/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B"}
@@ -0,0 +1,11 @@
1
+ import { StandardSortFields, SortOrders } from '../../shared';
2
+ export declare type FieldSortField = StandardSortFields;
3
+ export declare type FieldEmbedField = 'meta';
4
+ export interface GetFieldsQuery {
5
+ page?: number;
6
+ limit?: number;
7
+ names?: string[];
8
+ sort?: FieldSortField;
9
+ sortOrder?: SortOrders;
10
+ embed?: Array<FieldEmbedField>;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/fields/get/query.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { GetFieldsQuery } from './query';
2
+ import { GetFieldResponse } from '../[id]/get';
3
+ export interface GetFieldsResponse {
4
+ query: GetFieldsQuery | null;
5
+ total: number;
6
+ items: GetFieldResponse[];
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/fields/get/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './[id]';
2
+ export * from './get';
3
+ export * from './post';
4
+ export * from './constants';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./[id]"), exports);
18
+ __exportStar(require("./get"), exports);
19
+ __exportStar(require("./post"), exports);
20
+ __exportStar(require("./constants"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,wCAAsB;AACtB,yCAAuB;AACvB,8CAA4B"}
@@ -0,0 +1,2 @@
1
+ export * from './request';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./request"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fields/post/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B"}
@@ -0,0 +1,17 @@
1
+ import { FieldDataType, FieldInputType } from '../constants';
2
+ export interface PostFieldRequest {
3
+ name: string;
4
+ dataType: FieldDataType;
5
+ inputType?: FieldInputType;
6
+ label?: string;
7
+ required?: boolean;
8
+ regex?: string;
9
+ options?: string[];
10
+ integerMin?: number;
11
+ integerMax?: number;
12
+ decimalMin?: number;
13
+ decimalMax?: number;
14
+ decimalPlaces?: number;
15
+ }
16
+ export declare type PostFieldsRequest = PostFieldRequest[];
17
+ export declare const testPostFieldRequest: PostFieldRequest;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testPostFieldRequest = void 0;
4
+ exports.testPostFieldRequest = {
5
+ name: 'Documentation',
6
+ dataType: 'STRING',
7
+ };
8
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/fields/post/request.ts"],"names":[],"mappings":";;;AAuBa,QAAA,oBAAoB,GAAqB;IACpD,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { GetFieldResponse } from '../[id]/get';
2
+ export interface PostFieldsResponse {
3
+ inserted: number;
4
+ items: GetFieldResponse[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/fields/post/response.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -15,3 +15,4 @@ export * from './manifests';
15
15
  export * from './users';
16
16
  export * from './errors';
17
17
  export * from './snapshots';
18
+ export * from './fields';
package/dist/index.js CHANGED
@@ -31,4 +31,5 @@ __exportStar(require("./manifests"), exports);
31
31
  __exportStar(require("./users"), exports);
32
32
  __exportStar(require("./errors"), exports);
33
33
  __exportStar(require("./snapshots"), exports);
34
+ __exportStar(require("./fields"), exports);
34
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,0CAAwB;AACxB,8CAA4B;AAC5B,0CAAwB;AACxB,2CAAyB;AACzB,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,0CAAwB;AACxB,8CAA4B;AAC5B,0CAAwB;AACxB,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB"}
@@ -11,6 +11,7 @@ export interface ILocationStatusLocation {
11
11
  firstSeen?: number;
12
12
  lastSeen?: number;
13
13
  moving?: boolean;
14
+ confidence?: number;
14
15
  geolocation?: Point;
15
16
  }
16
17
  export interface ILocationStatus {
@@ -2,12 +2,15 @@ import { type Point } from 'geojson';
2
2
  import { IEntityMeta, IEmbeddedEntity } from '../../shared';
3
3
  import { IReaderTelemetry } from '../../telemetry';
4
4
  import { ReaderType, DeviceType } from '../constants';
5
+ import { LocationType } from '../../locations';
5
6
  export interface IReaderStatusLocation {
6
7
  id?: string;
7
8
  name?: string;
9
+ type?: LocationType;
8
10
  firstSeen?: number;
9
11
  lastSeen?: number;
10
12
  moving?: boolean;
13
+ confidence?: number;
11
14
  geolocation?: Point;
12
15
  }
13
16
  export interface IReaderStatus {
@@ -10,6 +10,7 @@ export interface ReaderFilters {
10
10
  deviceTypes?: DeviceType[];
11
11
  isOnline?: boolean;
12
12
  hasReported?: boolean;
13
+ hasGeolocationState?: boolean;
13
14
  search?: string;
14
15
  searchFuzzy?: boolean;
15
16
  searchFields?: ReaderSearchField[];
@@ -1,3 +1,20 @@
1
+ import { GetFieldResponse } from '../../fields/[id]/get';
2
+ import { IEmbeddedEntity } from '../../shared';
3
+ export interface IFieldValue {
4
+ id: string;
5
+ name: string;
6
+ valueString?: string;
7
+ valueInteger?: number;
8
+ valueDecimal?: number;
9
+ valueBoolean?: boolean;
10
+ valueDate?: Date;
11
+ }
12
+ export interface IFieldDefinitionAll extends GetFieldResponse {
13
+ typePath: string;
14
+ }
15
+ export interface IFieldValueAll extends IFieldValue {
16
+ typePath: string;
17
+ }
1
18
  export interface GetTypeResponse {
2
19
  id: string;
3
20
  name: string;
@@ -6,4 +23,10 @@ export interface GetTypeResponse {
6
23
  fullNameTemplate?: string;
7
24
  description?: string;
8
25
  path?: string;
26
+ fields?: IEmbeddedEntity[];
27
+ fieldsAll?: IFieldDefinitionAll[];
28
+ typeFields?: IEmbeddedEntity[];
29
+ typeFieldsAll?: IFieldDefinitionAll[];
30
+ typeFieldValues?: IFieldValue[];
31
+ typeFieldValuesAll?: IFieldValueAll[];
9
32
  }
@@ -1,7 +1,11 @@
1
+ import { IEmbeddedEntityWithIdOrName, IFieldValueWithConstraints } from '../../post';
1
2
  export interface UpdateTypeRequest {
2
3
  name?: string;
3
4
  parent?: string;
4
5
  fullNameTemplate?: string;
5
6
  description?: string;
6
7
  path?: string;
8
+ fields?: IEmbeddedEntityWithIdOrName[];
9
+ typeFields?: IEmbeddedEntityWithIdOrName[];
10
+ typeFieldValues?: IFieldValueWithConstraints[];
7
11
  }
@@ -1,9 +1,69 @@
1
+ export declare type IEmbeddedEntityWithIdOrName = {
2
+ id: string;
3
+ name?: never;
4
+ } | {
5
+ id?: never;
6
+ name: string;
7
+ } | {
8
+ id: string;
9
+ name: string;
10
+ };
11
+ declare type ValueStringOnly = {
12
+ valueString: string;
13
+ valueInteger?: never;
14
+ valueDecimal?: never;
15
+ valueBoolean?: never;
16
+ valueDate?: never;
17
+ };
18
+ declare type ValueIntegerOnly = {
19
+ valueString?: never;
20
+ valueInteger: number;
21
+ valueDecimal?: never;
22
+ valueBoolean?: never;
23
+ valueDate?: never;
24
+ };
25
+ declare type ValueDecimalOnly = {
26
+ valueString?: never;
27
+ valueInteger?: never;
28
+ valueDecimal: number;
29
+ valueBoolean?: never;
30
+ valueDate?: never;
31
+ };
32
+ declare type ValueBooleanOnly = {
33
+ valueString?: never;
34
+ valueInteger?: never;
35
+ valueDecimal?: never;
36
+ valueBoolean: boolean;
37
+ valueDate?: never;
38
+ };
39
+ declare type ValueDateOnly = {
40
+ valueString?: never;
41
+ valueInteger?: never;
42
+ valueDecimal?: never;
43
+ valueBoolean?: never;
44
+ valueDate: Date;
45
+ };
46
+ declare type IdOrName = {
47
+ id: string;
48
+ name?: never;
49
+ } | {
50
+ id?: never;
51
+ name: string;
52
+ } | {
53
+ id: string;
54
+ name: string;
55
+ };
56
+ export declare type IFieldValueWithConstraints = IdOrName & (ValueStringOnly | ValueIntegerOnly | ValueDecimalOnly | ValueBooleanOnly | ValueDateOnly);
1
57
  export interface PostTypeRequest {
2
58
  name: string;
3
59
  parent?: string;
4
60
  fullNameTemplate?: string;
5
61
  description?: string;
6
62
  path?: string;
63
+ fields?: IEmbeddedEntityWithIdOrName[];
64
+ typeFields?: IEmbeddedEntityWithIdOrName[];
65
+ typeFieldValues?: IFieldValueWithConstraints[];
7
66
  }
8
67
  export declare type PostTypesRequest = PostTypeRequest[];
9
68
  export declare const testPostTypeRequest: PostTypeRequest;
69
+ export {};
@@ -5,5 +5,17 @@ exports.testPostTypeRequest = {
5
5
  parent: 'abcd',
6
6
  name: '1 kg',
7
7
  fullNameTemplate: '@name',
8
+ fields: [
9
+ {
10
+ id: '234567',
11
+ name: '123456',
12
+ },
13
+ ],
14
+ typeFieldValues: [
15
+ {
16
+ name: '123456',
17
+ valueBoolean: true,
18
+ },
19
+ ],
8
20
  };
9
21
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;AAWa,QAAA,mBAAmB,GAAoB;IAClD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,OAAO;CAC1B,CAAC"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;AA2Ea,QAAA,mBAAmB,GAAoB;IAClD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,OAAO;IACzB,MAAM,EAAE;QACN;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,eAAe,EAAE;QACf;YAEE,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,IAAI;SAEnB;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "1.0.27",
4
+ "version": "1.0.29-alpha.0",
5
5
  "description": "Spotto's API Contract type definitions",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -14,5 +14,5 @@
14
14
  "devDependencies": {
15
15
  "@types/geojson": "^7946.0.11"
16
16
  },
17
- "gitHead": "856747814158eb64db8ae7959749b4cfb4b362c8"
17
+ "gitHead": "b76b7dfea452f9b56441e7a859e066a6c81cf150"
18
18
  }