@twin.org/entity-storage-models 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-models - Changelog
2
2
 
3
- ## v0.0.1-next.14
3
+ ## v0.0.1-next.16
4
4
 
5
5
  - Initial Release
@@ -20,15 +20,21 @@ Set an entity.
20
20
 
21
21
  #### Parameters
22
22
 
23
- **entity**: `T`
23
+ ##### entity
24
+
25
+ `T`
24
26
 
25
27
  The entity to set.
26
28
 
27
- **userIdentity?**: `string`
29
+ ##### userIdentity?
30
+
31
+ `string`
28
32
 
29
33
  The user identity to use with storage operations.
30
34
 
31
- **nodeIdentity?**: `string`
35
+ ##### nodeIdentity?
36
+
37
+ `string`
32
38
 
33
39
  The node identity to use with storage operations.
34
40
 
@@ -48,19 +54,27 @@ Get an entity.
48
54
 
49
55
  #### Parameters
50
56
 
51
- **id**: `string`
57
+ ##### id
58
+
59
+ `string`
52
60
 
53
61
  The id of the entity to get, or the index value if secondaryIndex is set.
54
62
 
55
- **secondaryIndex?**: keyof `T`
63
+ ##### secondaryIndex?
64
+
65
+ keyof `T`
56
66
 
57
67
  Get the item using a secondary index.
58
68
 
59
- **userIdentity?**: `string`
69
+ ##### userIdentity?
70
+
71
+ `string`
60
72
 
61
73
  The user identity to use with storage operations.
62
74
 
63
- **nodeIdentity?**: `string`
75
+ ##### nodeIdentity?
76
+
77
+ `string`
64
78
 
65
79
  The node identity to use with storage operations.
66
80
 
@@ -80,15 +94,21 @@ Remove the entity.
80
94
 
81
95
  #### Parameters
82
96
 
83
- **id**: `string`
97
+ ##### id
98
+
99
+ `string`
84
100
 
85
101
  The id of the entity to remove.
86
102
 
87
- **userIdentity?**: `string`
103
+ ##### userIdentity?
104
+
105
+ `string`
88
106
 
89
107
  The user identity to use with storage operations.
90
108
 
91
- **nodeIdentity?**: `string`
109
+ ##### nodeIdentity?
110
+
111
+ `string`
92
112
 
93
113
  The node identity to use with storage operations.
94
114
 
@@ -102,59 +122,63 @@ Nothing.
102
122
 
103
123
  ### query()
104
124
 
