@twin.org/synchronised-storage-models 0.0.1-next.2 → 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 (40) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/esm/index.mjs +2 -2
  3. package/dist/types/index.d.ts +5 -1
  4. package/dist/types/models/ISyncChange.d.ts +19 -0
  5. package/dist/types/models/ISyncChangeSet.d.ts +36 -0
  6. package/dist/types/models/ISynchronisedEntity.d.ts +4 -0
  7. package/dist/types/models/ISynchronisedStorageComponent.d.ts +13 -3
  8. package/dist/types/models/api/ISyncChangeSetRequest.d.ts +3 -7
  9. package/dist/types/models/api/ISyncDecryptionKeyRequest.d.ts +19 -0
  10. package/dist/types/models/api/ISyncDecryptionKeyResponse.d.ts +14 -0
  11. package/dist/types/models/eventBus/ISyncBatchRequest.d.ts +2 -2
  12. package/dist/types/models/eventBus/ISyncBatchResponse.d.ts +2 -6
  13. package/dist/types/models/eventBus/ISyncItemChange.d.ts +2 -2
  14. package/dist/types/models/eventBus/ISyncItemRemove.d.ts +2 -2
  15. package/dist/types/models/eventBus/ISyncItemRequest.d.ts +2 -2
  16. package/dist/types/models/eventBus/ISyncItemResponse.d.ts +2 -2
  17. package/dist/types/models/eventBus/ISyncItemSet.d.ts +2 -2
  18. package/dist/types/models/eventBus/ISyncRegisterStorageKey.d.ts +9 -0
  19. package/dist/types/models/synchronisedStorageTopics.d.ts +2 -2
  20. package/docs/changelog.md +14 -0
  21. package/docs/reference/index.md +5 -1
  22. package/docs/reference/interfaces/ISyncBatchRequest.md +3 -3
  23. package/docs/reference/interfaces/ISyncBatchResponse.md +3 -11
  24. package/docs/reference/interfaces/ISyncChange.md +33 -0
  25. package/docs/reference/interfaces/ISyncChangeSet.md +65 -0
  26. package/docs/reference/interfaces/ISyncChangeSetRequest.md +3 -9
  27. package/docs/reference/interfaces/ISyncDecryptionKeyRequest.md +23 -0
  28. package/docs/reference/interfaces/ISyncDecryptionKeyResponse.md +17 -0
  29. package/docs/reference/interfaces/ISyncItemChange.md +3 -3
  30. package/docs/reference/interfaces/ISyncItemRemove.md +3 -3
  31. package/docs/reference/interfaces/ISyncItemRequest.md +3 -3
  32. package/docs/reference/interfaces/ISyncItemResponse.md +3 -3
  33. package/docs/reference/interfaces/ISyncItemSet.md +3 -3
  34. package/docs/reference/interfaces/ISyncRegisterStorageKey.md +11 -0
  35. package/docs/reference/interfaces/ISynchronisedEntity.md +8 -0
  36. package/docs/reference/interfaces/ISynchronisedStorageComponent.md +34 -5
  37. package/docs/reference/variables/SynchronisedStorageTopics.md +3 -3
  38. package/package.json +3 -2
  39. package/dist/types/models/eventBus/ISyncRegisterSchemaType.d.ts +0 -9
  40. package/docs/reference/interfaces/ISyncRegisterSchemaType.md +0 -11
