Documentation
¶
Index ¶
- Constants
- Variables
- type AuthCompleteReq
- type AuthInitReq
- type AuthInitResp
- type BIMI
- type Client
- func (c *Client) DeactivateHME(anonymousId string) (bool, error)
- func (c *Client) DeleteHME(anonymousId string) (bool, error)
- func (c *Client) DeleteMail(uid string) (bool, error)
- func (c *Client) DraftMail(fromEmail, toEmail, subject, textBody, body string) (string, error)
- func (c *Client) GetMessage(uid string) (Message, error)
- func (c *Client) GetMessageMetadata(threadId string) (MessageMetadata, error)
- func (c *Client) Login() error
- func (c *Client) ReactivateHME(anonymousId string) (bool, error)
- func (c *Client) ReserveHME(label, note string) (string, error)
- func (c *Client) RetrieveHMEList() ([]HmeEmail, error)
- func (c *Client) RetrieveMailInbox(maxResults, beforeTs int) (MailInboxResp, error)
- func (c *Client) SendDraft(uid string) (bool, error)
- type HMEListResp
- type HmeEmail
- type MailDraftReq
- type MailInboxResp
- type Message
- type MessageMetadata
- type MsgPart
- type Params
- type Part
- type PhoneNumberID
- type Result
- type SMIME
- type SecurityCode
- type ServiceError
- type SessionHeaders
- type Thread
- type TwoFactorCodeFromPhoneRequest
Constants ¶
const ( ProtocolVersion = "QH5B2" OAuthClientID = "d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d" )
const ( HdrContentType = "Content-Type" HdrXRequestedWith = "X-Requested-With" HdrXAppleWidgetKey = "X-Apple-Widget-Key" HdrAccept = "Accept" HdrXAppleIDSessionID = "X-Apple-ID-Session-Id" HdrScnt = "scnt" )
Variables ¶
var ( ErrIncorrectUsernamePassword = errors.New("incorrect username or password") ErrRequiredPrivacyAck = errors.New("sign in to https://appleid.apple.com and acknowledge the Apple ID and Privacy agreement") ErrUnexpectedSigninResponse = errors.New("unexpected sign in response") ErrNotImplemented = errors.New("not implemented") ErrSeverErrorOrInvalidCreds = errors.New("apple server error or invalid credentials") )
Functions ¶
This section is empty.
Types ¶
type AuthCompleteReq ¶
type AuthInitReq ¶
type AuthInitResp ¶
type Client ¶
type Client struct { HttpClient tls_client.HttpClient OtpChannel chan string Username string Password string // contains filtered or unexported fields }
func (*Client) DeactivateHME ¶
* DeactivateHME() Deactivates an HME from the user's account, using the given anonymousId. Can be reactivated later
func (*Client) DeleteHME ¶
* DeleteHME() Deletes an HME from the user's account, using the given anonymousId. Can not be recovered later
func (*Client) DeleteMail ¶
* DeleteMail() deletes an email from the user's inbox using the uid
func (*Client) DraftMail ¶
* DraftMail() drafts and saves an email to the user's draft folder. fromName is the name of the sender, fromEmail is the email of the sender, toName is the name of the recipient, toEmail is the email of the recipient, subject is the subject of the email, textBody is the text body of the email, body is the full html body of the email
func (*Client) GetMessage ¶
* GetMessage() retrieves the message from the user's inbox using the uid, and returns the full body html of the email
func (*Client) GetMessageMetadata ¶
func (c *Client) GetMessageMetadata(threadId string) (MessageMetadata, error)
* GetMessage() retrieves the message metadata from the user's inbox using the threadId
func (*Client) Login ¶
* Login() logs in to iCloud and authenticates the user to access any iCloud web app/service
func (*Client) ReactivateHME ¶
* ReactivateHME() Reactivates an HME for a user's account, using the given anonymousId
func (*Client) ReserveHME ¶
* ReserveHME() Generates a new HME and reserves it, if successful it returns the email to user
func (*Client) RetrieveHMEList ¶
* RetrieveHMEList() Retrieves a list of HMEs from the user's account
func (*Client) RetrieveMailInbox ¶
func (c *Client) RetrieveMailInbox(maxResults, beforeTs int) (MailInboxResp, error)
* RetrieveMailInbox() retrieves the user's inbox from their iCloud account, maxResults is the maximum number of emails to retrieve, beforeTs is the timestamp to retrieve emails before
type HMEListResp ¶
type HmeEmail ¶
type HmeEmail struct { Origin string `json:"origin"` AnonymousID string `json:"anonymousId"` Domain string `json:"domain"` ForwardToEmail string `json:"forwardToEmail"` Hme string `json:"hme"` Label string `json:"label"` Note string `json:"note"` CreateTimestamp int64 `json:"createTimestamp"` IsActive bool `json:"isActive"` RecipientMailID string `json:"recipientMailId"` OriginAppName string `json:"originAppName,omitempty"` AppBundleID string `json:"appBundleId,omitempty"` }
type MailDraftReq ¶
type MailInboxResp ¶
type MailInboxResp struct { TotalThreadsReturned int `json:"totalThreadsReturned"` ThreadList []Thread `json:"threadList"` SessionHeaders SessionHeaders `json:"sessionHeaders"` Events []any `json:"events"` }
type Message ¶
type Message struct { GUID string `json:"guid"` LongHeader string `json:"longHeader"` To []string `json:"to"` From []string `json:"from"` Cc []string `json:"cc"` Bcc []string `json:"bcc"` ContentType string `json:"contentType"` Bimi BIMI `json:"bimi"` Smime SMIME `json:"smime"` Parts []MsgPart `json:"parts"` SessionHeaders SessionHeaders `json:"sessionHeaders"` Events []any `json:"events"` }
type MessageMetadata ¶
type MessageMetadata struct { UID string `json:"uid"` Date int64 `json:"date"` Size int `json:"size"` Folder string `json:"folder"` Modseq int64 `json:"modseq"` Flags []any `json:"flags"` SentDate string `json:"sentDate"` Subject string `json:"subject"` From []string `json:"from"` To []string `json:"to"` Cc []any `json:"cc"` Bcc []any `json:"bcc"` Bimi BIMI `json:"bimi"` Smime SMIME `json:"smime"` MessageID string `json:"messageId"` Parts []Part `json:"parts"` }
type PhoneNumberID ¶
type PhoneNumberID struct {
ID int `json:"id"`
}
type SecurityCode ¶
type SecurityCode struct {
Code string `json:"code"`
}
type ServiceError ¶
type ServiceError struct { Code string `json:"code,omitempty"` Title string `json:"title,omitempty"` Message string `json:"message,omitempty"` }
ServiceError represents a Apple service error.
type SessionHeaders ¶
type Thread ¶
type Thread struct { JSONType string `json:"jsonType"` ThreadID string `json:"threadId"` Timestamp int64 `json:"timestamp"` Count int `json:"count"` FolderMessageCount int `json:"folderMessageCount"` Flags []string `json:"flags"` Senders []string `json:"senders"` Subject string `json:"subject"` Preview string `json:"preview"` Modseq int64 `json:"modseq"` }
type TwoFactorCodeFromPhoneRequest ¶
type TwoFactorCodeFromPhoneRequest struct { SecurityCode *SecurityCode `json:"securityCode,omitempty"` PhoneNumber *PhoneNumberID `json:"phoneNumber,omitempty"` Mode string `json:"mode,omitempty"` }