@photostructure/fs-metadata 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/README.md +5 -0
- package/binding.gyp +12 -5
- package/dist/index.cjs +114 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -4
- package/dist/index.d.mts +30 -4
- package/dist/index.d.ts +30 -4
- package/dist/index.mjs +112 -34
- package/dist/index.mjs.map +1 -1
- package/doc/SECURITY_AUDIT_2025.md +22 -7
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@photostructure+fs-metadata.glibc.node +0 -0
- package/prebuilds/darwin-x64/@photostructure+fs-metadata.glibc.node +0 -0
- package/prebuilds/linux-arm64/@photostructure+fs-metadata.glibc.node +0 -0
- package/prebuilds/linux-x64/@photostructure+fs-metadata.glibc.node +0 -0
- package/prebuilds/win32-arm64/@photostructure+fs-metadata.glibc.node +0 -0
- package/prebuilds/win32-x64/@photostructure+fs-metadata.glibc.node +0 -0
- package/src/index.ts +4 -0
- package/src/linux/mtab.ts +10 -3
- package/src/options.ts +114 -3
- package/src/remote_info.ts +28 -34
- package/src/types/options.ts +7 -0
- package/src/volume_metadata.ts +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -141,6 +141,12 @@ interface Options {
|
|
|
141
141
|
* @see {@link LinuxMountTablePathsDefault} for the default values
|
|
142
142
|
*/
|
|
143
143
|
linuxMountTablePaths: string[];
|
|
144
|
+
/**
|
|
145
|
+
* Filesystem types that indicate network/remote volumes.
|
|
146
|
+
*
|
|
147
|
+
* @see {@link NetworkFsTypesDefault} for the default value
|
|
148
|
+
*/
|
|
149
|
+
networkFsTypes: string[];
|
|
144
150
|
/**
|
|
145
151
|
* Should system volumes be included in result arrays? Defaults to true on
|
|
146
152
|
* Windows and false elsewhere.
|
|
@@ -256,17 +262,37 @@ declare function getTimeoutMsDefault(): number;
|
|
|
256
262
|
/**
|
|
257
263
|
* System paths and globs that indicate system volumes
|
|
258
264
|
*/
|
|
259
|
-
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts"];
|
|
265
|
+
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/flatpak/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/var/lib/kubelet/**", "/var/lib/lxc/**", "/var/lib/lxd/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts", "**/.DocumentRevisions-V100", "**/.fseventsd", "**/.Spotlight-V100", "**/.Trashes"];
|
|
260
266
|
/**
|
|
261
|
-
* Filesystem types that indicate system volumes
|
|
267
|
+
* Filesystem types that indicate system/virtual volumes.
|
|
268
|
+
*
|
|
269
|
+
* These are pseudo-filesystems that don't represent real storage devices.
|
|
270
|
+
* See /proc/filesystems for the full list supported by the running kernel.
|
|
271
|
+
*
|
|
272
|
+
* @see https://www.kernel.org/doc/html/latest/filesystems/ - Linux kernel filesystem docs
|
|
273
|
+
* @see https://man7.org/linux/man-pages/man5/proc_filesystems.5.html - /proc/filesystems
|
|
262
274
|
*/
|
|
263
|
-
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "proc", "pstore", "rootfs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs"];
|
|
275
|
+
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "bpf", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.lxcfs", "fuse.portal", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "nsfs", "proc", "pstore", "ramfs", "rootfs", "rpc_pipefs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs", "tracefs"];
|
|
264
276
|
declare const LinuxMountTablePathsDefault: readonly ["/proc/self/mounts", "/proc/mounts", "/etc/mtab"];
|
|
277
|
+
/**
|
|
278
|
+
* Network/remote filesystem types.
|
|
279
|
+
*
|
|
280
|
+
* These filesystems require network connectivity and may have higher latency
|
|
281
|
+
* or availability concerns. Used by {@link Options.networkFsTypes}.
|
|
282
|
+
*
|
|
283
|
+
* Based on systemd's fstype_is_network() and common FUSE remote filesystems.
|
|
284
|
+
* @see https://github.com/systemd/systemd/blob/main/src/basic/mountpoint-util.c - fstype_is_network()
|
|
285
|
+
*/
|
|
286
|
+
declare const NetworkFsTypesDefault: readonly ["9p", "afp", "afs", "beegfs", "ceph", "cifs", "ftp", "fuse", "fuse.rclone", "fuse.s3fs", "fuse.sshfs", "gfs", "gfs2", "glusterfs", "lustre", "ncpfs", "ncp", "nfs", "nfs4", "smb", "smbfs", "sshfs", "webdav"];
|
|
265
287
|
/**
|
|
266
288
|
* Should {@link getAllVolumeMetadata} include system volumes by
|
|
267
289
|
* default?
|
|
268
290
|
*/
|
|
269
291
|
declare const IncludeSystemVolumesDefault: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Default value for {@link Options.skipNetworkVolumes}.
|
|
294
|
+
*/
|
|
295
|
+
declare const SkipNetworkVolumesDefault = false;
|
|
270
296
|
/**
|
|
271
297
|
* Default {@link Options} object.
|
|
272
298
|
*
|
|
@@ -367,4 +393,4 @@ declare function getHiddenMetadata(pathname: string): Promise<HiddenMetadata>;
|
|
|
367
393
|
*/
|
|
368
394
|
declare function setHidden(pathname: string, hidden: boolean, method?: HideMethod): Promise<SetHiddenResult>;
|
|
369
395
|
|
|
370
|
-
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, type Options, OptionsDefault, type SetHiddenResult, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
|
396
|
+
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, NetworkFsTypesDefault, type Options, OptionsDefault, type SetHiddenResult, SkipNetworkVolumesDefault, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
package/dist/index.d.mts
CHANGED
|
@@ -141,6 +141,12 @@ interface Options {
|
|
|
141
141
|
* @see {@link LinuxMountTablePathsDefault} for the default values
|
|
142
142
|
*/
|
|
143
143
|
linuxMountTablePaths: string[];
|
|
144
|
+
/**
|
|
145
|
+
* Filesystem types that indicate network/remote volumes.
|
|
146
|
+
*
|
|
147
|
+
* @see {@link NetworkFsTypesDefault} for the default value
|
|
148
|
+
*/
|
|
149
|
+
networkFsTypes: string[];
|
|
144
150
|
/**
|
|
145
151
|
* Should system volumes be included in result arrays? Defaults to true on
|
|
146
152
|
* Windows and false elsewhere.
|
|
@@ -256,17 +262,37 @@ declare function getTimeoutMsDefault(): number;
|
|
|
256
262
|
/**
|
|
257
263
|
* System paths and globs that indicate system volumes
|
|
258
264
|
*/
|
|
259
|
-
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts"];
|
|
265
|
+
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/flatpak/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/var/lib/kubelet/**", "/var/lib/lxc/**", "/var/lib/lxd/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts", "**/.DocumentRevisions-V100", "**/.fseventsd", "**/.Spotlight-V100", "**/.Trashes"];
|
|
260
266
|
/**
|
|
261
|
-
* Filesystem types that indicate system volumes
|
|
267
|
+
* Filesystem types that indicate system/virtual volumes.
|
|
268
|
+
*
|
|
269
|
+
* These are pseudo-filesystems that don't represent real storage devices.
|
|
270
|
+
* See /proc/filesystems for the full list supported by the running kernel.
|
|
271
|
+
*
|
|
272
|
+
* @see https://www.kernel.org/doc/html/latest/filesystems/ - Linux kernel filesystem docs
|
|
273
|
+
* @see https://man7.org/linux/man-pages/man5/proc_filesystems.5.html - /proc/filesystems
|
|
262
274
|
*/
|
|
263
|
-
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "proc", "pstore", "rootfs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs"];
|
|
275
|
+
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "bpf", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.lxcfs", "fuse.portal", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "nsfs", "proc", "pstore", "ramfs", "rootfs", "rpc_pipefs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs", "tracefs"];
|
|
264
276
|
declare const LinuxMountTablePathsDefault: readonly ["/proc/self/mounts", "/proc/mounts", "/etc/mtab"];
|
|
277
|
+
/**
|
|
278
|
+
* Network/remote filesystem types.
|
|
279
|
+
*
|
|
280
|
+
* These filesystems require network connectivity and may have higher latency
|
|
281
|
+
* or availability concerns. Used by {@link Options.networkFsTypes}.
|
|
282
|
+
*
|
|
283
|
+
* Based on systemd's fstype_is_network() and common FUSE remote filesystems.
|
|
284
|
+
* @see https://github.com/systemd/systemd/blob/main/src/basic/mountpoint-util.c - fstype_is_network()
|
|
285
|
+
*/
|
|
286
|
+
declare const NetworkFsTypesDefault: readonly ["9p", "afp", "afs", "beegfs", "ceph", "cifs", "ftp", "fuse", "fuse.rclone", "fuse.s3fs", "fuse.sshfs", "gfs", "gfs2", "glusterfs", "lustre", "ncpfs", "ncp", "nfs", "nfs4", "smb", "smbfs", "sshfs", "webdav"];
|
|
265
287
|
/**
|
|
266
288
|
* Should {@link getAllVolumeMetadata} include system volumes by
|
|
267
289
|
* default?
|
|
268
290
|
*/
|
|
269
291
|
declare const IncludeSystemVolumesDefault: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Default value for {@link Options.skipNetworkVolumes}.
|
|
294
|
+
*/
|
|
295
|
+
declare const SkipNetworkVolumesDefault = false;
|
|
270
296
|
/**
|
|
271
297
|
* Default {@link Options} object.
|
|
272
298
|
*
|
|
@@ -367,4 +393,4 @@ declare function getHiddenMetadata(pathname: string): Promise<HiddenMetadata>;
|
|
|
367
393
|
*/
|
|
368
394
|
declare function setHidden(pathname: string, hidden: boolean, method?: HideMethod): Promise<SetHiddenResult>;
|
|
369
395
|
|
|
370
|
-
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, type Options, OptionsDefault, type SetHiddenResult, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
|
396
|
+
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, NetworkFsTypesDefault, type Options, OptionsDefault, type SetHiddenResult, SkipNetworkVolumesDefault, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
package/dist/index.d.ts
CHANGED
|
@@ -141,6 +141,12 @@ interface Options {
|
|
|
141
141
|
* @see {@link LinuxMountTablePathsDefault} for the default values
|
|
142
142
|
*/
|
|
143
143
|
linuxMountTablePaths: string[];
|
|
144
|
+
/**
|
|
145
|
+
* Filesystem types that indicate network/remote volumes.
|
|
146
|
+
*
|
|
147
|
+
* @see {@link NetworkFsTypesDefault} for the default value
|
|
148
|
+
*/
|
|
149
|
+
networkFsTypes: string[];
|
|
144
150
|
/**
|
|
145
151
|
* Should system volumes be included in result arrays? Defaults to true on
|
|
146
152
|
* Windows and false elsewhere.
|
|
@@ -256,17 +262,37 @@ declare function getTimeoutMsDefault(): number;
|
|
|
256
262
|
/**
|
|
257
263
|
* System paths and globs that indicate system volumes
|
|
258
264
|
*/
|
|
259
|
-
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts"];
|
|
265
|
+
declare const SystemPathPatternsDefault: readonly ["/boot", "/boot/efi", "/dev", "/dev/**", "/proc/**", "/run", "/run/credentials/**", "/run/flatpak/**", "/run/lock", "/run/snapd/**", "/run/user/*/doc", "/run/user/*/gvfs", "/snap/**", "/sys/**", "/tmp", "/var/tmp", "**/#snapshot", "/run/docker/**", "/var/lib/docker/**", "/run/containerd/**", "/var/lib/containerd/**", "/run/containers/**", "/var/lib/containers/**", "/var/lib/kubelet/**", "/var/lib/lxc/**", "/var/lib/lxd/**", "/mnt/wslg/distro", "/mnt/wslg/doc", "/mnt/wslg/versions.txt", "/usr/lib/wsl/drivers", "/private/var/vm", "/System/Volumes/Hardware", "/System/Volumes/iSCPreboot", "/System/Volumes/Preboot", "/System/Volumes/Recovery", "/System/Volumes/Reserved", "/System/Volumes/Update", "/System/Volumes/VM", "/System/Volumes/xarts", "**/.DocumentRevisions-V100", "**/.fseventsd", "**/.Spotlight-V100", "**/.Trashes"];
|
|
260
266
|
/**
|
|
261
|
-
* Filesystem types that indicate system volumes
|
|
267
|
+
* Filesystem types that indicate system/virtual volumes.
|
|
268
|
+
*
|
|
269
|
+
* These are pseudo-filesystems that don't represent real storage devices.
|
|
270
|
+
* See /proc/filesystems for the full list supported by the running kernel.
|
|
271
|
+
*
|
|
272
|
+
* @see https://www.kernel.org/doc/html/latest/filesystems/ - Linux kernel filesystem docs
|
|
273
|
+
* @see https://man7.org/linux/man-pages/man5/proc_filesystems.5.html - /proc/filesystems
|
|
262
274
|
*/
|
|
263
|
-
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "proc", "pstore", "rootfs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs"];
|
|
275
|
+
declare const SystemFsTypesDefault: readonly ["autofs", "binfmt_misc", "bpf", "cgroup", "cgroup2", "configfs", "debugfs", "devpts", "devtmpfs", "efivarfs", "fusectl", "fuse.lxcfs", "fuse.portal", "fuse.snapfuse", "hugetlbfs", "mqueue", "none", "nsfs", "proc", "pstore", "ramfs", "rootfs", "rpc_pipefs", "securityfs", "snap*", "squashfs", "sysfs", "tmpfs", "tracefs"];
|
|
264
276
|
declare const LinuxMountTablePathsDefault: readonly ["/proc/self/mounts", "/proc/mounts", "/etc/mtab"];
|
|
277
|
+
/**
|
|
278
|
+
* Network/remote filesystem types.
|
|
279
|
+
*
|
|
280
|
+
* These filesystems require network connectivity and may have higher latency
|
|
281
|
+
* or availability concerns. Used by {@link Options.networkFsTypes}.
|
|
282
|
+
*
|
|
283
|
+
* Based on systemd's fstype_is_network() and common FUSE remote filesystems.
|
|
284
|
+
* @see https://github.com/systemd/systemd/blob/main/src/basic/mountpoint-util.c - fstype_is_network()
|
|
285
|
+
*/
|
|
286
|
+
declare const NetworkFsTypesDefault: readonly ["9p", "afp", "afs", "beegfs", "ceph", "cifs", "ftp", "fuse", "fuse.rclone", "fuse.s3fs", "fuse.sshfs", "gfs", "gfs2", "glusterfs", "lustre", "ncpfs", "ncp", "nfs", "nfs4", "smb", "smbfs", "sshfs", "webdav"];
|
|
265
287
|
/**
|
|
266
288
|
* Should {@link getAllVolumeMetadata} include system volumes by
|
|
267
289
|
* default?
|
|
268
290
|
*/
|
|
269
291
|
declare const IncludeSystemVolumesDefault: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Default value for {@link Options.skipNetworkVolumes}.
|
|
294
|
+
*/
|
|
295
|
+
declare const SkipNetworkVolumesDefault = false;
|
|
270
296
|
/**
|
|
271
297
|
* Default {@link Options} object.
|
|
272
298
|
*
|
|
@@ -367,4 +393,4 @@ declare function getHiddenMetadata(pathname: string): Promise<HiddenMetadata>;
|
|
|
367
393
|
*/
|
|
368
394
|
declare function setHidden(pathname: string, hidden: boolean, method?: HideMethod): Promise<SetHiddenResult>;
|
|
369
395
|
|
|
370
|
-
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, type Options, OptionsDefault, type SetHiddenResult, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
|
396
|
+
export { type GetVolumeMountPointOptions, type HiddenMetadata, type HideMethod, IncludeSystemVolumesDefault, LinuxMountTablePathsDefault, type MountPoint, NetworkFsTypesDefault, type Options, OptionsDefault, type SetHiddenResult, SkipNetworkVolumesDefault, type StringEnum, type StringEnumKeys, type StringEnumType, SystemFsTypesDefault, SystemPathPatternsDefault, type SystemVolumeConfig, type VolumeHealthStatus, VolumeHealthStatuses, type VolumeMetadata, getAllVolumeMetadata, getHiddenMetadata, getTimeoutMsDefault, getVolumeMetadata, getVolumeMountPoints, isHidden, isHiddenRecursive, optionsWithDefaults, setHidden };
|
package/dist/index.mjs
CHANGED
|
@@ -587,6 +587,7 @@ var SystemPathPatternsDefault = [
|
|
|
587
587
|
"/proc/**",
|
|
588
588
|
"/run",
|
|
589
589
|
"/run/credentials/**",
|
|
590
|
+
"/run/flatpak/**",
|
|
590
591
|
"/run/lock",
|
|
591
592
|
"/run/snapd/**",
|
|
592
593
|
"/run/user/*/doc",
|
|
@@ -616,12 +617,21 @@ var SystemPathPatternsDefault = [
|
|
|
616
617
|
// - Rootless and rootful container storage
|
|
617
618
|
"/run/containers/**",
|
|
618
619
|
"/var/lib/containers/**",
|
|
619
|
-
//
|
|
620
|
+
//
|
|
621
|
+
// Kubernetes: https://kubernetes.io/docs/reference/node/kubelet-files/
|
|
622
|
+
// - kubelet stores pod data, device plugins, and seccomp profiles
|
|
623
|
+
"/var/lib/kubelet/**",
|
|
624
|
+
//
|
|
625
|
+
// LXC/LXD: https://linuxcontainers.org/
|
|
626
|
+
// - Linux container storage and configuration
|
|
627
|
+
"/var/lib/lxc/**",
|
|
628
|
+
"/var/lib/lxd/**",
|
|
629
|
+
// WSL (Windows Subsystem for Linux):
|
|
620
630
|
"/mnt/wslg/distro",
|
|
621
631
|
"/mnt/wslg/doc",
|
|
622
632
|
"/mnt/wslg/versions.txt",
|
|
623
633
|
"/usr/lib/wsl/drivers",
|
|
624
|
-
//
|
|
634
|
+
// macOS system paths:
|
|
625
635
|
"/private/var/vm",
|
|
626
636
|
// macOS swap
|
|
627
637
|
"/System/Volumes/Hardware",
|
|
@@ -631,11 +641,20 @@ var SystemPathPatternsDefault = [
|
|
|
631
641
|
"/System/Volumes/Reserved",
|
|
632
642
|
"/System/Volumes/Update",
|
|
633
643
|
"/System/Volumes/VM",
|
|
634
|
-
"/System/Volumes/xarts"
|
|
644
|
+
"/System/Volumes/xarts",
|
|
645
|
+
// macOS per-volume metadata (Spotlight, FSEvents, versioning, Trash):
|
|
646
|
+
// https://eclecticlight.co/2021/01/28/spotlight-on-search-how-spotlight-works/
|
|
647
|
+
"**/.DocumentRevisions-V100",
|
|
648
|
+
"**/.fseventsd",
|
|
649
|
+
"**/.Spotlight-V100",
|
|
650
|
+
"**/.Trashes"
|
|
635
651
|
];
|
|
636
652
|
var SystemFsTypesDefault = [
|
|
637
653
|
"autofs",
|
|
638
654
|
"binfmt_misc",
|
|
655
|
+
// BPF filesystem for persistent BPF objects
|
|
656
|
+
// https://docs.kernel.org/bpf/
|
|
657
|
+
"bpf",
|
|
639
658
|
"cgroup",
|
|
640
659
|
"cgroup2",
|
|
641
660
|
"configfs",
|
|
@@ -644,24 +663,98 @@ var SystemFsTypesDefault = [
|
|
|
644
663
|
"devtmpfs",
|
|
645
664
|
"efivarfs",
|
|
646
665
|
"fusectl",
|
|
666
|
+
// LXC container filesystem virtualization
|
|
667
|
+
// https://linuxcontainers.org/lxcfs/
|
|
668
|
+
"fuse.lxcfs",
|
|
669
|
+
// XDG Desktop Portal for Flatpak sandboxed app file access
|
|
670
|
+
// https://flatpak.github.io/xdg-desktop-portal/
|
|
671
|
+
"fuse.portal",
|
|
647
672
|
"fuse.snapfuse",
|
|
648
673
|
"hugetlbfs",
|
|
649
674
|
"mqueue",
|
|
650
675
|
"none",
|
|
676
|
+
// Linux namespace filesystem (internal kernel use)
|
|
677
|
+
// https://man7.org/linux/man-pages/man7/namespaces.7.html
|
|
678
|
+
"nsfs",
|
|
651
679
|
"proc",
|
|
652
680
|
"pstore",
|
|
681
|
+
// RAM-based filesystem (predecessor to tmpfs)
|
|
682
|
+
// https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html
|
|
683
|
+
"ramfs",
|
|
653
684
|
"rootfs",
|
|
685
|
+
// NFS RPC communication pipe filesystem
|
|
686
|
+
// https://man7.org/linux/man-pages/man8/rpc.gssd.8.html
|
|
687
|
+
"rpc_pipefs",
|
|
654
688
|
"securityfs",
|
|
655
689
|
"snap*",
|
|
656
690
|
"squashfs",
|
|
657
691
|
"sysfs",
|
|
658
|
-
"tmpfs"
|
|
692
|
+
"tmpfs",
|
|
693
|
+
// Kernel function tracing filesystem
|
|
694
|
+
// https://www.kernel.org/doc/html/latest/trace/ftrace.html
|
|
695
|
+
"tracefs"
|
|
659
696
|
];
|
|
660
697
|
var LinuxMountTablePathsDefault = [
|
|
661
698
|
"/proc/self/mounts",
|
|
662
699
|
"/proc/mounts",
|
|
663
700
|
"/etc/mtab"
|
|
664
701
|
];
|
|
702
|
+
var NetworkFsTypesDefault = [
|
|
703
|
+
// Plan 9 filesystem (VM host-guest, also network)
|
|
704
|
+
// https://www.kernel.org/doc/html/latest/filesystems/9p.html
|
|
705
|
+
"9p",
|
|
706
|
+
// Apple Filing Protocol (legacy macOS/netatalk)
|
|
707
|
+
"afp",
|
|
708
|
+
// Andrew File System (distributed) - not to be confused with Apple's APFS
|
|
709
|
+
// https://www.openafs.org/
|
|
710
|
+
"afs",
|
|
711
|
+
// BeeGFS parallel filesystem (HPC)
|
|
712
|
+
// https://www.beegfs.io/
|
|
713
|
+
"beegfs",
|
|
714
|
+
// Ceph distributed filesystem
|
|
715
|
+
// https://docs.ceph.com/
|
|
716
|
+
"ceph",
|
|
717
|
+
// Windows/Samba shares (SMB/CIFS)
|
|
718
|
+
// https://www.samba.org/
|
|
719
|
+
"cifs",
|
|
720
|
+
// FTP filesystem mount
|
|
721
|
+
"ftp",
|
|
722
|
+
// Generic FUSE (often remote, treated conservatively)
|
|
723
|
+
"fuse",
|
|
724
|
+
// rclone cloud storage mount (Google Drive, S3, etc.)
|
|
725
|
+
// https://rclone.org/commands/rclone_mount/
|
|
726
|
+
"fuse.rclone",
|
|
727
|
+
// Amazon S3 FUSE mount
|
|
728
|
+
// https://github.com/s3fs-fuse/s3fs-fuse
|
|
729
|
+
"fuse.s3fs",
|
|
730
|
+
// SSH filesystem
|
|
731
|
+
// https://github.com/libfuse/sshfs
|
|
732
|
+
"fuse.sshfs",
|
|
733
|
+
// Red Hat Global File System (cluster)
|
|
734
|
+
"gfs",
|
|
735
|
+
"gfs2",
|
|
736
|
+
// GlusterFS distributed filesystem
|
|
737
|
+
// https://www.gluster.org/
|
|
738
|
+
"glusterfs",
|
|
739
|
+
// Lustre parallel filesystem (HPC)
|
|
740
|
+
// https://www.lustre.org/
|
|
741
|
+
"lustre",
|
|
742
|
+
// Novell NetWare (legacy)
|
|
743
|
+
"ncpfs",
|
|
744
|
+
"ncp",
|
|
745
|
+
// Network File System
|
|
746
|
+
// https://man7.org/linux/man-pages/man5/nfs.5.html
|
|
747
|
+
"nfs",
|
|
748
|
+
"nfs4",
|
|
749
|
+
// SMB filesystem
|
|
750
|
+
"smb",
|
|
751
|
+
"smbfs",
|
|
752
|
+
// SSH filesystem (non-FUSE variant)
|
|
753
|
+
"sshfs",
|
|
754
|
+
// WebDAV filesystem
|
|
755
|
+
// https://savannah.nongnu.org/projects/davfs2
|
|
756
|
+
"webdav"
|
|
757
|
+
];
|
|
665
758
|
var IncludeSystemVolumesDefault = isWindows;
|
|
666
759
|
var SkipNetworkVolumesDefault = false;
|
|
667
760
|
var OptionsDefault = {
|
|
@@ -670,6 +763,7 @@ var OptionsDefault = {
|
|
|
670
763
|
systemPathPatterns: [...SystemPathPatternsDefault],
|
|
671
764
|
systemFsTypes: [...SystemFsTypesDefault],
|
|
672
765
|
linuxMountTablePaths: [...LinuxMountTablePathsDefault],
|
|
766
|
+
networkFsTypes: [...NetworkFsTypesDefault],
|
|
673
767
|
includeSystemVolumes: IncludeSystemVolumesDefault,
|
|
674
768
|
skipNetworkVolumes: SkipNetworkVolumesDefault
|
|
675
769
|
};
|
|
@@ -794,38 +888,15 @@ function isRemoteInfo(obj) {
|
|
|
794
888
|
const { remoteHost, remoteShare } = obj;
|
|
795
889
|
return isNotBlank(remoteHost) && isNotBlank(remoteShare);
|
|
796
890
|
}
|
|
797
|
-
var NETWORK_FS_TYPE_ARRAY = [
|
|
798
|
-
"9p",
|
|
799
|
-
"afp",
|
|
800
|
-
"afs",
|
|
801
|
-
"beegfs",
|
|
802
|
-
"ceph",
|
|
803
|
-
"cifs",
|
|
804
|
-
"ftp",
|
|
805
|
-
"fuse",
|
|
806
|
-
"gfs2",
|
|
807
|
-
"glusterfs",
|
|
808
|
-
"lustre",
|
|
809
|
-
"ncpfs",
|
|
810
|
-
"nfs",
|
|
811
|
-
"nfs4",
|
|
812
|
-
"smb",
|
|
813
|
-
"smbfs",
|
|
814
|
-
"sshfs",
|
|
815
|
-
"webdav"
|
|
816
|
-
];
|
|
817
|
-
var NETWORK_FS_TYPES = new Set(NETWORK_FS_TYPE_ARRAY);
|
|
818
891
|
var FS_TYPE_ALIASES = /* @__PURE__ */ new Map([
|
|
819
892
|
["nfs1", "nfs"],
|
|
820
893
|
["nfs2", "nfs"],
|
|
821
894
|
["nfs3", "nfs"],
|
|
822
|
-
["nfs4", "nfs4"],
|
|
823
895
|
["fuse.sshfs", "sshfs"],
|
|
824
896
|
["sshfs.fuse", "sshfs"],
|
|
825
897
|
["davfs2", "webdav"],
|
|
826
898
|
["davfs", "webdav"],
|
|
827
899
|
["cifs.smb", "cifs"],
|
|
828
|
-
["smbfs", "cifs"],
|
|
829
900
|
["cephfs", "ceph"],
|
|
830
901
|
["fuse.ceph", "ceph"],
|
|
831
902
|
["fuse.cephfs", "ceph"],
|
|
@@ -836,8 +907,12 @@ function normalizeFsType(fstype) {
|
|
|
836
907
|
const norm = toS(fstype).toLowerCase().replace(/:$/, "");
|
|
837
908
|
return FS_TYPE_ALIASES.get(norm) ?? norm;
|
|
838
909
|
}
|
|
839
|
-
function isRemoteFsType(fstype) {
|
|
840
|
-
|
|
910
|
+
function isRemoteFsType(fstype, networkFsTypes = NetworkFsTypesDefault) {
|
|
911
|
+
if (!isNotBlank(fstype)) return false;
|
|
912
|
+
const normalized = normalizeFsType(fstype);
|
|
913
|
+
return networkFsTypes.some(
|
|
914
|
+
(nft) => nft === normalized || normalized.startsWith(nft + ".")
|
|
915
|
+
);
|
|
841
916
|
}
|
|
842
917
|
function parseURL(s) {
|
|
843
918
|
try {
|
|
@@ -846,7 +921,7 @@ function parseURL(s) {
|
|
|
846
921
|
return;
|
|
847
922
|
}
|
|
848
923
|
}
|
|
849
|
-
function extractRemoteInfo(fsSpec) {
|
|
924
|
+
function extractRemoteInfo(fsSpec, networkFsTypes = NetworkFsTypesDefault) {
|
|
850
925
|
if (fsSpec == null || isBlank(fsSpec)) return;
|
|
851
926
|
if (isWindows) {
|
|
852
927
|
fsSpec = fsSpec.replace(/\\/g, "/");
|
|
@@ -895,7 +970,7 @@ function extractRemoteInfo(fsSpec) {
|
|
|
895
970
|
if (parsed != null) {
|
|
896
971
|
debug("[extractRemoteInfo] parsed URL: %o", parsed);
|
|
897
972
|
const fstype = normalizeFsType(parsed.protocol);
|
|
898
|
-
if (!isRemoteFsType(fstype)) {
|
|
973
|
+
if (!isRemoteFsType(fstype, networkFsTypes)) {
|
|
899
974
|
return {
|
|
900
975
|
uri: fsSpec,
|
|
901
976
|
remote: false
|
|
@@ -1048,6 +1123,7 @@ function mountEntryToMountPoint(entry) {
|
|
|
1048
1123
|
};
|
|
1049
1124
|
}
|
|
1050
1125
|
function mountEntryToPartialVolumeMetadata(entry, options = {}) {
|
|
1126
|
+
const networkFsTypes = options.networkFsTypes ?? NetworkFsTypesDefault;
|
|
1051
1127
|
return {
|
|
1052
1128
|
mountPoint: entry.fs_file,
|
|
1053
1129
|
fstype: entry.fs_vfstype,
|
|
@@ -1055,7 +1131,7 @@ function mountEntryToPartialVolumeMetadata(entry, options = {}) {
|
|
|
1055
1131
|
isSystemVolume: isSystemVolume(entry.fs_file, entry.fs_vfstype, options),
|
|
1056
1132
|
remote: false,
|
|
1057
1133
|
// < default to false, but it may be overridden by extractRemoteInfo
|
|
1058
|
-
...extractRemoteInfo(entry.fs_spec)
|
|
1134
|
+
...extractRemoteInfo(entry.fs_spec, networkFsTypes)
|
|
1059
1135
|
};
|
|
1060
1136
|
}
|
|
1061
1137
|
function parseMtab(content) {
|
|
@@ -1307,9 +1383,9 @@ async function _getVolumeMetadata(o, nativeFn2) {
|
|
|
1307
1383
|
debug("[getVolumeMetadata] requesting native metadata");
|
|
1308
1384
|
const metadata = await (await nativeFn2()).getVolumeMetadata(o);
|
|
1309
1385
|
debug("[getVolumeMetadata] native metadata: %o", metadata);
|
|
1310
|
-
const remoteInfo = mtabInfo ?? extractRemoteInfo(metadata.uri) ?? extractRemoteInfo(metadata.mountFrom) ?? (isWindows ? parseUNCPath(o.mountPoint) : void 0);
|
|
1386
|
+
const remoteInfo = mtabInfo ?? extractRemoteInfo(metadata.uri, o.networkFsTypes) ?? extractRemoteInfo(metadata.mountFrom, o.networkFsTypes) ?? (isWindows ? parseUNCPath(o.mountPoint) : void 0);
|
|
1311
1387
|
debug("[getVolumeMetadata] extracted remote info: %o", remoteInfo);
|
|
1312
|
-
remote ||= isRemoteFsType(metadata.fstype) || (remoteInfo?.remote ?? metadata.remote ?? false);
|
|
1388
|
+
remote ||= isRemoteFsType(metadata.fstype, o.networkFsTypes) || (remoteInfo?.remote ?? metadata.remote ?? false);
|
|
1313
1389
|
debug("[getVolumeMetadata] assembling: %o", {
|
|
1314
1390
|
status,
|
|
1315
1391
|
mtabInfo,
|
|
@@ -1436,7 +1512,9 @@ function setHidden(pathname, hidden, method = "auto") {
|
|
|
1436
1512
|
export {
|
|
1437
1513
|
IncludeSystemVolumesDefault,
|
|
1438
1514
|
LinuxMountTablePathsDefault,
|
|
1515
|
+
NetworkFsTypesDefault,
|
|
1439
1516
|
OptionsDefault,
|
|
1517
|
+
SkipNetworkVolumesDefault,
|
|
1440
1518
|
SystemFsTypesDefault,
|
|
1441
1519
|
SystemPathPatternsDefault,
|
|
1442
1520
|
VolumeHealthStatuses,
|