@twin.org/entity-storage-service 0.0.3-next.1 → 0.0.3-next.10

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.
@@ -34,7 +34,7 @@ The dependencies for the entity storage service.
34
34
 
35
35
  ## Properties
36
36
 
37
- ### CLASS\_NAME
37
+ ### CLASS\_NAME {#class_name}
38
38
 
39
39
  > `readonly` `static` **CLASS\_NAME**: `string`
40
40
 
@@ -42,7 +42,7 @@ Runtime name for the class.
42
42
 
43
43
  ## Methods
44
44
 
45
- ### className()
45
+ ### className() {#classname}
46
46
 
47
47
  > **className**(): `string`
48
48
 
@@ -60,7 +60,7 @@ The class name of the component.
60
60
 
61
61
  ***
62
62
 
63
- ### set()
63
+ ### set() {#set}
64
64
 
65
65
  > **set**(`entity`): `Promise`\<`void`\>
66
66
 
@@ -86,7 +86,33 @@ The id of the entity.
86
86
 
87
87
  ***
88
88
 
89
- ### get()
89
+ ### setBatch() {#setbatch}
90
+
91
+ > **setBatch**(`entities`): `Promise`\<`void`\>
92
+
93
+ Set multiple entities in a batch.
94
+
95
+ #### Parameters
96
+
97
+ ##### entities
98
+
99
+ `T`[]
100
+
101
+ The entities to set.
102
+
103
+ #### Returns
104
+
105
+ `Promise`\<`void`\>
106
+
107
+ Nothing.
108
+
109
+ #### Implementation of
110
+
111
+ `IEntityStorageComponent.setBatch`
112
+
113
+ ***
114
+
115
+ ### get() {#get}
90
116
 
91
117
  > **get**(`id`, `secondaryIndex?`): `Promise`\<`T` \| `undefined`\>
92
118
 
@@ -118,7 +144,7 @@ The object if it can be found or undefined.
118
144
 
119
145
  ***
120
146
 
121
- ### remove()
147
+ ### remove() {#remove}
122
148
 
123
149
  > **remove**(`id`): `Promise`\<`void`\>
124
150
 
@@ -144,7 +170,69 @@ Nothing.
144
170
 
145
171
  ***
146
172
 
147
- ### query()
173
+ ### removeBatch() {#removebatch}
174
+
175
+ > **removeBatch**(`ids`): `Promise`\<`void`\>
176
+
177
+ Remove multiple entities by id.
178
+
179
+ #### Parameters
180
+
181
+ ##### ids
182
+
183
+ `string`[]
184
+
185
+ The ids of the entities to remove.
186
+
187
+ #### Returns
188
+
189
+ `Promise`\<`void`\>
190
+
191
+ Nothing.
192
+
193
+ #### Implementation of
194
+
195
+ `IEntityStorageComponent.removeBatch`
196
+
197
+ ***
198
+
199
+ ### empty() {#empty}
200
+
201
+ > **empty**(): `Promise`\<`void`\>
202
+
203
+ Remove all entities from the storage.
204
+
205
+ #### Returns
206
+
207
+ `Promise`\<`void`\>
208
+
209
+ Nothing.
210
+
211
+ #### Implementation of
212
+
213
+ `IEntityStorageComponent.empty`
214
+
215
+ ***
216
+
217
+ ### count() {#count}
218
+
219
+ > **count**(): `Promise`\<`number`\>
220
+
221
+ Count all the entities which match the conditions.
222
+
223
+ #### Returns
224
+
225
+ `Promise`\<`number`\>
226
+
227
+ The total count of entities in the storage.
228
+
229
+ #### Implementation of
230
+
231
+ `IEntityStorageComponent.count`
232
+
233
+ ***
234
+
235
+ ### query() {#query}
148
236
 
149
237
  > **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
150
238
 
