@twin.org/entity-storage-connector-file 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.
@@ -39,8 +39,6 @@ class FileEntityStorageConnector {
39
39
  /**
40
40
  * Create a new instance of FileEntityStorageConnector.
41
41
  * @param options The options for the connector.
42
- * @param options.entitySchema The name of the entity schema.
43
- * @param options.config The configuration for the connector.
44
42
  */
45
43
  constructor(options) {
46
44
  core.Guards.object(this.CLASS_NAME, "options", options);
@@ -37,8 +37,6 @@ class FileEntityStorageConnector {
37
37
  /**
38
38
  * Create a new instance of FileEntityStorageConnector.
39
39
  * @param options The options for the connector.
40
- * @param options.entitySchema The name of the entity schema.
41
- * @param options.config The configuration for the connector.
42
40
  */
43
41
  constructor(options) {
44
42
  Guards.object(this.CLASS_NAME, "options", options);
@@ -1,6 +1,6 @@
1
1
  import { type EntityCondition, type IEntitySchema, type SortDirection } from "@twin.org/entity";
2
2
  import type { IEntityStorageConnector } from "@twin.org/entity-storage-models";
3
- import type { IFileEntityStorageConnectorConfig } from "./models/IFileEntityStorageConnectorConfig";
3
+ import type { IFileEntityStorageConnectorConstructorOptions } from "./models/IFileEntityStorageConnectorConstructorOptions";
4
4
  /**
5
5
  * Class for performing entity storage operations in file.
6
6
  */
@@ -12,13 +12,8 @@ export declare class FileEntityStorageConnector<T = unknown> implements IEntityS
12
12
  /**
13
13
  * Create a new instance of FileEntityStorageConnector.
14
14
  * @param options The options for the connector.
15
- * @param options.entitySchema The name of the entity schema.
16
- * @param options.config The configuration for the connector.
17
15
  */
18
- constructor(options: {
19
- entitySchema: string;
20
- config: IFileEntityStorageConnectorConfig;
21
- });
16
+ constructor(options: IFileEntityStorageConnectorConstructorOptions);
22
17
  /**
23
18
  * Bootstrap the connector by creating and initializing any resources it needs.
24
19
  * @param nodeLoggingConnectorType The node logging connector type, defaults to "node-logging".
@@ -1,2 +1,3 @@
1
1
  export * from "./fileEntityStorageConnector";
2
2
  export * from "./models/IFileEntityStorageConnectorConfig";
3
+ export * from "./models/IFileEntityStorageConnectorConstructorOptions";
@@ -0,0 +1,14 @@
1
+ import type { IFileEntityStorageConnectorConfig } from "./IFileEntityStorageConnectorConfig";
2
+ /**
3
+ * Options for the File Entity Storage Connector constructor.
4
+ */
5
+ export interface IFileEntityStorageConnectorConstructorOptions {
6
+ /**
7
+ * The name of the entity schema.
8
+ */
9
+ entitySchema: string;
10
+ /**
11
+ * The configuration for the connector.
12
+ */
13
+ config: IFileEntityStorageConnectorConfig;
14
+ }
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/entity-storage-connector-file - Changelog
2
2
 
3
- ## v0.0.1-next.14
3
+ ## v0.0.1-next.16
4
4
 
5
5
  - Initial Release
@@ -20,17 +20,11 @@ Create a new instance of FileEntityStorageConnector.
20
20
 
21
21
  #### Parameters
22
22
 
23
- **options**
23
+ ##### options
24
24
 
25
- The options for the connector.
26
-
27
- • **options.entitySchema**: `string`
28
-
29
- The name of the entity schema.
30
-
31
- • **options.config**: [`IFileEntityStorageConnectorConfig`](../interfaces/IFileEntityStorageConnectorConfig.md)
25
+ [`IFileEntityStorageConnectorConstructorOptions`](../interfaces/IFileEntityStorageConnectorConstructorOptions.md)
32
26
 
33
- The configuration for the connector.
27
+ The options for the connector.
34
28
 
35
29
  #### Returns
36
30
 
@@ -58,7 +52,9 @@ Bootstrap the connector by creating and initializing any resources it needs.
58
52
 
59
53
  #### Parameters
60
54
 
61
- **nodeLoggingConnectorType?**: `string`
55
+ ##### nodeLoggingConnectorType?
56
+
57
+ `string`
62
58
 
63
59
  The node logging connector type, defaults to "node-logging".
64
60
 
@@ -76,13 +72,13 @@ True if the bootstrapping process was successful.
76
72
 
77
73
  ### getSchema()
78
74
 
79
- > **getSchema**(): `IEntitySchema`\<`unknown`\>
75
+ > **getSchema**(): `IEntitySchema`
80
76
 
81
77
  Get the schema for the entities.
82
78
 
83
79
  #### Returns
84
80
 
85
- `IEntitySchema`\<`unknown`\>
81
+ `IEntitySchema`
86
82
 
87
83
  The schema for the entities.
88
84
 
@@ -100,15 +96,21 @@ Get an entity.
100
96
 
101
97
  #### Parameters
102
98
 
103
- **id**: `string`
99
+ ##### id
100
+
101
+ `string`
104
102
 
105
103
  The id of the entity to get, or the index value if secondaryIndex is set.
106
104
 
107
- **secondaryIndex?**: keyof `T`
105
+ ##### secondaryIndex?
106
+
107
+ keyof `T`
108
108
 
109
109
  Get the item using a secondary index.
110
110
 
111
- **conditions?**: `object`[]
111
+ ##### conditions?
112
+
113
+ `object`[]
112
114
 
113
115
  The optional conditions to match for the entities.
114
116
 
@@ -132,11 +134,15 @@ Set an entity.
132
134
 
133
135
  #### Parameters
134
136
 
135
- **entity**: `T`
137
+ ##### entity
138
+
139
+ `T`
136
140
 
137
141
  The entity to set.
138
142
 
139
- **conditions?**: `object`[]
143
+ ##### conditions?
144
+
145
+ `object`[]
140
146
 
141
147
  The optional conditions to match for the entities.
142
148
 
@@ -160,11 +166,15 @@ Remove the entity.
160
166
 
161
167
  #### Parameters
162
168
 
163
- **id**: `string`
169
+ ##### id
170
+
171
+ `string`
164
172
 
165
173
  The id of the entity to remove.
166
174
 
167
- **conditions?**: `object`[]
175
+ ##### conditions?
176
+
177
+ `object`[]
168
178
 
169
179
  The optional conditions to match for the entities.
170
180
 
@@ -182,51 +192,49 @@ Nothing.
182
192
 
183
193
  ### query()
184
194
 
185
- > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
195
+ > **query**(`conditions`?, `sortProperties`?, `properties`?, `cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
186
196
 
187
197
  Find all the entities which match the conditions.
188
198
 
189
199
  #### Parameters
190
200
 
191
- **conditions?**: `EntityCondition`\<`T`\>
201
+ ##### conditions?
202
+
203
+ `EntityCondition`\<`T`\>
192
204
 
193
205
  The conditions to match for the entities.
194
206
 
195
- **sortProperties?**: `object`[]
207
+ ##### sortProperties?
208
+
209
+ `object`[]
196
210
 
197
211
  The optional sort order.
198
212
 
199
- **properties?**: keyof `T`[]
213
+ ##### properties?
214
+
215
+ keyof `T`[]
200
216
 
201
217
  The optional properties to return, defaults to all.
202
218
 
203
- **cursor?**: `string`
219
+ ##### cursor?
220
+
221
+ `string`
204
222
 
205
223
  The cursor to request the next page of entities.
206
224
 
207
- **pageSize?**: `number`
225
+ ##### pageSize?
226
+
227
+ `number`
208
228
 
209
229
  The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
210
230
 
211
231
  #### Returns
212
232
 
213
- `Promise`\<`object`\>
233
+ `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor`: `string`; \}\>
214
234
 
215
235
  All the entities for the storage matching the conditions,
216
236
  and a cursor which can be used to request more entities.
217
237
 
218
- ##### entities
219
-
220
- > **entities**: `Partial`\<`T`\>[]
221
-
222
- The entities, which can be partial if a limited keys list was provided.
223
-
224
- ##### cursor?
225
-
226
- > `optional` **cursor**: `string`
227
-
228
- An optional cursor, when defined can be used to call find to get more entities.
229
-
230
238
  #### Implementation of
231
239
 
232
240
  `IEntityStorageConnector.query`
@@ -7,3 +7,4 @@
7
7
  ## Interfaces
8
8
 
9
9
  - [IFileEntityStorageConnectorConfig](interfaces/IFileEntityStorageConnectorConfig.md)
10
+ - [IFileEntityStorageConnectorConstructorOptions](interfaces/IFileEntityStorageConnectorConstructorOptions.md)
@@ -0,0 +1,19 @@
1
+ # Interface: IFileEntityStorageConnectorConstructorOptions
2
+
3
+ Options for the File Entity Storage Connector constructor.
4
+
5
+ ## Properties
6
+
7
+ ### entitySchema
8
+
9
+ > **entitySchema**: `string`
10
+
11
+ The name of the entity schema.
12
+
13
+ ***
14
+
15
+ ### config
16
+
17
+ > **config**: [`IFileEntityStorageConnectorConfig`](IFileEntityStorageConnectorConfig.md)
18
+
19
+ The configuration for the connector.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-file",
3
- "version": "0.0.1-next.14",
3
+ "version": "0.0.1-next.16",
4
4
  "description": "Entity Storage connector implementation using file storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
18
  "@twin.org/entity": "next",
19
- "@twin.org/entity-storage-models": "0.0.1-next.14",
19
+ "@twin.org/entity-storage-models": "0.0.1-next.16",
20
20
  "@twin.org/logging-models": "next",
21
21
  "@twin.org/nameof": "next"
22
22
  },
@@ -25,9 +25,9 @@
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "exports": {
27
27
  ".": {
28
+ "types": "./dist/types/index.d.ts",
28
29
  "require": "./dist/cjs/index.cjs",
29
- "import": "./dist/esm/index.mjs",
30
- "types": "./dist/types/index.d.ts"
30
+ "import": "./dist/esm/index.mjs"
31
31
  },
32
32
  "./locales/*.json": "./locales/*.json"
33
33
  },