scout-types 1.0.18 → 1.0.20
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.
|
@@ -3,7 +3,7 @@ export declare class Conversation {
|
|
|
3
3
|
readonly user_id: string;
|
|
4
4
|
readonly conversation_id: string;
|
|
5
5
|
readonly scout_id: string;
|
|
6
|
-
readonly
|
|
6
|
+
readonly create_time: string;
|
|
7
7
|
readonly [x: string]: any;
|
|
8
8
|
constructor(conversation: any);
|
|
9
9
|
static is(conversation: any): conversation is Conversation;
|
|
@@ -3,7 +3,7 @@ export class Conversation {
|
|
|
3
3
|
user_id;
|
|
4
4
|
conversation_id;
|
|
5
5
|
scout_id;
|
|
6
|
-
|
|
6
|
+
create_time;
|
|
7
7
|
constructor(conversation) {
|
|
8
8
|
if (!Conversation.is(conversation)) {
|
|
9
9
|
throw Error("Invalid input.");
|
|
@@ -11,14 +11,14 @@ export class Conversation {
|
|
|
11
11
|
this.user_id = conversation.user_id;
|
|
12
12
|
this.conversation_id = conversation.conversation_id;
|
|
13
13
|
this.scout_id = conversation.scout_id;
|
|
14
|
-
this.
|
|
14
|
+
this.create_time = conversation.create_time;
|
|
15
15
|
}
|
|
16
16
|
static is(conversation) {
|
|
17
17
|
return (conversation !== undefined &&
|
|
18
18
|
typeof conversation.user_id === "string" &&
|
|
19
19
|
typeof conversation.conversation_id === "string" &&
|
|
20
20
|
typeof conversation.scout_id === "string" &&
|
|
21
|
-
typeof conversation.
|
|
21
|
+
typeof conversation.create_time === "string");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
export class ConversationAux extends Conversation {
|
|
@@ -80,6 +80,6 @@ export class Message {
|
|
|
80
80
|
(message.fragments === undefined || Array.isArray(message.fragments) && message.fragments.every(Fragment.is)) &&
|
|
81
81
|
(message.sources === undefined || Sources.is(message.sources)) &&
|
|
82
82
|
typeof message.text === "string" &&
|
|
83
|
-
Attachment.is(message.attachment));
|
|
83
|
+
(message.attachment === undefined || Attachment.is(message.attachment)));
|
|
84
84
|
}
|
|
85
85
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ export class Conversation {
|
|
|
4
4
|
readonly user_id : string
|
|
5
5
|
readonly conversation_id : string
|
|
6
6
|
readonly scout_id : string
|
|
7
|
-
readonly
|
|
7
|
+
readonly create_time : string
|
|
8
8
|
readonly [x : string] : any
|
|
9
9
|
|
|
10
10
|
constructor(conversation : any) {
|
|
@@ -14,7 +14,7 @@ export class Conversation {
|
|
|
14
14
|
this.user_id = conversation.user_id
|
|
15
15
|
this.conversation_id = conversation.conversation_id
|
|
16
16
|
this.scout_id = conversation.scout_id
|
|
17
|
-
this.
|
|
17
|
+
this.create_time = conversation.create_time
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
static is(conversation : any) : conversation is Conversation {
|
|
@@ -23,7 +23,7 @@ export class Conversation {
|
|
|
23
23
|
typeof conversation.user_id === "string" &&
|
|
24
24
|
typeof conversation.conversation_id === "string" &&
|
|
25
25
|
typeof conversation.scout_id === "string" &&
|
|
26
|
-
typeof conversation.
|
|
26
|
+
typeof conversation.create_time === "string"
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/types/Message.ts
CHANGED
|
@@ -94,7 +94,7 @@ export class Message {
|
|
|
94
94
|
(message.fragments === undefined || Array.isArray(message.fragments) && message.fragments.every(Fragment.is)) &&
|
|
95
95
|
(message.sources === undefined || Sources.is(message.sources)) &&
|
|
96
96
|
typeof message.text === "string" &&
|
|
97
|
-
Attachment.is(message.attachment)
|
|
97
|
+
(message.attachment === undefined || Attachment.is(message.attachment))
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
100
|
}
|