@twin.org/blob-storage-models 0.0.1-next.14 → 0.0.1-next.15

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.
@@ -53,7 +53,8 @@ export interface IBlobStorageComponent extends IComponent {
53
53
  /**
54
54
  * Query all the blob storage entries which match the conditions.
55
55
  * @param conditions The conditions to match for the entries.
56
- * @param sortProperties The optional sort order.
56
+ * @param orderBy The order for the results, defaults to created.
57
+ * @param orderByDirection The direction for the order, defaults to descending.
57
58
  * @param cursor The cursor to request the next page of entries.
58
59
  * @param pageSize The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
59
60
  * @param userIdentity The user identity to use with storage operations.
@@ -61,8 +62,5 @@ export interface IBlobStorageComponent extends IComponent {
61
62
  * @returns All the entries for the storage matching the conditions,
62
63
  * and a cursor which can be used to request more entities.
63
64
  */
64
- query(conditions?: EntityCondition<IBlobStorageEntry>, sortProperties?: {
65
- property: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">;
66
- sortDirection: SortDirection;
67
- }[], cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntryList>;
65
+ query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntryList>;
68
66
  }
@@ -1,4 +1,6 @@
1
+ import type { SortDirection } from "@twin.org/entity";
1
2
  import type { HeaderTypes, MimeTypes } from "@twin.org/web";
3
+ import type { IBlobStorageEntry } from "../IBlobStorageEntry";
2
4
  /**
3
5
  * Query the entries from blob storage.
4
6
  */
@@ -18,9 +20,13 @@ export interface IBlobStorageListRequest {
18
20
  */
19
21
  conditions?: string;
20
22
  /**
21
- * The sort property array as JSON serialization of property,direction.
23
+ * The order for the results, default to created.
22
24
  */
23
- sortProperties?: string;
25
+ orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">;
26
+ /**
27
+ * The direction for the order, defaults to desc.
28
+ */
29
+ orderByDirection?: SortDirection;
24
30
  /**
25
31
  * The number of entries to return per page.
26
32
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/blob-storage-models - Changelog
2
2
 
3
- ## v0.0.1-next.14
3
+ ## v0.0.1-next.15
4
4
 
5
5
  - Initial Release
@@ -166,7 +166,7 @@ Not found error if the blob cannot be found.
166
166
 
167
167
  ### query()
168
168
 
169
- > **query**(`conditions`?, `sortProperties`?, `cursor`?, `pageSize`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<[`IBlobStorageEntryList`](IBlobStorageEntryList.md)\>
169
+ > **query**(`conditions`?, `orderBy`?, `orderByDirection`?, `cursor`?, `pageSize`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<[`IBlobStorageEntryList`](IBlobStorageEntryList.md)\>
170
170
 
171
171
  Query all the blob storage entries which match the conditions.
172
172
 
@@ -176,9 +176,13 @@ Query all the blob storage entries which match the conditions.
176
176
 
177
177
  The conditions to match for the entries.
178
178
 
179
- • **sortProperties?**: `object`[]
179
+ • **orderBy?**: `"dateCreated"` \| `"dateModified"`
180
180
 
181
- The optional sort order.
181
+ The order for the results, defaults to created.
182
+
183
+ • **orderByDirection?**: `SortDirection`
184
+
185
+ The direction for the order, defaults to descending.
182
186
 
183
187
  • **cursor?**: `string`
184
188
 
@@ -28,11 +28,17 @@ The parameters from the query.
28
28
 
29
29
  The condition for the query as JSON version of EntityCondition type.
30
30
 
31
- #### sortProperties?
31
+ #### orderBy?
32
32
 
33
- > `optional` **sortProperties**: `string`
33
+ > `optional` **orderBy**: `"dateCreated"` \| `"dateModified"`
34
34
 
35
- The sort property array as JSON serialization of property,direction.
35
+ The order for the results, default to created.
36
+
37
+ #### orderByDirection?
38
+
39
+ > `optional` **orderByDirection**: `SortDirection`
40
+
41
+ The direction for the order, defaults to desc.
36
42
 
37
43
  #### pageSize?
38
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-models",
3
- "version": "0.0.1-next.14",
3
+ "version": "0.0.1-next.15",
4
4
  "description": "Models which define the structure of the blob storage contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",