clarion-shared-types 1.0.131 → 1.0.132

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
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZoneStatus = exports.ZoneType = void 0;
3
+ exports.ZoneBoundaryLevel = exports.ZoneStatus = exports.ZoneType = void 0;
4
4
  var ZoneType;
5
5
  (function (ZoneType) {
6
6
  ZoneType["PRIMARY"] = "PRIMARY";
@@ -17,4 +17,14 @@ var ZoneStatus;
17
17
  ZoneStatus["ARCHIVED"] = "ARCHIVED";
18
18
  ZoneStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL"; // Zone is pending approval
19
19
  })(ZoneStatus || (exports.ZoneStatus = ZoneStatus = {}));
20
+ /**
21
+ * What a zone built from administrative boundaries is made of: whole countries, or units of
22
+ * local government (Kenya's counties, Tanzania's regions, Uganda's districts, Zambia's
23
+ * provinces - clarion-gis keeps them all in county_boundaries).
24
+ */
25
+ var ZoneBoundaryLevel;
26
+ (function (ZoneBoundaryLevel) {
27
+ ZoneBoundaryLevel["COUNTRY"] = "COUNTRY";
28
+ ZoneBoundaryLevel["ADMIN_UNIT"] = "ADMIN_UNIT";
29
+ })(ZoneBoundaryLevel || (exports.ZoneBoundaryLevel = ZoneBoundaryLevel = {}));
20
30
  //# sourceMappingURL=zone.enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zone.enums.js","sourceRoot":"","sources":["../../../../../src/modules/gis/enums/zone.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA,CAAC,sDAAsD;AAClF,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,mCAAqB,CAAA;IACrB,mDAAqC,CAAA,CAAC,2BAA2B;AACrE,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB"}
1
+ {"version":3,"file":"zone.enums.js","sourceRoot":"","sources":["../../../../../src/modules/gis/enums/zone.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA,CAAC,sDAAsD;AAClF,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,mCAAqB,CAAA;IACrB,mDAAqC,CAAA,CAAC,2BAA2B;AACrE,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED;;;;GAIG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IACzB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;AAC7B,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../../../src/modules/gis/interfaces/zone.ts"],"names":[],"mappings":";;;AAEA,MAAa,IAAI;CAsBhB;AAtBD,oBAsBC"}
1
+ {"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../../../src/modules/gis/interfaces/zone.ts"],"names":[],"mappings":";;;AAsBA,MAAa,IAAI;CAwBhB;AAxBD,oBAwBC"}
@@ -14,4 +14,14 @@ export var ZoneStatus;
14
14
  ZoneStatus["ARCHIVED"] = "ARCHIVED";
15
15
  ZoneStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL"; // Zone is pending approval
16
16
  })(ZoneStatus || (ZoneStatus = {}));
17
+ /**
18
+ * What a zone built from administrative boundaries is made of: whole countries, or units of
19
+ * local government (Kenya's counties, Tanzania's regions, Uganda's districts, Zambia's
20
+ * provinces - clarion-gis keeps them all in county_boundaries).
21
+ */
22
+ export var ZoneBoundaryLevel;
23
+ (function (ZoneBoundaryLevel) {
24
+ ZoneBoundaryLevel["COUNTRY"] = "COUNTRY";
25
+ ZoneBoundaryLevel["ADMIN_UNIT"] = "ADMIN_UNIT";
26
+ })(ZoneBoundaryLevel || (ZoneBoundaryLevel = {}));
17
27
  //# sourceMappingURL=zone.enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zone.enums.js","sourceRoot":"","sources":["../../../../../src/modules/gis/enums/zone.enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA,CAAC,sDAAsD;AAClF,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,mCAAqB,CAAA;IACrB,mDAAqC,CAAA,CAAC,2BAA2B;AACrE,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB"}
1
+ {"version":3,"file":"zone.enums.js","sourceRoot":"","sources":["../../../../../src/modules/gis/enums/zone.enums.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA,CAAC,sDAAsD;AAClF,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;IACf,mCAAqB,CAAA;IACrB,mDAAqC,CAAA,CAAC,2BAA2B;AACrE,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IACzB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;AAC7B,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../../../src/modules/gis/interfaces/zone.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;CAsBhB"}
1
+ {"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../../../src/modules/gis/interfaces/zone.ts"],"names":[],"mappings":"AAsBA,MAAM,OAAO,IAAI;CAwBhB"}
@@ -12,3 +12,12 @@ export declare enum ZoneStatus {
12
12
  ARCHIVED = "ARCHIVED",// Zone has been archived and is no longer in use
13
13
  PENDING_APPROVAL = "PENDING_APPROVAL"
14
14
  }
15
+ /**
16
+ * What a zone built from administrative boundaries is made of: whole countries, or units of
17
+ * local government (Kenya's counties, Tanzania's regions, Uganda's districts, Zambia's
18
+ * provinces - clarion-gis keeps them all in county_boundaries).
19
+ */
20
+ export declare enum ZoneBoundaryLevel {
21
+ COUNTRY = "COUNTRY",
22
+ ADMIN_UNIT = "ADMIN_UNIT"
23
+ }
@@ -1,4 +1,22 @@
1
- import { ZoneStatus, ZoneType } from "../enums/zone.enums";
1
+ import { ZoneBoundaryLevel, ZoneStatus, ZoneType } from "../enums/zone.enums";
2
+ /** One boundary a zone was built from, as it was when the zone was built. */
3
+ export interface ZoneBoundaryRef {
4
+ /** The row in country_boundaries or county_boundaries. */
5
+ id: number;
6
+ name: string;
7
+ /** ISO 3166-1 alpha-3, `TZA`. */
8
+ countryIso: string;
9
+ /** The unit's code (unique across countries); null for a country. */
10
+ code: number | null;
11
+ }
12
+ /**
13
+ * Where a zone built from administrative boundaries came from. Null for a drawn zone. The
14
+ * geometry is the union of these boundaries, every part of it (islands included).
15
+ */
16
+ export interface ZoneBoundarySource {
17
+ level: ZoneBoundaryLevel;
18
+ boundaries: ZoneBoundaryRef[];
19
+ }
2
20
  export declare class Zone {
3
21
  id?: number;
4
22
  name: string;
@@ -8,7 +26,9 @@ export declare class Zone {
8
26
  priority: number;
9
27
  controlCentreId: number;
10
28
  organizationId: number;
11
- geoJson: GeoJSON.Polygon;
29
+ /** A Polygon when drawn; a MultiPolygon when built from boundaries (islands are parts). */
30
+ geoJson: GeoJSON.Polygon | GeoJSON.MultiPolygon;
31
+ boundarySource?: ZoneBoundarySource | null;
12
32
  areaSquareMeters?: number;
13
33
  centroid?: {
14
34
  lat: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarion-shared-types",
3
- "version": "1.0.131",
3
+ "version": "1.0.132",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",