@twin.org/entity-storage-connector-file 0.0.2-next.1 → 0.0.2-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.
package/dist/cjs/index.cjs
CHANGED
|
@@ -4,7 +4,6 @@ var promises = require('node:fs/promises');
|
|
|
4
4
|
var path = require('node:path');
|
|
5
5
|
var core = require('@twin.org/core');
|
|
6
6
|
var entity = require('@twin.org/entity');
|
|
7
|
-
var loggingModels = require('@twin.org/logging-models');
|
|
8
7
|
|
|
9
8
|
// Copyright 2024 IOTA Stiftung.
|
|
10
9
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -13,14 +12,14 @@ var loggingModels = require('@twin.org/logging-models');
|
|
|
13
12
|
*/
|
|
14
13
|
class FileEntityStorageConnector {
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
15
|
+
* Runtime name for the class.
|
|
18
16
|
*/
|
|
19
|
-
static
|
|
17
|
+
static CLASS_NAME = "FileEntityStorageConnector";
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
19
|
+
* Default limit for number of items to return.
|
|
20
|
+
* @internal
|
|
22
21
|
*/
|
|
23
|
-
|
|
22
|
+
static _DEFAULT_LIMIT = 20;
|
|
24
23
|
/**
|
|
25
24
|
* The schema for the entity.
|
|
26
25
|
* @internal
|
|
@@ -41,25 +40,25 @@ class FileEntityStorageConnector {
|
|
|
41
40
|
* @param options The options for the connector.
|
|
42
41
|
*/
|
|
43
42
|
constructor(options) {
|
|
44
|
-
core.Guards.object(
|
|
45
|
-
core.Guards.stringValue(
|
|
46
|
-
core.Guards.object(
|
|
47
|
-
core.Guards.stringValue(
|
|
43
|
+
core.Guards.object(FileEntityStorageConnector.CLASS_NAME, "options", options);
|
|
44
|
+
core.Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "options.entitySchema", options.entitySchema);
|
|
45
|
+
core.Guards.object(FileEntityStorageConnector.CLASS_NAME, "options.config", options.config);
|
|
46
|
+
core.Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "options.config.directory", options.config.directory);
|
|
48
47
|
this._entitySchema = entity.EntitySchemaFactory.get(options.entitySchema);
|
|
49
48
|
this._primaryKey = entity.EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
50
49
|
this._directory = path.resolve(options.config.directory);
|
|
51
50
|
}
|
|
52
51
|
/**
|
|
53
52
|
* Bootstrap the connector by creating and initializing any resources it needs.
|
|
54
|
-
* @param
|
|
53
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
55
54
|
* @returns True if the bootstrapping process was successful.
|
|
56
55
|
*/
|
|
57
|
-
async bootstrap(
|
|
58
|
-
const nodeLogging =
|
|
56
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
57
|
+
const nodeLogging = core.ComponentFactory.getIfExists(nodeLoggingComponentType);
|
|
59
58
|
if (!(await this.dirExists(this._directory))) {
|
|
60
59
|
await nodeLogging?.log({
|
|
61
60
|
level: "info",
|
|
62
|
-
source:
|
|
61
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
63
62
|
message: "directoryCreating",
|
|
64
63
|
data: {
|
|
65
64
|
directory: this._directory
|
|
@@ -69,7 +68,7 @@ class FileEntityStorageConnector {
|
|
|
69
68
|
await promises.mkdir(this._directory, { recursive: true });
|
|
70
69
|
await nodeLogging?.log({
|
|
71
70
|
level: "info",
|
|
72
|
-
source:
|
|
71
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
73
72
|
message: "directoryCreated",
|
|
74
73
|
data: {
|
|
75
74
|
directory: this._directory
|
|
@@ -79,7 +78,7 @@ class FileEntityStorageConnector {
|
|
|
79
78
|
catch (err) {
|
|
80
79
|
await nodeLogging?.log({
|
|
81
80
|
level: "error",
|
|
82
|
-
source:
|
|
81
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
83
82
|
message: "directoryCreateFailed",
|
|
84
83
|
data: {
|
|
85
84
|
directory: this._directory
|
|
@@ -92,7 +91,7 @@ class FileEntityStorageConnector {
|
|
|
92
91
|
else {
|
|
93
92
|
await nodeLogging?.log({
|
|
94
93
|
level: "info",
|
|
95
|
-
source:
|
|
94
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
96
95
|
message: "directoryExists",
|
|
97
96
|
data: {
|
|
98
97
|
directory: this._directory
|
|
@@ -116,7 +115,7 @@ class FileEntityStorageConnector {
|
|
|
116
115
|
* @returns The object if it can be found or undefined.
|
|
117
116
|
*/
|
|
118
117
|
async get(id, secondaryIndex, conditions) {
|
|
119
|
-
core.Guards.stringValue(
|
|
118
|
+
core.Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "id", id);
|
|
120
119
|
const store = await this.readStore();
|
|
121
120
|
const foundIndex = this.findItem(store, id, secondaryIndex, conditions);
|
|
122
121
|
return foundIndex === -1 ? undefined : store[foundIndex];
|
|
@@ -128,7 +127,7 @@ class FileEntityStorageConnector {
|
|
|
128
127
|
* @returns The id of the entity.
|
|
129
128
|
*/
|
|
130
129
|
async set(entity$1, conditions) {
|
|
131
|
-
core.Guards.object(
|
|
130
|
+
core.Guards.object(FileEntityStorageConnector.CLASS_NAME, "entity", entity$1);
|
|
132
131
|
entity.EntitySchemaHelper.validateEntity(entity$1, this.getSchema());
|
|
133
132
|
const store = await this.readStore();
|
|
134
133
|
const existingIndex = this.findItem(store, entity$1[this._primaryKey.property], undefined, conditions);
|
|
@@ -147,7 +146,7 @@ class FileEntityStorageConnector {
|
|
|
147
146
|
* @returns Nothing.
|
|
148
147
|
*/
|
|
149
148
|
async remove(id, conditions) {
|
|
150
|
-
core.Guards.stringValue(
|
|
149
|
+
core.Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "id", id);
|
|
151
150
|
const store = await this.readStore();
|
|
152
151
|
const index = this.findItem(store, id, undefined, conditions);
|
|
153
152
|
if (index >= 0) {
|
|
@@ -160,24 +159,24 @@ class FileEntityStorageConnector {
|
|
|
160
159
|
* @param conditions The conditions to match for the entities.
|
|
161
160
|
* @param sortProperties The optional sort order.
|
|
162
161
|
* @param properties The optional properties to return, defaults to all.
|
|
163
|
-
* @param cursor The cursor to request the next
|
|
164
|
-
* @param
|
|
162
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
163
|
+
* @param limit The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
|
|
165
164
|
* @returns All the entities for the storage matching the conditions,
|
|
166
165
|
* and a cursor which can be used to request more entities.
|
|
167
166
|
*/
|
|
168
|
-
async query(conditions, sortProperties, properties, cursor,
|
|
167
|
+
async query(conditions, sortProperties, properties, cursor, limit) {
|
|
169
168
|
let allEntities = await this.readStore();
|
|
170
169
|
const entities = [];
|
|
171
|
-
const
|
|
170
|
+
const finalLimit = limit ?? FileEntityStorageConnector._DEFAULT_LIMIT;
|
|
172
171
|
let nextCursor;
|
|
173
172
|
if (allEntities.length > 0) {
|
|
174
173
|
const finalSortKeys = entity.EntitySchemaHelper.buildSortProperties(this._entitySchema, sortProperties);
|
|
175
174
|
allEntities = entity.EntitySorter.sort(allEntities, finalSortKeys);
|
|
176
175
|
const startIndex = core.Coerce.number(cursor) ?? 0;
|
|
177
176
|
for (let i = startIndex; i < allEntities.length; i++) {
|
|
178
|
-
if (entity.EntityConditions.check(allEntities[i], conditions) && entities.length <
|
|
177
|
+
if (entity.EntityConditions.check(allEntities[i], conditions) && entities.length < finalLimit) {
|
|
179
178
|
entities.push(core.ObjectHelper.pick(allEntities[i], properties));
|
|
180
|
-
if (entities.length >=
|
|
179
|
+
if (entities.length >= finalLimit) {
|
|
181
180
|
if (i < allEntities.length - 1) {
|
|
182
181
|
nextCursor = (i + 1).toString();
|
|
183
182
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, writeFile, access } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { Guards, BaseError, Coerce, ObjectHelper, Is } from '@twin.org/core';
|
|
3
|
+
import { Guards, ComponentFactory, BaseError, Coerce, ObjectHelper, Is } from '@twin.org/core';
|
|
4
4
|
import { EntitySchemaFactory, EntitySchemaHelper, EntitySorter, EntityConditions, ComparisonOperator } from '@twin.org/entity';
|
|
5
|
-
import { LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
6
5
|
|
|
7
6
|
// Copyright 2024 IOTA Stiftung.
|
|
8
7
|
// SPDX-License-Identifier: Apache-2.0.
|
|
@@ -11,14 +10,14 @@ import { LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
|
11
10
|
*/
|
|
12
11
|
class FileEntityStorageConnector {
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @internal
|
|
13
|
+
* Runtime name for the class.
|
|
16
14
|
*/
|
|
17
|
-
static
|
|
15
|
+
static CLASS_NAME = "FileEntityStorageConnector";
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
17
|
+
* Default limit for number of items to return.
|
|
18
|
+
* @internal
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
static _DEFAULT_LIMIT = 20;
|
|
22
21
|
/**
|
|
23
22
|
* The schema for the entity.
|
|
24
23
|
* @internal
|
|
@@ -39,25 +38,25 @@ class FileEntityStorageConnector {
|
|
|
39
38
|
* @param options The options for the connector.
|
|
40
39
|
*/
|
|
41
40
|
constructor(options) {
|
|
42
|
-
Guards.object(
|
|
43
|
-
Guards.stringValue(
|
|
44
|
-
Guards.object(
|
|
45
|
-
Guards.stringValue(
|
|
41
|
+
Guards.object(FileEntityStorageConnector.CLASS_NAME, "options", options);
|
|
42
|
+
Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "options.entitySchema", options.entitySchema);
|
|
43
|
+
Guards.object(FileEntityStorageConnector.CLASS_NAME, "options.config", options.config);
|
|
44
|
+
Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "options.config.directory", options.config.directory);
|
|
46
45
|
this._entitySchema = EntitySchemaFactory.get(options.entitySchema);
|
|
47
46
|
this._primaryKey = EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
48
47
|
this._directory = path.resolve(options.config.directory);
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
51
50
|
* Bootstrap the connector by creating and initializing any resources it needs.
|
|
52
|
-
* @param
|
|
51
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
53
52
|
* @returns True if the bootstrapping process was successful.
|
|
54
53
|
*/
|
|
55
|
-
async bootstrap(
|
|
56
|
-
const nodeLogging =
|
|
54
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
55
|
+
const nodeLogging = ComponentFactory.getIfExists(nodeLoggingComponentType);
|
|
57
56
|
if (!(await this.dirExists(this._directory))) {
|
|
58
57
|
await nodeLogging?.log({
|
|
59
58
|
level: "info",
|
|
60
|
-
source:
|
|
59
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
61
60
|
message: "directoryCreating",
|
|
62
61
|
data: {
|
|
63
62
|
directory: this._directory
|
|
@@ -67,7 +66,7 @@ class FileEntityStorageConnector {
|
|
|
67
66
|
await mkdir(this._directory, { recursive: true });
|
|
68
67
|
await nodeLogging?.log({
|
|
69
68
|
level: "info",
|
|
70
|
-
source:
|
|
69
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
71
70
|
message: "directoryCreated",
|
|
72
71
|
data: {
|
|
73
72
|
directory: this._directory
|
|
@@ -77,7 +76,7 @@ class FileEntityStorageConnector {
|
|
|
77
76
|
catch (err) {
|
|
78
77
|
await nodeLogging?.log({
|
|
79
78
|
level: "error",
|
|
80
|
-
source:
|
|
79
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
81
80
|
message: "directoryCreateFailed",
|
|
82
81
|
data: {
|
|
83
82
|
directory: this._directory
|
|
@@ -90,7 +89,7 @@ class FileEntityStorageConnector {
|
|
|
90
89
|
else {
|
|
91
90
|
await nodeLogging?.log({
|
|
92
91
|
level: "info",
|
|
93
|
-
source:
|
|
92
|
+
source: FileEntityStorageConnector.CLASS_NAME,
|
|
94
93
|
message: "directoryExists",
|
|
95
94
|
data: {
|
|
96
95
|
directory: this._directory
|
|
@@ -114,7 +113,7 @@ class FileEntityStorageConnector {
|
|
|
114
113
|
* @returns The object if it can be found or undefined.
|
|
115
114
|
*/
|
|
116
115
|
async get(id, secondaryIndex, conditions) {
|
|
117
|
-
Guards.stringValue(
|
|
116
|
+
Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "id", id);
|
|
118
117
|
const store = await this.readStore();
|
|
119
118
|
const foundIndex = this.findItem(store, id, secondaryIndex, conditions);
|
|
120
119
|
return foundIndex === -1 ? undefined : store[foundIndex];
|
|
@@ -126,7 +125,7 @@ class FileEntityStorageConnector {
|
|
|
126
125
|
* @returns The id of the entity.
|
|
127
126
|
*/
|
|
128
127
|
async set(entity, conditions) {
|
|
129
|
-
Guards.object(
|
|
128
|
+
Guards.object(FileEntityStorageConnector.CLASS_NAME, "entity", entity);
|
|
130
129
|
EntitySchemaHelper.validateEntity(entity, this.getSchema());
|
|
131
130
|
const store = await this.readStore();
|
|
132
131
|
const existingIndex = this.findItem(store, entity[this._primaryKey.property], undefined, conditions);
|
|
@@ -145,7 +144,7 @@ class FileEntityStorageConnector {
|
|
|
145
144
|
* @returns Nothing.
|
|
146
145
|
*/
|
|
147
146
|
async remove(id, conditions) {
|
|
148
|
-
Guards.stringValue(
|
|
147
|
+
Guards.stringValue(FileEntityStorageConnector.CLASS_NAME, "id", id);
|
|
149
148
|
const store = await this.readStore();
|
|
150
149
|
const index = this.findItem(store, id, undefined, conditions);
|
|
151
150
|
if (index >= 0) {
|
|
@@ -158,24 +157,24 @@ class FileEntityStorageConnector {
|
|
|
158
157
|
* @param conditions The conditions to match for the entities.
|
|
159
158
|
* @param sortProperties The optional sort order.
|
|
160
159
|
* @param properties The optional properties to return, defaults to all.
|
|
161
|
-
* @param cursor The cursor to request the next
|
|
162
|
-
* @param
|
|
160
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
161
|
+
* @param limit The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
|
|
163
162
|
* @returns All the entities for the storage matching the conditions,
|
|
164
163
|
* and a cursor which can be used to request more entities.
|
|
165
164
|
*/
|
|
166
|
-
async query(conditions, sortProperties, properties, cursor,
|
|
165
|
+
async query(conditions, sortProperties, properties, cursor, limit) {
|
|
167
166
|
let allEntities = await this.readStore();
|
|
168
167
|
const entities = [];
|
|
169
|
-
const
|
|
168
|
+
const finalLimit = limit ?? FileEntityStorageConnector._DEFAULT_LIMIT;
|
|
170
169
|
let nextCursor;
|
|
171
170
|
if (allEntities.length > 0) {
|
|
172
171
|
const finalSortKeys = EntitySchemaHelper.buildSortProperties(this._entitySchema, sortProperties);
|
|
173
172
|
allEntities = EntitySorter.sort(allEntities, finalSortKeys);
|
|
174
173
|
const startIndex = Coerce.number(cursor) ?? 0;
|
|
175
174
|
for (let i = startIndex; i < allEntities.length; i++) {
|
|
176
|
-
if (EntityConditions.check(allEntities[i], conditions) && entities.length <
|
|
175
|
+
if (EntityConditions.check(allEntities[i], conditions) && entities.length < finalLimit) {
|
|
177
176
|
entities.push(ObjectHelper.pick(allEntities[i], properties));
|
|
178
|
-
if (entities.length >=
|
|
177
|
+
if (entities.length >= finalLimit) {
|
|
179
178
|
if (i < allEntities.length - 1) {
|
|
180
179
|
nextCursor = (i + 1).toString();
|
|
181
180
|
}
|
|
@@ -8,7 +8,7 @@ export declare class FileEntityStorageConnector<T = unknown> implements IEntityS
|
|
|
8
8
|
/**
|
|
9
9
|
* Runtime name for the class.
|
|
10
10
|
*/
|
|
11
|
-
readonly CLASS_NAME: string;
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
12
|
/**
|
|
13
13
|
* Create a new instance of FileEntityStorageConnector.
|
|
14
14
|
* @param options The options for the connector.
|
|
@@ -16,10 +16,10 @@ export declare class FileEntityStorageConnector<T = unknown> implements IEntityS
|
|
|
16
16
|
constructor(options: IFileEntityStorageConnectorConstructorOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Bootstrap the connector by creating and initializing any resources it needs.
|
|
19
|
-
* @param
|
|
19
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
20
20
|
* @returns True if the bootstrapping process was successful.
|
|
21
21
|
*/
|
|
22
|
-
bootstrap(
|
|
22
|
+
bootstrap(nodeLoggingComponentType?: string): Promise<boolean>;
|
|
23
23
|
/**
|
|
24
24
|
* Get the schema for the entities.
|
|
25
25
|
* @returns The schema for the entities.
|
|
@@ -61,15 +61,15 @@ export declare class FileEntityStorageConnector<T = unknown> implements IEntityS
|
|
|
61
61
|
* @param conditions The conditions to match for the entities.
|
|
62
62
|
* @param sortProperties The optional sort order.
|
|
63
63
|
* @param properties The optional properties to return, defaults to all.
|
|
64
|
-
* @param cursor The cursor to request the next
|
|
65
|
-
* @param
|
|
64
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
65
|
+
* @param limit The suggested number of entities to return in each chunk, in some scenarios can return a different amount.
|
|
66
66
|
* @returns All the entities for the storage matching the conditions,
|
|
67
67
|
* and a cursor which can be used to request more entities.
|
|
68
68
|
*/
|
|
69
69
|
query(conditions?: EntityCondition<T>, sortProperties?: {
|
|
70
70
|
property: keyof T;
|
|
71
71
|
sortDirection: SortDirection;
|
|
72
|
-
}[], properties?: (keyof T)[], cursor?: string,
|
|
72
|
+
}[], properties?: (keyof T)[], cursor?: string, limit?: number): Promise<{
|
|
73
73
|
/**
|
|
74
74
|
* The entities, which can be partial if a limited keys list was provided.
|
|
75
75
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,149 @@
|
|
|
1
1
|
# @twin.org/entity-storage-connector-file - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.10](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.9...entity-storage-connector-file-v0.0.2-next.10) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([e66ef0d](https://github.com/twinfoundation/entity-storage/commit/e66ef0de26ca2f82b3fe89bb5c7a15a0978a9644))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
18
|
+
|
|
19
|
+
## [0.0.2-next.9](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.8...entity-storage-connector-file-v0.0.2-next.9) (2025-10-02)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
* **entity-storage-connector-file:** Synchronize repo versions
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
32
|
+
* devDependencies
|
|
33
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
34
|
+
|
|
35
|
+
## [0.0.2-next.8](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.7...entity-storage-connector-file-v0.0.2-next.8) (2025-08-29)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* eslint migration to flat config ([f033b64](https://github.com/twinfoundation/entity-storage/commit/f033b64984c0e6a8129d929c9dd816dcc1b8dab0))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Dependencies
|
|
44
|
+
|
|
45
|
+
* The following workspace dependencies were updated
|
|
46
|
+
* dependencies
|
|
47
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
48
|
+
* devDependencies
|
|
49
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
50
|
+
|
|
51
|
+
## [0.0.2-next.7](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.6...entity-storage-connector-file-v0.0.2-next.7) (2025-08-20)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* logging naming consistency ([f99d12d](https://github.com/twinfoundation/entity-storage/commit/f99d12dea04b6d4f2b5632ff5473e9ec7d5f9055))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Dependencies
|
|
60
|
+
|
|
61
|
+
* The following workspace dependencies were updated
|
|
62
|
+
* dependencies
|
|
63
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
64
|
+
* devDependencies
|
|
65
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
66
|
+
|
|
67
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.5...entity-storage-connector-file-v0.0.2-next.6) (2025-08-19)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
* update framework core ([b59a380](https://github.com/twinfoundation/entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Dependencies
|
|
76
|
+
|
|
77
|
+
* The following workspace dependencies were updated
|
|
78
|
+
* dependencies
|
|
79
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
80
|
+
* devDependencies
|
|
81
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
82
|
+
|
|
83
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.4...entity-storage-connector-file-v0.0.2-next.5) (2025-08-11)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Miscellaneous Chores
|
|
87
|
+
|
|
88
|
+
* **entity-storage-connector-file:** Synchronize repo versions
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### Dependencies
|
|
92
|
+
|
|
93
|
+
* The following workspace dependencies were updated
|
|
94
|
+
* dependencies
|
|
95
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
96
|
+
* devDependencies
|
|
97
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
98
|
+
|
|
99
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.3...entity-storage-connector-file-v0.0.2-next.4) (2025-08-08)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Miscellaneous Chores
|
|
103
|
+
|
|
104
|
+
* **entity-storage-connector-file:** Synchronize repo versions
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Dependencies
|
|
108
|
+
|
|
109
|
+
* The following workspace dependencies were updated
|
|
110
|
+
* dependencies
|
|
111
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
112
|
+
* devDependencies
|
|
113
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
114
|
+
|
|
115
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.2...entity-storage-connector-file-v0.0.2-next.3) (2025-07-25)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Miscellaneous Chores
|
|
119
|
+
|
|
120
|
+
* **entity-storage-connector-file:** Synchronize repo versions
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Dependencies
|
|
124
|
+
|
|
125
|
+
* The following workspace dependencies were updated
|
|
126
|
+
* dependencies
|
|
127
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
128
|
+
* devDependencies
|
|
129
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
130
|
+
|
|
131
|
+
## [0.0.2-next.2](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.1...entity-storage-connector-file-v0.0.2-next.2) (2025-07-24)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Miscellaneous Chores
|
|
135
|
+
|
|
136
|
+
* **entity-storage-connector-file:** Synchronize repo versions
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Dependencies
|
|
140
|
+
|
|
141
|
+
* The following workspace dependencies were updated
|
|
142
|
+
* dependencies
|
|
143
|
+
* @twin.org/entity-storage-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
144
|
+
* devDependencies
|
|
145
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
146
|
+
|
|
3
147
|
## [0.0.2-next.1](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-file-v0.0.2-next.0...entity-storage-connector-file-v0.0.2-next.1) (2025-07-17)
|
|
4
148
|
|
|
5
149
|
|
|
@@ -36,29 +36,25 @@ The options for the connector.
|
|
|
36
36
|
|
|
37
37
|
### CLASS\_NAME
|
|
38
38
|
|
|
39
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
39
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
40
40
|
|
|
41
41
|
Runtime name for the class.
|
|
42
42
|
|
|
43
|
-
#### Implementation of
|
|
44
|
-
|
|
45
|
-
`IEntityStorageConnector.CLASS_NAME`
|
|
46
|
-
|
|
47
43
|
## Methods
|
|
48
44
|
|
|
49
45
|
### bootstrap()
|
|
50
46
|
|
|
51
|
-
> **bootstrap**(`
|
|
47
|
+
> **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
|
|
52
48
|
|
|
53
49
|
Bootstrap the connector by creating and initializing any resources it needs.
|
|
54
50
|
|
|
55
51
|
#### Parameters
|
|
56
52
|
|
|
57
|
-
#####
|
|
53
|
+
##### nodeLoggingComponentType?
|
|
58
54
|
|
|
59
55
|
`string`
|
|
60
56
|
|
|
61
|
-
The node logging
|
|
57
|
+
The node logging component type.
|
|
62
58
|
|
|
63
59
|
#### Returns
|
|
64
60
|
|
|
@@ -194,7 +190,7 @@ Nothing.
|
|
|
194
190
|
|
|
195
191
|
### query()
|
|
196
192
|
|
|
197
|
-
> **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `
|
|
193
|
+
> **query**(`conditions?`, `sortProperties?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `Partial`\<`T`\>[]; `cursor?`: `string`; \}\>
|
|
198
194
|
|
|
199
195
|
Find all the entities which match the conditions.
|
|
200
196
|
|
|
@@ -222,9 +218,9 @@ The optional properties to return, defaults to all.
|
|
|
222
218
|
|
|
223
219
|
`string`
|
|
224
220
|
|
|
225
|
-
The cursor to request the next
|
|
221
|
+
The cursor to request the next chunk of entities.
|
|
226
222
|
|
|
227
|
-
#####
|
|
223
|
+
##### limit?
|
|
228
224
|
|
|
229
225
|
`number`
|
|
230
226
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-file",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.10",
|
|
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.2-next.
|
|
19
|
+
"@twin.org/entity-storage-models": "0.0.2-next.10",
|
|
20
20
|
"@twin.org/logging-models": "next",
|
|
21
21
|
"@twin.org/nameof": "next"
|
|
22
22
|
},
|
|
@@ -37,5 +37,24 @@
|
|
|
37
37
|
"dist/types",
|
|
38
38
|
"locales",
|
|
39
39
|
"docs"
|
|
40
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"entity-storage",
|
|
48
|
+
"entity",
|
|
49
|
+
"storage",
|
|
50
|
+
"persistence",
|
|
51
|
+
"database",
|
|
52
|
+
"connector",
|
|
53
|
+
"adapter",
|
|
54
|
+
"integration"
|
|
55
|
+
],
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "git+https://github.com/twinfoundation/entity-storage/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://twindev.org"
|
|
41
60
|
}
|