triangle-types 1.0.259 → 1.0.261

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.
Files changed (50) hide show
  1. package/dist/src/index.d.ts +2 -7
  2. package/dist/src/index.js +2 -7
  3. package/dist/src/types/label/Label.d.ts +7 -0
  4. package/dist/src/types/label/Label.js +19 -0
  5. package/dist/src/types/scout/UserScout.d.ts +1 -16
  6. package/dist/src/types/scout/UserScout.js +46 -40
  7. package/dist/src/types/scout/UserScoutConversation.d.ts +1 -16
  8. package/dist/src/types/scout/UserScoutConversation.js +46 -40
  9. package/dist/src/types/scout/UserScoutConversationMessage.d.ts +0 -25
  10. package/dist/src/types/scout/UserScoutConversationMessage.js +69 -62
  11. package/dist/src/types/twitter/TwitterUserTag.d.ts +1 -0
  12. package/dist/src/types/twitter/TwitterUserTag.js +3 -0
  13. package/dist/src/types/user/TenantDocument.d.ts +1 -2
  14. package/dist/src/types/user/TenantDocument.js +1 -2
  15. package/dist/src/types/user/TenantDocumentFragment.d.ts +1 -2
  16. package/dist/src/types/user/TenantDocumentFragment.js +2 -2
  17. package/dist/src/types/user/TenantProvision.d.ts +1 -1
  18. package/dist/src/types/user/TenantProvision.js +1 -1
  19. package/dist/src/types/user/TenantResourceTag.d.ts +9 -0
  20. package/dist/src/types/user/TenantResourceTag.js +22 -0
  21. package/dist/src/types/web/WebDocument.d.ts +1 -1
  22. package/dist/src/types/web/WebDocument.js +1 -1
  23. package/dist/src/types/web/WebDocumentFragment.d.ts +4 -1
  24. package/dist/src/types/web/WebDocumentFragment.js +4 -1
  25. package/dist/src/types/web/WebDocumentTag.d.ts +1 -0
  26. package/dist/src/types/web/WebDocumentTag.js +3 -0
  27. package/dist/src/types/youtube/YoutubeVideoTag.d.ts +1 -0
  28. package/dist/src/types/youtube/YoutubeVideoTag.js +3 -0
  29. package/package.json +1 -1
  30. package/src/index.ts +2 -8
  31. package/src/types/label/Label.ts +23 -0
  32. package/src/types/scout/UserScout.ts +45 -45
  33. package/src/types/scout/UserScoutConversation.ts +45 -45
  34. package/src/types/scout/UserScoutConversationMessage.ts +68 -68
  35. package/src/types/twitter/TwitterUserTag.ts +3 -0
  36. package/src/types/user/TenantDocument.ts +2 -4
  37. package/src/types/user/TenantDocumentFragment.ts +3 -3
  38. package/src/types/user/TenantProvision.ts +1 -1
  39. package/src/types/user/TenantResourceTag.ts +27 -0
  40. package/src/types/web/WebDocument.ts +2 -2
  41. package/src/types/web/WebDocumentFragment.ts +7 -1
  42. package/src/types/web/WebDocumentTag.ts +3 -0
  43. package/src/types/youtube/YoutubeVideoTag.ts +3 -0
  44. package/src/types/fragments/Fragment.ts +0 -262
  45. package/src/types/fragments/FragmentVector.ts +0 -44
  46. package/src/types/scout/ScoutDocument.ts +0 -47
  47. package/src/types/scout/ScoutSubScout.ts +0 -21
  48. package/src/types/scout/ScoutTag.ts +0 -21
  49. package/src/types/tag/Tag.ts +0 -23
  50. package/src/types/user/TenantDocumentTag.ts +0 -24
