@twin.org/synchronised-storage-service 0.0.1-next.9 → 0.0.3-next.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.
Files changed (55) hide show
  1. package/dist/es/data/verifiableStorageKeys.json +5 -0
  2. package/dist/es/entities/syncSnapshotEntry.js +93 -0
  3. package/dist/es/entities/syncSnapshotEntry.js.map +1 -0
  4. package/dist/es/helpers/blobStorageHelper.js +185 -0
  5. package/dist/es/helpers/blobStorageHelper.js.map +1 -0
  6. package/dist/es/helpers/changeSetHelper.js +215 -0
  7. package/dist/es/helpers/changeSetHelper.js.map +1 -0
  8. package/dist/es/helpers/localSyncStateHelper.js +384 -0
  9. package/dist/es/helpers/localSyncStateHelper.js.map +1 -0
  10. package/dist/es/helpers/remoteSyncStateHelper.js +560 -0
  11. package/dist/es/helpers/remoteSyncStateHelper.js.map +1 -0
  12. package/dist/es/helpers/versions.js +6 -0
  13. package/dist/es/helpers/versions.js.map +1 -0
  14. package/dist/es/index.js +13 -0
  15. package/dist/es/index.js.map +1 -0
  16. package/dist/es/models/ISyncPointerStore.js +4 -0
  17. package/dist/es/models/ISyncPointerStore.js.map +1 -0
  18. package/dist/es/models/ISyncSnapshot.js +4 -0
  19. package/dist/es/models/ISyncSnapshot.js.map +1 -0
  20. package/dist/es/models/ISyncState.js +2 -0
  21. package/dist/es/models/ISyncState.js.map +1 -0
  22. package/dist/es/models/ISynchronisedStorageServiceConfig.js +4 -0
  23. package/dist/es/models/ISynchronisedStorageServiceConfig.js.map +1 -0
  24. package/dist/es/models/ISynchronisedStorageServiceConstructorOptions.js +2 -0
  25. package/dist/es/models/ISynchronisedStorageServiceConstructorOptions.js.map +1 -0
  26. package/dist/es/restEntryPoints.js +10 -0
  27. package/dist/es/restEntryPoints.js.map +1 -0
  28. package/dist/es/schema.js +11 -0
  29. package/dist/es/schema.js.map +1 -0
  30. package/dist/es/synchronisedStorageRoutes.js +142 -0
  31. package/dist/es/synchronisedStorageRoutes.js.map +1 -0
  32. package/dist/es/synchronisedStorageService.js +512 -0
  33. package/dist/es/synchronisedStorageService.js.map +1 -0
  34. package/dist/types/entities/syncSnapshotEntry.d.ts +3 -3
  35. package/dist/types/helpers/blobStorageHelper.d.ts +3 -3
  36. package/dist/types/helpers/changeSetHelper.d.ts +16 -32
  37. package/dist/types/helpers/localSyncStateHelper.d.ts +11 -11
  38. package/dist/types/helpers/remoteSyncStateHelper.d.ts +18 -14
  39. package/dist/types/index.d.ts +10 -10
  40. package/dist/types/models/ISyncState.d.ts +1 -1
  41. package/dist/types/models/ISynchronisedStorageServiceConfig.d.ts +7 -8
  42. package/dist/types/models/ISynchronisedStorageServiceConstructorOptions.d.ts +6 -6
  43. package/dist/types/synchronisedStorageRoutes.d.ts +1 -1
  44. package/dist/types/synchronisedStorageService.d.ts +17 -21
  45. package/docs/architecture.md +168 -12
  46. package/docs/changelog.md +149 -0
  47. package/docs/open-api/spec.json +62 -57
  48. package/docs/reference/classes/SyncSnapshotEntry.md +4 -10
  49. package/docs/reference/classes/SynchronisedStorageService.md +38 -50
  50. package/docs/reference/interfaces/ISynchronisedStorageServiceConfig.md +11 -17
  51. package/docs/reference/interfaces/ISynchronisedStorageServiceConstructorOptions.md +8 -8
  52. package/locales/en.json +7 -15
  53. package/package.json +26 -9
  54. package/dist/cjs/index.cjs +0 -2235
  55. package/dist/esm/index.mjs +0 -2227
