@web_of_trust/adapter-yjs 0.1.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 +136 -0
- package/dist/YjsPersonalDocManager.d.ts +56 -0
- package/dist/YjsPersonalDocManager.d.ts.map +1 -0
- package/dist/YjsPersonalSyncAdapter.d.ts +33 -0
- package/dist/YjsPersonalSyncAdapter.d.ts.map +1 -0
- package/dist/YjsReplicationAdapter.d.ts +151 -0
- package/dist/YjsReplicationAdapter.d.ts.map +1 -0
- package/dist/YjsStorageAdapter.d.ts +35 -0
- package/dist/YjsStorageAdapter.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1816 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +50 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document types for the Yjs Personal Document.
|
|
3
|
+
*
|
|
4
|
+
* These types define the shape of data stored in the Y.Doc.
|
|
5
|
+
* They are identical to the types in adapter-automerge's PersonalDocManager
|
|
6
|
+
* because both adapters manage the same personal document schema.
|
|
7
|
+
*/
|
|
8
|
+
export interface OutboxEntryDoc {
|
|
9
|
+
envelopeJson: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
retryCount: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SpaceMetadataDoc {
|
|
14
|
+
info: {
|
|
15
|
+
id: string;
|
|
16
|
+
type: string;
|
|
17
|
+
name: string | null;
|
|
18
|
+
description: string | null;
|
|
19
|
+
appTag?: string;
|
|
20
|
+
members: string[];
|
|
21
|
+
createdAt: string;
|
|
22
|
+
};
|
|
23
|
+
documentId: string;
|
|
24
|
+
documentUrl: string;
|
|
25
|
+
/** memberEncryptionKeys stored as Record<did, number[]> for serialization */
|
|
26
|
+
memberEncryptionKeys: Record<string, number[]>;
|
|
27
|
+
}
|
|
28
|
+
export interface GroupKeyDoc {
|
|
29
|
+
spaceId: string;
|
|
30
|
+
generation: number;
|
|
31
|
+
key: number[];
|
|
32
|
+
}
|
|
33
|
+
export interface ContactDoc {
|
|
34
|
+
did: string;
|
|
35
|
+
publicKey: string;
|
|
36
|
+
name: string | null;
|
|
37
|
+
avatar: string | null;
|
|
38
|
+
bio: string | null;
|
|
39
|
+
status: string;
|
|
40
|
+
verifiedAt: string | null;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
}
|
|
44
|
+
export interface VerificationDoc {
|
|
45
|
+
id: string;
|
|
46
|
+
fromDid: string;
|
|
47
|
+
toDid: string;
|
|
48
|
+
timestamp: string;
|
|
49
|
+
proofJson: string;
|
|
50
|
+
locationJson: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface AttestationDoc {
|
|
53
|
+
id: string;
|
|
54
|
+
attestationId: string | null;
|
|
55
|
+
fromDid: string;
|
|
56
|
+
toDid: string;
|
|
57
|
+
claim: string;
|
|
58
|
+
tagsJson: string | null;
|
|
59
|
+
context: string | null;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
proofJson: string;
|
|
62
|
+
}
|
|
63
|
+
export interface AttestationMetadataDoc {
|
|
64
|
+
attestationId: string;
|
|
65
|
+
accepted: boolean;
|
|
66
|
+
acceptedAt: string | null;
|
|
67
|
+
deliveryStatus: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface ProfileDoc {
|
|
70
|
+
did: string;
|
|
71
|
+
name: string | null;
|
|
72
|
+
bio: string | null;
|
|
73
|
+
avatar: string | null;
|
|
74
|
+
offersJson: string | null;
|
|
75
|
+
needsJson: string | null;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PersonalDoc {
|
|
80
|
+
profile: ProfileDoc | null;
|
|
81
|
+
contacts: Record<string, ContactDoc>;
|
|
82
|
+
verifications: Record<string, VerificationDoc>;
|
|
83
|
+
attestations: Record<string, AttestationDoc>;
|
|
84
|
+
attestationMetadata: Record<string, AttestationMetadataDoc>;
|
|
85
|
+
outbox: Record<string, OutboxEntryDoc>;
|
|
86
|
+
spaces: Record<string, SpaceMetadataDoc>;
|
|
87
|
+
groupKeys: Record<string, GroupKeyDoc>;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAC/C;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,EAAE,CAAA;CACd;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,GAAG,EAAE,M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WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC5C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IAC3D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACxC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CACvC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@web_of_trust/adapter-yjs",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Yjs CRDT adapter for Web of Trust — pure JavaScript replication and personal document management",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/antontranelis/web-of-trust.git",
|
|
8
|
+
"directory": "packages/adapter-yjs"
|
|
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
|
+
"yjs": "^13.6.30",
|
|
36
|
+
"y-protocols": "^1.0.7"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@web_of_trust/core": "workspace:*"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@web_of_trust/core": "workspace:*",
|
|
43
|
+
"fake-indexeddb": "^6.2.5",
|
|
44
|
+
"happy-dom": "^20.5.0",
|
|
45
|
+
"typescript": "~5.7.2",
|
|
46
|
+
"vite": "^6.0.7",
|
|
47
|
+
"vite-plugin-dts": "^4.4.0",
|
|
48
|
+
"vitest": "^4.1.0"
|
|
49
|
+
}
|
|
50
|
+
}
|