@twin.org/synchronised-storage-models 0.0.3-next.1 → 0.0.3-next.11

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 (52) hide show
  1. package/README.md +2 -2
  2. package/dist/es/index.js +0 -1
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/es/models/ISyncChange.js.map +1 -1
  5. package/dist/es/models/ISyncChangeSet.js.map +1 -1
  6. package/dist/es/models/ISyncRequest.js.map +1 -1
  7. package/dist/es/models/ISynchronisedEntity.js.map +1 -1
  8. package/dist/es/models/ISynchronisedEntityCore.js.map +1 -1
  9. package/dist/es/models/ISynchronisedStorageComponent.js.map +1 -1
  10. package/dist/es/models/synchronisedStorageContexts.js +11 -3
  11. package/dist/es/models/synchronisedStorageContexts.js.map +1 -1
  12. package/dist/types/index.d.ts +0 -1
  13. package/dist/types/models/ISyncChange.d.ts +2 -0
  14. package/dist/types/models/ISyncChangeSet.d.ts +7 -2
  15. package/dist/types/models/ISyncRequest.d.ts +3 -2
  16. package/dist/types/models/ISynchronisedEntity.d.ts +2 -1
  17. package/dist/types/models/ISynchronisedEntityCore.d.ts +1 -0
  18. package/dist/types/models/ISynchronisedStorageComponent.d.ts +4 -5
  19. package/dist/types/models/synchronisedStorageContexts.d.ts +12 -4
  20. package/docs/changelog.md +72 -1
  21. package/docs/examples.md +61 -1
  22. package/docs/reference/index.md +0 -2
  23. package/docs/reference/interfaces/ISyncBatchRequest.md +3 -3
  24. package/docs/reference/interfaces/ISyncBatchResponse.md +3 -3
  25. package/docs/reference/interfaces/ISyncChange.md +4 -4
  26. package/docs/reference/interfaces/ISyncChangeSet.md +10 -10
  27. package/docs/reference/interfaces/ISyncChangeSetRequest.md +5 -5
  28. package/docs/reference/interfaces/ISyncDecryptionKeyRequest.md +4 -4
  29. package/docs/reference/interfaces/ISyncDecryptionKeyResponse.md +1 -1
  30. package/docs/reference/interfaces/ISyncItemChange.md +4 -4
  31. package/docs/reference/interfaces/ISyncItemRemove.md +3 -3
  32. package/docs/reference/interfaces/ISyncItemRequest.md +2 -2
  33. package/docs/reference/interfaces/ISyncItemResponse.md +4 -4
  34. package/docs/reference/interfaces/ISyncItemSet.md +2 -2
  35. package/docs/reference/interfaces/ISyncRegisterStorageKey.md +1 -1
  36. package/docs/reference/interfaces/ISyncRequest.md +5 -5
  37. package/docs/reference/interfaces/ISyncReset.md +2 -2
  38. package/docs/reference/interfaces/ISynchronisedEntity.md +4 -4
  39. package/docs/reference/interfaces/ISynchronisedEntityCore.md +1 -1
  40. package/docs/reference/interfaces/ISynchronisedStorageComponent.md +10 -10
  41. package/docs/reference/type-aliases/SynchronisedStorageContexts.md +1 -1
  42. package/docs/reference/variables/SyncChangeOperation.md +2 -2
  43. package/docs/reference/variables/SyncNodeIdMode.md +3 -3
  44. package/docs/reference/variables/SynchronisedStorageContexts.md +16 -4
  45. package/docs/reference/variables/SynchronisedStorageTopics.md +9 -9
  46. package/docs/reference/variables/SynchronisedStorageTypes.md +2 -2
  47. package/package.json +3 -6
  48. package/dist/es/models/synchronisedStorageAssetTypes.js +0 -26
  49. package/dist/es/models/synchronisedStorageAssetTypes.js.map +0 -1
  50. package/dist/types/models/synchronisedStorageAssetTypes.d.ts +0 -25
  51. package/docs/reference/type-aliases/SynchronisedStorageAssetTypes.md +0 -5
  52. package/docs/reference/variables/SynchronisedStorageAssetTypes.md +0 -31
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # TWIN Synchronised Storage Models
1
+ # Synchronised Storage Models
2
2
 
3
- Models which define the structure of the synchronised-storage contracts and connectors.
3
+ This package defines the shared contracts for synchronised storage payloads, topics, and schema-aligned model structures. It is intended to keep producers and consumers aligned on message shape and semantics when exchanging state updates.
4
4
 
5
5
  ## Installation
6
6
 
package/dist/es/index.js CHANGED
@@ -19,7 +19,6 @@ export * from "./models/ISynchronisedEntityCore.js";
19
19
  export * from "./models/ISynchronisedStorageComponent.js";
20
20
  export * from "./models/ISyncRequest.js";
21
21
  export * from "./models/syncChangeOperation.js";
22
- export * from "./models/synchronisedStorageAssetTypes.js";
23
22
  export * from "./models/synchronisedStorageContexts.js";
24
23
  export * from "./models/synchronisedStorageTopics.js";
25
24
  export * from "./models/synchronisedStorageTypes.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./models/api/ISyncChangeSetRequest.js\";\nexport * from \"./models/api/ISyncDecryptionKeyRequest.js\";\nexport * from \"./models/api/ISyncDecryptionKeyResponse.js\";\nexport * from \"./models/eventBus/ISyncBatchRequest.js\";\nexport * from \"./models/eventBus/ISyncBatchResponse.js\";\nexport * from \"./models/eventBus/ISyncItemChange.js\";\nexport * from \"./models/eventBus/ISyncItemRemove.js\";\nexport * from \"./models/eventBus/ISyncItemRequest.js\";\nexport * from \"./models/eventBus/ISyncItemResponse.js\";\nexport * from \"./models/eventBus/ISyncItemSet.js\";\nexport * from \"./models/eventBus/ISyncRegisterStorageKey.js\";\nexport * from \"./models/eventBus/ISyncReset.js\";\nexport * from \"./models/ISyncChange.js\";\nexport * from \"./models/ISyncChangeSet.js\";\nexport * from \"./models/ISynchronisedEntity.js\";\nexport * from \"./models/ISynchronisedEntityCore.js\";\nexport * from \"./models/ISynchronisedStorageComponent.js\";\nexport * from \"./models/ISyncRequest.js\";\nexport * from \"./models/syncChangeOperation.js\";\nexport * from \"./models/synchronisedStorageAssetTypes.js\";\nexport * from \"./models/synchronisedStorageContexts.js\";\nexport * from \"./models/synchronisedStorageTopics.js\";\nexport * from \"./models/synchronisedStorageTypes.js\";\nexport * from \"./models/syncNodeIdMode.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./models/api/ISyncChangeSetRequest.js\";\nexport * from \"./models/api/ISyncDecryptionKeyRequest.js\";\nexport * from \"./models/api/ISyncDecryptionKeyResponse.js\";\nexport * from \"./models/eventBus/ISyncBatchRequest.js\";\nexport * from \"./models/eventBus/ISyncBatchResponse.js\";\nexport * from \"./models/eventBus/ISyncItemChange.js\";\nexport * from \"./models/eventBus/ISyncItemRemove.js\";\nexport * from \"./models/eventBus/ISyncItemRequest.js\";\nexport * from \"./models/eventBus/ISyncItemResponse.js\";\nexport * from \"./models/eventBus/ISyncItemSet.js\";\nexport * from \"./models/eventBus/ISyncRegisterStorageKey.js\";\nexport * from \"./models/eventBus/ISyncReset.js\";\nexport * from \"./models/ISyncChange.js\";\nexport * from \"./models/ISyncChangeSet.js\";\nexport * from \"./models/ISynchronisedEntity.js\";\nexport * from \"./models/ISynchronisedEntityCore.js\";\nexport * from \"./models/ISynchronisedStorageComponent.js\";\nexport * from \"./models/ISyncRequest.js\";\nexport * from \"./models/syncChangeOperation.js\";\nexport * from \"./models/synchronisedStorageContexts.js\";\nexport * from \"./models/synchronisedStorageTopics.js\";\nexport * from \"./models/synchronisedStorageTypes.js\";\nexport * from \"./models/syncNodeIdMode.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISyncChange.js","sourceRoot":"","sources":["../../../src/models/ISyncChange.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISynchronisedEntityCore } from \"./ISynchronisedEntityCore.js\";\nimport type { SyncChangeOperation } from \"./syncChangeOperation.js\";\n\n/**\n * The object definition for a sync change.\n */\nexport interface ISyncChange {\n\t/**\n\t * Operation.\n\t */\n\toperation: SyncChangeOperation;\n\n\t/**\n\t * The item id.\n\t */\n\tid: string;\n\n\t/**\n\t * The entity to set.\n\t */\n\tentity?: ISynchronisedEntityCore;\n}\n"]}