package/docs/changelog.md CHANGED
@@ -1,5 +1,154 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.2](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.3-next.1...synchronised-storage-service-v0.0.3-next.2) (2025-12-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * use trust component ([424f0d6](https://github.com/twinfoundation/synchronised-storage/commit/424f0d6aaacfdc7700c46fe6c2def23b2eacddc9))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/synchronised-storage-models bumped from 0.0.3-next.1 to 0.0.3-next.2
16
+
17
+ ## [0.0.3-next.1](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.3-next.0...synchronised-storage-service-v0.0.3-next.1) (2025-11-12)
18
+
19
+
20
+ ### Features
21
+
22
+ * add async item requests to reduce storage overhead ([#3](https://github.com/twinfoundation/synchronised-storage/issues/3)) ([af4e17d](https://github.com/twinfoundation/synchronised-storage/commit/af4e17d826f0a8278fd60dc69aaa21fe6895425f))
23
+ * add context id features ([#24](https://github.com/twinfoundation/synchronised-storage/issues/24)) ([5266b18](https://github.com/twinfoundation/synchronised-storage/commit/5266b18088317c7dc274a209a79102a6fc88a8e4))
24
+ * add guards for verifiable storage keys ([5182e8b](https://github.com/twinfoundation/synchronised-storage/commit/5182e8b2a7868e8d396fd02964b0ed7f0c0a5947))
25
+ * add payload versioning ([3bbbce0](https://github.com/twinfoundation/synchronised-storage/commit/3bbbce0bdf24bbe67c1a265704538d505d7feb91))
26
+ * add rights management integration ([56fff6b](https://github.com/twinfoundation/synchronised-storage/commit/56fff6b4074f7ffaa40920e0c1e9fc98ca669111))
27
+ * add rights management integration ([d003d33](https://github.com/twinfoundation/synchronised-storage/commit/d003d33d2d2b4a4aa1379071eed71a707ebcb4de))
28
+ * add validate-locales ([e3d7b98](https://github.com/twinfoundation/synchronised-storage/commit/e3d7b98839e9ca624855717c8957d572c4e09abf))
29
+ * additional node identity checks ([76257c4](https://github.com/twinfoundation/synchronised-storage/commit/76257c4173303d484391f71f581fd0e214204029))
30
+ * blob storage connector instead of component ([#7](https://github.com/twinfoundation/synchronised-storage/issues/7)) ([ea27241](https://github.com/twinfoundation/synchronised-storage/commit/ea27241cf0810b52ab7a6be7346809d127b7109a))
31
+ * eslint migration to flat config ([f601c14](https://github.com/twinfoundation/synchronised-storage/commit/f601c14f6adef3290554dc7df6e6b3528aa0dc2b))
32
+ * improve consolidation logic ([698232f](https://github.com/twinfoundation/synchronised-storage/commit/698232f57640f87642ecd323cb1e4670eda33343))
33
+ * initial commit ([16949b8](https://github.com/twinfoundation/synchronised-storage/commit/16949b8e5bdb190f053c52af352290e3fd964f9a))
34
+ * remove isTrustedNode from config and rely on trusted component ([cc2d987](https://github.com/twinfoundation/synchronised-storage/commit/cc2d98795044fc97b33fadf871188f6103f5c987))
35
+ * removed unused properties ([7d4e916](https://github.com/twinfoundation/synchronised-storage/commit/7d4e9169e923142cd767c8830f2c009675484df8))
36
+ * switch to chacha20poly1305 for encryption ([ecc7137](https://github.com/twinfoundation/synchronised-storage/commit/ecc713775bc958c15453729aa1d6dacafd789906))
37
+ * switch to logging component ([a606302](https://github.com/twinfoundation/synchronised-storage/commit/a606302d7b89b922d33456b420d8f140d4fd565a))
38
+ * sync testing ([#5](https://github.com/twinfoundation/synchronised-storage/issues/5)) ([f78d5ac](https://github.com/twinfoundation/synchronised-storage/commit/f78d5ac661b891f9912e0a81d028453f909a64b4))
39
+ * update assertion method naming ([fb0118c](https://github.com/twinfoundation/synchronised-storage/commit/fb0118c494f0f520e1850a4e77b54e91235ce9a9))
40
+ * update framework core ([99f09cc](https://github.com/twinfoundation/synchronised-storage/commit/99f09cc94cfb9fff6b3a345775eeae2ab3192ed2))
41
+ * update RSA components ([c57c7b8](https://github.com/twinfoundation/synchronised-storage/commit/c57c7b85d4225deb6efa1228c77b8148bf6e11f7))
42
+ * update to in built vc auth mechanism ([411a371](https://github.com/twinfoundation/synchronised-storage/commit/411a3716830195ebf54755a1633b05d5c3f96754))
43
+
44
+
45
+ ### Dependencies
46
+
47
+ * The following workspace dependencies were updated
48
+ * dependencies
49
+ * @twin.org/synchronised-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
50
+
51
+ ## [0.0.1-next.16](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.15...synchronised-storage-service-v0.0.1-next.16) (2025-10-09)
52
+
53
+
54
+ ### Features
55
+
56
+ * add validate-locales ([e3d7b98](https://github.com/twinfoundation/synchronised-storage/commit/e3d7b98839e9ca624855717c8957d572c4e09abf))
57
+ * update assertion method naming ([fb0118c](https://github.com/twinfoundation/synchronised-storage/commit/fb0118c494f0f520e1850a4e77b54e91235ce9a9))
58
+
59
+
60
+ ### Dependencies
61
+
62
+ * The following workspace dependencies were updated
63
+ * dependencies
64
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.15 to 0.0.1-next.16
65
+
66
+ ## [0.0.1-next.15](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.14...synchronised-storage-service-v0.0.1-next.15) (2025-09-23)
67
+
68
+
69
+ ### Features
70
+
71
+ * add rights management integration ([56fff6b](https://github.com/twinfoundation/synchronised-storage/commit/56fff6b4074f7ffaa40920e0c1e9fc98ca669111))
72
+ * update to in built vc auth mechanism ([411a371](https://github.com/twinfoundation/synchronised-storage/commit/411a3716830195ebf54755a1633b05d5c3f96754))
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * The following workspace dependencies were updated
78
+ * dependencies
79
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.14 to 0.0.1-next.15
80
+
81
+ ## [0.0.1-next.14](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.13...synchronised-storage-service-v0.0.1-next.14) (2025-09-22)
82
+
83
+
84
+ ### Features
85
+
86
+ * add rights management integration ([d003d33](https://github.com/twinfoundation/synchronised-storage/commit/d003d33d2d2b4a4aa1379071eed71a707ebcb4de))
87
+
88
+
89
+ ### Dependencies
90
+
91
+ * The following workspace dependencies were updated
92
+ * dependencies
93
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.13 to 0.0.1-next.14
94
+
95
+ ## [0.0.1-next.13](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.12...synchronised-storage-service-v0.0.1-next.13) (2025-08-29)
96
+
97
+
98
+ ### Features
99
+
100
+ * eslint migration to flat config ([f601c14](https://github.com/twinfoundation/synchronised-storage/commit/f601c14f6adef3290554dc7df6e6b3528aa0dc2b))
101
+ * removed unused properties ([7d4e916](https://github.com/twinfoundation/synchronised-storage/commit/7d4e9169e923142cd767c8830f2c009675484df8))
102
+
103
+
104
+ ### Dependencies
105
+
106
+ * The following workspace dependencies were updated
107
+ * dependencies
108
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.12 to 0.0.1-next.13
109
+
110
+ ## [0.0.1-next.12](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.11...synchronised-storage-service-v0.0.1-next.12) (2025-08-21)
111
+
112
+
113
+ ### Features
114
+
115
+ * update framework core ([99f09cc](https://github.com/twinfoundation/synchronised-storage/commit/99f09cc94cfb9fff6b3a345775eeae2ab3192ed2))
116
+
117
+
118
+ ### Dependencies
119
+
120
+ * The following workspace dependencies were updated
121
+ * dependencies
122
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.11 to 0.0.1-next.12
123
+
124
+ ## [0.0.1-next.11](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.10...synchronised-storage-service-v0.0.1-next.11) (2025-08-15)
125
+
126
+
127
+ ### Features
128
+
129
+ * switch to chacha20poly1305 for encryption ([ecc7137](https://github.com/twinfoundation/synchronised-storage/commit/ecc713775bc958c15453729aa1d6dacafd789906))
130
+
131
+
132
+ ### Dependencies
133
+
134
+ * The following workspace dependencies were updated
135
+ * dependencies
136
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.10 to 0.0.1-next.11
137
+
138
+ ## [0.0.1-next.10](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.9...synchronised-storage-service-v0.0.1-next.10) (2025-08-15)
139
+
140
+
141
+ ### Features
142
+
143
+ * update RSA components ([c57c7b8](https://github.com/twinfoundation/synchronised-storage/commit/c57c7b85d4225deb6efa1228c77b8148bf6e11f7))
144
+
145
+
146
+ ### Dependencies
147
+
148
+ * The following workspace dependencies were updated
149
+ * dependencies
150
+ * @twin.org/synchronised-storage-models bumped from 0.0.1-next.9 to 0.0.1-next.10
151
+
3
152
  ## [0.0.1-next.9](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-service-v0.0.1-next.8...synchronised-storage-service-v0.0.1-next.9) (2025-08-13)
4
153
 
5
154
 
@@ -28,6 +28,27 @@
28
28
  "tags": [
29
29
  "Synchronised Storage"
30
30
  ],
31
+ "parameters": [
32
+ {
33
+ "name": "accept",
34
+ "in": "header",
35
+ "required": true,
36
+ "schema": {
37
+ "type": "string"
38
+ },
39
+ "style": "simple"
40
+ },
41
+ {
42
+ "name": "authorization",
43
+ "in": "header",
44
+ "required": true,
45
+ "schema": {
46
+ "type": "string"
47
+ },
48
+ "style": "simple",
49
+ "example": "z3V32BP9ShC...z3V32BP9ShC"
50
+ }
51
+ ],
31
52
  "requestBody": {
32
53
  "description": "Request a trusted node to perform a sync request for a changeset.",
33
54
  "required": true,
@@ -39,10 +60,12 @@
39
60
  "examples": {
40
61
  "synchronisedStorageSyncChangeSetRequestExample": {
41
62
  "value": {
63
+ "@context": "https://schema.twindev.org/synchronised-storage",
64
+ "type": "ChangeSet",
42
65
  "id": "0909090909090909090909090909090909090909090909090909090909090909",
43
66
  "dateCreated": "2025-05-29T01:00:00.000Z",
44
67
  "dateModified": "2025-05-29T01:00:00.000Z",
45
- "nodeIdentity": "did:entity-storage:0xd2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2",
68
+ "nodeId": "did:entity-storage:0xd2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2",
46
69
  "changes": [
47
70
  {
48
71
  "entity": {
@@ -52,15 +75,6 @@
52
75
  "operation": "set"
53
76
  }
54
77
  ],
55
- "proof": {
56
- "@context": "https://www.w3.org/ns/credentials/v2",
57
- "created": "2025-05-29T01:00:00.000Z",
58
- "cryptosuite": "eddsa-jcs-2022",
59
- "proofPurpose": "assertionMethod",
60
- "proofValue": "z5efBErQs3YBLZoH7jgKMQaRc9YjAxA5XSYKmW3FmTBDw9WionT2NS2x1SMvcRyBvw53cSSoaCT1xQH9tkWngGCX3",
61
- "type": "DataIntegrityProof",
62
- "verificationMethod": "did:entity-storage:0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0#synchronised-storage-assertion"
63
- },
64
78
  "storageKey": "test-type"
65
79
  }
66
80
  }
@@ -83,7 +97,7 @@
83
97
  "exampleResponse": {
84
98
  "value": {
85
99
  "name": "GeneralError",
86
- "message": "component.error",
100
+ "message": "errorMessage",
87
101
  "properties": {
88
102
  "foo": "bar"
89
103
  }
@@ -104,7 +118,7 @@
104
118
  "exampleResponse": {
105
119
  "value": {
106
120
  "name": "InternalServerError",
107
- "message": "component.error"
121
+ "message": "errorMessage"
108
122
  }
109
123
  }
110
124
  }
@@ -128,22 +142,6 @@
128
142
  "application/json": {
129
143
  "schema": {
130
144
  "$ref": "#/components/schemas/SyncChangeSet"
131
- },
132
- "examples": {
133
- "synchronisedStorageSyncGetDecryptionKeyRequestExample": {
134
- "value": {
135
- "nodeIdentity": "did:entity-storage:0xd2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2",
136
- "proof": {
137
- "@context": "https://www.w3.org/ns/credentials/v2",
138
- "created": "2025-05-29T01:00:00.000Z",
139
- "cryptosuite": "eddsa-jcs-2022",
140
- "proofPurpose": "assertionMethod",
141
- "proofValue": "z5efBErQs3YBLZoH7jgKMQaRc9YjAxA5XSYKmW3FmTBDw9WionT2NS2x1SMvcRyBvw53cSSoaCT1xQH9tkWngGCX3",
142
- "type": "DataIntegrityProof",
143
- "verificationMethod": "did:entity-storage:0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0#synchronised-storage-assertion"
144
- }
145
- }
146
- }
147
145
  }
148
146
  }
149
147
  }
@@ -177,7 +175,7 @@
177
175
  "exampleResponse": {
178
176
  "value": {
179
177
  "name": "GeneralError",
180
- "message": "component.error",
178
+ "message": "errorMessage",
181
179
  "properties": {
182
180
  "foo": "bar"
183
181
  }
@@ -198,7 +196,7 @@
198
196
  "exampleResponse": {
199
197
  "value": {
200
198
  "name": "UnauthorizedError",
201
- "message": "component.error"
199
+ "message": "errorMessage"
202
200
  }
203
201
  }
204
202
  }
@@ -216,7 +214,7 @@
216
214
  "exampleResponse": {
217
215
  "value": {
218
216
  "name": "InternalServerError",
219
- "message": "component.error"
217
+ "message": "errorMessage"
220
218
  }
221
219
  }
222
220
  }
@@ -253,7 +251,7 @@
253
251
  "type": "string",
254
252
  "description": "The stack trace for the error."
255
253
  },
256
- "inner": {
254
+ "cause": {
257
255
  "$ref": "#/components/schemas/Error"
258
256
  }
259
257
  },
@@ -264,7 +262,7 @@
264
262
  "additionalProperties": false,
265
263
  "description": "Model to describe serialized error."
266
264
  },
267
- "SyncChange<SynchronisedEntity>": {
265
+ "SyncChange": {
268
266
  "type": "object",
269
267
  "properties": {
270
268
  "operation": {
@@ -275,7 +273,7 @@
275
273
  "description": "The item id."
276
274
  },
277
275
  "entity": {
278
- "$ref": "#/components/schemas/SynchronisedEntity"
276
+ "$ref": "#/components/schemas/SynchronisedEntityCore"
279
277
  }
280
278
  },
281
279
  "required": [
@@ -303,47 +301,53 @@
303
301
  "SyncChangeSet": {
304
302
  "type": "object",
305
303
  "properties": {
306
- "id": {
304
+ "@context": {
307
305
  "type": "string",
308
- "description": "The id of the change set."
306
+ "const": "https://schema.twindev.org/synchronised-storage",
307
+ "description": "The LD Context for the change set."
309
308
  },
310
- "dateCreated": {
309
+ "type": {
311
310
  "type": "string",
312
- "description": "The date the change set was created."
311
+ "const": "ChangeSet",
312
+ "description": "The LD Type for the change set."
313
+ },
314
+ "id": {
315
+ "type": "string",
316
+ "description": "The id of the change set."
313
317
  },
314
318
  "storageKey": {
315
319
  "type": "string",
316
320
  "description": "The storage key of the change set. This is used to identify the entities being synchronised."
317
321
  },
322
+ "dateCreated": {
323
+ "type": "string",
324
+ "description": "The date the change set was created."
325
+ },
318
326
  "dateModified": {
319
327
  "type": "string",
320
328
  "description": "The date the change set was last modified."
321
329
  },
322
- "changes": {
323
- "type": "array",
324
- "items": false,
325
- "description": "The changes to apply after a snapshot.",
326
- "prefixItems": [
327
- {
328
- "$ref": "#/components/schemas/SyncChange<SynchronisedEntity>"
329
- }
330
- ]
331
- },
332
- "nodeIdentity": {
330
+ "nodeId": {
333
331
  "type": "string",
334
332
  "description": "The identity of the node that created the change set."
335
333
  },
336
- "proof": {
337
- "$ref": "https://schema.twindev.org/w3c-did/Proof"
334
+ "changes": {
335
+ "type": "array",
336
+ "items": {
337
+ "$ref": "#/components/schemas/SyncChange"
338
+ },
339
+ "description": "The changes to apply after a snapshot."
338
340
  }
339
341
  },
340
342
  "required": [
343
+ "@context",
344
+ "type",
341
345
  "id",
342
- "dateCreated",
343
346
  "storageKey",
347
+ "dateCreated",
344
348
  "dateModified",
345
- "changes",
346
- "nodeIdentity"
349
+ "nodeId",
350
+ "changes"
347
351
  ],
348
352
  "additionalProperties": false,
349
353
  "description": "The object definition for a sync change set."
@@ -362,18 +366,19 @@
362
366
  "additionalProperties": false,
363
367
  "description": "The body of the response."
364
368
  },
365
- "SynchronisedEntity": {
369
+ "SynchronisedEntityCore": {
366
370
  "type": "object",
367
371
  "properties": {
368
372
  "dateModified": {
369
373
  "type": "string",
370
- "description": "The date the entry was modified"
374
+ "description": "The date the entry was modified."
371
375
  }
372
376
  },
373
377
  "required": [
374
378
  "dateModified"
375
379
  ],
376
- "additionalProperties": false
380
+ "additionalProperties": false,
381
+ "description": "The base definition for synchronised entries."
377
382
  }
378
383
  },
379
384
  "securitySchemes": {
@@ -1,22 +1,16 @@
1
- # Class: SyncSnapshotEntry\<T\>
1
+ # Class: SyncSnapshotEntry
2
2
 
3
3
  Class representing an entry for the sync snapshot.
4
4
 
5
- ## Type Parameters
6
-
7
- ### T
8
-
9
- `T` *extends* `ISynchronisedEntity` = `ISynchronisedEntity`
10
-
11
5
  ## Constructors
12
6
 
13
7
  ### Constructor
14
8
 
15
- > **new SyncSnapshotEntry**\<`T`\>(): `SyncSnapshotEntry`\<`T`\>
9
+ > **new SyncSnapshotEntry**(): `SyncSnapshotEntry`
16
10
 
17
11
  #### Returns
18
12
 
19
- `SyncSnapshotEntry`\<`T`\>
13
+ `SyncSnapshotEntry`
20
14
 
21
15
  ## Properties
22
16
 
@@ -94,6 +88,6 @@ The ids of the storage for the change sets in the snapshot, if this is not a loc
94
88
 
95
89
  ### changes?
96
90
 
97
- > `optional` **changes**: `ISyncChange`\<`T`\>[]
91
+ > `optional` **changes**: `ISyncChange`[]
98
92
 
99
93
  The changes that were made in this snapshot, if this is a local snapshot.
@@ -1,13 +1,7 @@
1
- # Class: SynchronisedStorageService\<T\>
1
+ # Class: SynchronisedStorageService
2
2
 
3
3
  Class for performing synchronised storage operations.
4
4
 
5
- ## Type Parameters
6
-
7
- ### T
8
-
9
- `T` *extends* `ISynchronisedEntity` = `ISynchronisedEntity`
10
-
11
5
  ## Implements
12
6
 
13
7
  - `ISynchronisedStorageComponent`
@@ -16,7 +10,7 @@ Class for performing synchronised storage operations.
16
10
 
17
11
  ### Constructor
18
12
 
19
- > **new SynchronisedStorageService**\<`T`\>(`options`): `SynchronisedStorageService`\<`T`\>
13
+ > **new SynchronisedStorageService**(`options`): `SynchronisedStorageService`
20
14
 
21
15
  Create a new instance of SynchronisedStorageService.
22
16
 
@@ -30,45 +24,49 @@ The options for the service.
30
24
 
31
25
  #### Returns
32
26
 
33
- `SynchronisedStorageService`\<`T`\>
27
+ `SynchronisedStorageService`
34
28
 
35
29
  ## Properties
36
30
 
37
31
  ### CLASS\_NAME
38
32
 
39
- > `readonly` **CLASS\_NAME**: `string`
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
40
34
 
41
35
  Runtime name for the class.
42
36
 
43
- #### Implementation of
37
+ ## Methods
44
38
 
45
- `ISynchronisedStorageComponent.CLASS_NAME`
39
+ ### className()
46
40
 
47
- ## Methods
41
+ > **className**(): `string`
48
42
 
49
- ### start()
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
50
46
 
51
- > **start**(`nodeIdentity`, `nodeLoggingConnectorType`, `componentState?`): `Promise`\<`void`\>
47
+ `string`
52
48
 
53
- The component needs to be started when the node is initialized.
49
+ The class name of the component.
54
50
 
55
- #### Parameters
51
+ #### Implementation of
56
52
 
57
- ##### nodeIdentity
53
+ `ISynchronisedStorageComponent.className`
58
54
 
59
- `string`
55
+ ***
56
+
57
+ ### start()
60
58
 
61
- The identity of the node starting the component.
59
+ > **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
62
60
 
63
- ##### nodeLoggingConnectorType
61
+ The component needs to be started when the node is initialized.
64
62
 
65
- The node logging connector type, defaults to "node-logging".
63
+ #### Parameters
66
64
 
67
- `undefined` | `string`
65
+ ##### nodeLoggingComponentType?
68
66
 
69
- ##### componentState?
67
+ `string`
70
68
 
71
- A persistent state which can be modified by the method.
69
+ The node logging component type.
72
70
 
73
71
  #### Returns
74
72
 
@@ -84,27 +82,17 @@ Nothing.
84
82
 
85
83
  ### stop()
86
84
 
87
- > **stop**(`nodeIdentity`, `nodeLoggingConnectorType`, `componentState?`): `Promise`\<`void`\>
85
+ > **stop**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
88
86
 
89
87
  The component needs to be stopped when the node is closed.
90
88
 
91
89
  #### Parameters
92
90
 
93
- ##### nodeIdentity
91
+ ##### nodeLoggingComponentType?
94
92
 
95
93
  `string`
96
94
 
97
- The identity of the node stopping the component.
98
-
99
- ##### nodeLoggingConnectorType
100
-
101
- The node logging connector type, defaults to "node-logging".
102
-
103
- `undefined` | `string`
104
-
105
- ##### componentState?
106
-
107
- A persistent state which can be modified by the method.
95
+ The node logging component type.
108
96
 
109
97
  #### Returns
110
98
 
@@ -120,24 +108,18 @@ Nothing.
120
108
 
121
109
  ### getDecryptionKey()
122
110
 
123
- > **getDecryptionKey**(`nodeIdentity`, `proof`): `Promise`\<`string`\>
111
+ > **getDecryptionKey**(`trustPayload`): `Promise`\<`string`\>
124
112
 
125
113
  Get the decryption key for the synchronised storage.
126
114
  This is used to decrypt the data stored in the synchronised storage.
127
115
 
128
116
  #### Parameters
129
117
 
130
- ##### nodeIdentity
131
-
132
- `string`
133
-
134
- The identity of the node requesting the decryption key.
118
+ ##### trustPayload
135
119
 
136
- ##### proof
120
+ `unknown`
137
121
 
138
- `IProof`
139
-
140
- The proof of the request so we know the request is from the specified node.
122
+ Trust payload to verify the requesters identity.
141
123
 
142
124
  #### Returns
143
125
 
@@ -153,7 +135,7 @@ The decryption key.
153
135
 
154
136
  ### syncChangeSet()
155
137
 
156
- > **syncChangeSet**(`syncChangeSet`): `Promise`\<`void`\>
138
+ > **syncChangeSet**(`syncChangeSet`, `trustPayload`): `Promise`\<`void`\>
157
139
 
158
140
  Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
159
141
 
@@ -161,10 +143,16 @@ Synchronise a set of changes from an untrusted node, assumes this is a trusted n
161
143
 
162
144
  ##### syncChangeSet
163
145
 
164
- `ISyncChangeSet`\<`T`\>
146
+ `ISyncChangeSet`
165
147
 
166
148
  The change set to synchronise.
167
149
 
150
+ ##### trustPayload
151
+
152
+ `unknown`
153
+
154
+ Trust payload to verify the requesters identity.
155
+
168
156
  #### Returns
169
157
 
170
158
  `Promise`\<`void`\>
@@ -4,20 +4,6 @@ Configuration for the Synchronised Storage Service.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### synchronisedStorageMethodId?
8
-
9
- > `optional` **synchronisedStorageMethodId**: `string`
10
-
11
- The id of the identity method to use when signing/verifying requests and changesets.
12
-
13
- #### Default
14
-
15
- ```ts
16
- synchronised-storage-assertion
17
- ```
18
-
19
- ***
20
-
21
7
  ### entityUpdateIntervalMinutes?
22
8
 
23
9
  > `optional` **entityUpdateIntervalMinutes**: `number`
@@ -36,7 +22,7 @@ How often to check for entity updates in minutes.
36
22
 
37
23
  > `optional` **consolidationIntervalMinutes**: `number`
38
24
 
39
- Interval to perform consolidation of changesets, only used if isTrustedNode is set.
25
+ Interval to perform consolidation of changesets, only used if this is a trusted node.
40
26
 
41
27
  #### Default
42
28
 
@@ -50,7 +36,7 @@ Interval to perform consolidation of changesets, only used if isTrustedNode is s
50
36
 
51
37
  > `optional` **consolidationBatchSize**: `number`
52
38
 
53
- The number of entities to process in a single consolidation batch.
39
+ The number of entities to process in a single consolidation batch, only used if this is a trusted node.
54
40
 
55
41
  #### Default
56
42
 
@@ -64,7 +50,7 @@ The number of entities to process in a single consolidation batch.
64
50
 
65
51
  > `optional` **maxConsolidations**: `number`
66
52
 
67
- The maximum number of consolidations to keep in storage.
53
+ The maximum number of consolidations to keep in storage, only used if this is a trusted node.
68
54
 
69
55
  #### Default
70
56
 
@@ -100,3 +86,11 @@ if the key is not found in the keys.json it is considered to be a custom verifia
100
86
  ```ts
101
87
  local
102
88
  ```
89
+
90
+ ***
91
+
92
+ ### overrideTrustGeneratorType?
93
+
94
+ > `optional` **overrideTrustGeneratorType**: `string`
95
+
96
+ Override the default trust generator.