Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | /**
* This file holds relevant information about the resources used by this application
*/
import {iCPSAppOptions} from "../../app/factory.js";
import { PushSubscription } from "./web-server-types.js";
/**
* File encoding for all text based files written by this application
*/
export const FILE_ENCODING = `utf8`;
/**
* Filename for library lock file located in DATA_DIR
*/
export const LIBRARY_LOCK_FILE_NAME = `.library.lock`;
/**
* Content of the library lock file, identifying the process holding the lock
* Lock files of previous versions only contain the process id
*/
export type LibraryLockOwner = {
/**
* Uniquely identifies the process holding the lock - process ids are not unique across containers
*/
instance?: string,
/**
* The process id of the process holding the lock
*/
pid: number,
/**
* The hostname of the host (or container) running the process holding the lock
*/
hostname?: string,
}
/**
* Filename of the resource file
*/
export const RESOURCE_FILE_NAME = `.icloud-photos-sync`;
/**
* The name of the log file
*/
export const LOG_FILE_NAME = `.icloud-photos-sync.log`;
/**
* The name of the metrics file
*/
export const METRICS_FILE_NAME = `.icloud-photos-sync.metrics`;
/**
* The name of the HAR file generated by the network capture
*/
export const HAR_FILE_NAME = `.icloud-photos-sync.har`;
/**
* Resources held by the resource manager
*/
export type iCPSResources = ResourceFile
& iCPSAppOptions
& PhotosAccount
& NetworkResources;
/**
* Persistent information, stored in a resource file
*/
export type ResourceFile = {
/**
* The library version of the currently present library
* @minimum 1
* @default 1
*/
libraryVersion: number,
/**
* The currently used trust token
*/
trustToken?: string,
/**
* The notification vapid credentials used to send push notifications
*/
notificationVapidCredentials?: {
publicKey: string,
privateKey: string
},
/**
* The active notification subscriptions with the server.
* This is used to send notifications to the client when the state changes
*/
notificationSubscriptions?: {
[endpoint: string]: PushSubscription
},
/**
* A random identifier of this installation, used as the `guid` attribute of crash reports.
* Generated on first use, so it stays stable across restarts and container re-creations.
*/
crashReportingGuid?: string
}
/**
* Non persistent network resources, required to access the iCloud API
*/
type NetworkResources = {
/**
* Session secret, either acquired on successful sign in, or after trusting the device
*/
sessionSecret?: string,
}
/**
* Information to interact with the iCloud Photos backend
*/
type PhotosAccount = {
/**
* The primary photos library zone
*/
primaryZone?: PhotosAccountZone,
/**
* The shared photos library zone
*/
sharedZone?: PhotosAccountZone
}
/**
* Information about photos library zones
*/
export type PhotosAccountZone = {
/**
* The zone name, either PrimarySync or SharedSync-<UUID>
*/
zoneName: string,
/**
* The zone type, usually REGULAR_CUSTOM_ZONE
*/
zoneType: string,
/**
* The owner name, usually _<UUID>
*/
ownerRecordName: string,
/**
* The zone area, either private or shared
*/
area: ZoneArea
}
/**
* Indicates if a photos account zone is owned by the current user or shared
*/
export type ZoneArea = `PRIVATE` | `SHARED` |