triangle-types 1.0.295 → 1.0.297

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.
@@ -80,6 +80,7 @@ export * from "./types/prism/Voter.js";
80
80
  export * from "./types/prism/VoterFeature.js";
81
81
  export * from "./types/prism/VoterTarget.js";
82
82
  export * from "./types/scout/Scout.js";
83
+ export * from "./types/scout/ScoutTag.js";
83
84
  export * from "./types/scout/UserScout.js";
84
85
  export * from "./types/scout/UserScoutConversation.js";
85
86
  export * from "./types/scout/UserScoutConversationMessage.js";
package/dist/src/index.js CHANGED
@@ -80,6 +80,7 @@ export * from "./types/prism/Voter.js";
80
80
  export * from "./types/prism/VoterFeature.js";
81
81
  export * from "./types/prism/VoterTarget.js";
82
82
  export * from "./types/scout/Scout.js";
83
+ export * from "./types/scout/ScoutTag.js";
83
84
  export * from "./types/scout/UserScout.js";
84
85
  export * from "./types/scout/UserScoutConversation.js";
85
86
  export * from "./types/scout/UserScoutConversationMessage.js";
@@ -12,6 +12,8 @@ export declare class StateVoter {
12
12
  readonly name_middle?: string;
13
13
  readonly name_last: string;
14
14
  readonly name_suffix?: string;
15
+ readonly gender_id?: string;
16
+ readonly birth_date?: string;
15
17
  readonly address_residence_1: string;
16
18
  readonly address_residence_2?: string;
17
19
  readonly address_residence_city?: string;
@@ -12,6 +12,8 @@ export class StateVoter {
12
12
  name_middle;
13
13
  name_last;
14
14
  name_suffix;
15
+ gender_id;
16
+ birth_date;
15
17
  address_residence_1;
16
18
  address_residence_2;
17
19
  address_residence_city;
@@ -34,6 +36,8 @@ export class StateVoter {
34
36
  this.name_middle = state_voter.name_middle;
35
37
  this.name_last = state_voter.name_last;
36
38
  this.name_suffix = state_voter.name_suffix;
39
+ this.gender_id = state_voter.gender_id;
40
+ this.birth_date = state_voter.birth_date;
37
41
  this.address_residence_1 = state_voter.address_residence_1;
38
42
  this.address_residence_2 = state_voter.address_residence_2;
39
43
  this.address_residence_city = state_voter.address_residence_city;
@@ -55,6 +59,8 @@ export class StateVoter {
55
59
  (state_voter.name_middle === undefined || typeof state_voter.name_middle === "string") &&
56
60
  typeof state_voter.name_last === "string" &&
57
61
  (state_voter.name_suffix === undefined || typeof state_voter.name_suffix === "string") &&
62
+ (state_voter.gender_id === undefined || typeof state_voter.gender_id === "string") &&
63
+ (state_voter.birth_date === undefined || typeof state_voter.birth_date === "string") &&
58
64
  typeof state_voter.address_residence_1 === "string" &&
59
65
  (state_voter.address_residence_2 === undefined || typeof state_voter.address_residence_2 === "string") &&
60
66
  (state_voter.address_residence_city === undefined || typeof state_voter.address_residence_city === "string") &&
@@ -1,6 +1,10 @@
1
1
  export declare class ScoutTag {
2
2
  readonly scout_id: string;
3
+ readonly tag_type_id: string;
3
4
  readonly tag_id: string;
5
+ readonly time?: string;
6
+ readonly is_relevant?: boolean;
7
+ readonly sentiment_id?: string;
4
8
  readonly [x: string]: any;
5
9
  constructor(scout_tag: ScoutTag);
6
10
  static is(scout_tag: any): scout_tag is ScoutTag;
@@ -1,16 +1,45 @@
1
+ // import { Scout } from "./Scout.js"
1
2
  export class ScoutTag {
2
3
  scout_id;
4
+ tag_type_id;
3
5
  tag_id;
6
+ time;
7
+ is_relevant;
8
+ sentiment_id;
4
9
  constructor(scout_tag) {
5
10
  if (!ScoutTag.is(scout_tag)) {
6
11
  throw Error("Invalid input.");
7
12
  }
8
13
  this.scout_id = scout_tag.scout_id;
14
+ this.tag_type_id = scout_tag.tag_type_id;
9
15
  this.tag_id = scout_tag.tag_id;
16
+ this.time = scout_tag.time;
17
+ this.is_relevant = scout_tag.is_relevant;
18
+ this.sentiment_id = scout_tag.sentiment_id;
10
19
  }
11
20
  static is(scout_tag) {
12
21
  return (scout_tag !== undefined &&
13
22
  typeof scout_tag.scout_id === "string" &&
14
- typeof scout_tag.tag_id === "string");
23
+ typeof scout_tag.tag_type_id === "string" &&
24
+ typeof scout_tag.tag_id === "string" &&
25
+ (scout_tag.time === undefined || typeof scout_tag.time === "string") &&
26
+ (scout_tag.is_relevant === undefined || typeof scout_tag.is_relevant === "boolean") &&
27
+ (scout_tag.sentiment_id === undefined || typeof scout_tag.sentiment_id === "string"));
15
28
  }
16
29
  }
30
+ // export class ScoutTagAux extends ScoutTag {
31
+ // readonly scout : Scout
32
+ // constructor(scout_tag : any) {
33
+ // if (!ScoutTagAux.is(scout_tag)) {
34
+ // throw Error("Invalid input.")
35
+ // }
36
+ // super(scout_tag)
37
+ // this.scout = scout_tag.scout
38
+ // }
39
+ // static is(scout_tag : any) : scout_tag is ScoutTagAux {
40
+ // return (
41
+ // ScoutTag.is(scout_tag) &&
42
+ // Scout.is(scout_tag.scout)
43
+ // )
44
+ // }
45
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.295",
3
+ "version": "1.0.297",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -96,6 +96,7 @@ export * from "./types/prism/VoterFeature"
96
96
  export * from "./types/prism/VoterTarget"
97
97
 
98
98
  export * from "./types/scout/Scout"
99
+ export * from "./types/scout/ScoutTag"
99
100
  export * from "./types/scout/UserScout"
100
101
  export * from "./types/scout/UserScoutConversation"
101
102
  export * from "./types/scout/UserScoutConversationMessage"
@@ -1,6 +1,5 @@
1
1
  import { LALFileVoter } from "../lal/LALFileVoter"
2
2
  import { is_state_id, StateID } from "../jurisdictions/State"
3
- import { StateVoterFeature } from "./StateVoterFeature"
4
3
  import { StateVoterTarget } from "./StateVoterTarget"
5
4
  import { is_voter_party_type_id, VoterPartyTypeID } from "./Voter"
6
5
  import { Geom } from "../jurisdictions/Geom"
@@ -14,6 +13,8 @@ export class StateVoter {
14
13
  readonly name_middle? : string
15
14
  readonly name_last : string
16
15
  readonly name_suffix? : string
16
+ readonly gender_id? : string
17
+ readonly birth_date? : string
17
18
  readonly address_residence_1 : string
18
19
  readonly address_residence_2? : string
19
20
  readonly address_residence_city? : string
@@ -38,6 +39,8 @@ export class StateVoter {
38
39
  this.name_middle = state_voter.name_middle
39
40
  this.name_last = state_voter.name_last
40
41
  this.name_suffix = state_voter.name_suffix
42
+ this.gender_id = state_voter.gender_id
43
+ this.birth_date = state_voter.birth_date
41
44
  this.address_residence_1 = state_voter.address_residence_1
42
45
  this.address_residence_2 = state_voter.address_residence_2
43
46
  this.address_residence_city = state_voter.address_residence_city
@@ -61,6 +64,8 @@ export class StateVoter {
61
64
  (state_voter.name_middle === undefined || typeof state_voter.name_middle === "string") &&
62
65
  typeof state_voter.name_last === "string" &&
63
66
  (state_voter.name_suffix === undefined || typeof state_voter.name_suffix === "string") &&
67
+ (state_voter.gender_id === undefined || typeof state_voter.gender_id === "string") &&
68
+ (state_voter.birth_date === undefined || typeof state_voter.birth_date === "string") &&
64
69
  typeof state_voter.address_residence_1 === "string" &&
65
70
  (state_voter.address_residence_2 === undefined || typeof state_voter.address_residence_2 === "string") &&
66
71
  (state_voter.address_residence_city === undefined || typeof state_voter.address_residence_city === "string") &&
@@ -0,0 +1,54 @@
1
+ // import { Scout } from "./Scout"
2
+
3
+ export class ScoutTag {
4
+ readonly scout_id : string
5
+ readonly tag_type_id : string
6
+ readonly tag_id : string
7
+ readonly time? : string
8
+ readonly is_relevant? : boolean
9
+ readonly sentiment_id? : string
10
+ readonly [x : string] : any
11
+
12
+ constructor(scout_tag : ScoutTag) {
13
+ if (!ScoutTag.is(scout_tag)) {
14
+ throw Error("Invalid input.")
15
+ }
16
+ this.scout_id = scout_tag.scout_id
17
+ this.tag_type_id = scout_tag.tag_type_id
18
+ this.tag_id = scout_tag.tag_id
19
+ this.time = scout_tag.time
20
+ this.is_relevant = scout_tag.is_relevant
21
+ this.sentiment_id = scout_tag.sentiment_id
22
+ }
23
+
24
+ static is(scout_tag : any) : scout_tag is ScoutTag {
25
+ return (
26
+ scout_tag !== undefined &&
27
+ typeof scout_tag.scout_id === "string" &&
28
+ typeof scout_tag.tag_type_id === "string" &&
29
+ typeof scout_tag.tag_id === "string" &&
30
+ (scout_tag.time === undefined || typeof scout_tag.time === "string") &&
31
+ (scout_tag.is_relevant === undefined || typeof scout_tag.is_relevant === "boolean") &&
32
+ (scout_tag.sentiment_id === undefined || typeof scout_tag.sentiment_id === "string")
33
+ )
34
+ }
35
+ }
36
+
37
+ // export class ScoutTagAux extends ScoutTag {
38
+ // readonly scout : Scout
39
+
40
+ // constructor(scout_tag : any) {
41
+ // if (!ScoutTagAux.is(scout_tag)) {
42
+ // throw Error("Invalid input.")
43
+ // }
44
+ // super(scout_tag)
45
+ // this.scout = scout_tag.scout
46
+ // }
47
+
48
+ // static is(scout_tag : any) : scout_tag is ScoutTagAux {
49
+ // return (
50
+ // ScoutTag.is(scout_tag) &&
51
+ // Scout.is(scout_tag.scout)
52
+ // )
53
+ // }
54
+ // }