device-passport 1.0.0 → 1.2.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 +33 -0
- package/README.md +110 -2
- package/assets/ego-profile-manager.png +0 -0
- package/dist/adapters/index.cjs +19 -0
- package/dist/adapters/index.d.cts +66 -0
- package/dist/adapters/index.d.mts +66 -0
- package/dist/adapters/index.d.ts +66 -0
- package/dist/adapters/index.mjs +3 -0
- package/dist/ego/index.cjs +22 -0
- package/dist/ego/index.d.cts +5 -0
- package/dist/ego/index.d.mts +5 -0
- package/dist/ego/index.d.ts +5 -0
- package/dist/ego/index.mjs +8 -0
- package/dist/evaluator/index.cjs +140 -0
- package/dist/evaluator/index.d.cts +204 -0
- package/dist/evaluator/index.d.mts +204 -0
- package/dist/evaluator/index.d.ts +204 -0
- package/dist/evaluator/index.mjs +119 -0
- package/dist/geo/index.cjs +50 -0
- package/dist/geo/index.d.cts +213 -0
- package/dist/geo/index.d.mts +213 -0
- package/dist/geo/index.d.ts +213 -0
- package/dist/geo/index.mjs +18 -0
- package/dist/index.cjs +110 -3940
- package/dist/index.d.cts +45 -1091
- package/dist/index.d.mts +45 -1091
- package/dist/index.d.ts +45 -1091
- package/dist/index.mjs +11 -3849
- package/dist/shared/device-passport.BGfRcQNh.mjs +565 -0
- package/dist/shared/device-passport.BKtmLzPt.cjs +1266 -0
- package/dist/shared/device-passport.BPQj0qdT.mjs +1238 -0
- package/dist/shared/device-passport.CDS7xrj8.d.ts +469 -0
- package/dist/shared/device-passport.C_F1vBE8.d.cts +79 -0
- package/dist/shared/device-passport.C_F1vBE8.d.mts +79 -0
- package/dist/shared/device-passport.C_F1vBE8.d.ts +79 -0
- package/dist/shared/device-passport.CfLes-lq.d.cts +469 -0
- package/dist/shared/device-passport.Cjxlv8xI.cjs +245 -0
- package/dist/shared/device-passport.CsOWqPIr.d.cts +77 -0
- package/dist/shared/device-passport.CyQtcZeD.mjs +237 -0
- package/dist/shared/device-passport.D7pEnyp2.d.ts +77 -0
- package/dist/shared/device-passport.D9xW6R0B.cjs +1571 -0
- package/dist/shared/device-passport.DirQmSd4.d.cts +47 -0
- package/dist/shared/device-passport.DirQmSd4.d.mts +47 -0
- package/dist/shared/device-passport.DirQmSd4.d.ts +47 -0
- package/dist/shared/device-passport.EK4RX7Xd.cjs +584 -0
- package/dist/shared/device-passport.ZBspe4ZW.d.mts +77 -0
- package/dist/shared/device-passport.dVEqzSEb.d.mts +469 -0
- package/dist/shared/device-passport.gNo82fQ5.mjs +1537 -0
- package/dist/shared/device-passport.kekU28UM.mjs +705 -0
- package/dist/shared/device-passport.qL4tjwc0.cjs +718 -0
- package/dist/storage/index.cjs +10 -0
- package/dist/storage/index.d.cts +97 -0
- package/dist/storage/index.d.mts +97 -0
- package/dist/storage/index.d.ts +97 -0
- package/dist/storage/index.mjs +3 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +397 -0
- package/dist/types/index.d.mts +397 -0
- package/dist/types/index.d.ts +397 -0
- package/dist/types/index.mjs +1 -0
- package/package.json +32 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { S as StorageAdapter } from '../shared/device-passport.DirQmSd4.cjs';
|
|
2
|
+
|
|
3
|
+
interface MemoryStorageOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to deep-clone stored and retrieved objects to prevent external mutations.
|
|
6
|
+
* Defaults to true.
|
|
7
|
+
*/
|
|
8
|
+
clone?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* In-memory storage adapter.
|
|
12
|
+
* Useful for ephemeral scraping runs, tests, and caching.
|
|
13
|
+
*/
|
|
14
|
+
declare class MemoryStorage<T = any> implements StorageAdapter<T> {
|
|
15
|
+
private readonly store;
|
|
16
|
+
private readonly clone;
|
|
17
|
+
constructor(options?: MemoryStorageOptions);
|
|
18
|
+
private deepClone;
|
|
19
|
+
get(key: string): Promise<T | null>;
|
|
20
|
+
getSync(key: string): T | null;
|
|
21
|
+
set(key: string, value: T): Promise<void>;
|
|
22
|
+
setSync(key: string, value: T): void;
|
|
23
|
+
has(key: string): Promise<boolean>;
|
|
24
|
+
hasSync(key: string): boolean;
|
|
25
|
+
delete(key: string): Promise<boolean>;
|
|
26
|
+
deleteSync(key: string): boolean;
|
|
27
|
+
keys(): Promise<string[]>;
|
|
28
|
+
keysSync(): string[];
|
|
29
|
+
clear(): Promise<void>;
|
|
30
|
+
clearSync(): void;
|
|
31
|
+
get size(): number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface JSONFileStorageOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Path to the JSON file on disk.
|
|
37
|
+
*/
|
|
38
|
+
filePath: string;
|
|
39
|
+
/**
|
|
40
|
+
* Format JSON with indentation for readability.
|
|
41
|
+
* Defaults to true.
|
|
42
|
+
*/
|
|
43
|
+
pretty?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Auto-save to disk immediately when values change.
|
|
46
|
+
* Defaults to true.
|
|
47
|
+
*/
|
|
48
|
+
autoSave?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* File-backed JSON storage adapter.
|
|
52
|
+
* Uses atomic writes via temp-file + renameSync to ensure zero corruption
|
|
53
|
+
* even if the process is killed mid-write. Automatically creates directories.
|
|
54
|
+
*/
|
|
55
|
+
declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
|
|
56
|
+
readonly filePath: string;
|
|
57
|
+
private readonly pretty;
|
|
58
|
+
private readonly autoSave;
|
|
59
|
+
private readonly cache;
|
|
60
|
+
private isLoaded;
|
|
61
|
+
private writeQueue;
|
|
62
|
+
constructor(filePathOrOptions: string | JSONFileStorageOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Ensure data is loaded from disk into the in-memory cache.
|
|
65
|
+
*/
|
|
66
|
+
private ensureLoaded;
|
|
67
|
+
/**
|
|
68
|
+
* Atomic flush to disk. Writes to a unique temp file in the same directory,
|
|
69
|
+
* then atomically renames it to target file.
|
|
70
|
+
*/
|
|
71
|
+
private flushAtomic;
|
|
72
|
+
/**
|
|
73
|
+
* Queue a disk write to prevent race conditions during rapid concurrent mutations.
|
|
74
|
+
*/
|
|
75
|
+
private queueSave;
|
|
76
|
+
get(key: string): Promise<T | null>;
|
|
77
|
+
getSync(key: string): T | null;
|
|
78
|
+
set(key: string, value: T): Promise<void>;
|
|
79
|
+
setSync(key: string, value: T): void;
|
|
80
|
+
has(key: string): Promise<boolean>;
|
|
81
|
+
hasSync(key: string): boolean;
|
|
82
|
+
delete(key: string): Promise<boolean>;
|
|
83
|
+
deleteSync(key: string): boolean;
|
|
84
|
+
keys(): Promise<string[]>;
|
|
85
|
+
keysSync(): string[];
|
|
86
|
+
clear(): Promise<void>;
|
|
87
|
+
clearSync(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Explicitly force a flush to disk (useful if autoSave is set to false).
|
|
90
|
+
*/
|
|
91
|
+
flush(): Promise<void>;
|
|
92
|
+
flushSync(): void;
|
|
93
|
+
get size(): number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { JSONFileStorage, MemoryStorage, StorageAdapter };
|
|
97
|
+
export type { JSONFileStorageOptions, MemoryStorageOptions };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { S as StorageAdapter } from '../shared/device-passport.DirQmSd4.mjs';
|
|
2
|
+
|
|
3
|
+
interface MemoryStorageOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to deep-clone stored and retrieved objects to prevent external mutations.
|
|
6
|
+
* Defaults to true.
|
|
7
|
+
*/
|
|
8
|
+
clone?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* In-memory storage adapter.
|
|
12
|
+
* Useful for ephemeral scraping runs, tests, and caching.
|
|
13
|
+
*/
|
|
14
|
+
declare class MemoryStorage<T = any> implements StorageAdapter<T> {
|
|
15
|
+
private readonly store;
|
|
16
|
+
private readonly clone;
|
|
17
|
+
constructor(options?: MemoryStorageOptions);
|
|
18
|
+
private deepClone;
|
|
19
|
+
get(key: string): Promise<T | null>;
|
|
20
|
+
getSync(key: string): T | null;
|
|
21
|
+
set(key: string, value: T): Promise<void>;
|
|
22
|
+
setSync(key: string, value: T): void;
|
|
23
|
+
has(key: string): Promise<boolean>;
|
|
24
|
+
hasSync(key: string): boolean;
|
|
25
|
+
delete(key: string): Promise<boolean>;
|
|
26
|
+
deleteSync(key: string): boolean;
|
|
27
|
+
keys(): Promise<string[]>;
|
|
28
|
+
keysSync(): string[];
|
|
29
|
+
clear(): Promise<void>;
|
|
30
|
+
clearSync(): void;
|
|
31
|
+
get size(): number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface JSONFileStorageOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Path to the JSON file on disk.
|
|
37
|
+
*/
|
|
38
|
+
filePath: string;
|
|
39
|
+
/**
|
|
40
|
+
* Format JSON with indentation for readability.
|
|
41
|
+
* Defaults to true.
|
|
42
|
+
*/
|
|
43
|
+
pretty?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Auto-save to disk immediately when values change.
|
|
46
|
+
* Defaults to true.
|
|
47
|
+
*/
|
|
48
|
+
autoSave?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* File-backed JSON storage adapter.
|
|
52
|
+
* Uses atomic writes via temp-file + renameSync to ensure zero corruption
|
|
53
|
+
* even if the process is killed mid-write. Automatically creates directories.
|
|
54
|
+
*/
|
|
55
|
+
declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
|
|
56
|
+
readonly filePath: string;
|
|
57
|
+
private readonly pretty;
|
|
58
|
+
private readonly autoSave;
|
|
59
|
+
private readonly cache;
|
|
60
|
+
private isLoaded;
|
|
61
|
+
private writeQueue;
|
|
62
|
+
constructor(filePathOrOptions: string | JSONFileStorageOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Ensure data is loaded from disk into the in-memory cache.
|
|
65
|
+
*/
|
|
66
|
+
private ensureLoaded;
|
|
67
|
+
/**
|
|
68
|
+
* Atomic flush to disk. Writes to a unique temp file in the same directory,
|
|
69
|
+
* then atomically renames it to target file.
|
|
70
|
+
*/
|
|
71
|
+
private flushAtomic;
|
|
72
|
+
/**
|
|
73
|
+
* Queue a disk write to prevent race conditions during rapid concurrent mutations.
|
|
74
|
+
*/
|
|
75
|
+
private queueSave;
|
|
76
|
+
get(key: string): Promise<T | null>;
|
|
77
|
+
getSync(key: string): T | null;
|
|
78
|
+
set(key: string, value: T): Promise<void>;
|
|
79
|
+
setSync(key: string, value: T): void;
|
|
80
|
+
has(key: string): Promise<boolean>;
|
|
81
|
+
hasSync(key: string): boolean;
|
|
82
|
+
delete(key: string): Promise<boolean>;
|
|
83
|
+
deleteSync(key: string): boolean;
|
|
84
|
+
keys(): Promise<string[]>;
|
|
85
|
+
keysSync(): string[];
|
|
86
|
+
clear(): Promise<void>;
|
|
87
|
+
clearSync(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Explicitly force a flush to disk (useful if autoSave is set to false).
|
|
90
|
+
*/
|
|
91
|
+
flush(): Promise<void>;
|
|
92
|
+
flushSync(): void;
|
|
93
|
+
get size(): number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { JSONFileStorage, MemoryStorage, StorageAdapter };
|
|
97
|
+
export type { JSONFileStorageOptions, MemoryStorageOptions };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { S as StorageAdapter } from '../shared/device-passport.DirQmSd4.js';
|
|
2
|
+
|
|
3
|
+
interface MemoryStorageOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to deep-clone stored and retrieved objects to prevent external mutations.
|
|
6
|
+
* Defaults to true.
|
|
7
|
+
*/
|
|
8
|
+
clone?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* In-memory storage adapter.
|
|
12
|
+
* Useful for ephemeral scraping runs, tests, and caching.
|
|
13
|
+
*/
|
|
14
|
+
declare class MemoryStorage<T = any> implements StorageAdapter<T> {
|
|
15
|
+
private readonly store;
|
|
16
|
+
private readonly clone;
|
|
17
|
+
constructor(options?: MemoryStorageOptions);
|
|
18
|
+
private deepClone;
|
|
19
|
+
get(key: string): Promise<T | null>;
|
|
20
|
+
getSync(key: string): T | null;
|
|
21
|
+
set(key: string, value: T): Promise<void>;
|
|
22
|
+
setSync(key: string, value: T): void;
|
|
23
|
+
has(key: string): Promise<boolean>;
|
|
24
|
+
hasSync(key: string): boolean;
|
|
25
|
+
delete(key: string): Promise<boolean>;
|
|
26
|
+
deleteSync(key: string): boolean;
|
|
27
|
+
keys(): Promise<string[]>;
|
|
28
|
+
keysSync(): string[];
|
|
29
|
+
clear(): Promise<void>;
|
|
30
|
+
clearSync(): void;
|
|
31
|
+
get size(): number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface JSONFileStorageOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Path to the JSON file on disk.
|
|
37
|
+
*/
|
|
38
|
+
filePath: string;
|
|
39
|
+
/**
|
|
40
|
+
* Format JSON with indentation for readability.
|
|
41
|
+
* Defaults to true.
|
|
42
|
+
*/
|
|
43
|
+
pretty?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Auto-save to disk immediately when values change.
|
|
46
|
+
* Defaults to true.
|
|
47
|
+
*/
|
|
48
|
+
autoSave?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* File-backed JSON storage adapter.
|
|
52
|
+
* Uses atomic writes via temp-file + renameSync to ensure zero corruption
|
|
53
|
+
* even if the process is killed mid-write. Automatically creates directories.
|
|
54
|
+
*/
|
|
55
|
+
declare class JSONFileStorage<T = any> implements StorageAdapter<T> {
|
|
56
|
+
readonly filePath: string;
|
|
57
|
+
private readonly pretty;
|
|
58
|
+
private readonly autoSave;
|
|
59
|
+
private readonly cache;
|
|
60
|
+
private isLoaded;
|
|
61
|
+
private writeQueue;
|
|
62
|
+
constructor(filePathOrOptions: string | JSONFileStorageOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Ensure data is loaded from disk into the in-memory cache.
|
|
65
|
+
*/
|
|
66
|
+
private ensureLoaded;
|
|
67
|
+
/**
|
|
68
|
+
* Atomic flush to disk. Writes to a unique temp file in the same directory,
|
|
69
|
+
* then atomically renames it to target file.
|
|
70
|
+
*/
|
|
71
|
+
private flushAtomic;
|
|
72
|
+
/**
|
|
73
|
+
* Queue a disk write to prevent race conditions during rapid concurrent mutations.
|
|
74
|
+
*/
|
|
75
|
+
private queueSave;
|
|
76
|
+
get(key: string): Promise<T | null>;
|
|
77
|
+
getSync(key: string): T | null;
|
|
78
|
+
set(key: string, value: T): Promise<void>;
|
|
79
|
+
setSync(key: string, value: T): void;
|
|
80
|
+
has(key: string): Promise<boolean>;
|
|
81
|
+
hasSync(key: string): boolean;
|
|
82
|
+
delete(key: string): Promise<boolean>;
|
|
83
|
+
deleteSync(key: string): boolean;
|
|
84
|
+
keys(): Promise<string[]>;
|
|
85
|
+
keysSync(): string[];
|
|
86
|
+
clear(): Promise<void>;
|
|
87
|
+
clearSync(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Explicitly force a flush to disk (useful if autoSave is set to false).
|
|
90
|
+
*/
|
|
91
|
+
flush(): Promise<void>;
|
|
92
|
+
flushSync(): void;
|
|
93
|
+
get size(): number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { JSONFileStorage, MemoryStorage, StorageAdapter };
|
|
97
|
+
export type { JSONFileStorageOptions, MemoryStorageOptions };
|