scout-types 1.0.20 → 1.0.22

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.
@@ -12,25 +12,31 @@ export declare class ScoutDocument {
12
12
  static is(scout_document: any): scout_document is ScoutDocument;
13
13
  }
14
14
  export declare class ScoutURLDocument extends ScoutDocument {
15
+ readonly type: "URL";
15
16
  readonly url: string;
16
17
  constructor(scout_document: any);
17
18
  static is(scout_document: any): scout_document is ScoutURLDocument;
18
19
  }
19
20
  export declare class ScoutTwitterDocument extends ScoutDocument {
21
+ readonly type: "TWITTER";
20
22
  readonly username: string;
21
23
  constructor(scout_document: any);
22
24
  static is(scout_document: any): scout_document is ScoutTwitterDocument;
23
25
  }
24
26
  export declare class ScoutTweetDocument extends ScoutDocument {
27
+ readonly type: "TWEET";
25
28
  readonly tweet: Tweet;
26
29
  constructor(scout_document: any);
27
30
  static is(scout_document: any): scout_document is ScoutTweetDocument;
28
31
  }
29
32
  export declare class ScoutPressDocument extends ScoutDocument {
33
+ readonly type: "PRESS";
34
+ readonly url: string;
30
35
  constructor(scout_document: any);
31
36
  static is(scout_document: any): scout_document is ScoutPressDocument;
32
37
  }
33
38
  export declare class ScoutFileDocument extends ScoutDocument {
39
+ readonly type: "FILE";
34
40
  readonly file_type: string;
35
41
  readonly filename: string;
36
42
  constructor(scout_document: any);
@@ -31,12 +31,14 @@ export class ScoutDocument {
31
31
  }
32
32
  }
