scout-types 1.0.8 → 1.0.10

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,5 @@
1
1
  import { JurisdictionLevel } from "./Jurisdiction.js";
2
- declare const office_class_ids: readonly ["ORG", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
2
+ declare const office_class_ids: readonly ["NOR", "LOR", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
3
3
  export type OfficeClassID = typeof office_class_ids[number];
4
4
  export declare function is_office_class_id(office_class_id: any): office_class_id is OfficeClassID;
5
5
  export interface OfficeClass {
@@ -1,12 +1,22 @@
1
1
  import { JurisdictionLevel } from "./Jurisdiction.js";
2
- const office_class_ids = ["ORG", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
2
+ const office_class_ids = ["NOR", "LOR", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
3
3
  export function is_office_class_id(office_class_id) {
4
4
  return office_class_ids.includes(office_class_id);
5
5
  }
6
6
  export const office_classes_by_office_class_id = {
7
- "ORG": {
8
- office_class_id: "ORG",
9
- name: "Organization",
7
+ "NOR": {
8
+ office_class_id: "NOR",
9
+ name: "National Organization",
10
+ type: "organization",
11
+ office_id_template: "O-US",
12
+ jurisdiction_level: JurisdictionLevel.NATION,
13
+ jurisdictions_mutable: true,
14
+ require_district: false,
15
+ require_initial_jurisdiction: false
16
+ },
17
+ "LOR": {
18
+ office_class_id: "LOR",
19
+ name: "Local Organization",
10
20
  type: "organization",
11
21
  office_id_template: "O-[state_id]",
12
22
  jurisdictions_mutable: true,
@@ -13,6 +13,7 @@ export declare class Scout {
13
13
  readonly party_id: PartyID;
14
14
  readonly tone_description_refresh: boolean;
15
15
  readonly jurisdiction_ids: number[];
16
+ readonly sub_scout_ids: string[];
16
17
  readonly office_class_id: OfficeClassID;
17
18
  readonly office_name?: string;
18
19
  readonly [x: string]: any;
@@ -21,6 +22,7 @@ export declare class Scout {
21
22
  }
22
23
  export declare class ScoutAux extends Scout {
23
24
  readonly jurisdictions: Jurisdiction[];
25
+ readonly sub_scouts: Jurisdiction[];
24
26
  readonly photo_download_url?: string;
25
27
  readonly tone_description?: string;
26
28
  constructor(scout: any);
@@ -13,6 +13,7 @@ export class Scout {
13
13
  party_id;
14
14
  tone_description_refresh;
15
15
  jurisdiction_ids;
16
+ sub_scout_ids;
16
17
  office_class_id;
17
18
  office_name;
18
19
  constructor(scout) {
@@ -29,6 +30,7 @@ export class Scout {
29
30
  this.party_id = scout.party_id;
30
31
  this.tone_description_refresh = scout.tone_description_refresh;
31
32
  this.jurisdiction_ids = scout.jurisdiction_ids;
33
+ this.sub_scout_ids = scout.sub_scout_ids;
32
34
  this.office_class_id = scout.office_class_id;
33
35
  this.office_name = scout.office_name;
34
36
  }
@@ -45,12 +47,15 @@ export class Scout {
45
47
  typeof scout.tone_description_refresh === "boolean" &&
46
48
  Array.isArray(scout.jurisdiction_ids) &&
47
49
  scout.jurisdiction_ids.every((jurisdiction_id) => typeof jurisdiction_id === "number") &&
50
+ Array.isArray(scout.sub_scout_ids) &&
51
+ scout.sub_scout_ids.every((sub_scout_id) => typeof sub_scout_id === "string") &&
48
52
  is_office_class_id(scout.office_class_id) &&
49
53
  (scout.office_name === undefined || typeof scout.office_name === "string"));
50
54
  }
51
55
  }
52
56
  export class ScoutAux extends Scout {
53
57
  jurisdictions;
58
+ sub_scouts;
54
59
  photo_download_url;
55
60
  tone_description;
56
61
  constructor(scout) {
@@ -59,6 +64,7 @@ export class ScoutAux extends Scout {
59
64
  }
60
65
  super(scout);
61
66
  this.jurisdictions = scout.jurisdictions;
67
+ this.sub_scouts = scout.sub_scouts;
62
68
  this.photo_download_url = scout.photo_download_url;
63
69
  this.tone_description = scout.tone_description;
64
70
  }
@@ -66,6 +72,8 @@ export class ScoutAux extends Scout {
66
72
  return (Scout.is(scout) &&
67
73
  Array.isArray(scout.jurisdictions) &&
68
74
  scout.jurisdictions.every(Jurisdiction.is) &&
75
+ Array.isArray(scout.sub_scouts) &&
76
+ scout.sub_scouts.every(Scout.is) &&
69
77
  (scout.photo_download_url === undefined || typeof scout.photo_download_url === "string") &&
70
78
  (scout.tone_description === undefined || typeof scout.tone_description === "string"));
71
79
  }
@@ -21,7 +21,7 @@ export declare class JurisdictionDocumentSource {
21
21
  constructor(jurisdiction_document_source: any);
22
22
  static is(jurisdiction_document_source: any): jurisdiction_document_source is JurisdictionDocumentSource;
23
23
  }
24
- export declare class BillSource {
24
+ export declare class BillDocumentSource {
25
25
  readonly chunk_text: string;
26
26
  readonly description: string;
27
27
  readonly label: string;
@@ -29,7 +29,7 @@ export declare class BillSource {
29
29
  readonly vector_key: string;
30
30
  readonly bill: Bill;
31
31
  constructor(bill_document_source: any);
32
- static is(bill_document_source: any): bill_document_source is BillSource;
32
+ static is(bill_document_source: any): bill_document_source is BillDocumentSource;
33
33
  }
34
34
  export declare class GrokSource {
35
35
  readonly title: string;
@@ -41,7 +41,7 @@ export declare class GrokSource {
41
41
  static is(grok_source: any): grok_source is GrokSource;
42
42
  }
43
43
  export declare class Sources {
44
- readonly B: BillSource[];
44
+ readonly B: BillDocumentSource[];
45
45
  readonly S: ScoutDocumentSource[];
46
46
  readonly J: JurisdictionDocumentSource[];
47
47
  readonly G: GrokSource[];
@@ -57,7 +57,7 @@ export class JurisdictionDocumentSource {
57
57
  JurisdictionDocument.is(jurisdiction_document_source.document));
58
58
  }
59
59
  }
60
- export class BillSource {
60
+ export class BillDocumentSource {
61
61
  chunk_text;
62
62
  description;
63
63
  label;
@@ -65,7 +65,7 @@ export class BillSource {
65
65
  vector_key;
66
66
  bill;
67
67
  constructor(bill_document_source) {
68
- if (!BillSource.is(bill_document_source)) {
68
+ if (!BillDocumentSource.is(bill_document_source)) {
69
69
  throw Error("Invalid input.");
70
70
  }
71
71
  this.chunk_text = bill_document_source.chunk_text;
@@ -127,7 +127,7 @@ export class Sources {
127
127
  static is(sources) {
128
128
  return (sources !== undefined &&
129
129
  Array.isArray(sources.B) &&
130
- sources.B.every(BillSource.is) &&
130
+ sources.B.every(BillDocumentSource.is) &&
131
131
  Array.isArray(sources.S) &&
132
132
  sources.S.every(ScoutDocumentSource.is) &&
133
133
  Array.isArray(sources.J) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scout-types",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,6 +1,6 @@
1
1
  import { JurisdictionLevel } from "./Jurisdiction"
2
2
 
3
- const office_class_ids = ["ORG", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"] as const
3
+ const office_class_ids = ["NOR", "LOR", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"] as const
4
4
 
5
5
  export type OfficeClassID = typeof office_class_ids[number]
6
6
 
@@ -22,9 +22,19 @@ export interface OfficeClass {
22
22
  }
23
23
 
24
24
  export const office_classes_by_office_class_id : Record<OfficeClassID, OfficeClass> = {
25
- "ORG" : {
26
- office_class_id : "ORG",
27
- name : "Organization",
25
+ "NOR" : {
26
+ office_class_id : "NOR",
27
+ name : "National Organization",
28
+ type : "organization",
29
+ office_id_template : "O-US",
30
+ jurisdiction_level : JurisdictionLevel.NATION,
31
+ jurisdictions_mutable : true,
32
+ require_district : false,
33
+ require_initial_jurisdiction : false
34
+ },
35
+ "LOR" : {
36
+ office_class_id : "LOR",
37
+ name : "Local Organization",
28
38
  type : "organization",
29
39
  office_id_template : "O-[state_id]",
30
40
  jurisdictions_mutable : true,
@@ -14,6 +14,7 @@ export class Scout {
14
14
  readonly party_id : PartyID
15
15
  readonly tone_description_refresh : boolean
16
16
  readonly jurisdiction_ids : number[]
17
+ readonly sub_scout_ids : string[]
17
18
  readonly office_class_id : OfficeClassID
18
19
  readonly office_name? : string
19
20
  readonly [x : string] : any
@@ -32,6 +33,7 @@ export class Scout {
32
33
  this.party_id = scout.party_id
33
34
  this.tone_description_refresh = scout.tone_description_refresh
34
35
  this.jurisdiction_ids = scout.jurisdiction_ids
36
+ this.sub_scout_ids = scout.sub_scout_ids
35
37
  this.office_class_id = scout.office_class_id
36
38
  this.office_name = scout.office_name
37
39
  }
@@ -50,6 +52,8 @@ export class Scout {
50
52
  typeof scout.tone_description_refresh === "boolean" &&
51
53
  Array.isArray(scout.jurisdiction_ids) &&
52
54
  scout.jurisdiction_ids.every((jurisdiction_id : any) => typeof jurisdiction_id === "number") &&
55
+ Array.isArray(scout.sub_scout_ids) &&
56
+ scout.sub_scout_ids.every((sub_scout_id : any) => typeof sub_scout_id === "string") &&
53
57
  is_office_class_id(scout.office_class_id) &&
54
58
  (scout.office_name === undefined || typeof scout.office_name === "string")
55
59
  )
@@ -58,6 +62,7 @@ export class Scout {
58
62
 
59
63
  export class ScoutAux extends Scout {
60
64
  readonly jurisdictions : Jurisdiction[]
65
+ readonly sub_scouts : Jurisdiction[]
61
66
  readonly photo_download_url? : string
62
67
  readonly tone_description? : string
63
68
 
@@ -67,6 +72,7 @@ export class ScoutAux extends Scout {
67
72
  }
68
73
  super(scout)
69
74
  this.jurisdictions = scout.jurisdictions
75
+ this.sub_scouts = scout.sub_scouts
70
76
  this.photo_download_url = scout.photo_download_url
71
77
  this.tone_description = scout.tone_description
72
78
  }
@@ -76,6 +82,8 @@ export class ScoutAux extends Scout {
76
82
  Scout.is(scout) &&
77
83
  Array.isArray(scout.jurisdictions) &&
78
84
  scout.jurisdictions.every(Jurisdiction.is) &&
85
+ Array.isArray(scout.sub_scouts) &&
86
+ scout.sub_scouts.every(Scout.is) &&
79
87
  (scout.photo_download_url === undefined || typeof scout.photo_download_url === "string") &&
80
88
  (scout.tone_description === undefined || typeof scout.tone_description === "string")
81
89
  )
@@ -68,7 +68,7 @@ export class JurisdictionDocumentSource {
68
68
  }
69
69
  }
70
70
 
71
- export class BillSource {
71
+ export class BillDocumentSource {
72
72
  readonly chunk_text : string
73
73
  readonly description : string
74
74
  readonly label : string
@@ -77,7 +77,7 @@ export class BillSource {
77
77
  readonly bill : Bill
78
78
 
79
79
  constructor(bill_document_source : any) {
80
- if (!BillSource.is(bill_document_source)) {
80
+ if (!BillDocumentSource.is(bill_document_source)) {
81
81
  throw Error("Invalid input.")
82
82
  }
83
83
  this.chunk_text = bill_document_source.chunk_text
@@ -88,7 +88,7 @@ export class BillSource {
88
88
  this.bill = bill_document_source.bill
89
89
  }
90
90
 
91
- static is(bill_document_source : any) : bill_document_source is BillSource {
91
+ static is(bill_document_source : any) : bill_document_source is BillDocumentSource {
92
92
  return (
93
93
  bill_document_source !== undefined &&
94
94
  typeof bill_document_source.chunk_text === "string" &&
@@ -132,7 +132,7 @@ export class GrokSource {
132
132
  }
133
133
 
134
134
  export class Sources {
135
- readonly B : BillSource[]
135
+ readonly B : BillDocumentSource[]
136
136
  readonly S : ScoutDocumentSource[]
137
137
  readonly J : JurisdictionDocumentSource[]
138
138
  readonly G : GrokSource[]
@@ -151,7 +151,7 @@ export class Sources {
151
151
  return (
152
152
  sources !== undefined &&
153
153
  Array.isArray(sources.B) &&
154
- sources.B.every(BillSource.is) &&
154
+ sources.B.every(BillDocumentSource.is) &&
155
155
  Array.isArray(sources.S) &&
156
156
  sources.S.every(ScoutDocumentSource.is) &&
157
157
  Array.isArray(sources.J) &&