@twin.org/entity-storage-connector-memory 0.0.1-next.4 → 0.0.1-next.6

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.
@@ -45,6 +45,13 @@ class MemoryEntityStorageConnector {
45
45
  this._primaryKey = entity.EntitySchemaHelper.getPrimaryKey(this._entitySchema);
46
46
  this._store = [];
47
47
  }
48
+ /**
49
+ * Get the schema for the entities.
50
+ * @returns The schema for the entities.
51
+ */
52
+ getSchema() {
53
+ return this._entitySchema;
54
+ }
48
55
  /**
49
56
  * Get an entity.
50
57
  * @param id The id of the entity to get, or the index value if secondaryIndex is set.
@@ -43,6 +43,13 @@ class MemoryEntityStorageConnector {
43
43
  this._primaryKey = EntitySchemaHelper.getPrimaryKey(this._entitySchema);
44
44
  this._store = [];
45
45
  }
46
+ /**
47
+ * Get the schema for the entities.
48
+ * @returns The schema for the entities.
49
+ */
50
+ getSchema() {
51
+ return this._entitySchema;
52
+ }
46
53
  /**
47
54
  * Get an entity.
48
55
  * @param id The id of the entity to get, or the index value if secondaryIndex is set.
@@ -1,4 +1,4 @@
1
- import { type EntityCondition, type SortDirection } from "@twin.org/entity";
1
+ import { type EntityCondition, type IEntitySchema, type SortDirection } from "@twin.org/entity";
2
2
  import type { IEntityStorageConnector } from "@twin.org/entity-storage-models";
3
3
  /**
4
4
  * Class for performing entity storage operations in-memory.
@@ -16,6 +16,11 @@ export declare class MemoryEntityStorageConnector<T = unknown> implements IEntit
16
16
  constructor(options: {
17
17
  entitySchema: string;
18
18
  });
19
+ /**
20
+ * Get the schema for the entities.
21
+ * @returns The schema for the entities.
22
+ */
23
+ getSchema(): IEntitySchema;
19
24
  /**
20
25
  * Get an entity.
21
26
  * @param id The id of the entity to get, or the index value if secondaryIndex is set.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/entity-storage-connector-memory - Changelog
2
2
 
3
- ## v0.0.1-next.4
3
+ ## v0.0.1-next.6
4
4
 
5
5
  - Initial Release
@@ -46,6 +46,24 @@ Runtime name for the class.
46
46
 
47
47
  ## Methods
48
48
 
49
+ ### getSchema()
50
+
51
+ > **getSchema**(): `IEntitySchema`\<`unknown`\>
52
+
53
+ Get the schema for the entities.
54
+
55
+ #### Returns
56
+
57
+ `IEntitySchema`\<`unknown`\>
58
+
59
+ The schema for the entities.
60
+
61
+ #### Implementation of
62
+
63
+ `IEntityStorageConnector.getSchema`
64
+
65
+ ***
66
+
49
67
  ### get()
50
68
 
51
69
  > **get**(`id`, `secondaryIndex`?): `Promise`\<`undefined` \| `T`\>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-memory",
3
- "version": "0.0.1-next.4",
3
+ "version": "0.0.1-next.6",
4
4
  "description": "Entity Storage connector implementation using in-memory 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.4",
19
+ "@twin.org/entity-storage-models": "0.0.1-next.6",
20
20
  "@twin.org/nameof": "next"
21
21
  },
22
22
  "main": "./dist/cjs/index.cjs",