1
+ {"version":3,"file":"ISyncChange.js","sourceRoot":"","sources":["../../../src/models/ISyncChange.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISynchronisedEntityCore } from \"./ISynchronisedEntityCore.js\";\nimport type { SyncChangeOperation } from \"./syncChangeOperation.js\";\n\n/**\n * The object definition for a sync change.\n */\nexport interface ISyncChange {\n\t/**\n\t * Operation.\n\t * @json-ld type:schema:Text\n\t */\n\toperation: SyncChangeOperation;\n\n\t/**\n\t * The item id.\n\t */\n\tid: string;\n\n\t/**\n\t * The entity to set.\n\t * @json-ld type:json\n\t */\n\tentity?: ISynchronisedEntityCore;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISyncChangeSet.js","sourceRoot":"","sources":["../../../src/models/ISyncChangeSet.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISyncChange } from \"./ISyncChange.js\";\nimport type { SynchronisedStorageContexts } from \"./synchronisedStorageContexts.js\";\nimport type { SynchronisedStorageTypes } from \"./synchronisedStorageTypes.js\";\n\n/**\n * The object definition for a sync change set.\n */\nexport interface ISyncChangeSet {\n\t/**\n\t * The LD Context for the change set.\n\t */\n\t\"@context\": typeof SynchronisedStorageContexts.ContextRoot;\n\n\t/**\n\t * The LD Type for the change set.\n\t */\n\ttype: typeof SynchronisedStorageTypes.ChangeSet;\n\n\t/**\n\t * The id of the change set.\n\t */\n\tid: string;\n\n\t/**\n\t * The storage key of the change set. This is used to identify the entities being synchronised.\n\t */\n\tstorageKey: string;\n\n\t/**\n\t * The date the change set was created.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The date the change set was last modified.\n\t */\n\tdateModified: string;\n\n\t/**\n\t * The identity of the node that created the change set.\n\t */\n\tnodeId: string;\n\n\t/**\n\t * The changes to apply after a snapshot.\n\t */\n\tchanges: ISyncChange[];\n}\n"]}
1
+ {"version":3,"file":"ISyncChangeSet.js","sourceRoot":"","sources":["../../../src/models/ISyncChangeSet.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISyncChange } from \"./ISyncChange.js\";\nimport type { SynchronisedStorageContexts } from \"./synchronisedStorageContexts.js\";\nimport type { SynchronisedStorageTypes } from \"./synchronisedStorageTypes.js\";\n\n/**\n * The object definition for a sync change set.\n */\nexport interface ISyncChangeSet {\n\t/**\n\t * The LD Context for the change set.\n\t */\n\t\"@context\": typeof SynchronisedStorageContexts.Context;\n\n\t/**\n\t * The LD Type for the change set.\n\t */\n\ttype: typeof SynchronisedStorageTypes.ChangeSet;\n\n\t/**\n\t * The id of the change set.\n\t */\n\tid: string;\n\n\t/**\n\t * The storage key of the change set. This is used to identify the entities being synchronised.\n\t * @json-ld type:schema:identifier\n\t */\n\tstorageKey: string;\n\n\t/**\n\t * The date the change set was created.\n\t * @json-ld namespace:schema\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The date the change set was last modified.\n\t * @json-ld namespace:schema\n\t */\n\tdateModified: string;\n\n\t/**\n\t * The identity of the node that created the change set.\n\t * @json-ld namespace:twin-common\n\t */\n\tnodeIdentity: string;\n\n\t/**\n\t * The changes to apply after a snapshot.\n\t * @json-ld type:json\n\t */\n\tchanges: ISyncChange[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISyncRequest.js","sourceRoot":"","sources":["../../../src/models/ISyncRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { SynchronisedStorageContexts } from \"./synchronisedStorageContexts.js\";\nimport type { SynchronisedStorageTypes } from \"./synchronisedStorageTypes.js\";\n\n/**\n * The object definition for a sync request.\n */\nexport interface ISyncRequest {\n\t/**\n\t * The LD Context for the request.\n\t */\n\t\"@context\": typeof SynchronisedStorageContexts.ContextRoot;\n\n\t/**\n\t * The LD Type for the request.\n\t */\n\ttype: typeof SynchronisedStorageTypes.SyncRequest;\n\n\t/**\n\t * The identity of the node that created the request.\n\t */\n\tnodeId: string;\n}\n"]}
1
+ {"version":3,"file":"ISyncRequest.js","sourceRoot":"","sources":["../../../src/models/ISyncRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { SynchronisedStorageContexts } from \"./synchronisedStorageContexts.js\";\nimport type { SynchronisedStorageTypes } from \"./synchronisedStorageTypes.js\";\n\n/**\n * The object definition for a sync request.\n */\nexport interface ISyncRequest {\n\t/**\n\t * The LD Context for the request.\n\t */\n\t\"@context\": typeof SynchronisedStorageContexts.Context;\n\n\t/**\n\t * The LD Type for the request.\n\t */\n\ttype: typeof SynchronisedStorageTypes.SyncRequest;\n\n\t/**\n\t * The identity of the node that created the request.\n\t * @json-ld namespace:twin-common\n\t */\n\tnodeIdentity: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISynchronisedEntity.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedEntity.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISynchronisedEntityCore } from \"./ISynchronisedEntityCore.js\";\n\n/**\n * The base definition for synchronised entries.\n */\nexport interface ISynchronisedEntity extends ISynchronisedEntityCore {\n\t/**\n\t * The id of the entry.\n\t */\n\tid: string;\n\n\t/**\n\t * The identity of the node that owns the entry.\n\t */\n\tnodeId?: string;\n}\n"]}
1
+ {"version":3,"file":"ISynchronisedEntity.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedEntity.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ISynchronisedEntityCore } from \"./ISynchronisedEntityCore.js\";\n\n/**\n * The base definition for synchronised entries.\n */\nexport interface ISynchronisedEntity extends ISynchronisedEntityCore {\n\t/**\n\t * The id of the entry.\n\t */\n\tid: string;\n\n\t/**\n\t * The identity of the node that owns the entry.\n\t * @json-ld namespace:twin-common\n\t */\n\tnodeIdentity: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISynchronisedEntityCore.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedEntityCore.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The base definition for synchronised entries.\n */\nexport interface ISynchronisedEntityCore {\n\t/**\n\t * The date the entry was modified.\n\t */\n\tdateModified: string;\n}\n"]}
1
+ {"version":3,"file":"ISynchronisedEntityCore.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedEntityCore.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The base definition for synchronised entries.\n */\nexport interface ISynchronisedEntityCore {\n\t/**\n\t * The date the entry was modified.\n\t * @json-ld namespace:schema\n\t */\n\tdateModified: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ISynchronisedStorageComponent.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IIdentityAuthenticationActionRequest } from \"@twin.org/identity-authentication\";\nimport type { ISyncChangeSet } from \"./ISyncChangeSet.js\";\n\n/**\n * Class for performing synchronised storage operations.\n */\nexport interface ISynchronisedStorageComponent extends IComponent {\n\t/**\n\t * Get the decryption key for the synchronised storage.\n\t * This is used to decrypt the data stored in the synchronised storage.\n\t * @param actionRequest The action request used in the verifiable credential.\n\t * @returns The decryption key.\n\t */\n\tgetDecryptionKey(actionRequest: IIdentityAuthenticationActionRequest): Promise<string>;\n\n\t/**\n\t * Synchronise a set of changes from an untrusted node, assumes this is a trusted node.\n\t * @param syncChangeSet The change set to synchronise.\n\t * @param actionRequest The action request used in the verifiable credential.\n\t * @returns Nothing.\n\t */\n\tsyncChangeSet(\n\t\tsyncChangeSet: ISyncChangeSet,\n\t\tactionRequest: IIdentityAuthenticationActionRequest\n\t): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"ISynchronisedStorageComponent.js","sourceRoot":"","sources":["../../../src/models/ISynchronisedStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { ISyncChangeSet } from \"./ISyncChangeSet.js\";\n\n/**\n * Class for performing synchronised storage operations.\n */\nexport interface ISynchronisedStorageComponent extends IComponent {\n\t/**\n\t * Get the decryption key for the synchronised storage.\n\t * This is used to decrypt the data stored in the synchronised storage.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns The decryption key.\n\t */\n\tgetDecryptionKey(trustPayload: unknown): Promise<string>;\n\n\t/**\n\t * Synchronise a set of changes from an untrusted node, assumes this is a trusted node.\n\t * @param syncChangeSet The change set to synchronise.\n\t * @param trustPayload Trust payload to verify the requesters identity.\n\t * @returns Nothing.\n\t */\n\tsyncChangeSet(syncChangeSet: ISyncChangeSet, trustPayload: unknown): Promise<void>;\n}\n"]}
@@ -1,13 +1,21 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
3
  /**
4
- * The LD Contexts concerning SynchronisedStorage.
4
+ * The Contexts concerning Synchronised Storage.
5
5
  */
