scout-types 1.0.21 → 1.0.23

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