/
typeDefs.graphql
143 lines (117 loc) · 3 KB
/
typeDefs.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
directive @auth on FIELD_DEFINITION
type Query {
insights: MessagingAPIInsight
# Current user's chatbot context
context: UserContext @auth
}
type MessagingAPIInsight {
"""
Ref: https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages
"""
messageDelivery(date: MessagingAPIDate!): MessagingAPIMessageDeliveryInsight
"""
Ref: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers
"""
followers(date: MessagingAPIDate!): MessagingAPIFollowersInsight
"""
Ref: https://developers.line.biz/en/reference/messaging-api/#get-demographic
"""
demographic(date: MessagingAPIDate!): MessaginAPIDemographicInsight
}
type MessagingAPIMessageDeliveryInsight {
status: MessagingAPIInsightStatus
broadcast: Int
targeting: Int
autoResponse: Int
welcomeResponse: Int
chat: Int
apiPush: Int
apiMulticast: Int
apiNarrowcast: Int
apiReply: Int
}
type MessagingAPIFollowersInsight {
status: MessagingAPIInsightStatus
followers: Int
targetedReaches: Int
blocks: Int
}
type MessaginAPIDemographicInsight {
available: Boolean
genders: [MessagingAPIInsightGenderStat]
ages: [MessagingAPIInsightAgeStat]
areas: [MessagingAPIInsightAreaStat]
appTypes: [MessagingAPIInsightAppTypeStat]
subscriptionPeriods: [MessagingAPIInsightSubscriptionStat]
}
type MessagingAPIInsightGenderStat {
"""
Raw string from Messaging API
Ref: https://developers.line.biz/en/reference/messaging-api/#response-28
"""
gender: String
percentage: Float
}
type MessagingAPIInsightAgeStat {
"""
Raw string from Messaging API
Ref: https://developers.line.biz/en/reference/messaging-api/#response-28
"""
age: String
# null when unknown
from: Int
# null for "from50" or unknown
to: Int
percentage: Float
}
type MessagingAPIInsightAreaStat {
"""
Raw string from Messaging API
Ref: https://developers.line.biz/en/reference/messaging-api/#response-28
"""
area: String
percentage: Float
}
type MessagingAPIInsightAppTypeStat {
"""
Raw string from Messaging API
Ref: https://developers.line.biz/en/reference/messaging-api/#response-28
"""
appType: String
percentage: Float
}
type MessagingAPIInsightSubscriptionStat {
"""
Raw string from Messaging API
Ref: https://developers.line.biz/en/reference/messaging-api/#response-28
"""
subscriptionPeriod: String
# null when unknown; -1 for over365days
withinDays: Int
percentage: Float
}
"""
Date format accepted by messaging API, in form of "yyyyMMdd".
Ref: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers
"""
scalar MessagingAPIDate
"""
1-1 mapping of status returned by Messaging API.
Ref: https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers
"""
enum MessagingAPIInsightStatus {
READY
UNREADY
OUT_OF_SERVICE
}
type UserContext {
state: String
issuedAt: Float
data: StateData
}
type StateData {
searchedText: String
selectedArticleId: ID
selectedArticleText: String
selectedReplyId: ID
}