6
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  export const SynchronisedStorageContexts = {
8
8
  /**
9
- * The SynchronisedStorage LD Context.
9
+ * The canonical RDF namespace URI for Synchronised Storage.
10
10
  */
11
- ContextRoot: "https://schema.twindev.org/synchronised-storage"
11
+ Namespace: "https://schema.twindev.org/synchronised-storage/",
12
+ /**
13
+ * The value to use in context for Synchronised Storage.
14
+ */
15
+ Context: "https://schema.twindev.org/synchronised-storage/",
16
+ /**
17
+ * The JSON-LD Context URL for Synchronised Storage.
18
+ */
19
+ JsonLdContext: "https://schema.twindev.org/synchronised-storage/types.jsonld"
12
20
  };
13
21
  //# sourceMappingURL=synchronisedStorageContexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"synchronisedStorageContexts.js","sourceRoot":"","sources":["../../../src/models/synchronisedStorageContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C;;OAEG;IACH,WAAW,EAAE,iDAAiD;CACrD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The LD Contexts concerning SynchronisedStorage.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SynchronisedStorageContexts = {\n\t/**\n\t * The SynchronisedStorage LD Context.\n\t */\n\tContextRoot: \"https://schema.twindev.org/synchronised-storage\"\n} as const;\n\n/**\n * The LD Contexts concerning SynchronisedStorage.\n */\nexport type SynchronisedStorageContexts =\n\t(typeof SynchronisedStorageContexts)[keyof typeof SynchronisedStorageContexts];\n"]}
1
+ {"version":3,"file":"synchronisedStorageContexts.js","sourceRoot":"","sources":["../../../src/models/synchronisedStorageContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C;;OAEG;IACH,SAAS,EAAE,kDAAkD;IAE7D;;OAEG;IACH,OAAO,EAAE,kDAAkD;IAE3D;;OAEG;IACH,aAAa,EAAE,8DAA8D;CACpE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The Contexts concerning Synchronised Storage.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SynchronisedStorageContexts = {\n\t/**\n\t * The canonical RDF namespace URI for Synchronised Storage.\n\t */\n\tNamespace: \"https://schema.twindev.org/synchronised-storage/\",\n\n\t/**\n\t * The value to use in context for Synchronised Storage.\n\t */\n\tContext: \"https://schema.twindev.org/synchronised-storage/\",\n\n\t/**\n\t * The JSON-LD Context URL for Synchronised Storage.\n\t */\n\tJsonLdContext: \"https://schema.twindev.org/synchronised-storage/types.jsonld\"\n} as const;\n\n/**\n * The Contexts concerning Synchronised Storage.\n */\nexport type SynchronisedStorageContexts =\n\t(typeof SynchronisedStorageContexts)[keyof typeof SynchronisedStorageContexts];\n"]}
@@ -17,7 +17,6 @@ export * from "./models/ISynchronisedEntityCore.js";
17
17
  export * from "./models/ISynchronisedStorageComponent.js";
18
18
  export * from "./models/ISyncRequest.js";
19
19
  export * from "./models/syncChangeOperation.js";
20
- export * from "./models/synchronisedStorageAssetTypes.js";
21
20
  export * from "./models/synchronisedStorageContexts.js";
22
21
  export * from "./models/synchronisedStorageTopics.js";
23
22
  export * from "./models/synchronisedStorageTypes.js";
@@ -6,6 +6,7 @@ import type { SyncChangeOperation } from "./syncChangeOperation.js";
6
6
  export interface ISyncChange {
7
7
  /**
8
8
  * Operation.
9
+ * @json-ld type:schema:Text
9
10
  */
10
11
  operation: SyncChangeOperation;
11
12
  /**
@@ -14,6 +15,7 @@ export interface ISyncChange {
14
15
  id: string;
15
16
  /**
16
17
  * The entity to set.
18
+ * @json-ld type:json
17
19
  */
18
20
  entity?: ISynchronisedEntityCore;
19
21
  }
