shogun-core 3.3.4 → 3.3.5
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/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js +4073 -2
- package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js.map +1 -0
- package/dist/browser/shogun-core.js +597 -343
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/ship/examples/identity-cli.js +12 -4
- package/dist/ship/examples/vault-cli.js +2 -2
- package/dist/ship/implementation/SHIP_06.js +574 -289
- package/dist/ship/interfaces/ISHIP_06.js +135 -85
- package/dist/src/gundb/db.js +7 -49
- package/dist/types/ship/implementation/SHIP_06.d.ts +90 -55
- package/dist/types/ship/interfaces/ISHIP_06.d.ts +383 -231
- package/package.json +2 -8
- package/dist/ship/examples/ephemeral-cli.js +0 -234
- package/dist/ship/implementation/SHIP_07.js +0 -635
- package/dist/ship/interfaces/ISHIP_07.js +0 -194
- package/dist/types/ship/examples/ephemeral-cli.d.ts +0 -13
- package/dist/types/ship/implementation/SHIP_07.d.ts +0 -101
- package/dist/types/ship/interfaces/ISHIP_07.d.ts +0 -522
|
@@ -1,66 +1,101 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SHIP-06:
|
|
2
|
+
* SHIP-06: Secure Vault Implementation
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1. Standalone: new SHIP_06(gunPeers[], roomId) - NO authentication!
|
|
6
|
-
* - Uses ShogunCore internally with silent: true, disableAutoRecall: true
|
|
7
|
-
* - Zero logs, zero storage, pure relay communication
|
|
8
|
-
* - Room hashed with Web Crypto API SHA-256 for deterministic IDs
|
|
4
|
+
* Vault crittografato decentralizzato che dipende da SHIP-00 per l'identità.
|
|
9
5
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* Dipendenze:
|
|
7
|
+
* - SHIP-00 (Identity & Authentication) - per gestione utenti e chiavi
|
|
8
|
+
* - GunDB - per storage decentralizzato P2P
|
|
9
|
+
* - SEA - per crittografia AES-256-GCM
|
|
13
10
|
*
|
|
14
|
-
*
|
|
15
|
-
* - Gun Relay for P2P communication (no WebRTC complexity!)
|
|
16
|
-
* - SEA for ephemeral key generation and ECDH encryption
|
|
17
|
-
* - Pure relay mode: radisk: false, localStorage: false, multicast: false
|
|
11
|
+
* Ispirato a: https://github.com/draeder/gunsafe
|
|
18
12
|
*/
|
|
19
13
|
import type { ISHIP_00 } from "../interfaces/ISHIP_00";
|
|
20
|
-
import type { ISHIP_06,
|
|
21
|
-
|
|
14
|
+
import type { ISHIP_06, VaultRecord, VaultResult, VaultStats, RecordMetadata, GetOptions, ListOptions, ImportOptions, ExportOptions } from "../interfaces/ISHIP_06";
|
|
15
|
+
/**
|
|
16
|
+
* SHIP-06 Reference Implementation
|
|
17
|
+
*
|
|
18
|
+
* Questa implementazione dipende da ISHIP_00 per tutte le operazioni di identità.
|
|
19
|
+
* Si concentra esclusivamente sulla logica del vault crittografato.
|
|
20
|
+
*/
|
|
22
21
|
declare class SHIP_06 implements ISHIP_06 {
|
|
23
22
|
private identity;
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
private heartbeatInterval;
|
|
41
|
-
private processedMessages;
|
|
42
|
-
constructor(identityOrPeers: ISHIP_00 | string[], roomId: string, config?: Partial<EphemeralConfig> | {
|
|
43
|
-
debug?: boolean;
|
|
44
|
-
});
|
|
23
|
+
private initialized;
|
|
24
|
+
private vaultNodeName;
|
|
25
|
+
private vaultNode;
|
|
26
|
+
private recordsNode;
|
|
27
|
+
private metadataNode;
|
|
28
|
+
private static readonly VAULT_VERSION;
|
|
29
|
+
private static readonly DEFAULT_NODE_NAME;
|
|
30
|
+
/**
|
|
31
|
+
* Constructor
|
|
32
|
+
* @param identity ISHIP_00 instance for identity operations
|
|
33
|
+
* @param vaultNodeName Optional custom vault node name
|
|
34
|
+
*/
|
|
35
|
+
constructor(identity: ISHIP_00, vaultNodeName?: string);
|
|
36
|
+
/**
|
|
37
|
+
* Get identity provider
|
|
38
|
+
*/
|
|
45
39
|
getIdentity(): ISHIP_00;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Initialize vault
|
|
42
|
+
*/
|
|
43
|
+
initialize(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Check if vault is initialized
|
|
46
|
+
*/
|
|
47
|
+
isInitialized(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Store encrypted record in vault
|
|
50
|
+
*/
|
|
51
|
+
put(name: string, data: any, metadata?: RecordMetadata): Promise<VaultResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve and decrypt record from vault
|
|
54
|
+
*/
|
|
55
|
+
get(name: string, options?: GetOptions): Promise<VaultRecord | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete record from vault (soft delete)
|
|
58
|
+
*/
|
|
59
|
+
delete(name?: string): Promise<VaultResult>;
|
|
60
|
+
/**
|
|
61
|
+
* List all record names in vault
|
|
62
|
+
*/
|
|
63
|
+
list(options?: ListOptions): Promise<string[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Check if record exists
|
|
66
|
+
*/
|
|
67
|
+
exists(name: string): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Update existing record
|
|
70
|
+
*/
|
|
71
|
+
update(name: string, data: any): Promise<VaultResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Export entire vault (encrypted)
|
|
74
|
+
*/
|
|
75
|
+
export(password?: string, options?: ExportOptions): Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Import vault from backup
|
|
78
|
+
*/
|
|
79
|
+
import(backupData: string, password?: string, options?: ImportOptions): Promise<VaultResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Get vault statistics
|
|
82
|
+
*/
|
|
83
|
+
getStats(): Promise<VaultStats>;
|
|
84
|
+
/**
|
|
85
|
+
* Clear all records (soft delete all)
|
|
86
|
+
*/
|
|
87
|
+
clear(): Promise<VaultResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Compact vault (remove deleted records permanently)
|
|
90
|
+
*/
|
|
91
|
+
compact(): Promise<VaultResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Search records by content
|
|
94
|
+
*/
|
|
95
|
+
search(query: string): Promise<string[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Update record count in metadata
|
|
98
|
+
*/
|
|
99
|
+
private updateRecordCount;
|
|
65
100
|
}
|
|
66
101
|
export { SHIP_06 };
|