@fintekkers/ledger-models 0.1.118 → 0.1.128
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/.npmrc.example +4 -0
- package/catalog/fields.json +275 -0
- package/catalog/measures.json +259 -0
- package/node/fintekkers/models/portfolio/portfolio_pb.js +13 -19
- package/node/fintekkers/models/position/field_pb.js +1 -7
- package/node/fintekkers/models/position/measure_pb.d.ts +18 -0
- package/node/fintekkers/models/position/measure_pb.js +20 -8
- package/node/fintekkers/models/position/position_filter_pb.js +7 -13
- package/node/fintekkers/models/position/position_pb.d.ts +7 -0
- package/node/fintekkers/models/position/position_pb.js +64 -17
- package/node/fintekkers/models/position/position_status_pb.js +1 -7
- package/node/fintekkers/models/position/position_util_pb.js +11 -17
- package/node/fintekkers/models/price/price_pb.d.ts +4 -0
- package/node/fintekkers/models/price/price_pb.js +45 -19
- package/node/fintekkers/models/price/price_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/price/price_type_pb.d.ts +15 -0
- package/node/fintekkers/models/price/price_type_pb.js +30 -0
- package/node/fintekkers/models/security/bond/auction_type_pb.js +1 -7
- package/node/fintekkers/models/security/bond/issuance_pb.js +17 -23
- package/node/fintekkers/models/security/coupon_frequency_pb.js +1 -7
- package/node/fintekkers/models/security/coupon_type_pb.js +1 -7
- package/node/fintekkers/models/security/identifier/identifier_pb.js +9 -15
- package/node/fintekkers/models/security/identifier/identifier_type_pb.d.ts +1 -0
- package/node/fintekkers/models/security/identifier/identifier_type_pb.js +2 -7
- package/node/fintekkers/models/security/index/index_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/index/index_type_pb.d.ts +22 -0
- package/node/fintekkers/models/security/index/index_type_pb.js +37 -0
- package/node/fintekkers/models/security/index_composition_pb.d.ts +126 -0
- package/node/fintekkers/models/security/index_composition_pb.js +992 -0
- package/node/fintekkers/models/security/security_pb.d.ts +382 -0
- package/node/fintekkers/models/security/security_pb.js +3183 -57
- package/node/fintekkers/models/security/security_quantity_type_pb.js +1 -7
- package/node/fintekkers/models/security/security_type_pb.d.ts +3 -0
- package/node/fintekkers/models/security/security_type_pb.js +5 -8
- package/node/fintekkers/models/security/tenor_pb.js +9 -15
- package/node/fintekkers/models/security/tenor_type_pb.js +1 -7
- package/node/fintekkers/models/strategy/strategy_allocation_pb.js +13 -19
- package/node/fintekkers/models/strategy/strategy_pb.js +14 -20
- package/node/fintekkers/models/transaction/transaction_pb.js +24 -30
- package/node/fintekkers/models/transaction/transaction_type_pb.js +1 -7
- package/node/fintekkers/models/util/api/api_key_pb.js +10 -16
- package/node/fintekkers/models/util/currency_pb.d.ts +27 -0
- package/node/fintekkers/models/util/currency_pb.js +170 -0
- package/node/fintekkers/models/util/date_range_pb.js +8 -14
- package/node/fintekkers/models/util/decimal_value_pb.js +4 -10
- package/node/fintekkers/models/util/endpoint_pb.js +7 -13
- package/node/fintekkers/models/util/local_date_pb.js +5 -11
- package/node/fintekkers/models/util/local_timestamp_pb.js +5 -11
- package/node/fintekkers/models/util/lock/node_partition_pb.js +9 -15
- package/node/fintekkers/models/util/lock/node_state_pb.js +10 -16
- package/node/fintekkers/models/util/uuid_pb.js +3 -9
- package/node/fintekkers/models/valuation/cashflow_pb.d.ts +57 -0
- package/node/fintekkers/models/valuation/cashflow_pb.js +401 -0
- package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.d.ts +79 -0
- package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.js +599 -0
- package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.d.ts +84 -0
- package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.js +624 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_request_pb.js +7 -13
- package/node/fintekkers/requests/portfolio/create_portfolio_response_pb.js +8 -14
- package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.js +39 -15
- package/node/fintekkers/requests/portfolio/query_portfolio_response_pb.js +8 -14
- package/node/fintekkers/requests/position/query_position_request_pb.js +15 -27
- package/node/fintekkers/requests/position/query_position_response_pb.js +10 -16
- package/node/fintekkers/requests/price/create_price_request_pb.js +7 -13
- package/node/fintekkers/requests/price/create_price_response_pb.js +8 -14
- package/node/fintekkers/requests/price/query_price_request_pb.js +12 -18
- package/node/fintekkers/requests/price/query_price_response_pb.js +8 -14
- package/node/fintekkers/requests/security/create_security_request_pb.js +7 -13
- package/node/fintekkers/requests/security/create_security_response_pb.js +9 -15
- package/node/fintekkers/requests/security/get_field_values_request_pb.js +7 -13
- package/node/fintekkers/requests/security/get_field_values_response_pb.js +7 -13
- package/node/fintekkers/requests/security/get_fields_response_pb.js +8 -17
- package/node/fintekkers/requests/security/query_security_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/security/query_security_request_pb.js +39 -15
- package/node/fintekkers/requests/security/query_security_response_pb.js +9 -15
- package/node/fintekkers/requests/transaction/create_transaction_request_pb.js +7 -13
- package/node/fintekkers/requests/transaction/create_transaction_response_pb.js +8 -14
- package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +10 -16
- package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +9 -15
- package/node/fintekkers/requests/util/delete_request_pb.d.ts +135 -0
- package/node/fintekkers/requests/util/delete_request_pb.js +1051 -0
- package/node/fintekkers/requests/util/errors/error_pb.js +7 -13
- package/node/fintekkers/requests/util/errors/message_pb.js +6 -12
- package/node/fintekkers/requests/util/errors/summary_pb.js +4 -10
- package/node/fintekkers/requests/util/lock/lock_request_pb.js +8 -14
- package/node/fintekkers/requests/util/lock/lock_response_pb.js +9 -15
- package/node/fintekkers/requests/util/operation_pb.js +1 -7
- package/node/fintekkers/requests/valuation/curve_request_pb.d.ts +85 -0
- package/node/fintekkers/requests/valuation/curve_request_pb.js +646 -0
- package/node/fintekkers/requests/valuation/curve_response_pb.d.ts +105 -0
- package/node/fintekkers/requests/valuation/curve_response_pb.js +806 -0
- package/node/fintekkers/requests/valuation/product_inputs.test.ts +172 -0
- package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +137 -0
- package/node/fintekkers/requests/valuation/product_inputs_pb.js +987 -0
- package/node/fintekkers/requests/valuation/valuation_request_pb.d.ts +19 -0
- package/node/fintekkers/requests/valuation/valuation_request_pb.js +168 -22
- package/node/fintekkers/requests/valuation/valuation_response_pb.d.ts +13 -0
- package/node/fintekkers/requests/valuation/valuation_response_pb.js +118 -16
- package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.d.ts +60 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.js +87 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_pb.d.ts +9 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_pb.js +21 -0
- package/node/fintekkers/services/lock-service/lock_service_grpc_pb.js +22 -22
- package/node/fintekkers/services/lock-service/lock_service_pb.js +15 -21
- package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.d.ts +18 -0
- package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.js +39 -5
- package/node/fintekkers/services/portfolio-service/portfolio_service_pb.d.ts +1 -0
- package/node/fintekkers/services/portfolio-service/portfolio_service_pb.js +3 -7
- package/node/fintekkers/services/position-service/position_service_grpc_pb.d.ts +37 -0
- package/node/fintekkers/services/position-service/position_service_grpc_pb.js +64 -6
- package/node/fintekkers/services/position-service/position_service_pb.d.ts +3 -0
- package/node/fintekkers/services/position-service/position_service_pb.js +7 -7
- package/node/fintekkers/services/price-service/price_service_grpc_pb.js +5 -5
- package/node/fintekkers/services/price-service/price_service_pb.js +1 -7
- package/node/fintekkers/services/security-service/security_service_grpc_pb.d.ts +18 -0
- package/node/fintekkers/services/security-service/security_service_grpc_pb.js +43 -9
- package/node/fintekkers/services/security-service/security_service_pb.d.ts +1 -0
- package/node/fintekkers/services/security-service/security_service_pb.js +3 -7
- package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.d.ts +55 -0
- package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.js +97 -5
- package/node/fintekkers/services/transaction-service/transaction_service_pb.d.ts +4 -0
- package/node/fintekkers/services/transaction-service/transaction_service_pb.js +9 -7
- package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.d.ts +19 -0
- package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.js +37 -2
- package/node/fintekkers/services/valuation-service/valuation_service_pb.d.ts +2 -0
- package/node/fintekkers/services/valuation-service/valuation_service_pb.js +5 -7
- package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
- package/node/wrappers/models/portfolio/portfolio.test.d.ts +2 -0
- package/node/wrappers/models/portfolio/portfolio.test.js +29 -0
- package/node/wrappers/models/portfolio/portfolio.test.js.map +1 -0
- package/node/wrappers/models/portfolio/portfolio.test.ts +28 -0
- package/node/wrappers/models/position/position.js +25 -13
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.js +20 -0
- package/node/wrappers/models/position/position.test.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +23 -0
- package/node/wrappers/models/position/position.ts +27 -13
- package/node/wrappers/models/position/positionfilter.js +1 -1
- package/node/wrappers/models/position/positionfilter.js.map +1 -1
- package/node/wrappers/models/position/positionfilter.test.js.map +1 -1
- package/node/wrappers/models/price/Price.cash.test.d.ts +1 -0
- package/node/wrappers/models/price/Price.cash.test.js +42 -0
- package/node/wrappers/models/price/Price.cash.test.js.map +1 -0
- package/node/wrappers/models/price/Price.cash.test.ts +43 -0
- package/node/wrappers/models/price/Price.d.ts +38 -0
- package/node/wrappers/models/price/Price.js +111 -0
- package/node/wrappers/models/price/Price.js.map +1 -0
- package/node/wrappers/models/price/Price.test.d.ts +1 -0
- package/node/wrappers/models/price/Price.test.js +55 -0
- package/node/wrappers/models/price/Price.test.js.map +1 -0
- package/node/wrappers/models/price/Price.test.ts +63 -0
- package/node/wrappers/models/price/Price.ts +123 -0
- package/node/wrappers/models/security/BondSecurity.d.ts +17 -2
- package/node/wrappers/models/security/BondSecurity.js +59 -11
- package/node/wrappers/models/security/BondSecurity.js.map +1 -1
- package/node/wrappers/models/security/BondSecurity.priceScale.test.d.ts +1 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.js +36 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.js.map +1 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.ts +36 -0
- package/node/wrappers/models/security/BondSecurity.test.js +34 -1
- package/node/wrappers/models/security/BondSecurity.test.js.map +1 -1
- package/node/wrappers/models/security/BondSecurity.test.ts +42 -1
- package/node/wrappers/models/security/BondSecurity.ts +63 -11
- package/node/wrappers/models/security/security-roundtrip.test.d.ts +1 -0
- package/node/wrappers/models/security/security-roundtrip.test.js +173 -0
- package/node/wrappers/models/security/security-roundtrip.test.js.map +1 -0
- package/node/wrappers/models/security/security-roundtrip.test.ts +192 -0
- package/node/wrappers/models/security/security.d.ts +8 -0
- package/node/wrappers/models/security/security.js +24 -2
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.ts +26 -2
- package/node/wrappers/models/security/term.js +31 -6
- package/node/wrappers/models/security/term.js.map +1 -1
- package/node/wrappers/models/security/term.test.js +21 -2
- package/node/wrappers/models/security/term.test.js.map +1 -1
- package/node/wrappers/models/security/term.test.ts +28 -2
- package/node/wrappers/models/security/term.ts +34 -6
- package/node/wrappers/models/transaction/transaction.d.ts +59 -1
- package/node/wrappers/models/transaction/transaction.derived.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction.derived.test.js +199 -0
- package/node/wrappers/models/transaction/transaction.derived.test.js.map +1 -0
- package/node/wrappers/models/transaction/transaction.derived.test.ts +251 -0
- package/node/wrappers/models/transaction/transaction.js +350 -2
- package/node/wrappers/models/transaction/transaction.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.ts +416 -2
- package/node/wrappers/models/transaction/transaction_constructor.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.js +100 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.js.map +1 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.ts +111 -0
- package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
- package/node/wrappers/models/utils/datetime.d.ts +6 -0
- package/node/wrappers/models/utils/datetime.js +14 -6
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.ts +15 -6
- package/node/wrappers/models/utils/protoEnum.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.d.ts +17 -3
- package/node/wrappers/models/utils/requestcontext.js +39 -7
- package/node/wrappers/models/utils/requestcontext.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.test.d.ts +1 -0
- package/node/wrappers/models/utils/requestcontext.test.js +108 -0
- package/node/wrappers/models/utils/requestcontext.test.js.map +1 -0
- package/node/wrappers/models/utils/requestcontext.test.ts +85 -0
- package/node/wrappers/models/utils/requestcontext.ts +49 -9
- package/node/wrappers/models/utils/serialization.d.ts +2 -1
- package/node/wrappers/models/utils/serialization.js +4 -0
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.js +15 -0
- package/node/wrappers/models/utils/serialization.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.ts +19 -1
- package/node/wrappers/models/utils/serialization.ts +5 -4
- package/node/wrappers/models/utils/serialization.util.js.map +1 -1
- package/node/wrappers/models/utils/uuid.js +9 -1
- package/node/wrappers/models/utils/uuid.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.js +22 -4
- package/node/wrappers/models/utils/uuid.test.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.ts +26 -5
- package/node/wrappers/models/utils/uuid.ts +7 -1
- package/node/wrappers/services/apikey.test.d.ts +7 -0
- package/node/wrappers/services/apikey.test.js +56 -0
- package/node/wrappers/services/apikey.test.js.map +1 -0
- package/node/wrappers/services/apikey.test.ts +65 -0
- package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.js +8 -2
- package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.ts +7 -2
- package/node/wrappers/services/position-service/PositionService.d.ts +1 -1
- package/node/wrappers/services/position-service/PositionService.js +8 -2
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.ts +7 -2
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/price-service/PriceService.d.ts +29 -0
- package/node/wrappers/services/price-service/PriceService.js +151 -0
- package/node/wrappers/services/price-service/PriceService.js.map +1 -0
- package/node/wrappers/services/price-service/PriceService.ts +127 -0
- package/node/wrappers/services/price-service/price-wrapper.test.d.ts +1 -0
- package/node/wrappers/services/price-service/price-wrapper.test.js +132 -0
- package/node/wrappers/services/price-service/price-wrapper.test.js.map +1 -0
- package/node/wrappers/services/price-service/price-wrapper.test.ts +120 -0
- package/node/wrappers/services/price-service/price.test.d.ts +1 -0
- package/node/wrappers/services/price-service/price.test.js +198 -0
- package/node/wrappers/services/price-service/price.test.js.map +1 -0
- package/node/wrappers/services/price-service/price.test.ts +205 -0
- package/node/wrappers/services/security-service/SecurityService.d.ts +1 -1
- package/node/wrappers/services/security-service/SecurityService.js +8 -2
- package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.d.ts +1 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js +38 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js.map +1 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.ts +32 -0
- package/node/wrappers/services/security-service/SecurityService.ts +7 -2
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.d.ts +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.js +8 -2
- package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.ts +7 -2
- package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
- package/package.json +3 -2
- package/.env +0 -3
|
@@ -6,6 +6,7 @@ const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_valu
|
|
|
6
6
|
const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
7
7
|
const local_timestamp_pb_1 = require("../../../fintekkers/models/util/local_timestamp_pb");
|
|
8
8
|
const uuid_pb_1 = require("../../../fintekkers/models/util/uuid_pb");
|
|
9
|
+
const strategy_allocation_pb_1 = require("../../../fintekkers/models/strategy/strategy_allocation_pb");
|
|
9
10
|
const datetime_1 = require("./datetime");
|
|
10
11
|
const protoEnum_1 = require("./protoEnum");
|
|
11
12
|
const uuid_1 = require("./uuid");
|
|
@@ -60,6 +61,9 @@ class ProtoSerializationUtil {
|
|
|
60
61
|
if (obj !== null && 'enum_name' in obj && typeof obj.enum_name !== 'undefined' && obj.enum_name !== null) {
|
|
61
62
|
return new protoEnum_1.ProtoEnum(obj.descriptor, obj.enum_value);
|
|
62
63
|
}
|
|
64
|
+
if (obj instanceof strategy_allocation_pb_1.StrategyAllocationProto) {
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
63
67
|
throw new Error(`Could not deserialize object of type ${typeof obj}. Value: ${obj}`);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["serialization.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["serialization.ts"],"names":[],"mappings":";;;AAAA,gGAA+F;AAC/F,uFAAqF;AACrF,iFAA+E;AAC/E,2FAAyF;AACzF,qEAAoE;AACpE,uGAAqG;AACrG,yCAA2C;AAC3C,2CAAwC;AACxC,iCAA8B;AAC9B,6EAA0E;AAC1E,uDAAoD;AAEpD,MAAa,sBAAsB;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;YACvE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1B,OAAO,IAAI,CAAC;SACb;QACD,IAAI,GAAG,YAAY,wCAAmB,EAAE;YACtC,OAAO,IAAI,wBAAa,CAAC,GAAG,CAAC,CAAC;SAC/B;QACD,IAAI,GAAG,YAAY,+BAAe,EAAE;YAClC,OAAO,IAAI,uBAAU,CAAC,GAAG,CAAC,CAAC;SAC5B;QACD,IAAI,GAAG,YAAY,oCAAiB,EAAE;YACpC,OAAO,UAAU,CAAC,GAAG,CAAC,0BAA0B,EAAE,CAAC,CAAC;SACrD;QACD,IAAI,GAAG,YAAY,yBAAW,EAAE;YAC9B,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QACD,IAAI,GAAG,KAAK,IAAI,IAAI,WAAW,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,WAAW,IAAI,GAAG,CAAC,SAAS,KAAK,IAAI,EAAE;YACxG,OAAO,IAAI,qBAAS,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;SACtD;QACD,IAAI,GAAG,YAAY,gDAAuB,EAAE;YAC1C,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,OAAO,GAAG,YAAY,GAAG,EAAE,CAAC,CAAC;IACvF,CAAC;CACF;AAzDD,wDAyDC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const strategy_allocation_pb_1 = require("../../../fintekkers/models/strategy/strategy_allocation_pb");
|
|
3
4
|
const serialization_1 = require("./serialization");
|
|
4
5
|
const uuid_1 = require("./uuid");
|
|
5
6
|
const assert = require("assert");
|
|
6
7
|
test('test serialization of key types', () => {
|
|
7
8
|
testSerialization();
|
|
8
9
|
});
|
|
10
|
+
test('test deserialize StrategyAllocationProto', () => {
|
|
11
|
+
checkStrategyAllocationProtoDeserialize();
|
|
12
|
+
});
|
|
9
13
|
function testSerialization() {
|
|
10
14
|
checkUUID();
|
|
11
15
|
const march2023 = new Date(2023, 2, 5); //Month is zero-indexed, so 2 == March.
|
|
@@ -27,4 +31,15 @@ function checkUUID() {
|
|
|
27
31
|
assert.equal(uuidString, uuidCopyString);
|
|
28
32
|
assert.deepEqual(uuid.toBytes(), uuidCopy.toBytes());
|
|
29
33
|
}
|
|
34
|
+
function checkStrategyAllocationProtoDeserialize() {
|
|
35
|
+
const proto = new strategy_allocation_pb_1.StrategyAllocationProto();
|
|
36
|
+
proto.setObjectClass('StrategyAllocation');
|
|
37
|
+
proto.setVersion('0.0.1');
|
|
38
|
+
proto.setIsLink(false);
|
|
39
|
+
const deserialized = serialization_1.ProtoSerializationUtil.deserialize(proto);
|
|
40
|
+
assert.strictEqual(deserialized, proto, 'deserialize returns same StrategyAllocationProto instance');
|
|
41
|
+
assert.equal(deserialized.getObjectClass(), 'StrategyAllocation');
|
|
42
|
+
assert.equal(deserialized.getVersion(), '0.0.1');
|
|
43
|
+
assert.equal(deserialized.getIsLink(), false);
|
|
44
|
+
}
|
|
30
45
|
//# sourceMappingURL=serialization.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.test.js","sourceRoot":"","sources":["serialization.test.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"serialization.test.js","sourceRoot":"","sources":["serialization.test.ts"],"names":[],"mappings":";;AACA,uGAAqG;AACrG,mDAAyD;AACzD,iCAA8B;AAE9B,iCAAkC;AAClC,IAAI,CAAC,iCAAiC,EAAE,GAAG,EAAE;IACzC,iBAAiB,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE;IAClD,uCAAuC,EAAE,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB;IACtB,SAAS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AAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,uCAAuC;IAC5C,MAAM,KAAK,GAAG,IAAI,gDAAuB,EAAE,CAAC;IAC5C,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;IAC3C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC1B,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,YAAY,GAAG,sCAAsB,CAAC,WAAW,CAAC,KAAK,CAA4B,CAAC;IAE1F,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,KAAK,EAAE,2DAA2D,CAAC,CAAC;IACrG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,EAAE,oBAAoB,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocalDateProto } from '../../../fintekkers/models/util/local_date_pb';
|
|
2
1
|
import { UUIDProto } from '../../../fintekkers/models/util/uuid_pb';
|
|
2
|
+
import { StrategyAllocationProto } from '../../../fintekkers/models/strategy/strategy_allocation_pb';
|
|
3
3
|
import { ProtoSerializationUtil } from './serialization';
|
|
4
4
|
import { UUID } from './uuid';
|
|
5
5
|
|
|
@@ -8,6 +8,10 @@ test('test serialization of key types', () => {
|
|
|
8
8
|
testSerialization();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
+
test('test deserialize StrategyAllocationProto', () => {
|
|
12
|
+
checkStrategyAllocationProtoDeserialize();
|
|
13
|
+
});
|
|
14
|
+
|
|
11
15
|
function testSerialization(): void {
|
|
12
16
|
checkUUID();
|
|
13
17
|
|
|
@@ -37,3 +41,17 @@ function checkUUID() {
|
|
|
37
41
|
assert.deepEqual(uuid.toBytes(), uuidCopy.toBytes());
|
|
38
42
|
}
|
|
39
43
|
|
|
44
|
+
function checkStrategyAllocationProtoDeserialize(): void {
|
|
45
|
+
const proto = new StrategyAllocationProto();
|
|
46
|
+
proto.setObjectClass('StrategyAllocation');
|
|
47
|
+
proto.setVersion('0.0.1');
|
|
48
|
+
proto.setIsLink(false);
|
|
49
|
+
|
|
50
|
+
const deserialized = ProtoSerializationUtil.deserialize(proto) as StrategyAllocationProto;
|
|
51
|
+
|
|
52
|
+
assert.strictEqual(deserialized, proto, 'deserialize returns same StrategyAllocationProto instance');
|
|
53
|
+
assert.equal(deserialized.getObjectClass(), 'StrategyAllocation');
|
|
54
|
+
assert.equal(deserialized.getVersion(), '0.0.1');
|
|
55
|
+
assert.equal(deserialized.getIsLink(), false);
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { PriceProto } from "../../../fintekkers/models/price/price_pb";
|
|
2
1
|
import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
|
|
3
2
|
import { DecimalValueProto } from "../../../fintekkers/models/util/decimal_value_pb";
|
|
4
3
|
import { LocalDateProto } from "../../../fintekkers/models/util/local_date_pb";
|
|
5
4
|
import { LocalTimestampProto } from "../../../fintekkers/models/util/local_timestamp_pb";
|
|
6
5
|
import { UUIDProto } from "../../../fintekkers/models/util/uuid_pb";
|
|
7
|
-
import {
|
|
6
|
+
import { StrategyAllocationProto } from "../../../fintekkers/models/strategy/strategy_allocation_pb";
|
|
8
7
|
import { ZonedDateTime } from "./datetime";
|
|
9
8
|
import { ProtoEnum } from "./protoEnum";
|
|
10
9
|
import { UUID } from "./uuid";
|
|
11
10
|
import { StringValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
12
|
-
import { Any } from 'google-protobuf/google/protobuf/any_pb';
|
|
13
11
|
import { Identifier } from "../security/identifier";
|
|
14
12
|
|
|
15
13
|
export class ProtoSerializationUtil {
|
|
@@ -39,7 +37,7 @@ export class ProtoSerializationUtil {
|
|
|
39
37
|
throw new Error(`Could not serialize object of type ${typeof obj}. Value: ${obj}`);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
static deserialize(obj: any): UUID | Date | ZonedDateTime | Identifier | string | number | ProtoEnum { //}: UUID | Date | ZonedDateTime | number | string {
|
|
40
|
+
static deserialize(obj: any): UUID | Date | ZonedDateTime | Identifier | string | number | ProtoEnum | StrategyAllocationProto { //}: UUID | Date | ZonedDateTime | number | string {
|
|
43
41
|
if (obj instanceof UUIDProto) {
|
|
44
42
|
return UUID.fromU8Array(obj.getRawUuid_asU8());
|
|
45
43
|
}
|
|
@@ -63,6 +61,9 @@ export class ProtoSerializationUtil {
|
|
|
63
61
|
if (obj !== null && 'enum_name' in obj && typeof obj.enum_name !== 'undefined' && obj.enum_name !== null) {
|
|
64
62
|
return new ProtoEnum(obj.descriptor, obj.enum_value);
|
|
65
63
|
}
|
|
64
|
+
if (obj instanceof StrategyAllocationProto) {
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
66
67
|
|
|
67
68
|
throw new Error(`Could not deserialize object of type ${typeof obj}. Value: ${obj}`);
|
|
68
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.util.js","sourceRoot":"","sources":["serialization.util.ts"],"names":[],"mappings":";;;AAAA,mEAA6D;AAC7D,6EAA0E;AAC1E,mDAAyD;AACzD,iFAA+E;AAC/E,yCAA2C;AAC3C,2FAAyF;AACzF,iCAA8B;AAC9B,qEAAoE;AACpE,uDAAoD;AACpD,gGAA+F;AAE/F,SAAS,IAAI,CAAC,KAAiE;IAC7E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"serialization.util.js","sourceRoot":"","sources":["serialization.util.ts"],"names":[],"mappings":";;;AAAA,mEAA6D;AAC7D,6EAA0E;A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,EAAE;QAC3E,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,OAAO,CAAC,CAAC;KAC/D;IAED,MAAM,SAAS,GAAmB,8BAAc,CAAC,iBAAiB,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IAC/F,OAAO,sCAAsB,CAAC,WAAW,CAAC,SAAS,CAAoB,CAAC;AAC1E,CAAC;AAED,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,MAAM,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;IACtC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAElC,MAAM,UAAU,GAAG,IAAI,YAAG,EAAE,CAAC;IAC7B,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,EAAE,6BAA6B,CAAC,CAAC;IAE9E,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,mBAAmB,CAAC,UAAe;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IAExC,IAAI,OAAO,KAAK,iDAAiD,EAAE;QACjE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,OAAO,CAAC,CAAC;KACpD;IAED,MAAM,UAAU,GAAG,yBAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7E,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAE1C,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -53,7 +53,15 @@ class UUID {
|
|
|
53
53
|
return id_proto;
|
|
54
54
|
}
|
|
55
55
|
equals(other) {
|
|
56
|
-
|
|
56
|
+
const a = this.bytes;
|
|
57
|
+
const b = other.toBytes();
|
|
58
|
+
if (a.length !== b.length)
|
|
59
|
+
return false;
|
|
60
|
+
for (let i = 0; i < a.length; i++) {
|
|
61
|
+
if (a[i] !== b[i])
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
57
65
|
}
|
|
58
66
|
static random() {
|
|
59
67
|
const random = uuid.v4();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["uuid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAoE;AACpE,2CAA6B;AAE7B;;;GAGG;AACH,MAAM,SAAS,GAAa,EAAE,CAAC;AAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["uuid.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAoE;AACpE,2CAA6B;AAE7B;;;GAGG;AACH,MAAM,SAAS,GAAa,EAAE,CAAC;AAE/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;IAC5B,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,IAAI;IAIR,YAAY,KAAe;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,MAAM,GAAG,GAAe,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC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OAAO,KAAK,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACjC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC;SACjC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAM;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,UAAsB;QACvC,MAAM,KAAK,GAAa,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,UAAkB;QAClC,gEAAgE;QAChE,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAE/C,oEAAoE;QACpE,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAE7C,sDAAsD;QACtD,MAAM,KAAK,GAAG,SAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAE7D,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEQ,oBAAI"}
|
|
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const assert = require("assert");
|
|
4
4
|
const uuid_1 = require("./uuid");
|
|
5
5
|
test('test packing/unpacking string', () => {
|
|
6
|
-
testString();
|
|
7
|
-
});
|
|
8
|
-
function testString() {
|
|
9
6
|
const test_uuid_bytes = [217, 98, 253, 240, 51, 225, 77, 157, 153, 155, 126, 195, 80, 240, 203, 119];
|
|
10
7
|
const test_uuid = new uuid_1.UUID(test_uuid_bytes);
|
|
11
8
|
assert(test_uuid.toString() == 'd962fdf0-33e1-4d9d-999b-7ec350f0cb77');
|
|
@@ -13,5 +10,26 @@ function testString() {
|
|
|
13
10
|
assert(test_uuid_bytes.length === test_uuid_bytes_copy.length &&
|
|
14
11
|
test_uuid_bytes.every((value, index) => value === test_uuid_bytes_copy[index]));
|
|
15
12
|
assert(uuid_1.UUID.random().toString().length == 36);
|
|
16
|
-
}
|
|
13
|
+
});
|
|
14
|
+
test('equals returns true for identical UUIDs', () => {
|
|
15
|
+
const bytes = [217, 98, 253, 240, 51, 225, 77, 157, 153, 155, 126, 195, 80, 240, 203, 119];
|
|
16
|
+
const uuid1 = new uuid_1.UUID(bytes);
|
|
17
|
+
const uuid2 = new uuid_1.UUID([...bytes]);
|
|
18
|
+
assert(uuid1.equals(uuid2));
|
|
19
|
+
});
|
|
20
|
+
test('equals returns false for different UUIDs', () => {
|
|
21
|
+
const uuid1 = uuid_1.UUID.random();
|
|
22
|
+
const uuid2 = uuid_1.UUID.random();
|
|
23
|
+
assert(!uuid1.equals(uuid2));
|
|
24
|
+
});
|
|
25
|
+
test('equals works with round-tripped UUIDs', () => {
|
|
26
|
+
const original = uuid_1.UUID.random();
|
|
27
|
+
const proto = original.toUUIDProto();
|
|
28
|
+
const restored = uuid_1.UUID.fromU8Array(proto.getRawUuid_asU8());
|
|
29
|
+
assert(original.equals(restored));
|
|
30
|
+
});
|
|
31
|
+
test('equals returns true for same instance', () => {
|
|
32
|
+
const uuid = uuid_1.UUID.random();
|
|
33
|
+
assert(uuid.equals(uuid));
|
|
34
|
+
});
|
|
17
35
|
//# sourceMappingURL=uuid.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.test.js","sourceRoot":"","sources":["uuid.test.ts"],"names":[],"mappings":";;AAAA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,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3F,MAAM,KAAK,GAAG,IAAI,WAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,WAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACpD,MAAM,KAAK,GAAG,WAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,WAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACjD,MAAM,QAAQ,GAAG,WAAI,CAAC,MAAM,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,WAAI,CAAC,WAAW,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACjD,MAAM,IAAI,GAAG,WAAI,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
|
|
@@ -2,10 +2,6 @@ import assert = require('assert');
|
|
|
2
2
|
import { UUID } from './uuid';
|
|
3
3
|
|
|
4
4
|
test('test packing/unpacking string', () => {
|
|
5
|
-
testString();
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
function testString() {
|
|
9
5
|
const test_uuid_bytes = [217, 98, 253, 240, 51, 225, 77, 157, 153, 155, 126, 195, 80, 240, 203, 119];
|
|
10
6
|
const test_uuid = new UUID(test_uuid_bytes);
|
|
11
7
|
assert(test_uuid.toString() == 'd962fdf0-33e1-4d9d-999b-7ec350f0cb77');
|
|
@@ -17,5 +13,30 @@ function testString() {
|
|
|
17
13
|
);
|
|
18
14
|
|
|
19
15
|
assert(UUID.random().toString().length == 36);
|
|
20
|
-
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('equals returns true for identical UUIDs', () => {
|
|
19
|
+
const bytes = [217, 98, 253, 240, 51, 225, 77, 157, 153, 155, 126, 195, 80, 240, 203, 119];
|
|
20
|
+
const uuid1 = new UUID(bytes);
|
|
21
|
+
const uuid2 = new UUID([...bytes]);
|
|
22
|
+
assert(uuid1.equals(uuid2));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('equals returns false for different UUIDs', () => {
|
|
26
|
+
const uuid1 = UUID.random();
|
|
27
|
+
const uuid2 = UUID.random();
|
|
28
|
+
assert(!uuid1.equals(uuid2));
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('equals works with round-tripped UUIDs', () => {
|
|
32
|
+
const original = UUID.random();
|
|
33
|
+
const proto = original.toUUIDProto();
|
|
34
|
+
const restored = UUID.fromU8Array(proto.getRawUuid_asU8());
|
|
35
|
+
assert(original.equals(restored));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('equals returns true for same instance', () => {
|
|
39
|
+
const uuid = UUID.random();
|
|
40
|
+
assert(uuid.equals(uuid));
|
|
41
|
+
});
|
|
21
42
|
|
|
@@ -37,7 +37,13 @@ class UUID {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
equals(other: UUID): boolean {
|
|
40
|
-
|
|
40
|
+
const a = this.bytes;
|
|
41
|
+
const b = other.toBytes();
|
|
42
|
+
if (a.length !== b.length) return false;
|
|
43
|
+
for (let i = 0; i < a.length; i++) {
|
|
44
|
+
if (a[i] !== b[i]) return false;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
static random(): UUID {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Unit tests for Issue #114: all wrapper services accept optional apiKey constructor param.
|
|
4
|
+
*
|
|
5
|
+
* These tests do NOT require a running gRPC server — they only verify that the
|
|
6
|
+
* constructor does not throw and that the client is created.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const PortfolioService_1 = require("./portfolio-service/PortfolioService");
|
|
10
|
+
const PositionService_1 = require("./position-service/PositionService");
|
|
11
|
+
const PriceService_1 = require("./price-service/PriceService");
|
|
12
|
+
const SecurityService_1 = require("./security-service/SecurityService");
|
|
13
|
+
const TransactionService_1 = require("./transaction-service/TransactionService");
|
|
14
|
+
// No server connection is made in constructors — gRPC connects lazily.
|
|
15
|
+
// API_URL is not set so it defaults to api.fintekkers.org:8082.
|
|
16
|
+
describe('PortfolioService', () => {
|
|
17
|
+
test('zero-arg constructor succeeds', () => {
|
|
18
|
+
expect(() => new PortfolioService_1.PortfolioService()).not.toThrow();
|
|
19
|
+
});
|
|
20
|
+
test('constructor with apiKey succeeds', () => {
|
|
21
|
+
expect(() => new PortfolioService_1.PortfolioService('test-api-key')).not.toThrow();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe('PositionService', () => {
|
|
25
|
+
test('zero-arg constructor succeeds', () => {
|
|
26
|
+
expect(() => new PositionService_1.PositionService()).not.toThrow();
|
|
27
|
+
});
|
|
28
|
+
test('constructor with apiKey succeeds', () => {
|
|
29
|
+
expect(() => new PositionService_1.PositionService('test-api-key')).not.toThrow();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('PriceService', () => {
|
|
33
|
+
test('zero-arg constructor succeeds', () => {
|
|
34
|
+
expect(() => new PriceService_1.PriceService()).not.toThrow();
|
|
35
|
+
});
|
|
36
|
+
test('constructor with apiKey succeeds', () => {
|
|
37
|
+
expect(() => new PriceService_1.PriceService('test-api-key')).not.toThrow();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('SecurityService', () => {
|
|
41
|
+
test('zero-arg constructor succeeds', () => {
|
|
42
|
+
expect(() => new SecurityService_1.SecurityService()).not.toThrow();
|
|
43
|
+
});
|
|
44
|
+
test('constructor with apiKey succeeds', () => {
|
|
45
|
+
expect(() => new SecurityService_1.SecurityService('test-api-key')).not.toThrow();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('TransactionService', () => {
|
|
49
|
+
test('zero-arg constructor succeeds', () => {
|
|
50
|
+
expect(() => new TransactionService_1.TransactionService()).not.toThrow();
|
|
51
|
+
});
|
|
52
|
+
test('constructor with apiKey succeeds', () => {
|
|
53
|
+
expect(() => new TransactionService_1.TransactionService('test-api-key')).not.toThrow();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=apikey.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apikey.test.js","sourceRoot":"","sources":["apikey.test.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2EAAwE;AACxE,wEAAqE;AACrE,+DAA4D;AAC5D,wEAAqE;AACrE,iFAA8E;AAE9E,uEAAuE;AACvE,gEAAgE;AAEhE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,mCAAgB,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,mCAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,C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AAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,uCAAkB,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,uCAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Issue #114: all wrapper services accept optional apiKey constructor param.
|
|
3
|
+
*
|
|
4
|
+
* These tests do NOT require a running gRPC server — they only verify that the
|
|
5
|
+
* constructor does not throw and that the client is created.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { PortfolioService } from './portfolio-service/PortfolioService';
|
|
9
|
+
import { PositionService } from './position-service/PositionService';
|
|
10
|
+
import { PriceService } from './price-service/PriceService';
|
|
11
|
+
import { SecurityService } from './security-service/SecurityService';
|
|
12
|
+
import { TransactionService } from './transaction-service/TransactionService';
|
|
13
|
+
|
|
14
|
+
// No server connection is made in constructors — gRPC connects lazily.
|
|
15
|
+
// API_URL is not set so it defaults to api.fintekkers.org:8082.
|
|
16
|
+
|
|
17
|
+
describe('PortfolioService', () => {
|
|
18
|
+
test('zero-arg constructor succeeds', () => {
|
|
19
|
+
expect(() => new PortfolioService()).not.toThrow();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('constructor with apiKey succeeds', () => {
|
|
23
|
+
expect(() => new PortfolioService('test-api-key')).not.toThrow();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('PositionService', () => {
|
|
28
|
+
test('zero-arg constructor succeeds', () => {
|
|
29
|
+
expect(() => new PositionService()).not.toThrow();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('constructor with apiKey succeeds', () => {
|
|
33
|
+
expect(() => new PositionService('test-api-key')).not.toThrow();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('PriceService', () => {
|
|
38
|
+
test('zero-arg constructor succeeds', () => {
|
|
39
|
+
expect(() => new PriceService()).not.toThrow();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('constructor with apiKey succeeds', () => {
|
|
43
|
+
expect(() => new PriceService('test-api-key')).not.toThrow();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('SecurityService', () => {
|
|
48
|
+
test('zero-arg constructor succeeds', () => {
|
|
49
|
+
expect(() => new SecurityService()).not.toThrow();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('constructor with apiKey succeeds', () => {
|
|
53
|
+
expect(() => new SecurityService('test-api-key')).not.toThrow();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('TransactionService', () => {
|
|
58
|
+
test('zero-arg constructor succeeds', () => {
|
|
59
|
+
expect(() => new TransactionService()).not.toThrow();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('constructor with apiKey succeeds', () => {
|
|
63
|
+
expect(() => new TransactionService('test-api-key')).not.toThrow();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -7,7 +7,7 @@ import Portfolio from '../../models/portfolio/portfolio';
|
|
|
7
7
|
declare class PortfolioService {
|
|
8
8
|
private client;
|
|
9
9
|
static url: string;
|
|
10
|
-
constructor();
|
|
10
|
+
constructor(apiKey?: string);
|
|
11
11
|
validateCreatePortfolio(portfolio: PortfolioProto): Promise<SummaryProto>;
|
|
12
12
|
createPortfolio(portfolio: PortfolioProto): Promise<CreatePortfolioResponseProto>;
|
|
13
13
|
searchPortfolio(asOf: LocalTimestampProto, positionFilter: PositionFilter): Promise<Portfolio[]>;
|
|
@@ -22,8 +22,14 @@ const create_portfolio_request_pb_1 = require("../../../fintekkers/requests/port
|
|
|
22
22
|
const requestcontext_1 = __importDefault(require("../../models/utils/requestcontext"));
|
|
23
23
|
const portfolio_1 = __importDefault(require("../../models/portfolio/portfolio"));
|
|
24
24
|
class PortfolioService {
|
|
25
|
-
constructor() {
|
|
26
|
-
|
|
25
|
+
constructor(apiKey) {
|
|
26
|
+
if (apiKey) {
|
|
27
|
+
const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(apiKey);
|
|
28
|
+
this.client = new portfolio_service_grpc_pb_1.PortfolioClient(requestcontext_1.default.apiURL, credentials, { interceptors });
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.client = new portfolio_service_grpc_pb_1.PortfolioClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
validateCreatePortfolio(portfolio) {
|
|
29
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortfolioService.js","sourceRoot":"","sources":["PortfolioService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAiC;AAOjC,cAAc;AAEd,sBAAsB;AACtB,wHAA2G;AAC3G,kHAA+G;AAE/G,oHAAiH;AAEjH,uFAA0D;AAE1D,iFAAyD;AAEzD,MAAM,gBAAgB;IAKpB;
|
|
1
|
+
{"version":3,"file":"PortfolioService.js","sourceRoot":"","sources":["PortfolioService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAiC;AAOjC,cAAc;AAEd,sBAAsB;AACtB,wHAA2G;AAC3G,kHAA+G;AAE/G,oHAAiH;AAEjH,uFAA0D;AAE1D,iFAAyD;AAEzD,MAAM,g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,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;aAAA;YAED,OAAO,MAAM,0BAA0B,EAAE,CAAC;QAC5C,CAAC;KAAA;;AAGM,4CAAgB;AAvEhB,oBAAG,GAAW,wBAAS,CAAC,MAAM,CAAC"}
|
|
@@ -22,8 +22,13 @@ class PortfolioService {
|
|
|
22
22
|
|
|
23
23
|
static url: string = EnvConfig.apiURL;
|
|
24
24
|
|
|
25
|
-
constructor() {
|
|
26
|
-
|
|
25
|
+
constructor(apiKey?: string) {
|
|
26
|
+
if (apiKey) {
|
|
27
|
+
const { credentials, interceptors } = EnvConfig.getAuthenticatedClientOptions(apiKey);
|
|
28
|
+
this.client = new PortfolioClient(EnvConfig.apiURL, credentials, { interceptors });
|
|
29
|
+
} else {
|
|
30
|
+
this.client = new PortfolioClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
async validateCreatePortfolio(portfolio: PortfolioProto): Promise<SummaryProto> {
|
|
@@ -3,7 +3,7 @@ import { QueryPositionRequest } from '../../requests/position/QueryPositionReque
|
|
|
3
3
|
import { SummaryProto } from '../../../fintekkers/requests/util/errors/summary_pb';
|
|
4
4
|
declare class PositionService {
|
|
5
5
|
private client;
|
|
6
|
-
constructor();
|
|
6
|
+
constructor(apiKey?: string);
|
|
7
7
|
validateRequest(positionRequest: QueryPositionRequest): Promise<SummaryProto>;
|
|
8
8
|
search(positionRequest: QueryPositionRequest): Promise<Position[]>;
|
|
9
9
|
}
|
|
@@ -20,8 +20,14 @@ const position_service_grpc_pb_1 = require("../../../fintekkers/services/positio
|
|
|
20
20
|
//Utils
|
|
21
21
|
const requestcontext_1 = __importDefault(require("../../models/utils/requestcontext"));
|
|
22
22
|
class PositionService {
|
|
23
|
-
constructor() {
|
|
24
|
-
|
|
23
|
+
constructor(apiKey) {
|
|
24
|
+
if (apiKey) {
|
|
25
|
+
const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(apiKey);
|
|
26
|
+
this.client = new position_service_grpc_pb_1.PositionClient(requestcontext_1.default.apiURL, credentials, { interceptors });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.client = new position_service_grpc_pb_1.PositionClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
|
|
30
|
+
}
|
|
25
31
|
}
|
|
26
32
|
validateRequest(positionRequest) {
|
|
27
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PositionService.js","sourceRoot":"","sources":["PositionService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS;AACT,6DAA0D;AAM1D,sBAAsB;AACtB,qHAAwG;AAExG,OAAO;AACP,uFAA0D;AAI1D,MAAM,eAAe;IAGnB;
|
|
1
|
+
{"version":3,"file":"PositionService.js","sourceRoot":"","sources":["PositionService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS;AACT,6DAA0D;AAM1D,sBAAsB;AACtB,qHAAwG;AAExG,OAAO;AACP,uFAA0D;AAI1D,MAAM,eAAe;IAGnB,YAAY,MAAe;QACzB,IAAI,MAAM,EAAE;YACV,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,wBAAS,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YACtF,IAAI,CAAC,MAAM,GAAG,IAAI,yCAAc,CAAC,wBAAS,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;SACnF;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,yCAAc,CAAC,wBAAS,CAAC,MAAM,EAAE,wBAAS,CAAC,cAAc,CAAC,CAAC;SAC9E;IACH,CAAC;IAEK,eAAe,CAAC,eAAqC;;YACzD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;YAC9B,MAAM,OAAO,GAA8B,eAAe,CAAC,OAAO,EAAE,CAAC;YAErE,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BAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;wBACd,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;aAAA;YAED,OAAO,MAAM,0BAA0B,EAAE,CAAC;QAC5C,CAAC;KAAA;CACF;AAEQ,0CAAe"}
|
|
@@ -16,8 +16,13 @@ import { SummaryProto } from '../../../fintekkers/requests/util/errors/summary_p
|
|
|
16
16
|
class PositionService {
|
|
17
17
|
private client: PositionClient;
|
|
18
18
|
|
|
19
|
-
constructor() {
|
|
20
|
-
|
|
19
|
+
constructor(apiKey?: string) {
|
|
20
|
+
if (apiKey) {
|
|
21
|
+
const { credentials, interceptors } = EnvConfig.getAuthenticatedClientOptions(apiKey);
|
|
22
|
+
this.client = new PositionClient(EnvConfig.apiURL, credentials, { interceptors });
|
|
23
|
+
} else {
|
|
24
|
+
this.client = new PositionClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
async validateRequest(positionRequest: QueryPositionRequest): Promise<SummaryProto> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAAS;AACT,+EAA8E;AAE9E,cAAc;AACd,2EAA0E;AAE1E,qBAAqB;AACrB,qFAAkF;AAClF,uFAAoF;AAEpF,IAAI,CAAC,yEAAyE,EAAE,GAAS,EAAE;IACzF,IAAI,MAAM,GAAG,CAAC,qBAAU,CAAC,YAAY,EAAE,qBAAU,CAAC,SAAS,EAAE,qBAAU,CAAC,YAAY,CAAC,CAAC;IACtF,IAAI,QAAQ,GAAG,CAAC,yBAAY,CAAC,iBAAiB,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACpD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;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C;QAChF,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;QAC9C,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,iBAAiB,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SAC/D;QAED,IAAI,SAAS,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEtD,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAA;YAErD,IAAI,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAE5B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACrB,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC,CAAC,CAAA;YACF,OAAO,IAAI,CAAA;SACZ;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Price from '../../models/price/Price';
|
|
2
|
+
import { PositionFilter } from '../../models/position/positionfilter';
|
|
3
|
+
import { LocalTimestampProto } from '../../../fintekkers/models/util/local_timestamp_pb';
|
|
4
|
+
import { PriceProto } from '../../../fintekkers/models/price/price_pb';
|
|
5
|
+
import { SummaryProto } from '../../../fintekkers/requests/util/errors/summary_pb';
|
|
6
|
+
import { CreatePriceResponseProto } from '../../../fintekkers/requests/price/create_price_response_pb';
|
|
7
|
+
declare class PriceService {
|
|
8
|
+
private client;
|
|
9
|
+
constructor(apiKey?: string);
|
|
10
|
+
close(): void;
|
|
11
|
+
validateCreateOrUpdate(price: Price | PriceProto): Promise<SummaryProto>;
|
|
12
|
+
createOrUpdate(price: Price | PriceProto): Promise<CreatePriceResponseProto>;
|
|
13
|
+
searchPriceAsOfNow(positionFilter: PositionFilter): Promise<Price[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Search for prices matching the given filter, returning Price wrapper objects.
|
|
16
|
+
*/
|
|
17
|
+
search(asOf: LocalTimestampProto, positionFilter: PositionFilter): Promise<Price[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Backward-compatible alias for search().
|
|
20
|
+
*/
|
|
21
|
+
searchPrice(asOf: LocalTimestampProto, positionFilter: PositionFilter): Promise<PriceProto[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Search prices by security UUID string.
|
|
24
|
+
* Convenience method so callers can write:
|
|
25
|
+
* priceService.searchBySecurityId('18e8c4e6-3da0-47c9-...')
|
|
26
|
+
*/
|
|
27
|
+
searchBySecurityId(securityId: string, asOf?: LocalTimestampProto): Promise<Price[]>;
|
|
28
|
+
}
|
|
29
|
+
export { PriceService };
|