@twin.org/synchronised-storage-models 0.0.1-next.4 → 0.0.1-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +26 -0
- package/dist/esm/index.mjs +26 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/ISyncChangeSet.d.ts +1 -1
- package/dist/types/models/eventBus/ISyncBatchRequest.d.ts +5 -0
- package/dist/types/models/eventBus/ISyncItemChange.d.ts +4 -0
- package/dist/types/models/eventBus/ISyncItemRemove.d.ts +4 -0
- package/dist/types/models/eventBus/ISyncReset.d.ts +14 -0
- package/dist/types/models/syncNodeIdentityMode.d.ts +21 -0
- package/dist/types/models/synchronisedStorageTopics.d.ts +4 -0
- package/docs/changelog.md +19 -0
- package/docs/reference/index.md +3 -0
- package/docs/reference/interfaces/ISyncBatchRequest.md +8 -0
- package/docs/reference/interfaces/ISyncChangeSet.md +2 -2
- package/docs/reference/interfaces/ISyncItemChange.md +8 -0
- package/docs/reference/interfaces/ISyncItemRemove.md +8 -0
- package/docs/reference/interfaces/ISyncReset.md +19 -0
- package/docs/reference/type-aliases/SyncNodeIdentityMode.md +5 -0
- package/docs/reference/variables/SyncNodeIdentityMode.md +25 -0
- package/docs/reference/variables/SynchronisedStorageTopics.md +6 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -40,6 +40,10 @@ const SynchronisedStorageTopics = {
|
|
|
40
40
|
* A response to a local item request.
|
|
41
41
|
*/
|
|
42
42
|
LocalItemResponse: "synchronised-storage:local-item-response",
|
|
43
|
+
/**
|
|
44
|
+
* Reset the storage.
|
|
45
|
+
*/
|
|
46
|
+
Reset: "synchronised-storage:reset",
|
|
43
47
|
/**
|
|
44
48
|
* A request has been made for a batch.
|
|
45
49
|
*/
|
|
@@ -58,5 +62,27 @@ const SynchronisedStorageTopics = {
|
|
|
58
62
|
RemoteItemRemove: "synchronised-storage:remote-item-remove"
|
|
59
63
|
};
|
|
60
64
|
|
|
65
|
+
// Copyright 2024 IOTA Stiftung.
|
|
66
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
67
|
+
/**
|
|
68
|
+
* The mode to determine how node identities are matched.
|
|
69
|
+
*/
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
71
|
+
const SyncNodeIdentityMode = {
|
|
72
|
+
/**
|
|
73
|
+
* Match the local node identity.
|
|
74
|
+
*/
|
|
75
|
+
Local: "local",
|
|
76
|
+
/**
|
|
77
|
+
* Match all but the local node identity.
|
|
78
|
+
*/
|
|
79
|
+
Remote: "remote",
|
|
80
|
+
/**
|
|
81
|
+
* All match both local and remote entities.
|
|
82
|
+
*/
|
|
83
|
+
All: "all"
|
|
84
|
+
};
|
|
85
|
+
|
|
61
86
|
exports.SyncChangeOperation = SyncChangeOperation;
|
|
87
|
+
exports.SyncNodeIdentityMode = SyncNodeIdentityMode;
|
|
62
88
|
exports.SynchronisedStorageTopics = SynchronisedStorageTopics;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -38,6 +38,10 @@ const SynchronisedStorageTopics = {
|
|
|
38
38
|
* A response to a local item request.
|
|
39
39
|
*/
|
|
40
40
|
LocalItemResponse: "synchronised-storage:local-item-response",
|
|
41
|
+
/**
|
|
42
|
+
* Reset the storage.
|
|
43
|
+
*/
|
|
44
|
+
Reset: "synchronised-storage:reset",
|
|
41
45
|
/**
|
|
42
46
|
* A request has been made for a batch.
|
|
43
47
|
*/
|
|
@@ -56,4 +60,25 @@ const SynchronisedStorageTopics = {
|
|
|
56
60
|
RemoteItemRemove: "synchronised-storage:remote-item-remove"
|
|
57
61
|
};
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
// Copyright 2024 IOTA Stiftung.
|
|
64
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
65
|
+
/**
|
|
66
|
+
* The mode to determine how node identities are matched.
|
|
67
|
+
*/
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
69
|
+
const SyncNodeIdentityMode = {
|
|
70
|
+
/**
|
|
71
|
+
* Match the local node identity.
|
|
72
|
+
*/
|
|
73
|
+
Local: "local",
|
|
74
|
+
/**
|
|
75
|
+
* Match all but the local node identity.
|
|
76
|
+
*/
|
|
77
|
+
Remote: "remote",
|
|
78
|
+
/**
|
|
79
|
+
* All match both local and remote entities.
|
|
80
|
+
*/
|
|
81
|
+
All: "all"
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { SyncChangeOperation, SyncNodeIdentityMode, SynchronisedStorageTopics };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,9 +9,11 @@ export * from "./models/eventBus/ISyncItemRequest";
|
|
|
9
9
|
export * from "./models/eventBus/ISyncItemResponse";
|
|
10
10
|
export * from "./models/eventBus/ISyncItemSet";
|
|
11
11
|
export * from "./models/eventBus/ISyncRegisterStorageKey";
|
|
12
|
+
export * from "./models/eventBus/ISyncReset";
|
|
12
13
|
export * from "./models/eventBus/syncChangeOperation";
|
|
13
14
|
export * from "./models/ISyncChange";
|
|
14
15
|
export * from "./models/ISyncChangeSet";
|
|
15
16
|
export * from "./models/ISynchronisedEntity";
|
|
16
17
|
export * from "./models/ISynchronisedStorageComponent";
|
|
17
18
|
export * from "./models/synchronisedStorageTopics";
|
|
19
|
+
export * from "./models/syncNodeIdentityMode";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SyncNodeIdentityMode } from "../syncNodeIdentityMode";
|
|
1
2
|
/**
|
|
2
3
|
* Request for a local batch.
|
|
3
4
|
*/
|
|
@@ -10,4 +11,8 @@ export interface ISyncBatchRequest {
|
|
|
10
11
|
* The size of the batch.
|
|
11
12
|
*/
|
|
12
13
|
batchSize: number;
|
|
14
|
+
/**
|
|
15
|
+
* Determines which entries are required, for local it will match the nodeIdentity, for remote it will not include matching nodeIdentity, for all it will include all entries.
|
|
16
|
+
*/
|
|
17
|
+
requestMode: SyncNodeIdentityMode;
|
|
13
18
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SyncNodeIdentityMode } from "../syncNodeIdentityMode";
|
|
2
|
+
/**
|
|
3
|
+
* Request to reset the local storage.
|
|
4
|
+
*/
|
|
5
|
+
export interface ISyncReset {
|
|
6
|
+
/**
|
|
7
|
+
* The key of the storage for the entities in the batch.
|
|
8
|
+
*/
|
|
9
|
+
storageKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* Reset mode, this will use the nodeIdentity in the entities to determine which are local/remote.
|
|
12
|
+
*/
|
|
13
|
+
resetMode: SyncNodeIdentityMode;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mode to determine how node identities are matched.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SyncNodeIdentityMode: {
|
|
5
|
+
/**
|
|
6
|
+
* Match the local node identity.
|
|
7
|
+
*/
|
|
8
|
+
readonly Local: "local";
|
|
9
|
+
/**
|
|
10
|
+
* Match all but the local node identity.
|
|
11
|
+
*/
|
|
12
|
+
readonly Remote: "remote";
|
|
13
|
+
/**
|
|
14
|
+
* All match both local and remote entities.
|
|
15
|
+
*/
|
|
16
|
+
readonly All: "all";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The mode to determine how node identities are matched.
|
|
20
|
+
*/
|
|
21
|
+
export type SyncNodeIdentityMode = (typeof SyncNodeIdentityMode)[keyof typeof SyncNodeIdentityMode];
|
|
@@ -18,6 +18,10 @@ export declare const SynchronisedStorageTopics: {
|
|
|
18
18
|
* A response to a local item request.
|
|
19
19
|
*/
|
|
20
20
|
readonly LocalItemResponse: "synchronised-storage:local-item-response";
|
|
21
|
+
/**
|
|
22
|
+
* Reset the storage.
|
|
23
|
+
*/
|
|
24
|
+
readonly Reset: "synchronised-storage:reset";
|
|
21
25
|
/**
|
|
22
26
|
* A request has been made for a batch.
|
|
23
27
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.6](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.1-next.5...synchronised-storage-models-v0.0.1-next.6) (2025-08-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **synchronised-storage-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.5](https://github.com/twinfoundation/synchronised-storage/compare/synchronised-storage-models-v0.0.1-next.4...synchronised-storage-models-v0.0.1-next.5) (2025-08-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* additional node identity checks ([76257c4](https://github.com/twinfoundation/synchronised-storage/commit/76257c4173303d484391f71f581fd0e214204029))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* missing dependency ([cf4427e](https://github.com/twinfoundation/synchronised-storage/commit/cf4427edf6668b90aae9a9c1faafff13dffc2fc7))
|
|
21
|
+
|
|
3
22
|
## [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
23
|
|
|
5
24
|
|
package/docs/reference/index.md
CHANGED
|
@@ -17,13 +17,16 @@
|
|
|
17
17
|
- [ISyncItemResponse](interfaces/ISyncItemResponse.md)
|
|
18
18
|
- [ISyncItemSet](interfaces/ISyncItemSet.md)
|
|
19
19
|
- [ISyncRegisterStorageKey](interfaces/ISyncRegisterStorageKey.md)
|
|
20
|
+
- [ISyncReset](interfaces/ISyncReset.md)
|
|
20
21
|
|
|
21
22
|
## Type Aliases
|
|
22
23
|
|
|
23
24
|
- [SyncChangeOperation](type-aliases/SyncChangeOperation.md)
|
|
25
|
+
- [SyncNodeIdentityMode](type-aliases/SyncNodeIdentityMode.md)
|
|
24
26
|
- [SynchronisedStorageTopics](type-aliases/SynchronisedStorageTopics.md)
|
|
25
27
|
|
|
26
28
|
## Variables
|
|
27
29
|
|
|
28
30
|
- [SyncChangeOperation](variables/SyncChangeOperation.md)
|
|
31
|
+
- [SyncNodeIdentityMode](variables/SyncNodeIdentityMode.md)
|
|
29
32
|
- [SynchronisedStorageTopics](variables/SynchronisedStorageTopics.md)
|
|
@@ -17,3 +17,11 @@ The key of the storage for the entities in the batch.
|
|
|
17
17
|
> **batchSize**: `number`
|
|
18
18
|
|
|
19
19
|
The size of the batch.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### requestMode
|
|
24
|
+
|
|
25
|
+
> **requestMode**: [`SyncNodeIdentityMode`](../type-aliases/SyncNodeIdentityMode.md)
|
|
26
|
+
|
|
27
|
+
Determines which entries are required, for local it will match the nodeIdentity, for remote it will not include matching nodeIdentity, for all it will include all entries.
|
|
@@ -34,9 +34,9 @@ The storage key of the change set. This is used to identify the entities being s
|
|
|
34
34
|
|
|
35
35
|
***
|
|
36
36
|
|
|
37
|
-
### dateModified
|
|
37
|
+
### dateModified
|
|
38
38
|
|
|
39
|
-
>
|
|
39
|
+
> **dateModified**: `string`
|
|
40
40
|
|
|
41
41
|
The date the change set was last modified.
|
|
42
42
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: ISyncReset
|
|
2
|
+
|
|
3
|
+
Request to reset the local storage.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### storageKey
|
|
8
|
+
|
|
9
|
+
> **storageKey**: `string`
|
|
10
|
+
|
|
11
|
+
The key of the storage for the entities in the batch.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### resetMode
|
|
16
|
+
|
|
17
|
+
> **resetMode**: [`SyncNodeIdentityMode`](../type-aliases/SyncNodeIdentityMode.md)
|
|
18
|
+
|
|
19
|
+
Reset mode, this will use the nodeIdentity in the entities to determine which are local/remote.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: SyncNodeIdentityMode
|
|
2
|
+
|
|
3
|
+
> **SyncNodeIdentityMode** = *typeof* [`SyncNodeIdentityMode`](../variables/SyncNodeIdentityMode.md)\[keyof *typeof* [`SyncNodeIdentityMode`](../variables/SyncNodeIdentityMode.md)\]
|
|
4
|
+
|
|
5
|
+
The mode to determine how node identities are matched.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Variable: SyncNodeIdentityMode
|
|
2
|
+
|
|
3
|
+
> `const` **SyncNodeIdentityMode**: `object`
|
|
4
|
+
|
|
5
|
+
The mode to determine how node identities are matched.
|
|
6
|
+
|
|
7
|
+
## Type declaration
|
|
8
|
+
|
|
9
|
+
### Local
|
|
10
|
+
|
|
11
|
+
> `readonly` **Local**: `"local"` = `"local"`
|
|
12
|
+
|
|
13
|
+
Match the local node identity.
|
|
14
|
+
|
|
15
|
+
### Remote
|
|
16
|
+
|
|
17
|
+
> `readonly` **Remote**: `"remote"` = `"remote"`
|
|
18
|
+
|
|
19
|
+
Match all but the local node identity.
|
|
20
|
+
|
|
21
|
+
### All
|
|
22
|
+
|
|
23
|
+
> `readonly` **All**: `"all"` = `"all"`
|
|
24
|
+
|
|
25
|
+
All match both local and remote entities.
|
|
@@ -30,6 +30,12 @@ A request has been made for a local item.
|
|
|
30
30
|
|
|
31
31
|
A response to a local item request.
|
|
32
32
|
|
|
33
|
+
### Reset
|
|
34
|
+
|
|
35
|
+
> `readonly` **Reset**: `"synchronised-storage:reset"` = `"synchronised-storage:reset"`
|
|
36
|
+
|
|
37
|
+
Reset the storage.
|
|
38
|
+
|
|
33
39
|
### BatchRequest
|
|
34
40
|
|
|
35
41
|
> `readonly` **BatchRequest**: `"synchronised-storage:batch-request"` = `"synchronised-storage:batch-request"`
|
package/package.json
CHANGED