@twin.org/engine 0.0.1-next.36 → 0.0.1-next.38

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.
@@ -183,6 +183,66 @@ function configureEntityStorageConnectors(coreConfig, envVars) {
183
183
  }
184
184
  });
185
185
  }
186
+ if (core.Is.stringValue(envVars.mySqlHost)) {
187
+ coreConfig.types.entityStorageConnector.push({
188
+ type: engineTypes.EntityStorageConnectorType.MySqlDb,
189
+ options: {
190
+ config: {
191
+ host: envVars.mySqlHost,
192
+ port: envVars.mySqlPort ?? 3306,
193
+ user: envVars.mySqlUser ?? "",
194
+ password: envVars.mySqlPassword ?? "",
195
+ database: envVars.mySqlDatabase ?? ""
196
+ },
197
+ tablePrefix: envVars.entityStorageTablePrefix
198
+ }
199
+ });
200
+ }
201
+ if (core.Is.stringValue(envVars.mySqlHost)) {
202
+ coreConfig.types.entityStorageConnector.push({
203
+ type: engineTypes.EntityStorageConnectorType.MySqlDb,
204
+ options: {
205
+ config: {
206
+ host: envVars.mySqlHost,
207
+ port: envVars.mySqlPort ?? 3306,
208
+ user: envVars.mySqlUser ?? "",
209
+ password: envVars.mySqlPassword ?? "",
210
+ database: envVars.mySqlDatabase ?? ""
211
+ },
212
+ tablePrefix: envVars.entityStorageTablePrefix
213
+ }
214
+ });
215
+ }
216
+ if (core.Is.stringValue(envVars.mongoDbHost)) {
217
+ coreConfig.types.entityStorageConnector.push({
218
+ type: engineTypes.EntityStorageConnectorType.MongoDb,
219
+ options: {
220
+ config: {
221
+ host: envVars.mongoDbHost,
222
+ port: envVars.mongoDbPort,
223
+ user: envVars.mongoDbUser ?? "",
224
+ password: envVars.mongoDbPassword ?? "",
225
+ database: envVars.mongoDbDatabase ?? ""
226
+ },
227
+ tablePrefix: envVars.entityStorageTablePrefix
228
+ }
229
+ });
230
+ }
231
+ if (core.Is.stringValue(envVars.postgreSqlHost)) {
232
+ coreConfig.types.entityStorageConnector.push({
233
+ type: engineTypes.EntityStorageConnectorType.PostgreSql,
234
+ options: {
235
+ config: {
236
+ host: envVars.postgreSqlHost,
237
+ port: envVars.postgreSqlPort,
238
+ user: envVars.postgreSqlUser ?? "",
239
+ password: envVars.postgreSqlPassword ?? "",
240
+ database: envVars.postgreSqlDatabase ?? ""
241
+ },
242
+ tablePrefix: envVars.entityStorageTablePrefix
243
+ }
244
+ });
245
+ }
186
246
  const defaultStorageConnector = envVars.entityStorageConnectorType;
187
247
  if (core.Is.stringValue(defaultStorageConnector)) {
188
248
  for (const config of coreConfig.types.entityStorageConnector) {
@@ -181,6 +181,66 @@ function configureEntityStorageConnectors(coreConfig, envVars) {
181
181
  }
182
182
  });
183
183
  }