@@ -5,7 +5,7 @@ export class WebDocument {
5
5
  readonly title : string
6
6
  readonly description : string
7
7
  readonly time : string
8
- readonly snippets : string[]
8
+ readonly snippets? : string[]
9
9
  readonly s3_id_html? : string
10
10
  readonly s3_id_txt? : string
11
11
 
@@ -33,7 +33,7 @@ export class WebDocument {
33
33
  typeof web_document.title === "string" &&
34
34
  typeof web_document.description === "string" &&
35
35
  typeof web_document.time === "string" &&
36
- Array.isArray(web_document.snippets) && web_document.snippets.every((snippet : any) => typeof snippet === "string") &&
36
+ (web_document.snippets === undefined || Array.isArray(web_document.snippets) && web_document.snippets.every((snippet : any) => typeof snippet === "string")) &&
37
37
  (web_document.s3_id_html === undefined || typeof web_document.s3_id_html === "string") &&
38
38
  (web_document.s3_id_txt === undefined || typeof web_document.s3_id_txt === "string")
39
39
  )
@@ -1,4 +1,10 @@
1
- import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
1
+ const fragment_type_ids = ["LINE", "CHAR"] as const
2
+
3
+ export type FragmentTypeID = typeof fragment_type_ids[number]
4
+
5
+ export function is_fragment_type_id(fragment_type_id : any) : fragment_type_id is FragmentTypeID {
6
+ return fragment_type_ids.includes(fragment_type_id)
7
+ }
2
8
 
3
9
  export class WebDocumentFragment {
4
10
  readonly web_document_id : string
@@ -2,6 +2,7 @@ import { WebDocument } from "./WebDocument"
2
2
 
3
3
  export class WebDocumentTag {
4
4
  readonly web_document_id : string
5
+ readonly tag_type_id : string
5
6
  readonly tag_id : string
6
7
  readonly time : string
7
8
  readonly is_relevant? : boolean
@@ -13,6 +14,7 @@ export class WebDocumentTag {
13
14
  throw Error("Invalid input.")
14
15
  }
15
16
  this.web_document_id = web_document_tag.web_document_id
17
+ this.tag_type_id = web_document_tag.tag_type_id
16
18
  this.tag_id = web_document_tag.tag_id
17
19
  this.time = web_document_tag.time
18
20
  this.is_relevant = web_document_tag.is_relevant
@@ -23,6 +25,7 @@ export class WebDocumentTag {
23
25
  return (
24
26
  web_document_tag !== undefined &&
25
27
  typeof web_document_tag.web_document_id === "string" &&
28
+ typeof web_document_tag.tag_type_id === "string" &&
26
29
  typeof web_document_tag.tag_id === "string" &&
27
30
  typeof web_document_tag.time === "string" &&
28
31
  (web_document_tag.is_relevant === undefined || typeof web_document_tag.is_relevant === "boolean") &&
@@ -2,6 +2,7 @@ import { YoutubeVideoAux } from "./YoutubeVideo"
2
2
 
3
3
  export class YoutubeVideoTag {
4
4
  readonly youtube_video_id : string
5
+ readonly tag_type_id : string
5
6
  readonly tag_id : string
6
7
  readonly time : string
7
8
  readonly is_relevant? : boolean
@@ -12,6 +13,7 @@ export class YoutubeVideoTag {
12
13
  throw Error("Invalid input.")
13
14
  }
14
15
  this.youtube_video_id = youtube_video_tag.youtube_video_id
16
+ this.tag_type_id = youtube_video_tag.tag_type_id
15
17
  this.tag_id = youtube_video_tag.tag_id
16
18
  this.time = youtube_video_tag.time
17
19
  this.is_relevant = youtube_video_tag.is_relevant
@@ -21,6 +23,7 @@ export class YoutubeVideoTag {
21
23
  return (
22
24
  youtube_video_tag !== undefined &&
23
25
  typeof youtube_video_tag.youtube_video_id === "string" &&
26
+ typeof youtube_video_tag.tag_type_id === "string" &&
24
27
  typeof youtube_video_tag.tag_id === "string" &&
25
28
  typeof youtube_video_tag.time === "string" &&
26
29
  (youtube_video_tag.is_relevant === undefined || typeof youtube_video_tag.is_relevant === "boolean")
@@ -1,262 +0,0 @@
1
- import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument"
2
- import { LegistarDocument } from "../legistar/LegistarDocument"
3
- import { WebDocumentTag } from "../web/WebDocumentTag"
4
- import { ScoutDocument } from "../scout/ScoutDocument"
5
- import { TwitterTweet } from "../twitter/TwitterTweet"
6
-
7
- const fragment_type_ids = ["LINE", "CHAR"] as const
8
-
9
- export type FragmentTypeID = typeof fragment_type_ids[number]
10
-
11
- export function is_fragment_type_id(fragment_type_id : any) : fragment_type_id is FragmentTypeID {
12
- return fragment_type_ids.includes(fragment_type_id)
13
- }
14
-
15
- const document_type_ids = ["federal_congress_bill_document", "legistar_document", "web_document_tag", "scout_document", "twitter_tweet"] as const
16
-
17
- export type DocumentTypeID = typeof document_type_ids[number]
18
-
19
- export function is_document_type_id(document_type_id : any) : document_type_id is DocumentTypeID {
20
- return document_type_ids.includes(document_type_id)
21
- }
22
-
23
- export class Fragment {
24
- readonly fragment_id : string
25
- readonly document_type_id : DocumentTypeID
26
- readonly fragment_type_id : FragmentTypeID
27
- readonly max_size : number
28
- readonly min_index : number
29
- readonly max_index : number
30
- readonly title : string
31
- readonly text : string
32
- readonly [x : string] : any
33
-
34
- constructor(fragment : Fragment) {
35
- if (!Fragment.is(fragment)) {
36
- throw Error("Invalid input.")
37
- }
38
- this.fragment_id = fragment.fragment_id
39
- this.document_type_id = fragment.document_type_id
40
- this.fragment_type_id = fragment.fragment_type_id
41
- this.max_size = fragment.max_size
42
- this.min_index = fragment.min_index
43
- this.max_index = fragment.max_index
44
- this.title = fragment.title
45
- this.text = fragment.text
46
- }
47
-
48
- static is(fragment : any) : fragment is Fragment {
49
- return (
50
- fragment !== undefined &&
51
- typeof fragment.fragment_id === "string" &&
52
- is_document_type_id(fragment.document_type_id) &&
53
- is_fragment_type_id(fragment.fragment_type_id) &&
54
- typeof fragment.max_size === "number" &&
55
- typeof fragment.min_index === "number" &&
56
- typeof fragment.max_index === "number" &&
57
- typeof fragment.title === "string" &&
58
- typeof fragment.text === "string"
59
- )
60
- }
61
- }
62
-
63
- export class FragmentAux extends Fragment {
64
- readonly federal_congress_bill_document? : FederalCongressBillDocument
65
- readonly legistar_document? : LegistarDocument
66
- readonly web_document_tag? : WebDocumentTag
67
- readonly scout_document? : ScoutDocument
68
- readonly twitter_tweet? : TwitterTweet
69
-
70
- constructor(fragment : FragmentAux) {
71
- if (!FragmentAux.is(fragment)) {
72
- throw Error("Invalid input.")
73
- }
74
- super(fragment)
75
- this.federal_congress_bill_document = fragment.federal_congress_bill_document
76
- this.legistar_document = fragment.legistar_document
77
- this.web_document_tag = fragment.web_document_tag
78
- this.scout_document = fragment.scout_document
79
- this.twitter_tweet = fragment.twitter_tweet
80
- }
81
-
82
- static is(fragment : any) : fragment is FragmentAux {
83
- return (
84
- Fragment.is(fragment) &&
85
- (fragment.federal_congress_bill_document === undefined || FederalCongressBillDocument.is(fragment.federal_congress_bill_document)) &&
86
- (fragment.legistar_document === undefined || LegistarDocument.is(fragment.legistar_document)) &&
87
- (fragment.web_document_tag === undefined || WebDocumentTag.is(fragment.web_document_tag)) &&
88
- (fragment.scout_document === undefined || ScoutDocument.is(fragment.scout_document)) &&
89
- (fragment.twitter_tweet === undefined || TwitterTweet.is(fragment.twitter_tweet))
90
- )
91
- }
92
- }
93
-
94
- export class FederalCongressBillDocumentFragment extends Fragment {
95
- readonly document_type_id : "federal_congress_bill_document"
96
- readonly federal_congress_bill_document_id : string
97
-
98
- constructor(fragment : FederalCongressBillDocumentFragment) {
99
- if (!FederalCongressBillDocumentFragment.is(fragment)) {
100
- throw Error("Invalid input.")
101
- }
102
- super(fragment)
103
- this.document_type_id = fragment.document_type_id
104
- this.federal_congress_bill_document_id = fragment.federal_congress_bill_document_id
105
- }
106
-
107
- static is(fragment : any) : fragment is FederalCongressBillDocumentFragment {
108
- return (
109
- Fragment.is(fragment) &&
110
- fragment.document_type_id === "federal_congress_bill_document" &&
111
- typeof fragment.federal_congress_bill_document_id === "string"
112
- )
113
- }
114
- }
115
-
116
- export class LegistarDocumentFragment extends Fragment {
117
- readonly document_type_id : "legistar_document"
118
- readonly legistar_document_id : string
119
-
120
- constructor(fragment : LegistarDocumentFragment) {
121
- if (!LegistarDocumentFragment.is(fragment)) {
122
- throw Error("Invalid input.")
123
- }
124
- super(fragment)
125
- this.document_type_id = fragment.document_type_id
126
- this.legistar_document_id = fragment.legistar_document_id
127
- }
128
-
129
- static is(fragment : any) : fragment is LegistarDocumentFragment {
130
- return (
131
- Fragment.is(fragment) &&
132
- fragment.document_type_id === "legistar_document" &&
133
- typeof fragment.legistar_document_id === "string"
134
- )
135
- }
136
- }
137
-
138
- export class WebDocumentTagFragment extends Fragment {
139
- readonly document_type_id : "web_document_tag"
140
- readonly web_document_id : string
141
- readonly tag_id : string
142
-
143
- constructor(fragment : WebDocumentTagFragment) {
144
- if (!WebDocumentTagFragment.is(fragment)) {
145
- throw Error("Invalid input.")
146
- }
147
- super(fragment)
148
- this.document_type_id = fragment.document_type_id
149
- this.web_document_id = fragment.web_document_id
150
- this.tag_id = fragment.tag_id
151
- }
152
-
153
- static is(fragment : any) : fragment is WebDocumentTagFragment {
154
- return (
155
- Fragment.is(fragment) &&
156
- fragment.document_type_id === "web_document_tag" &&
157
- typeof fragment.web_document_id === "string" &&
158
- typeof fragment.tag_id === "string"
159
- )
160
- }
161
- }
162
-
163
- // export class WebDocumentTagFragmentAux extends WebDocumentTagFragment {
164
- // readonly web_document_ : WebDocumentTagAux
165
-
166
- // constructor(fragment : WebDocumentTagFragmentAux) {
167
- // if (!WebDocumentTagFragmentAux.is(fragment)) {
168
- // throw Error("Invalid input.")
169
- // }
170
- // super(fragment)
171
- // this.scout_document = fragment.scout_document
172
- // }
173
-
174
- // static is(fragment : any) : fragment is WebDocumentTagFragmentAux {
175
- // return (
176
- // Fragment.is(fragment) &&
177
- // ScoutDocument.is(fragment.scout_document)
178
- // )
179
- // }
180
- // }
181
-
182
- export class ScoutDocumentFragment extends Fragment {
183
- readonly document_type_id : "scout_document"
184
- readonly scout_document_id : string
185
-
186
- constructor(fragment : ScoutDocumentFragment) {
187
- if (!ScoutDocumentFragment.is(fragment)) {
188
- throw Error("Invalid input.")
189
- }
190
- super(fragment)
191
- this.document_type_id = fragment.document_type_id
192
- this.scout_document_id = fragment.scout_document_id
193
- }
194
-
195
- static is(fragment : any) : fragment is ScoutDocumentFragment {
196
- return (
197
- Fragment.is(fragment) &&
198
- fragment.document_type_id === "scout_document" &&
199
- typeof fragment.scout_document_id === "string"
200
- )
201
- }
202
- }
203
-
204
- export class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
205
- readonly scout_document : ScoutDocument
206
-
207
- constructor(fragment : ScoutDocumentFragmentAux) {
208
- if (!ScoutDocumentFragmentAux.is(fragment)) {
209
- throw Error("Invalid input.")
210
- }
211
- super(fragment)
212
- this.scout_document = fragment.scout_document
213
- }
214
-
215
- static is(fragment : any) : fragment is ScoutDocumentFragmentAux {
216
- return (
217
- Fragment.is(fragment) &&
218
- ScoutDocument.is(fragment.scout_document)
219
- )
220
- }
221
- }
222
-
223
- export class TwitterTweetFragment extends Fragment {
224
- readonly document_type_id : "twitter_tweet"
225
- readonly twitter_tweet_id : string
226
-
227
- constructor(fragment : TwitterTweetFragment) {
228
- if (!TwitterTweetFragment.is(fragment)) {
229
- throw Error("Invalid input.")
230
- }
231
- super(fragment)
232
- this.document_type_id = fragment.document_type_id
233
- this.twitter_tweet_id = fragment.twitter_tweet_id
234
- }
235
-
236
- static is(fragment : any) : fragment is TwitterTweetFragment {
237
- return (
238
- Fragment.is(fragment) &&
239
- fragment.document_type_id === "twitter_tweet" &&
240
- typeof fragment.twitter_tweet_id === "string"
241
- )
242
- }
243
- }
244
-
245
- export class TwitterTweetFragmentAux extends TwitterTweetFragment {
246
- readonly twitter_tweet : TwitterTweet
247
-
248
- constructor(fragment : TwitterTweetFragmentAux) {
249
- if (!TwitterTweetFragmentAux.is(fragment)) {
250
- throw Error("Invalid input.")
251
- }
252
- super(fragment)
253
- this.twitter_tweet = fragment.twitter_tweet
254
- }
255
-
256
- static is(fragment : any) : fragment is TwitterTweetFragmentAux {
257
- return (
258
- Fragment.is(fragment) &&
259
- TwitterTweet.is(fragment.twitter_tweet)
260
- )
261
- }
262
- }
@@ -1,44 +0,0 @@
1
- import { DocumentTypeID, FragmentTypeID } from "./Fragment"
2
-
3
- export class FragmentVector {
4
- readonly fragment_vector_id : string
5
- readonly fragment_id : string
6
- readonly vector_id : string
7
- readonly document_type_id : DocumentTypeID
8
- // readonly s3_vector_bucket_id : string
9
- // readonly s3_vector_index_id : string
10
- readonly coordinates : number[]
11
- readonly headers : Record<string, any>
12
- readonly s3_vector_id? : string
13
- readonly [x : string] : any
14
-
15
- constructor(fragment_vector : FragmentVector) {
16
- if (!FragmentVector.is(fragment_vector)) {
17
- throw Error("Invalid input.")
18
- }
19
- this.fragment_vector_id = fragment_vector.fragment_vector_id
20
- this.fragment_id = fragment_vector.fragment_id
21
- this.vector_id = fragment_vector.vector_id
22
- this.document_type_id = fragment_vector.document_type_id
23
- // this.s3_vector_bucket_id = fragment_vector.s3_vector_bucket_id
24
- // this.s3_vector_index_id = fragment_vector.s3_vector_index_id
25
- this.coordinates = fragment_vector.coordinates
26
- this.headers = fragment_vector.headers
27
- this.s3_vector_id = fragment_vector.s3_vector_id
28
- }
29
-
30
- static is(fragment_vector : any) : fragment_vector is FragmentVector {
31
- return (
32
- fragment_vector !== undefined &&
33
- typeof fragment_vector.fragment_vector_id === "string" &&
34
- typeof fragment_vector.fragment_id === "string" &&
35
- typeof fragment_vector.vector_id === "string" &&
36
- typeof fragment_vector.document_type_id === "string" &&
37
- // typeof fragment_vector.s3_vector_bucket_id === "string" &&
38
- // typeof fragment_vector.s3_vector_index_id === "string" &&
39
- Array.isArray(fragment_vector.coordinates) && fragment_vector.coordinates.every((coordinate : any) => typeof coordinate === "number") &&
40
- typeof fragment_vector.headers === "object" && Object.keys(fragment_vector.headers).every((header_id : any) => typeof header_id === "string") &&
41
- (fragment_vector.s3_vector_id === undefined || typeof fragment_vector.s3_vector_id === "string")
42
- )
43
- }
44
- }
@@ -1,47 +0,0 @@
1
- import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
2
-
3
- export class ScoutDocument {
4
- readonly scout_document_id : string
5
- readonly scout_id : string
6
- readonly document_id : string
7
- readonly content_type_id : string
8
- readonly name : string
9
- readonly fragment_type_id? : FragmentTypeID
10
- readonly raw_s3_id : string
11
- readonly s3_id : string
12
- readonly s3_id_pdf? : string
13
- readonly s3_id_txt? : string
14
- readonly [x : string] : any
15
-
16
- constructor(scout_document : any) {
17
- if (!ScoutDocument.is(scout_document)) {
18
- throw Error("Invalid input.")
19
- }
20
- this.scout_document_id = scout_document.scout_document_id
21
- this.scout_id = scout_document.scout_id
22
- this.document_id = scout_document.document_id
23
- this.content_type_id = scout_document.content_type_id
24
- this.name = scout_document.name
25
- this.fragment_type_id = scout_document.fragment_type_id
26
- this.raw_s3_id = scout_document.raw_s3_id
27
- this.s3_id = scout_document.s3_id
28
- this.s3_id_pdf = scout_document.s3_id_pdf
29
- this.s3_id_txt = scout_document.s3_id_txt
30
- }
31
-
32
- static is(scout_document : any) : scout_document is ScoutDocument {
33
- return (
34
- scout_document !== undefined &&
35
- typeof scout_document.scout_document_id === "string" &&
36
- typeof scout_document.scout_id === "string" &&
37
- typeof scout_document.document_id === "string" &&
38
- typeof scout_document.content_type_id === "string" &&
39
- typeof scout_document.name === "string" &&
40
- (scout_document.fragment_type_id === undefined || is_fragment_type_id(scout_document.fragment_type_id)) &&
41
- typeof scout_document.raw_s3_id === "string" &&
42
- typeof scout_document.s3_id === "string" &&
43
- (scout_document.s3_id_pdf === undefined || typeof scout_document.s3_id_pdf === "string") &&
44
- (scout_document.s3_id_txt === undefined || typeof scout_document.s3_id_txt === "string")
45
- )
46
- }
47
- }
@@ -1,21 +0,0 @@
1
- export class ScoutSubScout {
2
- readonly scout_id : string
3
- readonly sub_scout_id : string
4
- readonly [x : string] : any
5
-
6
- constructor(scout_sub_scout : ScoutSubScout) {
7
- if (!ScoutSubScout.is(scout_sub_scout)) {
8
- throw Error("Invalid input.")
9
- }
10
- this.scout_id = scout_sub_scout.scout_id
11
- this.sub_scout_id = scout_sub_scout.sub_scout_id
12
- }
13
-
14
- static is(scout_sub_scout : any) : scout_sub_scout is ScoutSubScout {
15
- return (
16
- scout_sub_scout !== undefined &&
17
- typeof scout_sub_scout.scout_id === "string" &&
18
- typeof scout_sub_scout.sub_scout_id === "string"
19
- )
20
- }
21
- }
@@ -1,21 +0,0 @@
1
- export class ScoutTag {
2
- readonly scout_id : string
3
- readonly tag_id : string
4
- readonly [x : string] : any
5
-
6
- constructor(scout_tag : ScoutTag) {
7
- if (!ScoutTag.is(scout_tag)) {
8
- throw Error("Invalid input.")
9
- }
10
- this.scout_id = scout_tag.scout_id
11
- this.tag_id = scout_tag.tag_id
12
- }
13
-
14
- static is(scout_tag : any) : scout_tag is ScoutTag {
15
- return (
16
- scout_tag !== undefined &&
17
- typeof scout_tag.scout_id === "string" &&
18
- typeof scout_tag.tag_id === "string"
19
- )
20
- }
21
- }
@@ -1,23 +0,0 @@
1
- export class Tag {
2
- readonly tag_id : string
3
- readonly resource_type_id : string
4
- readonly name? : string
5
-
6
- constructor(tag : any) {
7
- if (!Tag.is(tag)) {
8
- throw Error("Invalid input.")
9
- }
10
- this.tag_id = tag.tag_id
11
- this.resource_type_id = tag.resource_type_id
12
- this.name = tag.name
13
- }
14
-
15
- static is(tag : any) : tag is Tag {
16
- return (
17
- tag !== undefined &&
18
- typeof tag.tag_id === "string" &&
19
- typeof tag.resource_type_id === "string" &&
20
- (tag.name === undefined || typeof tag.voter_id === "string")
21
- )
22
- }
23
- }
@@ -1,24 +0,0 @@
1
- export class TenantDocumentTag {
2
- readonly tenant_document_id : string
3
- readonly tenant_id : string
4
- readonly tag_id : string
5
- readonly [x : string] : any
6
-
7
- constructor(tenant_document_tag : TenantDocumentTag) {
8
- if (!TenantDocumentTag.is(tenant_document_tag)) {
9
- throw Error("Invalid input.")
10
- }
11
- this.tenant_document_id = tenant_document_tag.tenant_document_id
12
- this.tenant_id = tenant_document_tag.tenant_id
13
- this.tag_id = tenant_document_tag.tag_id
14
- }
15
-
16
- static is(tenant_document_tag : any) : tenant_document_tag is TenantDocumentTag {
17
- return (
18
- tenant_document_tag !== undefined &&
19
- typeof tenant_document_tag.tenant_document_id === "string" &&
20
- typeof tenant_document_tag.tenant_id === "string" &&
21
- typeof tenant_document_tag.tag_id === "string"
22
- )
23
- }
24
- }