Skip to content

lib.resources.network types

github-actions[bot] edited this page Oct 16, 2023 · 2 revisions

Module: lib/resources/network-types

Table of contents

Type Aliases

Variables

Type Aliases

PCSResponse

Ƭ PCSResponse: Object

The expected response when trying to acquire PCS cookies

Type declaration

Name Type
data { deviceConsentForPCSExpiry: number ; isDeviceConsentedForPCS: true ; isWebAccessAllowed: true ; message: "Cookies attached." | "Cookies already present." ; status: "success" }
data.deviceConsentForPCSExpiry number
data.isDeviceConsentedForPCS true
data.isWebAccessAllowed true
data.message "Cookies attached." | "Cookies already present."
data.status "success"
headers { set-cookie: string[] }
headers.set-cookie string[]

Defined in

lib/resources/network-types.ts:338


PhotosSetupResponse

Ƭ PhotosSetupResponse: Object

The expected response format for the photos setup request

Type declaration

Name Type
data { moreComing: false ; syncToken: string ; zones: PhotosSetupResponseZone[] }
data.moreComing false
data.syncToken string
data.zones PhotosSetupResponseZone[]

Defined in

lib/resources/network-types.ts:373


ResendMFADeviceResponse

Ƭ ResendMFADeviceResponse: Object

The expected response format for the MFA resend request on a trusted device

See

ENDPOINTS.AUTH.PATH.MFA.DEVICE_RESEND

Type declaration

Name Type
data { phoneNumberVerification: PhoneNumberVerification ; securityCode: SecurityCodeFormat ; trustedDeviceCount: number }
data.phoneNumberVerification PhoneNumberVerification
data.securityCode SecurityCodeFormat
data.trustedDeviceCount number

Defined in

lib/resources/network-types.ts:193


ResendMFAPhoneResponse

Ƭ ResendMFAPhoneResponse: Object

The expected response format for the MFA resend request on a trusted phone number

See

ENDPOINTS.AUTH.PATH.MFA.PHONE_RESEND

Type declaration

Name Type
data PhoneNumberVerification

Defined in

lib/resources/network-types.ts:215


SRPProtocol

Ƭ SRPProtocol: "s2k" | "s2k_fo"

Currently supported SRP password hashing protocols

Defined in

lib/resources/network-types.ts:148


SetupResponse

Ƭ SetupResponse: Object

The expected response format for the account setup request

See

ENDPOINTS.SETUP.PATH.ACCOUNT

Type declaration

Name Type
data { dsInfo: { isWebAccessAllowed: true } ; webservices: { ckdatabasews: { pcsRequired?: boolean ; status: "active" ; url: string } } }
data.dsInfo { isWebAccessAllowed: true }
data.dsInfo.isWebAccessAllowed true
data.webservices { ckdatabasews: { pcsRequired?: boolean ; status: "active" ; url: string } }
data.webservices.ckdatabasews { pcsRequired?: boolean ; status: "active" ; url: string }
data.webservices.ckdatabasews.pcsRequired? boolean
data.webservices.ckdatabasews.status "active"
data.webservices.ckdatabasews.url string
headers { set-cookie: string[] }
headers.set-cookie string[]

Defined in

lib/resources/network-types.ts:295


SigninInitResponse

Ƭ SigninInitResponse: Object

The expected response format for the signin init request

See

ENDPOINTS.AUTH.PATH.SIGNIN.INIT

Type declaration

Name Type
data { b: string ; c: string ; iteration: number ; protocol: SRPProtocol ; salt: string }
data.b string
data.c string
data.iteration number
data.protocol SRPProtocol
data.salt string
headers { scnt: string }
headers.scnt string

Defined in

lib/resources/network-types.ts:154


SigninResponse

Ƭ SigninResponse: Object

The expected response format for the signin request

See

Type declaration

Name Type Description
data { authType: "hsa2" } Data should be irrelevant for this one
data.authType "hsa2" -
headers { scnt: string ; set-cookie: string[] ; x-apple-session-token: string } -
headers.scnt string Scnt token - required to keep track of MFA request 1
headers.set-cookie string[] Should hold the 'aasp' cookie 1
headers.x-apple-session-token string Session secret - required to keep track of MFA request 1

