@fkn/lib/cloud/fs
Classes
Section titled “Classes”StorageLockedError
Section titled “StorageLockedError”Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StorageLockedError(): StorageLockedError;Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”code: string = 'FKN_E2E_LOCKED';StorageNotFoundError
Section titled “StorageNotFoundError”There is no object at this path. Test err.code === STORAGE_NOT_FOUND, never the message: absence
is worded differently by the presign (“Not found”) and by the object fetch (“storage: read failed
(404)”).
“There is nothing here” is safe to overwrite; “I could not tell you” is not, and a caller that confuses them either never writes a first backup or destroys a real one.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StorageNotFoundError(message?): StorageNotFoundError;Parameters
Section titled “Parameters”message?
Section titled “message?”string = 'storage: no object at that path'
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”code: string = STORAGE_NOT_FOUND;Type Aliases
Section titled “Type Aliases”CloudAvailability
Section titled “CloudAvailability”type CloudAvailability = "connected" | "disconnected" | "unknown";EncryptionStatus
Section titled “EncryptionStatus”type EncryptionStatus = object;Properties
Section titled “Properties”enrolled
Section titled “enrolled”enrolled: boolean;keyEpoch
Section titled “keyEpoch”keyEpoch: number | null;unlocked
Section titled “unlocked”unlocked: boolean;FileEntry
Section titled “FileEntry”type FileEntry = object;Properties
Section titled “Properties”contentType
Section titled “contentType”contentType: string | null;encryption
Section titled “encryption”encryption: string | null;path: string;size: number;updatedAt
Section titled “updatedAt”updatedAt: string;StorageQuota
Section titled “StorageQuota”type StorageQuota = object;Properties
Section titled “Properties”limitBytes
Section titled “limitBytes”limitBytes: number;maxObjects
Section titled “maxObjects”maxObjects: number;objects
Section titled “objects”objects: number;remaining
Section titled “remaining”remaining: number;usedBytes
Section titled “usedBytes”usedBytes: number;Variables
Section titled “Variables”available
Section titled “available”available: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
mkdir: (path, a, b?) => void;Parameters
Section titled “Parameters”PathLike
MakeOptions | Callback<void>
Callback<void>
Returns
Section titled “Returns”void
promises
Section titled “promises”promises: object;Type Declaration
Section titled “Type Declaration”access
Section titled “access”access: (path) => Promise<void>;Parameters
Section titled “Parameters”PathLike
Returns
Section titled “Returns”Promise<void>
lstat: (path) => Promise<Stats> = stat;Parameters
Section titled “Parameters”PathLike
Returns
Section titled “Returns”mkdir: (_path?, _options?) => Promise<void>;Parameters
Section titled “Parameters”_path?
Section titled “_path?”PathLike
_options?
Section titled “_options?”MakeOptions
Returns
Section titled “Returns”Promise<void>
readdir
Section titled “readdir”readdir: (path) => Promise<string[]>;Parameters
Section titled “Parameters”PathLike
Returns
Section titled “Returns”Promise<string[]>
readFile
Section titled “readFile”readFile: (path, options?) => Promise<string | Buffer<ArrayBufferLike>>;Parameters
Section titled “Parameters”PathLike
options?
Section titled “options?”ReadOptions
Returns
Section titled “Returns”Promise<string | Buffer<ArrayBufferLike>>
rename
Section titled “rename”rename: (from, to) => Promise<void>;Parameters
Section titled “Parameters”PathLike
PathLike
Returns
Section titled “Returns”Promise<void>
rm: (path, options?) => Promise<void>;Parameters
Section titled “Parameters”PathLike
options?
Section titled “options?”recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”Promise<void>
rmdir: (path, options?) => Promise<void> = rm;Parameters
Section titled “Parameters”PathLike
options?
Section titled “options?”recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”Promise<void>
stat: (path) => Promise<Stats>;Parameters
Section titled “Parameters”PathLike
Returns
Section titled “Returns”unlink
Section titled “unlink”unlink: (path) => Promise<void>;Parameters
Section titled “Parameters”PathLike
Returns
Section titled “Returns”Promise<void>
writeFile
Section titled “writeFile”writeFile: (path, data, options?) => Promise<void>;Parameters
Section titled “Parameters”PathLike
options?
Section titled “options?”WriteOptions
Returns
Section titled “Returns”Promise<void>
readdir
Section titled “readdir”readdir: (path, a, b?) => void;Parameters
Section titled “Parameters”PathLike
unknown
Callback<string[]>
Returns
Section titled “Returns”void
readFile
Section titled “readFile”readFile: (path, a, b?) => void;Parameters
Section titled “Parameters”PathLike
ReadOptions | Callback<string | Buffer<ArrayBufferLike>>
Callback<string | Buffer<ArrayBufferLike>>
Returns
Section titled “Returns”void
rename
Section titled “rename”rename: (from, to, callback) => void;Parameters
Section titled “Parameters”PathLike
PathLike
callback
Section titled “callback”Callback<void>
Returns
Section titled “Returns”void
rm: (path, a, b?) => void;Parameters
Section titled “Parameters”PathLike
| Callback<void>
| {
recursive?: boolean;
}
Callback<void>
Returns
Section titled “Returns”void
stat: (path, callback) => void;Parameters
Section titled “Parameters”PathLike
callback
Section titled “callback”Callback<Stats>
Returns
Section titled “Returns”void
unlink
Section titled “unlink”unlink: (path, callback) => void;Parameters
Section titled “Parameters”PathLike
callback
Section titled “callback”Callback<void>
Returns
Section titled “Returns”void
writeFile
Section titled “writeFile”writeFile: (path, data, a, b?) => void;Parameters
Section titled “Parameters”PathLike
WriteOptions | Callback<void>
Callback<void>
Returns
Section titled “Returns”void
Functions
Section titled “Functions”availability()
Section titled “availability()”function availability(): Promise<CloudAvailability>;Whether the cloud half is backed by an account, as three answers rather than two: ‘disconnected’ is an ANSWER (signed out, or the api refusing the stored token), ‘unknown’ means nobody could be asked, including a broker that never came up. Always settles within the probe deadline. A caller owing data to the cloud may drop that obligation only on ‘disconnected’; treating ‘unknown’ the same silently loses the write.
Returns
Section titled “Returns”encryption()
Section titled “encryption()”function encryption(): Promise<EncryptionStatus>;Returns
Section titled “Returns”isNotFound()
Section titled “isNotFound()”function isNotFound(error): boolean;Whether an error from this module means the path is empty, as opposed to unreadable.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean
list()
Section titled “list()”function list(): Promise<FileEntry[]>;Every object of this app in the account, with the server’s stamps.
Returns
Section titled “Returns”quota()
Section titled “quota()”function quota(): Promise<StorageQuota>;Returns
Section titled “Returns”readFileSealed()
Section titled “readFileSealed()”function readFileSealed(path): Promise<SealedRead>;Not part of the node-style surface above, since node has no concept of a seal time; readFile is untouched.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”unlock()
Section titled “unlock()”function unlock(): Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
References
Section titled “References”isAccountChanged
Section titled “isAccountChanged”Re-exports isAccountChanged
SealedRead
Section titled “SealedRead”Re-exports SealedRead
Re-exports Stats
STORAGE_ACCOUNT_CHANGED
Section titled “STORAGE_ACCOUNT_CHANGED”Re-exports STORAGE_ACCOUNT_CHANGED
STORAGE_ACCOUNT_PIN_UNSUPPORTED
Section titled “STORAGE_ACCOUNT_PIN_UNSUPPORTED”Re-exports STORAGE_ACCOUNT_PIN_UNSUPPORTED
STORAGE_NOT_FOUND
Section titled “STORAGE_NOT_FOUND”Re-exports STORAGE_NOT_FOUND
StorageAccountChangedError
Section titled “StorageAccountChangedError”Re-exports StorageAccountChangedError
StorageAccountPinUnsupportedError
Section titled “StorageAccountPinUnsupportedError”Re-exports StorageAccountPinUnsupportedError