@twin.org/entity-storage-connector-scylladb 0.0.2-next.4 → 0.0.2-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.
- package/dist/cjs/index.cjs +10 -13
- package/dist/esm/index.mjs +11 -14
- package/dist/types/abstractScyllaDBConnector.d.ts +2 -2
- package/dist/types/models/IScyllaDBTableConnectorConstructorOptions.d.ts +2 -2
- package/dist/types/models/IScyllaDBViewConnectorConstructorOptions.d.ts +2 -2
- package/dist/types/scyllaDBTableConnector.d.ts +2 -2
- package/dist/types/scyllaDBViewConnector.d.ts +2 -2
- package/docs/changelog.md +32 -0
- package/docs/reference/classes/ScyllaDBTableConnector.md +3 -3
- package/docs/reference/classes/ScyllaDBViewConnector.md +3 -3
- package/docs/reference/interfaces/IScyllaDBTableConnectorConstructorOptions.md +3 -3
- package/docs/reference/interfaces/IScyllaDBViewConnectorConstructorOptions.md +3 -3
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@twin.org/core');
|
|
4
4
|
var entity = require('@twin.org/entity');
|
|
5
|
-
var loggingModels = require('@twin.org/logging-models');
|
|
6
5
|
var cassandraDriver = require('cassandra-driver');
|
|
7
6
|
|
|
8
7
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -32,7 +31,7 @@ class AbstractScyllaDBConnector {
|
|
|
32
31
|
*/
|
|
33
32
|
_config;
|
|
34
33
|
/**
|
|
35
|
-
* The logging
|
|
34
|
+
* The logging component.
|
|
36
35
|
* @internal
|
|
37
36
|
*/
|
|
38
37
|
_logging;
|
|
@@ -49,7 +48,7 @@ class AbstractScyllaDBConnector {
|
|
|
49
48
|
/**
|
|
50
49
|
* Create a new instance of AbstractScyllaDBConnector.
|
|
51
50
|
* @param options The options for the connector.
|
|
52
|
-
* @param options.
|
|
51
|
+
* @param options.loggingComponentType The type of logging component to use, defaults to no logging.
|
|
53
52
|
* @param options.entitySchema The name of the entity schema.
|
|
54
53
|
* @param options.config The configuration for the connector.
|
|
55
54
|
* @param className The name of the derived class.
|
|
@@ -62,9 +61,7 @@ class AbstractScyllaDBConnector {
|
|
|
62
61
|
core.Guards.arrayValue(this.CLASS_NAME, "options.config.hosts", options.config.hosts);
|
|
63
62
|
core.Guards.stringValue(this.CLASS_NAME, "options.config.localDataCenter", options.config.localDataCenter);
|
|
64
63
|
core.Guards.stringValue(this.CLASS_NAME, "options.config.keyspace", options.config.keyspace);
|
|
65
|
-
|
|
66
|
-
this._logging = loggingModels.LoggingConnectorFactory.get(options.loggingConnectorType);
|
|
67
|
-
}
|
|
64
|
+
this._logging = core.ComponentFactory.getIfExists(options.loggingComponentType ?? "logging");
|
|
68
65
|
this._entitySchema = entity.EntitySchemaFactory.get(options.entitySchema);
|
|
69
66
|
this._primaryKey = entity.EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
70
67
|
this._config = options.config;
|
|
@@ -453,11 +450,11 @@ class ScyllaDBTableConnector extends AbstractScyllaDBConnector {
|
|
|
453
450
|
}
|
|
454
451
|
/**
|
|
455
452
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
456
|
-
* @param
|
|
453
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
457
454
|
* @returns True if the bootstrapping process was successful.
|
|
458
455
|
*/
|
|
459
|
-
async bootstrap(
|
|
460
|
-
const nodeLogging =
|
|
456
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
457
|
+
const nodeLogging = core.ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
461
458
|
nodeLogging?.log({
|
|
462
459
|
level: "info",
|
|
463
460
|
source: this.CLASS_NAME,
|
|
@@ -812,7 +809,7 @@ class ScyllaDBViewConnector extends AbstractScyllaDBConnector {
|
|
|
812
809
|
constructor(options) {
|
|
813
810
|
// We need this conversion so that types can match in the superclass and reuse the get method
|
|
814
811
|
super({
|
|
815
|
-
|
|
812
|
+
loggingComponentType: options.loggingComponentType,
|
|
816
813
|
entitySchema: options.viewSchema,
|
|
817
814
|
config: options.config
|
|
818
815
|
}, "ScyllaDBViewConnector");
|
|
@@ -825,11 +822,11 @@ class ScyllaDBViewConnector extends AbstractScyllaDBConnector {
|
|
|
825
822
|
}
|
|
826
823
|
/**
|
|
827
824
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
828
|
-
* @param
|
|
825
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
829
826
|
* @returns True if the bootstrapping process was successful.
|
|
830
827
|
*/
|
|
831
|
-
async bootstrap(
|
|
832
|
-
const nodeLogging =
|
|
828
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
829
|
+
const nodeLogging = core.ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
833
830
|
nodeLogging?.log({
|
|
834
831
|
level: "info",
|
|
835
832
|
source: this.CLASS_NAME,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Guards,
|
|
1
|
+
import { Guards, ComponentFactory, StringHelper, Is, GeneralError, BaseError, NotSupportedError } from '@twin.org/core';
|
|
2
2
|
import { EntitySchemaFactory, EntitySchemaHelper, ComparisonOperator, LogicalOperator, SortDirection, EntitySchemaPropertyType } from '@twin.org/entity';
|
|
3
|
-
import { LoggingConnectorFactory } from '@twin.org/logging-models';
|
|
4
3
|
import { Client, types } from 'cassandra-driver';
|
|
5
4
|
|
|
6
5
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -30,7 +29,7 @@ class AbstractScyllaDBConnector {
|
|
|
30
29
|
*/
|
|
31
30
|
_config;
|
|
32
31
|
/**
|
|
33
|
-
* The logging
|
|
32
|
+
* The logging component.
|
|
34
33
|
* @internal
|
|
35
34
|
*/
|
|
36
35
|
_logging;
|
|
@@ -47,7 +46,7 @@ class AbstractScyllaDBConnector {
|
|
|
47
46
|
/**
|
|
48
47
|
* Create a new instance of AbstractScyllaDBConnector.
|
|
49
48
|
* @param options The options for the connector.
|
|
50
|
-
* @param options.
|
|
49
|
+
* @param options.loggingComponentType The type of logging component to use, defaults to no logging.
|
|
51
50
|
* @param options.entitySchema The name of the entity schema.
|
|
52
51
|
* @param options.config The configuration for the connector.
|
|
53
52
|
* @param className The name of the derived class.
|
|
@@ -60,9 +59,7 @@ class AbstractScyllaDBConnector {
|
|
|
60
59
|
Guards.arrayValue(this.CLASS_NAME, "options.config.hosts", options.config.hosts);
|
|
61
60
|
Guards.stringValue(this.CLASS_NAME, "options.config.localDataCenter", options.config.localDataCenter);
|
|
62
61
|
Guards.stringValue(this.CLASS_NAME, "options.config.keyspace", options.config.keyspace);
|
|
63
|
-
|
|
64
|
-
this._logging = LoggingConnectorFactory.get(options.loggingConnectorType);
|
|
65
|
-
}
|
|
62
|
+
this._logging = ComponentFactory.getIfExists(options.loggingComponentType ?? "logging");
|
|
66
63
|
this._entitySchema = EntitySchemaFactory.get(options.entitySchema);
|
|
67
64
|
this._primaryKey = EntitySchemaHelper.getPrimaryKey(this._entitySchema);
|
|
68
65
|
this._config = options.config;
|
|
@@ -451,11 +448,11 @@ class ScyllaDBTableConnector extends AbstractScyllaDBConnector {
|
|
|
451
448
|
}
|
|
452
449
|
/**
|
|
453
450
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
454
|
-
* @param
|
|
451
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
455
452
|
* @returns True if the bootstrapping process was successful.
|
|
456
453
|
*/
|
|
457
|
-
async bootstrap(
|
|
458
|
-
const nodeLogging =
|
|
454
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
455
|
+
const nodeLogging = ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
459
456
|
nodeLogging?.log({
|
|
460
457
|
level: "info",
|
|
461
458
|
source: this.CLASS_NAME,
|
|
@@ -810,7 +807,7 @@ class ScyllaDBViewConnector extends AbstractScyllaDBConnector {
|
|
|
810
807
|
constructor(options) {
|
|
811
808
|
// We need this conversion so that types can match in the superclass and reuse the get method
|
|
812
809
|
super({
|
|
813
|
-
|
|
810
|
+
loggingComponentType: options.loggingComponentType,
|
|
814
811
|
entitySchema: options.viewSchema,
|
|
815
812
|
config: options.config
|
|
816
813
|
}, "ScyllaDBViewConnector");
|
|
@@ -823,11 +820,11 @@ class ScyllaDBViewConnector extends AbstractScyllaDBConnector {
|
|
|
823
820
|
}
|
|
824
821
|
/**
|
|
825
822
|
* Bootstrap the component by creating and initializing any resources it needs.
|
|
826
|
-
* @param
|
|
823
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
827
824
|
* @returns True if the bootstrapping process was successful.
|
|
828
825
|
*/
|
|
829
|
-
async bootstrap(
|
|
830
|
-
const nodeLogging =
|
|
826
|
+
async bootstrap(nodeLoggingComponentType) {
|
|
827
|
+
const nodeLogging = ComponentFactory.getIfExists(nodeLoggingComponentType ?? "logging");
|
|
831
828
|
nodeLogging?.log({
|
|
832
829
|
level: "info",
|
|
833
830
|
source: this.CLASS_NAME,
|
|
@@ -7,13 +7,13 @@ export declare abstract class AbstractScyllaDBConnector<T> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Create a new instance of AbstractScyllaDBConnector.
|
|
9
9
|
* @param options The options for the connector.
|
|
10
|
-
* @param options.
|
|
10
|
+
* @param options.loggingComponentType The type of logging component to use, defaults to no logging.
|
|
11
11
|
* @param options.entitySchema The name of the entity schema.
|
|
12
12
|
* @param options.config The configuration for the connector.
|
|
13
13
|
* @param className The name of the derived class.
|
|
14
14
|
*/
|
|
15
15
|
constructor(options: {
|
|
16
|
-
|
|
16
|
+
loggingComponentType?: string;
|
|
17
17
|
entitySchema: string;
|
|
18
18
|
config: IScyllaDBTableConfig;
|
|
19
19
|
}, className: string);
|
|
@@ -4,9 +4,9 @@ import type { IScyllaDBTableConfig } from "./IScyllaDBTableConfig";
|
|
|
4
4
|
*/
|
|
5
5
|
export interface IScyllaDBTableConnectorConstructorOptions {
|
|
6
6
|
/**
|
|
7
|
-
* The type of logging
|
|
7
|
+
* The type of logging component to use, defaults to no logging.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
loggingComponentType?: string;
|
|
10
10
|
/**
|
|
11
11
|
* The name of the entity schema.
|
|
12
12
|
*/
|
|
@@ -4,9 +4,9 @@ import type { IScyllaDBViewConfig } from "./IScyllaDBViewConfig";
|
|
|
4
4
|
*/
|
|
5
5
|
export interface IScyllaDBViewConnectorConstructorOptions {
|
|
6
6
|
/**
|
|
7
|
-
* The type of logging
|
|
7
|
+
* The type of logging component to use, defaults to no logging.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
loggingComponentType?: string;
|
|
10
10
|
/**
|
|
11
11
|
* The name of the entity schema.
|
|
12
12
|
*/
|
|
@@ -16,10 +16,10 @@ export declare class ScyllaDBTableConnector<T = unknown> extends AbstractScyllaD
|
|
|
16
16
|
constructor(options: IScyllaDBTableConnectorConstructorOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Bootstrap the component 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
|
* Set an entity.
|
|
25
25
|
* @param entity The entity to set.
|
|
@@ -16,10 +16,10 @@ export declare class ScyllaDBViewConnector<T> extends AbstractScyllaDBConnector<
|
|
|
16
16
|
constructor(options: IScyllaDBViewConnectorConstructorOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Bootstrap the component 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
|
* Set an entity.
|
|
25
25
|
* @param entity The entity to set.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @twin.org/entity-storage-connector-scylladb - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-scylladb-v0.0.2-next.5...entity-storage-connector-scylladb-v0.0.2-next.6) (2025-08-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update framework core ([b59a380](https://github.com/twinfoundation/entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
|
|
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.5 to 0.0.2-next.6
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
18
|
+
|
|
19
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-scylladb-v0.0.2-next.4...entity-storage-connector-scylladb-v0.0.2-next.5) (2025-08-11)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
* **entity-storage-connector-scylladb:** 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.4 to 0.0.2-next.5
|
|
32
|
+
* devDependencies
|
|
33
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
34
|
+
|
|
3
35
|
## [0.0.2-next.4](https://github.com/twinfoundation/entity-storage/compare/entity-storage-connector-scylladb-v0.0.2-next.3...entity-storage-connector-scylladb-v0.0.2-next.4) (2025-08-08)
|
|
4
36
|
|
|
5
37
|
|
|
@@ -179,17 +179,17 @@ and a cursor which can be used to request more entities.
|
|
|
179
179
|
|
|
180
180
|
### bootstrap()
|
|
181
181
|
|
|
182
|
-
> **bootstrap**(`
|
|
182
|
+
> **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
|
|
183
183
|
|
|
184
184
|
Bootstrap the component by creating and initializing any resources it needs.
|
|
185
185
|
|
|
186
186
|
#### Parameters
|
|
187
187
|
|
|
188
|
-
#####
|
|
188
|
+
##### nodeLoggingComponentType?
|
|
189
189
|
|
|
190
190
|
`string`
|
|
191
191
|
|
|
192
|
-
The node logging
|
|
192
|
+
The node logging component type.
|
|
193
193
|
|
|
194
194
|
#### Returns
|
|
195
195
|
|
|
@@ -179,17 +179,17 @@ and a cursor which can be used to request more entities.
|
|
|
179
179
|
|
|
180
180
|
### bootstrap()
|
|
181
181
|
|
|
182
|
-
> **bootstrap**(`
|
|
182
|
+
> **bootstrap**(`nodeLoggingComponentType?`): `Promise`\<`boolean`\>
|
|
183
183
|
|
|
184
184
|
Bootstrap the component by creating and initializing any resources it needs.
|
|
185
185
|
|
|
186
186
|
#### Parameters
|
|
187
187
|
|
|
188
|
-
#####
|
|
188
|
+
##### nodeLoggingComponentType?
|
|
189
189
|
|
|
190
190
|
`string`
|
|
191
191
|
|
|
192
|
-
The node logging
|
|
192
|
+
The node logging component type.
|
|
193
193
|
|
|
194
194
|
#### Returns
|
|
195
195
|
|
|
@@ -4,11 +4,11 @@ Options for the ScyllaDB Table Connector constructor.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### loggingComponentType?
|
|
8
8
|
|
|
9
|
-
> `optional` **
|
|
9
|
+
> `optional` **loggingComponentType**: `string`
|
|
10
10
|
|
|
11
|
-
The type of logging
|
|
11
|
+
The type of logging component to use, defaults to no logging.
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
|
@@ -4,11 +4,11 @@ Options for the ScyllaDB View Connector constructor.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### loggingComponentType?
|
|
8
8
|
|
|
9
|
-
> `optional` **
|
|
9
|
+
> `optional` **loggingComponentType**: `string`
|
|
10
10
|
|
|
11
|
-
The type of logging
|
|
11
|
+
The type of logging component to use, defaults to no logging.
|
|
12
12
|
|
|
13
13
|
***
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-scylladb",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.6",
|
|
4
4
|
"description": "Entity Storage connector implementation using ScyllaDB",
|
|
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.6",
|
|
20
20
|
"@twin.org/logging-models": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"cassandra-driver": "4.8.0"
|