Skip to content

lib.resources.resource manager.ResourceManager

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

Class: ResourceManager

lib/resources/resource-manager.ResourceManager

This class handles access to the .icloud-photos-sync resource file and handles currently applied configurations from the CLI and environment variables

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ResourceManager(appOptions)

Creates the resource manager, based on the previously parsed iCPSAppOptions. Should not be called directly, but through the static setup function.

Parameters

Name Type Description
appOptions iCPSAppOptions The parsed app options

Defined in

lib/resources/resource-manager.ts:27

Properties

_resources

_resources: iCPSResources

The shared resources held by this instances of the icps application

Defined in

lib/resources/resource-manager.ts:20

Accessors

dataDir

get dataDir(): string

Returns

string

The data dir read from the CLI Options

Defined in

lib/resources/resource-manager.ts:80


downloadThreads

get downloadThreads(): number

Returns

number

The number of threads to use for downloading

Defined in

lib/resources/resource-manager.ts:193


enableCrashReporting

get enableCrashReporting(): boolean

Returns

boolean

If the application should enable crash reporting

Defined in

lib/resources/resource-manager.ts:207


enableNetworkCapture

get enableNetworkCapture(): boolean

Returns

boolean

If the application should capture network traffic

Defined in

lib/resources/resource-manager.ts:277


exportMetrics

get exportMetrics(): boolean

Returns

boolean

If the application should export metrics

Defined in

lib/resources/resource-manager.ts:263


failOnMfa

get failOnMfa(): boolean

Returns

boolean

If the application should fail on MFA requirement

Defined in

lib/resources/resource-manager.ts:214


force

get force(): boolean

Returns

boolean

If an existing library lock should be forcefully removed

Defined in

lib/resources/resource-manager.ts:221


harFilePath

get harFilePath(): string

Returns

string

The path to the har file

Defined in

lib/resources/resource-manager.ts:127


legacyLogin

get legacyLogin(): boolean

Returns

boolean

True if legacy login should be used, false otherwise

Defined in

lib/resources/resource-manager.ts:358


libraryVersion

get libraryVersion(): number

Even though present in the resource file, this will only be loaded once and not re-read

Returns

number

The currently loaded libraries version

Defined in

lib/resources/resource-manager.ts:138


lockFilePath

get lockFilePath(): string

Returns

string

The path to the library lock file

Defined in

lib/resources/resource-manager.ts:107


logFilePath

get logFilePath(): string

Returns

string

The path to the log file

Defined in

lib/resources/resource-manager.ts:97


logLevel

get logLevel(): LogLevel

Returns

LogLevel

The log level of the application

Defined in

lib/resources/resource-manager.ts:235


logToCli

get logToCli(): boolean

Returns

boolean

If the application should log to the CLI

Defined in

lib/resources/resource-manager.ts:249


maxRetries

get maxRetries(): number

Returns

number

The number of retries to use for downloading

Defined in

lib/resources/resource-manager.ts:186


metadataRate

get metadataRate(): [number, number]

Returns

[number, number]

The rate at which the metadata should be downloaded

Defined in

lib/resources/resource-manager.ts:270


metricsFilePath

get metricsFilePath(): string

Returns

string

The path to the metrics file

Defined in

lib/resources/resource-manager.ts:117


mfaServerPort

get mfaServerPort(): number

Returns

number

The port to use for the MFA server

Defined in

lib/resources/resource-manager.ts:179


password

get password(): string

Returns

string

The iCloud user password

Defined in

lib/resources/resource-manager.ts:172


primaryZone

get primaryZone(): PhotosAccountZone

Returns

PhotosAccountZone

The primary zone of the account

Throws

If no primary zone is set

Defined in

lib/resources/resource-manager.ts:312

set primaryZone(primaryZone): void

Sets the primary zone of the account

Parameters

Name Type Description
primaryZone PhotosAccountZone The primary zone to set

Returns

void

Defined in

lib/resources/resource-manager.ts:324


region

get region(): Region

Returns

Region

The region to be used for this app

Defined in

lib/resources/resource-manager.ts:284


remoteDelete

get remoteDelete(): boolean

Returns

boolean

If the application should delete remote files

Defined in

lib/resources/resource-manager.ts:228


resourceFilePath

get resourceFilePath(): string

Returns

string

The path to the resource file

Defined in

lib/resources/resource-manager.ts:87


schedule

get schedule(): string

Returns

string

The schedule of the application

Defined in

lib/resources/resource-manager.ts:200


sessionSecret

get sessionSecret(): string

Returns

string

The session secret of the account

Throws

If no session secret is set

Defined in

lib/resources/resource-manager.ts:292

set sessionSecret(sessionSecret): void

Sets the session secret of the account

Parameters

Name Type Description
sessionSecret string The session secret to set

Returns

void

Defined in

lib/resources/resource-manager.ts:304


sharedZone

get sharedZone(): PhotosAccountZone

Returns

PhotosAccountZone

The shared zone of the account

Throws

If no shared zone is set

Defined in

lib/resources/resource-manager.ts:332

set sharedZone(sharedZone): void

Sets the shared zone of the account

Parameters

Name Type
sharedZone PhotosAccountZone

Returns

void

Defined in

lib/resources/resource-manager.ts:344


sharedZoneAvailable

get sharedZoneAvailable(): boolean

Returns

boolean

If the shared zone is available

Defined in

lib/resources/resource-manager.ts:351


silent

get silent(): boolean

Returns

boolean

If the application should run in silent mode

Defined in

lib/resources/resource-manager.ts:242


suppressWarnings

get suppressWarnings(): boolean

Returns

boolean

If the application should suppress warnings

Defined in

lib/resources/resource-manager.ts:256


trustToken

get trustToken(): string

This will always read the resource file for the most recently trust token and update the internal data structure

Returns

string

The currently used trust token, or undefined if none is set.

Defined in

lib/resources/resource-manager.ts:146

set trustToken(trustToken): void

Sets the trust token and syncs the resource file.

Parameters

Name Type Description
trustToken string The trust token to use

Returns

void

Defined in

lib/resources/resource-manager.ts:157


username

get username(): string

Returns

string

The iCloud username

Defined in

lib/resources/resource-manager.ts:165

Methods

_readResourceFile

_readResourceFile(): ResourceFile

Reads the resource file from disk and parses it

Returns

ResourceFile

Defined in

lib/resources/resource-manager.ts:43


_writeResourceFile

_writeResourceFile(): void

Writes the resources to the resource file

Returns

void

Defined in

lib/resources/resource-manager.ts:61

Clone this wiki locally