@fintekkers/ledger-models 0.1.132 → 0.1.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/fintekkers/models/security/asset_class_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/asset_class_pb.d.ts +15 -0
- package/node/fintekkers/models/security/asset_class_pb.js +36 -0
- package/node/fintekkers/models/security/security_pb.d.ts +6 -0
- package/node/fintekkers/models/security/security_pb.js +51 -0
- package/node/fintekkers/requests/price/query_price_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/price/query_price_request_pb.js +31 -1
- package/node/fintekkers/requests/price/query_price_response_pb.d.ts +7 -0
- package/node/fintekkers/requests/price/query_price_response_pb.js +54 -1
- package/node/wrappers/models/security/BondSecurity.d.ts +8 -0
- package/node/wrappers/models/security/BondSecurity.js +13 -0
- package/node/wrappers/models/security/BondSecurity.js.map +1 -1
- package/node/wrappers/models/security/BondSecurity.ts +13 -0
- package/node/wrappers/models/security/asset_class.d.ts +37 -0
- package/node/wrappers/models/security/asset_class.js +51 -0
- package/node/wrappers/models/security/asset_class.js.map +1 -0
- package/node/wrappers/models/security/asset_class.test.d.ts +1 -0
- package/node/wrappers/models/security/asset_class.test.js +52 -0
- package/node/wrappers/models/security/asset_class.test.js.map +1 -0
- package/node/wrappers/models/security/asset_class.test.ts +58 -0
- package/node/wrappers/models/security/asset_class.ts +53 -0
- package/node/wrappers/models/security/identifier.d.ts +26 -0
- package/node/wrappers/models/security/identifier.js +39 -0
- package/node/wrappers/models/security/identifier.js.map +1 -1
- package/node/wrappers/models/security/identifier.test.js +62 -0
- package/node/wrappers/models/security/identifier.test.js.map +1 -1
- package/node/wrappers/models/security/identifier.test.ts +70 -0
- package/node/wrappers/models/security/identifier.ts +44 -0
- package/node/wrappers/models/security/security.d.ts +36 -1
- package/node/wrappers/models/security/security.js +45 -2
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.test.js +72 -0
- package/node/wrappers/models/security/security.test.js.map +1 -1
- package/node/wrappers/models/security/security.test.ts +80 -0
- package/node/wrappers/models/security/security.ts +47 -3
- package/node/wrappers/models/security/security_type.d.ts +31 -0
- package/node/wrappers/models/security/security_type.js +45 -0
- package/node/wrappers/models/security/security_type.js.map +1 -0
- package/node/wrappers/models/security/security_type.test.d.ts +1 -0
- package/node/wrappers/models/security/security_type.test.js +64 -0
- package/node/wrappers/models/security/security_type.test.js.map +1 -0
- package/node/wrappers/models/security/security_type.test.ts +70 -0
- package/node/wrappers/models/security/security_type.ts +47 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// package: fintekkers.models.security
|
|
2
|
+
// file: fintekkers/models/security/asset_class.proto
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
import * as jspb from "google-protobuf";
|
|
8
|
+
|
|
9
|
+
export enum AssetClassProto {
|
|
10
|
+
UNKNOWN_ASSET_CLASS = 0,
|
|
11
|
+
FIXED_INCOME = 1,
|
|
12
|
+
EQUITY = 2,
|
|
13
|
+
CASH_ASSET_CLASS = 3,
|
|
14
|
+
INDEX = 4,
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// source: fintekkers/models/security/asset_class.proto
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview
|
|
4
|
+
* @enhanceable
|
|
5
|
+
* @suppress {missingRequire} reports error on implicit type usages.
|
|
6
|
+
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
7
|
+
* field starts with 'MSG_' and isn't a translatable message.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
// GENERATED CODE -- DO NOT EDIT!
|
|
11
|
+
/* eslint-disable */
|
|
12
|
+
// @ts-nocheck
|
|
13
|
+
|
|
14
|
+
var jspb = require('google-protobuf');
|
|
15
|
+
var goog = jspb;
|
|
16
|
+
var global = (function() {
|
|
17
|
+
if (this) { return this; }
|
|
18
|
+
if (typeof window !== 'undefined') { return window; }
|
|
19
|
+
if (typeof global !== 'undefined') { return global; }
|
|
20
|
+
if (typeof self !== 'undefined') { return self; }
|
|
21
|
+
return Function('return this')();
|
|
22
|
+
}.call(null));
|
|
23
|
+
|
|
24
|
+
goog.exportSymbol('proto.fintekkers.models.security.AssetClassProto', null, global);
|
|
25
|
+
/**
|
|
26
|
+
* @enum {number}
|
|
27
|
+
*/
|
|
28
|
+
proto.fintekkers.models.security.AssetClassProto = {
|
|
29
|
+
UNKNOWN_ASSET_CLASS: 0,
|
|
30
|
+
FIXED_INCOME: 1,
|
|
31
|
+
EQUITY: 2,
|
|
32
|
+
CASH_ASSET_CLASS: 3,
|
|
33
|
+
INDEX: 4
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
goog.object.extend(exports, proto.fintekkers.models.security);
|
|
@@ -46,6 +46,11 @@ export class SecurityProto extends jspb.Message {
|
|
|
46
46
|
setValidTo(value?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto): SecurityProto;
|
|
47
47
|
getSecurityType(): fintekkers_models_security_security_type_pb.SecurityTypeProto;
|
|
48
48
|
setSecurityType(value: fintekkers_models_security_security_type_pb.SecurityTypeProto): SecurityProto;
|
|
49
|
+
|
|
50
|
+
hasDeletedAt(): boolean;
|
|
51
|
+
clearDeletedAt(): void;
|
|
52
|
+
getDeletedAt(): fintekkers_models_util_local_timestamp_pb.LocalTimestampProto | undefined;
|
|
53
|
+
setDeletedAt(value?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto): SecurityProto;
|
|
49
54
|
getAssetClass(): string;
|
|
50
55
|
setAssetClass(value: string): SecurityProto;
|
|
51
56
|
getIssuerName(): string;
|
|
@@ -184,6 +189,7 @@ export namespace SecurityProto {
|
|
|
184
189
|
validFrom?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
185
190
|
validTo?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
186
191
|
securityType: fintekkers_models_security_security_type_pb.SecurityTypeProto,
|
|
192
|
+
deletedAt?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
187
193
|
assetClass: string,
|
|
188
194
|
issuerName: string,
|
|
189
195
|
settlementCurrency?: SecurityProto.AsObject,
|
|
@@ -298,6 +298,7 @@ proto.fintekkers.models.security.SecurityProto.toObject = function(includeInstan
|
|
|
298
298
|
validFrom: (f = msg.getValidFrom()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
299
299
|
validTo: (f = msg.getValidTo()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
300
300
|
securityType: jspb.Message.getFieldWithDefault(msg, 10, 0),
|
|
301
|
+
deletedAt: (f = msg.getDeletedAt()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
301
302
|
assetClass: jspb.Message.getFieldWithDefault(msg, 11, ""),
|
|
302
303
|
issuerName: jspb.Message.getFieldWithDefault(msg, 12, ""),
|
|
303
304
|
settlementCurrency: (f = msg.getSettlementCurrency()) && proto.fintekkers.models.security.SecurityProto.toObject(includeInstance, f),
|
|
@@ -402,6 +403,11 @@ proto.fintekkers.models.security.SecurityProto.deserializeBinaryFromReader = fun
|
|
|
402
403
|
var value = /** @type {!proto.fintekkers.models.security.SecurityTypeProto} */ (reader.readEnum());
|
|
403
404
|
msg.setSecurityType(value);
|
|
404
405
|
break;
|
|
406
|
+
case 15:
|
|
407
|
+
var value = new fintekkers_models_util_local_timestamp_pb.LocalTimestampProto;
|
|
408
|
+
reader.readMessage(value,fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.deserializeBinaryFromReader);
|
|
409
|
+
msg.setDeletedAt(value);
|
|
410
|
+
break;
|
|
405
411
|
case 11:
|
|
406
412
|
var value = /** @type {string} */ (reader.readString());
|
|
407
413
|
msg.setAssetClass(value);
|
|
@@ -630,6 +636,14 @@ proto.fintekkers.models.security.SecurityProto.serializeBinaryToWriter = functio
|
|
|
630
636
|
f
|
|
631
637
|
);
|
|
632
638
|
}
|
|
639
|
+
f = message.getDeletedAt();
|
|
640
|
+
if (f != null) {
|
|
641
|
+
writer.writeMessage(
|
|
642
|
+
15,
|
|
643
|
+
f,
|
|
644
|
+
fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.serializeBinaryToWriter
|
|
645
|
+
);
|
|
646
|
+
}
|
|
633
647
|
f = message.getAssetClass();
|
|
634
648
|
if (f.length > 0) {
|
|
635
649
|
writer.writeString(
|
|
@@ -1082,6 +1096,43 @@ proto.fintekkers.models.security.SecurityProto.prototype.setSecurityType = funct
|
|
|
1082
1096
|
};
|
|
1083
1097
|
|
|
1084
1098
|
|
|
1099
|
+
/**
|
|
1100
|
+
* optional fintekkers.models.util.LocalTimestampProto deleted_at = 15;
|
|
1101
|
+
* @return {?proto.fintekkers.models.util.LocalTimestampProto}
|
|
1102
|
+
*/
|
|
1103
|
+
proto.fintekkers.models.security.SecurityProto.prototype.getDeletedAt = function() {
|
|
1104
|
+
return /** @type{?proto.fintekkers.models.util.LocalTimestampProto} */ (
|
|
1105
|
+
jspb.Message.getWrapperField(this, fintekkers_models_util_local_timestamp_pb.LocalTimestampProto, 15));
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* @param {?proto.fintekkers.models.util.LocalTimestampProto|undefined} value
|
|
1111
|
+
* @return {!proto.fintekkers.models.security.SecurityProto} returns this
|
|
1112
|
+
*/
|
|
1113
|
+
proto.fintekkers.models.security.SecurityProto.prototype.setDeletedAt = function(value) {
|
|
1114
|
+
return jspb.Message.setWrapperField(this, 15, value);
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* Clears the message field making it undefined.
|
|
1120
|
+
* @return {!proto.fintekkers.models.security.SecurityProto} returns this
|
|
1121
|
+
*/
|
|
1122
|
+
proto.fintekkers.models.security.SecurityProto.prototype.clearDeletedAt = function() {
|
|
1123
|
+
return this.setDeletedAt(undefined);
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Returns whether this field is set.
|
|
1129
|
+
* @return {boolean}
|
|
1130
|
+
*/
|
|
1131
|
+
proto.fintekkers.models.security.SecurityProto.prototype.hasDeletedAt = function() {
|
|
1132
|
+
return jspb.Message.getField(this, 15) != null;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
|
|
1085
1136
|
/**
|
|
1086
1137
|
* optional string asset_class = 11;
|
|
1087
1138
|
* @return {string}
|
|
@@ -41,6 +41,8 @@ export class QueryPriceRequestProto extends jspb.Message {
|
|
|
41
41
|
clearDateRange(): void;
|
|
42
42
|
getDateRange(): fintekkers_models_util_date_range_pb.DateRangeProto | undefined;
|
|
43
43
|
setDateRange(value?: fintekkers_models_util_date_range_pb.DateRangeProto): QueryPriceRequestProto;
|
|
44
|
+
getLimit(): number;
|
|
45
|
+
setLimit(value: number): QueryPriceRequestProto;
|
|
44
46
|
|
|
45
47
|
getTimeRangeCase(): QueryPriceRequestProto.TimeRangeCase;
|
|
46
48
|
|
|
@@ -64,6 +66,7 @@ export namespace QueryPriceRequestProto {
|
|
|
64
66
|
frequency: PriceFrequencyProto,
|
|
65
67
|
horizon: PriceHorizonProto,
|
|
66
68
|
dateRange?: fintekkers_models_util_date_range_pb.DateRangeProto.AsObject,
|
|
69
|
+
limit: number,
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
export enum TimeRangeCase {
|
|
@@ -127,7 +127,8 @@ proto.fintekkers.requests.price.QueryPriceRequestProto.toObject = function(inclu
|
|
|
127
127
|
asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
128
128
|
frequency: jspb.Message.getFieldWithDefault(msg, 24, 0),
|
|
129
129
|
horizon: jspb.Message.getFieldWithDefault(msg, 25, 0),
|
|
130
|
-
dateRange: (f = msg.getDateRange()) && fintekkers_models_util_date_range_pb.DateRangeProto.toObject(includeInstance, f)
|
|
130
|
+
dateRange: (f = msg.getDateRange()) && fintekkers_models_util_date_range_pb.DateRangeProto.toObject(includeInstance, f),
|
|
131
|
+
limit: jspb.Message.getFieldWithDefault(msg, 27, 0)
|
|
131
132
|
};
|
|
132
133
|
|
|
133
134
|
if (includeInstance) {
|
|
@@ -200,6 +201,10 @@ proto.fintekkers.requests.price.QueryPriceRequestProto.deserializeBinaryFromRead
|
|
|
200
201
|
reader.readMessage(value,fintekkers_models_util_date_range_pb.DateRangeProto.deserializeBinaryFromReader);
|
|
201
202
|
msg.setDateRange(value);
|
|
202
203
|
break;
|
|
204
|
+
case 27:
|
|
205
|
+
var value = /** @type {number} */ (reader.readInt32());
|
|
206
|
+
msg.setLimit(value);
|
|
207
|
+
break;
|
|
203
208
|
default:
|
|
204
209
|
reader.skipField();
|
|
205
210
|
break;
|
|
@@ -289,6 +294,13 @@ proto.fintekkers.requests.price.QueryPriceRequestProto.serializeBinaryToWriter =
|
|
|
289
294
|
fintekkers_models_util_date_range_pb.DateRangeProto.serializeBinaryToWriter
|
|
290
295
|
);
|
|
291
296
|
}
|
|
297
|
+
f = message.getLimit();
|
|
298
|
+
if (f !== 0) {
|
|
299
|
+
writer.writeInt32(
|
|
300
|
+
27,
|
|
301
|
+
f
|
|
302
|
+
);
|
|
303
|
+
}
|
|
292
304
|
};
|
|
293
305
|
|
|
294
306
|
|
|
@@ -531,6 +543,24 @@ proto.fintekkers.requests.price.QueryPriceRequestProto.prototype.hasDateRange =
|
|
|
531
543
|
};
|
|
532
544
|
|
|
533
545
|
|
|
546
|
+
/**
|
|
547
|
+
* optional int32 limit = 27;
|
|
548
|
+
* @return {number}
|
|
549
|
+
*/
|
|
550
|
+
proto.fintekkers.requests.price.QueryPriceRequestProto.prototype.getLimit = function() {
|
|
551
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 27, 0));
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @param {number} value
|
|
557
|
+
* @return {!proto.fintekkers.requests.price.QueryPriceRequestProto} returns this
|
|
558
|
+
*/
|
|
559
|
+
proto.fintekkers.requests.price.QueryPriceRequestProto.prototype.setLimit = function(value) {
|
|
560
|
+
return jspb.Message.setProto3IntField(this, 27, value);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
|
|
534
564
|
/**
|
|
535
565
|
* @enum {number}
|
|
536
566
|
*/
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as jspb from "google-protobuf";
|
|
8
8
|
import * as fintekkers_models_price_price_pb from "../../../fintekkers/models/price/price_pb";
|
|
9
9
|
import * as fintekkers_requests_price_query_price_request_pb from "../../../fintekkers/requests/price/query_price_request_pb";
|
|
10
|
+
import * as fintekkers_requests_util_errors_summary_pb from "../../../fintekkers/requests/util/errors/summary_pb";
|
|
10
11
|
|
|
11
12
|
export class QueryPriceResponseProto extends jspb.Message {
|
|
12
13
|
getObjectClass(): string;
|
|
@@ -23,6 +24,11 @@ export class QueryPriceResponseProto extends jspb.Message {
|
|
|
23
24
|
setPriceResponseList(value: Array<fintekkers_models_price_price_pb.PriceProto>): QueryPriceResponseProto;
|
|
24
25
|
addPriceResponse(value?: fintekkers_models_price_price_pb.PriceProto, index?: number): fintekkers_models_price_price_pb.PriceProto;
|
|
25
26
|
|
|
27
|
+
hasErrorsOrWarnings(): boolean;
|
|
28
|
+
clearErrorsOrWarnings(): void;
|
|
29
|
+
getErrorsOrWarnings(): fintekkers_requests_util_errors_summary_pb.SummaryProto | undefined;
|
|
30
|
+
setErrorsOrWarnings(value?: fintekkers_requests_util_errors_summary_pb.SummaryProto): QueryPriceResponseProto;
|
|
31
|
+
|
|
26
32
|
serializeBinary(): Uint8Array;
|
|
27
33
|
toObject(includeInstance?: boolean): QueryPriceResponseProto.AsObject;
|
|
28
34
|
static toObject(includeInstance: boolean, msg: QueryPriceResponseProto): QueryPriceResponseProto.AsObject;
|
|
@@ -39,5 +45,6 @@ export namespace QueryPriceResponseProto {
|
|
|
39
45
|
version: string,
|
|
40
46
|
queryPriceRequest?: fintekkers_requests_price_query_price_request_pb.QueryPriceRequestProto.AsObject,
|
|
41
47
|
priceResponseList: Array<fintekkers_models_price_price_pb.PriceProto.AsObject>,
|
|
48
|
+
errorsOrWarnings?: fintekkers_requests_util_errors_summary_pb.SummaryProto.AsObject,
|
|
42
49
|
}
|
|
43
50
|
}
|
|
@@ -25,6 +25,8 @@ var fintekkers_models_price_price_pb = require('../../../fintekkers/models/price
|
|
|
25
25
|
goog.object.extend(proto, fintekkers_models_price_price_pb);
|
|
26
26
|
var fintekkers_requests_price_query_price_request_pb = require('../../../fintekkers/requests/price/query_price_request_pb.js');
|
|
27
27
|
goog.object.extend(proto, fintekkers_requests_price_query_price_request_pb);
|
|
28
|
+
var fintekkers_requests_util_errors_summary_pb = require('../../../fintekkers/requests/util/errors/summary_pb.js');
|
|
29
|
+
goog.object.extend(proto, fintekkers_requests_util_errors_summary_pb);
|
|
28
30
|
goog.exportSymbol('proto.fintekkers.requests.price.QueryPriceResponseProto', null, global);
|
|
29
31
|
/**
|
|
30
32
|
* Generated by JsPbCodeGenerator.
|
|
@@ -90,7 +92,8 @@ proto.fintekkers.requests.price.QueryPriceResponseProto.toObject = function(incl
|
|
|
90
92
|
version: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
91
93
|
queryPriceRequest: (f = msg.getQueryPriceRequest()) && fintekkers_requests_price_query_price_request_pb.QueryPriceRequestProto.toObject(includeInstance, f),
|
|
92
94
|
priceResponseList: jspb.Message.toObjectList(msg.getPriceResponseList(),
|
|
93
|
-
fintekkers_models_price_price_pb.PriceProto.toObject, includeInstance)
|
|
95
|
+
fintekkers_models_price_price_pb.PriceProto.toObject, includeInstance),
|
|
96
|
+
errorsOrWarnings: (f = msg.getErrorsOrWarnings()) && fintekkers_requests_util_errors_summary_pb.SummaryProto.toObject(includeInstance, f)
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
if (includeInstance) {
|
|
@@ -145,6 +148,11 @@ proto.fintekkers.requests.price.QueryPriceResponseProto.deserializeBinaryFromRea
|
|
|
145
148
|
reader.readMessage(value,fintekkers_models_price_price_pb.PriceProto.deserializeBinaryFromReader);
|
|
146
149
|
msg.addPriceResponse(value);
|
|
147
150
|
break;
|
|
151
|
+
case 40:
|
|
152
|
+
var value = new fintekkers_requests_util_errors_summary_pb.SummaryProto;
|
|
153
|
+
reader.readMessage(value,fintekkers_requests_util_errors_summary_pb.SummaryProto.deserializeBinaryFromReader);
|
|
154
|
+
msg.setErrorsOrWarnings(value);
|
|
155
|
+
break;
|
|
148
156
|
default:
|
|
149
157
|
reader.skipField();
|
|
150
158
|
break;
|
|
@@ -204,6 +212,14 @@ proto.fintekkers.requests.price.QueryPriceResponseProto.serializeBinaryToWriter
|
|
|
204
212
|
fintekkers_models_price_price_pb.PriceProto.serializeBinaryToWriter
|
|
205
213
|
);
|
|
206
214
|
}
|
|
215
|
+
f = message.getErrorsOrWarnings();
|
|
216
|
+
if (f != null) {
|
|
217
|
+
writer.writeMessage(
|
|
218
|
+
40,
|
|
219
|
+
f,
|
|
220
|
+
fintekkers_requests_util_errors_summary_pb.SummaryProto.serializeBinaryToWriter
|
|
221
|
+
);
|
|
222
|
+
}
|
|
207
223
|
};
|
|
208
224
|
|
|
209
225
|
|
|
@@ -318,4 +334,41 @@ proto.fintekkers.requests.price.QueryPriceResponseProto.prototype.clearPriceResp
|
|
|
318
334
|
};
|
|
319
335
|
|
|
320
336
|
|
|
337
|
+
/**
|
|
338
|
+
* optional fintekkers.requests.util.errors.SummaryProto errors_or_warnings = 40;
|
|
339
|
+
* @return {?proto.fintekkers.requests.util.errors.SummaryProto}
|
|
340
|
+
*/
|
|
341
|
+
proto.fintekkers.requests.price.QueryPriceResponseProto.prototype.getErrorsOrWarnings = function() {
|
|
342
|
+
return /** @type{?proto.fintekkers.requests.util.errors.SummaryProto} */ (
|
|
343
|
+
jspb.Message.getWrapperField(this, fintekkers_requests_util_errors_summary_pb.SummaryProto, 40));
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @param {?proto.fintekkers.requests.util.errors.SummaryProto|undefined} value
|
|
349
|
+
* @return {!proto.fintekkers.requests.price.QueryPriceResponseProto} returns this
|
|
350
|
+
*/
|
|
351
|
+
proto.fintekkers.requests.price.QueryPriceResponseProto.prototype.setErrorsOrWarnings = function(value) {
|
|
352
|
+
return jspb.Message.setWrapperField(this, 40, value);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Clears the message field making it undefined.
|
|
358
|
+
* @return {!proto.fintekkers.requests.price.QueryPriceResponseProto} returns this
|
|
359
|
+
*/
|
|
360
|
+
proto.fintekkers.requests.price.QueryPriceResponseProto.prototype.clearErrorsOrWarnings = function() {
|
|
361
|
+
return this.setErrorsOrWarnings(undefined);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Returns whether this field is set.
|
|
367
|
+
* @return {boolean}
|
|
368
|
+
*/
|
|
369
|
+
proto.fintekkers.requests.price.QueryPriceResponseProto.prototype.hasErrorsOrWarnings = function() {
|
|
370
|
+
return jspb.Message.getField(this, 40) != null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
|
|
321
374
|
goog.object.extend(exports, proto.fintekkers.requests.price);
|
|
@@ -35,6 +35,14 @@ declare class BondSecurity extends Security {
|
|
|
35
35
|
* @returns The price scale factor as a Decimal (0.01)
|
|
36
36
|
*/
|
|
37
37
|
getPriceScaleFactor(): Decimal;
|
|
38
|
+
/**
|
|
39
|
+
* Bond issue date is the auction date and is required for bonds.
|
|
40
|
+
* Overrides Security.getIssueDate (which returns LocalDate | null on the
|
|
41
|
+
* base) with a non-nullable return type — for a properly-formed bond,
|
|
42
|
+
* issue date is always present, and TS callers narrowed via isBond()
|
|
43
|
+
* shouldn't have to null-check.
|
|
44
|
+
*/
|
|
45
|
+
getIssueDate(): LocalDate;
|
|
38
46
|
getProductType(): string;
|
|
39
47
|
}
|
|
40
48
|
export default BondSecurity;
|
|
@@ -104,6 +104,19 @@ class BondSecurity extends security_1.default {
|
|
|
104
104
|
getPriceScaleFactor() {
|
|
105
105
|
return new decimal_js_1.Decimal('0.01');
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Bond issue date is the auction date and is required for bonds.
|
|
109
|
+
* Overrides Security.getIssueDate (which returns LocalDate | null on the
|
|
110
|
+
* base) with a non-nullable return type — for a properly-formed bond,
|
|
111
|
+
* issue date is always present, and TS callers narrowed via isBond()
|
|
112
|
+
* shouldn't have to null-check.
|
|
113
|
+
*/
|
|
114
|
+
getIssueDate() {
|
|
115
|
+
const date = super.getIssueDate();
|
|
116
|
+
if (!date)
|
|
117
|
+
throw new Error("Issue date is required for bonds");
|
|
118
|
+
return date;
|
|
119
|
+
}
|
|
107
120
|
getProductType() {
|
|
108
121
|
// Only BondSecurity has getTenor implemented
|
|
109
122
|
// Check if getTenor method exists (it's only in BondSecurity)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BondSecurity.js","sourceRoot":"","sources":["BondSecurity.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC,2FAAyF;AAEzF,wCAA0C;AAE1C,yDAAqD;AACrD,+CAA2C;AAC3C,iCAAuC;AACvC,qFAAmF;AACnF,2CAAqC;AAErC,MAAM,YAAa,SAAQ,kBAAQ;IACjC,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,KAAK,CAAC,eAAe,EAAE,KAAK,oCAAiB,CAAC,aAAa,IAAI,KAAK,CAAC,eAAe,EAAE,KAAK,oCAAiB,CA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AAC;SACf;aAAM;YACL,OAAO,MAAM,CAAC;SACf;IACH,CAAC;CACF;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -116,6 +116,19 @@ class BondSecurity extends Security {
|
|
|
116
116
|
return new Decimal('0.01');
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Bond issue date is the auction date and is required for bonds.
|
|
121
|
+
* Overrides Security.getIssueDate (which returns LocalDate | null on the
|
|
122
|
+
* base) with a non-nullable return type — for a properly-formed bond,
|
|
123
|
+
* issue date is always present, and TS callers narrowed via isBond()
|
|
124
|
+
* shouldn't have to null-check.
|
|
125
|
+
*/
|
|
126
|
+
getIssueDate(): LocalDate {
|
|
127
|
+
const date = super.getIssueDate();
|
|
128
|
+
if (!date) throw new Error("Issue date is required for bonds");
|
|
129
|
+
return date;
|
|
130
|
+
}
|
|
131
|
+
|
|
119
132
|
getProductType(): string {
|
|
120
133
|
// Only BondSecurity has getTenor implemented
|
|
121
134
|
// Check if getTenor method exists (it's only in BondSecurity)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AssetClassProto } from '../../../fintekkers/models/security/asset_class_pb';
|
|
2
|
+
/**
|
|
3
|
+
* Static helpers around the AssetClass proto enum, mirroring the
|
|
4
|
+
* Identifier wrapper pattern shipped in v0.1.133 (PR #188) and the
|
|
5
|
+
* SecurityType wrapper alongside this file.
|
|
6
|
+
*
|
|
7
|
+
* Note: SecurityProto.asset_class is currently a `string` field
|
|
8
|
+
* (security.proto field 11). This enum defines the canonical vocabulary;
|
|
9
|
+
* the field type stays string in this release to avoid coordinating a
|
|
10
|
+
* breaking change with downstream services. A follow-up will flip the
|
|
11
|
+
* field type after a data-normalization audit.
|
|
12
|
+
*
|
|
13
|
+
* Until then: producers SHOULD use `AssetClass.getAllTypeNames()` as
|
|
14
|
+
* the source of truth for the legal string values; consumers SHOULD
|
|
15
|
+
* use `AssetClass.fromName(name)` to validate a string against the
|
|
16
|
+
* canonical vocabulary.
|
|
17
|
+
*/
|
|
18
|
+
export declare class AssetClass {
|
|
19
|
+
/**
|
|
20
|
+
* Returns the names of all known AssetClassProto values, EXCLUDING
|
|
21
|
+
* the sentinel `UNKNOWN_ASSET_CLASS`. Drives UI dropdowns / pickers
|
|
22
|
+
* so adding a new proto enum variant auto-propagates to consumers.
|
|
23
|
+
*
|
|
24
|
+
* Order matches proto declaration order.
|
|
25
|
+
*/
|
|
26
|
+
static getAllTypeNames(): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a proto enum NAME (e.g., "FIXED_INCOME", "EQUITY") to its
|
|
29
|
+
* numeric AssetClassProto value. Throws on unknown name; the error
|
|
30
|
+
* lists the valid names so typos are fixable without grepping the
|
|
31
|
+
* proto.
|
|
32
|
+
*
|
|
33
|
+
* @param name proto enum key (e.g., "FIXED_INCOME")
|
|
34
|
+
* @returns the numeric AssetClassProto value
|
|
35
|
+
*/
|
|
36
|
+
static fromName(name: string): AssetClassProto;
|
|
37
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetClass = void 0;
|
|
4
|
+
const asset_class_pb_1 = require("../../../fintekkers/models/security/asset_class_pb");
|
|
5
|
+
/**
|
|
6
|
+
* Static helpers around the AssetClass proto enum, mirroring the
|
|
7
|
+
* Identifier wrapper pattern shipped in v0.1.133 (PR #188) and the
|
|
8
|
+
* SecurityType wrapper alongside this file.
|
|
9
|
+
*
|
|
10
|
+
* Note: SecurityProto.asset_class is currently a `string` field
|
|
11
|
+
* (security.proto field 11). This enum defines the canonical vocabulary;
|
|
12
|
+
* the field type stays string in this release to avoid coordinating a
|
|
13
|
+
* breaking change with downstream services. A follow-up will flip the
|
|
14
|
+
* field type after a data-normalization audit.
|
|
15
|
+
*
|
|
16
|
+
* Until then: producers SHOULD use `AssetClass.getAllTypeNames()` as
|
|
17
|
+
* the source of truth for the legal string values; consumers SHOULD
|
|
18
|
+
* use `AssetClass.fromName(name)` to validate a string against the
|
|
19
|
+
* canonical vocabulary.
|
|
20
|
+
*/
|
|
21
|
+
class AssetClass {
|
|
22
|
+
/**
|
|
23
|
+
* Returns the names of all known AssetClassProto values, EXCLUDING
|
|
24
|
+
* the sentinel `UNKNOWN_ASSET_CLASS`. Drives UI dropdowns / pickers
|
|
25
|
+
* so adding a new proto enum variant auto-propagates to consumers.
|
|
26
|
+
*
|
|
27
|
+
* Order matches proto declaration order.
|
|
28
|
+
*/
|
|
29
|
+
static getAllTypeNames() {
|
|
30
|
+
return Object.keys(asset_class_pb_1.AssetClassProto).filter(k => k !== 'UNKNOWN_ASSET_CLASS');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a proto enum NAME (e.g., "FIXED_INCOME", "EQUITY") to its
|
|
34
|
+
* numeric AssetClassProto value. Throws on unknown name; the error
|
|
35
|
+
* lists the valid names so typos are fixable without grepping the
|
|
36
|
+
* proto.
|
|
37
|
+
*
|
|
38
|
+
* @param name proto enum key (e.g., "FIXED_INCOME")
|
|
39
|
+
* @returns the numeric AssetClassProto value
|
|
40
|
+
*/
|
|
41
|
+
static fromName(name) {
|
|
42
|
+
const enumObj = asset_class_pb_1.AssetClassProto;
|
|
43
|
+
const enumValue = enumObj[name];
|
|
44
|
+
if (enumValue === undefined) {
|
|
45
|
+
throw new Error(`Unknown AssetClass name: '${name}'. Valid names: ${AssetClass.getAllTypeNames().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
return enumValue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.AssetClass = AssetClass;
|
|
51
|
+
//# sourceMappingURL=asset_class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset_class.js","sourceRoot":"","sources":["asset_class.ts"],"names":[],"mappings":";;;AAAA,uFAAqF;AAErF;;;;;;;;;;;;;;;GAeG;AACH,MAAa,UAAU;IAEnB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe;QAClB,OAAO,MAAM,CAAC,IAAI,CAAC,gCAAe,CAAC,CAAC,MAAM,CACtC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,qBAAqB,CACnC,CAAC;IACN,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAY;QACxB,MAAM,OAAO,GAAG,gCAAoD,CAAC;QACrE,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,SAAS,KAAK,SAAS,EAAE;YACzB,MAAM,IAAI,KAAK,CACX,6BAA6B,IAAI,mBAAmB,UAAU,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChG,CAAC;SACL;QACD,OAAO,SAA4B,CAAC;IACxC,CAAC;CACJ;AAlCD,gCAkCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const asset_class_1 = require("./asset_class");
|
|
4
|
+
const asset_class_pb_1 = require("../../../fintekkers/models/security/asset_class_pb");
|
|
5
|
+
describe('AssetClass.fromName', () => {
|
|
6
|
+
test.each(asset_class_1.AssetClass.getAllTypeNames())('fromName("%s") returns the matching numeric enum value', (name) => {
|
|
7
|
+
const value = asset_class_1.AssetClass.fromName(name);
|
|
8
|
+
const expected = asset_class_pb_1.AssetClassProto[name];
|
|
9
|
+
expect(value).toBe(expected);
|
|
10
|
+
});
|
|
11
|
+
test('throws on unknown name and lists valid names in the error', () => {
|
|
12
|
+
let err;
|
|
13
|
+
try {
|
|
14
|
+
asset_class_1.AssetClass.fromName('COMMODITY');
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
err = e;
|
|
18
|
+
}
|
|
19
|
+
expect(err).toBeDefined();
|
|
20
|
+
expect(err.message).toContain('COMMODITY');
|
|
21
|
+
// Hint with valid entries
|
|
22
|
+
expect(err.message).toContain('FIXED_INCOME');
|
|
23
|
+
expect(err.message).toContain('EQUITY');
|
|
24
|
+
});
|
|
25
|
+
test('accepts UNKNOWN_ASSET_CLASS — sentinel is a valid enum key', () => {
|
|
26
|
+
// Same pin as SecurityType / Identifier: excluded from getAllTypeNames
|
|
27
|
+
// (no dropdown surface), but valid via fromName.
|
|
28
|
+
expect(asset_class_1.AssetClass.fromName('UNKNOWN_ASSET_CLASS')).toBe(asset_class_pb_1.AssetClassProto.UNKNOWN_ASSET_CLASS);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('AssetClass.getAllTypeNames', () => {
|
|
32
|
+
test('returns the expected set in proto-declaration order, excluding UNKNOWN', () => {
|
|
33
|
+
// Proto-declared order in asset_class.proto:
|
|
34
|
+
// UNKNOWN_ASSET_CLASS = 0; (excluded)
|
|
35
|
+
// FIXED_INCOME = 1;
|
|
36
|
+
// EQUITY = 2;
|
|
37
|
+
// CASH_ASSET_CLASS = 3; (suffixed to avoid name collision
|
|
38
|
+
// with IdentifierTypeProto.CASH per
|
|
39
|
+
// proto3 package-wide uniqueness)
|
|
40
|
+
// INDEX = 4;
|
|
41
|
+
expect(asset_class_1.AssetClass.getAllTypeNames()).toEqual([
|
|
42
|
+
'FIXED_INCOME',
|
|
43
|
+
'EQUITY',
|
|
44
|
+
'CASH_ASSET_CLASS',
|
|
45
|
+
'INDEX',
|
|
46
|
+
]);
|
|
47
|
+
});
|
|
48
|
+
test('excludes the UNKNOWN_ASSET_CLASS sentinel', () => {
|
|
49
|
+
expect(asset_class_1.AssetClass.getAllTypeNames()).not.toContain('UNKNOWN_ASSET_CLASS');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=asset_class.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset_class.test.js","sourceRoot":"","sources":["asset_class.test.ts"],"names":[],"mappings":";;AAAA,+CAA2C;AAC3C,uFA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AChF,6CAA6C;QAC7C,4CAA4C;QAC5C,sBAAsB;QACtB,gBAAgB;QAChB,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,eAAe;QACf,MAAM,CAAC,wBAAU,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC;YACzC,cAAc;YACd,QAAQ;YACR,kBAAkB;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,wBAAU,CAAC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AssetClass } from './asset_class';
|
|
2
|
+
import { AssetClassProto } from '../../../fintekkers/models/security/asset_class_pb';
|
|
3
|
+
|
|
4
|
+
describe('AssetClass.fromName', () => {
|
|
5
|
+
test.each(AssetClass.getAllTypeNames())(
|
|
6
|
+
'fromName("%s") returns the matching numeric enum value',
|
|
7
|
+
(name: string) => {
|
|
8
|
+
const value = AssetClass.fromName(name);
|
|
9
|
+
const expected = (AssetClassProto as unknown as Record<string, number>)[name];
|
|
10
|
+
expect(value).toBe(expected);
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
test('throws on unknown name and lists valid names in the error', () => {
|
|
15
|
+
let err: Error | undefined;
|
|
16
|
+
try {
|
|
17
|
+
AssetClass.fromName('COMMODITY');
|
|
18
|
+
} catch (e) {
|
|
19
|
+
err = e as Error;
|
|
20
|
+
}
|
|
21
|
+
expect(err).toBeDefined();
|
|
22
|
+
expect(err!.message).toContain('COMMODITY');
|
|
23
|
+
// Hint with valid entries
|
|
24
|
+
expect(err!.message).toContain('FIXED_INCOME');
|
|
25
|
+
expect(err!.message).toContain('EQUITY');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('accepts UNKNOWN_ASSET_CLASS — sentinel is a valid enum key', () => {
|
|
29
|
+
// Same pin as SecurityType / Identifier: excluded from getAllTypeNames
|
|
30
|
+
// (no dropdown surface), but valid via fromName.
|
|
31
|
+
expect(AssetClass.fromName('UNKNOWN_ASSET_CLASS')).toBe(
|
|
32
|
+
AssetClassProto.UNKNOWN_ASSET_CLASS
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('AssetClass.getAllTypeNames', () => {
|
|
38
|
+
test('returns the expected set in proto-declaration order, excluding UNKNOWN', () => {
|
|
39
|
+
// Proto-declared order in asset_class.proto:
|
|
40
|
+
// UNKNOWN_ASSET_CLASS = 0; (excluded)
|
|
41
|
+
// FIXED_INCOME = 1;
|
|
42
|
+
// EQUITY = 2;
|
|
43
|
+
// CASH_ASSET_CLASS = 3; (suffixed to avoid name collision
|
|
44
|
+
// with IdentifierTypeProto.CASH per
|
|
45
|
+
// proto3 package-wide uniqueness)
|
|
46
|
+
// INDEX = 4;
|
|
47
|
+
expect(AssetClass.getAllTypeNames()).toEqual([
|
|
48
|
+
'FIXED_INCOME',
|
|
49
|
+
'EQUITY',
|
|
50
|
+
'CASH_ASSET_CLASS',
|
|
51
|
+
'INDEX',
|
|
52
|
+
]);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('excludes the UNKNOWN_ASSET_CLASS sentinel', () => {
|
|
56
|
+
expect(AssetClass.getAllTypeNames()).not.toContain('UNKNOWN_ASSET_CLASS');
|
|
57
|
+
});
|
|
58
|
+
});
|