@enervance/insight-cim-model 1.0.8 → 1.0.9

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.
Files changed (66) hide show
  1. package/dist/database/core/ConductingEquipmentDao.d.ts +7 -0
  2. package/dist/database/core/ConductingEquipmentDao.js +24 -0
  3. package/dist/database/core/ConductingEquipmentDao.js.map +1 -0
  4. package/dist/database/core/ConnectivityNodeContainerDao.d.ts +7 -0
  5. package/dist/database/core/ConnectivityNodeContainerDao.js +24 -0
  6. package/dist/database/core/ConnectivityNodeContainerDao.js.map +1 -0
  7. package/dist/database/core/EquipmentContainerDao.d.ts +7 -0
  8. package/dist/database/core/EquipmentContainerDao.js +24 -0
  9. package/dist/database/core/EquipmentContainerDao.js.map +1 -0
  10. package/dist/database/core/EquipmentDao.d.ts +8 -0
  11. package/dist/database/core/EquipmentDao.js +43 -0
  12. package/dist/database/core/EquipmentDao.js.map +1 -0
  13. package/dist/database/core/FeederDao.d.ts +6 -0
  14. package/dist/database/core/FeederDao.js +27 -0
  15. package/dist/database/core/FeederDao.js.map +1 -0
  16. package/dist/database/core/IdentifiedObjectDao.d.ts +8 -0
  17. package/dist/database/core/IdentifiedObjectDao.js +30 -0
  18. package/dist/database/core/IdentifiedObjectDao.js.map +1 -0
  19. package/dist/database/core/PowerSystemResourceDao.d.ts +7 -0
  20. package/dist/database/core/PowerSystemResourceDao.js +30 -0
  21. package/dist/database/core/PowerSystemResourceDao.js.map +1 -0
  22. package/dist/database/core/PsrTypeDao.d.ts +6 -0
  23. package/dist/database/core/PsrTypeDao.js +21 -0
  24. package/dist/database/core/PsrTypeDao.js.map +1 -0
  25. package/dist/database/core/SubGeographicalRegionDao.d.ts +6 -0
  26. package/dist/database/core/SubGeographicalRegionDao.js +21 -0
  27. package/dist/database/core/SubGeographicalRegionDao.js.map +1 -0
  28. package/dist/database/core/SubstationDao.d.ts +6 -0
  29. package/dist/database/core/SubstationDao.js +29 -0
  30. package/dist/database/core/SubstationDao.js.map +1 -0
  31. package/dist/database/core/WNFeederDao.d.ts +6 -0
  32. package/dist/database/core/WNFeederDao.js +27 -0
  33. package/dist/database/core/WNFeederDao.js.map +1 -0
  34. package/dist/database/dao-base.d.ts +7 -0
  35. package/dist/database/dao-base.js +11 -0
  36. package/dist/database/dao-base.js.map +1 -0
  37. package/dist/database/dao-dependency-resolver.d.ts +5 -0
  38. package/dist/database/dao-dependency-resolver.js +49 -0
  39. package/dist/database/dao-dependency-resolver.js.map +1 -0
  40. package/dist/database/dao-factory.d.ts +5 -0
  41. package/dist/database/dao-factory.js +41 -0
  42. package/dist/database/dao-factory.js.map +1 -0
  43. package/dist/database/dao-persistence-engine.d.ts +6 -0
  44. package/dist/database/dao-persistence-engine.js +19 -0
  45. package/dist/database/dao-persistence-engine.js.map +1 -0
  46. package/dist/database/dao-sql-types.d.ts +8 -0
  47. package/dist/database/dao-sql-types.js +3 -0
  48. package/dist/database/dao-sql-types.js.map +1 -0
  49. package/dist/database/dao-statement-planner.d.ts +7 -0
  50. package/dist/database/dao-statement-planner.js +38 -0
  51. package/dist/database/dao-statement-planner.js.map +1 -0
  52. package/dist/database/wires/ACLineSegmentDao.d.ts +6 -0
  53. package/dist/database/wires/ACLineSegmentDao.js +36 -0
  54. package/dist/database/wires/ACLineSegmentDao.js.map +1 -0
  55. package/dist/index.d.ts +17 -0
  56. package/dist/index.js +18 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/model/core/Substation.d.ts +1 -0
  59. package/dist/model/core/Substation.js +3 -0
  60. package/dist/model/core/Substation.js.map +1 -1
  61. package/dist/model/extensions/amprion/assets/AMPRIONFacility.d.ts +0 -1
  62. package/dist/model/extensions/amprion/assets/AMPRIONFacility.js +22 -13
  63. package/dist/model/extensions/amprion/assets/AMPRIONFacility.js.map +1 -1
  64. package/dist/model/extensions/westnetz-neplan/wires/WNEnergyConsumer.js +56 -49
  65. package/dist/model/extensions/westnetz-neplan/wires/WNEnergyConsumer.js.map +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ import { ConductingEquipment } from '../../model/core/ConductingEquipment.js';