@@ -8,7 +8,7 @@ export interface ISyncChangeSet {
8
8
  /**
9
9
  * The LD Context for the change set.
10
10
  */
11
- "@context": typeof SynchronisedStorageContexts.ContextRoot;
11
+ "@context": typeof SynchronisedStorageContexts.Context;
12
12
  /**
13
13
  * The LD Type for the change set.
14
14
  */
@@ -19,22 +19,27 @@ export interface ISyncChangeSet {
19
19
  id: string;
20
20
  /**
21
21
  * The storage key of the change set. This is used to identify the entities being synchronised.
22
+ * @json-ld type:schema:identifier
22
23
  */
23
24
  storageKey: string;
24
25
  /**
25
26
  * The date the change set was created.
27
+ * @json-ld namespace:schema
26
28
  */
27
29
  dateCreated: string;
28
30
  /**
29
31
  * The date the change set was last modified.
32
+ * @json-ld namespace:schema
30
33
  */
31
34
  dateModified: string;
32
35
  /**
33
36
  * The identity of the node that created the change set.
37
+ * @json-ld namespace:twin-common
34
38
  */
35
- nodeId: string;
39
+ nodeIdentity: string;
36
40
  /**
37
41
  * The changes to apply after a snapshot.
42
+ * @json-ld type:json
38
43
  */
39
44
  changes: ISyncChange[];
40
45
  }
@@ -7,13 +7,14 @@ export interface ISyncRequest {
7
7
  /**
8
8
  * The LD Context for the request.
9
9
  */
10
- "@context": typeof SynchronisedStorageContexts.ContextRoot;
10
+ "@context": typeof SynchronisedStorageContexts.Context;
11
11
  /**
12
12
  * The LD Type for the request.
13
13
  */
14
14
  type: typeof SynchronisedStorageTypes.SyncRequest;
15
15
  /**
16
16
  * The identity of the node that created the request.
17
+ * @json-ld namespace:twin-common
17
18
  */
18
- nodeId: string;
19
+ nodeIdentity: string;
19
20
  }
@@ -9,6 +9,7 @@ export interface ISynchronisedEntity extends ISynchronisedEntityCore {
9
9
  id: string;
10
10
  /**
11
11
  * The identity of the node that owns the entry.
12
+ * @json-ld namespace:twin-common
12
13
  */
13
- nodeId?: string;
14
+ nodeIdentity: string;
14
15
  }
@@ -4,6 +4,7 @@
4
4
  export interface ISynchronisedEntityCore {
5
5
  /**
6
6
  * The date the entry was modified.
7
+ * @json-ld namespace:schema
7
8
  */
8
9
  dateModified: string;
9
10
  }
@@ -1,5 +1,4 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
- import type { IIdentityAuthenticationActionRequest } from "@twin.org/identity-authentication";
3
2
  import type { ISyncChangeSet } from "./ISyncChangeSet.js";
4
3
  /**
5
4
  * Class for performing synchronised storage operations.
@@ -8,15 +7,15 @@ export interface ISynchronisedStorageComponent extends IComponent {
8
7
  /**
9
8
  * Get the decryption key for the synchronised storage.
10
9
  * This is used to decrypt the data stored in the synchronised storage.
11
- * @param actionRequest The action request used in the verifiable credential.
10
+ * @param trustPayload Trust payload to verify the requesters identity.
12
11
  * @returns The decryption key.
13
12
  */
14
- getDecryptionKey(actionRequest: IIdentityAuthenticationActionRequest): Promise<string>;
13
+ getDecryptionKey(trustPayload: unknown): Promise<string>;
15
14
  /**
16
15
  * Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
17
16
  * @param syncChangeSet The change set to synchronise.
18
- * @param actionRequest The action request used in the verifiable credential.
17
+ * @param trustPayload Trust payload to verify the requesters identity.
19
18
  * @returns Nothing.
20
19
  */
21
- syncChangeSet(syncChangeSet: ISyncChangeSet, actionRequest: IIdentityAuthenticationActionRequest): Promise<void>;
20
+ syncChangeSet(syncChangeSet: ISyncChangeSet, trustPayload: unknown): Promise<void>;
22
21
  }
@@ -1,13 +1,21 @@
1
1
  /**
2
- * The LD Contexts concerning SynchronisedStorage.
2
+ * The Contexts concerning Synchronised Storage.
3
3
  */
4
4
  export declare const SynchronisedStorageContexts: {
5
5
  /**
6
- * The SynchronisedStorage LD Context.
6
+ * The canonical RDF namespace URI for Synchronised Storage.
7
7
  */
8
- readonly ContextRoot: "https://schema.twindev.org/synchronised-storage";
8
+ readonly Namespace: "https://schema.twindev.org/synchronised-storage/";
9
+ /**
10
+ * The value to use in context for Synchronised Storage.
11
+ */
12
+ readonly Context: "https://schema.twindev.org/synchronised-storage/";
13
+ /**
14
+ * The JSON-LD Context URL for Synchronised Storage.
15
+ */
16
+ readonly JsonLdContext: "https://schema.twindev.org/synchronised-storage/types.jsonld";
9
17
  };
10
18
  /**
11
- * The LD Contexts concerning SynchronisedStorage.
19
+ * The Contexts concerning Synchronised Storage.
12
20
  */
13
21
  export type SynchronisedStorageContexts = (typeof SynchronisedStorageContexts)[keyof typeof SynchronisedStorageContexts];