184
+ if (Is.stringValue(envVars.mySqlHost)) {
185
+ coreConfig.types.entityStorageConnector.push({
186
+ type: EntityStorageConnectorType.MySqlDb,
187
+ options: {
188
+ config: {
189
+ host: envVars.mySqlHost,
190
+ port: envVars.mySqlPort ?? 3306,
191
+ user: envVars.mySqlUser ?? "",
192
+ password: envVars.mySqlPassword ?? "",
193
+ database: envVars.mySqlDatabase ?? ""
194
+ },
195
+ tablePrefix: envVars.entityStorageTablePrefix
196
+ }
197
+ });
198
+ }
199
+ if (Is.stringValue(envVars.mySqlHost)) {
200
+ coreConfig.types.entityStorageConnector.push({
201
+ type: EntityStorageConnectorType.MySqlDb,
202
+ options: {
203
+ config: {
204
+ host: envVars.mySqlHost,
205
+ port: envVars.mySqlPort ?? 3306,
206
+ user: envVars.mySqlUser ?? "",
207
+ password: envVars.mySqlPassword ?? "",
208
+ database: envVars.mySqlDatabase ?? ""
209
+ },
210
+ tablePrefix: envVars.entityStorageTablePrefix
211
+ }
212
+ });
213
+ }
214
+ if (Is.stringValue(envVars.mongoDbHost)) {
215
+ coreConfig.types.entityStorageConnector.push({
216
+ type: EntityStorageConnectorType.MongoDb,
217
+ options: {
218
+ config: {
219
+ host: envVars.mongoDbHost,
220
+ port: envVars.mongoDbPort,
221
+ user: envVars.mongoDbUser ?? "",
222
+ password: envVars.mongoDbPassword ?? "",
223
+ database: envVars.mongoDbDatabase ?? ""
224
+ },
225
+ tablePrefix: envVars.entityStorageTablePrefix
226
+ }
227
+ });
228
+ }
229
+ if (Is.stringValue(envVars.postgreSqlHost)) {
230
+ coreConfig.types.entityStorageConnector.push({
231
+ type: EntityStorageConnectorType.PostgreSql,
232
+ options: {
233
+ config: {
234
+ host: envVars.postgreSqlHost,
235
+ port: envVars.postgreSqlPort,
236
+ user: envVars.postgreSqlUser ?? "",
237
+ password: envVars.postgreSqlPassword ?? "",
238
+ database: envVars.postgreSqlDatabase ?? ""
239
+ },
240
+ tablePrefix: envVars.entityStorageTablePrefix
241
+ }
242
+ });
243
+ }
184
244
  const defaultStorageConnector = envVars.entityStorageConnectorType;