2
+ import { EquipmentDao } from './EquipmentDao.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class ConductingEquipmentDao<T extends ConductingEquipment> extends EquipmentDao<T> {
5
+ protected buildConductingEquipmentInsert(): InsertStatement;
6
+ toInsertStatements(): InsertStatement[];
7
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConductingEquipmentDao = void 0;
4
+ const EquipmentDao_1 = require("./EquipmentDao.js");
5
+ class ConductingEquipmentDao extends EquipmentDao_1.EquipmentDao {
6
+ buildConductingEquipmentInsert() {
7
+ return {
8
+ sql: `
9
+ insert into cim.conducting_equipment (uuid)
10
+ values ($1)
11
+ on conflict (uuid) do nothing
12
+ `,
13
+ params: [this.cimObject.getUUID()]
14
+ };
15
+ }
16
+ toInsertStatements() {
17
+ return [
18
+ ...super.toInsertStatements(),
19
+ this.buildConductingEquipmentInsert()
20
+ ];
21
+ }
22
+ }
23
+ exports.ConductingEquipmentDao = ConductingEquipmentDao;
24
+ //# sourceMappingURL=ConductingEquipmentDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConductingEquipmentDao.js","sourceRoot":"","sources":["../../../src/database/core/ConductingEquipmentDao.ts"],"names":[],"mappings":";;;AACA,iDAA8C;AAG9C,MAAa,sBAAsD,SAAQ,2BAAe;IAC9E,8BAA8B;QACtC,OAAO;YACL,GAAG,EAAE;;;;OAIJ;YACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SACnC,CAAC;IACJ,CAAC;IAEQ,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B,IAAI,CAAC,8BAA8B,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAlBD,wDAkBC"}
@@ -0,0 +1,7 @@
1
+ import { ConnectivityNodeContainer } from '../../model/core/ConnectivityNodeContainer.js';
2
+ import { PowerSystemResourceDao } from './PowerSystemResourceDao.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class ConnectivityNodeContainerDao<T extends ConnectivityNodeContainer> extends PowerSystemResourceDao<T> {
5
+ protected buildConnectivityNodeContainerInsert(): InsertStatement;
6
+ toInsertStatements(): InsertStatement[];
7
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectivityNodeContainerDao = void 0;
4
+ const PowerSystemResourceDao_1 = require("./PowerSystemResourceDao.js");
5
+ class ConnectivityNodeContainerDao extends PowerSystemResourceDao_1.PowerSystemResourceDao {
6
+ buildConnectivityNodeContainerInsert() {
7
+ return {
8
+ sql: `
9
+ insert into cim.connectivity_node_container (uuid)
10
+ values ($1)
11
+ on conflict (uuid) do nothing
12
+ `,
13
+ params: [this.cimObject.getUUID()]
14
+ };
15
+ }
16
+ toInsertStatements() {
17
+ return [
18
+ ...super.toInsertStatements(),
19
+ this.buildConnectivityNodeContainerInsert()
20
+ ];
21
+ }
22
+ }
23
+ exports.ConnectivityNodeContainerDao = ConnectivityNodeContainerDao;
24
+ //# sourceMappingURL=ConnectivityNodeContainerDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectivityNodeContainerDao.js","sourceRoot":"","sources":["../../../src/database/core/ConnectivityNodeContainerDao.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAGlE,MAAa,4BAAkE,SAAQ,+CAAyB;IACpG,oCAAoC;QAC5C,OAAO;YACL,GAAG,EAAE;;;;OAIJ;YACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SACnC,CAAC;IACJ,CAAC;IAEQ,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B,IAAI,CAAC,oCAAoC,EAAE;SAC5C,CAAC;IACJ,CAAC;CACF;AAlBD,oEAkBC"}
@@ -0,0 +1,7 @@
1
+ import { EquipmentContainer } from '../../model/core/EquipmentContainer.js';
2
+ import { ConnectivityNodeContainerDao } from './ConnectivityNodeContainerDao.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class EquipmentContainerDao<T extends EquipmentContainer> extends ConnectivityNodeContainerDao<T> {
5
+ protected buildEquipmentContainerInsert(): InsertStatement;
6
+ toInsertStatements(): InsertStatement[];
7
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EquipmentContainerDao = void 0;
4
+ const ConnectivityNodeContainerDao_1 = require("./ConnectivityNodeContainerDao.js");
5
+ class EquipmentContainerDao extends ConnectivityNodeContainerDao_1.ConnectivityNodeContainerDao {
6
+ buildEquipmentContainerInsert() {
7
+ return {
8
+ sql: `
9
+ insert into cim.equipment_container (uuid)
10
+ values ($1)
11
+ on conflict (uuid) do nothing
12
+ `,
13
+ params: [this.cimObject.getUUID()]
14
+ };
15
+ }
16
+ toInsertStatements() {
17
+ return [
18
+ ...super.toInsertStatements(),
19
+ this.buildEquipmentContainerInsert()
20
+ ];
21
+ }
22
+ }
23
+ exports.EquipmentContainerDao = EquipmentContainerDao;
24
+ //# sourceMappingURL=EquipmentContainerDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EquipmentContainerDao.js","sourceRoot":"","sources":["../../../src/database/core/EquipmentContainerDao.ts"],"names":[],"mappings":";;;AACA,iFAA8E;AAG9E,MAAa,qBAAoD,SAAQ,2DAA+B;IAC5F,6BAA6B;QACrC,OAAO;YACL,GAAG,EAAE;;;;OAIJ;YACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SACnC,CAAC;IACJ,CAAC;IAEQ,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B,IAAI,CAAC,6BAA6B,EAAE;SACrC,CAAC;IACJ,CAAC;CACF;AAlBD,sDAkBC"}
@@ -0,0 +1,8 @@
1
+ import { Equipment } from '../../model/core/Equipment.js';
2
+ import { PowerSystemResourceDao } from './PowerSystemResourceDao.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class EquipmentDao<T extends Equipment> extends PowerSystemResourceDao<T> {
5
+ protected buildEquipmentInsert(): InsertStatement;
6
+ protected buildAdditionalEquipmentContainerInserts(): InsertStatement[];
7
+ toInsertStatements(): InsertStatement[];
8
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EquipmentDao = void 0;
4
+ const PowerSystemResourceDao_1 = require("./PowerSystemResourceDao.js");
5
+ class EquipmentDao extends PowerSystemResourceDao_1.PowerSystemResourceDao {
6
+ buildEquipmentInsert() {
7
+ return {
8
+ sql: `
9
+ insert into cim.equipment (
10
+ uuid,
11
+ equipment_container_uuid
12
+ ) values ($1, $2)
13
+ on conflict (uuid) do update
14
+ set equipment_container_uuid = excluded.equipment_container_uuid
15
+ `,
16
+ params: [
17
+ this.cimObject.getUUID(),
18
+ this.cimObject.equipmentContainer?.getUUID() ?? null
19
+ ]
20
+ };
21
+ }
22
+ buildAdditionalEquipmentContainerInserts() {
23
+ return [...this.cimObject.additionalEquipmentContainer.values()].map((container) => ({
24
+ sql: `
25
+ insert into cim.equipment_additional_equipment_container (
26
+ equipment_uuid,
27
+ equipment_container_uuid
28
+ ) values ($1, $2)
29
+ on conflict (equipment_uuid, equipment_container_uuid) do nothing
30
+ `,
31
+ params: [this.cimObject.getUUID(), container.getUUID()]
32
+ }));
33
+ }
34
+ toInsertStatements() {
35
+ return [
36
+ ...super.toInsertStatements(),
37
+ this.buildEquipmentInsert(),
38
+ ...this.buildAdditionalEquipmentContainerInserts()
39
+ ];
40
+ }
41
+ }
42
+ exports.EquipmentDao = EquipmentDao;
43
+ //# sourceMappingURL=EquipmentDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EquipmentDao.js","sourceRoot":"","sources":["../../../src/database/core/EquipmentDao.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAGlE,MAAa,YAAkC,SAAQ,+CAAyB;IACpE,oBAAoB;QAC5B,OAAO;YACL,GAAG,EAAE;;;;;;;OAOJ;YACD,MAAM,EAAE;gBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;gBACxB,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,OAAO,EAAE,IAAI,IAAI;aACrD;SACF,CAAC;IACJ,CAAC;IAES,wCAAwC;QAChD,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YACnF,GAAG,EAAE;;;;;;OAMJ;YACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC;SACxD,CAAC,CAAC,CAAC;IACN,CAAC;IAEQ,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B,IAAI,CAAC,oBAAoB,EAAE;YAC3B,GAAG,IAAI,CAAC,wCAAwC,EAAE;SACnD,CAAC;IACJ,CAAC;CACF;AAtCD,oCAsCC"}
@@ -0,0 +1,6 @@
1
+ import { EquipmentContainerDao } from './EquipmentContainerDao.js';
2
+ import { Feeder } from '../../model/core/Feeder.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class FeederDao<T extends Feeder> extends EquipmentContainerDao<Feeder> {
5
+ toInsertStatements(): InsertStatement[];
6
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeederDao = void 0;
4
+ const EquipmentContainerDao_1 = require("./EquipmentContainerDao.js");
5
+ class FeederDao extends EquipmentContainerDao_1.EquipmentContainerDao {
6
+ toInsertStatements() {
7
+ return [
8
+ ...super.toInsertStatements(),
9
+ {
10
+ sql: `
11
+ insert into cim.feeder (
12
+ uuid,
13
+ normal_energizing_substation_uuid
14
+ ) values ($1, $2)
15
+ on conflict (uuid) do update
16
+ set normal_energizing_substation_uuid = excluded.normal_energizing_substation_uuid
17
+ `,
18
+ params: [
19
+ this.cimObject.getUUID(),
20
+ this.cimObject.normalEnergizingSubstation?.getUUID() ?? null
21
+ ]
22
+ }
23
+ ];
24
+ }
25
+ }
26
+ exports.FeederDao = FeederDao;
27
+ //# sourceMappingURL=FeederDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeederDao.js","sourceRoot":"","sources":["../../../src/database/core/FeederDao.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAIhE,MAAa,SAA4B,SAAQ,6CAA6B;IACnE,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,GAAG,EAAE;;;;;;;SAOJ;gBACD,MAAM,EAAE;oBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;oBACxB,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,OAAO,EAAE,IAAI,IAAI;iBAC7D;aACF;SACF,CAAC;IACJ,CAAC;CACF;AApBD,8BAoBC"}
@@ -0,0 +1,8 @@
1
+ import { InsertStatement } from '../dao-sql-types.js';
2
+ import { IdentifiedObject } from '../../model/core/IdentifiedObject.js';
3
+ export declare class IdentifiedObjectDao<T extends IdentifiedObject> {
4
+ readonly cimObject: T;
5
+ powerGridId: number;
6
+ constructor(cimObject: T, powerGridId: number);
7
+ protected buildIdentifiedObjectInsert(): InsertStatement;
8
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdentifiedObjectDao = void 0;
4
+ class IdentifiedObjectDao {
5
+ cimObject;
6
+ //ToDo better solution
7
+ //ToDo use identified_object instead of dim_object
8
+ powerGridId;
9
+ constructor(cimObject, powerGridId) {
10
+ this.cimObject = cimObject;
11
+ this.powerGridId = powerGridId;
12
+ }
13
+ buildIdentifiedObjectInsert() {
14
+ return {
15
+ sql: `
16
+ insert into cim.identified_object (uuid, name, short_name, description, power_grid_id)
17
+ values ($1, $2, $3, $4, $4)) on conflict (uuid) do
18
+ update set name = excluded.name, short_name = excluded.short_name, description = excluded.description `,
19
+ params: [
20
+ this.cimObject.getUUID(),
21
+ this.cimObject.name ?? null,
22
+ this.cimObject.shortName ?? null,
23
+ this.cimObject.description ?? null,
24
+ this.powerGridId
25
+ ]
26
+ };
27
+ }
28
+ }
29
+ exports.IdentifiedObjectDao = IdentifiedObjectDao;
30
+ //# sourceMappingURL=IdentifiedObjectDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentifiedObjectDao.js","sourceRoot":"","sources":["../../../src/database/core/IdentifiedObjectDao.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAMF;IAJ5B,sBAAsB;IACtB,kDAAkD;IAClD,WAAW,CAAS;IAEpB,YAA4B,SAAY,EAAE,WAAmB;QAAjC,cAAS,GAAT,SAAS,CAAG;QACtC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAGS,2BAA2B;QACnC,OAAO;YACL,GAAG,EAAE;;;kHAGuG;YAC5G,MAAM,EAAE;gBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;gBACxB,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI;gBAC3B,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,IAAI;gBAChC,IAAI,CAAC,SAAS,CAAC,WAAW,IAAI,IAAI;gBAClC,IAAI,CAAC,WAAW;aACjB;SACF,CAAC;IACJ,CAAC;CACF;AA1BD,kDA0BC"}
@@ -0,0 +1,7 @@
1
+ import { PowerSystemResource } from '../../model/core/PowerSystemResource.js';
2
+ import { IdentifiedObjectDao } from './IdentifiedObjectDao.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class PowerSystemResourceDao<T extends PowerSystemResource> extends IdentifiedObjectDao<T> {
5
+ protected buildPowerSystemResourceInsert(): InsertStatement;
6
+ toInsertStatements(): InsertStatement[];
7
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PowerSystemResourceDao = void 0;
4
+ const IdentifiedObjectDao_1 = require("./IdentifiedObjectDao.js");
5
+ class PowerSystemResourceDao extends IdentifiedObjectDao_1.IdentifiedObjectDao {
6
+ buildPowerSystemResourceInsert() {
7
+ return {
8
+ sql: `
9
+ insert into cim.power_system_resource (
10
+ uuid,
11
+ psr_type_uuid
12
+ ) values ($1, $2)
13
+ on conflict (uuid) do update
14
+ set psr_type_uuid = excluded.psr_type_uuid
15
+ `,
16
+ params: [
17
+ this.cimObject.getUUID(),
18
+ this.cimObject.psrType?.getUUID() ?? null
19
+ ]
20
+ };
21
+ }
22
+ toInsertStatements() {
23
+ return [
24
+ this.buildIdentifiedObjectInsert(),
25
+ this.buildPowerSystemResourceInsert()
26
+ ];
27
+ }
28
+ }
29
+ exports.PowerSystemResourceDao = PowerSystemResourceDao;
30
+ //# sourceMappingURL=PowerSystemResourceDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PowerSystemResourceDao.js","sourceRoot":"","sources":["../../../src/database/core/PowerSystemResourceDao.ts"],"names":[],"mappings":";;;AACA,+DAA4D;AAG5D,MAAa,sBAAsD,SAAQ,yCAAsB;IACrF,8BAA8B;QACtC,OAAO;YACL,GAAG,EAAE;;;;;;;OAOJ;YACD,MAAM,EAAE;gBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;gBACxB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,IAAI;aAC1C;SACF,CAAC;IACJ,CAAC;IAED,kBAAkB;QAChB,OAAO;YACL,IAAI,CAAC,2BAA2B,EAAE;YAClC,IAAI,CAAC,8BAA8B,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AAxBD,wDAwBC"}
@@ -0,0 +1,6 @@
1
+ import { PSRType } from '../../model/core/PSRType.js';
2
+ import { InsertStatement } from '../dao-sql-types.js';
3
+ import { IdentifiedObjectDao } from './IdentifiedObjectDao.js';
4
+ export declare class PsrTypeDao extends IdentifiedObjectDao<PSRType> {
5
+ toInsertStatements(): InsertStatement[];
6
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsrTypeDao = void 0;
4
+ const IdentifiedObjectDao_1 = require("./IdentifiedObjectDao.js");
5
+ class PsrTypeDao extends IdentifiedObjectDao_1.IdentifiedObjectDao {
6
+ toInsertStatements() {
7
+ return [
8
+ this.buildIdentifiedObjectInsert(),
9
+ {
10
+ sql: `
11
+ insert into cim.psr_type (uuid)
12
+ values ($1)
13
+ on conflict (uuid) do nothing
14
+ `,
15
+ params: [this.cimObject.getUUID()]
16
+ }
17
+ ];
18
+ }
19
+ }
20
+ exports.PsrTypeDao = PsrTypeDao;
21
+ //# sourceMappingURL=PsrTypeDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PsrTypeDao.js","sourceRoot":"","sources":["../../../src/database/core/PsrTypeDao.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAE5D,MAAa,UAAW,SAAQ,yCAA4B;IAE1D,kBAAkB;QAChB,OAAO;YACL,IAAI,CAAC,2BAA2B,EAAE;YAClC;gBACE,GAAG,EAAE;;;;SAIJ;gBACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;aACnC;SACF,CAAC;IACJ,CAAC;CACF;AAfD,gCAeC"}
@@ -0,0 +1,6 @@
1
+ import { IdentifiedObjectDao } from './IdentifiedObjectDao.js';
2
+ import { SubGeographicalRegion } from '../../model/core/SubGeographicalRegion.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class SubGeographicalRegionDao extends IdentifiedObjectDao<SubGeographicalRegion> {
5
+ toInsertStatements(): InsertStatement[];
6
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SubGeographicalRegionDao = void 0;
4
+ const IdentifiedObjectDao_1 = require("./IdentifiedObjectDao.js");
5
+ class SubGeographicalRegionDao extends IdentifiedObjectDao_1.IdentifiedObjectDao {
6
+ toInsertStatements() {
7
+ return [
8
+ this.buildIdentifiedObjectInsert(),
9
+ {
10
+ sql: `
11
+ insert into cim.sub_geographical_region (uuid)
12
+ values ($1)
13
+ on conflict (uuid) do nothing
14
+ `,
15
+ params: [this.cimObject.getUUID()]
16
+ }
17
+ ];
18
+ }
19
+ }
20
+ exports.SubGeographicalRegionDao = SubGeographicalRegionDao;
21
+ //# sourceMappingURL=SubGeographicalRegionDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubGeographicalRegionDao.js","sourceRoot":"","sources":["../../../src/database/core/SubGeographicalRegionDao.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAI5D,MAAa,wBAAyB,SAAQ,yCAA0C;IACtF,kBAAkB;QAChB,OAAO;YACL,IAAI,CAAC,2BAA2B,EAAE;YAClC;gBACE,GAAG,EAAE;;;;SAIJ;gBACD,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;aACnC;SACF,CAAC;IACJ,CAAC;CACF;AAdD,4DAcC"}
@@ -0,0 +1,6 @@
1
+ import { EquipmentContainerDao } from './EquipmentContainerDao.js';
2
+ import { Substation } from '../../model/core/Substation.js';
3
+ import { InsertStatement } from '../dao-sql-types.js';
4
+ export declare class SubstationDao extends EquipmentContainerDao<Substation> {
5
+ toInsertStatements(): InsertStatement[];
6
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SubstationDao = void 0;
4
+ const EquipmentContainerDao_1 = require("./EquipmentContainerDao.js");
5
+ class SubstationDao extends EquipmentContainerDao_1.EquipmentContainerDao {
6
+ toInsertStatements() {
7
+ return [
8
+ ...super.toInsertStatements(),
9
+ {
10
+ sql: `
11
+ insert into cim.substation (
12
+ uuid,
13
+ number,
14
+ sub_geographical_region_uuid
15
+ ) values ($1, $2)
16
+ on conflict (uuid) do update
17
+ set sub_geographical_region_uuid = excluded.sub_geographical_region_uuid
18
+ `,
19
+ params: [
20
+ this.cimObject.getUUID(),
21
+ this.cimObject.getNumber() ?? null,
22
+ this.cimObject.subGeographicalRegion?.getUUID() ?? null
23
+ ]
24
+ }
25
+ ];
26
+ }
27
+ }
28
+ exports.SubstationDao = SubstationDao;
29
+ //# sourceMappingURL=SubstationDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubstationDao.js","sourceRoot":"","sources":["../../../src/database/core/SubstationDao.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAIhE,MAAa,aAAc,SAAQ,6CAAiC;IACzD,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,GAAG,EAAE;;;;;;;;SAQJ;gBACD,MAAM,EAAE;oBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;oBACxB,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,IAAI;oBAClC,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,IAAI;iBACxD;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAtBD,sCAsBC"}
@@ -0,0 +1,6 @@
1
+ import { InsertStatement } from '../dao-sql-types.js';
2
+ import { FeederDao } from './FeederDao.js';
3
+ import { WNFeeder } from '../../model/extensions/westnetz-neplan/core/WNFeeder.js';
4
+ export declare class WNFeederDao extends FeederDao<WNFeeder> {
5
+ toInsertStatements(): InsertStatement[];
6
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WNFeederDao = void 0;
4
+ const FeederDao_1 = require("./FeederDao.js");
5
+ class WNFeederDao extends FeederDao_1.FeederDao {
6
+ toInsertStatements() {
7
+ return [
8
+ ...super.toInsertStatements(),
9
+ {
10
+ sql: `
11
+ insert into cim.wnfeeder (
12
+ uuid,
13
+ number
14
+ ) values ($1, $2)
15
+ on conflict (uuid) do update
16
+ set number = excluded.number
17
+ `,
18
+ params: [
19
+ this.cimObject.getUUID(),
20
+ this.cimObject.number ?? null
21
+ ]
22
+ }
23
+ ];
24
+ }
25
+ }
26
+ exports.WNFeederDao = WNFeederDao;
27
+ //# sourceMappingURL=WNFeederDao.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WNFeederDao.js","sourceRoot":"","sources":["../../../src/database/core/WNFeederDao.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAGxC,MAAa,WAAY,SAAQ,qBAAmB;IACzC,kBAAkB;QACzB,OAAO;YACL,GAAG,KAAK,CAAC,kBAAkB,EAAE;YAC7B;gBACE,GAAG,EAAE;;;;;;;SAOJ;gBACD,MAAM,EAAE;oBACN,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;oBACxB,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI;iBAC9B;aACF;SACF,CAAC;IACJ,CAAC;CACF;AApBD,kCAoBC"}
@@ -0,0 +1,7 @@
1
+ import { InsertStatement } from "./dao-sql-types.js";
2
+ import { IdentifiedObject } from '../model/core/IdentifiedObject.js';
3
+ export declare abstract class BaseDao<T extends IdentifiedObject> {
4
+ readonly cimObject: T;
5
+ constructor(cimObject: T);
6
+ abstract toInsertStatements(): InsertStatement[];
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseDao = void 0;
4
+ class BaseDao {
5
+ cimObject;
6
+ constructor(cimObject) {
7
+ this.cimObject = cimObject;
8
+ }
9
+ }
10
+ exports.BaseDao = BaseDao;
11
+ //# sourceMappingURL=dao-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dao-base.js","sourceRoot":"","sources":["../../src/database/dao-base.ts"],"names":[],"mappings":";;;AAGA,MAAsB,OAAO;IACC;IAA5B,YAA4B,SAAY;QAAZ,cAAS,GAAT,SAAS,CAAG;IAAG,CAAC;CAG7C;AAJD,0BAIC"}
@@ -0,0 +1,5 @@
1
+ import { IdentifiedObject } from '../model/core/IdentifiedObject.js';
2
+ export declare class DaoDependencyResolver {
3
+ resolve(root: IdentifiedObject): IdentifiedObject[];
4
+ private getDependencies;
5
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DaoDependencyResolver = void 0;
4
+ const PowerSystemResource_1 = require("../model/core/PowerSystemResource.js");
5
+ const Substation_1 = require("../model/core/Substation.js");
6
+ const Feeder_1 = require("../model/core/Feeder.js");
7
+ const Equipment_1 = require("../model/core/Equipment.js");
8
+ class DaoDependencyResolver {
9
+ resolve(root) {
10
+ const ordered = [];
11
+ const visited = new Set();
12
+ const visit = (obj) => {
13
+ if (!obj)
14
+ return;
15
+ if (visited.has(obj.getUUID()))
16
+ return;
17
+ visited.add(obj.getUUID());
18
+ for (const dep of this.getDependencies(obj)) {
19
+ visit(dep);
20
+ }
21
+ ordered.push(obj);
22
+ };
23
+ visit(root);
24
+ return ordered;
25
+ }
26
+ getDependencies(obj) {
27
+ const deps = [];
28
+ if (obj instanceof PowerSystemResource_1.PowerSystemResource && obj.psrType) {
29
+ deps.push(obj.psrType);
30
+ }
31
+ if (obj instanceof Substation_1.Substation && obj.subGeographicalRegion) {
32
+ deps.push(obj.subGeographicalRegion);
33
+ }
34
+ if (obj instanceof Feeder_1.Feeder && obj.normalEnergizingSubstation) {
35
+ deps.push(obj.normalEnergizingSubstation);
36
+ }
37
+ if (obj instanceof Equipment_1.Equipment) {
38
+ if (obj.equipmentContainer) {
39
+ deps.push(obj.equipmentContainer);
40
+ }
41
+ for (const additional of obj.additionalEquipmentContainer.values()) {
42
+ deps.push(additional);
43
+ }
44
+ }
45
+ return deps;
46
+ }
47
+ }
48
+ exports.DaoDependencyResolver = DaoDependencyResolver;
49
+ //# sourceMappingURL=dao-dependency-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dao-dependency-resolver.js","sourceRoot":"","sources":["../../src/database/dao-dependency-resolver.ts"],"names":[],"mappings":";;;AACA,2EAAwE;AACxE,yDAAsD;AACtD,iDAA8C;AAC9C,uDAAoD;AAGpD,MAAa,qBAAqB;IAEhC,OAAO,CAAC,IAAsB;QAC5B,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAElC,MAAM,KAAK,GAAG,CAAC,GAAiC,EAAQ,EAAE;YACxD,IAAI,CAAC,GAAG;gBAAE,OAAO;YACjB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;gBAAE,OAAO;YAEvC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAE3B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5C,KAAK,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,eAAe,CAAC,GAAqB;QAC3C,MAAM,IAAI,GAAuB,EAAE,CAAC;QAEpC,IAAI,GAAG,YAAY,yCAAmB,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YACtD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,GAAG,YAAY,uBAAU,IAAI,GAAG,CAAC,qBAAqB,EAAE,CAAC;YAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,GAAG,YAAY,eAAM,IAAI,GAAG,CAAC,0BAA0B,EAAE,CAAC;YAC5D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,GAAG,YAAY,qBAAS,EAAE,CAAC;YAC7B,IAAI,GAAG,CAAC,kBAAkB,EAAE,CAAC;gBAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACpC,CAAC;YAED,KAAK,MAAM,UAAU,IAAI,GAAG,CAAC,4BAA4B,CAAC,MAAM,EAAE,EAAE,CAAC;gBACnE,IAAI,CAAC,IAAI,CAAC,UAAgC,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlDD,sDAkDC"}
@@ -0,0 +1,5 @@
1
+ import { IdentifiedObject } from '../model/core/IdentifiedObject.js';
2
+ import { BaseDao } from './dao-base.js';
3
+ export declare class DaoFactory {
4
+ static create(obj: IdentifiedObject, powerGridID: number): BaseDao<any>;
5
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DaoFactory = void 0;
4
+ const PSRType_1 = require("../model/core/PSRType.js");
5
+ const PsrTypeDao_1 = require("./core/PsrTypeDao.js");
6
+ const SubGeographicalRegion_1 = require("../model/core/SubGeographicalRegion.js");
7
+ const SubGeographicalRegionDao_1 = require("./core/SubGeographicalRegionDao.js");
8
+ const Substation_1 = require("../model/core/Substation.js");
9
+ const SubstationDao_1 = require("./core/SubstationDao.js");
10
+ const Feeder_1 = require("../model/core/Feeder.js");
11
+ const FeederDao_1 = require("./core/FeederDao.js");
12
+ const ACLineSegment_1 = require("../model/wires/ACLineSegment.js");
13
+ const ACLineSegmentDao_1 = require("./wires/ACLineSegmentDao.js");
14
+ const WNFeeder_1 = require("../model/extensions/westnetz-neplan/core/WNFeeder.js");
15
+ const WNFeederDao_1 = require("./core/WNFeederDao.js");
16
+ class DaoFactory {
17
+ static create(obj, powerGridID) {
18
+ if (obj instanceof PSRType_1.PSRType) {
19
+ return new PsrTypeDao_1.PsrTypeDao(obj, powerGridID);
20
+ }
21
+ if (obj instanceof SubGeographicalRegion_1.SubGeographicalRegion) {
22
+ return new SubGeographicalRegionDao_1.SubGeographicalRegionDao(obj, powerGridID);
23
+ }
24
+ if (obj instanceof Substation_1.Substation) {
25
+ return new SubstationDao_1.SubstationDao(obj, powerGridID);
26
+ }
27
+ // spezialiserte DAO-Klassen sollen vor CIM-Klassen instanziiert werden!
28
+ if (obj instanceof WNFeeder_1.WNFeeder) {
29
+ return new WNFeederDao_1.WNFeederDao(obj, powerGridID);
30
+ }
31
+ if (obj instanceof Feeder_1.Feeder) {
32
+ return new FeederDao_1.FeederDao(obj, powerGridID);
33
+ }
34
+ if (obj instanceof ACLineSegment_1.ACLineSegment) {
35
+ return new ACLineSegmentDao_1.ACLineSegmentDao(obj, powerGridID);
36
+ }
37
+ throw new Error(`Unsupported CIM object type: ${obj.constructor.name}`);
38
+ }
39
+ }
40
+ exports.DaoFactory = DaoFactory;
41
+ //# sourceMappingURL=dao-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dao-factory.js","sourceRoot":"","sources":["../../src/database/dao-factory.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAChD,kDAA+C;AAC/C,+EAA4E;AAC5E,8EAA2E;AAC3E,yDAAsD;AACtD,wDAAqD;AACrD,iDAA8C;AAC9C,gDAA6C;AAC7C,gEAA6D;AAC7D,+DAA4D;AAC5D,gFAA6E;AAC7E,oDAAiD;AAEjD,MAAa,UAAU;IACrB,MAAM,CAAC,MAAM,CAAC,GAAqB,EAAE,WAAmB;QACtD,IAAI,GAAG,YAAY,iBAAO,EAAE,CAAC;YAC3B,OAAO,IAAI,uBAAU,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,GAAG,YAAY,6CAAqB,EAAE,CAAC;YACzC,OAAO,IAAI,mDAAwB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,GAAG,YAAY,uBAAU,EAAE,CAAC;YAC9B,OAAO,IAAI,6BAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC7C,CAAC;QACD,wEAAwE;QACxE,IAAI,GAAG,YAAY,mBAAQ,EAAE,CAAC;YAC5B,OAAO,IAAI,yBAAW,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,GAAG,YAAY,eAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,qBAAS,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,GAAG,YAAY,6BAAa,EAAE,CAAC;YACjC,OAAO,IAAI,mCAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AAxBD,gCAwBC"}
@@ -0,0 +1,6 @@
1
+ import { IdentifiedObject } from '../model/core/IdentifiedObject.js';
2
+ export declare class DaoPersistenceEngine {
3
+ private readonly planner;
4
+ persist(root: IdentifiedObject): Promise<void>;
5
+ persistMany(roots: IdentifiedObject[]): Promise<void>;
6
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DaoPersistenceEngine = void 0;
4
+ const dao_statement_planner_1 = require("./dao-statement-planner.js");
5
+ class DaoPersistenceEngine {
6
+ planner = new dao_statement_planner_1.DaoStatementPlanner();
7
+ /* constructor(private readonly pool: Pool) {
8
+ }*/
9
+ async persist(root) {
10
+ //const statements = this.planner.plan(root);
11
+ // await this.executeInTransaction(statements);
12
+ }
13
+ async persistMany(roots) {
14
+ // const statements = this.planner.planMany(roots);
15
+ // await this.executeInTransaction(statements);
16
+ }
17
+ }
18
+ exports.DaoPersistenceEngine = DaoPersistenceEngine;
19
+ //# sourceMappingURL=dao-persistence-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dao-persistence-engine.js","sourceRoot":"","sources":["../../src/database/dao-persistence-engine.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAG9D,MAAa,oBAAoB;IACd,OAAO,GAAG,IAAI,2CAAmB,EAAE,CAAC;IAEvD;SACK;IAEH,KAAK,CAAC,OAAO,CAAC,IAAsB;QAClC,6CAA6C;QAC7C,+CAA+C;IACjD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAyB;QACzC,mDAAmD;QACnD,+CAA+C;IACjD,CAAC;CAoBF;AAlCD,oDAkCC"}
@@ -0,0 +1,8 @@
1
+ export interface InsertStatement {
2
+ sql: string;
3
+ params: unknown[];
4
+ }
5
+ export interface DeleteStatement {
6
+ sql: string;
7
+ params: unknown[];
8
+ }