@fintekkers/ledger-models 0.1.83 → 0.1.85
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/wrappers/models/position/position.js +11 -10
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +1 -1
- package/node/wrappers/models/position/position.ts +12 -10
- package/node/wrappers/models/utils/date.test.js +70 -0
- package/node/wrappers/models/utils/date.test.js.map +1 -0
- package/node/wrappers/models/utils/date.test.ts +36 -0
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.test.js +25 -2
- package/node/wrappers/models/utils/datetime.test.js.map +1 -1
- package/node/wrappers/models/utils/datetime.test.ts +31 -1
- package/node/wrappers/models/utils/datetime.ts +0 -1
- package/node/wrappers/services/position-service/PositionService.ts +1 -1
- package/package.json +1 -1
- package/node/fintekkers/models/portfolio/portfolio_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/field_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/measure_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/position_filter_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/position_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/position_status_grpc_pb.js +0 -1
- package/node/fintekkers/models/position/position_util_grpc_pb.js +0 -1
- package/node/fintekkers/models/price/price_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/bond/auction_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/bond/issuance_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/coupon_frequency_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/coupon_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/identifier/identifier_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/identifier/identifier_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/security_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/security_quantity_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/security_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/tenor_grpc_pb.js +0 -1
- package/node/fintekkers/models/security/tenor_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/strategy/strategy_allocation_grpc_pb.js +0 -1
- package/node/fintekkers/models/strategy/strategy_grpc_pb.js +0 -1
- package/node/fintekkers/models/transaction/transaction_grpc_pb.js +0 -1
- package/node/fintekkers/models/transaction/transaction_type_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/api/api_key_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/decimal_value_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/endpoint_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/local_date_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/local_timestamp_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/lock/node_partition_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/lock/node_state_grpc_pb.js +0 -1
- package/node/fintekkers/models/util/uuid_grpc_pb.js +0 -1
- package/node/fintekkers/requests/portfolio/create_portfolio_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/portfolio/create_portfolio_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/portfolio/query_portfolio_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/portfolio/query_portfolio_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/position/query_position_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/position/query_position_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/price/create_price_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/price/create_price_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/price/query_price_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/price/query_price_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/security/create_security_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/security/create_security_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/security/query_security_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/security/query_security_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/transaction/create_transaction_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/transaction/create_transaction_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/transaction/query_transaction_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/transaction/query_transaction_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/errors/error_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/errors/message_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/errors/summary_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/lock/lock_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/lock/lock_response_grpc_pb.js +0 -1
- package/node/fintekkers/requests/util/operation_grpc_pb.js +0 -1
- package/node/fintekkers/requests/valuation/valuation_request_grpc_pb.js +0 -1
- package/node/fintekkers/requests/valuation/valuation_response_grpc_pb.js +0 -1
- package/node/wrappers/models/position/hardcoded.position.js +0 -74
- package/node/wrappers/models/position/hardcoded.position.js.map +0 -1
- package/node/wrappers/models/position/hardcoded.position.ts +0 -81
- package/web/fintekkers/models/portfolio/portfolio_pb.d.ts +0 -60
- package/web/fintekkers/models/portfolio/portfolio_pb.js +0 -468
- package/web/fintekkers/models/position/field_pb.d.ts +0 -36
- package/web/fintekkers/models/position/field_pb.js +0 -55
- package/web/fintekkers/models/position/measure_pb.d.ts +0 -13
- package/web/fintekkers/models/position/measure_pb.js +0 -32
- package/web/fintekkers/models/position/position_filter_pb.d.ts +0 -33
- package/web/fintekkers/models/position/position_filter_pb.js +0 -262
- package/web/fintekkers/models/position/position_pb.d.ts +0 -57
- package/web/fintekkers/models/position/position_pb.js +0 -395
- package/web/fintekkers/models/position/position_status_pb.d.ts +0 -10
- package/web/fintekkers/models/position/position_status_pb.js +0 -29
- package/web/fintekkers/models/position/position_util_pb.d.ts +0 -86
- package/web/fintekkers/models/position/position_util_pb.js +0 -600
- package/web/fintekkers/models/price/price_pb.d.ts +0 -70
- package/web/fintekkers/models/price/price_pb.js +0 -544
- package/web/fintekkers/models/security/bond/auction_type_pb.d.ts +0 -8
- package/web/fintekkers/models/security/bond/auction_type_pb.js +0 -27
- package/web/fintekkers/models/security/bond/issuance_pb.d.ts +0 -94
- package/web/fintekkers/models/security/bond/issuance_pb.js +0 -748
- package/web/fintekkers/models/security/coupon_frequency_pb.d.ts +0 -12
- package/web/fintekkers/models/security/coupon_frequency_pb.js +0 -31
- package/web/fintekkers/models/security/coupon_type_pb.d.ts +0 -10
- package/web/fintekkers/models/security/coupon_type_pb.js +0 -29
- package/web/fintekkers/models/security/identifier/identifier_pb.d.ts +0 -35
- package/web/fintekkers/models/security/identifier/identifier_pb.js +0 -262
- package/web/fintekkers/models/security/identifier/identifier_type_pb.d.ts +0 -13
- package/web/fintekkers/models/security/identifier/identifier_type_pb.js +0 -32
- package/web/fintekkers/models/security/security_pb.d.ts +0 -144
- package/web/fintekkers/models/security/security_pb.js +0 -1111
- package/web/fintekkers/models/security/security_quantity_type_pb.d.ts +0 -10
- package/web/fintekkers/models/security/security_quantity_type_pb.js +0 -29
- package/web/fintekkers/models/security/security_type_pb.d.ts +0 -12
- package/web/fintekkers/models/security/security_type_pb.js +0 -31
- package/web/fintekkers/models/security/tenor_pb.d.ts +0 -35
- package/web/fintekkers/models/security/tenor_pb.js +0 -262
- package/web/fintekkers/models/security/tenor_type_pb.d.ts +0 -9
- package/web/fintekkers/models/security/tenor_type_pb.js +0 -28
- package/web/fintekkers/models/strategy/strategy_allocation_pb.d.ts +0 -78
- package/web/fintekkers/models/strategy/strategy_allocation_pb.js +0 -624
- package/web/fintekkers/models/strategy/strategy_pb.d.ts +0 -66
- package/web/fintekkers/models/strategy/strategy_pb.js +0 -519
- package/web/fintekkers/models/transaction/transaction_pb.d.ts +0 -128
- package/web/fintekkers/models/transaction/transaction_pb.js +0 -991
- package/web/fintekkers/models/transaction/transaction_type_pb.d.ts +0 -13
- package/web/fintekkers/models/transaction/transaction_type_pb.js +0 -32
- package/web/fintekkers/models/util/api/api_key_pb.d.ts +0 -34
- package/web/fintekkers/models/util/api/api_key_pb.js +0 -260
- package/web/fintekkers/models/util/decimal_value_pb.d.ts +0 -22
- package/web/fintekkers/models/util/decimal_value_pb.js +0 -170
- package/web/fintekkers/models/util/endpoint_pb.d.ts +0 -30
- package/web/fintekkers/models/util/endpoint_pb.js +0 -230
- package/web/fintekkers/models/util/local_date_pb.d.ts +0 -30
- package/web/fintekkers/models/util/local_date_pb.js +0 -230
- package/web/fintekkers/models/util/local_timestamp_pb.d.ts +0 -29
- package/web/fintekkers/models/util/local_timestamp_pb.js +0 -223
- package/web/fintekkers/models/util/lock/node_partition_pb.d.ts +0 -34
- package/web/fintekkers/models/util/lock/node_partition_pb.js +0 -260
- package/web/fintekkers/models/util/lock/node_state_pb.d.ts +0 -51
- package/web/fintekkers/models/util/lock/node_state_pb.js +0 -389
- package/web/fintekkers/models/util/uuid_pb.d.ts +0 -24
- package/web/fintekkers/models/util/uuid_pb.js +0 -194
- package/web/fintekkers/requests/portfolio/create_portfolio_request_pb.d.ts +0 -33
- package/web/fintekkers/requests/portfolio/create_portfolio_request_pb.js +0 -253
- package/web/fintekkers/requests/portfolio/create_portfolio_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/portfolio/create_portfolio_response_pb.js +0 -315
- package/web/fintekkers/requests/portfolio/query_portfolio_request_pb.d.ts +0 -47
- package/web/fintekkers/requests/portfolio/query_portfolio_request_pb.js +0 -368
- package/web/fintekkers/requests/portfolio/query_portfolio_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/portfolio/query_portfolio_response_pb.js +0 -315
- package/web/fintekkers/requests/position/query_position_request_pb.d.ts +0 -68
- package/web/fintekkers/requests/position/query_position_request_pb.js +0 -513
- package/web/fintekkers/requests/position/query_position_response_pb.d.ts +0 -44
- package/web/fintekkers/requests/position/query_position_response_pb.js +0 -345
- package/web/fintekkers/requests/price/create_price_request_pb.d.ts +0 -33
- package/web/fintekkers/requests/price/create_price_request_pb.js +0 -253
- package/web/fintekkers/requests/price/create_price_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/price/create_price_response_pb.js +0 -315
- package/web/fintekkers/requests/price/query_price_request_pb.d.ts +0 -47
- package/web/fintekkers/requests/price/query_price_request_pb.js +0 -368
- package/web/fintekkers/requests/price/query_price_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/price/query_price_response_pb.js +0 -315
- package/web/fintekkers/requests/security/create_security_request_pb.d.ts +0 -33
- package/web/fintekkers/requests/security/create_security_request_pb.js +0 -253
- package/web/fintekkers/requests/security/create_security_response_pb.d.ts +0 -47
- package/web/fintekkers/requests/security/create_security_response_pb.js +0 -359
- package/web/fintekkers/requests/security/query_security_request_pb.d.ts +0 -47
- package/web/fintekkers/requests/security/query_security_request_pb.js +0 -368
- package/web/fintekkers/requests/security/query_security_response_pb.d.ts +0 -47
- package/web/fintekkers/requests/security/query_security_response_pb.js +0 -370
- package/web/fintekkers/requests/transaction/create_transaction_request_pb.d.ts +0 -33
- package/web/fintekkers/requests/transaction/create_transaction_request_pb.js +0 -253
- package/web/fintekkers/requests/transaction/create_transaction_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/transaction/create_transaction_response_pb.js +0 -306
- package/web/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +0 -51
- package/web/fintekkers/requests/transaction/query_transaction_request_pb.js +0 -398
- package/web/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +0 -47
- package/web/fintekkers/requests/transaction/query_transaction_response_pb.js +0 -368
- package/web/fintekkers/requests/util/errors/error_pb.d.ts +0 -57
- package/web/fintekkers/requests/util/errors/error_pb.js +0 -435
- package/web/fintekkers/requests/util/errors/message_pb.d.ts +0 -26
- package/web/fintekkers/requests/util/errors/message_pb.js +0 -200
- package/web/fintekkers/requests/util/errors/summary_pb.d.ts +0 -31
- package/web/fintekkers/requests/util/errors/summary_pb.js +0 -255
- package/web/fintekkers/requests/util/lock/lock_request_pb.d.ts +0 -33
- package/web/fintekkers/requests/util/lock/lock_request_pb.js +0 -253
- package/web/fintekkers/requests/util/lock/lock_response_pb.d.ts +0 -47
- package/web/fintekkers/requests/util/lock/lock_response_pb.js +0 -359
- package/web/fintekkers/requests/util/operation_pb.d.ts +0 -11
- package/web/fintekkers/requests/util/operation_pb.js +0 -30
- package/web/fintekkers/requests/valuation/valuation_request_pb.d.ts +0 -59
- package/web/fintekkers/requests/valuation/valuation_request_pb.js +0 -451
- package/web/fintekkers/requests/valuation/valuation_response_pb.d.ts +0 -40
- package/web/fintekkers/requests/valuation/valuation_response_pb.js +0 -315
- package/web/fintekkers/services/lock-service/lock_service_grpc_web_pb.d.ts +0 -94
- package/web/fintekkers/services/lock-service/lock_service_grpc_web_pb.js +0 -451
- package/web/fintekkers/services/lock-service/lock_service_pb.d.ts +0 -69
- package/web/fintekkers/services/lock-service/lock_service_pb.js +0 -570
- package/web/fintekkers/services/portfolio-service/portfolio_service_grpc_web_pb.d.ts +0 -93
- package/web/fintekkers/services/portfolio-service/portfolio_service_grpc_web_pb.js +0 -451
- package/web/fintekkers/services/portfolio-service/portfolio_service_pb.d.ts +0 -9
- package/web/fintekkers/services/portfolio-service/portfolio_service_pb.js +0 -27
- package/web/fintekkers/services/position-service/position_service_grpc_web_pb.d.ts +0 -43
- package/web/fintekkers/services/position-service/position_service_grpc_web_pb.js +0 -203
- package/web/fintekkers/services/position-service/position_service_pb.d.ts +0 -7
- package/web/fintekkers/services/position-service/position_service_pb.js +0 -23
- package/web/fintekkers/services/price-service/price_service_grpc_web_pb.d.ts +0 -93
- package/web/fintekkers/services/price-service/price_service_grpc_web_pb.js +0 -451
- package/web/fintekkers/services/price-service/price_service_pb.d.ts +0 -9
- package/web/fintekkers/services/price-service/price_service_pb.js +0 -27
- package/web/fintekkers/services/security-service/security_service_grpc_web_pb.d.ts +0 -93
- package/web/fintekkers/services/security-service/security_service_grpc_web_pb.js +0 -451
- package/web/fintekkers/services/security-service/security_service_pb.d.ts +0 -9
- package/web/fintekkers/services/security-service/security_service_pb.js +0 -27
- package/web/fintekkers/services/transaction-service/transaction_service_grpc_web_pb.d.ts +0 -93
- package/web/fintekkers/services/transaction-service/transaction_service_grpc_web_pb.js +0 -451
- package/web/fintekkers/services/transaction-service/transaction_service_pb.d.ts +0 -9
- package/web/fintekkers/services/transaction-service/transaction_service_pb.js +0 -27
- package/web/fintekkers/services/valuation-service/valuation_service_grpc_web_pb.d.ts +0 -32
- package/web/fintekkers/services/valuation-service/valuation_service_grpc_web_pb.js +0 -145
- package/web/fintekkers/services/valuation-service/valuation_service_pb.d.ts +0 -6
- package/web/fintekkers/services/valuation-service/valuation_service_pb.js +0 -21
|
@@ -7,23 +7,23 @@ var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
|
7
7
|
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
8
8
|
var portfolio_1 = require("../portfolio/portfolio");
|
|
9
9
|
var security_1 = require("../security/security");
|
|
10
|
-
var uuid_pb_1 = require("../../../fintekkers/models/util/uuid_pb");
|
|
11
|
-
var local_timestamp_pb_1 = require("../../../fintekkers/models/util/local_timestamp_pb");
|
|
12
|
-
var local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
13
|
-
var identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
|
|
14
10
|
var measure_pb_1 = require("../../../fintekkers/models/position/measure_pb");
|
|
15
11
|
var serialization_1 = require("../utils/serialization");
|
|
16
|
-
var wrappers_pb_1 = require("google-protobuf/google/protobuf/wrappers_pb");
|
|
17
12
|
var protoEnum_1 = require("../utils/protoEnum");
|
|
18
13
|
var field_1 = require("./field");
|
|
19
14
|
var uuid_1 = require("../utils/uuid");
|
|
20
15
|
var datetime_1 = require("../utils/datetime");
|
|
21
|
-
var strategy_pb_1 = require("../../../fintekkers/models/strategy/strategy_pb");
|
|
22
16
|
var price_pb_1 = require("../../../fintekkers/models/price/price_pb");
|
|
17
|
+
var transaction_1 = require("../transaction/transaction");
|
|
18
|
+
var uuid_pb_1 = require("../../../fintekkers/models/util/uuid_pb");
|
|
19
|
+
var local_timestamp_pb_1 = require("../../../fintekkers/models/util/local_timestamp_pb");
|
|
20
|
+
var local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
21
|
+
var identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
|
|
22
|
+
var strategy_pb_1 = require("../../../fintekkers/models/strategy/strategy_pb");
|
|
23
23
|
var tenor_pb_1 = require("../../../fintekkers/models/security/tenor_pb");
|
|
24
|
-
var security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
25
24
|
var portfolio_pb_1 = require("../../../fintekkers/models/portfolio/portfolio_pb");
|
|
26
|
-
var
|
|
25
|
+
var security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
26
|
+
var wrappers_pb_1 = require("google-protobuf/google/protobuf/wrappers_pb");
|
|
27
27
|
var Position = /** @class */ (function () {
|
|
28
28
|
function Position(positionProto) {
|
|
29
29
|
this.proto = positionProto;
|
|
@@ -116,10 +116,11 @@ var Position = /** @class */ (function () {
|
|
|
116
116
|
return value.toString();
|
|
117
117
|
}
|
|
118
118
|
else if (value instanceof Date) {
|
|
119
|
-
return value.
|
|
119
|
+
return "".concat(value.getFullYear(), "/").concat(value.getMonth(), "/").concat(value.getDay());
|
|
120
120
|
}
|
|
121
121
|
else if (value instanceof datetime_1.ZonedDateTime) {
|
|
122
|
-
|
|
122
|
+
var tmpDateTime = value.toDateTime();
|
|
123
|
+
return tmpDateTime.toFormat('yyyy/MM/dd hh:mm:ss');
|
|
123
124
|
}
|
|
124
125
|
else if (value instanceof protoEnum_1.ProtoEnum) {
|
|
125
126
|
return value.toString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":";;;AAAA,QAAQ;AACR,yEAA0E;AAC1E,+EAAgF;AAChF,yFAAsG;AACtG,oDAA+C;AAC/C,iDAA4C;AAC5C,
|
|
1
|
+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vF,KAAK,qBAAU,CAAC,SAAS;gBACvB,OAAO,6BAAc,CAAC,iBAAiB,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1F,KAAK,qBAAU,CAAC,QAAQ,CAAC;YACzB,KAAK,qBAAU,CAAC,oBAAoB;gBAClC,OAAO,2BAAa,CAAC,iBAAiB,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YACzF,KAAK,qBAAU,CAAC,YAAY;gBAC1B,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;gBACtE,OAAO,aAAa,CAAC,mBAAmB,EAAE,CAAC;YAC7C;gBACE,MAAM,IAAI,KAAK,CAAC,4CAAqC,qBAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,sBAAmB,CAAC,CAAC;QAClH,CAAC;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AA7LD,IA6LC;AA7LY,4BAAQ"}
|
|
@@ -8,7 +8,7 @@ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
|
8
8
|
import { MeasureProto } from '../../../fintekkers/models/position/measure_pb';
|
|
9
9
|
import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
|
|
10
10
|
import { PortfolioProto } from '../../../fintekkers/models/portfolio/portfolio_pb';
|
|
11
|
-
import { Position } from
|
|
11
|
+
import { Position } from "./position";
|
|
12
12
|
import { LocalDate } from '../utils/date';
|
|
13
13
|
import { PositionStatusProto } from '../../../fintekkers/models/position/position_status_pb';
|
|
14
14
|
import { ProtoEnum } from '../utils/protoEnum';
|
|
@@ -4,25 +4,26 @@ import { PositionProto } from "../../../fintekkers/models/position/position_pb";
|
|
|
4
4
|
import { FieldMapEntry, MeasureMapEntry } from "../../../fintekkers/models/position/position_util_pb";
|
|
5
5
|
import Portfolio from "../portfolio/portfolio";
|
|
6
6
|
import Security from "../security/security";
|
|
7
|
-
import { UUIDProto } from "../../../fintekkers/models/util/uuid_pb";
|
|
8
|
-
import { LocalTimestampProto } from "../../../fintekkers/models/util/local_timestamp_pb";
|
|
9
|
-
import { LocalDateProto } from "../../../fintekkers/models/util/local_date_pb";
|
|
10
|
-
import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
|
|
11
7
|
import { MeasureProto } from "../../../fintekkers/models/position/measure_pb";
|
|
12
8
|
import Decimal from "decimal.js";
|
|
13
9
|
import { ProtoSerializationUtil } from "../utils/serialization";
|
|
14
|
-
import { StringValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
15
10
|
import { ProtoEnum } from "../utils/protoEnum";
|
|
16
11
|
import { Field } from "./field";
|
|
17
12
|
import { UUID } from "../utils/uuid";
|
|
18
13
|
import { ZonedDateTime } from "../utils/datetime";
|
|
19
|
-
import { StrategyProto } from "../../../fintekkers/models/strategy/strategy_pb";
|
|
20
14
|
import { PriceProto } from "../../../fintekkers/models/price/price_pb";
|
|
15
|
+
import Transaction from "../transaction/transaction";
|
|
16
|
+
import { DateTime } from 'luxon';
|
|
17
|
+
import { UUIDProto } from "../../../fintekkers/models/util/uuid_pb";
|
|
18
|
+
import { LocalTimestampProto } from "../../../fintekkers/models/util/local_timestamp_pb";
|
|
19
|
+
import { LocalDateProto } from "../../../fintekkers/models/util/local_date_pb";
|
|
20
|
+
import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
|
|
21
|
+
import { StrategyProto } from "../../../fintekkers/models/strategy/strategy_pb";
|
|
21
22
|
import { TenorProto } from "../../../fintekkers/models/security/tenor_pb";
|
|
22
|
-
import { SecurityProto } from "../../../fintekkers/models/security/security_pb";
|
|
23
23
|
import { PortfolioProto } from "../../../fintekkers/models/portfolio/portfolio_pb";
|
|
24
|
-
import
|
|
24
|
+
import { SecurityProto } from "../../../fintekkers/models/security/security_pb";
|
|
25
25
|
|
|
26
|
+
import { StringValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
26
27
|
export class Position {
|
|
27
28
|
proto: PositionProto;
|
|
28
29
|
|
|
@@ -126,9 +127,10 @@ export class Position {
|
|
|
126
127
|
} else if (value instanceof UUID) {
|
|
127
128
|
return value.toString();
|
|
128
129
|
} else if (value instanceof Date) {
|
|
129
|
-
return value.
|
|
130
|
+
return `${value.getFullYear()}/${value.getMonth()}/${value.getDay()}`;
|
|
130
131
|
} else if (value instanceof ZonedDateTime) {
|
|
131
|
-
|
|
132
|
+
const tmpDateTime: DateTime = value.toDateTime();
|
|
133
|
+
return tmpDateTime.toFormat('yyyy/MM/dd hh:mm:ss');
|
|
132
134
|
} else if (value instanceof ProtoEnum) {
|
|
133
135
|
return value.toString();
|
|
134
136
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
40
|
+
var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
41
|
+
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
42
|
+
var position_1 = require("../position/position");
|
|
43
|
+
var date_1 = require("./date");
|
|
44
|
+
var any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
|
|
45
|
+
test('test the date time', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var now, nowProto, nowPacked, position, field1, pos, timestampStr;
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
now = date_1.LocalDate.today();
|
|
49
|
+
nowProto = now.toProto();
|
|
50
|
+
nowPacked = new any_pb_1.Any();
|
|
51
|
+
nowPacked.setTypeUrl("DUMMYTYPE_DATE");
|
|
52
|
+
nowPacked.setValue(nowProto.serializeBinary());
|
|
53
|
+
position = new position_pb_1.PositionProto();
|
|
54
|
+
// Set properties
|
|
55
|
+
position.setObjectClass(' MyClass');
|
|
56
|
+
position.setVersion('1.0');
|
|
57
|
+
position.setPositionView(position_pb_1.PositionViewProto.DEFAULT_VIEW);
|
|
58
|
+
position.setPositionType(position_pb_1.PositionTypeProto.TRANSACTION);
|
|
59
|
+
field1 = new position_util_pb_1.FieldMapEntry();
|
|
60
|
+
field1.setField(field_pb_1.FieldProto.EFFECTIVE_DATE);
|
|
61
|
+
field1.setFieldValuePacked(nowPacked);
|
|
62
|
+
position.addFields(field1);
|
|
63
|
+
pos = new position_1.Position(position);
|
|
64
|
+
timestampStr = pos.getFieldDisplay(field1);
|
|
65
|
+
//Expect timestamp match
|
|
66
|
+
expect(timestampStr).toMatch(/^\d{4}\/(?:\d{1,2})(?:\/\d{1,2})?$/);
|
|
67
|
+
return [2 /*return*/];
|
|
68
|
+
});
|
|
69
|
+
}); });
|
|
70
|
+
//# sourceMappingURL=date.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.test.js","sourceRoot":"","sources":["date.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yEAA0E;AAC1E,+EAAsH;AACtH,yFAAqF;AACrF,iDAAgD;AAChD,+BAAmC;AACnC,iEAA6D;AAE7D,IAAI,CAAC,oBAAoB,EAAE;;;QACjB,GAAG,GAAG,gBAAS,CAAC,KAAK,EAAE,CAAC;QAExB,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;QACzB,SAAS,GAAG,IAAI,YAAG,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QACvC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC;QAEzC,QAAQ,GAAG,IAAI,2BAAa,EAAE,CAAC;QAErC,iBAAiB;QACjB,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACpC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,QAAQ,CAAC,eAAe,CAAC,+BAAiB,CAAC,YAAY,CAAC,CAAC;QACzD,QAAQ,CAAC,eAAe,CAAC,+BAAiB,CAAC,WAAW,CAAC,CAAC;QAGlD,MAAM,GAAG,IAAI,gCAAa,EAAE,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACtC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAErB,GAAG,GAAG,IAAI,mBAAQ,CAAC,QAAQ,CAAC,CAAC;QAC7B,YAAY,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEjD,wBAAwB;QACxB,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC;;;KACtE,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
3
|
+
import { PositionProto, PositionTypeProto, PositionViewProto } from '../../../fintekkers/models/position/position_pb';
|
|
4
|
+
import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
|
|
5
|
+
import { Position } from "../position/position";
|
|
6
|
+
import { LocalDate } from './date';
|
|
7
|
+
import { Any } from 'google-protobuf/google/protobuf/any_pb';
|
|
8
|
+
|
|
9
|
+
test('test the date time', async () => {
|
|
10
|
+
const now = LocalDate.today();
|
|
11
|
+
|
|
12
|
+
const nowProto = now.toProto();
|
|
13
|
+
const nowPacked = new Any();
|
|
14
|
+
nowPacked.setTypeUrl(`DUMMYTYPE_DATE`);
|
|
15
|
+
nowPacked.setValue(nowProto.serializeBinary());
|
|
16
|
+
|
|
17
|
+
const position = new PositionProto();
|
|
18
|
+
|
|
19
|
+
// Set properties
|
|
20
|
+
position.setObjectClass(' MyClass');
|
|
21
|
+
position.setVersion('1.0');
|
|
22
|
+
position.setPositionView(PositionViewProto.DEFAULT_VIEW);
|
|
23
|
+
position.setPositionType(PositionTypeProto.TRANSACTION);
|
|
24
|
+
|
|
25
|
+
// Add fields
|
|
26
|
+
const field1 = new FieldMapEntry();
|
|
27
|
+
field1.setField(FieldProto.EFFECTIVE_DATE);
|
|
28
|
+
field1.setFieldValuePacked(nowPacked);
|
|
29
|
+
position.addFields(field1);
|
|
30
|
+
|
|
31
|
+
const pos = new Position(position);
|
|
32
|
+
const timestampStr = pos.getFieldDisplay(field1);
|
|
33
|
+
|
|
34
|
+
//Expect timestamp match
|
|
35
|
+
expect(timestampStr).toMatch(/^\d{4}\/(?:\d{1,2})(?:\/\d{1,2})?$/);
|
|
36
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.js","sourceRoot":"","sources":["datetime.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"datetime.js","sourceRoot":"","sources":["datetime.ts"],"names":[],"mappings":";;;AAAA,yFAAyF;AACzF,6EAAyE;AACzE,+BAAiC;AAEjC;IAGE,uBAAY,KAA0B;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,mCAAW,GAAX;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED,kCAAU,GAAV;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,CA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B,IAAM,cAAc,GAAG,IAAI,wCAAmB,EAAE,CAAC;QACjD,cAAc,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QAC/C,cAAc,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAEvC,OAAO,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IACH,oBAAC;AAAD,CAAC,AA1DD,IA0DC;AAEQ,sCAAa"}
|
|
@@ -36,12 +36,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
40
|
+
var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
41
|
+
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
42
|
+
var position_1 = require("../position/position");
|
|
39
43
|
var datetime_1 = require("./datetime");
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
var any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
|
|
45
|
+
test('test the date time', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var now, nowProto, nowPacked, position, field1, pos, timestampStr;
|
|
42
47
|
return __generator(this, function (_a) {
|
|
43
48
|
now = datetime_1.ZonedDateTime.now();
|
|
44
49
|
expect(now.toDateTime().toString()).toBe(now.toString());
|
|
50
|
+
nowProto = now.toProto();
|
|
51
|
+
nowPacked = new any_pb_1.Any();
|
|
52
|
+
nowPacked.setTypeUrl("DUMMYTYPE_DATE");
|
|
53
|
+
nowPacked.setValue(nowProto.serializeBinary());
|
|
54
|
+
position = new position_pb_1.PositionProto();
|
|
55
|
+
// Set properties
|
|
56
|
+
position.setObjectClass(' MyClass');
|
|
57
|
+
position.setVersion('1.0');
|
|
58
|
+
position.setPositionView(position_pb_1.PositionViewProto.DEFAULT_VIEW);
|
|
59
|
+
position.setPositionType(position_pb_1.PositionTypeProto.TRANSACTION);
|
|
60
|
+
field1 = new position_util_pb_1.FieldMapEntry();
|
|
61
|
+
field1.setField(field_pb_1.FieldProto.AS_OF);
|
|
62
|
+
field1.setFieldValuePacked(nowPacked);
|
|
63
|
+
position.addFields(field1);
|
|
64
|
+
pos = new position_1.Position(position);
|
|
65
|
+
timestampStr = pos.getFieldDisplay(field1);
|
|
66
|
+
//Expect timestamp match
|
|
67
|
+
expect(timestampStr).toMatch(/^[0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/);
|
|
45
68
|
return [2 /*return*/];
|
|
46
69
|
});
|
|
47
70
|
}); });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.test.js","sourceRoot":"","sources":["datetime.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA2C;
|
|
1
|
+
{"version":3,"file":"datetime.test.js","sourceRoot":"","sources":["datetime.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yEAA0E;AAC1E,+EAAsH;AACtH,yFAAqF;AACrF,iDAAgD;AAChD,uCAA2C;AAC3C,iEAA6D;AAE7D,IAAI,CAAC,oBAAoB,EAAE;;;QAEjB,GAAG,GAAG,wBAAa,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEnD,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;QACzB,SAAS,GAAG,IAAI,YAAG,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QACvC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC;QAEzC,QAAQ,GAAG,IAAI,2BAAa,EAAE,CAAC;QAErC,iBAAiB;QACjB,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACpC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,QAAQ,CAAC,eAAe,CAAC,+BAAiB,CAAC,YAAY,CAAC,CAAC;QACzD,QAAQ,CAAC,eAAe,CAAC,+BAAiB,CAAC,WAAW,CAAC,CAAC;QAGlD,MAAM,GAAG,IAAI,gCAAa,EAAE,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,qBAAU,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACtC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAErB,GAAG,GAAG,IAAI,mBAAQ,CAAC,QAAQ,CAAC,CAAC;QAC7B,YAAY,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAEjD,wBAAwB;QACxB,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,2DAA2D,CAAC,CAAC;;;KAC7F,CAAC,CAAC"}
|
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
|
|
2
|
+
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
3
|
+
import { PositionProto, PositionTypeProto, PositionViewProto } from '../../../fintekkers/models/position/position_pb';
|
|
4
|
+
import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
|
|
5
|
+
import { Position } from "../position/position";
|
|
2
6
|
import { ZonedDateTime } from './datetime';
|
|
7
|
+
import { Any } from 'google-protobuf/google/protobuf/any_pb';
|
|
3
8
|
|
|
4
|
-
test('test the
|
|
9
|
+
test('test the date time', async () => {
|
|
5
10
|
|
|
6
11
|
const now = ZonedDateTime.now();
|
|
7
12
|
expect(now.toDateTime().toString()).toBe(now.toString());
|
|
13
|
+
|
|
14
|
+
const nowProto = now.toProto();
|
|
15
|
+
const nowPacked = new Any();
|
|
16
|
+
nowPacked.setTypeUrl(`DUMMYTYPE_DATE`);
|
|
17
|
+
nowPacked.setValue(nowProto.serializeBinary());
|
|
18
|
+
|
|
19
|
+
const position = new PositionProto();
|
|
20
|
+
|
|
21
|
+
// Set properties
|
|
22
|
+
position.setObjectClass(' MyClass');
|
|
23
|
+
position.setVersion('1.0');
|
|
24
|
+
position.setPositionView(PositionViewProto.DEFAULT_VIEW);
|
|
25
|
+
position.setPositionType(PositionTypeProto.TRANSACTION);
|
|
26
|
+
|
|
27
|
+
// Add fields
|
|
28
|
+
const field1 = new FieldMapEntry();
|
|
29
|
+
field1.setField(FieldProto.AS_OF);
|
|
30
|
+
field1.setFieldValuePacked(nowPacked);
|
|
31
|
+
position.addFields(field1);
|
|
32
|
+
|
|
33
|
+
const pos = new Position(position);
|
|
34
|
+
const timestampStr = pos.getFieldDisplay(field1);
|
|
35
|
+
|
|
36
|
+
//Expect timestamp match
|
|
37
|
+
expect(timestampStr).toMatch(/^[0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/);
|
|
8
38
|
});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|