@twin.org/synchronised-storage-service 0.0.1-next.3 → 0.0.1-next.4

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 (34) hide show
  1. package/dist/cjs/index.cjs +641 -176
  2. package/dist/esm/index.mjs +642 -178
  3. package/dist/types/entities/syncSnapshotEntry.d.ts +1 -2
  4. package/dist/types/helpers/blobStorageHelper.d.ts +33 -0
  5. package/dist/types/helpers/changeSetHelper.d.ts +19 -7
  6. package/dist/types/helpers/localSyncStateHelper.d.ts +8 -23
  7. package/dist/types/helpers/remoteSyncStateHelper.d.ts +15 -11
  8. package/dist/types/helpers/versions.d.ts +3 -0
  9. package/dist/types/index.d.ts +0 -2
  10. package/dist/types/models/ISyncPointerStore.d.ts +4 -0
  11. package/dist/types/models/ISyncSnapshot.d.ts +5 -1
  12. package/dist/types/models/ISyncState.d.ts +4 -0
  13. package/dist/types/models/ISynchronisedStorageServiceConfig.d.ts +12 -6
  14. package/dist/types/models/ISynchronisedStorageServiceConstructorOptions.d.ts +6 -2
  15. package/dist/types/synchronisedStorageRoutes.d.ts +9 -1
  16. package/dist/types/synchronisedStorageService.d.ts +13 -4
  17. package/docs/architecture.md +125 -0
  18. package/docs/changelog.md +15 -0
  19. package/docs/open-api/spec.json +244 -18
  20. package/docs/reference/classes/SyncSnapshotEntry.md +1 -1
  21. package/docs/reference/classes/SynchronisedStorageService.md +38 -5
  22. package/docs/reference/functions/synchronisedStorageGetDecryptionKeyRequest.md +31 -0
  23. package/docs/reference/index.md +1 -2
  24. package/docs/reference/interfaces/ISyncPointerStore.md +8 -0
  25. package/docs/reference/interfaces/ISyncSnapshot.md +10 -2
  26. package/docs/reference/interfaces/ISyncState.md +8 -0
  27. package/docs/reference/interfaces/ISynchronisedStorageServiceConfig.md +30 -10
  28. package/docs/reference/interfaces/ISynchronisedStorageServiceConstructorOptions.md +11 -3
  29. package/locales/en.json +46 -18
  30. package/package.json +3 -2
  31. package/dist/types/models/ISyncChange.d.ts +0 -18
  32. package/dist/types/models/ISyncChangeSet.d.ts +0 -36
  33. package/docs/reference/interfaces/ISyncChange.md +0 -33
  34. package/docs/reference/interfaces/ISyncChangeSet.md +0 -65
@@ -21,30 +21,52 @@
21
21
  }
22
22
  ],
