triangle-types 1.0.260 → 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.
- package/dist/src/index.d.ts +2 -7
- package/dist/src/index.js +2 -7
- package/dist/src/types/label/Label.d.ts +7 -0
- package/dist/src/types/label/Label.js +19 -0
- package/dist/src/types/scout/UserScout.d.ts +1 -16
- package/dist/src/types/scout/UserScout.js +46 -40
- package/dist/src/types/scout/UserScoutConversation.d.ts +1 -16
- package/dist/src/types/scout/UserScoutConversation.js +46 -40
- package/dist/src/types/scout/UserScoutConversationMessage.d.ts +0 -25
- package/dist/src/types/scout/UserScoutConversationMessage.js +69 -62
- package/dist/src/types/twitter/TwitterUserTag.d.ts +1 -0
- package/dist/src/types/twitter/TwitterUserTag.js +3 -0
- package/dist/src/types/user/TenantDocument.d.ts +1 -2
- package/dist/src/types/user/TenantDocument.js +1 -2
- package/dist/src/types/user/TenantDocumentFragment.d.ts +1 -2
- package/dist/src/types/user/TenantDocumentFragment.js +2 -2
- package/dist/src/types/user/TenantProvision.d.ts +1 -1
- package/dist/src/types/user/TenantProvision.js +1 -1
- package/dist/src/types/user/TenantResourceTag.d.ts +9 -0
- package/dist/src/types/user/TenantResourceTag.js +22 -0
- package/dist/src/types/web/WebDocumentFragment.d.ts +4 -1
- package/dist/src/types/web/WebDocumentFragment.js +4 -1
- package/dist/src/types/web/WebDocumentTag.d.ts +1 -0
- package/dist/src/types/web/WebDocumentTag.js +3 -0
- package/dist/src/types/youtube/YoutubeVideoTag.d.ts +1 -0
- package/dist/src/types/youtube/YoutubeVideoTag.js +3 -0
- package/package.json +1 -1
- package/src/index.ts +2 -8
- package/src/types/label/Label.ts +23 -0
- package/src/types/scout/UserScout.ts +45 -45
- package/src/types/scout/UserScoutConversation.ts +45 -45
- package/src/types/scout/UserScoutConversationMessage.ts +68 -68
- package/src/types/twitter/TwitterUserTag.ts +3 -0
- package/src/types/user/TenantDocument.ts +2 -4
- package/src/types/user/TenantDocumentFragment.ts +3 -3
- package/src/types/user/TenantProvision.ts +1 -1
- package/src/types/user/TenantResourceTag.ts +27 -0
- package/src/types/web/WebDocumentFragment.ts +7 -1
- package/src/types/web/WebDocumentTag.ts +3 -0
- package/src/types/youtube/YoutubeVideoTag.ts +3 -0
- package/src/types/fragments/Fragment.ts +0 -262
- package/src/types/fragments/FragmentVector.ts +0 -44
- package/src/types/scout/ScoutDocument.ts +0 -47
- package/src/types/scout/ScoutSubScout.ts +0 -21
- package/src/types/scout/ScoutTag.ts +0 -21
- package/src/types/tag/Tag.ts +0 -23
- package/src/types/user/TenantDocumentTag.ts +0 -24
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const fragment_type_ids = ["LINE", "CHAR"];
|
|
2
|
+
export function is_fragment_type_id(fragment_type_id) {
|
|
3
|
+
return fragment_type_ids.includes(fragment_type_id);
|
|
4
|
+
}
|
|
2
5
|
export class WebDocumentFragment {
|
|
3
6
|
web_document_id;
|
|
4
7
|
fragment_id;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WebDocument } from "./WebDocument.js";
|
|
2
2
|
export class WebDocumentTag {
|
|
3
3
|
web_document_id;
|
|
4
|
+
tag_type_id;
|
|
4
5
|
tag_id;
|
|
5
6
|
time;
|
|
6
7
|
is_relevant;
|
|
@@ -10,6 +11,7 @@ export class WebDocumentTag {
|
|
|
10
11
|
throw Error("Invalid input.");
|
|
11
12
|
}
|
|
12
13
|
this.web_document_id = web_document_tag.web_document_id;
|
|
14
|
+
this.tag_type_id = web_document_tag.tag_type_id;
|
|
13
15
|
this.tag_id = web_document_tag.tag_id;
|
|
14
16
|
this.time = web_document_tag.time;
|
|
15
17
|
this.is_relevant = web_document_tag.is_relevant;
|
|
@@ -18,6 +20,7 @@ export class WebDocumentTag {
|
|
|
18
20
|
static is(web_document_tag) {
|
|
19
21
|
return (web_document_tag !== undefined &&
|
|
20
22
|
typeof web_document_tag.web_document_id === "string" &&
|
|
23
|
+
typeof web_document_tag.tag_type_id === "string" &&
|
|
21
24
|
typeof web_document_tag.tag_id === "string" &&
|
|
22
25
|
typeof web_document_tag.time === "string" &&
|
|
23
26
|
(web_document_tag.is_relevant === undefined || typeof web_document_tag.is_relevant === "boolean") &&
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { YoutubeVideoAux } from "./YoutubeVideo.js";
|
|
2
2
|
export class YoutubeVideoTag {
|
|
3
3
|
youtube_video_id;
|
|
4
|
+
tag_type_id;
|
|
4
5
|
tag_id;
|
|
5
6
|
time;
|
|
6
7
|
is_relevant;
|
|
@@ -9,6 +10,7 @@ export class YoutubeVideoTag {
|
|
|
9
10
|
throw Error("Invalid input.");
|
|
10
11
|
}
|
|
11
12
|
this.youtube_video_id = youtube_video_tag.youtube_video_id;
|
|
13
|
+
this.tag_type_id = youtube_video_tag.tag_type_id;
|
|
12
14
|
this.tag_id = youtube_video_tag.tag_id;
|
|
13
15
|
this.time = youtube_video_tag.time;
|
|
14
16
|
this.is_relevant = youtube_video_tag.is_relevant;
|
|
@@ -16,6 +18,7 @@ export class YoutubeVideoTag {
|
|
|
16
18
|
static is(youtube_video_tag) {
|
|
17
19
|
return (youtube_video_tag !== undefined &&
|
|
18
20
|
typeof youtube_video_tag.youtube_video_id === "string" &&
|
|
21
|
+
typeof youtube_video_tag.tag_type_id === "string" &&
|
|
19
22
|
typeof youtube_video_tag.tag_id === "string" &&
|
|
20
23
|
typeof youtube_video_tag.time === "string" &&
|
|
21
24
|
(youtube_video_tag.is_relevant === undefined || typeof youtube_video_tag.is_relevant === "boolean"));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -66,8 +66,7 @@ export * from "./types/federal_dockets/FederalDocketCommentAttachment"
|
|
|
66
66
|
export * from "./types/federal_rules/FederalRuleTitle"
|
|
67
67
|
export * from "./types/federal_rules/FederalRuleSection"
|
|
68
68
|
|
|
69
|
-
export * from "./types/
|
|
70
|
-
export * from "./types/fragments/FragmentVector"
|
|
69
|
+
export * from "./types/label/Label"
|
|
71
70
|
|
|
72
71
|
export * from "./types/lal/LALFile"
|
|
73
72
|
export * from "./types/lal/LALFileVoter"
|
|
@@ -94,9 +93,6 @@ export * from "./types/regions/SchoolDistrict"
|
|
|
94
93
|
export * from "./types/regions/State"
|
|
95
94
|
|
|
96
95
|
export * from "./types/scout/Scout"
|
|
97
|
-
export * from "./types/scout/ScoutDocument"
|
|
98
|
-
export * from "./types/scout/ScoutSubScout"
|
|
99
|
-
export * from "./types/scout/ScoutTag"
|
|
100
96
|
export * from "./types/scout/UserScout"
|
|
101
97
|
export * from "./types/scout/UserScoutConversation"
|
|
102
98
|
export * from "./types/scout/UserScoutConversationMessage"
|
|
@@ -128,12 +124,10 @@ export * from "./types/state_permits/TN/TNStatePermitDocument"
|
|
|
128
124
|
export * from "./types/state_permits/WI/WIStatePermit"
|
|
129
125
|
export * from "./types/state_permits/WI/WIStatePermitDocument"
|
|
130
126
|
|
|
131
|
-
export * from "./types/tag/Tag"
|
|
132
|
-
|
|
133
127
|
export * from "./types/user/Tenant"
|
|
134
128
|
export * from "./types/user/TenantDocument"
|
|
135
129
|
export * from "./types/user/TenantDocumentFragment"
|
|
136
|
-
export * from "./types/user/
|
|
130
|
+
export * from "./types/user/TenantResourceTag"
|
|
137
131
|
export * from "./types/user/TenantProvision"
|
|
138
132
|
export * from "./types/user/TenantRole"
|
|
139
133
|
export * from "./types/user/TenantRoleProvision"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class Label {
|
|
2
|
+
readonly label_id : string
|
|
3
|
+
readonly resource_type_id : string
|
|
4
|
+
readonly name? : string
|
|
5
|
+
|
|
6
|
+
constructor(label : any) {
|
|
7
|
+
if (!Label.is(label)) {
|
|
8
|
+
throw Error("Invalid input.")
|
|
9
|
+
}
|
|
10
|
+
this.label_id = label.label_id
|
|
11
|
+
this.resource_type_id = label.resource_type_id
|
|
12
|
+
this.name = label.name
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static is(label : any) : label is Label {
|
|
16
|
+
return (
|
|
17
|
+
label !== undefined &&
|
|
18
|
+
typeof label.label_id === "string" &&
|
|
19
|
+
typeof label.resource_type_id === "string" &&
|
|
20
|
+
(label.name === undefined || typeof label.voter_id === "string")
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { Scout, ScoutAux } from "./Scout"
|
|
1
|
+
// import { Scout, ScoutAux } from "./Scout"
|
|
2
2
|
|
|
3
|
-
export class UserScout {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
// export class UserScout {
|
|
4
|
+
// readonly user_scout_id : string
|
|
5
|
+
// readonly user_id : string
|
|
6
|
+
// readonly scout_id : string
|
|
7
|
+
// readonly is_conversation_allowed : boolean
|
|
8
|
+
// readonly is_search_allowed : boolean
|
|
9
|
+
// readonly [x : string] : any
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
// constructor(user_scout : any) {
|
|
12
|
+
// if (!UserScout.is(user_scout)) {
|
|
13
|
+
// throw Error("Invalid input.")
|
|
14
|
+
// }
|
|
15
|
+
// this.user_scout_id = user_scout.user_scout_id
|
|
16
|
+
// this.user_id = user_scout.user_id
|
|
17
|
+
// this.scout_id = user_scout.scout_id
|
|
18
|
+
// this.is_conversation_allowed = user_scout.is_conversation_allowed
|
|
19
|
+
// this.is_search_allowed = user_scout.is_search_allowed
|
|
20
|
+
// }
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
22
|
+
// static is(user_scout : any) : user_scout is UserScout {
|
|
23
|
+
// return (
|
|
24
|
+
// user_scout !== undefined &&
|
|
25
|
+
// typeof user_scout.user_scout_id === "string" &&
|
|
26
|
+
// typeof user_scout.user_id === "string" &&
|
|
27
|
+
// typeof user_scout.scout_id === "string" &&
|
|
28
|
+
// typeof user_scout.is_conversation_allowed === "boolean" &&
|
|
29
|
+
// typeof user_scout.is_search_allowed === "boolean"
|
|
30
|
+
// )
|
|
31
|
+
// }
|
|
32
|
+
// }
|
|
33
33
|
|
|
34
|
-
export class UserScoutAux extends UserScout {
|
|
35
|
-
|
|
34
|
+
// export class UserScoutAux extends UserScout {
|
|
35
|
+
// readonly scout : ScoutAux
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
// constructor(user_scout : any) {
|
|
38
|
+
// if (!UserScoutAux.is(user_scout)) {
|
|
39
|
+
// throw Error("Invalid input.")
|
|
40
|
+
// }
|
|
41
|
+
// super(user_scout)
|
|
42
|
+
// this.scout = user_scout.scout
|
|
43
|
+
// }
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
45
|
+
// static is(user_scout : any) : user_scout is UserScoutAux {
|
|
46
|
+
// return (
|
|
47
|
+
// UserScout.is(user_scout) &&
|
|
48
|
+
// ScoutAux.is(user_scout.scout)
|
|
49
|
+
// )
|
|
50
|
+
// }
|
|
51
|
+
// }
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { UserScoutConversationMessage } from "./UserScoutConversationMessage"
|
|
1
|
+
// import { UserScoutConversationMessage } from "./UserScoutConversationMessage"
|
|
2
2
|
|
|
3
|
-
export class UserScoutConversation {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
// export class UserScoutConversation {
|
|
4
|
+
// readonly user_scout_conversation_id : string
|
|
5
|
+
// readonly user_id : string
|
|
6
|
+
// readonly scout_id : string
|
|
7
|
+
// readonly conversation_id : string
|
|
8
|
+
// readonly user_scout_id : string
|
|
9
|
+
// readonly [x : string] : any
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
// constructor(user_scout_conversation : any) {
|
|
12
|
+
// if (!UserScoutConversation.is(user_scout_conversation)) {
|
|
13
|
+
// throw Error("Invalid input.")
|
|
14
|
+
// }
|
|
15
|
+
// this.user_scout_conversation_id = user_scout_conversation.user_scout_conversation_id
|
|
16
|
+
// this.user_id = user_scout_conversation.user_id
|
|
17
|
+
// this.scout_id = user_scout_conversation.scout_id
|
|
18
|
+
// this.conversation_id = user_scout_conversation.conversation_id
|
|
19
|
+
// this.user_scout_id = user_scout_conversation.user_scout_id
|
|
20
|
+
// }
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
22
|
+
// static is(user_scout_conversation : any) : user_scout_conversation is UserScoutConversation {
|
|
23
|
+
// return (
|
|
24
|
+
// user_scout_conversation !== undefined &&
|
|
25
|
+
// typeof user_scout_conversation.user_scout_conversation_id === "string" &&
|
|
26
|
+
// typeof user_scout_conversation.user_id === "string" &&
|
|
27
|
+
// typeof user_scout_conversation.scout_id === "string" &&
|
|
28
|
+
// typeof user_scout_conversation.conversation_id === "string" &&
|
|
29
|
+
// typeof user_scout_conversation.user_scout_id === "string"
|
|
30
|
+
// )
|
|
31
|
+
// }
|
|
32
|
+
// }
|
|
33
33
|
|
|
34
|
-
export class UserScoutConversationAux extends UserScoutConversation {
|
|
35
|
-
|
|
34
|
+
// export class UserScoutConversationAux extends UserScoutConversation {
|
|
35
|
+
// readonly messages : UserScoutConversationMessage[]
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
// constructor(user_scout_conversation : any) {
|
|
38
|
+
// if (!UserScoutConversationAux.is(user_scout_conversation)) {
|
|
39
|
+
// throw Error("Invalid input.")
|
|
40
|
+
// }
|
|
41
|
+
// super(user_scout_conversation)
|
|
42
|
+
// this.messages = user_scout_conversation.messages
|
|
43
|
+
// }
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
45
|
+
// static is(user_scout_conversation : any) : user_scout_conversation is UserScoutConversationAux {
|
|
46
|
+
// return (
|
|
47
|
+
// UserScoutConversation.is(user_scout_conversation) &&
|
|
48
|
+
// Array.isArray(user_scout_conversation.messages) && user_scout_conversation.messages.every(UserScoutConversationMessage.is)
|
|
49
|
+
// )
|
|
50
|
+
// }
|
|
51
|
+
// }
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { FragmentAux } from "../fragments/Fragment"
|
|
1
|
+
// import { FragmentAux } from "../fragments/Fragment"
|
|
2
2
|
|
|
3
|
-
const user_scout_conversation_role_ids = ["USER", "SCOUT"] as const
|
|
3
|
+
// const user_scout_conversation_role_ids = ["USER", "SCOUT"] as const
|
|
4
4
|
|
|
5
|
-
export type UserScoutConversationRoleID = typeof user_scout_conversation_role_ids[number]
|
|
5
|
+
// export type UserScoutConversationRoleID = typeof user_scout_conversation_role_ids[number]
|
|
6
6
|
|
|
7
|
-
export function is_user_scout_conversation_role_id(user_scout_conversation_role_id : any) : user_scout_conversation_role_id is UserScoutConversationRoleID {
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
// export function is_user_scout_conversation_role_id(user_scout_conversation_role_id : any) : user_scout_conversation_role_id is UserScoutConversationRoleID {
|
|
8
|
+
// return user_scout_conversation_role_ids.includes(user_scout_conversation_role_id)
|
|
9
|
+
// }
|
|
10
10
|
|
|
11
|
-
export class UserScoutConversationMessage {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
// export class UserScoutConversationMessage {
|
|
12
|
+
// readonly user_scout_conversation_message_id : string
|
|
13
|
+
// readonly user_id : string
|
|
14
|
+
// readonly scout_id : string
|
|
15
|
+
// readonly conversation_id : string
|
|
16
|
+
// readonly message_id : string
|
|
17
|
+
// readonly user_scout_id : string
|
|
18
|
+
// readonly user_scout_conversation_id : string
|
|
19
|
+
// readonly role_id : UserScoutConversationRoleID
|
|
20
|
+
// readonly system_prompt? : string
|
|
21
|
+
// readonly fragment_ids? : string[]
|
|
22
|
+
// readonly text : string
|
|
23
|
+
// readonly [x : string] : any
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
// constructor(user_scout_conversation_message : any) {
|
|
26
|
+
// if (!UserScoutConversationMessage.is(user_scout_conversation_message)) {
|
|
27
|
+
// throw Error("Invalid input.")
|
|
28
|
+
// }
|
|
29
|
+
// this.user_scout_conversation_message_id = user_scout_conversation_message.user_scout_conversation_message_id
|
|
30
|
+
// this.user_id = user_scout_conversation_message.user_id
|
|
31
|
+
// this.scout_id = user_scout_conversation_message.scout_id
|
|
32
|
+
// this.conversation_id = user_scout_conversation_message.conversation_id
|
|
33
|
+
// this.message_id = user_scout_conversation_message.message_id
|
|
34
|
+
// this.user_scout_id = user_scout_conversation_message.user_scout_id
|
|
35
|
+
// this.user_scout_conversation_id = user_scout_conversation_message.user_scout_conversation_id
|
|
36
|
+
// this.role_id = user_scout_conversation_message.role_id
|
|
37
|
+
// this.system_prompt = user_scout_conversation_message.system_prompt
|
|
38
|
+
// this.fragment_ids = user_scout_conversation_message.fragment_ids
|
|
39
|
+
// this.text = user_scout_conversation_message.text
|
|
40
|
+
// }
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
42
|
+
// static is(user_scout_conversation_message : any) : user_scout_conversation_message is UserScoutConversationMessage {
|
|
43
|
+
// return (
|
|
44
|
+
// user_scout_conversation_message !== undefined &&
|
|
45
|
+
// typeof user_scout_conversation_message.user_scout_conversation_message_id === "string" &&
|
|
46
|
+
// typeof user_scout_conversation_message.user_id === "string" &&
|
|
47
|
+
// typeof user_scout_conversation_message.scout_id === "string" &&
|
|
48
|
+
// typeof user_scout_conversation_message.conversation_id === "string" &&
|
|
49
|
+
// typeof user_scout_conversation_message.message_id === "string" &&
|
|
50
|
+
// typeof user_scout_conversation_message.user_scout_id === "string" &&
|
|
51
|
+
// typeof user_scout_conversation_message.user_scout_conversation_id === "string" &&
|
|
52
|
+
// is_user_scout_conversation_role_id(user_scout_conversation_message.role_id) &&
|
|
53
|
+
// (user_scout_conversation_message.system_prompt === undefined || typeof user_scout_conversation_message.system_prompt === "string") &&
|
|
54
|
+
// (user_scout_conversation_message.fragment_ids === undefined || Array.isArray(user_scout_conversation_message.fragment_ids) && user_scout_conversation_message.fragment_ids.every((fragment_id : any) => typeof fragment_id === "string")) &&
|
|
55
|
+
// typeof user_scout_conversation_message.text === "string"
|
|
56
|
+
// )
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
59
|
|
|
60
|
-
export class UserScoutConversationMessageAux extends UserScoutConversationMessage {
|
|
61
|
-
|
|
60
|
+
// export class UserScoutConversationMessageAux extends UserScoutConversationMessage {
|
|
61
|
+
// readonly fragments? : FragmentAux[]
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
// constructor(user_scout_conversation_message : any) {
|
|
64
|
+
// if (!UserScoutConversationMessageAux.is(user_scout_conversation_message)) {
|
|
65
|
+
// throw Error("Invalid input.")
|
|
66
|
+
// }
|
|
67
|
+
// super(user_scout_conversation_message)
|
|
68
|
+
// this.fragments = user_scout_conversation_message.fragments
|
|
69
|
+
// }
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
71
|
+
// static is(user_scout_conversation_message : any) : user_scout_conversation_message is UserScoutConversationMessageAux {
|
|
72
|
+
// return (
|
|
73
|
+
// UserScoutConversationMessage.is(user_scout_conversation_message) &&
|
|
74
|
+
// (user_scout_conversation_message.fragments === undefined || Array.isArray(user_scout_conversation_message.fragments) && user_scout_conversation_message.fragments.every(FragmentAux.is))
|
|
75
|
+
// )
|
|
76
|
+
// }
|
|
77
|
+
// }
|
|
@@ -2,6 +2,7 @@ import { TwitterUser } from "./TwitterUser"
|
|
|
2
2
|
|
|
3
3
|
export class TwitterUserTag {
|
|
4
4
|
readonly twitter_user_id : string
|
|
5
|
+
readonly tag_type_id : string
|
|
5
6
|
readonly tag_id : string
|
|
6
7
|
readonly [x : string] : any
|
|
7
8
|
|
|
@@ -10,6 +11,7 @@ export class TwitterUserTag {
|
|
|
10
11
|
throw Error("Invalid input.")
|
|
11
12
|
}
|
|
12
13
|
this.twitter_user_id = twitter_user_tag.twitter_user_id
|
|
14
|
+
this.tag_type_id = twitter_user_tag.tag_type_id
|
|
13
15
|
this.tag_id = twitter_user_tag.tag_id
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -17,6 +19,7 @@ export class TwitterUserTag {
|
|
|
17
19
|
return (
|
|
18
20
|
twitter_user_tag !== undefined &&
|
|
19
21
|
typeof twitter_user_tag.twitter_user_id === "string" &&
|
|
22
|
+
typeof twitter_user_tag.tag_type_id === "string" &&
|
|
20
23
|
typeof twitter_user_tag.tag_id === "string"
|
|
21
24
|
)
|
|
22
25
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
|
|
2
|
-
|
|
3
1
|
export class TenantDocument {
|
|
4
2
|
readonly tenant_document_id : string
|
|
5
3
|
readonly tenant_id : string
|
|
6
4
|
readonly file_suffix_id : string
|
|
7
5
|
readonly name : string
|
|
8
|
-
readonly fragment_type_id? :
|
|
6
|
+
readonly fragment_type_id? : string
|
|
9
7
|
readonly time : string
|
|
10
8
|
readonly s3_id : string
|
|
11
9
|
readonly s3_id_json? : string
|
|
@@ -34,7 +32,7 @@ export class TenantDocument {
|
|
|
34
32
|
typeof tenant_document.tenant_id === "string" &&
|
|
35
33
|
typeof tenant_document.file_suffix_id === "string" &&
|
|
36
34
|
typeof tenant_document.name === "string" &&
|
|
37
|
-
|
|
35
|
+
typeof tenant_document.fragment_type_id === "string" &&
|
|
38
36
|
typeof tenant_document.time === "string" &&
|
|
39
37
|
typeof tenant_document.s3_id === "string" &&
|
|
40
38
|
(tenant_document.s3_id_json === undefined || typeof tenant_document.s3_id_json === "string") &&
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
|
|
1
|
+
// import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
|
|
2
2
|
import { TenantDocument } from "./TenantDocument"
|
|
3
3
|
|
|
4
4
|
export class TenantDocumentFragment {
|
|
5
5
|
readonly tenant_document_id : string
|
|
6
6
|
readonly tenant_id : string
|
|
7
7
|
readonly fragment_id : string
|
|
8
|
-
readonly fragment_type_id :
|
|
8
|
+
readonly fragment_type_id : string
|
|
9
9
|
readonly max_size : number
|
|
10
10
|
readonly min_index : number
|
|
11
11
|
readonly max_index : number
|
|
@@ -36,7 +36,7 @@ export class TenantDocumentFragment {
|
|
|
36
36
|
typeof tenant_document_fragment.tenant_document_id === "string" &&
|
|
37
37
|
typeof tenant_document_fragment.tenant_id === "string" &&
|
|
38
38
|
typeof tenant_document_fragment.fragment_id === "string" &&
|
|
39
|
-
|
|
39
|
+
typeof tenant_document_fragment.fragment_type_id === "string" &&
|
|
40
40
|
typeof tenant_document_fragment.max_size === "number" &&
|
|
41
41
|
typeof tenant_document_fragment.min_index === "number" &&
|
|
42
42
|
typeof tenant_document_fragment.max_index === "number" &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const resource_type_ids = ["twitter_tweet", "youtube_video", "document", "scout", "prism", "
|
|
1
|
+
const resource_type_ids = ["twitter_tweet", "youtube_video", "document", "scout", "prism", "label", "target", "role", "user", "fragment_type", "palette"] as const
|
|
2
2
|
|
|
3
3
|
export type ResourceTypeID = typeof resource_type_ids[number]
|
|
4
4
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class TenantResourceTag {
|
|
2
|
+
readonly tenant_resource_id : string
|
|
3
|
+
readonly tenant_id : string
|
|
4
|
+
readonly tag_type_id : string
|
|
5
|
+
readonly tag_id : string
|
|
6
|
+
readonly [x : string] : any
|
|
7
|
+
|
|
8
|
+
constructor(tenant_resource_tag : TenantResourceTag) {
|
|
9
|
+
if (!TenantResourceTag.is(tenant_resource_tag)) {
|
|
10
|
+
throw Error("Invalid input.")
|
|
11
|
+
}
|
|
12
|
+
this.tenant_resource_id = tenant_resource_tag.tenant_resource_id
|
|
13
|
+
this.tenant_id = tenant_resource_tag.tenant_id
|
|
14
|
+
this.tag_type_id = tenant_resource_tag.tag_type_id
|
|
15
|
+
this.tag_id = tenant_resource_tag.tag_id
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static is(tenant_resource_tag : any) : tenant_resource_tag is TenantResourceTag {
|
|
19
|
+
return (
|
|
20
|
+
tenant_resource_tag !== undefined &&
|
|
21
|
+
typeof tenant_resource_tag.tenant_resource_id === "string" &&
|
|
22
|
+
typeof tenant_resource_tag.tenant_id === "string" &&
|
|
23
|
+
typeof tenant_resource_tag.tag_type_id === "string" &&
|
|
24
|
+
typeof tenant_resource_tag.tag_id === "string"
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
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") &&
|