105
- > **query**(`conditions`?, `orderBy`?, `orderByDirection`?, `properties`?, `cursor`?, `pageSize`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`object`\>
125
+ > **query**(`conditions`?, `orderBy`?, `orderByDirection`?, `properties`?, `cursor`?, `pageSize`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
106
126
 
107
127
  Query all the entities which match the conditions.
108
128
 
109
129
  #### Parameters
110
130
 
111
- **conditions?**: `EntityCondition`\<`T`\>
131
+ ##### conditions?
132
+
133
+ `EntityCondition`\<`T`\>
112
134
 
113
135
  The conditions to match for the entities.
114
136
 
115
- **orderBy?**: keyof `T`
137
+ ##### orderBy?
138
+
139
+ keyof `T`
116
140
 
117
141
  The order for the results.
118
142
 
119
- **orderByDirection?**: `SortDirection`
143
+ ##### orderByDirection?
144
+
145
+ `SortDirection`
120
146
 
121
147
  The direction for the order, defaults to ascending.
122
148
 
123
- **properties?**: keyof `T`[]
149
+ ##### properties?
150
+
151
+ keyof `T`[]
124
152
 
125
153
  The optional properties to return, defaults to all.
126
154
 
127
- **cursor?**: `string`
155
+ ##### cursor?
156
+
157
+ `string`
128
158
 
129
159
  The cursor to request the next page of entities.
130
160
 
131
- **pageSize?**: `number`
161
+ ##### pageSize?
162
+
163
+ `number`
132
164
 
133
165
  The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
134
166
 
135
- **userIdentity?**: `string`
167
+ ##### userIdentity?
168
+
169
+ `string`
136
170
 
137
171
  The user identity to use with storage operations.
138
172
 
139
- **nodeIdentity?**: `string`
173
+ ##### nodeIdentity?
174
+
175
+ `string`
140
176
 
141
177
  The node identity to use with storage operations.
142
178
 
143
179
  #### Returns
144
180
 
145
- `Promise`\<`object`\>
181
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
146
182
 
147
183
  All the entities for the storage matching the conditions,
148
184
  and a cursor which can be used to request more entities.
149
-
150
- ##### entities
151
-
152
- > **entities**: `Partial`\<`T`\>[]
153
-
154
- The entities, which can be partial if a limited keys list was provided.
155
-
156
- ##### cursor?
157
-
158
- > `optional` **cursor**: `string`
159
-
160
- An optional cursor, when defined can be used to call find to get more entities.
@@ -14,13 +14,13 @@ Interface describing an entity storage connector.
14
14
 
15
15
  ### getSchema()
16
16
 
17
- > **getSchema**(): `IEntitySchema`\<`unknown`\>
17
+ > **getSchema**(): `IEntitySchema`
18
18
 
19
19
  Get the schema for the entities.
20
20
 
21
21
  #### Returns
22
22
 
23
- `IEntitySchema`\<`unknown`\>
23
+ `IEntitySchema`
24
24
 
25
25
  The schema for the entities.
26
26
 
@@ -34,11 +34,15 @@ Set an entity.
34
34
 
35
35
  #### Parameters
36
36
 
37
- **entity**: `T`
37
+ ##### entity
38
+
39
+ `T`
38
40
 
39
41
  The entity to set.
40
42
 
41
- **conditions?**: `object`[]
43
+ ##### conditions?
44
+
45
+ `object`[]
42
46
 
43
47
  The optional conditions to match for the entities.
44
48
 
@@ -58,15 +62,21 @@ Get an entity.
58
62
 
59
63
  #### Parameters
60
64
 
61
- **id**: `string`
65
+ ##### id
66
+
67
+ `string`
62
68
 
63
69
  The id of the entity to get, or the index value if secondaryIndex is set.
64
70
 
65
- **secondaryIndex?**: keyof `T`
71
+ ##### secondaryIndex?
72
+
73
+ keyof `T`
66
74
 
67
75
  Get the item using a secondary index.
68
76
 
69
- **conditions?**: `object`[]
77
+ ##### conditions?
78
+
79
+ `object`[]
70
80
 
71
81
  The optional conditions to match for the entities.
72
82
 
@@ -86,11 +96,15 @@ Remove the entity.
86
96
 
87
97
  #### Parameters
88
98
 
89
- **id**: `string`
99
+ ##### id
100
+
101
+ `string`
90
102
 
91
103
  The id of the entity to remove.
92
104
 
93
- **conditions?**: `object`[]
105
+ ##### conditions?
106
+
107
+ `object`[]
94
108
 
95
109
  The optional conditions to match for the entities.
96
110
 
@@ -104,47 +118,45 @@ Nothing.
104
118
 
105
119
  ### query()
106
120
 
107
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
121
+ > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
108
122
 
109
123
  Query all the entities which match the conditions.
110
124
 
111
125
  #### Parameters
112
126
 
113
- **conditions?**: `EntityCondition`\<`T`\>
127
+ ##### conditions?
128
+
129
+ `EntityCondition`\<`T`\>
114
130
 
115
131
  The conditions to match for the entities.
116
132
 
117
- **sortProperties?**: `object`[]
133
+ ##### sortProperties?
134
+
135
+ `object`[]
118
136
 
119
137
  The optional sort order.
120
138
 
121
- **properties?**: keyof `T`[]
139
+ ##### properties?
140
+
141
+ keyof `T`[]
122
142
 
123
143
  The optional properties to return, defaults to all.
124
144
 
125
- **cursor?**: `string`
145
+ ##### cursor?
146
+
147
+ `string`
126
148
 
127
149
  The cursor to request the next page of entities.
128
150
 
129
- **pageSize?**: `number`
151
+ ##### pageSize?
152
+
153
+ `number`
130
154
 
131
155
  The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
132
156
 
133
157
  #### Returns
134
158
 
135
- `Promise`\<`object`\>
159
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
136
160
 
137
161
  All the entities for the storage matching the conditions,
138
162
  and a cursor which can be used to request more entities.
139
-
140
- ##### entities
141
-
142
- > **entities**: `Partial`\<`T`\>[]
143
-
144
- The entities, which can be partial if a limited keys list was provided.
145
-
146
- ##### cursor?
147
-
148
- > `optional` **cursor**: `string`
149
-
150
- An optional cursor, when defined can be used to call find to get more entities.
@@ -1,5 +1,5 @@
1
1
  # Variable: EntityStorageConnectorFactory
2
2
 
3
- > `const` **EntityStorageConnectorFactory**: `Factory`\<[`IEntityStorageConnector`](../interfaces/IEntityStorageConnector.md)\<`unknown`\>\>
3
+ > `const` **EntityStorageConnectorFactory**: `Factory`\<[`IEntityStorageConnector`](../interfaces/IEntityStorageConnector.md)\>
4
4
 
5
5
  Factory for creating entity storage connectors.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-models",
3
- "version": "0.0.1-next.14",
3
+ "version": "0.0.1-next.16",
4
4
  "description": "Models which define the structure of the entity storage contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,9 +23,9 @@
23
23
  "types": "./dist/types/index.d.ts",
24
24
  "exports": {
25
25
  ".": {
26
+ "types": "./dist/types/index.d.ts",
26
27
  "require": "./dist/cjs/index.cjs",
27
- "import": "./dist/esm/index.mjs",
28
- "types": "./dist/types/index.d.ts"
28
+ "import": "./dist/esm/index.mjs"
29
29
  },
30
30
  "./locales/*.json": "./locales/*.json"
31
31
  },