triage-types 1.0.56 → 1.0.57

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,11 @@
1
1
  import { StateID } from "../State.js";
2
2
  import { StateFacility } from "./StateFacility.js";
3
+ export declare class StatePermitComment {
4
+ readonly comment_text: string;
5
+ readonly response_text: string;
6
+ constructor(state_permit_comment: StatePermitComment);
7
+ static is(state_permit_comment: any): state_permit_comment is StatePermitComment;
8
+ }
3
9
  export declare class StatePermit {
4
10
  readonly state_permit_id: string;
5
11
  readonly state_id: StateID;
@@ -13,6 +19,7 @@ export declare class StatePermit {
13
19
  readonly s3_filename?: string;
14
20
  readonly s3_text_filename?: string;
15
21
  readonly source_ids?: string[];
22
+ readonly comments?: StatePermitComment[];
16
23
  readonly [x: string]: any;
17
24
  constructor(state_permit: StatePermit);
18
25
  static is(state_permit: any): state_permit is StatePermit;
@@ -1,5 +1,21 @@
1
1
  import { is_state_id } from "../State.js";
2
2
  import { StateFacility } from "./StateFacility.js";
3
+ export class StatePermitComment {
4
+ comment_text;
5
+ response_text;
6
+ constructor(state_permit_comment) {
7
+ if (!StatePermitComment.is(state_permit_comment)) {
8
+ throw Error("Invalid input.");
9
+ }
10
+ this.comment_text = state_permit_comment.comment_text;
11
+ this.response_text = state_permit_comment.response_text;
12
+ }
13
+ static is(state_permit_comment) {
14
+ return (state_permit_comment !== undefined &&
15
+ typeof state_permit_comment.comment_text === "string" &&
16
+ typeof state_permit_comment.response_text === "string");
17
+ }
18
+ }
3
19
  export class StatePermit {
4
20
  state_permit_id;
5
21
  state_id;
@@ -13,6 +29,7 @@ export class StatePermit {
13
29
  s3_filename;
14
30
  s3_text_filename;
15
31
  source_ids;
32
+ comments;
16
33
  constructor(state_permit) {
17
34
  if (!StatePermit.is(state_permit)) {
18
35
  throw Error("Invalid input.");
@@ -29,6 +46,7 @@ export class StatePermit {
29
46
  this.s3_filename = state_permit.s3_filename;
30
47
  this.s3_text_filename = state_permit.s3_text_filename;
31
48
  this.source_ids = state_permit.source_ids;
49
+ this.comments = state_permit.comments;
32
50
  }
33
51
  static is(state_permit) {
34
52
  return (state_permit !== undefined &&
@@ -43,7 +61,8 @@ export class StatePermit {
43
61
  (state_permit.subtype_id === undefined || typeof state_permit.subtype_id === "string") &&
44
62
  (state_permit.s3_filename === undefined || typeof state_permit.s3_filename === "string") &&
45
63
  (state_permit.s3_text_filename === undefined || typeof state_permit.s3_text_filename === "string") &&
46
- (state_permit.source_ids === undefined || Array.isArray(state_permit.source_ids) && state_permit.source_ids.every((source_id) => typeof source_id === "string")));
64
+ (state_permit.source_ids === undefined || Array.isArray(state_permit.source_ids) && state_permit.source_ids.every((source_id) => typeof source_id === "string")) &&
65
+ (state_permit.comments === undefined || Array.isArray(state_permit.comments) && state_permit.comments.every(StatePermitComment.is)));
47
66
  }
48
67
  }
49
68
  export class StatePermitAux extends StatePermit {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triage-types",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,6 +1,28 @@
1
1
  import { is_state_id, StateID } from "../State"
2
2
  import { StateFacility, StateFacilityAux } from "./StateFacility"
3
3
 
4
+ export class StatePermitComment {
5
+ readonly comment_text : string
6
+ readonly response_text : string
7
+
8
+
9
+ constructor(state_permit_comment : StatePermitComment) {
10
+ if (!StatePermitComment.is(state_permit_comment)) {
11
+ throw Error("Invalid input.")
12
+ }
13
+ this.comment_text = state_permit_comment.comment_text
14
+ this.response_text = state_permit_comment.response_text
15
+ }
16
+
17
+ static is(state_permit_comment : any) : state_permit_comment is StatePermitComment {
18
+ return (
19
+ state_permit_comment !== undefined &&
20
+ typeof state_permit_comment.comment_text === "string" &&
21
+ typeof state_permit_comment.response_text === "string"
22
+ )
23
+ }
24
+ }
25
+
4
26
  export class StatePermit {
5
27
  readonly state_permit_id : string
6
28
  readonly state_id : StateID
@@ -14,6 +36,7 @@ export class StatePermit {
14
36
  readonly s3_filename? : string
15
37
  readonly s3_text_filename? : string
16
38
  readonly source_ids? : string[]
39
+ readonly comments? : StatePermitComment[]
17
40
  readonly [x : string] : any
18
41
 
19
42
  constructor(state_permit : StatePermit) {
@@ -32,6 +55,7 @@ export class StatePermit {
32
55
  this.s3_filename = state_permit.s3_filename
33
56
  this.s3_text_filename = state_permit.s3_text_filename
34
57
  this.source_ids = state_permit.source_ids
58
+ this.comments = state_permit.comments
35
59
  }
36
60
 
37
61
  static is(state_permit : any) : state_permit is StatePermit {
@@ -48,7 +72,8 @@ export class StatePermit {
48
72
  (state_permit.subtype_id === undefined || typeof state_permit.subtype_id === "string") &&
49
73
  (state_permit.s3_filename === undefined || typeof state_permit.s3_filename === "string") &&
50
74
  (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.every((source_id : any) => typeof source_id === "string"))
75
+ (state_permit.source_ids === undefined || Array.isArray(state_permit.source_ids) && state_permit.source_ids.every((source_id : any) => typeof source_id === "string")) &&
76
+ (state_permit.comments === undefined || Array.isArray(state_permit.comments) && state_permit.comments.every(StatePermitComment.is))
52
77
  )
53
78
  }
54
79
  }