@twin.org/entity-storage-models 0.0.1-next.3 → 0.0.1-next.30

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.
@@ -1,2 +1,9 @@
1
1
  export * from "./factories/entityStorageConnectorFactory";
2
+ export * from "./models/api/IEntityStorageGetRequest";
3
+ export * from "./models/api/IEntityStorageGetResponse";
4
+ export * from "./models/api/IEntityStorageListRequest";
5
+ export * from "./models/api/IEntityStorageListResponse";
6
+ export * from "./models/api/IEntityStorageRemoveRequest";
7
+ export * from "./models/api/IEntityStorageSetRequest";
8
+ export * from "./models/IEntityStorageComponent";
2
9
  export * from "./models/IEntityStorageConnector";
@@ -0,0 +1,55 @@
1
+ import type { IComponent } from "@twin.org/core";
2
+ import type { EntityCondition, SortDirection } from "@twin.org/entity";
3
+ /**
4
+ * Interface describing an entity storage component.
5
+ */
6
+ export interface IEntityStorageComponent<T = unknown> extends IComponent {
7
+ /**
8
+ * Set an entity.
9
+ * @param entity The entity to set.
10
+ * @param userIdentity The user identity to use with storage operations.
11
+ * @param nodeIdentity The node identity to use with storage operations.
12
+ * @returns The id of the entity.
13
+ */
14
+ set(entity: T, userIdentity?: string, nodeIdentity?: string): Promise<void>;
15
+ /**
16
+ * Get an entity.
17
+ * @param id The id of the entity to get, or the index value if secondaryIndex is set.
18
+ * @param secondaryIndex Get the item using a secondary index.
19
+ * @param userIdentity The user identity to use with storage operations.
20
+ * @param nodeIdentity The node identity to use with storage operations.
21
+ * @returns The object if it can be found or undefined.
22
+ */
23
+ get(id: string, secondaryIndex?: keyof T, userIdentity?: string, nodeIdentity?: string): Promise<T | undefined>;
24
+ /**
25
+ * Remove the entity.
26
+ * @param id The id of the entity to remove.
27
+ * @param userIdentity The user identity to use with storage operations.
28
+ * @param nodeIdentity The node identity to use with storage operations.
29
+ * @returns Nothing.
30
+ */
31
+ remove(id: string, userIdentity?: string, nodeIdentity?: string): Promise<void>;
32
+ /**
33
+ * Query all the entities which match the conditions.
34
+ * @param conditions The conditions to match for the entities.
35
+ * @param orderBy The order for the results.
36
+ * @param orderByDirection The direction for the order, defaults to ascending.
37
+ * @param properties The optional properties to return, defaults to all.
38
+ * @param cursor The cursor to request the next page of entities.
39
+ * @param pageSize The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
40
+ * @param userIdentity The user identity to use with storage operations.
41
+ * @param nodeIdentity The node identity to use with storage operations.
42
+ * @returns All the entities for the storage matching the conditions,
43
+ * and a cursor which can be used to request more entities.
44
+ */
45
+ query(conditions?: EntityCondition<T>, orderBy?: keyof T, orderByDirection?: SortDirection, properties?: (keyof T)[], cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<{
46
+ /**
47
+ * The entities, which can be partial if a limited keys list was provided.
48
+ */
49
+ entities: Partial<T>[];
50
+ /**
51
+ * An optional cursor, when defined can be used to call find to get more entities.
52
+ */
53
+ cursor?: string;
54
+ }>;
55
+ }
@@ -1,28 +1,45 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
- import type { EntityCondition, SortDirection } from "@twin.org/entity";
2
+ import type { EntityCondition, IEntitySchema, SortDirection } from "@twin.org/entity";
3
3
  /**
4
4
  * Interface describing an entity storage connector.
5
5
  */
6
6
  export interface IEntityStorageConnector<T = unknown> extends IComponent {
7
7
  /**
8
- * Get an entity.
9
- * @param id The id of the entity to get, or the index value if secondaryIndex is set.
10
- * @param secondaryIndex Get the item using a secondary index.
11
- * @returns The object if it can be found or undefined.
8
+ * Get the schema for the entities.
9
+ * @returns The schema for the entities.
12
10
  */
13
- get(id: string, secondaryIndex?: keyof T): Promise<T | undefined>;
11
+ getSchema(): IEntitySchema;
14
12
  /**
15
13
  * Set an entity.
16
14
  * @param entity The entity to set.
15
+ * @param conditions The optional conditions to match for the entities.
17
16
  * @returns The id of the entity.
18
17
  */
19
- set(entity: T): Promise<void>;
18
+ set(entity: T, conditions?: {
19
+ property: keyof T;
20
+ value: unknown;
21
+ }[]): Promise<void>;
22
+ /**
23
+ * Get an entity.
24
+ * @param id The id of the entity to get, or the index value if secondaryIndex is set.
25
+ * @param secondaryIndex Get the item using a secondary index.
26
+ * @param conditions The optional conditions to match for the entities.
27
+ * @returns The object if it can be found or undefined.
28
+ */
29
+ get(id: string, secondaryIndex?: keyof T, conditions?: {
30
+ property: keyof T;
31
+ value: unknown;
32
+ }[]): Promise<T | undefined>;
20
33
  /**
21
34
  * Remove the entity.
22
35
  * @param id The id of the entity to remove.
36
+ * @param conditions The optional conditions to match for the entities.
23
37
  * @returns Nothing.
24
38
  */
25
- remove(id: string): Promise<void>;
39
+ remove(id: string, conditions?: {
40
+ property: keyof T;
41
+ value: unknown;
42
+ }[]): Promise<void>;
26
43
  /**
27
44
  * Query all the entities which match the conditions.
28
45
  * @param conditions The conditions to match for the entities.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Get an entry from entity storage.
3
+ */
4
+ export interface IEntityStorageGetRequest {
5
+ /**
6
+ * The parameters from the path.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the entity to get.
11
+ */
12
+ id: string;
13
+ };
14
+ /**
15
+ * The query parameters.
16
+ */
17
+ query?: {
18
+ /**
19
+ * The secondary index to query with the id.
20
+ */
21
+ secondaryIndex?: string;
22
+ };
23
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Get an entry from entity storage.
3
+ */
4
+ export interface IEntityStorageGetResponse {
5
+ /**
6
+ * The data for the requested entity.
7
+ */
8
+ body: unknown;
9
+ }
@@ -0,0 +1,35 @@
1
+ import type { SortDirection } from "@twin.org/entity";
2
+ /**
3
+ * Query the entries from entity storage.
4
+ */
5
+ export interface IEntityStorageListRequest {
6
+ /**
7
+ * The parameters from the query.
8
+ */
9
+ query?: {
10
+ /**
11
+ * The condition for the query as JSON version of EntityCondition type.
12
+ */
13
+ conditions?: string;
14
+ /**
15
+ * The order property for the results.
16
+ */
17
+ orderBy?: string;
18
+ /**
19
+ * The direction for the order, defaults to desc.
20
+ */
21
+ orderByDirection?: SortDirection;
22
+ /**
23
+ * The properties to return in the response as a comma separated list, by default returns all properties.
24
+ */
25
+ properties?: string;
26
+ /**
27
+ * The number of entries to return per page.
28
+ */
29
+ pageSize?: number;
30
+ /**
31
+ * The cursor to get next chunk of data, returned in previous response.
32
+ */
33
+ cursor?: string;
34
+ };
35
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Response to getting the list of entries from a query.
3
+ */
4
+ export interface IEntityStorageListResponse {
5
+ /**
6
+ * The list of entries from the query.
7
+ */
8
+ body: {
9
+ /**
10
+ * The entities from the query.
11
+ */
12
+ entities: unknown[];
13
+ /**
14
+ * The cursor for the next page.
15
+ */
16
+ cursor?: string;
17
+ };
18
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Remove an entry from entity storage.
3
+ */
4
+ export interface IEntityStorageRemoveRequest {
5
+ /**
6
+ * The parameters from the path.
7
+ */
8
+ pathParams: {
9
+ /**
10
+ * The id of the entity to remove.
11
+ */
12
+ id: string;
13
+ };
14
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Set an entry in entity storage.
3
+ */
4
+ export interface IEntityStorageSetRequest {
5
+ /**
6
+ * The data to be used in the entity.
7
+ */
8
+ body: unknown;
9
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @twin.org/entity-storage-models - Changelog
2
2
 
3
- ## v0.0.1-next.3
3
+ ## [0.0.1-next.30](https://github.com/twinfoundation/entity-storage/compare/entity-storage-models-v0.0.1-next.29...entity-storage-models-v0.0.1-next.30) (2025-06-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * update dependencies ([7ccc0c4](https://github.com/twinfoundation/entity-storage/commit/7ccc0c429125d073dc60b3de6cf101abc8cc6cba))
9
+
10
+ ## [0.0.1-next.29](https://github.com/twinfoundation/entity-storage/compare/entity-storage-models-v0.0.1-next.28...entity-storage-models-v0.0.1-next.29) (2025-04-17)
11
+
12
+
13
+ ### Features
14
+
15
+ * use shared store mechanism ([#34](https://github.com/twinfoundation/entity-storage/issues/34)) ([68b6b71](https://github.com/twinfoundation/entity-storage/commit/68b6b71e7a96d7d016cd57bfff36775b56bf3f93))
16
+
17
+ ## [0.0.1-next.28](https://github.com/twinfoundation/entity-storage/compare/entity-storage-models-v0.0.1-next.27...entity-storage-models-v0.0.1-next.28) (2025-04-09)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **entity-storage-models:** Synchronize repo versions
23
+
24
+ ## [0.0.1-next.27](https://github.com/twinfoundation/entity-storage/compare/entity-storage-models-v0.0.1-next.26...entity-storage-models-v0.0.1-next.27) (2025-03-28)
25
+
26
+
27
+ ### Miscellaneous Chores
28
+
29
+ * **entity-storage-models:** Synchronize repo versions
30
+
31
+ ## v0.0.1-next.26
4
32
 
5
33
  - Initial Release
@@ -2,7 +2,14 @@
2
2
 
3
3
  ## Interfaces
4
4
 
5
+ - [IEntityStorageComponent](interfaces/IEntityStorageComponent.md)
5
6
  - [IEntityStorageConnector](interfaces/IEntityStorageConnector.md)
7
+ - [IEntityStorageGetRequest](interfaces/IEntityStorageGetRequest.md)
8
+ - [IEntityStorageGetResponse](interfaces/IEntityStorageGetResponse.md)
9
+ - [IEntityStorageListRequest](interfaces/IEntityStorageListRequest.md)
10
+ - [IEntityStorageListResponse](interfaces/IEntityStorageListResponse.md)
11
+ - [IEntityStorageRemoveRequest](interfaces/IEntityStorageRemoveRequest.md)
12
+ - [IEntityStorageSetRequest](interfaces/IEntityStorageSetRequest.md)
6
13
 
7
14
  ## Variables
8
15
 
@@ -0,0 +1,186 @@
1
+ # Interface: IEntityStorageComponent\<T\>
2
+
3
+ Interface describing an entity storage component.
4
+
5
+ ## Extends
6
+
7
+ - `IComponent`
8
+
9
+ ## Type Parameters
10
+
11
+ ### T
12
+
13
+ `T` = `unknown`
14
+
15
+ ## Methods
16
+
17
+ ### set()
18
+
19
+ > **set**(`entity`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
20
+
21
+ Set an entity.
22
+
23
+ #### Parameters
24
+
25
+ ##### entity
26
+
27
+ `T`
28
+
29
+ The entity to set.
30
+
31
+ ##### userIdentity?
32
+
33
+ `string`
34
+
35
+ The user identity to use with storage operations.
36
+
37
+ ##### nodeIdentity?
38
+
39
+ `string`
40
+
41
+ The node identity to use with storage operations.
42
+
43
+ #### Returns
44
+
45
+ `Promise`\<`void`\>
46
+
47
+ The id of the entity.
48
+
49
+ ***
50
+
51
+ ### get()
52
+
53
+ > **get**(`id`, `secondaryIndex?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`undefined` \| `T`\>
54
+
55
+ Get an entity.
56
+
57
+ #### Parameters
58
+
59
+ ##### id
60
+
61
+ `string`
62
+
63
+ The id of the entity to get, or the index value if secondaryIndex is set.
64
+
65
+ ##### secondaryIndex?
66
+
67
+ keyof `T`
68
+
69
+ Get the item using a secondary index.
70
+
71
+ ##### userIdentity?
72
+
73
+ `string`
74
+
75
+ The user identity to use with storage operations.
76
+
77
+ ##### nodeIdentity?
78
+
79
+ `string`
80
+
81
+ The node identity to use with storage operations.
82
+
83
+ #### Returns
84
+
85
+ `Promise`\<`undefined` \| `T`\>
86
+
87
+ The object if it can be found or undefined.
88
+
89
+ ***
90
+
91
+ ### remove()
92
+
93
+ > **remove**(`id`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
94
+
95
+ Remove the entity.
96
+
97
+ #### Parameters
98
+
99
+ ##### id
100
+
101
+ `string`
102
+
103
+ The id of the entity to remove.
104
+
105
+ ##### userIdentity?
106
+
107
+ `string`
108
+
109
+ The user identity to use with storage operations.
110
+
111
+ ##### nodeIdentity?
112
+
113
+ `string`
114
+
115
+ The node identity to use with storage operations.
116
+
117
+ #### Returns
118
+
119
+ `Promise`\<`void`\>
120
+
121
+ Nothing.
122
+
123
+ ***
124
+
125
+ ### query()
126
+
127
+ > **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `pageSize?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
128
+
129
+ Query all the entities which match the conditions.
130
+
131
+ #### Parameters
132
+
133
+ ##### conditions?
134
+
135
+ `EntityCondition`\<`T`\>
136
+
137
+ The conditions to match for the entities.
138
+
139
+ ##### orderBy?
140
+
141
+ keyof `T`
142
+
143
+ The order for the results.
144
+
145
+ ##### orderByDirection?
146
+
147
+ `SortDirection`
148
+
149
+ The direction for the order, defaults to ascending.
150
+
151
+ ##### properties?
152
+
153
+ keyof `T`[]
154
+
155
+ The optional properties to return, defaults to all.
156
+
157
+ ##### cursor?
158
+
159
+ `string`
160
+
161
+ The cursor to request the next page of entities.
162
+
163
+ ##### pageSize?
164
+
165
+ `number`
166
+
167
+ The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
168
+
169
+ ##### userIdentity?
170
+
171
+ `string`
172
+
173
+ The user identity to use with storage operations.
174
+
175
+ ##### nodeIdentity?
176
+
177
+ `string`
178
+
179
+ The node identity to use with storage operations.
180
+
181
+ #### Returns
182
+
183
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
184
+
185
+ All the entities for the storage matching the conditions,
186
+ and a cursor which can be used to request more entities.
@@ -8,66 +8,108 @@ Interface describing an entity storage connector.
8
8
 
9
9
  ## Type Parameters
10
10
 
11
- **T** = `unknown`
11
+ ### T
12
+
13
+ `T` = `unknown`
12
14
 
13
15
  ## Methods
14
16
 
15
- ### get()
17
+ ### getSchema()
16
18
 
17
- > **get**(`id`, `secondaryIndex`?): `Promise`\<`undefined` \| `T`\>
19
+ > **getSchema**(): `IEntitySchema`
18
20
 
19
- Get an entity.
21
+ Get the schema for the entities.
22
+
23
+ #### Returns
24
+
25
+ `IEntitySchema`
26
+
27
+ The schema for the entities.
28
+
29
+ ***
30
+
31
+ ### set()
32
+
33
+ > **set**(`entity`, `conditions?`): `Promise`\<`void`\>
34
+
35
+ Set an entity.
20
36
 
21
37
  #### Parameters
22
38
 
23
- **id**: `string`
39
+ ##### entity
24
40
 
25
- The id of the entity to get, or the index value if secondaryIndex is set.
41
+ `T`
26
42
 
27
- **secondaryIndex?**: keyof `T`
43
+ The entity to set.
28
44
 
29
- Get the item using a secondary index.
45
+ ##### conditions?
46
+
47
+ `object`[]
48
+
49
+ The optional conditions to match for the entities.
30
50
 
31
51
  #### Returns
32
52
 
33
- `Promise`\<`undefined` \| `T`\>
53
+ `Promise`\<`void`\>
34
54
 
35
- The object if it can be found or undefined.
55
+ The id of the entity.
36
56
 
37
57
  ***
38
58
 
39
- ### set()
59
+ ### get()
40
60
 
41
- > **set**(`entity`): `Promise`\<`void`\>
61
+ > **get**(`id`, `secondaryIndex?`, `conditions?`): `Promise`\<`undefined` \| `T`\>
42
62
 
43
- Set an entity.
63
+ Get an entity.
44
64
 
45
65
  #### Parameters
46
66
 
47
- **entity**: `T`
67
+ ##### id
48
68
 
49
- The entity to set.
69
+ `string`
70
+
71
+ The id of the entity to get, or the index value if secondaryIndex is set.
72
+
73
+ ##### secondaryIndex?
74
+
75
+ keyof `T`
76
+
77
+ Get the item using a secondary index.
78
+
79
+ ##### conditions?
80
+
81
+ `object`[]
82
+
83
+ The optional conditions to match for the entities.
50
84
 
51
85
  #### Returns
52
86
 
53
- `Promise`\<`void`\>
87
+ `Promise`\<`undefined` \| `T`\>
54
88
 
55
- The id of the entity.
89
+ The object if it can be found or undefined.
56
90
 
57
91
  ***
58
92
 
59
93
  ### remove()
60
94
 
61
- > **remove**(`id`): `Promise`\<`void`\>
95
+ > **remove**(`id`, `conditions?`): `Promise`\<`void`\>
62
96
 
63
97
  Remove the entity.
64
98
 
65
99
  #### Parameters
66
100
 
67
- **id**: `string`
101
+ ##### id
102
+
103
+ `string`
68
104
 
69
105
  The id of the entity to remove.
70
106
 
107
+ ##### conditions?
108
+
109
+ `object`[]
110
+
111
+ The optional conditions to match for the entities.
112
+
71
113
  #### Returns
72
114
 
73
115
  `Promise`\<`void`\>
@@ -78,47 +120,45 @@ Nothing.
78
120
 
79
121
  ### query()
80
122
 
81
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
123
+ > **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `pageSize?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
82
124
 
83
125
  Query all the entities which match the conditions.
84
126
 
85
127
  #### Parameters
86
128
 
87
- **conditions?**: `EntityCondition`\<`T`\>
129
+ ##### conditions?
130
+
131
+ `EntityCondition`\<`T`\>
88
132
 
89
133
  The conditions to match for the entities.
90
134
 
91
- **sortProperties?**: `object`[]
135
+ ##### sortProperties?
136
+
137
+ `object`[]
92
138
 
93
139
  The optional sort order.
94
140
 
95
- **properties?**: keyof `T`[]
141
+ ##### properties?
142
+
143
+ keyof `T`[]
96
144
 
97
145
  The optional properties to return, defaults to all.
98
146
 
99
- **cursor?**: `string`
147
+ ##### cursor?
148
+
149
+ `string`
100
150
 
101
151
  The cursor to request the next page of entities.
102
152
 
103
- **pageSize?**: `number`
153
+ ##### pageSize?
154
+
155
+ `number`
104
156
 
105
157
  The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
106
158
 
107
159
  #### Returns
108
160
 
109
- `Promise`\<`object`\>
161
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
110
162
 
111
163
  All the entities for the storage matching the conditions,
112
164
  and a cursor which can be used to request more entities.
113
-
114
- ##### entities
115
-
116
- > **entities**: `Partial`\<`T`\>[]
117
-
118
- The entities, which can be partial if a limited keys list was provided.
119
-
120
- ##### cursor?
121
-
122
- > `optional` **cursor**: `string`
123
-
124
- An optional cursor, when defined can be used to call find to get more entities.
@@ -0,0 +1,31 @@
1
+ # Interface: IEntityStorageGetRequest
2
+
3
+ Get an entry from entity storage.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The parameters from the path.
12
+
13
+ #### id
14
+
15
+ > **id**: `string`
16
+
17
+ The id of the entity to get.
18
+
19
+ ***
20
+
21
+ ### query?
22
+
23
+ > `optional` **query**: `object`
24
+
25
+ The query parameters.
26
+
27
+ #### secondaryIndex?
28
+
29
+ > `optional` **secondaryIndex**: `string`
30
+
31
+ The secondary index to query with the id.
@@ -0,0 +1,11 @@
1
+ # Interface: IEntityStorageGetResponse
2
+
3
+ Get an entry from entity storage.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `unknown`
10
+
11
+ The data for the requested entity.
@@ -0,0 +1,47 @@
1
+ # Interface: IEntityStorageListRequest
2
+
3
+ Query the entries from entity storage.
4
+
5
+ ## Properties
6
+
7
+ ### query?
8
+
9
+ > `optional` **query**: `object`
10
+
11
+ The parameters from the query.
12
+
13
+ #### conditions?
14
+
15
+ > `optional` **conditions**: `string`
16
+
17
+ The condition for the query as JSON version of EntityCondition type.
18
+
19
+ #### orderBy?
20
+
21
+ > `optional` **orderBy**: `string`
22
+
23
+ The order property for the results.
24
+
25
+ #### orderByDirection?
26
+
27
+ > `optional` **orderByDirection**: `SortDirection`
28
+
29
+ The direction for the order, defaults to desc.
30
+
31
+ #### properties?
32
+
33
+ > `optional` **properties**: `string`
34
+
35
+ The properties to return in the response as a comma separated list, by default returns all properties.
36
+
37
+ #### pageSize?
38
+
39
+ > `optional` **pageSize**: `number`
40
+
41
+ The number of entries to return per page.
42
+
43
+ #### cursor?
44
+
45
+ > `optional` **cursor**: `string`
46
+
47
+ The cursor to get next chunk of data, returned in previous response.
@@ -0,0 +1,23 @@
1
+ # Interface: IEntityStorageListResponse
2
+
3
+ Response to getting the list of entries from a query.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The list of entries from the query.
12
+
13
+ #### entities
14
+
15
+ > **entities**: `unknown`[]
16
+
17
+ The entities from the query.
18
+
19
+ #### cursor?
20
+
21
+ > `optional` **cursor**: `string`
22
+
23
+ The cursor for the next page.
@@ -0,0 +1,17 @@
1
+ # Interface: IEntityStorageRemoveRequest
2
+
3
+ Remove an entry from entity storage.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The parameters from the path.
12
+
13
+ #### id
14
+
15
+ > **id**: `string`
16
+
17
+ The id of the entity to remove.
@@ -0,0 +1,11 @@
1
+ # Interface: IEntityStorageSetRequest
2
+
3
+ Set an entry in entity storage.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `unknown`
10
+
11
+ The data to be used in the entity.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-models",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.30",
4
4
  "description": "Models which define the structure of the entity storage contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,47 +13,21 @@
13
13
  "engines": {
14
14
  "node": ">=20.0.0"
15
15
  },
16
- "scripts": {
17
- "clean": "rimraf dist coverage docs/reference",
18
- "build": "tspc",
19
- "test": "vitest --run --config ./vitest.config.ts --no-cache",
20
- "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
21
- "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
22
- "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
23
- "bundle": "npm run bundle:esm && npm run bundle:cjs",
24
- "docs:clean": "rimraf docs/reference",
25
- "docs:generate": "typedoc",
26
- "docs": "npm run docs:clean && npm run docs:generate",
27
- "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
28
- },
29
16
  "dependencies": {
30
17
  "@twin.org/core": "next",
31
18
  "@twin.org/entity": "next",
32
19
  "@twin.org/nameof": "next"
33
20
  },
34
- "devDependencies": {
35
- "@twin.org/nameof-transformer": "next",
36
- "@vitest/coverage-v8": "2.1.1",
37
- "copyfiles": "2.4.1",
38
- "rimraf": "6.0.1",
39
- "rollup": "4.21.3",
40
- "rollup-plugin-typescript2": "0.36.0",
41
- "ts-patch": "3.2.1",
42
- "typedoc": "0.26.7",
43
- "typedoc-plugin-markdown": "4.2.7",
44
- "typescript": "5.6.2",
45
- "vitest": "2.1.1"
46
- },
47
21
  "main": "./dist/cjs/index.cjs",
48
22
  "module": "./dist/esm/index.mjs",
49
23
  "types": "./dist/types/index.d.ts",
50
24
  "exports": {
51
25
  ".": {
26
+ "types": "./dist/types/index.d.ts",
52
27
  "require": "./dist/cjs/index.cjs",
53
- "import": "./dist/esm/index.mjs",
54
- "types": "./dist/types/index.d.ts"
28
+ "import": "./dist/esm/index.mjs"
55
29
  },
56
- "./locales": "./locales"
30
+ "./locales/*.json": "./locales/*.json"
57
31
  },
58
32
  "files": [
59
33
  "dist/cjs",