@@ -0,0 +1,31 @@
1
+ # Function: entityStorageCount()
2
+
3
+ > **entityStorageCount**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IEntityStorageCountResponse`\>
4
+
5
+ Count the entries in entity storage.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IEntityStorageCountRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IEntityStorageCountResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: entityStorageEmpty()
2
+
3
+ > **entityStorageEmpty**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Remove all entries from entity storage.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IEntityStorageEmptyRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: entityStorageRemoveBatch()
2
+
3
+ > **entityStorageRemoveBatch**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Remove multiple entries from entity storage by id.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IEntityStorageRemoveBatchRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: entityStorageSetBatch()
2
+
3
+ > **entityStorageSetBatch**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Set multiple entries in entity storage.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IEntityStorageSetBatchRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -19,6 +19,10 @@
19
19
 
20
20
  - [generateRestRoutesEntityStorage](functions/generateRestRoutesEntityStorage.md)
21
21
  - [entityStorageSet](functions/entityStorageSet.md)
22
+ - [entityStorageSetBatch](functions/entityStorageSetBatch.md)
23
+ - [entityStorageEmpty](functions/entityStorageEmpty.md)
22
24
  - [entityStorageGet](functions/entityStorageGet.md)
23
25
  - [entityStorageRemove](functions/entityStorageRemove.md)
24
26
  - [entityStorageList](functions/entityStorageList.md)
27
+ - [entityStorageCount](functions/entityStorageCount.md)
28
+ - [entityStorageRemoveBatch](functions/entityStorageRemoveBatch.md)
@@ -4,9 +4,9 @@ Examples for the entity storage routes.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### set?
7
+ ### set? {#set}
8
8
 
9
- > `optional` **set**: `object`
9
+ > `optional` **set?**: `object`
10
10
 
11
11
  Examples for the set route.
12
12
 
@@ -16,9 +16,9 @@ Examples for the set route.
16
16
 
17
17
  ***
18
18
 
19
- ### get?
19
+ ### get? {#get}
20
20
 
21
- > `optional` **get**: `object`
21
+ > `optional` **get?**: `object`
22
22
 
23
23
  Examples for the get route.
24
24
 
@@ -32,9 +32,9 @@ Examples for the get route.
32
32
 
33
33
  ***
34
34
 
35
- ### remove?
35
+ ### remove? {#remove}
36
36
 
37
- > `optional` **remove**: `object`
37
+ > `optional` **remove?**: `object`
38
38
 
39
39
  Examples for the remove route.
40
40
 
@@ -44,9 +44,9 @@ Examples for the remove route.
44
44
 
45
45
  ***
46
46
 
47
- ### list?
47
+ ### list? {#list}
48
48
 
49
- > `optional` **list**: `object`
49
+ > `optional` **list?**: `object`
50
50
 
51
51
  Examples for the list route.
52
52
 
@@ -57,3 +57,19 @@ Examples for the list route.
57
57
  #### responseExamples
58
58
 
59
59
  > **responseExamples**: `IRestRouteResponseExample`\<`IEntityStorageListResponse`\>[]
60
+
61
+ ***
62
+
63
+ ### count? {#count}
64
+
65
+ > `optional` **count?**: `object`
66
+
67
+ Examples for the count route.
68
+
69
+ #### requestExamples
70
+
71
+ > **requestExamples**: `IRestRouteRequestExample`\<`IEntityStorageCountRequest`\>[]
72
+
73
+ #### responseExamples
74
+
75
+ > **responseExamples**: `IRestRouteResponseExample`\<`IEntityStorageCountResponse`\>[]
@@ -4,7 +4,7 @@ Options for the Entity Storage Service constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### entityStorageType
7
+ ### entityStorageType {#entitystoragetype}
8
8
 
9
9
  > **entityStorageType**: `string`
10
10
 
@@ -12,8 +12,8 @@ The type of the entity storage.
12
12
 
13
13
  ***
14
14
 
15
- ### config?
15
+ ### config? {#config}
16
16
 
17
- > `optional` **config**: [`IEntityStorageServiceConfig`](IEntityStorageServiceConfig.md)
17
+ > `optional` **config?**: [`IEntityStorageServiceConfig`](IEntityStorageServiceConfig.md)
18
18
 
19
19
  The configuration for the service.
package/locales/en.json CHANGED
@@ -1,7 +1 @@
1
- {
2
- "error": {
3
- "entityStorageService": {
4
- "entityNotFound": "Could not find entity with id \"{notFoundId}\""
5
- }
6
- }
7
- }
1
+ {}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-service",
3
- "version": "0.0.3-next.1",
4
- "description": "Entity Storage contract implementation and REST endpoint definitions",
3
+ "version": "0.0.3-next.10",
4
+ "description": "Service layer exposing storage contracts and REST endpoint definitions.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/entity-storage.git",
7
+ "url": "git+https://github.com/iotaledger/entity-storage.git",
8
8
  "directory": "packages/entity-storage-service"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -17,7 +17,7 @@
17
17
  "@twin.org/api-models": "next",
18
18
  "@twin.org/core": "next",
19
19
  "@twin.org/entity": "next",
20
- "@twin.org/entity-storage-models": "0.0.3-next.1",
20
+ "@twin.org/entity-storage-models": "0.0.3-next.10",
21
21
  "@twin.org/nameof": "next",
22
22
  "@twin.org/web": "next"
23
23
  },
@@ -53,7 +53,7 @@
53
53
  "business-logic"
54
54
  ],
55
55
  "bugs": {
56
- "url": "git+https://github.com/twinfoundation/entity-storage/issues"
56
+ "url": "git+https://github.com/iotaledger/entity-storage/issues"
57
57
  },
58
58
  "homepage": "https://twindev.org"
59
59
  }