23
23
  "paths": {
24
- "/synchronised-storage": {
25
- "get": {
24
+ "/synchronised-storage/sync-changeset": {
25
+ "post": {
26
26
  "operationId": "synchronisedStorageSyncChangeSetRequest",
27
27
  "summary": "Request that the node perform a sync request for a changeset.",
28
28
  "tags": [
29
29
  "Synchronised Storage"
30
30
  ],
31
- "parameters": [
32
- {
33
- "name": "changeSetStorageId",
34
- "description": "The storage id of the changeset.",
35
- "in": "query",
36
- "required": false,
37
- "schema": {
38
- "type": "string"
39
- },
40
- "example": "12345"
41
- }
42
- ],
43
- "security": [
44
- {
45
- "jwtBearerAuthScheme": []
31
+ "requestBody": {
32
+ "description": "Request a trusted node to perform a sync request for a changeset.",
33
+ "required": true,
34
+ "content": {
35
+ "application/json": {
36
+ "schema": {
37
+ "$ref": "#/components/schemas/SyncChangeSet"
38
+ },
39
+ "examples": {
40
+ "synchronisedStorageSyncChangeSetRequestExample": {
41
+ "value": {
42
+ "id": "0909090909090909090909090909090909090909090909090909090909090909",
43
+ "dateCreated": "2025-05-29T01:00:00.000Z",
44
+ "nodeIdentity": "did:entity-storage:0xd2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2",
45
+ "changes": [
46
+ {
47
+ "entity": {
48
+ "dateModified": "2025-01-01T00:00:00.000Z"
49
+ },
50
+ "id": "test-id-1",
51
+ "operation": "set"
52
+ }
53
+ ],
54
+ "proof": {
55
+ "@context": "https://www.w3.org/ns/credentials/v2",
56
+ "created": "2025-05-29T01:00:00.000Z",
57
+ "cryptosuite": "eddsa-jcs-2022",
58
+ "proofPurpose": "assertionMethod",
59
+ "proofValue": "z5efBErQs3YBLZoH7jgKMQaRc9YjAxA5XSYKmW3FmTBDw9WionT2NS2x1SMvcRyBvw53cSSoaCT1xQH9tkWngGCX3",
60
+ "type": "DataIntegrityProof",
61
+ "verificationMethod": "did:entity-storage:0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0#synchronised-storage-assertion"
62
+ },
63
+ "storageKey": "test-type"
64
+ }
65
+ }
66
+ }
67
+ }
46
68
  }
47
- ],
69
+ },
48
70
  "responses": {
49
71
  "204": {
50
72
  "description": "The rest request ended in success with no data."
@@ -70,6 +92,100 @@
70
92
  }
71
93
  }
72
94
  },
95
+ "500": {
96
+ "description": "The server has encountered a situation it does not know how to handle, see the content for more details.",
97
+ "content": {
98
+ "application/json": {
99
+ "schema": {
100
+ "$ref": "#/components/schemas/Error"
101
+ },
102
+ "examples": {
103
+ "exampleResponse": {
104
+ "value": {
105
+ "name": "InternalServerError",
106
+ "message": "component.error"
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "/synchronised-storage/decryption-key": {
117
+ "post": {
118
+ "operationId": "synchronisedStorageGetDecryptionKeyRequest",
119
+ "summary": "Request the decryption key.",
120
+ "tags": [
121
+ "Synchronised Storage"
122
+ ],
123
+ "requestBody": {
124
+ "description": "Request a trusted node to perform a sync request for a changeset.",
125
+ "required": true,
126
+ "content": {
127
+ "application/json": {
128
+ "schema": {
129
+ "$ref": "#/components/schemas/SyncChangeSet"
130
+ },
131
+ "examples": {
132
+ "synchronisedStorageSyncGetDecryptionKeyRequestExample": {
133
+ "value": {
134
+ "nodeIdentity": "did:entity-storage:0xd2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2",
135
+ "proof": {
136
+ "@context": "https://www.w3.org/ns/credentials/v2",
137
+ "created": "2025-05-29T01:00:00.000Z",
138
+ "cryptosuite": "eddsa-jcs-2022",
139
+ "proofPurpose": "assertionMethod",
140
+ "proofValue": "z5efBErQs3YBLZoH7jgKMQaRc9YjAxA5XSYKmW3FmTBDw9WionT2NS2x1SMvcRyBvw53cSSoaCT1xQH9tkWngGCX3",
141
+ "type": "DataIntegrityProof",
142
+ "verificationMethod": "did:entity-storage:0xd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0#synchronised-storage-assertion"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+ },
150
+ "responses": {
151
+ "200": {
152
+ "description": "Response to a request for the decryption key for the synchronised storage.",
153
+ "content": {
154
+ "application/json": {
155
+ "schema": {
156
+ "$ref": "#/components/schemas/SyncDecryptionKeyResponse"
157
+ },
158
+ "examples": {
159
+ "synchronisedStorageSyncGetDecryptionKeyResponseExample": {
160
+ "value": {
161
+ "decryptionKey": "z5efBErQs3YBLZoH7jgKMQaRc9YjAxA5XSYKmW3FmTBDw9WionT2NS2x1SMvcRyBvw53cSSoaCT1xQH9tkWngGCX3"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ },
168
+ "400": {
169
+ "description": "The server cannot process the request, see the content for more details.",
170
+ "content": {
171
+ "application/json": {
172
+ "schema": {
173
+ "$ref": "#/components/schemas/Error"
174
+ },
175
+ "examples": {
176
+ "exampleResponse": {
177
+ "value": {
178
+ "name": "GeneralError",
179
+ "message": "component.error",
180
+ "properties": {
181
+ "foo": "bar"
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ },
73
189
  "401": {
74
190
  "description": "You are not authorized to use the API or no credentials were supplied, see the content for more details.",
75
191
  "content": {
@@ -146,6 +262,116 @@
146
262
  ],
147
263
  "additionalProperties": false,
148
264
  "description": "Model to describe serialized error."
265
+ },
266
+ "SyncChange<SynchronisedEntity>": {
267
+ "type": "object",
268
+ "properties": {
269
+ "operation": {
270
+ "$ref": "#/components/schemas/SyncChangeOperation"
271
+ },
272
+ "id": {
273
+ "type": "string",
274
+ "description": "The item id."
275
+ },
276
+ "entity": {
277
+ "$ref": "#/components/schemas/SynchronisedEntity"
278
+ }
279
+ },
280
+ "required": [
281
+ "operation",
282
+ "id"
283
+ ],
284
+ "additionalProperties": false,
285
+ "description": "The object definition for a sync change."
286
+ },
287
+ "SyncChangeOperation": {
288
+ "anyOf": [
289
+ {
290
+ "type": "string",
291
+ "const": "set",
292
+ "description": "An item was set in the storage."
293
+ },
294
+ {
295
+ "type": "string",
296
+ "const": "delete",
297
+ "description": "An item was deleted from the storage."
298
+ }
299
+ ],
300
+ "description": "The operations for a change. The operations for a change"
301
+ },
302
+ "SyncChangeSet": {
303
+ "type": "object",
304
+ "properties": {
305
+ "id": {
306
+ "type": "string",
307
+ "description": "The id of the change set."
308
+ },
309
+ "dateCreated": {
310
+ "type": "string",
311
+ "description": "The date the change set was created."
312
+ },
313
+ "storageKey": {
314
+ "type": "string",
315
+ "description": "The storage key of the change set. This is used to identify the entities being synchronised."
316
+ },
317
+ "dateModified": {
318
+ "type": "string",
319
+ "description": "The date the change set was last modified."
320
+ },
321
+ "changes": {
322
+ "type": "array",
323
+ "items": false,
324
+ "description": "The changes to apply after a snapshot.",
325
+ "prefixItems": [
326
+ {
327
+ "$ref": "#/components/schemas/SyncChange<SynchronisedEntity>"
328
+ }
329
+ ]
330
+ },
331
+ "nodeIdentity": {
332
+ "type": "string",
333
+ "description": "The identity of the node that created the change set."
334
+ },
335
+ "proof": {
336
+ "$ref": "https://schema.twindev.org/w3c-did/Proof"
337
+ }
338
+ },
339
+ "required": [
340
+ "id",
341
+ "dateCreated",
342
+ "storageKey",
343
+ "changes",
344
+ "nodeIdentity"
345
+ ],
346
+ "additionalProperties": false,
347
+ "description": "The object definition for a sync change set."
348
+ },
349
+ "SyncDecryptionKeyResponse": {
350
+ "type": "object",
351
+ "properties": {
352
+ "decryptionKey": {
353
+ "type": "string",
354
+ "description": "The decryption key for the synchronised storage as base64."
355
+ }
356
+ },
357
+ "required": [
358
+ "decryptionKey"
359
+ ],
360
+ "additionalProperties": false,
361
+ "description": "The body of the response."
362
+ },
363
+ "SynchronisedEntity": {
364
+ "type": "object",
365
+ "properties": {
366
+ "dateModified": {
367
+ "type": "string",
368
+ "description": "The date the entry was modified"
369
+ }
370
+ },
371
+ "required": [
372
+ "dateModified"
373
+ ],
374
+ "additionalProperties": false
149
375
  }
150
376
  },
151
377
  "securitySchemes": {
@@ -70,6 +70,6 @@ The ids of the storage for the change sets in the snapshot, if this is not a loc
70
70
 
71
71
  ### changes?
72
72
 
73
- > `optional` **changes**: [`ISyncChange`](../interfaces/ISyncChange.md)\<`T`\>[]
73
+ > `optional` **changes**: `ISyncChange`\<`T`\>[]
74
74
 
75
75
  The changes that were made in this snapshot, if this is a local snapshot.
@@ -118,19 +118,52 @@ Nothing.
118
118
 
119
119
  ***
120
120
 
121
- ### syncChangeSet()
121
+ ### getDecryptionKey()
122
122
 
123
- > **syncChangeSet**(`changeSetStorageId`): `Promise`\<`void`\>
123
+ > **getDecryptionKey**(`nodeIdentity`, `proof`): `Promise`\<`string`\>
124
124
 
125
- Synchronise a complete set of changes, assumes this is a trusted node.
125
+ Get the decryption key for the synchronised storage.
126
+ This is used to decrypt the data stored in the synchronised storage.
126
127
 
127
128
  #### Parameters
128
129
 
129
- ##### changeSetStorageId
130
+ ##### nodeIdentity
130
131
 
131
132
  `string`
132
133
 
133
- The id of the change set to synchronise in blob storage.
134
+ The identity of the node requesting the decryption key.
135
+
136
+ ##### proof
137
+
138
+ `IProof`
139
+
140
+ The proof of the request so we know the request is from the specified node.
141
+
142
+ #### Returns
143
+
144
+ `Promise`\<`string`\>
145
+
146
+ The decryption key.
147
+
148
+ #### Implementation of
149
+
150
+ `ISynchronisedStorageComponent.getDecryptionKey`
151
+
152
+ ***
153
+
154
+ ### syncChangeSet()
155
+
156
+ > **syncChangeSet**(`syncChangeSet`): `Promise`\<`void`\>
157
+
158
+ Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
159
+
160
+ #### Parameters
161
+
162
+ ##### syncChangeSet
163
+
164
+ `ISyncChangeSet`\<`T`\>
165
+
166
+ The change set to synchronise.
134
167
 
135
168
  #### Returns
136
169
 
@@ -0,0 +1,31 @@
1
+ # Function: synchronisedStorageGetDecryptionKeyRequest()
2
+
3
+ > **synchronisedStorageGetDecryptionKeyRequest**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`ISyncDecryptionKeyResponse`\>
4
+
5
+ Request the decryption key.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `ISyncDecryptionKeyRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`ISyncDecryptionKeyResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -7,8 +7,6 @@
7
7
 
8
8
  ## Interfaces
9
9
 
10
- - [ISyncChange](interfaces/ISyncChange.md)
11
- - [ISyncChangeSet](interfaces/ISyncChangeSet.md)
12
10
  - [ISyncPointerStore](interfaces/ISyncPointerStore.md)
13
11
  - [ISyncSnapshot](interfaces/ISyncSnapshot.md)
14
12
  - [ISyncState](interfaces/ISyncState.md)
@@ -25,3 +23,4 @@
25
23
  - [initSchema](functions/initSchema.md)
26
24
  - [generateRestRoutesSynchronisedStorage](functions/generateRestRoutesSynchronisedStorage.md)
27
25
  - [synchronisedStorageSyncChangeSetRequest](functions/synchronisedStorageSyncChangeSetRequest.md)
26
+ - [synchronisedStorageGetDecryptionKeyRequest](functions/synchronisedStorageGetDecryptionKeyRequest.md)
@@ -4,6 +4,14 @@ The object definition for the sync pointer store.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### version
8
+
9
+ > **version**: `string`
10
+
11
+ The version of the sync pointer store.
12
+
13
+ ***
14
+
7
15
  ### syncPointers
8
16
 
9
17
  > **syncPointers**: `object`
@@ -4,6 +4,14 @@ The object definition for a sync snapshot.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### version
8
+
9
+ > **version**: `string`
10
+
11
+ The version of the sync state.
12
+
13
+ ***
14
+
7
15
  ### id
8
16
 
9
17
  > **id**: `string`
@@ -20,9 +28,9 @@ The date the snapshot was created.
20
28
 
21
29
  ***
22
30
 
23
- ### dateModified?
31
+ ### dateModified
24
32
 
25
- > `optional` **dateModified**: `string`
33
+ > **dateModified**: `string`
26
34
 
27
35
  The date the snapshot was last modified.
28
36
 
@@ -4,6 +4,14 @@ The object definition for a sync state.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### version
8
+
9
+ > **version**: `string`
10
+
11
+ The version of the sync state.
12
+
13
+ ***
14
+
7
15
  ### snapshots
8
16
 
9
17
  > **snapshots**: [`ISyncSnapshot`](ISyncSnapshot.md)[]
@@ -4,20 +4,11 @@ Configuration for the Synchronised Storage Service.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### synchronisedStorageKey
8
-
9
- > **synchronisedStorageKey**: `string`
10
-
11
- The key to use for the remote synchronised storage, the initial item will have been
12
- generated by a trusted node.
13
-
14
- ***
15
-
16
7
  ### synchronisedStorageMethodId?
17
8
 
18
9
  > `optional` **synchronisedStorageMethodId**: `string`
19
10
 
20
- The id of the identity method to use when signing/verifying changesets.
11
+ The id of the identity method to use when signing/verifying requests and changesets.
21
12
 
22
13
  #### Default
23
14
 
@@ -80,3 +71,32 @@ The number of entities to process in a single consolidation batch.
80
71
  ```ts
81
72
  1000
82
73
  ```
74
+
75
+ ***
76
+
77
+ ### blobStorageEncryptionKeyId?
78
+
79
+ > `optional` **blobStorageEncryptionKeyId**: `string`
80
+
81
+ The encryption key id from the vault to use for blob storage, only required for trusted nodes, untrusted nodes will request the key.
82
+
83
+ #### Default
84
+
85
+ ```ts
86
+ synchronised-storage-blob-encryption-key
87
+ ```
88
+
89
+ ***
90
+
91
+ ### verifiableStorageKeyId
92
+
93
+ > **verifiableStorageKeyId**: `string`
94
+
95
+ The verifiable storage key to use, already expected to be created.
96
+ if the key is not found in the keys.json it is considered to be a custom verifiable storage id.
97
+
98
+ #### Default
99
+
100
+ ```ts
101
+ local
102
+ ```
@@ -20,6 +20,14 @@ The event bus component type.
20
20
 
21
21
  ***
22
22
 
23
+ ### vaultConnectorType?
24
+
25
+ > `optional` **vaultConnectorType**: `string`
26
+
27
+ The vault connector type.
28
+
29
+ ***
30
+
23
31
  ### syncSnapshotStorageConnectorType?
24
32
 
25
33
  > `optional` **syncSnapshotStorageConnectorType**: `string`
@@ -34,11 +42,11 @@ sync-snapshot-entry
34
42
 
35
43
  ***
36
44
 
37
- ### blobStorageComponentType?
45
+ ### blobStorageConnectorType?
38
46
 
39
- > `optional` **blobStorageComponentType**: `string`
47
+ > `optional` **blobStorageConnectorType**: `string`
40
48
 
41
- The blob storage component used for remote sync state.
49
+ The blob storage connector used for remote sync state.
42
50
 
43
51
  #### Default
44
52
 
package/locales/en.json CHANGED
@@ -4,18 +4,22 @@
4
4
  "changeSetApplyingChange": "Applying remote sync change with operation id \"{operation}\" for item with id \"{id}\"",
5
5
  "changeSetStoring": "Storing remote sync change set with id \"{id}\"",
6
6
  "verifyChangeSetProofMissing": "Verifying change set with id \"{id}\" failed, missing proof",
7
- "verifyChangeSetProofInvalid": "Verifying change set with id \"{id}\" failed, invalid proof",
7
+ "verifyChangeSetProofInvalid": "Verifying change set with id \"{id}\" failed, missing proof",
8
+ "verifyChangeSetProofNodeIdentityMismatch": "Verifying change set with id \"{id}\" failed, the node identity does not match the proof",
8
9
  "verifyChangeSetProofValid": "Verifying change set with id \"{id}\" succeeded",
9
- "createdChangeSetProof": "Created change proof for change set with id \"{id}\", proof value is \"{proofValue}\""
10
+ "createdChangeSetProof": "Created change proof for change set with id \"{id}\", proof value is \"{proofValue}\"",
11
+ "getChangeSet": "Retrieving change set with id \"{changeSetStorageId}\"",
12
+ "getChangeSetEmpty": "No change set found with id \"{changeSetStorageId}\"",
13
+ "copyChangeSet": "Copying change set with id \"{changeSetStorageId}\""
10
14
  },
11
15
  "localSyncStateHelper": {
12
16
  "getLocalChangeSnapshot": "Retrieving local change snapshot for storage key \"{storageKey}\"",
13
17
  "localChangeSnapshotExists": "Found existing local change snapshot for storage key \"{storageKey}\"",
14
18
  "localChangeSnapshotDoesNotExist": "No local change snapshot found for storage key \"{storageKey}\", creating new one",
15
- "remoteSyncSynchronisation": "Syncing from remote state with \"{snapshotCount}\" snapshots",
16
- "remoteSyncSnapshotProcessing": "Processing remote sync snapshot with id \"{snapshotId}\" created on \"{dateCreated}\"",
17
- "remoteSyncSnapshotModified": "Processing modified sync snapshot with id \"{snapshotId}\", remote modified on \"{remoteModified}\", local modified on \"{localModified}\"",
18
- "remoteSyncSnapshotNew": "Processing new sync snapshot with id \"{snapshotId}\", created on \"{dateCreated}\"",
19
+ "applySyncState": "Syncing from remote state with \"{snapshotCount}\" snapshots",
20
+ "applySnapshot": "Processing sync snapshot with id \"{snapshotId}\" created on \"{dateCreated}\"",
21
+ "processModifiedSnapshot": "Processing modified sync snapshot with id \"{snapshotId}\", remote modified on \"{remoteModified}\", local modified on \"{localModified}\"",
22
+ "processNewSnapshot": "Processing new sync snapshot with id \"{snapshotId}\", created on \"{dateCreated}\"",
19
23
  "removeLocalChangeSnapshot": "Removing local change snapshot with id \"{snapshotId}\"",
20
24
  "addLocalChange": "Adding local change with id \"{id}\" to local change snapshot for storage key \"{storageKey}\", operation \"{operation}\"",
21
25
  "setLocalChangeSnapshot": "Storing local change snapshot for storage key \"{storageKey}\""
@@ -32,20 +36,29 @@
32
36
  "consolidationStarting": "Starting consolidation of remote sync state",
33
37
  "consolidationCompleted": "Consolidation of remote sync state completed",
34
38
  "addChangeSetToSyncState": "Adding change set with id \"{changeSetStorageId}\" to remote sync state for storage key \"{storageKey}\"",
35
- "createAndStoreChangeSet": "Creating and storing change set for storage key \"{storageKey}\" with \"{changeCount}\" changes",
39
+ "buildingChangeSet": "Building change set for storage key \"{storageKey}\" with \"{changeCount}\" changes",
36
40
  "finalisingSyncChanges": "Finalising sync changes for storage key \"{storageKey}\""
37
41
  },
38
42
  "synchronisedStorageService": {
39
- "registerType": "Registering synchronised storage type \"{storageKey}\"",
40
- "activateType": "Activating synchronised storage type \"{storageKey}\"",
41
- "startEntitySync": "Starting synchronised entity storage for type \"{storageKey}\"",
42
- "updateFromRemoteSyncState": "Updating synchronised entity storage from remote sync state for type \"{storageKey}\"",
43
- "updateFromLocalSyncState": "Updating synchronised entity storage from local sync state for type \"{storageKey}\"",
44
- "updateFromLocalSyncStateNoChanges": "No changes found in local sync state for type \"{storageKey}\", skipping update",
45
- "createdStorageChangeSet": "Created storage change set for type \"{storageKey}\" with id \"{changeSetStorageId}\"",
46
- "createdStorageChangeSetNone": "No changes found for type \"{storageKey}\", no storage change set created",
47
- "createChangeSetRequestingItem": "Creating change set for type \"{storageKey}\", requesting item with id \"{id}\"",
48
- "createChangeSetRespondingItem": "Responding to change set request for type \"{storageKey}\", item with id \"{id}\""
43
+ "registerStorageKey": "Registering synchronised storage key \"{storageKey}\"",
44
+ "activateStorageKey": "Activating synchronised storage key \"{storageKey}\"",
45
+ "startEntitySync": "Starting synchronised entity storage for key \"{storageKey}\"",
46
+ "updateFromRemoteSyncState": "Updating synchronised entity storage from remote sync state for key \"{storageKey}\"",
47
+ "updateFromLocalSyncState": "Updating synchronised entity storage from local sync state for key \"{storageKey}\"",
48
+ "updateFromLocalSyncStateNoChanges": "No changes found in local sync state for key \"{storageKey}\", skipping update",
49
+ "builtStorageChangeSet": "Built storage change set for key \"{storageKey}\" with id \"{changeSetStorageId}\"",
50
+ "builtStorageChangeSetNone": "No changes found for key \"{storageKey}\", no storage change set created",
51
+ "createChangeSetRequestingItem": "Creating change set for key \"{storageKey}\", requesting item with id \"{id}\"",
52
+ "createChangeSetRespondingItem": "Responding to change set request for key \"{storageKey}\", item with id \"{id}\"",
53
+ "sendingChangeSetToTrustedNode": "Sending change set with id \"{changeSetStorageId}\" to trusted node for key \"{storageKey}\"",
54
+ "syncChangeSetForRemoteNode": "Synchronising change set with id \"{changeSetStorageId}\" for remote node for type \"{storageKey}\""
55
+ },
56
+ "blobStorageHelper": {
57
+ "loadBlob": "Loading blob with id \"{blobId}\"",
58
+ "loadedBlob": "Loaded blob with id \"{blobId}\"",
59
+ "loadBlobEmpty": "No blob found with id \"{blobId}\"",
60
+ "saveBlob": "Saving blob",
61
+ "savedBlob": "Saved blob with id \"{blobId}\""
49
62
  }
50
63
  },
51
64
  "error": {
@@ -56,10 +69,25 @@
56
69
  "synchronisedStorageService": {
57
70
  "notTrustedNode": "This method can only be called on a trusted node",
58
71
  "entitySyncFailed": "Failed to sync synchronised entity storage connector",
59
- "consolidationSyncFailed": "Failed to consolidate synchronised entity storage connector"
72
+ "consolidationSyncFailed": "Failed to consolidate synchronised entity storage connector",
73
+ "invalidProof": "Invalid proof provided for synchronised entity storage connector",
74
+ "decryptionKeyNotFound": "Decryption key not found, ensure the synchronised storage component is initialised and the decryption key is set"
60
75
  },
61
76
  "remoteSyncStateHelper": {
62
77
  "finalisingSyncChangesFailed": "Failed to finalise sync changes for storage key \"{storageKey}\""
78
+ },
79
+ "blobStorageHelper": {
80
+ "loadBlobFailed": "Failed to load blob with id \"{blobId}\"",
81
+ "saveBlobFailed": "Failed to save blob",
82
+ "notTrustedNode": "Cannot save blob, this is not a trusted node"
83
+ }
84
+ },
85
+ "warn": {
86
+ "changeSetHelper": {
87
+ "getChangeSetError": "Failed to retrieve change set with id \"{changeSetStorageId}\""
88
+ },
89
+ "remoteSyncStateHelper": {
90
+ "getSyncStateError": "Failed to retrieve sync state for syncPointerId \"{syncPointerId}\""
63
91
  }
64
92
  }
65
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/synchronised-storage-service",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.4",
4
4
  "description": "Synchronised storage contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,6 +18,7 @@
18
18
  "@twin.org/background-task-models": "next",
19
19
  "@twin.org/blob-storage-models": "next",
20
20
  "@twin.org/core": "next",
21
+ "@twin.org/crypto": "next",
21
22
  "@twin.org/entity": "next",
22
23
  "@twin.org/entity-storage-models": "next",
23
24
  "@twin.org/event-bus-models": "next",
@@ -25,7 +26,7 @@
25
26
  "@twin.org/logging-models": "next",
26
27
  "@twin.org/nameof": "next",
27
28
  "@twin.org/standards-w3c-did": "next",
28
- "@twin.org/synchronised-storage-models": "0.0.1-next.3",
29
+ "@twin.org/synchronised-storage-models": "0.0.1-next.4",
29
30
  "@twin.org/verifiable-storage-models": "next",
30
31
  "@twin.org/web": "next"
31
32
  },