@@ -25,9 +25,9 @@ const SyncChangeOperation = {
25
25
  // eslint-disable-next-line @typescript-eslint/naming-convention
26
26
  const SynchronisedStorageTopics = {
27
27
  /**
28
- * Register a schema type for the synchronised storage.
28
+ * Register a storage key for the synchronised storage.
29
29
  */
30
- RegisterSchemaType: "synchronised-storage:register-schema-type",
30
+ RegisterStorageKey: "synchronised-storage:register-storage-key",
31
31
  /**
32
32
  * An item was changed in the storage by the local node.
33
33
  */
@@ -23,9 +23,9 @@ const SyncChangeOperation = {
23
23
  // eslint-disable-next-line @typescript-eslint/naming-convention
24
24
  const SynchronisedStorageTopics = {
25
25
  /**
26
- * Register a schema type for the synchronised storage.
26
+ * Register a storage key for the synchronised storage.
27
27
  */
28
- RegisterSchemaType: "synchronised-storage:register-schema-type",
28
+ RegisterStorageKey: "synchronised-storage:register-storage-key",
29
29
  /**
30
30
  * An item was changed in the storage by the local node.
31
31
  */
@@ -1,4 +1,6 @@
1
1
  export * from "./models/api/ISyncChangeSetRequest";
2
+ export * from "./models/api/ISyncDecryptionKeyRequest";
3
+ export * from "./models/api/ISyncDecryptionKeyResponse";
2
4
  export * from "./models/eventBus/ISyncBatchRequest";
3
5
  export * from "./models/eventBus/ISyncBatchResponse";
4
6
  export * from "./models/eventBus/ISyncItemChange";
@@ -6,8 +8,10 @@ export * from "./models/eventBus/ISyncItemRemove";
6
8
  export * from "./models/eventBus/ISyncItemRequest";
7
9
  export * from "./models/eventBus/ISyncItemResponse";
8
10
  export * from "./models/eventBus/ISyncItemSet";
9
- export * from "./models/eventBus/ISyncRegisterSchemaType";
11
+ export * from "./models/eventBus/ISyncRegisterStorageKey";
10
12
  export * from "./models/eventBus/syncChangeOperation";
13
+ export * from "./models/ISyncChange";
14
+ export * from "./models/ISyncChangeSet";
11
15
  export * from "./models/ISynchronisedEntity";
12
16
  export * from "./models/ISynchronisedStorageComponent";
13
17
  export * from "./models/synchronisedStorageTopics";
@@ -0,0 +1,19 @@
1
+ import type { SyncChangeOperation } from "./eventBus/syncChangeOperation";
2
+ import type { ISynchronisedEntity } from "./ISynchronisedEntity";
3
+ /**
4
+ * The object definition for a sync change.
5
+ */
6
+ export interface ISyncChange<T extends ISynchronisedEntity = ISynchronisedEntity> {
7
+ /**
8
+ * Operation.
9
+ */
10
+ operation: SyncChangeOperation;
11
+ /**
12
+ * The item id.
13
+ */
14
+ id: string;
15
+ /**
16
+ * The entity to set.
17
+ */
18
+ entity?: Omit<T, "id" | "nodeIdentity">;
19
+ }
@@ -0,0 +1,36 @@
1
+ import type { IProof } from "@twin.org/standards-w3c-did";
2
+ import type { ISyncChange } from "./ISyncChange";
3
+ import type { ISynchronisedEntity } from "./ISynchronisedEntity";
4
+ /**
5
+ * The object definition for a sync change set.
6
+ */
7
+ export interface ISyncChangeSet<T extends ISynchronisedEntity = ISynchronisedEntity> {
8
+ /**
9
+ * The id of the change set.
10
+ */
11
+ id: string;
12
+ /**
13
+ * The date the change set was created.
14
+ */
15
+ dateCreated: string;
16
+ /**
17
+ * The storage key of the change set. This is used to identify the entities being synchronised.
18
+ */
19
+ storageKey: string;
20
+ /**
21
+ * The date the change set was last modified.
22
+ */
23
+ dateModified?: string;
24
+ /**
25
+ * The changes to apply after a snapshot.
26
+ */
27
+ changes: ISyncChange<T>[];
28
+ /**
29
+ * The identity of the node that created the change set.
30
+ */
31
+ nodeIdentity: string;
32
+ /**
33
+ * The proof for the change set.
34
+ */
35
+ proof?: IProof;
36
+ }
@@ -2,6 +2,10 @@
2
2
  * The base definition for synchronised entries.
3
3
  */
4
4
  export interface ISynchronisedEntity {
5
+ /**
6
+ * The id of the entry.
7
+ */
8
+ id: string;
5
9
  /**
6
10
  * The date the entry was modified
7
11
  */
@@ -1,12 +1,22 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
+ import type { IProof } from "@twin.org/standards-w3c-did";
3
+ import type { ISyncChangeSet } from "./ISyncChangeSet";
2
4
  /**
3
5
  * Class for performing synchronised storage operations.
4
6
  */
5
7
  export interface ISynchronisedStorageComponent extends IComponent {
6
8
  /**
7
- * Synchronise a complete set of changes, assumes this is a trusted node.
8
- * @param changeSetStorageId The id of the change set to synchronise in blob storage.
9
+ * Get the decryption key for the synchronised storage.
10
+ * This is used to decrypt the data stored in the synchronised storage.
11
+ * @param nodeIdentity The identity of the node requesting the decryption key.
12
+ * @param proof The proof of the request so we know the request is from the specified node.
13
+ * @returns The decryption key.
14
+ */
15
+ getDecryptionKey(nodeIdentity: string, proof: IProof): Promise<string>;
16
+ /**
17
+ * Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
18
+ * @param syncChangeSet The change set to synchronise.
9
19
  * @returns Nothing.
10
20
  */
11
- syncChangeSet(changeSetStorageId: string): Promise<void>;
21
+ syncChangeSet(syncChangeSet: ISyncChangeSet): Promise<void>;
12
22
  }
@@ -1,14 +1,10 @@
1
+ import type { ISyncChangeSet } from "../ISyncChangeSet";
1
2
  /**
2
3
  * Request a trusted node to perform a sync request for a changeset.
3
4
  */
4
5
  export interface ISyncChangeSetRequest {
5
6
  /**
6
- * The query parameters.
7
+ * The body of the request.
7
8
  */
8
- query: {
9
- /**
10
- * The storage id of the changeset.
11
- */
12
- changeSetStorageId: string;
13
- };
9
+ body: ISyncChangeSet;
14
10
  }
@@ -0,0 +1,19 @@
1
+ import type { IProof } from "@twin.org/standards-w3c-did";
2
+ /**
3
+ * Request for the decryption key for the synchronised storage.
4
+ */
5
+ export interface ISyncDecryptionKeyRequest {
6
+ /**
7
+ * The body of the request.
8
+ */
9
+ body: {
10
+ /**
11
+ * The identity of the node making the request.
12
+ */
13
+ nodeIdentity: string;
14
+ /**
15
+ * The proof of the request.
16
+ */
17
+ proof: IProof;
18
+ };
19
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Response to a request for the decryption key for the synchronised storage.
3
+ */
4
+ export interface ISyncDecryptionKeyResponse {
5
+ /**
6
+ * The body of the response.
7
+ */
8
+ body: {
9
+ /**
10
+ * The decryption key for the synchronised storage as base64.
11
+ */
12
+ decryptionKey: string;
13
+ };
14
+ }
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export interface ISyncBatchRequest {
5
5
  /**
6
- * The type of the schema for the entities in the batch.
6
+ * The key of the storage for the entities in the batch.
7
7
  */
8
- schemaType: string;
8
+ storageKey: string;
9
9
  /**
10
10
  * The size of the batch.
11
11
  */
@@ -4,13 +4,9 @@ import type { ISynchronisedEntity } from "../ISynchronisedEntity";
4
4
  */
5
5
  export interface ISyncBatchResponse<T extends ISynchronisedEntity> {
6
6
  /**
7
- * The type of the schema for the entities in the batch.
7
+ * The key of the storage for the entities in the batch.
8
8
  */
9
- schemaType: string;
10
- /**
11
- * The primary key of the entity in the sync item response.
12
- */
13
- primaryKey: keyof T;
9
+ storageKey: string;
14
10
  /**
15
11
  * The entities in the batch.
16
12
  */
@@ -4,9 +4,9 @@ import type { SyncChangeOperation } from "./syncChangeOperation";
4
4
  */
5
5
  export interface ISyncItemChange {
6
6
  /**
7
- * The type of the schema being changed.
7
+ * The key of the storage being changed.
8
8
  */
9
- schemaType: string;
9
+ storageKey: string;
10
10
  /**
11
11
  * The operation being performed on the item.
12
12
  */
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export interface ISyncItemRemove {
5
5
  /**
6
- * The type of the schema being removed.
6
+ * The key of the storage being removed.
7
7
  */
8
- schemaType: string;
8
+ storageKey: string;
9
9
  /**
10
10
  * The entity being removed from the item set.
11
11
  */
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export interface ISyncItemRequest {
5
5
  /**
6
- * The type of the schema for the entities in the batch.
6
+ * The key of the storage for the entities in the batch.
7
7
  */
8
- schemaType: string;
8
+ storageKey: string;
9
9
  /**
10
10
  * The item id being requested.
11
11
  */
@@ -4,9 +4,9 @@ import type { ISynchronisedEntity } from "../ISynchronisedEntity";
4
4
  */
5
5
  export interface ISyncItemResponse<T extends ISynchronisedEntity> {
6
6
  /**
7
- * The type of the schema for the entities in the batch.
7
+ * The key of the storage for the entities in the batch.
8
8
  */
9
- schemaType: string;
9
+ storageKey: string;
10
10
  /**
11
11
  * The id of the entity in the sync item response.
12
12
  */
@@ -4,9 +4,9 @@ import type { ISynchronisedEntity } from "../ISynchronisedEntity";
4
4
  */
5
5
  export interface ISyncItemSet<T extends ISynchronisedEntity = ISynchronisedEntity> {
6
6
  /**
7
- * The type of the schema being set.
7
+ * The key of the storage being set.
8
8
  */
9
- schemaType: string;
9
+ storageKey: string;
10
10
  /**
11
11
  * The entity being set in the item set.
12
12
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Register a key with synchronised storage.
3
+ */
4
+ export interface ISyncRegisterStorageKey {
5
+ /**
6
+ * The key for the storage being registered.
7
+ */
8
+ storageKey: string;
9
+ }
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export declare const SynchronisedStorageTopics: {
5
5
  /**
6
- * Register a schema type for the synchronised storage.
6
+ * Register a storage key for the synchronised storage.
7
7
  */
8
- readonly RegisterSchemaType: "synchronised-storage:register-schema-type";
8
+ readonly RegisterStorageKey: "synchronised-storage:register-storage-key";
9
9
  /**
10
10
  * An item was changed in the storage by the local node.
11
11
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.1-next.4](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.1-next.3...synchronised-storage-models-v0.0.1-next.4) (2025-08-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * blob storage connector instead of component ([#7](https://github.com/twinfoundation/synchronised-storage/issues/7)) ([ea27241](https://github.com/twinfoundation/synchronised-storage/commit/ea27241cf0810b52ab7a6be7346809d127b7109a))
9
+
10
+ ## [0.0.1-next.3](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.1-next.2...synchronised-storage-models-v0.0.1-next.3) (2025-07-25)
11
+
12
+
13
+ ### Features
14
+
15
+ * sync testing ([#5](https://github.com/twinfoundation/synchronised-storage/issues/5)) ([f78d5ac](https://github.com/twinfoundation/synchronised-storage/commit/f78d5ac661b891f9912e0a81d028453f909a64b4))
16
+
3
17
  ## [0.0.1-next.2](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.1-next.1...synchronised-storage-models-v0.0.1-next.2) (2025-07-22)
4
18
 
5
19
 
@@ -2,9 +2,13 @@
2
2
 
3
3
  ## Interfaces
4
4
 
5
+ - [ISyncChange](interfaces/ISyncChange.md)
6
+ - [ISyncChangeSet](interfaces/ISyncChangeSet.md)
5
7
  - [ISynchronisedEntity](interfaces/ISynchronisedEntity.md)
6
8
  - [ISynchronisedStorageComponent](interfaces/ISynchronisedStorageComponent.md)
7
9
  - [ISyncChangeSetRequest](interfaces/ISyncChangeSetRequest.md)
10
+ - [ISyncDecryptionKeyRequest](interfaces/ISyncDecryptionKeyRequest.md)
11
+ - [ISyncDecryptionKeyResponse](interfaces/ISyncDecryptionKeyResponse.md)
8
12
  - [ISyncBatchRequest](interfaces/ISyncBatchRequest.md)
9
13
  - [ISyncBatchResponse](interfaces/ISyncBatchResponse.md)
10
14
  - [ISyncItemChange](interfaces/ISyncItemChange.md)
@@ -12,7 +16,7 @@
12
16
  - [ISyncItemRequest](interfaces/ISyncItemRequest.md)
13
17
  - [ISyncItemResponse](interfaces/ISyncItemResponse.md)
14
18
  - [ISyncItemSet](interfaces/ISyncItemSet.md)
15
- - [ISyncRegisterSchemaType](interfaces/ISyncRegisterSchemaType.md)
19
+ - [ISyncRegisterStorageKey](interfaces/ISyncRegisterStorageKey.md)
16
20
 
17
21
  ## Type Aliases
18
22
 
@@ -4,11 +4,11 @@ Request for a local batch.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### schemaType
7
+ ### storageKey
8
8
 
9
- > **schemaType**: `string`
9
+ > **storageKey**: `string`
10
10
 
11
- The type of the schema for the entities in the batch.
11
+ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
@@ -10,19 +10,11 @@ Response for a local batch.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### schemaType
13
+ ### storageKey
14
14
 
15
- > **schemaType**: `string`
15
+ > **storageKey**: `string`
16
16
 
17
- The type of the schema for the entities in the batch.
18
-
19
- ***
20
-
21
- ### primaryKey
22
-
23
- > **primaryKey**: keyof `T`
24
-
25
- The primary key of the entity in the sync item response.
17
+ The key of the storage for the entities in the batch.
26
18
 
27
19
  ***
28
20
 
@@ -0,0 +1,33 @@
1
+ # Interface: ISyncChange\<T\>
2
+
3
+ The object definition for a sync change.
4
+
5
+ ## Type Parameters
6
+
7
+ ### T
8
+
9
+ `T` *extends* [`ISynchronisedEntity`](ISynchronisedEntity.md) = [`ISynchronisedEntity`](ISynchronisedEntity.md)
10
+
11
+ ## Properties
12
+
13
+ ### operation
14
+
15
+ > **operation**: [`SyncChangeOperation`](../type-aliases/SyncChangeOperation.md)
16
+
17
+ Operation.
18
+
19
+ ***
20
+
21
+ ### id
22
+
23
+ > **id**: `string`
24
+
25
+ The item id.
26
+
27
+ ***
28
+
29
+ ### entity?
30
+
31
+ > `optional` **entity**: `Omit`\<`T`, `"id"` \| `"nodeIdentity"`\>
32
+
33
+ The entity to set.
@@ -0,0 +1,65 @@
1
+ # Interface: ISyncChangeSet\<T\>
2
+
3
+ The object definition for a sync change set.
4
+
5
+ ## Type Parameters
6
+
7
+ ### T
8
+
9
+ `T` *extends* [`ISynchronisedEntity`](ISynchronisedEntity.md) = [`ISynchronisedEntity`](ISynchronisedEntity.md)
10
+
11
+ ## Properties
12
+
13
+ ### id
14
+
15
+ > **id**: `string`
16
+
17
+ The id of the change set.
18
+
19
+ ***
20
+
21
+ ### dateCreated
22
+
23
+ > **dateCreated**: `string`
24
+
25
+ The date the change set was created.
26
+
27
+ ***
28
+
29
+ ### storageKey
30
+
31
+ > **storageKey**: `string`
32
+
33
+ The storage key of the change set. This is used to identify the entities being synchronised.
34
+
35
+ ***
36
+
37
+ ### dateModified?
38
+
39
+ > `optional` **dateModified**: `string`
40
+
41
+ The date the change set was last modified.
42
+
43
+ ***
44
+
45
+ ### changes
46
+
47
+ > **changes**: [`ISyncChange`](ISyncChange.md)\<`T`\>[]
48
+
49
+ The changes to apply after a snapshot.
50
+
51
+ ***
52
+
53
+ ### nodeIdentity
54
+
55
+ > **nodeIdentity**: `string`
56
+
57
+ The identity of the node that created the change set.
58
+
59
+ ***
60
+
61
+ ### proof?
62
+
63
+ > `optional` **proof**: `IProof`
64
+
65
+ The proof for the change set.
@@ -4,14 +4,8 @@ Request a trusted node to perform a sync request for a changeset.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### query
7
+ ### body
8
8
 
9
- > **query**: `object`
9
+ > **body**: [`ISyncChangeSet`](ISyncChangeSet.md)
10
10
 
11
- The query parameters.
12
-
13
- #### changeSetStorageId
14
-
15
- > **changeSetStorageId**: `string`
16
-
17
- The storage id of the changeset.
11
+ The body of the request.
@@ -0,0 +1,23 @@
1
+ # Interface: ISyncDecryptionKeyRequest
2
+
3
+ Request for the decryption key for the synchronised storage.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The body of the request.
12
+
13
+ #### nodeIdentity
14
+
15
+ > **nodeIdentity**: `string`
16
+
17
+ The identity of the node making the request.
18
+
19
+ #### proof
20
+
21
+ > **proof**: `IProof`
22
+
23
+ The proof of the request.
@@ -0,0 +1,17 @@
1
+ # Interface: ISyncDecryptionKeyResponse
2
+
3
+ Response to a request for the decryption key for the synchronised storage.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The body of the response.
12
+
13
+ #### decryptionKey
14
+
15
+ > **decryptionKey**: `string`
16
+
17
+ The decryption key for the synchronised storage as base64.
@@ -4,11 +4,11 @@ The payload for an item change.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### schemaType
7
+ ### storageKey
8
8
 
9
- > **schemaType**: `string`
9
+ > **storageKey**: `string`
10
10
 
11
- The type of the schema being changed.
11
+ The key of the storage being changed.
12
12
 
13
13
  ***
14
14
 
@@ -4,11 +4,11 @@ The payload for an item remove.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### schemaType
7
+ ### storageKey
8
8
 
9
- > **schemaType**: `string`
9
+ > **storageKey**: `string`
10
10
 
11
- The type of the schema being removed.
11
+ The key of the storage being removed.
12
12
 
13
13
  ***
14
14
 
@@ -4,11 +4,11 @@ Request for a local item.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### schemaType
7
+ ### storageKey
8
8
 
9
- > **schemaType**: `string`
9
+ > **storageKey**: `string`
10
10
 
11
- The type of the schema for the entities in the batch.
11
+ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
@@ -10,11 +10,11 @@ Response for a sync item request.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### schemaType
13
+ ### storageKey
14
14
 
15
- > **schemaType**: `string`
15
+ > **storageKey**: `string`
16
16
 
17
- The type of the schema for the entities in the batch.
17
+ The key of the storage for the entities in the batch.
18
18
 
19
19
  ***
20
20
 
@@ -10,11 +10,11 @@ The payload for an item set.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### schemaType
13
+ ### storageKey
14
14
 
15
- > **schemaType**: `string`
15
+ > **storageKey**: `string`
16
16
 
17
- The type of the schema being set.
17
+ The key of the storage being set.
18
18
 
19
19
  ***
20
20
 
@@ -0,0 +1,11 @@
1
+ # Interface: ISyncRegisterStorageKey
2
+
3
+ Register a key with synchronised storage.
4
+
5
+ ## Properties
6
+
7
+ ### storageKey
8
+
9
+ > **storageKey**: `string`
10
+
11
+ The key for the storage being registered.
@@ -4,6 +4,14 @@ The base definition for synchronised entries.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### id
8
+
9
+ > **id**: `string`
10
+
11
+ The id of the entry.
12
+
13
+ ***
14
+
7
15
  ### dateModified
8
16
 
9
17
  > **dateModified**: `string`
@@ -8,19 +8,48 @@ Class for performing synchronised storage operations.
8
8
 
9
9
  ## Methods
10
10
 
11
- ### syncChangeSet()
11
+ ### getDecryptionKey()
12
12
 
13
- > **syncChangeSet**(`changeSetStorageId`): `Promise`\<`void`\>
13
+ > **getDecryptionKey**(`nodeIdentity`, `proof`): `Promise`\<`string`\>
14
14
 
15
- Synchronise a complete set of changes, assumes this is a trusted node.
15
+ Get the decryption key for the synchronised storage.
16
+ This is used to decrypt the data stored in the synchronised storage.
16
17
 
17
18
  #### Parameters
18
19
 
19
- ##### changeSetStorageId
20
+ ##### nodeIdentity
20
21
 
21
22
  `string`
22
23
 
23
- The id of the change set to synchronise in blob storage.
24
+ The identity of the node requesting the decryption key.
25
+
26
+ ##### proof
27
+
28
+ `IProof`
29
+
30
+ The proof of the request so we know the request is from the specified node.
31
+
32
+ #### Returns
33
+
34
+ `Promise`\<`string`\>
35
+
36
+ The decryption key.
37
+
38
+ ***
39
+
40
+ ### syncChangeSet()
41
+
42
+ > **syncChangeSet**(`syncChangeSet`): `Promise`\<`void`\>
43
+
44
+ Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
45
+
46
+ #### Parameters
47
+
48
+ ##### syncChangeSet
49
+
50
+ [`ISyncChangeSet`](ISyncChangeSet.md)
51
+
52
+ The change set to synchronise.
24
53
 
25
54
  #### Returns
26
55
 
@@ -6,11 +6,11 @@ The topics for synchronised storage event bus notifications.
6
6
 
7
7
  ## Type declaration
8
8
 
9
- ### RegisterSchemaType
9
+ ### RegisterStorageKey
10
10
 
11
- > `readonly` **RegisterSchemaType**: `"synchronised-storage:register-schema-type"` = `"synchronised-storage:register-schema-type"`
11
+ > `readonly` **RegisterStorageKey**: `"synchronised-storage:register-storage-key"` = `"synchronised-storage:register-storage-key"`
12
12
 
13
- Register a schema type for the synchronised storage.
13
+ Register a storage key for the synchronised storage.
14
14
 
15
15
  ### LocalItemChange
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/synchronised-storage-models",
3
- "version": "0.0.1-next.2",
3
+ "version": "0.0.1-next.4",
4
4
  "description": "Models which define the structure of the synchronised storage connectors and services",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,8 @@
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
18
  "@twin.org/entity": "next",
19
- "@twin.org/nameof": "next"
19
+ "@twin.org/nameof": "next",
20
+ "@twin.org/standards-w3c-did": "next"
20
21
  },
21
22
  "main": "./dist/cjs/index.cjs",
22
23
  "module": "./dist/esm/index.mjs",
@@ -1,9 +0,0 @@
1
- /**
2
- * Register a type with synchronised storage so that it can perform consolidations.
3
- */
4
- export interface ISyncRegisterSchemaType {
5
- /**
6
- * The type of the schema being registered.
7
- */
8
- schemaType: string;
9
- }
@@ -1,11 +0,0 @@
1
- # Interface: ISyncRegisterSchemaType
2
-
3
- Register a type with synchronised storage so that it can perform consolidations.
4
-
5
- ## Properties
6
-
7
- ### schemaType
8
-
9
- > **schemaType**: `string`
10
-
11
- The type of the schema being registered.