@fintekkers/ledger-models 0.1.96 → 0.1.98
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/node/fintekkers/models/portfolio/portfolio_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/field_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/measure_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_filter_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_status_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_util_grpc_pb.js +1 -0
- package/node/fintekkers/models/price/price_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/auction_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/issuance_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/coupon_frequency_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/coupon_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/identifier/identifier_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/identifier/identifier_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_pb.test.d.ts +1 -0
- package/node/fintekkers/models/security/security_pb.test.js +10 -10
- package/node/fintekkers/models/security/security_pb.test.js.map +1 -1
- package/node/fintekkers/models/security/security_quantity_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/tenor_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/tenor_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/strategy/strategy_allocation_grpc_pb.js +1 -0
- package/node/fintekkers/models/strategy/strategy_grpc_pb.js +1 -0
- package/node/fintekkers/models/transaction/transaction_grpc_pb.js +1 -0
- package/node/fintekkers/models/transaction/transaction_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/api/api_key_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/date_range_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/date_range_pb.d.ts +43 -0
- package/node/fintekkers/models/util/date_range_pb.js +310 -0
- package/node/fintekkers/models/util/decimal_value_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/endpoint_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/local_date_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/local_timestamp_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/lock/node_partition_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/lock/node_state_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/uuid_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/position/query_position_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/position/query_position_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/create_price_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/create_price_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/query_price_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/query_price_request_pb.d.ts +47 -0
- package/node/fintekkers/requests/price/query_price_request_pb.js +190 -2
- package/node/fintekkers/requests/price/query_price_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/create_security_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/create_security_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_request_pb.js +238 -0
- package/node/fintekkers/requests/security/get_field_values_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_response_pb.js +268 -0
- package/node/fintekkers/requests/security/get_fields_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_fields_response_pb.js +266 -0
- package/node/fintekkers/requests/security/query_security_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/query_security_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/create_transaction_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/create_transaction_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/query_transaction_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/query_transaction_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/error_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/message_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/summary_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/lock/lock_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/lock/lock_request_pb.js +54 -1
- package/node/fintekkers/requests/util/lock/lock_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/operation_grpc_pb.js +1 -0
- package/node/fintekkers/requests/valuation/valuation_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/valuation/valuation_response_grpc_pb.js +1 -0
- package/node/wrappers/models/portfolio/portfolio.d.ts +15 -0
- package/node/wrappers/models/portfolio/portfolio.js +26 -21
- package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
- package/node/wrappers/models/portfolio/portfolio.ts +6 -2
- package/node/wrappers/models/position/field.d.ts +7 -0
- package/node/wrappers/models/position/field.js +10 -14
- package/node/wrappers/models/position/field.js.map +1 -1
- package/node/wrappers/models/position/field.test.d.ts +1 -0
- package/node/wrappers/models/position/field.test.js +10 -48
- package/node/wrappers/models/position/field.test.js.map +1 -1
- package/node/wrappers/models/position/field.ts +1 -2
- package/node/wrappers/models/position/position.d.ts +32 -0
- package/node/wrappers/models/position/position.js +89 -83
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.d.ts +1 -0
- package/node/wrappers/models/position/position.test.js +128 -198
- package/node/wrappers/models/position/position.test.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +1 -1
- package/node/wrappers/models/position/position.ts +19 -12
- package/node/wrappers/models/position/positionfilter.d.ts +24 -0
- package/node/wrappers/models/position/positionfilter.js +19 -20
- package/node/wrappers/models/position/positionfilter.js.map +1 -1
- package/node/wrappers/models/position/positionfilter.ts +1 -1
- package/node/wrappers/models/security/security.d.ts +23 -0
- package/node/wrappers/models/security/security.js +55 -44
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.test.d.ts +1 -0
- package/node/wrappers/models/security/security.test.js +14 -11
- package/node/wrappers/models/security/security.test.js.map +1 -1
- package/node/wrappers/models/security/security.ts +13 -6
- package/node/wrappers/models/transaction/transaction.d.ts +36 -0
- package/node/wrappers/models/transaction/transaction.js +98 -68
- package/node/wrappers/models/transaction/transaction.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction.test.js +12 -9
- package/node/wrappers/models/transaction/transaction.test.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.ts +30 -12
- package/node/wrappers/models/transaction/transaction_type.d.ts +17 -0
- package/node/wrappers/models/transaction/transaction_type.js +12 -12
- package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
- package/node/wrappers/models/transaction/transaction_type.ts +5 -5
- package/node/wrappers/models/utils/date.d.ts +11 -0
- package/node/wrappers/models/utils/date.js +16 -17
- package/node/wrappers/models/utils/date.js.map +1 -1
- package/node/wrappers/models/utils/date.test.d.ts +1 -0
- package/node/wrappers/models/utils/date.test.js +28 -58
- package/node/wrappers/models/utils/date.test.js.map +1 -1
- package/node/wrappers/models/utils/date.ts +1 -1
- package/node/wrappers/models/utils/datetime.d.ts +14 -0
- package/node/wrappers/models/utils/datetime.js +41 -34
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.test.d.ts +1 -0
- package/node/wrappers/models/utils/datetime.test.js +40 -70
- package/node/wrappers/models/utils/datetime.test.js.map +1 -1
- package/node/wrappers/models/utils/datetime.ts +13 -8
- package/node/wrappers/models/utils/protoEnum.d.ts +12 -0
- package/node/wrappers/models/utils/protoEnum.js +22 -24
- package/node/wrappers/models/utils/protoEnum.js.map +1 -1
- package/node/wrappers/models/utils/protoEnum.test.d.ts +1 -0
- package/node/wrappers/models/utils/protoEnum.test.js +13 -13
- package/node/wrappers/models/utils/protoEnum.test.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.d.ts +13 -0
- package/node/wrappers/models/utils/requestcontext.js +52 -44
- package/node/wrappers/models/utils/requestcontext.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.ts +15 -15
- package/node/wrappers/models/utils/requestcontext_d.d.ts +6 -0
- package/node/wrappers/models/utils/requestcontext_d.js +1 -0
- package/node/wrappers/models/utils/serialization.d.ts +12 -0
- package/node/wrappers/models/utils/serialization.js +19 -22
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.d.ts +1 -0
- package/node/wrappers/models/utils/serialization.test.js +14 -14
- package/node/wrappers/models/utils/serialization.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.ts +1 -1
- package/node/wrappers/models/utils/serialization.util.d.ts +4 -0
- package/node/wrappers/models/utils/serialization.util.js +25 -25
- package/node/wrappers/models/utils/serialization.util.js.map +1 -1
- package/node/wrappers/models/utils/serialization.util.test.d.ts +1 -0
- package/node/wrappers/models/utils/serialization.util.test.js +15 -15
- package/node/wrappers/models/utils/serialization.util.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.util.ts +5 -5
- package/node/wrappers/models/utils/uuid.d.ts +13 -0
- package/node/wrappers/models/utils/uuid.js +53 -31
- package/node/wrappers/models/utils/uuid.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.d.ts +1 -0
- package/node/wrappers/models/utils/uuid.test.js +7 -7
- package/node/wrappers/models/utils/uuid.test.js.map +1 -1
- package/node/wrappers/models/utils/uuid.ts +1 -1
- package/node/wrappers/requests/position/QueryPositionRequest.d.ts +19 -0
- package/node/wrappers/requests/position/QueryPositionRequest.js +19 -20
- package/node/wrappers/requests/position/QueryPositionRequest.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +15 -0
- package/node/wrappers/services/portfolio-service/PortfolioService.js +58 -109
- package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.ts +2 -2
- package/node/wrappers/services/portfolio-service/portfolioService.test.d.ts +1 -0
- package/node/wrappers/services/portfolio-service/portfolioService.test.js +47 -64
- package/node/wrappers/services/portfolio-service/portfolioService.test.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.d.ts +10 -0
- package/node/wrappers/services/position-service/PositionService.js +45 -83
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.d.ts +1 -0
- package/node/wrappers/services/position-service/position.test.js +52 -118
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.ts +7 -1
- package/node/wrappers/services/security-service/SecurityService.d.ts +15 -0
- package/node/wrappers/services/security-service/SecurityService.js +86 -117
- package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
- package/node/wrappers/services/security-service/SecurityService.ts +2 -2
- package/node/wrappers/services/security-service/security.maturityLadder.test.d.ts +1 -0
- package/node/wrappers/services/security-service/security.maturityLadder.test.js +40 -75
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.maturityLadder.test.ts +1 -1
- package/node/wrappers/services/security-service/security.test.d.ts +1 -0
- package/node/wrappers/services/security-service/security.test.js +88 -114
- package/node/wrappers/services/security-service/security.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.test.ts +2 -2
- package/node/wrappers/services/transaction-service/TransactionService.d.ts +13 -0
- package/node/wrappers/services/transaction-service/TransactionService.js +53 -98
- package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.ts +2 -2
- package/node/wrappers/services/transaction-service/transaction.search.test.d.ts +1 -0
- package/node/wrappers/services/transaction-service/transaction.search.test.js +51 -70
- package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.d.ts +1 -0
- package/node/wrappers/services/transaction-service/transaction.test.js +127 -171
- package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.ts +3 -1
- package/package.json +4 -1
- package/tsconfig.json +15 -6
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
4
|
+
const datetime_1 = require("../utils/datetime");
|
|
5
|
+
const uuid_1 = require("../utils/uuid");
|
|
6
|
+
class Portfolio {
|
|
7
|
+
constructor(proto) {
|
|
8
8
|
this.proto = proto;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
toString() {
|
|
11
11
|
return this.getPortfolioName();
|
|
12
|
-
}
|
|
13
|
-
|
|
12
|
+
}
|
|
13
|
+
getID() {
|
|
14
|
+
const uuid = this.proto.getUuid();
|
|
15
|
+
if (!uuid)
|
|
16
|
+
throw new Error('Portfolio UUID is undefined');
|
|
14
17
|
return uuid_1.UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
getAsOf() {
|
|
20
|
+
const asOf = this.proto.getAsOf();
|
|
21
|
+
if (!asOf)
|
|
22
|
+
throw new Error('Portfolio AsOf is undefined');
|
|
23
|
+
return new datetime_1.ZonedDateTime(asOf);
|
|
24
|
+
}
|
|
25
|
+
getPortfolioName() {
|
|
20
26
|
return this.proto.getPortfolioName();
|
|
21
|
-
}
|
|
22
|
-
|
|
27
|
+
}
|
|
28
|
+
getFields() {
|
|
23
29
|
return [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.PORTFOLIO, field_pb_1.FieldProto.PORTFOLIO_ID, field_pb_1.FieldProto.PORTFOLIO_NAME];
|
|
24
|
-
}
|
|
25
|
-
|
|
30
|
+
}
|
|
31
|
+
getField(field) {
|
|
26
32
|
switch (field) {
|
|
27
33
|
case field_pb_1.FieldProto.ID:
|
|
28
34
|
case field_pb_1.FieldProto.PORTFOLIO_ID:
|
|
@@ -32,10 +38,9 @@ var Portfolio = /** @class */ (function () {
|
|
|
32
38
|
case field_pb_1.FieldProto.PORTFOLIO_NAME:
|
|
33
39
|
return this.getPortfolioName();
|
|
34
40
|
default:
|
|
35
|
-
throw new Error(
|
|
41
|
+
throw new Error(`Field not mapped in Portfolio wrapper: ${field}`);
|
|
36
42
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
40
45
|
exports.default = Portfolio;
|
|
41
46
|
//# sourceMappingURL=portfolio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["portfolio.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["portfolio.ts"],"names":[],"mappings":";;AACA,2EAA0E;AAC1E,gDAAkD;AAClD,wCAAqC;AAErC,MAAM,SAAS;IAGX,YAAY,KAAqB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnC,CAAC;IAED,KAAK;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI;YAAE,M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+
return UUID.fromU8Array(this.proto.getUuid()!.getRawUuid_asU8());
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
getAsOf(): ZonedDateTime {
|
|
22
|
-
|
|
24
|
+
const asOf = this.proto.getAsOf();
|
|
25
|
+
if (!asOf) throw new Error('Portfolio AsOf is undefined');
|
|
26
|
+
return new ZonedDateTime(asOf);
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
getPortfolioName(): string {
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Field = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
5
|
+
class Field {
|
|
6
|
+
constructor(field) {
|
|
7
7
|
this.field = field;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
getName() {
|
|
10
10
|
function getEnumNameByValue(enumObj, value) {
|
|
11
11
|
// Find the enum key that matches the value
|
|
12
|
-
|
|
13
|
-
var val = _a[1];
|
|
14
|
-
return val === value;
|
|
15
|
-
});
|
|
12
|
+
const entry = Object.entries(enumObj).find(([, val]) => val === value);
|
|
16
13
|
// Return the key name if found, otherwise undefined or a placeholder
|
|
17
14
|
return entry ? entry[0] : 'undefined';
|
|
18
15
|
}
|
|
19
16
|
return getEnumNameByValue(field_pb_1.FieldProto, this.field);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
}());
|
|
17
|
+
}
|
|
18
|
+
toString() {
|
|
19
|
+
return ""; //this.getEnumValueName();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
26
22
|
exports.Field = Field;
|
|
27
23
|
//# sourceMappingURL=field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":";;;AAAA,2EAA0E;AAE1E,MAAa,KAAK;IAGd,YAAY,KAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,OAAO;QACH,SAAS,kBAAkB,CAAC,OAAY,EAAE,KAAa;YACnD,2CAA2C;YAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC;YACvE,qEAAqE;YACrE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1C,CAAC;QAED,OAAO,kBAAkB,CAAC,qBAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ;QACJ,OAAO,EAAE,CAAC,CAAA,0BAA0B;IACxC,CAAC;CACJ;AArBD,sBAqBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,56 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
test('test the field wrapper',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
case 0: return [4 /*yield*/, testSerialization()];
|
|
46
|
-
case 1:
|
|
47
|
-
isTrue = _a.sent();
|
|
48
|
-
expect(isTrue).toBe(true);
|
|
49
|
-
return [2 /*return*/];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}); });
|
|
12
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
13
|
+
const field_1 = require("./field");
|
|
14
|
+
test('test the field wrapper', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const isTrue = yield testSerialization();
|
|
16
|
+
expect(isTrue).toBe(true);
|
|
17
|
+
}));
|
|
53
18
|
function testSerialization() {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
expect(field.getName()).toBe("TRADE_DATE");
|
|
59
|
-
return [2 /*return*/, true];
|
|
60
|
-
});
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
let field = new field_1.Field(field_pb_1.FieldProto.TRADE_DATE);
|
|
21
|
+
expect(field.getName()).toBe("TRADE_DATE");
|
|
22
|
+
return true;
|
|
61
23
|
});
|
|
62
24
|
}
|
|
63
25
|
//# sourceMappingURL=field.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.test.js","sourceRoot":"","sources":["field.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.test.js","sourceRoot":"","sources":["field.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2EAA0E;AAC1E,mCAAgC;AAEhC,IAAI,CAAC,wBAAwB,EAAE,GAAS,EAAE;IACtC,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC;IACzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAA,CAAC,CAAC;AAEH,SAAe,iBAAiB;;QAC5B,IAAI,KAAK,GAAU,IAAI,aAAK,CAAC,qBAAU,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
3
2
|
|
|
4
3
|
export class Field {
|
|
@@ -20,6 +19,6 @@ export class Field {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
toString(): string {
|
|
23
|
-
return
|
|
22
|
+
return "";//this.getEnumValueName();
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FieldProto } from "../../../fintekkers/models/position/field_pb";
|
|
2
|
+
import { PositionProto } from "../../../fintekkers/models/position/position_pb";
|
|
3
|
+
import { FieldMapEntry, MeasureMapEntry } from "../../../fintekkers/models/position/position_util_pb";
|
|
4
|
+
import Portfolio from "../portfolio/portfolio";
|
|
5
|
+
import Security from "../security/security";
|
|
6
|
+
import { MeasureProto } from "../../../fintekkers/models/position/measure_pb";
|
|
7
|
+
import Decimal from "decimal.js";
|
|
8
|
+
import { ProtoEnum } from "../utils/protoEnum";
|
|
9
|
+
import { UUID } from "../utils/uuid";
|
|
10
|
+
import { ZonedDateTime } from "../utils/datetime";
|
|
11
|
+
import { PriceProto } from "../../../fintekkers/models/price/price_pb";
|
|
12
|
+
export declare class Position {
|
|
13
|
+
proto: PositionProto;
|
|
14
|
+
constructor(positionProto: PositionProto);
|
|
15
|
+
/*** */
|
|
16
|
+
toJSON(): any;
|
|
17
|
+
/**
|
|
18
|
+
* Experimental impelementaiton
|
|
19
|
+
* @param binary An array which is the raw binary of the proto object
|
|
20
|
+
* @returns A Position object with the deserialized binary inside it
|
|
21
|
+
*/
|
|
22
|
+
static fromJSON(json: any): Position;
|
|
23
|
+
getFieldValue(field: FieldProto): any;
|
|
24
|
+
getField(fieldToGet: FieldMapEntry): string | ProtoEnum | Security | Portfolio | UUID | Date | ZonedDateTime | number | PriceProto;
|
|
25
|
+
getMeasureValue(measure: MeasureProto): Decimal;
|
|
26
|
+
private getMeasure;
|
|
27
|
+
getFieldDisplay(fieldToGet: FieldMapEntry): string;
|
|
28
|
+
getMeasures(): MeasureMapEntry[];
|
|
29
|
+
getFields(): FieldMapEntry[];
|
|
30
|
+
toString(): string;
|
|
31
|
+
static unpackField(fieldToUnpack: FieldMapEntry): any;
|
|
32
|
+
}
|
|
@@ -1,70 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Position = void 0;
|
|
4
7
|
//Models
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
9
|
+
const position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
10
|
+
const position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
11
|
+
const portfolio_1 = __importDefault(require("../portfolio/portfolio"));
|
|
12
|
+
const security_1 = __importDefault(require("../security/security"));
|
|
13
|
+
const measure_pb_1 = require("../../../fintekkers/models/position/measure_pb");
|
|
14
|
+
const serialization_1 = require("../utils/serialization");
|
|
15
|
+
const protoEnum_1 = require("../utils/protoEnum");
|
|
16
|
+
const field_1 = require("./field");
|
|
17
|
+
const uuid_1 = require("../utils/uuid");
|
|
18
|
+
const datetime_1 = require("../utils/datetime");
|
|
19
|
+
const price_pb_1 = require("../../../fintekkers/models/price/price_pb");
|
|
20
|
+
const transaction_1 = __importDefault(require("../transaction/transaction"));
|
|
21
|
+
const uuid_pb_1 = require("../../../fintekkers/models/util/uuid_pb");
|
|
22
|
+
const local_timestamp_pb_1 = require("../../../fintekkers/models/util/local_timestamp_pb");
|
|
23
|
+
const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
24
|
+
const identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
|
|
25
|
+
const strategy_pb_1 = require("../../../fintekkers/models/strategy/strategy_pb");
|
|
26
|
+
const tenor_pb_1 = require("../../../fintekkers/models/security/tenor_pb");
|
|
27
|
+
const portfolio_pb_1 = require("../../../fintekkers/models/portfolio/portfolio_pb");
|
|
28
|
+
const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
29
|
+
const wrappers_pb_1 = require("google-protobuf/google/protobuf/wrappers_pb");
|
|
30
|
+
class Position {
|
|
31
|
+
constructor(positionProto) {
|
|
29
32
|
this.proto = positionProto;
|
|
30
33
|
}
|
|
31
34
|
/*** */
|
|
32
|
-
|
|
35
|
+
toJSON() {
|
|
33
36
|
return {
|
|
34
37
|
proto: this.proto.serializeBinary(), // Serialize Age object to binary buffer
|
|
35
38
|
};
|
|
36
|
-
}
|
|
39
|
+
}
|
|
37
40
|
/**
|
|
38
41
|
* Experimental impelementaiton
|
|
39
42
|
* @param binary An array which is the raw binary of the proto object
|
|
40
43
|
* @returns A Position object with the deserialized binary inside it
|
|
41
44
|
*/
|
|
42
|
-
|
|
45
|
+
static fromJSON(json) {
|
|
43
46
|
return new Position(position_pb_1.PositionProto.deserializeBinary(json['proto']));
|
|
44
|
-
}
|
|
45
|
-
|
|
47
|
+
}
|
|
48
|
+
getFieldValue(field) {
|
|
46
49
|
return this.getField(new position_util_pb_1.FieldMapEntry().setField(field));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
for (
|
|
50
|
-
var tmpField = _a[_i];
|
|
50
|
+
}
|
|
51
|
+
getField(fieldToGet) {
|
|
52
|
+
for (const tmpField of this.proto.getFieldsList()) {
|
|
51
53
|
if (tmpField.getField() === fieldToGet.getField()) {
|
|
52
54
|
if (tmpField.getStringValue() !== undefined && tmpField.getStringValue().length > 0) {
|
|
53
55
|
return tmpField.getStringValue();
|
|
54
56
|
}
|
|
55
57
|
if (tmpField.getEnumValue() > 0) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
let fieldName = new field_1.Field(fieldToGet.getField()).getName();
|
|
59
|
+
let proto = protoEnum_1.ProtoEnum.fromEnumName(fieldName, tmpField.getEnumValue());
|
|
58
60
|
return proto;
|
|
59
61
|
}
|
|
60
62
|
else if (tmpField.getEnumValue() == 0 && !tmpField.getStringValue() &&
|
|
61
63
|
!tmpField.getFieldValuePacked()) {
|
|
62
64
|
console.log("Warning: this position has an undefined enum value, which should be fixed in upstream data");
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
let fieldName = new field_1.Field(fieldToGet.getField()).getName();
|
|
66
|
+
let proto = protoEnum_1.ProtoEnum.fromEnumName(fieldName, 0);
|
|
65
67
|
return proto;
|
|
66
68
|
}
|
|
67
|
-
|
|
69
|
+
const unpackedValue = Position.unpackField(tmpField);
|
|
68
70
|
if (field_pb_1.FieldProto.PRICE == fieldToGet.getField()
|
|
69
71
|
|| field_pb_1.FieldProto.TENOR == fieldToGet.getField()) {
|
|
70
72
|
return unpackedValue; //instanceof PriceProto || TenorProto
|
|
@@ -79,21 +81,20 @@ var Position = /** @class */ (function () {
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
throw new Error("Could not find field in position");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
+
}
|
|
85
|
+
getMeasureValue(measure) {
|
|
84
86
|
return this.getMeasure(new position_util_pb_1.MeasureMapEntry().setMeasure(measure));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
for (
|
|
88
|
-
var tmpMeasure = _a[_i];
|
|
87
|
+
}
|
|
88
|
+
getMeasure(measureToGet) {
|
|
89
|
+
for (const tmpMeasure of this.proto.getMeasuresList()) {
|
|
89
90
|
if (tmpMeasure.getMeasure() === measureToGet.getMeasure()) {
|
|
90
91
|
return serialization_1.ProtoSerializationUtil.deserialize(tmpMeasure.getMeasureDecimalValue());
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
throw new Error("Could not find measure in position");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
}
|
|
96
|
+
getFieldDisplay(fieldToGet) {
|
|
97
|
+
const value = this.getField(fieldToGet);
|
|
97
98
|
switch (typeof value) {
|
|
98
99
|
case 'string':
|
|
99
100
|
return value;
|
|
@@ -107,7 +108,10 @@ var Position = /** @class */ (function () {
|
|
|
107
108
|
return value.getPortfolioName();
|
|
108
109
|
}
|
|
109
110
|
else if (value instanceof price_pb_1.PriceProto) {
|
|
110
|
-
|
|
111
|
+
const uuid = value.getUuid();
|
|
112
|
+
if (!uuid)
|
|
113
|
+
throw new Error("Price UUID is required");
|
|
114
|
+
return uuid_1.UUID.fromU8Array(uuid.getRawUuid_asU8()).toString();
|
|
111
115
|
}
|
|
112
116
|
else if (value instanceof transaction_1.default) {
|
|
113
117
|
return value.toString();
|
|
@@ -116,10 +120,10 @@ var Position = /** @class */ (function () {
|
|
|
116
120
|
return value.toString();
|
|
117
121
|
}
|
|
118
122
|
else if (value instanceof Date) {
|
|
119
|
-
return
|
|
123
|
+
return `${value.getFullYear()}/${value.getMonth()}/${value.getDay()}`;
|
|
120
124
|
}
|
|
121
125
|
else if (value instanceof datetime_1.ZonedDateTime) {
|
|
122
|
-
|
|
126
|
+
const tmpDateTime = value.toDateTime();
|
|
123
127
|
return tmpDateTime.toFormat('yyyy/MM/dd hh:mm:ss');
|
|
124
128
|
}
|
|
125
129
|
else if (value instanceof protoEnum_1.ProtoEnum) {
|
|
@@ -129,37 +133,40 @@ var Position = /** @class */ (function () {
|
|
|
129
133
|
default:
|
|
130
134
|
return "Can't display this field: " + fieldToGet.getField();
|
|
131
135
|
}
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
return "Unknown field type";
|
|
137
|
+
}
|
|
138
|
+
getMeasures() {
|
|
134
139
|
return this.proto.getMeasuresList();
|
|
135
|
-
}
|
|
136
|
-
|
|
140
|
+
}
|
|
141
|
+
getFields() {
|
|
137
142
|
return this.proto.getFieldsList();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
for (
|
|
142
|
-
|
|
143
|
-
output +=
|
|
144
|
-
output += "".concat(this.getFieldDisplay(field), ";");
|
|
143
|
+
}
|
|
144
|
+
toString() {
|
|
145
|
+
let output = "";
|
|
146
|
+
for (const field of this.getFields()) {
|
|
147
|
+
output += `${field_pb_1.FieldProto[field.getField()]},`;
|
|
148
|
+
output += `${this.getFieldDisplay(field)};`;
|
|
145
149
|
}
|
|
146
|
-
for (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
output += "".concat(tmp.toString(), ";");
|
|
150
|
+
for (const measure of this.getMeasures()) {
|
|
151
|
+
output += `${measure_pb_1.MeasureProto[measure.getMeasure()]},`;
|
|
152
|
+
const tmp = this.getMeasure(measure);
|
|
153
|
+
output += `${tmp.toString()};`;
|
|
151
154
|
}
|
|
152
155
|
return output;
|
|
153
|
-
}
|
|
154
|
-
|
|
156
|
+
}
|
|
157
|
+
static unpackField(fieldToUnpack) {
|
|
158
|
+
const packedValue = fieldToUnpack.getFieldValuePacked();
|
|
159
|
+
if (!packedValue)
|
|
160
|
+
throw new Error("Field value is required");
|
|
161
|
+
const binaryValue = packedValue.getValue();
|
|
155
162
|
switch (fieldToUnpack.getField()) {
|
|
156
163
|
case field_pb_1.FieldProto.PORTFOLIO_ID:
|
|
157
164
|
case field_pb_1.FieldProto.SECURITY_ID:
|
|
158
165
|
case field_pb_1.FieldProto.PRICE_ID:
|
|
159
166
|
case field_pb_1.FieldProto.ID:
|
|
160
|
-
return uuid_pb_1.UUIDProto.deserializeBinary(
|
|
167
|
+
return uuid_pb_1.UUIDProto.deserializeBinary(binaryValue);
|
|
161
168
|
case field_pb_1.FieldProto.AS_OF:
|
|
162
|
-
return local_timestamp_pb_1.LocalTimestampProto.deserializeBinary(
|
|
169
|
+
return local_timestamp_pb_1.LocalTimestampProto.deserializeBinary(binaryValue);
|
|
163
170
|
case field_pb_1.FieldProto.TRADE_DATE:
|
|
164
171
|
case field_pb_1.FieldProto.MATURITY_DATE:
|
|
165
172
|
case field_pb_1.FieldProto.ISSUE_DATE:
|
|
@@ -167,15 +174,15 @@ var Position = /** @class */ (function () {
|
|
|
167
174
|
case field_pb_1.FieldProto.TAX_LOT_OPEN_DATE:
|
|
168
175
|
case field_pb_1.FieldProto.TAX_LOT_CLOSE_DATE:
|
|
169
176
|
case field_pb_1.FieldProto.EFFECTIVE_DATE:
|
|
170
|
-
return local_date_pb_1.LocalDateProto.deserializeBinary(
|
|
177
|
+
return local_date_pb_1.LocalDateProto.deserializeBinary(binaryValue);
|
|
171
178
|
case field_pb_1.FieldProto.IDENTIFIER:
|
|
172
|
-
return identifier_pb_1.IdentifierProto.deserializeBinary(
|
|
179
|
+
return identifier_pb_1.IdentifierProto.deserializeBinary(binaryValue);
|
|
173
180
|
case field_pb_1.FieldProto.STRATEGY:
|
|
174
|
-
return strategy_pb_1.StrategyProto.deserializeBinary(
|
|
181
|
+
return strategy_pb_1.StrategyProto.deserializeBinary(binaryValue);
|
|
175
182
|
case field_pb_1.FieldProto.TENOR:
|
|
176
|
-
return tenor_pb_1.TenorProto.deserializeBinary(
|
|
183
|
+
return tenor_pb_1.TenorProto.deserializeBinary(binaryValue);
|
|
177
184
|
case field_pb_1.FieldProto.PRICE:
|
|
178
|
-
return price_pb_1.PriceProto.deserializeBinary(
|
|
185
|
+
return price_pb_1.PriceProto.deserializeBinary(binaryValue);
|
|
179
186
|
case field_pb_1.FieldProto.TRANSACTION_TYPE:
|
|
180
187
|
case field_pb_1.FieldProto.POSITION_STATUS:
|
|
181
188
|
return fieldToUnpack;
|
|
@@ -186,20 +193,19 @@ var Position = /** @class */ (function () {
|
|
|
186
193
|
case field_pb_1.FieldProto.PRODUCT_TYPE:
|
|
187
194
|
case field_pb_1.FieldProto.PRODUCT_CLASS:
|
|
188
195
|
case field_pb_1.FieldProto.ASSET_CLASS:
|
|
189
|
-
return wrappers_pb_1.StringValue.deserializeBinary(
|
|
196
|
+
return wrappers_pb_1.StringValue.deserializeBinary(binaryValue);
|
|
190
197
|
case field_pb_1.FieldProto.PORTFOLIO:
|
|
191
|
-
return portfolio_pb_1.PortfolioProto.deserializeBinary(
|
|
198
|
+
return portfolio_pb_1.PortfolioProto.deserializeBinary(binaryValue);
|
|
192
199
|
case field_pb_1.FieldProto.SECURITY:
|
|
193
200
|
case field_pb_1.FieldProto.CASH_IMPACT_SECURITY:
|
|
194
|
-
return security_pb_1.SecurityProto.deserializeBinary(
|
|
201
|
+
return security_pb_1.SecurityProto.deserializeBinary(binaryValue);
|
|
195
202
|
case field_pb_1.FieldProto.IS_CANCELLED:
|
|
196
203
|
console.log("Need to check that IS_CANCELLED IS SUPPORTED CORRECTLY");
|
|
197
|
-
return
|
|
204
|
+
return packedValue;
|
|
198
205
|
default:
|
|
199
|
-
throw new Error(
|
|
206
|
+
throw new Error(`Field not found. Could not unpack ${field_pb_1.FieldProto[fieldToUnpack.getField()]}. Mapping missing`);
|
|
200
207
|
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
}());
|
|
208
|
+
}
|
|
209
|
+
}
|
|
204
210
|
exports.Position = Position;
|
|
205
211
|
//# sourceMappingURL=position.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":";;;;;;AAAA,QAAQ;AACR,2EAA0E;AAC1E,iFAAgF;AAChF,2FAAsG;AACtG,uEAA+C;AAC/C,oEAA4C;AAC5C,+EAA8E;AAE9E,0DAAgE;AAChE,kDAA+C;AAC/C,mCAAgC;AAChC,wCAAqC;AACrC,gDAAkD;AAClD,wEAAuE;AACvE,6EAAqD;AAErD,qEAAoE;AAC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