185
245
  if (Is.stringValue(defaultStorageConnector)) {
186
246
  for (const config of coreConfig.types.entityStorageConnector) {
@@ -15,7 +15,7 @@ export interface IEngineEnvironmentVariables {
15
15
  */
16
16
  stateFilename?: string;
17
17
  /**
18
- * The type of the default entity storage: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb.
18
+ * The type of the default entity storage: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql.
19
19
  */
20
20
  entityStorageConnectorType?: string;
21
21
  /**
@@ -94,6 +94,66 @@ export interface IEngineEnvironmentVariables {
94
94
  * ScyllaDB local data center.
95
95
  */
96
96
  scylladbLocalDataCenter?: string;
97
+ /**
98
+ * MySQL host.
99
+ */
100
+ mySqlHost?: string;
101
+ /**
102
+ * MySQL port.
103
+ */
104
+ mySqlPort?: number;
105
+ /**
106
+ * MySQL username.
107
+ */
108
+ mySqlUser?: string;
109
+ /**
110
+ * MySQL password.
111
+ */
112
+ mySqlPassword?: string;
113
+ /**
114
+ * MySQL Database.
115
+ */
116
+ mySqlDatabase?: string;
117
+ /**
118
+ * MongoDB host.
119
+ */
120
+ mongoDbHost?: string;
121
+ /**
122
+ * MongoDB port.
123
+ */
124
+ mongoDbPort?: number;
125
+ /**
126
+ * MongoDB username.
127
+ */
128
+ mongoDbUser?: string;
129
+ /**
130
+ * MongoDB password.
131
+ */
132
+ mongoDbPassword?: string;
133
+ /**
134
+ * MongoDB Database.
135
+ */
136
+ mongoDbDatabase?: string;
137
+ /**
138
+ * PostgreSQl host.
139
+ */
140
+ postgreSqlHost?: string;
141
+ /**
142
+ * PostgreSQl port.
143
+ */
144
+ postgreSqlPort?: number;
145
+ /**
146
+ * PostgreSQl username.
147
+ */
148
+ postgreSqlUser?: string;
149
+ /**
150
+ * PostgreSQl password.
151
+ */
152
+ postgreSqlPassword?: string;
153
+ /**
154
+ * PostgreSQl Database.
155
+ */
156
+ postgreSqlDatabase?: string;
97
157
  /**
98
158
  * The security token for accessing IPFS API.
99
159
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/engine - Changelog
2
2
 
3
- ## v0.0.1-next.36
3
+ ## v0.0.1-next.37
4
4
 
5
5
  - Initial Release
@@ -32,7 +32,7 @@ The name of the state file.
32
32
 
33
33
  > `optional` **entityStorageConnectorType**: `string`
34
34
 
35
- The type of the default entity storage: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb.
35
+ The type of the default entity storage: file, memory, aws-dynamodb, azure-cosmosdb, gcp-firestoredb, scylladb, mysql, mongodb, postgresql.
36
36
 
37
37
  ***
38
38
 
@@ -188,6 +188,126 @@ ScyllaDB local data center.
188
188
 
189
189
  ***
190
190
 
191
+ ### mySqlHost?
192
+
193
+ > `optional` **mySqlHost**: `string`
194
+
195
+ MySQL host.
196
+
197
+ ***
198
+
199
+ ### mySqlPort?
200
+
201
+ > `optional` **mySqlPort**: `number`
202
+
203
+ MySQL port.
204
+
205
+ ***
206
+
207
+ ### mySqlUser?
208
+
209
+ > `optional` **mySqlUser**: `string`
210
+
211
+ MySQL username.
212
+
213
+ ***
214
+
215
+ ### mySqlPassword?
216
+
217
+ > `optional` **mySqlPassword**: `string`
218
+
219
+ MySQL password.
220
+
221
+ ***
222
+
223
+ ### mySqlDatabase?
224
+
225
+ > `optional` **mySqlDatabase**: `string`
226
+
227
+ MySQL Database.
228
+
229
+ ***
230
+
231
+ ### mongoDbHost?
232
+
233
+ > `optional` **mongoDbHost**: `string`
234
+
235
+ MongoDB host.
236
+
237
+ ***
238
+
239
+ ### mongoDbPort?
240
+
241
+ > `optional` **mongoDbPort**: `number`
242
+
243
+ MongoDB port.
244
+
245
+ ***
246
+
247
+ ### mongoDbUser?
248
+
249
+ > `optional` **mongoDbUser**: `string`
250
+
251
+ MongoDB username.
252
+
253
+ ***
254
+
255
+ ### mongoDbPassword?
256
+
257
+ > `optional` **mongoDbPassword**: `string`
258
+
259
+ MongoDB password.
260
+
261
+ ***
262
+
263
+ ### mongoDbDatabase?
264
+
265
+ > `optional` **mongoDbDatabase**: `string`
266
+
267
+ MongoDB Database.
268
+
269
+ ***
270
+
271
+ ### postgreSqlHost?
272
+
273
+ > `optional` **postgreSqlHost**: `string`
274
+
275
+ PostgreSQl host.
276
+
277
+ ***
278
+
279
+ ### postgreSqlPort?
280
+
281
+ > `optional` **postgreSqlPort**: `number`
282
+
283
+ PostgreSQl port.
284
+
285
+ ***
286
+
287
+ ### postgreSqlUser?
288
+
289
+ > `optional` **postgreSqlUser**: `string`
290
+
291
+ PostgreSQl username.
292
+
293
+ ***
294
+
295
+ ### postgreSqlPassword?
296
+
297
+ > `optional` **postgreSqlPassword**: `string`
298
+
299
+ PostgreSQl password.
300
+
301
+ ***
302
+
303
+ ### postgreSqlDatabase?
304
+
305
+ > `optional` **postgreSqlDatabase**: `string`
306
+
307
+ PostgreSQl Database.
308
+
309
+ ***
310
+
191
311
  ### ipfsBearerToken?
192
312
 
193
313
  > `optional` **ipfsBearerToken**: `string`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine",
3
- "version": "0.0.1-next.36",
3
+ "version": "0.0.1-next.38",
4
4
  "description": "Engine implementation.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
- "@twin.org/engine-core": "0.0.1-next.36",
19
- "@twin.org/engine-types": "0.0.1-next.36"
18
+ "@twin.org/engine-core": "0.0.1-next.38",
19
+ "@twin.org/engine-types": "0.0.1-next.38"
20
20
  },
21
21
  "main": "./dist/cjs/index.cjs",
22
22
  "module": "./dist/esm/index.mjs",