package/docs/changelog.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.11](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.10...synchronised-storage-models-v0.0.3-next.11) (2026-04-10)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **synchronised-storage-models:** Synchronize repo versions
9
+
10
+ ## [0.0.3-next.10](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.9...synchronised-storage-models-v0.0.3-next.10) (2026-03-20)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * remove redundant code ([19edb23](https://github.com/twinfoundation/synchronised-storage/commit/19edb236f318b9c9454a64259d0ab5098a0c8173))
16
+
17
+ ## [0.0.3-next.9](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.8...synchronised-storage-models-v0.0.3-next.9) (2026-03-04)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **synchronised-storage-models:** Synchronize repo versions
23
+
24
+ ## [0.0.3-next.8](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.7...synchronised-storage-models-v0.0.3-next.8) (2026-02-25)
25
+
26
+
27
+ ### Features
28
+
29
+ * add ts-to-jsonld-context tool ([16d7677](https://github.com/twinfoundation/synchronised-storage/commit/16d76776e7e3f75e6c4fb9f88cb32fed2967c4b6))
30
+ * update schemas ([7566c48](https://github.com/twinfoundation/synchronised-storage/commit/7566c4860baad5ead4327ac19cb5b647e63f2ca3))
31
+
32
+ ## [0.0.3-next.7](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.6...synchronised-storage-models-v0.0.3-next.7) (2026-01-28)
33
+
34
+
35
+ ### Features
36
+
37
+ * json ld contexts ([#36](https://github.com/twinfoundation/synchronised-storage/issues/36)) ([3a87a9f](https://github.com/twinfoundation/synchronised-storage/commit/3a87a9fb16d21baf672e44b4e8914cf1937b1d6a))
38
+
39
+ ## [0.0.3-next.6](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.5...synchronised-storage-models-v0.0.3-next.6) (2026-01-22)
40
+
41
+
42
+ ### Features
43
+
44
+ * update contexts ([#34](https://github.com/twinfoundation/synchronised-storage/issues/34)) ([7be9caf](https://github.com/twinfoundation/synchronised-storage/commit/7be9caf3da63f8afefd625650150bed171a1d045))
45
+
46
+ ## [0.0.3-next.5](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.4...synchronised-storage-models-v0.0.3-next.5) (2026-01-19)
47
+
48
+
49
+ ### Features
50
+
51
+ * remove unused dependencies ([518c460](https://github.com/twinfoundation/synchronised-storage/commit/518c460d2e5e2b2c487565acb5162a03ddb85eae))
52
+
53
+ ## [0.0.3-next.4](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.3...synchronised-storage-models-v0.0.3-next.4) (2026-01-15)
54
+
55
+
56
+ ### Features
57
+
58
+ * update contexts and namespaces ([#31](https://github.com/twinfoundation/synchronised-storage/issues/31)) ([b31c8fa](https://github.com/twinfoundation/synchronised-storage/commit/b31c8fabb8431a230415aaa2caa47fb021489d3a))
59
+
60
+ ## [0.0.3-next.3](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.2...synchronised-storage-models-v0.0.3-next.3) (2026-01-12)
61
+
62
+
63
+ ### Miscellaneous Chores
64
+
65
+ * **synchronised-storage-models:** Synchronize repo versions
66
+
67
+ ## [0.0.3-next.2](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.1...synchronised-storage-models-v0.0.3-next.2) (2025-12-04)
68
+
69
+
70
+ ### Features
71
+
72
+ * use trust component ([424f0d6](https://github.com/twinfoundation/synchronised-storage/commit/424f0d6aaacfdc7700c46fe6c2def23b2eacddc9))
73
+
3
74
  ## [0.0.3-next.1](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.3-next.0...synchronised-storage-models-v0.0.3-next.1) (2025-11-12)
4
75
 
5
76
 
@@ -141,4 +212,4 @@
141
212
 
142
213
  * initial commit ([16949b8](https://github.com/twinfoundation/synchronised-storage/commit/16949b8e5bdb190f053c52af352290e3fd964f9a))
143
214
 
144
- ## @twin.org/synchronised-storage-models - Changelog
215
+ ## Changelog
package/docs/examples.md CHANGED
@@ -1 +1,61 @@
1
- # @twin.org/synchronised-storage-models - Examples
1
+ # Synchronised Storage Models Examples
2
+
3
+ Use these model-focused snippets to define strongly typed payloads for synchronisation requests, changes, and event bus workflows.
4
+
5
+ ## Model Contracts
6
+
7
+ ```typescript
8
+ import {
9
+ SynchronisedStorageContexts,
10
+ SynchronisedStorageTypes,
11
+ SyncChangeOperation,
12
+ type ISyncChangeSet
13
+ } from '@twin.org/synchronised-storage-models';
14
+
15
+ const syncChangeSet: ISyncChangeSet = {
16
+ '@context': SynchronisedStorageContexts.Context,
17
+ type: SynchronisedStorageTypes.ChangeSet,
18
+ id: 'changeset-001',
19
+ storageKey: 'profile',
20
+ dateCreated: '2026-03-10T11:00:00.000Z',
21
+ dateModified: '2026-03-10T11:00:00.000Z',
22
+ nodeIdentity: 'did:iota:node-1',
23
+ changes: [
24
+ {
25
+ operation: SyncChangeOperation.Set,
26
+ id: 'profile-42',
27
+ entity: {
28
+ dateModified: '2026-03-10T11:00:00.000Z'
29
+ }
30
+ }
31
+ ]
32
+ };
33
+
34
+ console.log(syncChangeSet.changes[0].operation); // set
35
+ ```
36
+
37
+ ```typescript
38
+ import {
39
+ SyncNodeIdMode,
40
+ SynchronisedStorageTopics,
41
+ type ISynchronisedEntity
42
+ } from '@twin.org/synchronised-storage-models';
43
+
44
+ interface IProfileEntity extends ISynchronisedEntity {
45
+ displayName: string;
46
+ }
47
+
48
+ const entity: IProfileEntity = {
49
+ id: 'profile-42',
50
+ nodeIdentity: 'did:iota:node-1',
51
+ dateModified: '2026-03-10T11:05:00.000Z',
52
+ displayName: 'Rowan'
53
+ };
54
+
55
+ const topic = SynchronisedStorageTopics.LocalItemChange;
56
+ const mode = SyncNodeIdMode.Remote;
57
+
58
+ console.log(entity.id); // profile-42
59
+ console.log(topic); // synchronised-storage:local-item-change
60
+ console.log(mode); // remote
61
+ ```
@@ -25,7 +25,6 @@
25
25
 
26
26
  - [SyncChangeOperation](type-aliases/SyncChangeOperation.md)
27
27
  - [SyncNodeIdMode](type-aliases/SyncNodeIdMode.md)
28
- - [SynchronisedStorageAssetTypes](type-aliases/SynchronisedStorageAssetTypes.md)
29
28
  - [SynchronisedStorageContexts](type-aliases/SynchronisedStorageContexts.md)
30
29
  - [SynchronisedStorageTopics](type-aliases/SynchronisedStorageTopics.md)
31
30
  - [SynchronisedStorageTypes](type-aliases/SynchronisedStorageTypes.md)
@@ -34,7 +33,6 @@
34
33
 
35
34
  - [SyncChangeOperation](variables/SyncChangeOperation.md)
36
35
  - [SyncNodeIdMode](variables/SyncNodeIdMode.md)
37
- - [SynchronisedStorageAssetTypes](variables/SynchronisedStorageAssetTypes.md)
38
36
  - [SynchronisedStorageContexts](variables/SynchronisedStorageContexts.md)
39
37
  - [SynchronisedStorageTopics](variables/SynchronisedStorageTopics.md)
40
38
  - [SynchronisedStorageTypes](variables/SynchronisedStorageTypes.md)
@@ -4,7 +4,7 @@ Request for a local batch.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
15
- ### batchSize
15
+ ### batchSize {#batchsize}
16
16
 
17
17
  > **batchSize**: `number`
18
18
 
@@ -20,7 +20,7 @@ The size of the batch.
20
20
 
21
21
  ***
22
22
 
23
- ### requestMode
23
+ ### requestMode {#requestmode}
24
24
 
25
25
  > **requestMode**: [`SyncNodeIdMode`](../type-aliases/SyncNodeIdMode.md)
26
26
 
@@ -4,7 +4,7 @@ Response for a local batch.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
15
- ### entities
15
+ ### entities {#entities}
16
16
 
17
17
  > **entities**: [`ISynchronisedEntity`](ISynchronisedEntity.md)[]
18
18
 
@@ -20,7 +20,7 @@ The entities in the batch.
20
20
 
21
21
  ***
22
22
 
23
- ### lastEntry
23
+ ### lastEntry {#lastentry}
24
24
 
25
25
  > **lastEntry**: `boolean`
26
26
 
@@ -4,7 +4,7 @@ The object definition for a sync change.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### operation
7
+ ### operation {#operation}
8
8
 
9
9
  > **operation**: [`SyncChangeOperation`](../type-aliases/SyncChangeOperation.md)
10
10
 
@@ -12,7 +12,7 @@ Operation.
12
12
 
13
13
  ***
14
14
 
15
- ### id
15
+ ### id {#id}
16
16
 
17
17
  > **id**: `string`
18
18
 
@@ -20,8 +20,8 @@ The item id.
20
20
 
21
21
  ***
22
22
 
23
- ### entity?
23
+ ### entity? {#entity}
24
24
 
25
- > `optional` **entity**: [`ISynchronisedEntityCore`](ISynchronisedEntityCore.md)
25
+ > `optional` **entity?**: [`ISynchronisedEntityCore`](ISynchronisedEntityCore.md)
26
26
 
27
27
  The entity to set.
@@ -4,15 +4,15 @@ The object definition for a sync change set.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### @context
7
+ ### @context {#context}
8
8
 
9
- > **@context**: `"https://schema.twindev.org/synchronised-storage"`
9
+ > **@context**: `"https://schema.twindev.org/synchronised-storage/"`
10
10
 
11
11
  The LD Context for the change set.
12
12
 
13
13
  ***
14
14
 
15
- ### type
15
+ ### type {#type}
16
16
 
17
17
  > **type**: `"ChangeSet"`
18
18
 
@@ -20,7 +20,7 @@ The LD Type for the change set.
20
20
 
21
21
  ***
22
22
 
23
- ### id
23
+ ### id {#id}
24
24
 
25
25
  > **id**: `string`
26
26
 
@@ -28,7 +28,7 @@ The id of the change set.
28
28
 
29
29
  ***
30
30
 
31
- ### storageKey
31
+ ### storageKey {#storagekey}
32
32
 
33
33
  > **storageKey**: `string`
34
34
 
@@ -36,7 +36,7 @@ The storage key of the change set. This is used to identify the entities being s
36
36
 
37
37
  ***
38
38
 
39
- ### dateCreated
39
+ ### dateCreated {#datecreated}
40
40
 
41
41
  > **dateCreated**: `string`
42
42
 
@@ -44,7 +44,7 @@ The date the change set was created.
44
44
 
45
45
  ***
46
46
 
47
- ### dateModified
47
+ ### dateModified {#datemodified}
48
48
 
49
49
  > **dateModified**: `string`
50
50
 
@@ -52,15 +52,15 @@ The date the change set was last modified.
52
52
 
53
53
  ***
54
54
 
55
- ### nodeId
55
+ ### nodeIdentity {#nodeidentity}
56
56
 
57
- > **nodeId**: `string`
57
+ > **nodeIdentity**: `string`
58
58
 
59
59
  The identity of the node that created the change set.
60
60
 
61
61
  ***
62
62
 
63
- ### changes
63
+ ### changes {#changes}
64
64
 
65
65
  > **changes**: [`ISyncChange`](ISyncChange.md)[]
66
66
 
@@ -4,23 +4,23 @@ Request a trusted node to perform a sync request for a changeset.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### headers?
7
+ ### headers? {#headers}
8
8
 
9
- > `optional` **headers**: `object`
9
+ > `optional` **headers?**: `object`
10
10
 
11
11
  The headers which can be used to determine the response data type.
12
12
 
13
13
  #### accept?
14
14
 
15
- > `optional` **accept**: `"application/ld+json"` \| `"application/json"`
15
+ > `optional` **accept?**: `"application/ld+json"` \| `"application/json"`
16
16
 
17
17
  #### authorization?
18
18
 
19
- > `optional` **authorization**: `string`
19
+ > `optional` **authorization?**: `string`
20
20
 
21
21
  ***
22
22
 
23
- ### body
23
+ ### body {#body}
24
24
 
25
25
  > **body**: [`ISyncChangeSet`](ISyncChangeSet.md)
26
26
 
@@ -4,16 +4,16 @@ Request for the decryption key for the synchronised storage.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### headers?
7
+ ### headers? {#headers}
8
8
 
9
- > `optional` **headers**: `object`
9
+ > `optional` **headers?**: `object`
10
10
 
11
11
  The headers which can be used to determine the response data type.
12
12
 
13
13
  #### accept?
14
14
 
15
- > `optional` **accept**: `"application/ld+json"` \| `"application/json"`
15
+ > `optional` **accept?**: `"application/ld+json"` \| `"application/json"`
16
16
 
17
17
  #### authorization?
18
18
 
19
- > `optional` **authorization**: `string`
19
+ > `optional` **authorization?**: `string`
@@ -4,7 +4,7 @@ Response to a request for the decryption key for the synchronised storage.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### body
7
+ ### body {#body}
8
8
 
9
9
  > **body**: `object`
10
10
 
@@ -4,7 +4,7 @@ The payload for an item change.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage being changed.
12
12
 
13
13
  ***
14
14
 
15
- ### operation
15
+ ### operation {#operation}
16
16
 
17
17
  > **operation**: [`SyncChangeOperation`](../type-aliases/SyncChangeOperation.md)
18
18
 
@@ -20,7 +20,7 @@ The operation being performed on the item.
20
20
 
21
21
  ***
22
22
 
23
- ### nodeId
23
+ ### nodeId {#nodeid}
24
24
 
25
25
  > **nodeId**: `string`
26
26
 
@@ -28,7 +28,7 @@ The node performing the operation.
28
28
 
29
29
  ***
30
30
 
31
- ### id
31
+ ### id {#id}
32
32
 
33
33
  > **id**: `string`
34
34
 
@@ -4,7 +4,7 @@ The payload for an item remove.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage being removed.
12
12
 
13
13
  ***
14
14
 
15
- ### nodeId
15
+ ### nodeId {#nodeid}
16
16
 
17
17
  > **nodeId**: `string`
18
18
 
@@ -20,7 +20,7 @@ The node identity of the entity being removed.
20
20
 
21
21
  ***
22
22
 
23
- ### id
23
+ ### id {#id}
24
24
 
25
25
  > **id**: `string`
26
26
 
@@ -4,7 +4,7 @@ Request for a local item.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
15
- ### id
15
+ ### id {#id}
16
16
 
17
17
  > **id**: `string`
18
18
 
@@ -4,7 +4,7 @@ Response for a sync item request.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
15
- ### id
15
+ ### id {#id}
16
16
 
17
17
  > **id**: `string`
18
18
 
@@ -20,8 +20,8 @@ The id of the entity in the sync item response.
20
20
 
21
21
  ***
22
22
 
23
- ### entity?
23
+ ### entity? {#entity}
24
24
 
25
- > `optional` **entity**: [`ISynchronisedEntity`](ISynchronisedEntity.md)
25
+ > `optional` **entity?**: [`ISynchronisedEntity`](ISynchronisedEntity.md)
26
26
 
27
27
  The entity in the sync item response, undefined if not found.
@@ -4,7 +4,7 @@ The payload for an item set.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage being set.
12
12
 
13
13
  ***
14
14
 
15
- ### entity
15
+ ### entity {#entity}
16
16
 
17
17
  > **entity**: [`ISynchronisedEntity`](ISynchronisedEntity.md)
18
18
 
@@ -4,7 +4,7 @@ Register a key with synchronised storage.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -4,15 +4,15 @@ The object definition for a sync request.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### @context
7
+ ### @context {#context}
8
8
 
9
- > **@context**: `"https://schema.twindev.org/synchronised-storage"`
9
+ > **@context**: `"https://schema.twindev.org/synchronised-storage/"`
10
10
 
11
11
  The LD Context for the request.
12
12
 
13
13
  ***
14
14
 
15
- ### type
15
+ ### type {#type}
16
16
 
17
17
  > **type**: `"SyncRequest"`
18
18
 
@@ -20,8 +20,8 @@ The LD Type for the request.
20
20
 
21
21
  ***
22
22
 
23
- ### nodeId
23
+ ### nodeIdentity {#nodeidentity}
24
24
 
25
- > **nodeId**: `string`
25
+ > **nodeIdentity**: `string`
26
26
 
27
27
  The identity of the node that created the request.
@@ -4,7 +4,7 @@ Request to reset the local storage.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### storageKey
7
+ ### storageKey {#storagekey}
8
8
 
9
9
  > **storageKey**: `string`
10
10
 
@@ -12,7 +12,7 @@ The key of the storage for the entities in the batch.
12
12
 
13
13
  ***
14
14
 
15
- ### resetMode
15
+ ### resetMode {#resetmode}
16
16
 
17
17
  > **resetMode**: [`SyncNodeIdMode`](../type-aliases/SyncNodeIdMode.md)
18
18
 
@@ -8,7 +8,7 @@ The base definition for synchronised entries.
8
8
 
9
9
  ## Properties
10
10
 
11
- ### id
11
+ ### id {#id}
12
12
 
13
13
  > **id**: `string`
14
14
 
@@ -16,15 +16,15 @@ The id of the entry.
16
16
 
17
17
  ***
18
18
 
19
- ### nodeId?
19
+ ### nodeIdentity {#nodeidentity}
20
20
 
21
- > `optional` **nodeId**: `string`
21
+ > **nodeIdentity**: `string`
22
22
 
23
23
  The identity of the node that owns the entry.
24
24
 
25
25
  ***
26
26
 
27
- ### dateModified
27
+ ### dateModified {#datemodified}
28
28
 
29
29
  > **dateModified**: `string`
30
30
 
@@ -8,7 +8,7 @@ The base definition for synchronised entries.
8
8
 
9
9
  ## Properties
10
10
 
11
- ### dateModified
11
+ ### dateModified {#datemodified}
12
12
 
13
13
  > **dateModified**: `string`
14
14
 
@@ -8,20 +8,20 @@ Class for performing synchronised storage operations.
8
8
 
9
9
  ## Methods
10
10
 
11
- ### getDecryptionKey()
11
+ ### getDecryptionKey() {#getdecryptionkey}
12
12
 
13
- > **getDecryptionKey**(`actionRequest`): `Promise`\<`string`\>
13
+ > **getDecryptionKey**(`trustPayload`): `Promise`\<`string`\>
14
14
 
15
15
  Get the decryption key for the synchronised storage.
16
16
  This is used to decrypt the data stored in the synchronised storage.
17
17
 
18
18
  #### Parameters
19
19
 
20
- ##### actionRequest
20
+ ##### trustPayload
21
21
 
22
- `IIdentityAuthenticationActionRequest`
22
+ `unknown`
23
23
 
24
- The action request used in the verifiable credential.
24
+ Trust payload to verify the requesters identity.
25
25
 
26
26
  #### Returns
27
27
 
@@ -31,9 +31,9 @@ The decryption key.
31
31
 
32
32
  ***
33
33
 
34
- ### syncChangeSet()
34
+ ### syncChangeSet() {#syncchangeset}
35
35
 
36
- > **syncChangeSet**(`syncChangeSet`, `actionRequest`): `Promise`\<`void`\>
36
+ > **syncChangeSet**(`syncChangeSet`, `trustPayload`): `Promise`\<`void`\>
37
37
 
38
38
  Synchronise a set of changes from an untrusted node, assumes this is a trusted node.
39
39
 
@@ -45,11 +45,11 @@ Synchronise a set of changes from an untrusted node, assumes this is a trusted n
45
45
 
46
46
  The change set to synchronise.
47
47
 
48
- ##### actionRequest
48
+ ##### trustPayload
49
49
 
50
- `IIdentityAuthenticationActionRequest`
50
+ `unknown`
51
51
 
52
- The action request used in the verifiable credential.
52
+ Trust payload to verify the requesters identity.
53
53
 
54
54
  #### Returns
55
55
 
@@ -2,4 +2,4 @@
2
2
 
3
3
  > **SynchronisedStorageContexts** = *typeof* [`SynchronisedStorageContexts`](../variables/SynchronisedStorageContexts.md)\[keyof *typeof* [`SynchronisedStorageContexts`](../variables/SynchronisedStorageContexts.md)\]
4
4
 
5
- The LD Contexts concerning SynchronisedStorage.
5
+ The Contexts concerning Synchronised Storage.
@@ -6,13 +6,13 @@ The operations for a change.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### Set
9
+ ### Set {#set}
10
10
 
11
11
  > `readonly` **Set**: `"set"` = `"set"`
12
12
 
13
13
  An item was set in the storage.
14
14
 
15
- ### Delete
15
+ ### Delete {#delete}
16
16
 
17
17
  > `readonly` **Delete**: `"delete"` = `"delete"`
18
18
 
@@ -6,19 +6,19 @@ The mode to determine how node identities are matched.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### Local
9
+ ### Local {#local}
10
10
 
11
11
  > `readonly` **Local**: `"local"` = `"local"`
12
12
 
13
13
  Match the local node identity.
14
14
 
15
- ### Remote
15
+ ### Remote {#remote}
16
16
 
17
17
  > `readonly` **Remote**: `"remote"` = `"remote"`
18
18
 
19
19
  Match all but the local node identity.
20
20
 
21
- ### All
21
+ ### All {#all}
22
22
 
23
23
  > `readonly` **All**: `"all"` = `"all"`
24
24
 
@@ -2,12 +2,24 @@
2
2
 
3
3
  > `const` **SynchronisedStorageContexts**: `object`
4
4
 
5
- The LD Contexts concerning SynchronisedStorage.
5
+ The Contexts concerning Synchronised Storage.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### ContextRoot
9
+ ### Namespace {#namespace}
10
10
 
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/synchronised-storage"` = `"https://schema.twindev.org/synchronised-storage"`
11
+ > `readonly` **Namespace**: `"https://schema.twindev.org/synchronised-storage/"` = `"https://schema.twindev.org/synchronised-storage/"`
12
12
 
13
- The SynchronisedStorage LD Context.
13
+ The canonical RDF namespace URI for Synchronised Storage.
14
+
15
+ ### Context {#context}
16
+
17
+ > `readonly` **Context**: `"https://schema.twindev.org/synchronised-storage/"` = `"https://schema.twindev.org/synchronised-storage/"`
18
+
19
+ The value to use in context for Synchronised Storage.
20
+
21
+ ### JsonLdContext {#jsonldcontext}
22
+
23
+ > `readonly` **JsonLdContext**: `"https://schema.twindev.org/synchronised-storage/types.jsonld"` = `"https://schema.twindev.org/synchronised-storage/types.jsonld"`
24
+
25
+ The JSON-LD Context URL for Synchronised Storage.
@@ -6,55 +6,55 @@ The topics for synchronised storage event bus notifications.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### RegisterStorageKey
9
+ ### RegisterStorageKey {#registerstoragekey}
10
10
 
11
11
  > `readonly` **RegisterStorageKey**: `"synchronised-storage:register-storage-key"` = `"synchronised-storage:register-storage-key"`
12
12
 
13
13
  Register a storage key for the synchronised storage.
14
14
 
15
- ### LocalItemChange
15
+ ### LocalItemChange {#localitemchange}
16
16
 
17
17
  > `readonly` **LocalItemChange**: `"synchronised-storage:local-item-change"` = `"synchronised-storage:local-item-change"`
18
18
 
19
19
  An item was changed in the storage by the local node.
20
20
 
21
- ### LocalItemRequest
21
+ ### LocalItemRequest {#localitemrequest}
22
22
 
23
23
  > `readonly` **LocalItemRequest**: `"synchronised-storage:local-item-request"` = `"synchronised-storage:local-item-request"`
24
24
 
25
25
  A request has been made for a local item.
26
26
 
27
- ### LocalItemResponse
27
+ ### LocalItemResponse {#localitemresponse}
28
28
 
29
29
  > `readonly` **LocalItemResponse**: `"synchronised-storage:local-item-response"` = `"synchronised-storage:local-item-response"`
30
30
 
31
31
  A response to a local item request.
32
32
 
33
- ### Reset
33
+ ### Reset {#reset}
34
34
 
35
35
  > `readonly` **Reset**: `"synchronised-storage:reset"` = `"synchronised-storage:reset"`
36
36
 
37
37
  Reset the storage.
38
38
 
39
- ### BatchRequest
39
+ ### BatchRequest {#batchrequest}
40
40
 
41
41
  > `readonly` **BatchRequest**: `"synchronised-storage:batch-request"` = `"synchronised-storage:batch-request"`
42
42
 
43
43
  A request has been made for a batch.
44
44
 
45
- ### BatchResponse
45
+ ### BatchResponse {#batchresponse}
46
46
 
47
47
  > `readonly` **BatchResponse**: `"synchronised-storage:batch-response"` = `"synchronised-storage:batch-response"`
48
48
 
49
49
  A response to a batch.
50
50
 
51
- ### RemoteItemSet
51
+ ### RemoteItemSet {#remoteitemset}
52
52
 
53
53
  > `readonly` **RemoteItemSet**: `"synchronised-storage:remote-item-set"` = `"synchronised-storage:remote-item-set"`
54
54
 
55
55
  An item was set in the storage by the remote node.
56
56
 
57
- ### RemoteItemRemove
57
+ ### RemoteItemRemove {#remoteitemremove}
58
58
 
59
59
  > `readonly` **RemoteItemRemove**: `"synchronised-storage:remote-item-remove"` = `"synchronised-storage:remote-item-remove"`
60
60
 
@@ -6,13 +6,13 @@ The types of Synchronised Storage data.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### SyncRequest
9
+ ### SyncRequest {#syncrequest}
10
10
 
11
11
  > `readonly` **SyncRequest**: `"SyncRequest"` = `"SyncRequest"`
12
12
 
13
13
  Represents a synchronised storage request.
14
14
 
15
- ### ChangeSet
15
+ ### ChangeSet {#changeset}
16
16
 
17
17
  > `readonly` **ChangeSet**: `"ChangeSet"` = `"ChangeSet"`
18
18
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/synchronised-storage-models",
3
- "version": "0.0.3-next.1",
4
- "description": "Models which define the structure of the synchronised storage connectors and services",
3
+ "version": "0.0.3-next.11",
4
+ "description": "Shared models, constants, and schemas for synchronised storage messages and contracts.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/synchronised-storage.git",
@@ -16,11 +16,8 @@
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
18
  "@twin.org/entity": "next",
19
- "@twin.org/identity-authentication": "next",
20
19
  "@twin.org/identity-models": "next",
21
- "@twin.org/nameof": "next",
22
- "@twin.org/standards-w3c-did": "next",
23
- "@twin.org/standards-w3c-odrl": "next"
20
+ "@twin.org/nameof": "next"
24
21
  },
25
22
  "main": "./dist/es/index.js",
26
23
  "types": "./dist/types/index.d.ts",
@@ -1,26 +0,0 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
- import { ActionType } from "@twin.org/standards-w3c-odrl";
4
- /**
5
- * The ODRL asset types for SynchronisedStorage.
6
- */
7
- // eslint-disable-next-line @typescript-eslint/naming-convention
8
- export const SynchronisedStorageAssetTypes = {
9
- /**
10
- * Decryption Key.
11
- */
12
- DecryptionKey: "decryption-key",
13
- /**
14
- * Decryption Key Actions.
15
- */
16
- DecryptionKeyActions: [ActionType.Read],
17
- /**
18
- * Change Set.
19
- */
20
- ChangeSet: "change-set",
21
- /**
22
- * Change Set Actions.
23
- */
24
- ChangeSetActions: [ActionType.Write]
25
- };
26
- //# sourceMappingURL=synchronisedStorageAssetTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"synchronisedStorageAssetTypes.js","sourceRoot":"","sources":["../../../src/models/synchronisedStorageAssetTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C;;OAEG;IACH,aAAa,EAAE,gBAAgB;IAE/B;;OAEG;IACH,oBAAoB,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;IAEvC;;OAEG;IACH,SAAS,EAAE,YAAY;IAEvB;;OAEG;IACH,gBAAgB,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;CAC3B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { ActionType } from \"@twin.org/standards-w3c-odrl\";\n\n/**\n * The ODRL asset types for SynchronisedStorage.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SynchronisedStorageAssetTypes = {\n\t/**\n\t * Decryption Key.\n\t */\n\tDecryptionKey: \"decryption-key\",\n\n\t/**\n\t * Decryption Key Actions.\n\t */\n\tDecryptionKeyActions: [ActionType.Read],\n\n\t/**\n\t * Change Set.\n\t */\n\tChangeSet: \"change-set\",\n\n\t/**\n\t * Change Set Actions.\n\t */\n\tChangeSetActions: [ActionType.Write]\n} as const;\n\n/**\n * The ODRL asset types for SynchronisedStorage.\n */\nexport type SynchronisedStorageAssetTypes =\n\t(typeof SynchronisedStorageAssetTypes)[keyof typeof SynchronisedStorageAssetTypes];\n"]}
@@ -1,25 +0,0 @@
1
- /**
2
- * The ODRL asset types for SynchronisedStorage.
3
- */
4
- export declare const SynchronisedStorageAssetTypes: {
5
- /**
6
- * Decryption Key.
7
- */
8
- readonly DecryptionKey: "decryption-key";
9
- /**
10
- * Decryption Key Actions.
11
- */
12
- readonly DecryptionKeyActions: readonly ["read"];
13
- /**
14
- * Change Set.
15
- */
16
- readonly ChangeSet: "change-set";
17
- /**
18
- * Change Set Actions.
19
- */
20
- readonly ChangeSetActions: readonly ["write"];
21
- };
22
- /**
23
- * The ODRL asset types for SynchronisedStorage.
24
- */
25
- export type SynchronisedStorageAssetTypes = (typeof SynchronisedStorageAssetTypes)[keyof typeof SynchronisedStorageAssetTypes];
@@ -1,5 +0,0 @@
1
- # Type Alias: SynchronisedStorageAssetTypes
2
-
3
- > **SynchronisedStorageAssetTypes** = *typeof* [`SynchronisedStorageAssetTypes`](../variables/SynchronisedStorageAssetTypes.md)\[keyof *typeof* [`SynchronisedStorageAssetTypes`](../variables/SynchronisedStorageAssetTypes.md)\]
4
-
5
- The ODRL asset types for SynchronisedStorage.
@@ -1,31 +0,0 @@
1
- # Variable: SynchronisedStorageAssetTypes
2
-
3
- > `const` **SynchronisedStorageAssetTypes**: `object`
4
-
5
- The ODRL asset types for SynchronisedStorage.
6
-
7
- ## Type Declaration
8
-
9
- ### DecryptionKey
10
-
11
- > `readonly` **DecryptionKey**: `"decryption-key"` = `"decryption-key"`
12
-
13
- Decryption Key.
14
-
15
- ### DecryptionKeyActions
16
-
17
- > `readonly` **DecryptionKeyActions**: readonly \[`"read"`\]
18
-
19
- Decryption Key Actions.
20
-
21
- ### ChangeSet
22
-
23
- > `readonly` **ChangeSet**: `"change-set"` = `"change-set"`
24
-
25
- Change Set.
26
-
27
- ### ChangeSetActions
28
-
29
- > `readonly` **ChangeSetActions**: readonly \[`"write"`\]
30
-
31
- Change Set Actions.