Defined in

lib/resources/network-types.ts:119


TrustResponse

Ƭ TrustResponse: Object

The expected response format for the device trust request

See

ENDPOINTS.AUTH.PATH.TRUST

Type declaration

Name Type
headers { x-apple-session-token: string ; x-apple-twosv-trust-token: string }
headers.x-apple-session-token string
headers.x-apple-twosv-trust-token string

Defined in

lib/resources/network-types.ts:276

Variables

CLIENT_ID

Const CLIENT_ID: "d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d"

Hard coded client id, extracted from previous requests

Defined in

lib/resources/network-types.ts:11


CLIENT_INFO

Const CLIENT_INFO: string

Client information shared with the iCloud backend based on the user agent

Defined in

lib/resources/network-types.ts:21


COOKIE_KEYS

Const COOKIE_KEYS: Object

Keys for dynamic cookie values

Type declaration

Name Type
AASP string
PCS_PHOTOS string
PCS_SHARING string
X_APPLE string

Defined in

lib/resources/network-types.ts:41


ENDPOINTS

Const ENDPOINTS: Object

List of endpoints used in this application

Type declaration

Name Type Description
AUTH { BASE: string ; PATH: { MFA: { DEVICE_ENTER: string ; DEVICE_RESEND: string ; PHONE_ENTER: string ; PHONE_RESEND: string } ; SIGNIN: { COMPLETE: string ; INIT: string ; LEGACY: string } ; TRUST: string } } Authentication endpoints needed to acquire the session secret and two trust token
AUTH.BASE string -
AUTH.PATH { MFA: { DEVICE_ENTER: string ; DEVICE_RESEND: string ; PHONE_ENTER: string ; PHONE_RESEND: string } ; SIGNIN: { COMPLETE: string ; INIT: string ; LEGACY: string } ; TRUST: string } -
AUTH.PATH.MFA { DEVICE_ENTER: string ; DEVICE_RESEND: string ; PHONE_ENTER: string ; PHONE_RESEND: string } -
AUTH.PATH.MFA.DEVICE_ENTER string -
AUTH.PATH.MFA.DEVICE_RESEND string -
AUTH.PATH.MFA.PHONE_ENTER string -
AUTH.PATH.MFA.PHONE_RESEND string -
AUTH.PATH.SIGNIN { COMPLETE: string ; INIT: string ; LEGACY: string } -
AUTH.PATH.SIGNIN.COMPLETE string -
AUTH.PATH.SIGNIN.INIT string -
AUTH.PATH.SIGNIN.LEGACY string -
AUTH.PATH.TRUST string -
PHOTOS { BASE_PATH: string ; PATH: { MODIFY: string ; QUERY: string ; ZONES: string } } Photos endpoints needed to access the photos library
PHOTOS.BASE_PATH string Base URL for photos requests is dynamic - the path is static
PHOTOS.PATH { MODIFY: string ; QUERY: string ; ZONES: string } -
PHOTOS.PATH.MODIFY string -
PHOTOS.PATH.QUERY string -
PHOTOS.PATH.ZONES string -
SETUP { PATH: { ACCOUNT_LOGIN: string ; REQUEST_PCS: string } ; BASE: () => string } Setup endpoints needed to acquire cookies and Photos URL
SETUP.PATH { ACCOUNT_LOGIN: string ; REQUEST_PCS: string } -
SETUP.PATH.ACCOUNT_LOGIN string -
SETUP.PATH.REQUEST_PCS string -
SETUP.BASE [object Object] -

Defined in

lib/resources/network-types.ts:51


HEADER_KEYS

Const HEADER_KEYS: Object

Keys for dynamic header values

Type declaration

Name Type
COOKIE string
SCNT string
SESSION_ID string

Defined in

lib/resources/network-types.ts:32


USER_AGENT

Const USER_AGENT: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0"

User Agent this CLI is using. Emulating a Firefox Browser

Defined in

lib/resources/network-types.ts:16

Clone this wiki locally