@twin.org/entity-storage-rest-client 0.0.1-next.14 → 0.0.1-next.16

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/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/entity-storage-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.14
3
+ ## v0.0.1-next.16
4
4
 
5
5
  - Initial Release
@@ -24,7 +24,9 @@ Create a new instance of EntityStorageClient.
24
24
 
25
25
  #### Parameters
26
26
 
27
- **config**: `IBaseRestClientConfig`
27
+ ##### config
28
+
29
+ `IBaseRestClientConfig`
28
30
 
29
31
  The configuration for the client.
30
32
 
@@ -58,7 +60,9 @@ Set an entity.
58
60
 
59
61
  #### Parameters
60
62
 
61
- **entity**: `T`
63
+ ##### entity
64
+
65
+ `T`
62
66
 
63
67
  The entity to set.
64
68
 
@@ -82,11 +86,15 @@ Get an entity.
82
86
 
83
87
  #### Parameters
84
88
 
85
- **id**: `string`
89
+ ##### id
90
+
91
+ `string`
86
92
 
87
93
  The id of the entity to get, or the index value if secondaryIndex is set.
88
94
 
89
- **secondaryIndex?**: keyof `T`
95
+ ##### secondaryIndex?
96
+
97
+ keyof `T`
90
98
 
91
99
  Get the item using a secondary index.
92
100
 
@@ -110,7 +118,9 @@ Remove the entity.
110
118
 
111
119
  #### Parameters
112
120
 
113
- **id**: `string`
121
+ ##### id
122
+
123
+ `string`
114
124
 
115
125
  The id of the entity to remove.
116
126
 
@@ -128,55 +138,55 @@ Nothing.
128
138
 
129
139
  ### query()
130
140
 
131
- > **query**(`conditions`?, `orderBy`?, `orderByDirection`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
141
+ > **query**(`conditions`?, `orderBy`?, `orderByDirection`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
132
142
 
133
143
  Query all the entities which match the conditions.
134
144
 
135
145
  #### Parameters
136
146
 
137
- **conditions?**: `EntityCondition`\<`T`\>
147
+ ##### conditions?
148
+
149
+ `EntityCondition`\<`T`\>
138
150
 
139
151
  The conditions to match for the entities.
140
152
 
141
- **orderBy?**: keyof `T`
153
+ ##### orderBy?
154
+
155
+ keyof `T`
142
156
 
143
157
  The order for the results.
144
158
 
145
- **orderByDirection?**: `SortDirection`
159
+ ##### orderByDirection?
160
+
161
+ `SortDirection`
146
162
 
147
163
  The direction for the order, defaults to ascending.
148
164
 
149
- **properties?**: keyof `T`[]
165
+ ##### properties?
166
+
167
+ keyof `T`[]
150
168
 
151
169
  The optional properties to return, defaults to all.
152
170
 
153
- **cursor?**: `string`
171
+ ##### cursor?
172
+
173
+ `string`
154
174
 
155
175
  The cursor to request the next page of entities.
156
176
 
157
- **pageSize?**: `number`
177
+ ##### pageSize?
178
+
179
+ `number`
158
180
 
159
181
  The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
160
182
 
161
183
  #### Returns
162
184
 
163
- `Promise`\<`object`\>
185
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
164
186
 
165
187
  All the entities for the storage matching the conditions,
166
188
  and a cursor which can be used to request more entities.
167
189
 
168
- ##### entities
169
-
170
- > **entities**: `Partial`\<`T`\>[]
171
-
172
- The entities, which can be partial if a limited keys list was provided.
173
-
174
- ##### cursor?
175
-
176
- > `optional` **cursor**: `string`
177
-
178
- An optional cursor, when defined can be used to call find to get more entities.
179
-
180
190
  #### Implementation of
181
191
 
182
192
  `IEntityStorageComponent.query`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-rest-client",
3
- "version": "0.0.1-next.14",
3
+ "version": "0.0.1-next.16",
4
4
  "description": "Entity Storage contract implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "@twin.org/api-models": "next",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/entity": "next",
21
- "@twin.org/entity-storage-models": "0.0.1-next.14",
21
+ "@twin.org/entity-storage-models": "0.0.1-next.16",
22
22
  "@twin.org/nameof": "next",
23
23
  "@twin.org/web": "next"
24
24
  },
@@ -27,9 +27,9 @@
27
27
  "types": "./dist/types/index.d.ts",
28
28
  "exports": {
29
29
  ".": {
30
+ "types": "./dist/types/index.d.ts",
30
31
  "require": "./dist/cjs/index.cjs",
31
- "import": "./dist/esm/index.mjs",
32
- "types": "./dist/types/index.d.ts"
32
+ "import": "./dist/esm/index.mjs"
33
33
  },
34
34
  "./locales/*.json": "./locales/*.json"
35
35
  },