triage-types 1.0.32 → 1.0.34

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.
@@ -4,3 +4,5 @@ export * from "./types/AR/ARStateFacility.js";
4
4
  export * from "./types/AR/ARStatePermit.js";
5
5
  export * from "./types/AR/ARStatePermitSource.js";
6
6
  export * from "./types/AR/ARStatePermitSourcePollutant.js";
7
+ export * from "./types/NC/NCStateFacility.js";
8
+ export * from "./types/NC/NCStatePermit.js";
package/dist/src/index.js CHANGED
@@ -4,3 +4,5 @@ export * from "./types/AR/ARStateFacility.js";
4
4
  export * from "./types/AR/ARStatePermit.js";
5
5
  export * from "./types/AR/ARStatePermitSource.js";
6
6
  export * from "./types/AR/ARStatePermitSourcePollutant.js";
7
+ export * from "./types/NC/NCStateFacility.js";
8
+ export * from "./types/NC/NCStatePermit.js";
@@ -22,7 +22,7 @@ export class ARStateFacility {
22
22
  }
23
23
  static is(state_facility) {
24
24
  return (state_facility !== undefined &&
25
- is_state_id(state_facility.state_id) &&
25
+ is_state_id(state_facility.state_id) && state_facility.state_id === "AR" &&
26
26
  typeof state_facility.state_facility_id === "string" &&
27
27
  typeof state_facility.facility_id === "string" &&
28
28
  typeof state_facility.name === "string" &&
@@ -35,7 +35,7 @@ export class ARStatePermit {
35
35
  static is(state_permit) {
36
36
  return (state_permit !== undefined &&
37
37
  typeof state_permit.state_permit_id === "string" &&
38
- is_state_id(state_permit.state_id) &&
38
+ is_state_id(state_permit.state_id) && state_permit.state_id === "AR" &&
39
39
  typeof state_permit.permit_id === "string" &&
40
40
  typeof state_permit.state_facility_id === "string" &&
41
41
  (state_permit.issue_date === undefined || typeof state_permit.issue_date === "string") &&
@@ -22,7 +22,7 @@ export class ARStatePermitSource {
22
22
  static is(state_permit_source) {
23
23
  return (state_permit_source !== undefined &&
24
24
  typeof state_permit_source.state_permit_source_id === "string" &&
25
- is_state_id(state_permit_source.state_id) &&
25
+ is_state_id(state_permit_source.state_id) && state_permit_source.state_id === "AR" &&
26
26
  typeof state_permit_source.state_permit_id === "string" &&
27
27
  typeof state_permit_source.source_id === "string" &&
28
28
  typeof state_permit_source.type_id === "string" &&
@@ -18,7 +18,7 @@ export class ARStatePermitSourcePollutant {
18
18
  static is(state_permit_source_pollutant) {
19
19
  return (state_permit_source_pollutant !== undefined &&
20
20
  typeof state_permit_source_pollutant.state_permit_source_pollutant_id === "string" &&
21
- is_state_id(state_permit_source_pollutant.state_id) &&
21
+ is_state_id(state_permit_source_pollutant.state_id) && state_permit_source_pollutant.state_id === "AR" &&
22
22
  typeof state_permit_source_pollutant.state_permit_id === "string" &&
23
23
  typeof state_permit_source_pollutant.state_permit_source_id === "string" &&
24
24
  typeof state_permit_source_pollutant.pollutant_id === "string");
@@ -0,0 +1,13 @@
1
+ import { StateID } from "../State.js";
2
+ export declare class NCStateFacility {
3
+ readonly state_facility_id: string;
4
+ readonly state_id: StateID;
5
+ readonly facility_id: string;
6
+ readonly name: string;
7
+ readonly active: boolean;
8
+ readonly type_id: string;
9
+ readonly site_address_county?: string;
10
+ readonly [x: string]: any;
11
+ constructor(state_facility: NCStateFacility);
12
+ static is(state_facility: any): state_facility is NCStateFacility;
13
+ }
@@ -0,0 +1,32 @@
1
+ import { is_state_id } from "../State.js";
2
+ export class NCStateFacility {
3
+ state_facility_id;
4
+ state_id;
5
+ facility_id;
6
+ name;
7
+ active;
8
+ type_id;
9
+ site_address_county;
10
+ constructor(state_facility) {
11
+ if (!NCStateFacility.is(state_facility)) {
12
+ throw Error("Invalid input.");
13
+ }
14
+ this.state_facility_id = state_facility.state_facility_id;
15
+ this.state_id = state_facility.state_id;
16
+ this.facility_id = state_facility.facility_id;
17
+ this.name = state_facility.name;
18
+ this.active = state_facility.active;
19
+ this.type_id = state_facility.type_id;
20
+ this.site_address_county = state_facility.site_address_county;
21
+ }
22
+ static is(state_facility) {
23
+ return (state_facility !== undefined &&
24
+ is_state_id(state_facility.state_id) && state_facility.state_id === "NC" &&
25
+ typeof state_facility.state_facility_id === "string" &&
26
+ typeof state_facility.facility_id === "string" &&
27
+ typeof state_facility.name === "string" &&
28
+ typeof state_facility.active === "boolean" &&
29
+ typeof state_facility.type_id === "string" &&
30
+ (state_facility.site_address_county === undefined || typeof state_facility.site_address_county === "string"));
31
+ }
32
+ }
@@ -0,0 +1,18 @@
1
+ import { StateID } from "../State.js";
2
+ export declare class NCStatePermit {
3
+ readonly state_permit_id: string;
4
+ readonly state_id: StateID;
5
+ readonly permit_id: string;
6
+ readonly state_facility_id: string;
7
+ readonly issue_date?: string;
8
+ readonly expiration_date?: string;
9
+ readonly url?: string;
10
+ readonly status?: string;
11
+ readonly type_id?: string;
12
+ readonly s3_filename?: string;
13
+ readonly s3_text_filename?: string;
14
+ readonly source_ids?: string[];
15
+ readonly [x: string]: any;
16
+ constructor(state_permit: NCStatePermit);
17
+ static is(state_permit: any): state_permit is NCStatePermit;
18
+ }
@@ -0,0 +1,47 @@
1
+ import { is_state_id } from "../State.js";
2
+ export class NCStatePermit {
3
+ state_permit_id;
4
+ state_id;
5
+ permit_id;
6
+ state_facility_id;
7
+ issue_date;
8
+ expiration_date;
9
+ url;
10
+ status;
11
+ type_id;
12
+ s3_filename;
13
+ s3_text_filename;
14
+ source_ids;
15
+ constructor(state_permit) {
16
+ if (!NCStatePermit.is(state_permit)) {
17
+ throw Error("Invalid input.");
18
+ }
19
+ this.state_permit_id = state_permit.state_permit_id;
20
+ this.state_id = state_permit.state_id;
21
+ this.permit_id = state_permit.permit_id;
22
+ this.state_facility_id = state_permit.state_facility_id;
23
+ this.issue_date = state_permit.issue_date;
24
+ this.expiration_date = state_permit.expiration_date;
25
+ this.url = state_permit.url;
26
+ this.status = state_permit.status;
27
+ this.type_id = state_permit.type_id;
28
+ this.s3_filename = state_permit.s3_filename;
29
+ this.s3_text_filename = state_permit.s3_text_filename;
30
+ this.source_ids = state_permit.source_ids;
31
+ }
32
+ static is(state_permit) {
33
+ return (state_permit !== undefined &&
34
+ typeof state_permit.state_permit_id === "string" &&
35
+ is_state_id(state_permit.state_id) && state_permit.state_id === "NC" &&
36
+ typeof state_permit.permit_id === "string" &&
37
+ typeof state_permit.state_facility_id === "string" &&
38
+ (state_permit.issue_date === undefined || typeof state_permit.issue_date === "string") &&
39
+ (state_permit.expiration_date === undefined || typeof state_permit.expiration_date === "string") &&
40
+ state_permit.url === "string" &&
41
+ (state_permit.status === undefined || typeof state_permit.status === "string") &&
42
+ (state_permit.type_id === undefined || typeof state_permit.type_id === "string") &&
43
+ (state_permit.s3_filename === undefined || typeof state_permit.s3_filename === "string") &&
44
+ (state_permit.s3_text_filename === undefined || typeof state_permit.s3_text_filename === "string") &&
45
+ (state_permit.source_ids === undefined || Array.isArray(state_permit.source_ids) && state_permit.source_ids.map((source_id) => typeof source_id === "string")));
46
+ }
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triage-types",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
package/src/index.ts CHANGED
@@ -3,4 +3,6 @@ export * from "./types/State"
3
3
  export * from "./types/AR/ARStateFacility"
4
4
  export * from "./types/AR/ARStatePermit"
5
5
  export * from "./types/AR/ARStatePermitSource"
6
- export * from "./types/AR/ARStatePermitSourcePollutant"
6
+ export * from "./types/AR/ARStatePermitSourcePollutant"
7
+ export * from "./types/NC/NCStateFacility"
8
+ export * from "./types/NC/NCStatePermit"
@@ -27,7 +27,7 @@ export class ARStateFacility {
27
27
  static is(state_facility : any) : state_facility is ARStateFacility {
28
28
  return (
29
29
  state_facility !== undefined &&
30
- is_state_id(state_facility.state_id) &&
30
+ is_state_id(state_facility.state_id) && state_facility.state_id === "AR" &&
31
31
  typeof state_facility.state_facility_id === "string" &&
32
32
  typeof state_facility.facility_id === "string" &&
33
33
  typeof state_facility.name === "string" &&
@@ -41,7 +41,7 @@ export class ARStatePermit {
41
41
  return (
42
42
  state_permit !== undefined &&
43
43
  typeof state_permit.state_permit_id === "string" &&
44
- is_state_id(state_permit.state_id) &&
44
+ is_state_id(state_permit.state_id) && state_permit.state_id === "AR" &&
45
45
  typeof state_permit.permit_id === "string" &&
46
46
  typeof state_permit.state_facility_id === "string" &&
47
47
  (state_permit.issue_date === undefined || typeof state_permit.issue_date === "string") &&
@@ -27,7 +27,7 @@ export class ARStatePermitSource {
27
27
  return (
28
28
  state_permit_source !== undefined &&
29
29
  typeof state_permit_source.state_permit_source_id === "string" &&
30
- is_state_id(state_permit_source.state_id) &&
30
+ is_state_id(state_permit_source.state_id) && state_permit_source.state_id === "AR" &&
31
31
  typeof state_permit_source.state_permit_id === "string" &&
32
32
  typeof state_permit_source.source_id === "string" &&
33
33
  typeof state_permit_source.type_id === "string" &&
@@ -23,7 +23,7 @@ export class ARStatePermitSourcePollutant {
23
23
  return (
24
24
  state_permit_source_pollutant !== undefined &&
25
25
  typeof state_permit_source_pollutant.state_permit_source_pollutant_id === "string" &&
26
- is_state_id(state_permit_source_pollutant.state_id) &&
26
+ is_state_id(state_permit_source_pollutant.state_id) && state_permit_source_pollutant.state_id === "AR" &&
27
27
  typeof state_permit_source_pollutant.state_permit_id === "string" &&
28
28
  typeof state_permit_source_pollutant.state_permit_source_id === "string" &&
29
29
  typeof state_permit_source_pollutant.pollutant_id === "string"
@@ -0,0 +1,38 @@
1
+ import { is_state_id, StateID } from "../State"
2
+
3
+ export class NCStateFacility {
4
+ readonly state_facility_id : string
5
+ readonly state_id : StateID
6
+ readonly facility_id : string
7
+ readonly name : string
8
+ readonly active : boolean
9
+ readonly type_id : string
10
+ readonly site_address_county? : string
11
+ readonly [x : string] : any
12
+
13
+ constructor(state_facility : NCStateFacility) {
14
+ if (!NCStateFacility.is(state_facility)) {
15
+ throw Error("Invalid input.")
16
+ }
17
+ this.state_facility_id = state_facility.state_facility_id
18
+ this.state_id = state_facility.state_id
19
+ this.facility_id = state_facility.facility_id
20
+ this.name = state_facility.name
21
+ this.active = state_facility.active
22
+ this.type_id = state_facility.type_id
23
+ this.site_address_county = state_facility.site_address_county
24
+ }
25
+
26
+ static is(state_facility : any) : state_facility is NCStateFacility {
27
+ return (
28
+ state_facility !== undefined &&
29
+ is_state_id(state_facility.state_id) && state_facility.state_id === "NC" &&
30
+ typeof state_facility.state_facility_id === "string" &&
31
+ typeof state_facility.facility_id === "string" &&
32
+ typeof state_facility.name === "string" &&
33
+ typeof state_facility.active === "boolean" &&
34
+ typeof state_facility.type_id === "string" &&
35
+ (state_facility.site_address_county === undefined || typeof state_facility.site_address_county === "string")
36
+ )
37
+ }
38
+ }
@@ -0,0 +1,54 @@
1
+ import { is_state_id, StateID } from "../State"
2
+
3
+
4
+ export class NCStatePermit {
5
+ readonly state_permit_id : string
6
+ readonly state_id : StateID
7
+ readonly permit_id : string
8
+ readonly state_facility_id : string
9
+ readonly issue_date? : string
10
+ readonly expiration_date? : string
11
+ readonly url? : string
12
+ readonly status? : string
13
+ readonly type_id? : string
14
+ readonly s3_filename? : string
15
+ readonly s3_text_filename? : string
16
+ readonly source_ids? : string[]
17
+ readonly [x : string] : any
18
+
19
+ constructor(state_permit : NCStatePermit) {
20
+ if (!NCStatePermit.is(state_permit)) {
21
+ throw Error("Invalid input.")
22
+ }
23
+ this.state_permit_id = state_permit.state_permit_id
24
+ this.state_id = state_permit.state_id
25
+ this.permit_id = state_permit.permit_id
26
+ this.state_facility_id = state_permit.state_facility_id
27
+ this.issue_date = state_permit.issue_date
28
+ this.expiration_date = state_permit.expiration_date
29
+ this.url = state_permit.url
30
+ this.status = state_permit.status
31
+ this.type_id = state_permit.type_id
32
+ this.s3_filename = state_permit.s3_filename
33
+ this.s3_text_filename = state_permit.s3_text_filename
34
+ this.source_ids = state_permit.source_ids
35
+ }
36
+
37
+ static is(state_permit : any) : state_permit is NCStatePermit {
38
+ return (
39
+ state_permit !== undefined &&
40
+ typeof state_permit.state_permit_id === "string" &&
41
+ is_state_id(state_permit.state_id) && state_permit.state_id === "NC" &&
42
+ typeof state_permit.permit_id === "string" &&
43
+ typeof state_permit.state_facility_id === "string" &&
44
+ (state_permit.issue_date === undefined || typeof state_permit.issue_date === "string") &&
45
+ (state_permit.expiration_date === undefined || typeof state_permit.expiration_date === "string") &&
46
+ state_permit.url === "string" &&
47
+ (state_permit.status === undefined || typeof state_permit.status === "string") &&
48
+ (state_permit.type_id === undefined || typeof state_permit.type_id === "string") &&
49
+ (state_permit.s3_filename === undefined || typeof state_permit.s3_filename === "string") &&
50
+ (state_permit.s3_text_filename === undefined || typeof state_permit.s3_text_filename === "string") &&
51
+ (state_permit.source_ids === undefined || Array.isArray(state_permit.source_ids) && state_permit.source_ids.map((source_id : any) => typeof source_id === "string"))
52
+ )
53
+ }
54
+ }