/
account.go
223 lines (189 loc) · 8.75 KB
/
account.go
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package types
type AccountInfo interface {
GetUserId() string
GetFbId() string
GetUsername() string
GetName() string
GetAvatarURL() string
GetAvatarURLHD() string
GetBiography() string
GetExternalUrl() string
GetBusinessEmail() string
HasPhoneNumber() bool
IsPrivate() bool
}
type CurrentBusinessAccount struct {
BusinessAccountName any `json:"businessAccountName,omitempty"`
BusinessID any `json:"business_id,omitempty"`
BusinessPersonaID any `json:"business_persona_id,omitempty"`
BusinessProfilePicURL any `json:"business_profile_pic_url,omitempty"`
BusinessRole any `json:"business_role,omitempty"`
BusinessUserID any `json:"business_user_id,omitempty"`
Email any `json:"email,omitempty"`
EnterpriseProfilePicURL any `json:"enterprise_profile_pic_url,omitempty"`
ExpiryTime any `json:"expiry_time,omitempty"`
FirstName any `json:"first_name,omitempty"`
HasVerifiedEmail any `json:"has_verified_email,omitempty"`
IPPermission any `json:"ip_permission,omitempty"`
IsBusinessPerson bool `json:"isBusinessPerson,omitempty"`
IsEnterpriseBusiness bool `json:"isEnterpriseBusiness,omitempty"`
IsFacebookWorkAccount bool `json:"isFacebookWorkAccount,omitempty"`
IsInstagramBusinessPerson bool `json:"isInstagramBusinessPerson,omitempty"`
IsTwoFacNewFlow bool `json:"isTwoFacNewFlow,omitempty"`
IsUserOptInAccountSwitchInfraUpgrade bool `json:"isUserOptInAccountSwitchInfraUpgrade,omitempty"`
IsAdsFeatureLimited any `json:"is_ads_feature_limited,omitempty"`
IsBusinessBanhammered any `json:"is_business_banhammered,omitempty"`
LastName any `json:"last_name,omitempty"`
PermittedBusinessAccountTaskIds []any `json:"permitted_business_account_task_ids,omitempty"`
PersonalUserID string `json:"personal_user_id,omitempty"`
ShouldHideComponentsByUnsupportedFirstPartyTools bool `json:"shouldHideComponentsByUnsupportedFirstPartyTools,omitempty"`
ShouldShowAccountSwitchComponents bool `json:"shouldShowAccountSwitchComponents,omitempty"`
}
type MessengerWebInitData struct {
AccountKey string `json:"accountKey,omitempty"`
AppID int64 `json:"appId,omitempty"`
CryptoAuthToken CryptoAuthToken `json:"cryptoAuthToken,omitempty"`
LogoutToken string `json:"logoutToken,omitempty"`
SessionID string `json:"sessionId,omitempty"`
}
type CryptoAuthToken struct {
EncryptedSerializedCat string `json:"encrypted_serialized_cat,omitempty"`
ExpirationTimeInSeconds int `json:"expiration_time_in_seconds,omitempty"`
}
type LSD struct {
Token string `json:"token,omitempty"`
}
type IntlViewerContext struct {
Gender int `json:"GENDER,omitempty"`
RegionalLocale any `json:"regionalLocale,omitempty"`
}
type IntlCurrentLocale struct {
Code string `json:"code,omitempty"`
}
type DTSGInitData struct {
AsyncGetToken string `json:"async_get_token,omitempty"`
Token string `json:"token,omitempty"`
}
type DTSGInitialData struct {
Token string `json:"token,omitempty"`
}
type CurrentUserInitialData struct {
AccountID string `json:"ACCOUNT_ID,omitempty"`
AppID string `json:"APP_ID,omitempty"`
HasSecondaryBusinessPerson bool `json:"HAS_SECONDARY_BUSINESS_PERSON,omitempty"`
IsBusinessDomain bool `json:"IS_BUSINESS_DOMAIN,omitempty"`
IsBusinessPersonAccount bool `json:"IS_BUSINESS_PERSON_ACCOUNT,omitempty"`
IsDeactivatedAllowedOnMessenger bool `json:"IS_DEACTIVATED_ALLOWED_ON_MESSENGER,omitempty"`
IsFacebookWorkAccount bool `json:"IS_FACEBOOK_WORK_ACCOUNT,omitempty"`
IsMessengerCallGuestUser bool `json:"IS_MESSENGER_CALL_GUEST_USER,omitempty"`
IsMessengerOnlyUser bool `json:"IS_MESSENGER_ONLY_USER,omitempty"`
IsWorkroomsUser bool `json:"IS_WORKROOMS_USER,omitempty"`
IsWorkMessengerCallGuestUser bool `json:"IS_WORK_MESSENGER_CALL_GUEST_USER,omitempty"`
Name string `json:"NAME,omitempty"`
ShortName string `json:"SHORT_NAME,omitempty"`
UserID string `json:"USER_ID,omitempty"`
}
func (c *CurrentUserInitialData) GetBusinessEmail() string {
return "" // TO-DO
}
func (c *CurrentUserInitialData) GetUserId() string {
return c.UserID
}
func (c *CurrentUserInitialData) GetName() string {
return c.Name
}
func (c *CurrentUserInitialData) GetUsername() string {
return c.ShortName
}
func (c *CurrentUserInitialData) GetFbId() string {
return c.AccountID
}
func (c *CurrentUserInitialData) IsPrivate() bool {
return false // TO-DO
}
func (c *CurrentUserInitialData) GetAvatarURLHD() string {
return "" // TO-DO
}
func (c *CurrentUserInitialData) GetAvatarURL() string {
return "" // TO-DO
}
func (c *CurrentUserInitialData) GetBiography() string {
return "" // TO-DO
}
func (c *CurrentUserInitialData) HasPhoneNumber() bool {
return false // TO-DO
}
func (c *CurrentUserInitialData) GetExternalUrl() string {
return "" // TO-DO
}
type ViewerData struct {
Biography string `json:"biography,omitempty"`
BusinessAddressJSON any `json:"business_address_json,omitempty"`
BusinessContactMethod string `json:"business_contact_method,omitempty"`
BusinessEmail string `json:"business_email,omitempty"`
BusinessPhoneNumber any `json:"business_phone_number,omitempty"`
CanSeeOrganicInsights bool `json:"can_see_organic_insights,omitempty"`
CategoryName any `json:"category_name,omitempty"`
ExternalURL string `json:"external_url,omitempty"`
Fbid string `json:"fbid,omitempty"`
FullName string `json:"full_name,omitempty"`
HasPhoneNumber bool `json:"has_phone_number,omitempty"`
HasProfilePic bool `json:"has_profile_pic,omitempty"`
HasTabbedInbox bool `json:"has_tabbed_inbox,omitempty"`
HideLikeAndViewCounts bool `json:"hide_like_and_view_counts,omitempty"`
ID string `json:"id,omitempty"`
IsBusinessAccount bool `json:"is_business_account,omitempty"`
IsJoinedRecently bool `json:"is_joined_recently,omitempty"`
IsSupervisedUser bool `json:"is_supervised_user,omitempty"`
GuardianID any `json:"guardian_id,omitempty"`
IsPrivate bool `json:"is_private,omitempty"`
IsProfessionalAccount bool `json:"is_professional_account,omitempty"`
IsSupervisionEnabled bool `json:"is_supervision_enabled,omitempty"`
IsUserInCanada bool `json:"is_user_in_canada,omitempty"`
ProfilePicURL string `json:"profile_pic_url,omitempty"`
ProfilePicURLHd string `json:"profile_pic_url_hd,omitempty"`
ShouldShowCategory bool `json:"should_show_category,omitempty"`
ShouldShowPublicContacts bool `json:"should_show_public_contacts,omitempty"`
Username string `json:"username,omitempty"`
BadgeCount string `json:"badge_count,omitempty"`
IsBasicAdsOptedIn bool `json:"is_basic_ads_opted_in,omitempty"`
BasicAdsTier int `json:"basic_ads_tier,omitempty"`
ProbablyHasApp bool `json:"probably_has_app,omitempty"`
}
type PolarisViewer struct {
Data ViewerData `json:"data,omitempty"`
ID string `json:"id,omitempty"`
}
func (p *PolarisViewer) GetUserId() string {
return p.ID
}
func (p *PolarisViewer) GetUsername() string {
return p.Data.Username
}
func (p *PolarisViewer) GetName() string {
return p.Data.FullName
}
func (p *PolarisViewer) GetFbId() string {
return p.Data.Fbid
}
func (p *PolarisViewer) GetAvatarURLHD() string {
return p.Data.ProfilePicURLHd
}
func (p *PolarisViewer) GetAvatarURL() string {
return p.Data.ProfilePicURL
}
func (p *PolarisViewer) GetBiography() string {
return p.Data.Biography
}
func (p *PolarisViewer) GetExternalUrl() string {
return p.Data.ExternalURL
}
func (p *PolarisViewer) IsPrivate() bool {
return p.Data.IsPrivate
}
func (p *PolarisViewer) HasPhoneNumber() bool {
return p.Data.HasPhoneNumber
}
func (p *PolarisViewer) GetBusinessEmail() string {
return p.Data.BusinessEmail
}