33
33
  export class ScoutURLDocument extends ScoutDocument {
34
+ type;
34
35
  url;
35
36
  constructor(scout_document) {
36
37
  if (!ScoutURLDocument.is(scout_document)) {
37
38
  throw Error("Invalid input.");
38
39
  }
39
40
  super(scout_document);
41
+ this.type = "URL";
40
42
  this.url = scout_document.url;
41
43
  }
42
44
  static is(scout_document) {
@@ -46,12 +48,14 @@ export class ScoutURLDocument extends ScoutDocument {
46
48
  }
47
49
  }
48
50
  export class ScoutTwitterDocument extends ScoutDocument {
51
+ type;
49
52
  username;
50
53
  constructor(scout_document) {
51
54
  if (!ScoutTwitterDocument.is(scout_document)) {
52
55
  throw Error("Invalid input.");
53
56
  }
54
57
  super(scout_document);
58
+ this.type = "TWITTER";
55
59
  this.username = scout_document.username;
56
60
  }
57
61
  static is(scout_document) {
@@ -61,12 +65,14 @@ export class ScoutTwitterDocument extends ScoutDocument {
61
65
  }
62
66
  }
63
67
  export class ScoutTweetDocument extends ScoutDocument {
68
+ type;
64
69
  tweet;
65
70
  constructor(scout_document) {
66
71
  if (!ScoutTweetDocument.is(scout_document)) {
67
72
  throw Error("Invalid input.");
68
73
  }
69
74
  super(scout_document);
75
+ this.type = "TWEET";
70
76
  this.tweet = scout_document.tweet;
71
77
  }
72
78
  static is(scout_document) {
@@ -76,18 +82,24 @@ export class ScoutTweetDocument extends ScoutDocument {
76
82
  }
77
83
  }
78
84
  export class ScoutPressDocument extends ScoutDocument {
85
+ type;
86
+ url;
79
87
  constructor(scout_document) {
80
88
  if (!ScoutPressDocument.is(scout_document)) {
81
89
  throw Error("Invalid input.");
82
90
  }
83
91
  super(scout_document);
92
+ this.type = "PRESS";
93
+ this.url = scout_document.url;
84
94
  }
85
95
  static is(scout_document) {
86
96
  return (ScoutDocument.is(scout_document) &&
87
- scout_document.type === "PRESS");
97
+ scout_document.type === "PRESS" &&
98
+ typeof scout_document.url === "string");
88
99
  }
89
100
  }
90
101
  export class ScoutFileDocument extends ScoutDocument {
102
+ type;
91
103
  file_type;
92
104
  filename;
93
105
  constructor(scout_document) {
@@ -95,6 +107,7 @@ export class ScoutFileDocument extends ScoutDocument {
95
107
  throw Error("Invalid input.");
96
108
  }
97
109
  super(scout_document);
110
+ this.type = "FILE";
98
111
  this.file_type = scout_document.file_type;
99
112
  this.filename = scout_document.filename;
100
113
  }
@@ -28,8 +28,8 @@ export declare class BillSource {
28
28
  readonly type: string;
29
29
  readonly vector_key: string;
30
30
  readonly bill: Bill;
31
- constructor(bill_document_source: any);
32
- static is(bill_document_source: any): bill_document_source is BillSource;
31
+ constructor(bill_source: any);
32
+ static is(bill_source: any): bill_source is BillSource;
33
33
  }
34
34
  export declare class GrokSource {
35
35
  readonly title: string;
@@ -64,25 +64,25 @@ export class BillSource {
64
64
  type;
65
65
  vector_key;
66
66
  bill;
67
- constructor(bill_document_source) {
68
- if (!BillSource.is(bill_document_source)) {
67
+ constructor(bill_source) {
68
+ if (!BillSource.is(bill_source)) {
69
69
  throw Error("Invalid input.");
70
70
  }
71
- this.chunk_text = bill_document_source.chunk_text;
72
- this.description = bill_document_source.description;
73
- this.label = bill_document_source.label;
74
- this.type = bill_document_source.type;
75
- this.vector_key = bill_document_source.vector_key;
76
- this.bill = bill_document_source.bill;
71
+ this.chunk_text = bill_source.chunk_text;
72
+ this.description = bill_source.description;
73
+ this.label = bill_source.label;
74
+ this.type = bill_source.type;
75
+ this.vector_key = bill_source.vector_key;
76
+ this.bill = bill_source.bill;
77
77
  }
78
- static is(bill_document_source) {
79
- return (bill_document_source !== undefined &&
80
- typeof bill_document_source.chunk_text === "string" &&
81
- typeof bill_document_source.description === "string" &&
82
- typeof bill_document_source.label === "string" &&
83
- typeof bill_document_source.type === "string" &&
84
- typeof bill_document_source.vector_key === "string" &&
85
- Bill.is(bill_document_source.bill));
78
+ static is(bill_source) {
79
+ return (bill_source !== undefined &&
80
+ typeof bill_source.chunk_text === "string" &&
81
+ typeof bill_source.description === "string" &&
82
+ typeof bill_source.label === "string" &&
83
+ typeof bill_source.type === "string" &&
84
+ typeof bill_source.vector_key === "string" &&
85
+ Bill.is(bill_source.bill));
86
86
  }
87
87
  }
88
88
  export class GrokSource {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scout-types",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -38,6 +38,7 @@ export class ScoutDocument {
38
38
  }
39
39
 
40
40
  export class ScoutURLDocument extends ScoutDocument {
41
+ readonly type : "URL"
41
42
  readonly url : string
42
43
 
43
44
  constructor(scout_document : any) {
@@ -45,6 +46,7 @@ export class ScoutURLDocument extends ScoutDocument {
45
46
  throw Error("Invalid input.")
46
47
  }
47
48
  super(scout_document)
49
+ this.type = "URL"
48
50
  this.url = scout_document.url
49
51
 
50
52
  }
@@ -59,6 +61,7 @@ export class ScoutURLDocument extends ScoutDocument {
59
61
  }
60
62
 
61
63
  export class ScoutTwitterDocument extends ScoutDocument {
64
+ readonly type : "TWITTER"
62
65
  readonly username : string
63
66
 
64
67
  constructor(scout_document : any) {
@@ -66,6 +69,7 @@ export class ScoutTwitterDocument extends ScoutDocument {
66
69
  throw Error("Invalid input.")
67
70
  }
68
71
  super(scout_document)
72
+ this.type = "TWITTER"
69
73
  this.username = scout_document.username
70
74
 
71
75
  }
@@ -80,6 +84,7 @@ export class ScoutTwitterDocument extends ScoutDocument {
80
84
  }
81
85
 
82
86
  export class ScoutTweetDocument extends ScoutDocument {
87
+ readonly type : "TWEET"
83
88
  readonly tweet : Tweet
84
89
 
85
90
  constructor(scout_document : any) {
@@ -87,6 +92,7 @@ export class ScoutTweetDocument extends ScoutDocument {
87
92
  throw Error("Invalid input.")
88
93
  }
89
94
  super(scout_document)
95
+ this.type = "TWEET"
90
96
  this.tweet = scout_document.tweet
91
97
 
92
98
  }
@@ -101,24 +107,30 @@ export class ScoutTweetDocument extends ScoutDocument {
101
107
  }
102
108
 
103
109
  export class ScoutPressDocument extends ScoutDocument {
110
+ readonly type : "PRESS"
111
+ readonly url : string
104
112
 
105
113
  constructor(scout_document : any) {
106
114
  if (!ScoutPressDocument.is(scout_document)) {
107
115
  throw Error("Invalid input.")
108
116
  }
109
117
  super(scout_document)
118
+ this.type = "PRESS"
119
+ this.url = scout_document.url
110
120
 
111
121
  }
112
122
 
113
123
  static is(scout_document : any) : scout_document is ScoutPressDocument {
114
124
  return (
115
125
  ScoutDocument.is(scout_document) &&
116
- scout_document.type === "PRESS"
126
+ scout_document.type === "PRESS" &&
127
+ typeof scout_document.url === "string"
117
128
  )
118
129
  }
119
130
  }
120
131
 
121
132
  export class ScoutFileDocument extends ScoutDocument {
133
+ readonly type : "FILE"
122
134
  readonly file_type : string
123
135
  readonly filename : string
124
136
 
@@ -127,6 +139,7 @@ export class ScoutFileDocument extends ScoutDocument {
127
139
  throw Error("Invalid input.")
128
140
  }
129
141
  super(scout_document)
142
+ this.type = "FILE"
130
143
  this.file_type = scout_document.file_type
131
144
  this.filename = scout_document.filename
132
145
 
@@ -76,27 +76,27 @@ export class BillSource {
76
76
  readonly vector_key : string
77
77
  readonly bill : Bill
78
78
 
79
- constructor(bill_document_source : any) {
80
- if (!BillSource.is(bill_document_source)) {
79
+ constructor(bill_source : any) {
80
+ if (!BillSource.is(bill_source)) {
81
81
  throw Error("Invalid input.")
82
82
  }
83
- this.chunk_text = bill_document_source.chunk_text
84
- this.description = bill_document_source.description
85
- this.label = bill_document_source.label
86
- this.type = bill_document_source.type
87
- this.vector_key = bill_document_source.vector_key
88
- this.bill = bill_document_source.bill
83
+ this.chunk_text = bill_source.chunk_text
84
+ this.description = bill_source.description
85
+ this.label = bill_source.label
86
+ this.type = bill_source.type
87
+ this.vector_key = bill_source.vector_key
88
+ this.bill = bill_source.bill
89
89
  }
90
90
 
91
- static is(bill_document_source : any) : bill_document_source is BillSource {
91
+ static is(bill_source : any) : bill_source is BillSource {
92
92
  return (
93
- bill_document_source !== undefined &&
94
- typeof bill_document_source.chunk_text === "string" &&
95
- typeof bill_document_source.description === "string" &&
96
- typeof bill_document_source.label === "string" &&
97
- typeof bill_document_source.type === "string" &&
98
- typeof bill_document_source.vector_key === "string" &&
99
- Bill.is(bill_document_source.bill)
93
+ bill_source !== undefined &&
94
+ typeof bill_source.chunk_text === "string" &&
95
+ typeof bill_source.description === "string" &&
96
+ typeof bill_source.label === "string" &&
97
+ typeof bill_source.type === "string" &&
98
+ typeof bill_source.vector_key === "string" &&
99
+ Bill.is(bill_source.bill)
100
100
  )
101
101
  }
102
102
  }