scout-types 1.0.15 → 1.0.17

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.
@@ -8,7 +8,7 @@ export declare class Scout {
8
8
  readonly scout_id: string;
9
9
  readonly name: string;
10
10
  readonly active: boolean;
11
- readonly state_id: StateID;
11
+ readonly state_id?: StateID;
12
12
  readonly district?: number;
13
13
  readonly party_id: PartyID;
14
14
  readonly tone_description_refresh: boolean;
@@ -41,7 +41,7 @@ export class Scout {
41
41
  typeof scout.scout_id === "string" &&
42
42
  typeof scout.name === "string" &&
43
43
  typeof scout.active === "boolean" &&
44
- is_state_id(scout.state_id) &&
44
+ (scout.state_id === undefined || is_state_id(scout.state_id)) &&
45
45
  (scout.district === undefined || typeof scout.district === "number") &&
46
46
  is_party_id(scout.party_id) &&
47
47
  typeof scout.tone_description_refresh === "boolean" &&
@@ -5,6 +5,7 @@ export declare class ScoutDocument {
5
5
  readonly type: "URL" | "TWEET" | "TWITTER" | "PRESS" | "FILE";
6
6
  readonly s3_filename?: string;
7
7
  readonly s3_text_filename?: string;
8
+ readonly text?: string;
8
9
  readonly vector_keys?: string[];
9
10
  readonly [x: string]: any;
10
11
  constructor(scout_document: any);
@@ -5,6 +5,7 @@ export class ScoutDocument {
5
5
  type;
6
6
  s3_filename;
7
7
  s3_text_filename;
8
+ text;
8
9
  vector_keys;
9
10
  constructor(scout_document) {
10
11
  if (!ScoutDocument.is(scout_document)) {
@@ -15,6 +16,7 @@ export class ScoutDocument {
15
16
  this.type = scout_document.type;
16
17
  this.s3_filename = scout_document.s3_filename;
17
18
  this.s3_text_filename = scout_document.s3_text_filename;
19
+ this.text = scout_document.text;
18
20
  this.vector_keys = scout_document.vector_keys;
19
21
  }
20
22
  static is(scout_document) {
@@ -24,6 +26,7 @@ export class ScoutDocument {
24
26
  typeof scout_document.type === "string" &&
25
27
  (scout_document.s3_filename === undefined || typeof scout_document.s3_filename === "string") &&
26
28
  (scout_document.s3_text_filename === undefined || typeof scout_document.s3_text_filename === "string") &&
29
+ (scout_document.text === undefined || typeof scout_document.text === "string") &&
27
30
  (scout_document.vector_keys === undefined || Array.isArray(scout_document.vector_keys) && scout_document.vector_keys.every((vector_key) => typeof vector_key === "string")));
28
31
  }
29
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scout-types",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -9,7 +9,7 @@ export class Scout {
9
9
  readonly scout_id : string
10
10
  readonly name : string
11
11
  readonly active : boolean
12
- readonly state_id : StateID
12
+ readonly state_id? : StateID
13
13
  readonly district? : number
14
14
  readonly party_id : PartyID
15
15
  readonly tone_description_refresh : boolean
@@ -46,7 +46,7 @@ export class Scout {
46
46
  typeof scout.scout_id === "string" &&
47
47
  typeof scout.name === "string" &&
48
48
  typeof scout.active === "boolean" &&
49
- is_state_id(scout.state_id) &&
49
+ (scout.state_id === undefined || is_state_id(scout.state_id)) &&
50
50
  (scout.district === undefined || typeof scout.district === "number") &&
51
51
  is_party_id(scout.party_id) &&
52
52
  typeof scout.tone_description_refresh === "boolean" &&
@@ -6,6 +6,7 @@ export class ScoutDocument {
6
6
  readonly type : "URL" | "TWEET" | "TWITTER" | "PRESS" | "FILE"
7
7
  readonly s3_filename? : string
8
8
  readonly s3_text_filename? : string
9
+ readonly text? : string
9
10
  readonly vector_keys? : string[]
10
11
  readonly [x : string] : any
11
12
 
@@ -18,6 +19,7 @@ export class ScoutDocument {
18
19
  this.type = scout_document.type
19
20
  this.s3_filename = scout_document.s3_filename
20
21
  this.s3_text_filename = scout_document.s3_text_filename
22
+ this.text = scout_document.text
21
23
  this.vector_keys = scout_document.vector_keys
22
24
  }
23
25
 
@@ -29,6 +31,7 @@ export class ScoutDocument {
29
31
  typeof scout_document.type === "string" &&
30
32
  (scout_document.s3_filename === undefined || typeof scout_document.s3_filename === "string") &&
31
33
  (scout_document.s3_text_filename === undefined || typeof scout_document.s3_text_filename === "string") &&
34
+ (scout_document.text === undefined || typeof scout_document.text === "string") &&
32
35
  (scout_document.vector_keys === undefined || Array.isArray(scout_document.vector_keys) && scout_document.vector_keys.every((vector_key : any) => typeof vector_key === "string"))
33
36
  )
34
37
  }