@web_of_trust/core 0.2.2
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/README.md +357 -0
- package/dist/adapters/authorization/InMemoryAuthorizationAdapter.d.ts +30 -0
- package/dist/adapters/authorization/InMemoryAuthorizationAdapter.d.ts.map +1 -0
- package/dist/adapters/crypto/WebCryptoAdapter.d.ts +30 -0
- package/dist/adapters/crypto/WebCryptoAdapter.d.ts.map +1 -0
- package/dist/adapters/crypto/index.d.ts +2 -0
- package/dist/adapters/crypto/index.d.ts.map +1 -0
- package/dist/adapters/discovery/HttpDiscoveryAdapter.d.ts +25 -0
- package/dist/adapters/discovery/HttpDiscoveryAdapter.d.ts.map +1 -0
- package/dist/adapters/discovery/InMemoryGraphCacheStore.d.ts +29 -0
- package/dist/adapters/discovery/InMemoryGraphCacheStore.d.ts.map +1 -0
- package/dist/adapters/discovery/InMemoryPublishStateStore.d.ts +13 -0
- package/dist/adapters/discovery/InMemoryPublishStateStore.d.ts.map +1 -0
- package/dist/adapters/discovery/OfflineFirstDiscoveryAdapter.d.ts +62 -0
- package/dist/adapters/discovery/OfflineFirstDiscoveryAdapter.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +5 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/interfaces/AuthorizationAdapter.d.ts +52 -0
- package/dist/adapters/interfaces/AuthorizationAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/CryptoAdapter.d.ts +43 -0
- package/dist/adapters/interfaces/CryptoAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/DiscoveryAdapter.d.ts +71 -0
- package/dist/adapters/interfaces/DiscoveryAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/GraphCacheStore.d.ts +66 -0
- package/dist/adapters/interfaces/GraphCacheStore.d.ts.map +1 -0
- package/dist/adapters/interfaces/MessagingAdapter.d.ts +23 -0
- package/dist/adapters/interfaces/MessagingAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/OutboxStore.d.ts +35 -0
- package/dist/adapters/interfaces/OutboxStore.d.ts.map +1 -0
- package/dist/adapters/interfaces/PublishStateStore.d.ts +23 -0
- package/dist/adapters/interfaces/PublishStateStore.d.ts.map +1 -0
- package/dist/adapters/interfaces/ReactiveStorageAdapter.d.ts +23 -0
- package/dist/adapters/interfaces/ReactiveStorageAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/ReplicationAdapter.d.ts +57 -0
- package/dist/adapters/interfaces/ReplicationAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/SpaceMetadataStorage.d.ts +46 -0
- package/dist/adapters/interfaces/SpaceMetadataStorage.d.ts.map +1 -0
- package/dist/adapters/interfaces/StorageAdapter.d.ts +32 -0
- package/dist/adapters/interfaces/StorageAdapter.d.ts.map +1 -0
- package/dist/adapters/interfaces/Subscribable.d.ts +22 -0
- package/dist/adapters/interfaces/Subscribable.d.ts.map +1 -0
- package/dist/adapters/interfaces/index.d.ts +12 -0
- package/dist/adapters/interfaces/index.d.ts.map +1 -0
- package/dist/adapters/messaging/AutomergeOutboxStore.d.ts +24 -0
- package/dist/adapters/messaging/AutomergeOutboxStore.d.ts.map +1 -0
- package/dist/adapters/messaging/InMemoryMessagingAdapter.d.ts +36 -0
- package/dist/adapters/messaging/InMemoryMessagingAdapter.d.ts.map +1 -0
- package/dist/adapters/messaging/InMemoryOutboxStore.d.ts +12 -0
- package/dist/adapters/messaging/InMemoryOutboxStore.d.ts.map +1 -0
- package/dist/adapters/messaging/OutboxMessagingAdapter.d.ts +61 -0
- package/dist/adapters/messaging/OutboxMessagingAdapter.d.ts.map +1 -0
- package/dist/adapters/messaging/TracedOutboxMessagingAdapter.d.ts +20 -0
- package/dist/adapters/messaging/TracedOutboxMessagingAdapter.d.ts.map +1 -0
- package/dist/adapters/messaging/WebSocketMessagingAdapter.d.ts +63 -0
- package/dist/adapters/messaging/WebSocketMessagingAdapter.d.ts.map +1 -0
- package/dist/adapters/messaging/index.d.ts +3 -0
- package/dist/adapters/messaging/index.d.ts.map +1 -0
- package/dist/adapters/storage/AutomergeSpaceMetadataStorage.d.ts +22 -0
- package/dist/adapters/storage/AutomergeSpaceMetadataStorage.d.ts.map +1 -0
- package/dist/adapters/storage/InMemoryCompactStore.d.ts +18 -0
- package/dist/adapters/storage/InMemoryCompactStore.d.ts.map +1 -0
- package/dist/adapters/storage/InMemorySpaceMetadataStorage.d.ts +17 -0
- package/dist/adapters/storage/InMemorySpaceMetadataStorage.d.ts.map +1 -0
- package/dist/adapters/storage/IndexedDBSpaceMetadataStorage.d.ts +15 -0
- package/dist/adapters/storage/IndexedDBSpaceMetadataStorage.d.ts.map +1 -0
- package/dist/adapters/storage/LocalStorageAdapter.d.ts +26 -0
- package/dist/adapters/storage/LocalStorageAdapter.d.ts.map +1 -0
- package/dist/adapters/storage/index.d.ts +2 -0
- package/dist/adapters/storage/index.d.ts.map +1 -0
- package/dist/crypto/capabilities.d.ts +80 -0
- package/dist/crypto/capabilities.d.ts.map +1 -0
- package/dist/crypto/did.d.ts +19 -0
- package/dist/crypto/did.d.ts.map +1 -0
- package/dist/crypto/encoding.d.ts +7 -0
- package/dist/crypto/encoding.d.ts.map +1 -0
- package/dist/crypto/envelope-auth.d.ts +30 -0
- package/dist/crypto/envelope-auth.d.ts.map +1 -0
- package/dist/crypto/index.d.ts +4 -0
- package/dist/crypto/index.d.ts.map +1 -0
- package/dist/crypto/jws.d.ts +26 -0
- package/dist/crypto/jws.d.ts.map +1 -0
- package/dist/identity/SeedStorage.d.ts +64 -0
- package/dist/identity/SeedStorage.d.ts.map +1 -0
- package/dist/identity/WotIdentity.d.ts +134 -0
- package/dist/identity/WotIdentity.d.ts.map +1 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6840 -0
- package/dist/services/AttestationDeliveryService.d.ts +61 -0
- package/dist/services/AttestationDeliveryService.d.ts.map +1 -0
- package/dist/services/EncryptedSyncService.d.ts +26 -0
- package/dist/services/EncryptedSyncService.d.ts.map +1 -0
- package/dist/services/GraphCacheService.d.ts +56 -0
- package/dist/services/GraphCacheService.d.ts.map +1 -0
- package/dist/services/GroupKeyService.d.ts +43 -0
- package/dist/services/GroupKeyService.d.ts.map +1 -0
- package/dist/services/ProfileService.d.ts +19 -0
- package/dist/services/ProfileService.d.ts.map +1 -0
- package/dist/services/VaultClient.d.ts +53 -0
- package/dist/services/VaultClient.d.ts.map +1 -0
- package/dist/services/VaultPushScheduler.d.ts +49 -0
- package/dist/services/VaultPushScheduler.d.ts.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/storage/CompactStorageManager.d.ts +22 -0
- package/dist/storage/CompactStorageManager.d.ts.map +1 -0
- package/dist/storage/PersistenceMetrics.d.ts +141 -0
- package/dist/storage/PersistenceMetrics.d.ts.map +1 -0
- package/dist/storage/TraceLog.d.ts +85 -0
- package/dist/storage/TraceLog.d.ts.map +1 -0
- package/dist/storage/TracedCompactStorageManager.d.ts +12 -0
- package/dist/storage/TracedCompactStorageManager.d.ts.map +1 -0
- package/dist/types/attestation.d.ts +33 -0
- package/dist/types/attestation.d.ts.map +1 -0
- package/dist/types/contact.d.ts +25 -0
- package/dist/types/contact.d.ts.map +1 -0
- package/dist/types/identity.d.ts +28 -0
- package/dist/types/identity.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/messaging.d.ts +33 -0
- package/dist/types/messaging.d.ts.map +1 -0
- package/dist/types/proof.d.ts +12 -0
- package/dist/types/proof.d.ts.map +1 -0
- package/dist/types/resource-ref.d.ts +25 -0
- package/dist/types/resource-ref.d.ts.map +1 -0
- package/dist/types/space.d.ts +25 -0
- package/dist/types/space.d.ts.map +1 -0
- package/dist/types/verification.d.ts +49 -0
- package/dist/types/verification.d.ts.map +1 -0
- package/dist/verification/VerificationHelper.d.ts +75 -0
- package/dist/verification/VerificationHelper.d.ts.map +1 -0
- package/dist/verification/index.d.ts +2 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/wordlists/german-positive.d.ts +21 -0
- package/dist/wordlists/german-positive.d.ts.map +1 -0
- package/dist/wordlists/index.d.ts +2 -0
- package/dist/wordlists/index.d.ts.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Proof } from './proof';
|
|
2
|
+
/**
|
|
3
|
+
* An attestation is a signed statement about someone.
|
|
4
|
+
* Like a gift - the sender gives, the recipient decides to accept.
|
|
5
|
+
*
|
|
6
|
+
* Empfänger-Prinzip: Stored at the recipient (to).
|
|
7
|
+
* Only the sender (from) signs. The recipient controls visibility via metadata.
|
|
8
|
+
*
|
|
9
|
+
* Example: Anna attests "Ben helped in the garden"
|
|
10
|
+
* - Anna creates: { from: anna, to: ben, claim: "...", proof: anna_sig }
|
|
11
|
+
* - Stored at: Ben
|
|
12
|
+
* - Ben decides: accepted = true/false (via AttestationMetadata)
|
|
13
|
+
*/
|
|
14
|
+
export interface Attestation {
|
|
15
|
+
id: string;
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
claim: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
context?: string;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
proof: Proof;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Local metadata for attestations (not signed, not synced)
|
|
26
|
+
* Controlled entirely by the recipient
|
|
27
|
+
*/
|
|
28
|
+
export interface AttestationMetadata {
|
|
29
|
+
attestationId: string;
|
|
30
|
+
accepted: boolean;
|
|
31
|
+
acceptedAt?: string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=attestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../../src/types/attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contact status
|
|
3
|
+
* - pending: One-sided verification, waiting for mutual
|
|
4
|
+
* - active: Mutual verification complete
|
|
5
|
+
*
|
|
6
|
+
* Note: "Hidden" contacts are handled via excludedMembers in AutoGroup,
|
|
7
|
+
* not via contact status.
|
|
8
|
+
*/
|
|
9
|
+
export type ContactStatus = 'pending' | 'active';
|
|
10
|
+
/**
|
|
11
|
+
* A contact is a local record of someone you've verified.
|
|
12
|
+
* Stores their public key for E2E encryption.
|
|
13
|
+
*/
|
|
14
|
+
export interface Contact {
|
|
15
|
+
did: string;
|
|
16
|
+
publicKey: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
avatar?: string;
|
|
19
|
+
bio?: string;
|
|
20
|
+
status: ContactStatus;
|
|
21
|
+
verifiedAt?: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/types/contact.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEhD;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface Profile {
|
|
2
|
+
name: string;
|
|
3
|
+
bio?: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
offers?: string[];
|
|
6
|
+
needs?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface Identity {
|
|
9
|
+
did: string;
|
|
10
|
+
profile: Profile;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface KeyPair {
|
|
15
|
+
publicKey: CryptoKey;
|
|
16
|
+
privateKey: CryptoKey;
|
|
17
|
+
}
|
|
18
|
+
export interface PublicProfile {
|
|
19
|
+
did: string;
|
|
20
|
+
name: string;
|
|
21
|
+
bio?: string;
|
|
22
|
+
avatar?: string;
|
|
23
|
+
offers?: string[];
|
|
24
|
+
needs?: string[];
|
|
25
|
+
encryptionPublicKey?: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/types/identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,UAAU,EAAE,SAAS,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './identity';
|
|
2
|
+
export * from './contact';
|
|
3
|
+
export * from './verification';
|
|
4
|
+
export * from './attestation';
|
|
5
|
+
export * from './proof';
|
|
6
|
+
export * from './resource-ref';
|
|
7
|
+
export * from './messaging';
|
|
8
|
+
export * from './space';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ResourceRef } from './resource-ref';
|
|
2
|
+
export type MessageType = 'verification' | 'attestation' | 'contact-request' | 'item-key' | 'space-invite' | 'group-key-rotation' | 'profile-update' | 'attestation-ack' | 'ack' | 'content' | 'member-update' | 'personal-sync' | 'space-sync-request';
|
|
3
|
+
/**
|
|
4
|
+
* Standardized envelope format for all cross-user messages.
|
|
5
|
+
* Signature is separate from payload — independently verifiable.
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageEnvelope {
|
|
8
|
+
v: 1;
|
|
9
|
+
id: string;
|
|
10
|
+
type: MessageType;
|
|
11
|
+
fromDid: string;
|
|
12
|
+
toDid: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
encoding: 'json' | 'cbor' | 'base64';
|
|
15
|
+
payload: string;
|
|
16
|
+
signature: string;
|
|
17
|
+
ref?: ResourceRef;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Multi-stage delivery receipts:
|
|
21
|
+
* - accepted: Relay has accepted the message
|
|
22
|
+
* - delivered: Recipient device has received it
|
|
23
|
+
* - acknowledged: Recipient app has processed it (e.g. attestation saved)
|
|
24
|
+
* - failed: Delivery failed (reason in reason field)
|
|
25
|
+
*/
|
|
26
|
+
export interface DeliveryReceipt {
|
|
27
|
+
messageId: string;
|
|
28
|
+
status: 'accepted' | 'delivered' | 'acknowledged' | 'failed';
|
|
29
|
+
timestamp: string;
|
|
30
|
+
reason?: string;
|
|
31
|
+
}
|
|
32
|
+
export type MessagingState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
33
|
+
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,iBAAiB,GACjB,KAAK,GACL,SAAS,GACT,eAAe,GACf,eAAe,GACf,oBAAoB,CAAA;AAExB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,CAAC,CAAA;IACJ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAA;IAC5D,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cryptographic proof for signed documents
|
|
3
|
+
* Based on W3C Data Integrity 1.0
|
|
4
|
+
*/
|
|
5
|
+
export interface Proof {
|
|
6
|
+
type: 'Ed25519Signature2020';
|
|
7
|
+
verificationMethod: string;
|
|
8
|
+
created: string;
|
|
9
|
+
proofPurpose: 'assertionMethod' | 'authentication';
|
|
10
|
+
proofValue: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=proof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/types/proof.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,sBAAsB,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,iBAAiB,GAAG,gBAAgB,CAAA;IAClD,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ResourceRef: Standardized pointer format for WoT resources.
|
|
3
|
+
*
|
|
4
|
+
* Format: wot:<type>:<id>[/<sub-path>]
|
|
5
|
+
*
|
|
6
|
+
* Examples:
|
|
7
|
+
* wot:attestation:abc-123
|
|
8
|
+
* wot:verification:def-456
|
|
9
|
+
* wot:space:wg-kalender
|
|
10
|
+
* wot:space:wg-kalender/item/event-789
|
|
11
|
+
* wot:contact:did:key:z6Mk...
|
|
12
|
+
*/
|
|
13
|
+
export type ResourceType = 'attestation' | 'verification' | 'contact' | 'space' | 'item';
|
|
14
|
+
declare const __brand: unique symbol;
|
|
15
|
+
export type ResourceRef = string & {
|
|
16
|
+
readonly [__brand]: 'ResourceRef';
|
|
17
|
+
};
|
|
18
|
+
export declare function createResourceRef(type: ResourceType, id: string, subPath?: string): ResourceRef;
|
|
19
|
+
export declare function parseResourceRef(ref: ResourceRef): {
|
|
20
|
+
type: ResourceType;
|
|
21
|
+
id: string;
|
|
22
|
+
subPath?: string;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=resource-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-ref.d.ts","sourceRoot":"","sources":["../../src/types/resource-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,cAAc,GACd,SAAS,GACT,OAAO,GACP,MAAM,CAAA;AAEV,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAA;AACpC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE,CAAA;AAUxE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,MAAM,GACf,WAAW,CAGb;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,GACf;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CA+BtD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ReplicationState = 'idle' | 'syncing' | 'error';
|
|
2
|
+
export interface SpaceInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'personal' | 'shared';
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
image?: string;
|
|
8
|
+
modules?: string[];
|
|
9
|
+
/** App identifier for cross-app space isolation (e.g. 'rls', 'wot-demo') */
|
|
10
|
+
appTag?: string;
|
|
11
|
+
members: string[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SpaceDocMeta {
|
|
15
|
+
name?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
image?: string;
|
|
18
|
+
modules?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface SpaceMemberChange {
|
|
21
|
+
spaceId: string;
|
|
22
|
+
did: string;
|
|
23
|
+
action: 'added' | 'removed';
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/types/space.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;AAE3D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Proof } from './proof';
|
|
2
|
+
/**
|
|
3
|
+
* A verification is a signed statement: "I have verified this person"
|
|
4
|
+
*
|
|
5
|
+
* Empfänger-Prinzip: Stored at the recipient (to).
|
|
6
|
+
* Each direction is a separate Verification document.
|
|
7
|
+
*
|
|
8
|
+
* Example: Anna verifies Ben
|
|
9
|
+
* - Anna creates: { from: anna, to: ben, proof: anna_sig }
|
|
10
|
+
* - Stored at: Ben
|
|
11
|
+
*/
|
|
12
|
+
export interface Verification {
|
|
13
|
+
id: string;
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
timestamp: string;
|
|
17
|
+
location?: GeoLocation;
|
|
18
|
+
proof: Proof;
|
|
19
|
+
}
|
|
20
|
+
export interface GeoLocation {
|
|
21
|
+
latitude: number;
|
|
22
|
+
longitude: number;
|
|
23
|
+
accuracy?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Challenge sent during verification handshake
|
|
27
|
+
*/
|
|
28
|
+
export interface VerificationChallenge {
|
|
29
|
+
nonce: string;
|
|
30
|
+
timestamp: string;
|
|
31
|
+
fromDid: string;
|
|
32
|
+
fromPublicKey: string;
|
|
33
|
+
fromName?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Response to a verification challenge
|
|
37
|
+
* Includes both responder's info and original challenge info
|
|
38
|
+
*/
|
|
39
|
+
export interface VerificationResponse {
|
|
40
|
+
nonce: string;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
toDid: string;
|
|
43
|
+
toPublicKey: string;
|
|
44
|
+
toName?: string;
|
|
45
|
+
fromDid: string;
|
|
46
|
+
fromPublicKey: string;
|
|
47
|
+
fromName?: string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/types/verification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,KAAK,EAAE,KAAK,CAAA;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { WotIdentity } from '../identity/WotIdentity';
|
|
2
|
+
import { Verification } from '../types/verification';
|
|
3
|
+
/**
|
|
4
|
+
* VerificationHelper - Utilities for in-person verification flow
|
|
5
|
+
*
|
|
6
|
+
* Implements challenge-response protocol with Ed25519 signatures.
|
|
7
|
+
*/
|
|
8
|
+
export declare class VerificationHelper {
|
|
9
|
+
/**
|
|
10
|
+
* Create a verification challenge
|
|
11
|
+
*
|
|
12
|
+
* @param identity - WotIdentity of challenger
|
|
13
|
+
* @param name - Display name of challenger
|
|
14
|
+
* @returns Base64-encoded challenge string
|
|
15
|
+
*/
|
|
16
|
+
static createChallenge(identity: WotIdentity, name: string): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Respond to a verification challenge
|
|
19
|
+
*
|
|
20
|
+
* @param challengeCode - Base64-encoded challenge
|
|
21
|
+
* @param identity - WotIdentity of responder
|
|
22
|
+
* @param name - Display name of responder
|
|
23
|
+
* @returns Base64-encoded response string
|
|
24
|
+
*/
|
|
25
|
+
static respondToChallenge(challengeCode: string, identity: WotIdentity, name: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Complete verification by creating signed verification object
|
|
28
|
+
*
|
|
29
|
+
* @param responseCode - Base64-encoded response
|
|
30
|
+
* @param identity - WotIdentity of initiator (signer)
|
|
31
|
+
* @param expectedNonce - Nonce from original challenge
|
|
32
|
+
* @returns Signed Verification object
|
|
33
|
+
* @throws Error if nonce mismatch
|
|
34
|
+
*/
|
|
35
|
+
static completeVerification(responseCode: string, identity: WotIdentity, expectedNonce: string): Promise<Verification>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a verification for a specific DID (Empfänger-Prinzip).
|
|
38
|
+
* Used when Bob verifies Alice: from=Bob, to=Alice.
|
|
39
|
+
*
|
|
40
|
+
* @param identity - WotIdentity of the signer (from)
|
|
41
|
+
* @param toDid - DID of the person being verified (to/recipient)
|
|
42
|
+
* @param nonce - Nonce from the challenge for deterministic ID
|
|
43
|
+
* @returns Signed Verification object
|
|
44
|
+
*/
|
|
45
|
+
static createVerificationFor(identity: WotIdentity, toDid: string, nonce: string): Promise<Verification>;
|
|
46
|
+
/**
|
|
47
|
+
* Verify signature on a verification object
|
|
48
|
+
*
|
|
49
|
+
* @param verification - Verification object to verify
|
|
50
|
+
* @returns True if signature is valid
|
|
51
|
+
*/
|
|
52
|
+
static verifySignature(verification: Verification): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Extract public key from did:key DID
|
|
55
|
+
*
|
|
56
|
+
* @param did - DID in format did:key:z6Mk...
|
|
57
|
+
* @returns Multibase-encoded public key (z6Mk...)
|
|
58
|
+
*/
|
|
59
|
+
static publicKeyFromDid(did: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Convert multibase (base58btc) to bytes
|
|
62
|
+
*
|
|
63
|
+
* @param multibase - Multibase string (z-prefixed base58btc)
|
|
64
|
+
* @returns Uint8Array of decoded bytes
|
|
65
|
+
*/
|
|
66
|
+
static multibaseToBytes(multibase: string): Uint8Array;
|
|
67
|
+
/**
|
|
68
|
+
* Convert base64url to bytes
|
|
69
|
+
*
|
|
70
|
+
* @param base64url - Base64url-encoded string
|
|
71
|
+
* @returns Uint8Array of decoded bytes
|
|
72
|
+
*/
|
|
73
|
+
static base64UrlToBytes(base64url: string): Uint8Array;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=VerificationHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationHelper.d.ts","sourceRoot":"","sources":["../../src/verification/VerificationHelper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,uBAAuB,CAAA;AAG9B;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;OAMG;WACU,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYlF;;;;;;;OAOG;WACU,kBAAkB,CAC7B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC;IAmBlB;;;;;;;;OAQG;WACU,oBAAoB,CAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,EACrB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,YAAY,CAAC;IAmCxB;;;;;;;;OAQG;WACU,qBAAqB,CAChC,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,CAAC;IA0BxB;;;;;OAKG;WACU,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IA2C1E;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQ5C;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU;IAkBtD;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU;CAcvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* German Wordlist for BIP39 Mnemonic Generation
|
|
3
|
+
*
|
|
4
|
+
* Source: https://github.com/dys2p/wordlists-de/blob/main/de-2048-v1.txt
|
|
5
|
+
*
|
|
6
|
+
* A curated list of 2048 German words for generating memorable
|
|
7
|
+
* recovery phrases (Magische Wörter).
|
|
8
|
+
*
|
|
9
|
+
* Technical requirements (BIP39):
|
|
10
|
+
* - Exactly 2048 words (2^11 for 11-bit entropy per word)
|
|
11
|
+
* - First 4 characters must be unique across all words
|
|
12
|
+
* - Only lowercase letters
|
|
13
|
+
* - Alphabetically sorted
|
|
14
|
+
*
|
|
15
|
+
* Content focus:
|
|
16
|
+
* - Common German words
|
|
17
|
+
* - Noun-focused for memorability
|
|
18
|
+
* - Suitable for recovery phrases
|
|
19
|
+
*/
|
|
20
|
+
export declare const germanPositiveWordlist: string[];
|
|
21
|
+
//# sourceMappingURL=german-positive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"german-positive.d.ts","sourceRoot":"","sources":["../../src/wordlists/german-positive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,EA8M1C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wordlists/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@web_of_trust/core",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Core library for building decentralized Web of Trust applications",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/antontranelis/web-of-trust.git",
|
|
8
|
+
"directory": "packages/wot-core"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "vite build",
|
|
29
|
+
"dev": "vite build --watch",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:watch": "vitest",
|
|
32
|
+
"typecheck": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@noble/ed25519": "^3.0.0",
|
|
36
|
+
"@scure/base": "^2.0.0",
|
|
37
|
+
"@scure/bip39": "^2.0.1",
|
|
38
|
+
"idb": "^8.0.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"fake-indexeddb": "^6.2.5",
|
|
42
|
+
"happy-dom": "^20.5.0",
|
|
43
|
+
"typescript": "~5.7.2",
|
|
44
|
+
"vite": "^6.0.7",
|
|
45
|
+
"vite-plugin-dts": "^4.4.0",
|
|
46
|
+
"vitest": "^4.1.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^19.0.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"react": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|