@fintekkers/ledger-models 0.2.4 → 0.2.5
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/identifier/identifier_type_pb.d.ts +1 -0
- package/node/fintekkers/models/security/identifier/identifier_type_pb.js +1 -0
- package/node/fintekkers/models/security/security_pb.d.ts +9 -5
- package/node/fintekkers/models/security/security_pb.js +74 -16
- package/node/fintekkers/requests/security/query_security_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/security/query_security_request_pb.js +31 -1
- package/node/wrappers/models/security/identifier.test.js +2 -0
- package/node/wrappers/models/security/identifier.test.js.map +1 -1
- package/node/wrappers/models/security/identifier.test.ts +2 -0
- package/node/wrappers/models/security/security-roundtrip.test.js +96 -12
- package/node/wrappers/models/security/security-roundtrip.test.js.map +1 -1
- package/node/wrappers/models/security/security-roundtrip.test.ts +97 -0
- package/node/wrappers/models/security/security.d.ts +25 -0
- package/node/wrappers/models/security/security.js +60 -0
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.ts +65 -0
- package/package.json +1 -1
- package/node/fintekkers/models/security/security_id_pb.d.ts +0 -31
- package/node/fintekkers/models/security/security_id_pb.js +0 -199
|
@@ -13,7 +13,6 @@ import * as fintekkers_models_security_identifier_identifier_pb from "../../../f
|
|
|
13
13
|
import * as fintekkers_models_security_bond_issuance_pb from "../../../fintekkers/models/security/bond/issuance_pb";
|
|
14
14
|
import * as fintekkers_models_security_product_type_pb from "../../../fintekkers/models/security/product_type_pb";
|
|
15
15
|
import * as fintekkers_models_security_instrument_type_pb from "../../../fintekkers/models/security/instrument_type_pb";
|
|
16
|
-
import * as fintekkers_models_security_security_id_pb from "../../../fintekkers/models/security/security_id_pb";
|
|
17
16
|
import * as fintekkers_models_security_security_quantity_type_pb from "../../../fintekkers/models/security/security_quantity_type_pb";
|
|
18
17
|
import * as fintekkers_models_security_coupon_frequency_pb from "../../../fintekkers/models/security/coupon_frequency_pb";
|
|
19
18
|
import * as fintekkers_models_security_coupon_type_pb from "../../../fintekkers/models/security/coupon_type_pb";
|
|
@@ -51,9 +50,9 @@ export class SecurityProto extends jspb.Message {
|
|
|
51
50
|
getInstrumentType(): fintekkers_models_security_instrument_type_pb.InstrumentTypeProto;
|
|
52
51
|
setInstrumentType(value: fintekkers_models_security_instrument_type_pb.InstrumentTypeProto): SecurityProto;
|
|
53
52
|
clearLegsList(): void;
|
|
54
|
-
getLegsList(): Array<
|
|
55
|
-
setLegsList(value: Array<
|
|
56
|
-
addLegs(value?:
|
|
53
|
+
getLegsList(): Array<SecurityProto>;
|
|
54
|
+
setLegsList(value: Array<SecurityProto>): SecurityProto;
|
|
55
|
+
addLegs(value?: SecurityProto, index?: number): SecurityProto;
|
|
57
56
|
|
|
58
57
|
hasDeletedAt(): boolean;
|
|
59
58
|
clearDeletedAt(): void;
|
|
@@ -198,7 +197,7 @@ export namespace SecurityProto {
|
|
|
198
197
|
validTo?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
199
198
|
productType: fintekkers_models_security_product_type_pb.ProductTypeProto,
|
|
200
199
|
instrumentType: fintekkers_models_security_instrument_type_pb.InstrumentTypeProto,
|
|
201
|
-
legsList: Array<
|
|
200
|
+
legsList: Array<SecurityProto.AsObject>,
|
|
202
201
|
deletedAt?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
203
202
|
assetClass: string,
|
|
204
203
|
issuerName: string,
|
|
@@ -449,6 +448,10 @@ export namespace FrnDetailsProto {
|
|
|
449
448
|
export class IndexDetailsProto extends jspb.Message {
|
|
450
449
|
getIndexType(): fintekkers_models_security_index_index_type_pb.IndexTypeProto;
|
|
451
450
|
setIndexType(value: fintekkers_models_security_index_index_type_pb.IndexTypeProto): IndexDetailsProto;
|
|
451
|
+
clearConstituentsList(): void;
|
|
452
|
+
getConstituentsList(): Array<SecurityProto>;
|
|
453
|
+
setConstituentsList(value: Array<SecurityProto>): IndexDetailsProto;
|
|
454
|
+
addConstituents(value?: SecurityProto, index?: number): SecurityProto;
|
|
452
455
|
|
|
453
456
|
serializeBinary(): Uint8Array;
|
|
454
457
|
toObject(includeInstance?: boolean): IndexDetailsProto.AsObject;
|
|
@@ -463,6 +466,7 @@ export class IndexDetailsProto extends jspb.Message {
|
|
|
463
466
|
export namespace IndexDetailsProto {
|
|
464
467
|
export type AsObject = {
|
|
465
468
|
indexType: fintekkers_models_security_index_index_type_pb.IndexTypeProto,
|
|
469
|
+
constituentsList: Array<SecurityProto.AsObject>,
|
|
466
470
|
}
|
|
467
471
|
}
|
|
468
472
|
|
|
@@ -37,8 +37,6 @@ var fintekkers_models_security_product_type_pb = require('../../../fintekkers/mo
|
|
|
37
37
|
goog.object.extend(proto, fintekkers_models_security_product_type_pb);
|
|
38
38
|
var fintekkers_models_security_instrument_type_pb = require('../../../fintekkers/models/security/instrument_type_pb.js');
|
|
39
39
|
goog.object.extend(proto, fintekkers_models_security_instrument_type_pb);
|
|
40
|
-
var fintekkers_models_security_security_id_pb = require('../../../fintekkers/models/security/security_id_pb.js');
|
|
41
|
-
goog.object.extend(proto, fintekkers_models_security_security_id_pb);
|
|
42
40
|
var fintekkers_models_security_security_quantity_type_pb = require('../../../fintekkers/models/security/security_quantity_type_pb.js');
|
|
43
41
|
goog.object.extend(proto, fintekkers_models_security_security_quantity_type_pb);
|
|
44
42
|
var fintekkers_models_security_coupon_frequency_pb = require('../../../fintekkers/models/security/coupon_frequency_pb.js');
|
|
@@ -151,7 +149,7 @@ if (goog.DEBUG && !COMPILED) {
|
|
|
151
149
|
* @constructor
|
|
152
150
|
*/
|
|
153
151
|
proto.fintekkers.models.security.IndexDetailsProto = function(opt_data) {
|
|
154
|
-
jspb.Message.initialize(this, opt_data, 0, -1,
|
|
152
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.fintekkers.models.security.IndexDetailsProto.repeatedFields_, null);
|
|
155
153
|
};
|
|
156
154
|
goog.inherits(proto.fintekkers.models.security.IndexDetailsProto, jspb.Message);
|
|
157
155
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -304,7 +302,7 @@ proto.fintekkers.models.security.SecurityProto.toObject = function(includeInstan
|
|
|
304
302
|
productType: jspb.Message.getFieldWithDefault(msg, 10, 0),
|
|
305
303
|
instrumentType: jspb.Message.getFieldWithDefault(msg, 16, 0),
|
|
306
304
|
legsList: jspb.Message.toObjectList(msg.getLegsList(),
|
|
307
|
-
|
|
305
|
+
proto.fintekkers.models.security.SecurityProto.toObject, includeInstance),
|
|
308
306
|
deletedAt: (f = msg.getDeletedAt()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
309
307
|
assetClass: jspb.Message.getFieldWithDefault(msg, 11, ""),
|
|
310
308
|
issuerName: jspb.Message.getFieldWithDefault(msg, 12, ""),
|
|
@@ -415,8 +413,8 @@ proto.fintekkers.models.security.SecurityProto.deserializeBinaryFromReader = fun
|
|
|
415
413
|
msg.setInstrumentType(value);
|
|
416
414
|
break;
|
|
417
415
|
case 17:
|
|
418
|
-
var value = new
|
|
419
|
-
reader.readMessage(value,
|
|
416
|
+
var value = new proto.fintekkers.models.security.SecurityProto;
|
|
417
|
+
reader.readMessage(value,proto.fintekkers.models.security.SecurityProto.deserializeBinaryFromReader);
|
|
420
418
|
msg.addLegs(value);
|
|
421
419
|
break;
|
|
422
420
|
case 15:
|
|
@@ -664,7 +662,7 @@ proto.fintekkers.models.security.SecurityProto.serializeBinaryToWriter = functio
|
|
|
664
662
|
writer.writeRepeatedMessage(
|
|
665
663
|
17,
|
|
666
664
|
f,
|
|
667
|
-
|
|
665
|
+
proto.fintekkers.models.security.SecurityProto.serializeBinaryToWriter
|
|
668
666
|
);
|
|
669
667
|
}
|
|
670
668
|
f = message.getDeletedAt();
|
|
@@ -1146,17 +1144,17 @@ proto.fintekkers.models.security.SecurityProto.prototype.setInstrumentType = fun
|
|
|
1146
1144
|
|
|
1147
1145
|
|
|
1148
1146
|
/**
|
|
1149
|
-
* repeated
|
|
1150
|
-
* @return {!Array<!proto.fintekkers.models.security.
|
|
1147
|
+
* repeated SecurityProto legs = 17;
|
|
1148
|
+
* @return {!Array<!proto.fintekkers.models.security.SecurityProto>}
|
|
1151
1149
|
*/
|
|
1152
1150
|
proto.fintekkers.models.security.SecurityProto.prototype.getLegsList = function() {
|
|
1153
|
-
return /** @type{!Array<!proto.fintekkers.models.security.
|
|
1154
|
-
jspb.Message.getRepeatedWrapperField(this,
|
|
1151
|
+
return /** @type{!Array<!proto.fintekkers.models.security.SecurityProto>} */ (
|
|
1152
|
+
jspb.Message.getRepeatedWrapperField(this, proto.fintekkers.models.security.SecurityProto, 17));
|
|
1155
1153
|
};
|
|
1156
1154
|
|
|
1157
1155
|
|
|
1158
1156
|
/**
|
|
1159
|
-
* @param {!Array<!proto.fintekkers.models.security.
|
|
1157
|
+
* @param {!Array<!proto.fintekkers.models.security.SecurityProto>} value
|
|
1160
1158
|
* @return {!proto.fintekkers.models.security.SecurityProto} returns this
|
|
1161
1159
|
*/
|
|
1162
1160
|
proto.fintekkers.models.security.SecurityProto.prototype.setLegsList = function(value) {
|
|
@@ -1165,12 +1163,12 @@ proto.fintekkers.models.security.SecurityProto.prototype.setLegsList = function(
|
|
|
1165
1163
|
|
|
1166
1164
|
|
|
1167
1165
|
/**
|
|
1168
|
-
* @param {!proto.fintekkers.models.security.
|
|
1166
|
+
* @param {!proto.fintekkers.models.security.SecurityProto=} opt_value
|
|
1169
1167
|
* @param {number=} opt_index
|
|
1170
|
-
* @return {!proto.fintekkers.models.security.
|
|
1168
|
+
* @return {!proto.fintekkers.models.security.SecurityProto}
|
|
1171
1169
|
*/
|
|
1172
1170
|
proto.fintekkers.models.security.SecurityProto.prototype.addLegs = function(opt_value, opt_index) {
|
|
1173
|
-
return jspb.Message.addToRepeatedWrapperField(this, 17, opt_value, proto.fintekkers.models.security.
|
|
1171
|
+
return jspb.Message.addToRepeatedWrapperField(this, 17, opt_value, proto.fintekkers.models.security.SecurityProto, opt_index);
|
|
1174
1172
|
};
|
|
1175
1173
|
|
|
1176
1174
|
|
|
@@ -3792,6 +3790,13 @@ proto.fintekkers.models.security.FrnDetailsProto.prototype.setResetFrequency = f
|
|
|
3792
3790
|
|
|
3793
3791
|
|
|
3794
3792
|
|
|
3793
|
+
/**
|
|
3794
|
+
* List of repeated fields within this message type.
|
|
3795
|
+
* @private {!Array<number>}
|
|
3796
|
+
* @const
|
|
3797
|
+
*/
|
|
3798
|
+
proto.fintekkers.models.security.IndexDetailsProto.repeatedFields_ = [2];
|
|
3799
|
+
|
|
3795
3800
|
|
|
3796
3801
|
|
|
3797
3802
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
@@ -3823,7 +3828,9 @@ proto.fintekkers.models.security.IndexDetailsProto.prototype.toObject = function
|
|
|
3823
3828
|
*/
|
|
3824
3829
|
proto.fintekkers.models.security.IndexDetailsProto.toObject = function(includeInstance, msg) {
|
|
3825
3830
|
var f, obj = {
|
|
3826
|
-
indexType: jspb.Message.getFieldWithDefault(msg, 1, 0)
|
|
3831
|
+
indexType: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
|
3832
|
+
constituentsList: jspb.Message.toObjectList(msg.getConstituentsList(),
|
|
3833
|
+
proto.fintekkers.models.security.SecurityProto.toObject, includeInstance)
|
|
3827
3834
|
};
|
|
3828
3835
|
|
|
3829
3836
|
if (includeInstance) {
|
|
@@ -3864,6 +3871,11 @@ proto.fintekkers.models.security.IndexDetailsProto.deserializeBinaryFromReader =
|
|
|
3864
3871
|
var value = /** @type {!proto.fintekkers.models.security.index.IndexTypeProto} */ (reader.readEnum());
|
|
3865
3872
|
msg.setIndexType(value);
|
|
3866
3873
|
break;
|
|
3874
|
+
case 2:
|
|
3875
|
+
var value = new proto.fintekkers.models.security.SecurityProto;
|
|
3876
|
+
reader.readMessage(value,proto.fintekkers.models.security.SecurityProto.deserializeBinaryFromReader);
|
|
3877
|
+
msg.addConstituents(value);
|
|
3878
|
+
break;
|
|
3867
3879
|
default:
|
|
3868
3880
|
reader.skipField();
|
|
3869
3881
|
break;
|
|
@@ -3900,6 +3912,14 @@ proto.fintekkers.models.security.IndexDetailsProto.serializeBinaryToWriter = fun
|
|
|
3900
3912
|
f
|
|
3901
3913
|
);
|
|
3902
3914
|
}
|
|
3915
|
+
f = message.getConstituentsList();
|
|
3916
|
+
if (f.length > 0) {
|
|
3917
|
+
writer.writeRepeatedMessage(
|
|
3918
|
+
2,
|
|
3919
|
+
f,
|
|
3920
|
+
proto.fintekkers.models.security.SecurityProto.serializeBinaryToWriter
|
|
3921
|
+
);
|
|
3922
|
+
}
|
|
3903
3923
|
};
|
|
3904
3924
|
|
|
3905
3925
|
|
|
@@ -3921,6 +3941,44 @@ proto.fintekkers.models.security.IndexDetailsProto.prototype.setIndexType = func
|
|
|
3921
3941
|
};
|
|
3922
3942
|
|
|
3923
3943
|
|
|
3944
|
+
/**
|
|
3945
|
+
* repeated SecurityProto constituents = 2;
|
|
3946
|
+
* @return {!Array<!proto.fintekkers.models.security.SecurityProto>}
|
|
3947
|
+
*/
|
|
3948
|
+
proto.fintekkers.models.security.IndexDetailsProto.prototype.getConstituentsList = function() {
|
|
3949
|
+
return /** @type{!Array<!proto.fintekkers.models.security.SecurityProto>} */ (
|
|
3950
|
+
jspb.Message.getRepeatedWrapperField(this, proto.fintekkers.models.security.SecurityProto, 2));
|
|
3951
|
+
};
|
|
3952
|
+
|
|
3953
|
+
|
|
3954
|
+
/**
|
|
3955
|
+
* @param {!Array<!proto.fintekkers.models.security.SecurityProto>} value
|
|
3956
|
+
* @return {!proto.fintekkers.models.security.IndexDetailsProto} returns this
|
|
3957
|
+
*/
|
|
3958
|
+
proto.fintekkers.models.security.IndexDetailsProto.prototype.setConstituentsList = function(value) {
|
|
3959
|
+
return jspb.Message.setRepeatedWrapperField(this, 2, value);
|
|
3960
|
+
};
|
|
3961
|
+
|
|
3962
|
+
|
|
3963
|
+
/**
|
|
3964
|
+
* @param {!proto.fintekkers.models.security.SecurityProto=} opt_value
|
|
3965
|
+
* @param {number=} opt_index
|
|
3966
|
+
* @return {!proto.fintekkers.models.security.SecurityProto}
|
|
3967
|
+
*/
|
|
3968
|
+
proto.fintekkers.models.security.IndexDetailsProto.prototype.addConstituents = function(opt_value, opt_index) {
|
|
3969
|
+
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.fintekkers.models.security.SecurityProto, opt_index);
|
|
3970
|
+
};
|
|
3971
|
+
|
|
3972
|
+
|
|
3973
|
+
/**
|
|
3974
|
+
* Clears the list making it empty but non-null.
|
|
3975
|
+
* @return {!proto.fintekkers.models.security.IndexDetailsProto} returns this
|
|
3976
|
+
*/
|
|
3977
|
+
proto.fintekkers.models.security.IndexDetailsProto.prototype.clearConstituentsList = function() {
|
|
3978
|
+
return this.setConstituentsList([]);
|
|
3979
|
+
};
|
|
3980
|
+
|
|
3981
|
+
|
|
3924
3982
|
|
|
3925
3983
|
|
|
3926
3984
|
|
|
@@ -30,6 +30,8 @@ export class QuerySecurityRequestProto extends jspb.Message {
|
|
|
30
30
|
setAsOf(value?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto): QuerySecurityRequestProto;
|
|
31
31
|
getNameFilter(): string;
|
|
32
32
|
setNameFilter(value: string): QuerySecurityRequestProto;
|
|
33
|
+
getLookthrough(): boolean;
|
|
34
|
+
setLookthrough(value: boolean): QuerySecurityRequestProto;
|
|
33
35
|
|
|
34
36
|
serializeBinary(): Uint8Array;
|
|
35
37
|
toObject(includeInstance?: boolean): QuerySecurityRequestProto.AsObject;
|
|
@@ -49,5 +51,6 @@ export namespace QuerySecurityRequestProto {
|
|
|
49
51
|
searchSecurityInput?: fintekkers_models_position_position_filter_pb.PositionFilterProto.AsObject,
|
|
50
52
|
asOf?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
51
53
|
nameFilter: string,
|
|
54
|
+
lookthrough: boolean,
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -94,7 +94,8 @@ proto.fintekkers.requests.security.QuerySecurityRequestProto.toObject = function
|
|
|
94
94
|
fintekkers_models_util_uuid_pb.UUIDProto.toObject, includeInstance),
|
|
95
95
|
searchSecurityInput: (f = msg.getSearchSecurityInput()) && fintekkers_models_position_position_filter_pb.PositionFilterProto.toObject(includeInstance, f),
|
|
96
96
|
asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
97
|
-
nameFilter: jspb.Message.getFieldWithDefault(msg, 24, "")
|
|
97
|
+
nameFilter: jspb.Message.getFieldWithDefault(msg, 24, ""),
|
|
98
|
+
lookthrough: jspb.Message.getBooleanFieldWithDefault(msg, 25, false)
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
if (includeInstance) {
|
|
@@ -158,6 +159,10 @@ proto.fintekkers.requests.security.QuerySecurityRequestProto.deserializeBinaryFr
|
|
|
158
159
|
var value = /** @type {string} */ (reader.readString());
|
|
159
160
|
msg.setNameFilter(value);
|
|
160
161
|
break;
|
|
162
|
+
case 25:
|
|
163
|
+
var value = /** @type {boolean} */ (reader.readBool());
|
|
164
|
+
msg.setLookthrough(value);
|
|
165
|
+
break;
|
|
161
166
|
default:
|
|
162
167
|
reader.skipField();
|
|
163
168
|
break;
|
|
@@ -232,6 +237,13 @@ proto.fintekkers.requests.security.QuerySecurityRequestProto.serializeBinaryToWr
|
|
|
232
237
|
f
|
|
233
238
|
);
|
|
234
239
|
}
|
|
240
|
+
f = message.getLookthrough();
|
|
241
|
+
if (f) {
|
|
242
|
+
writer.writeBool(
|
|
243
|
+
25,
|
|
244
|
+
f
|
|
245
|
+
);
|
|
246
|
+
}
|
|
235
247
|
};
|
|
236
248
|
|
|
237
249
|
|
|
@@ -401,4 +413,22 @@ proto.fintekkers.requests.security.QuerySecurityRequestProto.prototype.setNameFi
|
|
|
401
413
|
};
|
|
402
414
|
|
|
403
415
|
|
|
416
|
+
/**
|
|
417
|
+
* optional bool lookthrough = 25;
|
|
418
|
+
* @return {boolean}
|
|
419
|
+
*/
|
|
420
|
+
proto.fintekkers.requests.security.QuerySecurityRequestProto.prototype.getLookthrough = function() {
|
|
421
|
+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 25, false));
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @param {boolean} value
|
|
427
|
+
* @return {!proto.fintekkers.requests.security.QuerySecurityRequestProto} returns this
|
|
428
|
+
*/
|
|
429
|
+
proto.fintekkers.requests.security.QuerySecurityRequestProto.prototype.setLookthrough = function(value) {
|
|
430
|
+
return jspb.Message.setProto3BooleanField(this, 25, value);
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
|
|
404
434
|
goog.object.extend(exports, proto.fintekkers.requests.security);
|
|
@@ -99,6 +99,7 @@ describe('Identifier.getAllTypeNames', () => {
|
|
|
99
99
|
// OSI = 4;
|
|
100
100
|
// FIGI = 5;
|
|
101
101
|
// SERIES_ID = 6;
|
|
102
|
+
// INDEX_NAME = 7;
|
|
102
103
|
// CASH = 50;
|
|
103
104
|
expect(identifier_1.Identifier.getAllTypeNames()).toEqual([
|
|
104
105
|
'EXCH_TICKER',
|
|
@@ -107,6 +108,7 @@ describe('Identifier.getAllTypeNames', () => {
|
|
|
107
108
|
'OSI',
|
|
108
109
|
'FIGI',
|
|
109
110
|
'SERIES_ID',
|
|
111
|
+
'INDEX_NAME',
|
|
110
112
|
'CASH',
|
|
111
113
|
]);
|
|
112
114
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.test.js","sourceRoot":"","sources":["identifier.test.ts"],"names":[],"mappings":";;AAAA,iCAAkC;AAClC,6CAA0C;AAC1C,gGAA+F;AAC/F,0GAAwG;AAExG,IAAI,CAAC,6DAA6D,EAAE,GAAG,EAAE;IACrE,kBAAkB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,8DAA8D,EA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G,EAAE;IACxC,IAAI,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAChF,iDAAiD;QACjD,6CAA6C;QAC7C,qBAAqB;QACrB,cAAc;QACd,eAAe;QACf,aAAa;QACb,cAAc;QACd,mBAAmB;QACnB,oBAAoB;QACpB,eAAe;QACf,MAAM,CAAC,uBAAU,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC;YACzC,aAAa;YACb,MAAM;YACN,OAAO;YACP,KAAK;YACL,MAAM;YACN,WAAW;YACX,YAAY;YACZ,MAAM;SACT,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,CAAC,uBAAU,CAAC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -116,6 +116,7 @@ describe('Identifier.getAllTypeNames', () => {
|
|
|
116
116
|
// OSI = 4;
|
|
117
117
|
// FIGI = 5;
|
|
118
118
|
// SERIES_ID = 6;
|
|
119
|
+
// INDEX_NAME = 7;
|
|
119
120
|
// CASH = 50;
|
|
120
121
|
expect(Identifier.getAllTypeNames()).toEqual([
|
|
121
122
|
'EXCH_TICKER',
|
|
@@ -124,6 +125,7 @@ describe('Identifier.getAllTypeNames', () => {
|
|
|
124
125
|
'OSI',
|
|
125
126
|
'FIGI',
|
|
126
127
|
'SERIES_ID',
|
|
128
|
+
'INDEX_NAME',
|
|
127
129
|
'CASH',
|
|
128
130
|
]);
|
|
129
131
|
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
/**
|
|
4
7
|
* ISSUE #7: SecurityProto round-trip serialization tests for all 6 security types.
|
|
@@ -6,6 +9,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
9
|
* For each type: construct → serialize to bytes → deserialize → verify all fields match.
|
|
7
10
|
*/
|
|
8
11
|
const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
12
|
+
const security_pb_2 = require("../../../fintekkers/models/security/security_pb");
|
|
13
|
+
const security_1 = __importDefault(require("./security"));
|
|
14
|
+
const uuid_1 = require("../utils/uuid");
|
|
15
|
+
const datetime_1 = require("../utils/datetime");
|
|
9
16
|
const product_type_pb_1 = require("../../../fintekkers/models/security/product_type_pb");
|
|
10
17
|
const coupon_frequency_pb_1 = require("../../../fintekkers/models/security/coupon_frequency_pb");
|
|
11
18
|
const coupon_type_pb_1 = require("../../../fintekkers/models/security/coupon_type_pb");
|
|
@@ -26,7 +33,7 @@ function makeIdentifier(type, value) {
|
|
|
26
33
|
}
|
|
27
34
|
describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () => {
|
|
28
35
|
test('BOND_SECURITY: all bond fields survive round-trip', () => {
|
|
29
|
-
const original = new
|
|
36
|
+
const original = new security_pb_2.SecurityProto();
|
|
30
37
|
original.setObjectClass('Security');
|
|
31
38
|
original.setVersion('0.0.1');
|
|
32
39
|
original.setProductType(product_type_pb_1.ProductTypeProto.TREASURY_NOTE);
|
|
@@ -43,7 +50,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
43
50
|
original.setDatedDate(makeDate(2020, 1, 15));
|
|
44
51
|
original.setMaturityDate(makeDate(2030, 1, 15));
|
|
45
52
|
const bytes = original.serializeBinary();
|
|
46
|
-
const parsed =
|
|
53
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
47
54
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.TREASURY_NOTE);
|
|
48
55
|
expect(parsed.getAssetClass()).toBe('Fixed Income');
|
|
49
56
|
expect(parsed.getIssuerName()).toBe('US Treasury');
|
|
@@ -62,7 +69,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
62
69
|
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.CUSIP);
|
|
63
70
|
});
|
|
64
71
|
test('TIPS: bond fields + base_cpi + inflation_index_type survive round-trip', () => {
|
|
65
|
-
const original = new
|
|
72
|
+
const original = new security_pb_2.SecurityProto();
|
|
66
73
|
original.setObjectClass('Security');
|
|
67
74
|
original.setVersion('0.0.1');
|
|
68
75
|
original.setProductType(product_type_pb_1.ProductTypeProto.TIPS);
|
|
@@ -76,7 +83,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
76
83
|
original.setBaseCpi(makeDecimal('256.394'));
|
|
77
84
|
original.setInflationIndexType(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
78
85
|
const bytes = original.serializeBinary();
|
|
79
|
-
const parsed =
|
|
86
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
80
87
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.TIPS);
|
|
81
88
|
expect(parsed.getCouponRate().getArbitraryPrecisionValue()).toBe('0.625');
|
|
82
89
|
expect(parsed.getCouponType()).toBe(coupon_type_pb_1.CouponTypeProto.FIXED);
|
|
@@ -87,7 +94,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
87
94
|
expect(parsed.getInflationIndexType()).toBe(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
88
95
|
});
|
|
89
96
|
test('FRN: spread + reference_rate_index + reset_frequency survive round-trip', () => {
|
|
90
|
-
const original = new
|
|
97
|
+
const original = new security_pb_2.SecurityProto();
|
|
91
98
|
original.setObjectClass('Security');
|
|
92
99
|
original.setVersion('0.0.1');
|
|
93
100
|
original.setProductType(product_type_pb_1.ProductTypeProto.TREASURY_FRN);
|
|
@@ -101,7 +108,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
101
108
|
original.setReferenceRateIndex(index_type_pb_1.IndexTypeProto.T_BILL_13_WEEK);
|
|
102
109
|
// Note: setResetFrequency (field 92) not yet in generated JS — codegen needs update
|
|
103
110
|
const bytes = original.serializeBinary();
|
|
104
|
-
const parsed =
|
|
111
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
105
112
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.TREASURY_FRN);
|
|
106
113
|
expect(parsed.getCouponType()).toBe(coupon_type_pb_1.CouponTypeProto.FLOAT);
|
|
107
114
|
expect(parsed.getCouponFrequency()).toBe(coupon_frequency_pb_1.CouponFrequencyProto.QUARTERLY);
|
|
@@ -111,7 +118,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
111
118
|
expect(parsed.getReferenceRateIndex()).toBe(index_type_pb_1.IndexTypeProto.T_BILL_13_WEEK);
|
|
112
119
|
});
|
|
113
120
|
test('EQUITY_SECURITY: identifier + asset_class survive round-trip', () => {
|
|
114
|
-
const original = new
|
|
121
|
+
const original = new security_pb_2.SecurityProto();
|
|
115
122
|
original.setObjectClass('Security');
|
|
116
123
|
original.setVersion('0.0.1');
|
|
117
124
|
original.setProductType(product_type_pb_1.ProductTypeProto.COMMON_STOCK);
|
|
@@ -121,7 +128,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
121
128
|
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.EXCH_TICKER, 'AAPL'));
|
|
122
129
|
original.setDescription('Apple Inc. Common Stock');
|
|
123
130
|
const bytes = original.serializeBinary();
|
|
124
|
-
const parsed =
|
|
131
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
125
132
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.COMMON_STOCK);
|
|
126
133
|
expect(parsed.getAssetClass()).toBe('Equity');
|
|
127
134
|
expect(parsed.getIssuerName()).toBe('Apple Inc.');
|
|
@@ -131,7 +138,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
131
138
|
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.EXCH_TICKER);
|
|
132
139
|
});
|
|
133
140
|
test('CASH_SECURITY: cash_id + settlement fields survive round-trip', () => {
|
|
134
|
-
const original = new
|
|
141
|
+
const original = new security_pb_2.SecurityProto();
|
|
135
142
|
original.setObjectClass('Security');
|
|
136
143
|
original.setVersion('0.0.1');
|
|
137
144
|
original.setProductType(product_type_pb_1.ProductTypeProto.CURRENCY);
|
|
@@ -142,7 +149,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
142
149
|
original.setDescription('US Dollar');
|
|
143
150
|
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.CASH, 'USD'));
|
|
144
151
|
const bytes = original.serializeBinary();
|
|
145
|
-
const parsed =
|
|
152
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
146
153
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.CURRENCY);
|
|
147
154
|
expect(parsed.getAssetClass()).toBe('Cash');
|
|
148
155
|
expect(parsed.getCashId()).toBe('USD');
|
|
@@ -151,7 +158,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
151
158
|
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.CASH);
|
|
152
159
|
});
|
|
153
160
|
test('INDEX_SECURITY: index_type + inflation_index_type survive round-trip', () => {
|
|
154
|
-
const original = new
|
|
161
|
+
const original = new security_pb_2.SecurityProto();
|
|
155
162
|
original.setObjectClass('Security');
|
|
156
163
|
original.setVersion('0.0.1');
|
|
157
164
|
original.setProductType(product_type_pb_1.ProductTypeProto.EQUITY_INDEX);
|
|
@@ -161,7 +168,7 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
161
168
|
original.setIndexType(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
162
169
|
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.CUSIP, 'CPI-U'));
|
|
163
170
|
const bytes = original.serializeBinary();
|
|
164
|
-
const parsed =
|
|
171
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
165
172
|
expect(parsed.getProductType()).toBe(product_type_pb_1.ProductTypeProto.EQUITY_INDEX);
|
|
166
173
|
expect(parsed.getAssetClass()).toBe('Index');
|
|
167
174
|
expect(parsed.getIssuerName()).toBe('Bureau of Labor Statistics');
|
|
@@ -170,4 +177,81 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
170
177
|
expect(parsed.getIdentifier().getIdentifierValue()).toBe('CPI-U');
|
|
171
178
|
});
|
|
172
179
|
});
|
|
180
|
+
describe('v0.2.5: Security link helpers + IndexDetailsProto.constituents', () => {
|
|
181
|
+
test('linkOf populates uuid, as_of and sets is_link=true', () => {
|
|
182
|
+
const uuid = uuid_1.UUID.random();
|
|
183
|
+
const asOf = datetime_1.ZonedDateTime.now();
|
|
184
|
+
const link = security_1.default.linkOf(uuid, asOf);
|
|
185
|
+
expect(link.getIsLink()).toBe(true);
|
|
186
|
+
expect(link.getUuid()).toBeDefined();
|
|
187
|
+
expect(link.getAsOf()).toBeDefined();
|
|
188
|
+
expect(link.getAssetClass()).toBe(''); // no other fields populated
|
|
189
|
+
});
|
|
190
|
+
test('linkOfLatest skips as_of', () => {
|
|
191
|
+
const uuid = uuid_1.UUID.random();
|
|
192
|
+
const link = security_1.default.linkOfLatest(uuid);
|
|
193
|
+
expect(link.getIsLink()).toBe(true);
|
|
194
|
+
expect(link.getUuid()).toBeDefined();
|
|
195
|
+
expect(link.getAsOf()).toBeUndefined();
|
|
196
|
+
});
|
|
197
|
+
test('linkOf requires asOf (throws when called without it)', () => {
|
|
198
|
+
const uuid = uuid_1.UUID.random();
|
|
199
|
+
expect(() => security_1.default.linkOf(uuid, undefined)).toThrow(/asOf is required/);
|
|
200
|
+
});
|
|
201
|
+
test('Security.isLink() reads the proto flag', () => {
|
|
202
|
+
const full = new security_pb_2.SecurityProto();
|
|
203
|
+
const wrapperFull = new security_1.default(full);
|
|
204
|
+
expect(wrapperFull.isLink()).toBe(false);
|
|
205
|
+
const link = security_1.default.linkOf(uuid_1.UUID.random(), datetime_1.ZonedDateTime.now());
|
|
206
|
+
const wrapperLink = new security_1.default(link);
|
|
207
|
+
expect(wrapperLink.isLink()).toBe(true);
|
|
208
|
+
});
|
|
209
|
+
test('Accessors throw on link wrappers', () => {
|
|
210
|
+
const link = security_1.default.linkOf(uuid_1.UUID.random(), datetime_1.ZonedDateTime.now());
|
|
211
|
+
const wrapper = new security_1.default(link);
|
|
212
|
+
expect(() => wrapper.getAssetClass()).toThrow(/link-mode/);
|
|
213
|
+
expect(() => wrapper.getIssuerName()).toThrow(/link-mode/);
|
|
214
|
+
expect(() => wrapper.getProductType()).toThrow(/link-mode/);
|
|
215
|
+
});
|
|
216
|
+
test('Link round-trips via serializeBinary preserving uuid + as_of + is_link', () => {
|
|
217
|
+
const uuid = uuid_1.UUID.random();
|
|
218
|
+
const asOf = datetime_1.ZonedDateTime.now();
|
|
219
|
+
const link = security_1.default.linkOf(uuid, asOf);
|
|
220
|
+
const bytes = link.serializeBinary();
|
|
221
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(bytes);
|
|
222
|
+
expect(parsed.getIsLink()).toBe(true);
|
|
223
|
+
expect(parsed.getUuid()).toBeDefined();
|
|
224
|
+
const parsedBytes = Array.from(parsed.getUuid().getRawUuid_asU8());
|
|
225
|
+
expect(parsedBytes).toEqual(uuid.toBytes());
|
|
226
|
+
expect(parsed.getAsOf().getTimeZone()).toBe(asOf.toProto().getTimeZone());
|
|
227
|
+
});
|
|
228
|
+
test('IndexDetailsProto.constituents round-trip with each constituent in link mode', () => {
|
|
229
|
+
const asOf = datetime_1.ZonedDateTime.now();
|
|
230
|
+
const c1 = security_1.default.linkOf(uuid_1.UUID.random(), asOf);
|
|
231
|
+
const c2 = security_1.default.linkOf(uuid_1.UUID.random(), asOf);
|
|
232
|
+
const details = new security_pb_1.IndexDetailsProto();
|
|
233
|
+
details.setIndexType(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
234
|
+
details.setConstituentsList([c1, c2]);
|
|
235
|
+
const original = new security_pb_2.SecurityProto();
|
|
236
|
+
original.setProductType(product_type_pb_1.ProductTypeProto.EQUITY_INDEX);
|
|
237
|
+
original.setIndexDetails(details);
|
|
238
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(original.serializeBinary());
|
|
239
|
+
const parsedDetails = parsed.getIndexDetails();
|
|
240
|
+
expect(parsedDetails.getConstituentsList().length).toBe(2);
|
|
241
|
+
expect(parsedDetails.getConstituentsList()[0].getIsLink()).toBe(true);
|
|
242
|
+
expect(parsedDetails.getConstituentsList()[0].getAsOf()).toBeDefined();
|
|
243
|
+
});
|
|
244
|
+
test('Wire compat: SecurityIdProto-shaped bytes (uuid at tag 1) parse as SecurityProto', () => {
|
|
245
|
+
// Pre-v0.2.5, legs were SecurityIdProto (uuid at tag 1). We rebuild that
|
|
246
|
+
// wire shape by serializing a SecurityProto with only uuid set — same
|
|
247
|
+
// bytes — and confirm round-trip under the new type.
|
|
248
|
+
const uuid = uuid_1.UUID.random();
|
|
249
|
+
const legacy = new security_pb_2.SecurityProto();
|
|
250
|
+
legacy.setUuid(uuid.toUUIDProto());
|
|
251
|
+
const legacyBytes = legacy.serializeBinary();
|
|
252
|
+
const parsed = security_pb_2.SecurityProto.deserializeBinary(legacyBytes);
|
|
253
|
+
const parsedBytes = Array.from(parsed.getUuid().getRawUuid_asU8());
|
|
254
|
+
expect(parsedBytes).toEqual(uuid.toBytes());
|
|
255
|
+
});
|
|
256
|
+
});
|
|
173
257
|
//# sourceMappingURL=security-roundtrip.test.js.map
|
|
@@ -1 +1 @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AAM,WAAW,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,2BAAa,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAG,CAAC,eAAe,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* For each type: construct → serialize to bytes → deserialize → verify all fields match.
|
|
5
5
|
*/
|
|
6
|
+
import { IndexDetailsProto } from '../../../fintekkers/models/security/security_pb';
|
|
6
7
|
import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
|
|
8
|
+
import Security from './security';
|
|
9
|
+
import { UUID } from '../utils/uuid';
|
|
10
|
+
import { ZonedDateTime } from '../utils/datetime';
|
|
7
11
|
import { ProductTypeProto } from "../../../fintekkers/models/security/product_type_pb";
|
|
8
12
|
import { CouponFrequencyProto } from '../../../fintekkers/models/security/coupon_frequency_pb';
|
|
9
13
|
import { CouponTypeProto } from '../../../fintekkers/models/security/coupon_type_pb';
|
|
@@ -190,3 +194,96 @@ describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () =
|
|
|
190
194
|
expect(parsed.getIdentifier()!.getIdentifierValue()).toBe('CPI-U');
|
|
191
195
|
});
|
|
192
196
|
});
|
|
197
|
+
|
|
198
|
+
describe('v0.2.5: Security link helpers + IndexDetailsProto.constituents', () => {
|
|
199
|
+
|
|
200
|
+
test('linkOf populates uuid, as_of and sets is_link=true', () => {
|
|
201
|
+
const uuid = UUID.random();
|
|
202
|
+
const asOf = ZonedDateTime.now();
|
|
203
|
+
const link = Security.linkOf(uuid, asOf);
|
|
204
|
+
expect(link.getIsLink()).toBe(true);
|
|
205
|
+
expect(link.getUuid()).toBeDefined();
|
|
206
|
+
expect(link.getAsOf()).toBeDefined();
|
|
207
|
+
expect(link.getAssetClass()).toBe(''); // no other fields populated
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test('linkOfLatest skips as_of', () => {
|
|
211
|
+
const uuid = UUID.random();
|
|
212
|
+
const link = Security.linkOfLatest(uuid);
|
|
213
|
+
expect(link.getIsLink()).toBe(true);
|
|
214
|
+
expect(link.getUuid()).toBeDefined();
|
|
215
|
+
expect(link.getAsOf()).toBeUndefined();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('linkOf requires asOf (throws when called without it)', () => {
|
|
219
|
+
const uuid = UUID.random();
|
|
220
|
+
expect(() => Security.linkOf(uuid, undefined as any)).toThrow(/asOf is required/);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test('Security.isLink() reads the proto flag', () => {
|
|
224
|
+
const full = new SecurityProto();
|
|
225
|
+
const wrapperFull = new Security(full);
|
|
226
|
+
expect(wrapperFull.isLink()).toBe(false);
|
|
227
|
+
|
|
228
|
+
const link = Security.linkOf(UUID.random(), ZonedDateTime.now());
|
|
229
|
+
const wrapperLink = new Security(link);
|
|
230
|
+
expect(wrapperLink.isLink()).toBe(true);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
test('Accessors throw on link wrappers', () => {
|
|
234
|
+
const link = Security.linkOf(UUID.random(), ZonedDateTime.now());
|
|
235
|
+
const wrapper = new Security(link);
|
|
236
|
+
expect(() => wrapper.getAssetClass()).toThrow(/link-mode/);
|
|
237
|
+
expect(() => wrapper.getIssuerName()).toThrow(/link-mode/);
|
|
238
|
+
expect(() => wrapper.getProductType()).toThrow(/link-mode/);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
test('Link round-trips via serializeBinary preserving uuid + as_of + is_link', () => {
|
|
242
|
+
const uuid = UUID.random();
|
|
243
|
+
const asOf = ZonedDateTime.now();
|
|
244
|
+
const link = Security.linkOf(uuid, asOf);
|
|
245
|
+
|
|
246
|
+
const bytes = link.serializeBinary();
|
|
247
|
+
const parsed = SecurityProto.deserializeBinary(bytes);
|
|
248
|
+
|
|
249
|
+
expect(parsed.getIsLink()).toBe(true);
|
|
250
|
+
expect(parsed.getUuid()).toBeDefined();
|
|
251
|
+
const parsedBytes = Array.from(parsed.getUuid()!.getRawUuid_asU8());
|
|
252
|
+
expect(parsedBytes).toEqual(uuid.toBytes());
|
|
253
|
+
expect(parsed.getAsOf()!.getTimeZone()).toBe(asOf.toProto().getTimeZone());
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
test('IndexDetailsProto.constituents round-trip with each constituent in link mode', () => {
|
|
257
|
+
const asOf = ZonedDateTime.now();
|
|
258
|
+
const c1 = Security.linkOf(UUID.random(), asOf);
|
|
259
|
+
const c2 = Security.linkOf(UUID.random(), asOf);
|
|
260
|
+
|
|
261
|
+
const details = new IndexDetailsProto();
|
|
262
|
+
details.setIndexType(IndexTypeProto.CPI_U);
|
|
263
|
+
details.setConstituentsList([c1, c2]);
|
|
264
|
+
|
|
265
|
+
const original = new SecurityProto();
|
|
266
|
+
original.setProductType(ProductTypeProto.EQUITY_INDEX);
|
|
267
|
+
original.setIndexDetails(details);
|
|
268
|
+
|
|
269
|
+
const parsed = SecurityProto.deserializeBinary(original.serializeBinary());
|
|
270
|
+
const parsedDetails = parsed.getIndexDetails()!;
|
|
271
|
+
expect(parsedDetails.getConstituentsList().length).toBe(2);
|
|
272
|
+
expect(parsedDetails.getConstituentsList()[0].getIsLink()).toBe(true);
|
|
273
|
+
expect(parsedDetails.getConstituentsList()[0].getAsOf()).toBeDefined();
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test('Wire compat: SecurityIdProto-shaped bytes (uuid at tag 1) parse as SecurityProto', () => {
|
|
277
|
+
// Pre-v0.2.5, legs were SecurityIdProto (uuid at tag 1). We rebuild that
|
|
278
|
+
// wire shape by serializing a SecurityProto with only uuid set — same
|
|
279
|
+
// bytes — and confirm round-trip under the new type.
|
|
280
|
+
const uuid = UUID.random();
|
|
281
|
+
const legacy = new SecurityProto();
|
|
282
|
+
legacy.setUuid(uuid.toUUIDProto());
|
|
283
|
+
|
|
284
|
+
const legacyBytes = legacy.serializeBinary();
|
|
285
|
+
const parsed = SecurityProto.deserializeBinary(legacyBytes);
|
|
286
|
+
const parsedBytes = Array.from(parsed.getUuid()!.getRawUuid_asU8());
|
|
287
|
+
expect(parsedBytes).toEqual(uuid.toBytes());
|
|
288
|
+
});
|
|
289
|
+
});
|
|
@@ -7,6 +7,31 @@ import { LocalDate } from "../utils/date";
|
|
|
7
7
|
declare class Security {
|
|
8
8
|
proto: SecurityProto;
|
|
9
9
|
constructor(proto: SecurityProto);
|
|
10
|
+
/**
|
|
11
|
+
* Build a SecurityProto link reference (is_link=true) with uuid and as_of
|
|
12
|
+
* populated. Use this whenever you embed a Security inside another message
|
|
13
|
+
* that itself carries an as_of (Position, Transaction, Price, etc.) — the
|
|
14
|
+
* link MUST carry the same as_of as the parent so the resolver hydrates
|
|
15
|
+
* the correct point-in-time vintage. See docs/adr/is_link_pattern.md.
|
|
16
|
+
*
|
|
17
|
+
* @param uuid The Security UUID to reference.
|
|
18
|
+
* @param asOf The as-of timestamp; required. For "always latest" semantics
|
|
19
|
+
* use linkOfLatest(uuid) instead.
|
|
20
|
+
*/
|
|
21
|
+
static linkOf(uuid: UUID, asOf: ZonedDateTime): SecurityProto;
|
|
22
|
+
/**
|
|
23
|
+
* Build a SecurityProto link reference (is_link=true) with only uuid set.
|
|
24
|
+
* Resolution returns the latest version. Explicit escape hatch — most
|
|
25
|
+
* callers should prefer linkOf(uuid, asOf).
|
|
26
|
+
*/
|
|
27
|
+
static linkOfLatest(uuid: UUID): SecurityProto;
|
|
28
|
+
private static _uuidToProto;
|
|
29
|
+
private static _zonedDateTimeToProto;
|
|
30
|
+
/**
|
|
31
|
+
* Throws if this Security is in link mode. Use to guard accessors that
|
|
32
|
+
* would otherwise return proto3 default values on a link reference.
|
|
33
|
+
*/
|
|
34
|
+
private assertNotLink;
|
|
10
35
|
/**
|
|
11
36
|
* Factory method to create the appropriate Security subclass based on security type
|
|
12
37
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
4
|
+
const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
4
5
|
const datetime_1 = require("../utils/datetime");
|
|
5
6
|
const uuid_1 = require("../utils/uuid");
|
|
6
7
|
const date_1 = require("../utils/date");
|
|
@@ -9,6 +10,58 @@ class Security {
|
|
|
9
10
|
constructor(proto) {
|
|
10
11
|
this.proto = proto;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Build a SecurityProto link reference (is_link=true) with uuid and as_of
|
|
15
|
+
* populated. Use this whenever you embed a Security inside another message
|
|
16
|
+
* that itself carries an as_of (Position, Transaction, Price, etc.) — the
|
|
17
|
+
* link MUST carry the same as_of as the parent so the resolver hydrates
|
|
18
|
+
* the correct point-in-time vintage. See docs/adr/is_link_pattern.md.
|
|
19
|
+
*
|
|
20
|
+
* @param uuid The Security UUID to reference.
|
|
21
|
+
* @param asOf The as-of timestamp; required. For "always latest" semantics
|
|
22
|
+
* use linkOfLatest(uuid) instead.
|
|
23
|
+
*/
|
|
24
|
+
static linkOf(uuid, asOf) {
|
|
25
|
+
if (!uuid)
|
|
26
|
+
throw new Error("uuid is required for linkOf");
|
|
27
|
+
if (!asOf)
|
|
28
|
+
throw new Error("asOf is required for linkOf; use linkOfLatest(uuid) for latest-version semantics");
|
|
29
|
+
const proto = new security_pb_1.SecurityProto();
|
|
30
|
+
proto.setIsLink(true);
|
|
31
|
+
proto.setUuid(Security._uuidToProto(uuid));
|
|
32
|
+
proto.setAsOf(Security._zonedDateTimeToProto(asOf));
|
|
33
|
+
return proto;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build a SecurityProto link reference (is_link=true) with only uuid set.
|
|
37
|
+
* Resolution returns the latest version. Explicit escape hatch — most
|
|
38
|
+
* callers should prefer linkOf(uuid, asOf).
|
|
39
|
+
*/
|
|
40
|
+
static linkOfLatest(uuid) {
|
|
41
|
+
if (!uuid)
|
|
42
|
+
throw new Error("uuid is required for linkOfLatest");
|
|
43
|
+
const proto = new security_pb_1.SecurityProto();
|
|
44
|
+
proto.setIsLink(true);
|
|
45
|
+
proto.setUuid(Security._uuidToProto(uuid));
|
|
46
|
+
return proto;
|
|
47
|
+
}
|
|
48
|
+
static _uuidToProto(uuid) {
|
|
49
|
+
return uuid.toUUIDProto();
|
|
50
|
+
}
|
|
51
|
+
static _zonedDateTimeToProto(asOf) {
|
|
52
|
+
return asOf.toProto();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Throws if this Security is in link mode. Use to guard accessors that
|
|
56
|
+
* would otherwise return proto3 default values on a link reference.
|
|
57
|
+
*/
|
|
58
|
+
assertNotLink(accessor) {
|
|
59
|
+
if (this.proto.getIsLink()) {
|
|
60
|
+
throw new Error(`Cannot read ${accessor} on a link-mode Security (is_link=true). `
|
|
61
|
+
+ `Resolve via SecurityService.GetByIds first. `
|
|
62
|
+
+ `See docs/adr/is_link_pattern.md.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
12
65
|
/**
|
|
13
66
|
* Factory method to create the appropriate Security subclass based on security type
|
|
14
67
|
*/
|
|
@@ -98,17 +151,21 @@ class Security {
|
|
|
98
151
|
return new datetime_1.ZonedDateTime(asOf);
|
|
99
152
|
}
|
|
100
153
|
getAssetClass() {
|
|
154
|
+
this.assertNotLink('assetClass');
|
|
101
155
|
return this.proto.getAssetClass();
|
|
102
156
|
}
|
|
103
157
|
getProductClass() {
|
|
158
|
+
this.assertNotLink('productClass');
|
|
104
159
|
throw new Error('Not implemented yet. See Java implementation for reference');
|
|
105
160
|
}
|
|
106
161
|
getProductType() {
|
|
162
|
+
this.assertNotLink('productType');
|
|
107
163
|
const securityType = this.proto.getProductType();
|
|
108
164
|
const securityTypeString = Object.keys(product_type_pb_1.ProductTypeProto).find(key => product_type_pb_1.ProductTypeProto[key] === securityType);
|
|
109
165
|
return securityTypeString || 'UNKNOWN_SECURITY_TYPE';
|
|
110
166
|
}
|
|
111
167
|
getSecurityID() {
|
|
168
|
+
this.assertNotLink('securityId');
|
|
112
169
|
const identifier = this.proto.getIdentifier();
|
|
113
170
|
if (!identifier)
|
|
114
171
|
throw new Error("Identifier is required");
|
|
@@ -127,6 +184,7 @@ class Security {
|
|
|
127
184
|
* calling BondSecurity.getIssueDate() (which returns LocalDate, not null).
|
|
128
185
|
*/
|
|
129
186
|
getIssueDate() {
|
|
187
|
+
this.assertNotLink('issueDate');
|
|
130
188
|
// Prefer oneof bond sub-message if available, fall back to flat fields
|
|
131
189
|
const bond = this.getBondLikeDetails();
|
|
132
190
|
const date = bond ? bond.getIssueDate() : this.proto.getIssueDate();
|
|
@@ -145,6 +203,7 @@ class Security {
|
|
|
145
203
|
* and TS will catch the misuse at compile time.
|
|
146
204
|
*/
|
|
147
205
|
getMaturityDate() {
|
|
206
|
+
this.assertNotLink('maturityDate');
|
|
148
207
|
// Prefer oneof bond sub-message if available, fall back to flat fields
|
|
149
208
|
const bond = this.getBondLikeDetails();
|
|
150
209
|
const date = bond ? bond.getMaturityDate() : this.proto.getMaturityDate();
|
|
@@ -169,6 +228,7 @@ class Security {
|
|
|
169
228
|
undefined;
|
|
170
229
|
}
|
|
171
230
|
getIssuerName() {
|
|
231
|
+
this.assertNotLink('issuerName');
|
|
172
232
|
return this.proto.getIssuerName();
|
|
173
233
|
}
|
|
174
234
|
equals(other) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["security.ts"],"names":[],"mappings":";;AAAA,2EAA0E;
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["security.ts"],"names":[],"mappings":";;AAAA,2EAA0E;A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AC3C;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;CACF;AAED,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FieldProto } from "../../../fintekkers/models/position/field_pb";
|
|
2
2
|
import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
|
|
3
3
|
import { SecurityProto } from "../../../fintekkers/models/security/security_pb";
|
|
4
|
+
import { UUIDProto } from "../../../fintekkers/models/util/uuid_pb";
|
|
5
|
+
import { LocalTimestampProto } from "../../../fintekkers/models/util/local_timestamp_pb";
|
|
4
6
|
import { ZonedDateTime } from "../utils/datetime";
|
|
5
7
|
import { UUID } from "../utils/uuid";
|
|
6
8
|
import { LocalDate } from "../utils/date";
|
|
@@ -13,6 +15,62 @@ class Security {
|
|
|
13
15
|
this.proto = proto;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Build a SecurityProto link reference (is_link=true) with uuid and as_of
|
|
20
|
+
* populated. Use this whenever you embed a Security inside another message
|
|
21
|
+
* that itself carries an as_of (Position, Transaction, Price, etc.) — the
|
|
22
|
+
* link MUST carry the same as_of as the parent so the resolver hydrates
|
|
23
|
+
* the correct point-in-time vintage. See docs/adr/is_link_pattern.md.
|
|
24
|
+
*
|
|
25
|
+
* @param uuid The Security UUID to reference.
|
|
26
|
+
* @param asOf The as-of timestamp; required. For "always latest" semantics
|
|
27
|
+
* use linkOfLatest(uuid) instead.
|
|
28
|
+
*/
|
|
29
|
+
static linkOf(uuid: UUID, asOf: ZonedDateTime): SecurityProto {
|
|
30
|
+
if (!uuid) throw new Error("uuid is required for linkOf");
|
|
31
|
+
if (!asOf) throw new Error("asOf is required for linkOf; use linkOfLatest(uuid) for latest-version semantics");
|
|
32
|
+
const proto = new SecurityProto();
|
|
33
|
+
proto.setIsLink(true);
|
|
34
|
+
proto.setUuid(Security._uuidToProto(uuid));
|
|
35
|
+
proto.setAsOf(Security._zonedDateTimeToProto(asOf));
|
|
36
|
+
return proto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Build a SecurityProto link reference (is_link=true) with only uuid set.
|
|
41
|
+
* Resolution returns the latest version. Explicit escape hatch — most
|
|
42
|
+
* callers should prefer linkOf(uuid, asOf).
|
|
43
|
+
*/
|
|
44
|
+
static linkOfLatest(uuid: UUID): SecurityProto {
|
|
45
|
+
if (!uuid) throw new Error("uuid is required for linkOfLatest");
|
|
46
|
+
const proto = new SecurityProto();
|
|
47
|
+
proto.setIsLink(true);
|
|
48
|
+
proto.setUuid(Security._uuidToProto(uuid));
|
|
49
|
+
return proto;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private static _uuidToProto(uuid: UUID): UUIDProto {
|
|
53
|
+
return uuid.toUUIDProto();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private static _zonedDateTimeToProto(asOf: ZonedDateTime): LocalTimestampProto {
|
|
57
|
+
return asOf.toProto();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Throws if this Security is in link mode. Use to guard accessors that
|
|
62
|
+
* would otherwise return proto3 default values on a link reference.
|
|
63
|
+
*/
|
|
64
|
+
private assertNotLink(accessor: string): void {
|
|
65
|
+
if (this.proto.getIsLink()) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Cannot read ${accessor} on a link-mode Security (is_link=true). `
|
|
68
|
+
+ `Resolve via SecurityService.GetByIds first. `
|
|
69
|
+
+ `See docs/adr/is_link_pattern.md.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
16
74
|
/**
|
|
17
75
|
* Factory method to create the appropriate Security subclass based on security type
|
|
18
76
|
*/
|
|
@@ -109,14 +167,17 @@ class Security {
|
|
|
109
167
|
}
|
|
110
168
|
|
|
111
169
|
getAssetClass(): string {
|
|
170
|
+
this.assertNotLink('assetClass');
|
|
112
171
|
return this.proto.getAssetClass();
|
|
113
172
|
}
|
|
114
173
|
|
|
115
174
|
getProductClass(): string {
|
|
175
|
+
this.assertNotLink('productClass');
|
|
116
176
|
throw new Error('Not implemented yet. See Java implementation for reference');
|
|
117
177
|
}
|
|
118
178
|
|
|
119
179
|
getProductType(): string {
|
|
180
|
+
this.assertNotLink('productType');
|
|
120
181
|
const securityType = this.proto.getProductType();
|
|
121
182
|
const securityTypeString = (Object.keys(ProductTypeProto) as Array<keyof typeof ProductTypeProto>).find(
|
|
122
183
|
key => ProductTypeProto[key] === securityType
|
|
@@ -126,6 +187,7 @@ class Security {
|
|
|
126
187
|
}
|
|
127
188
|
|
|
128
189
|
getSecurityID(): IdentifierProto {
|
|
190
|
+
this.assertNotLink('securityId');
|
|
129
191
|
const identifier = this.proto.getIdentifier();
|
|
130
192
|
if (!identifier) throw new Error("Identifier is required");
|
|
131
193
|
return identifier;
|
|
@@ -144,6 +206,7 @@ class Security {
|
|
|
144
206
|
* calling BondSecurity.getIssueDate() (which returns LocalDate, not null).
|
|
145
207
|
*/
|
|
146
208
|
getIssueDate(): LocalDate | null {
|
|
209
|
+
this.assertNotLink('issueDate');
|
|
147
210
|
// Prefer oneof bond sub-message if available, fall back to flat fields
|
|
148
211
|
const bond = this.getBondLikeDetails();
|
|
149
212
|
const date = bond ? bond.getIssueDate() : this.proto.getIssueDate();
|
|
@@ -162,6 +225,7 @@ class Security {
|
|
|
162
225
|
* and TS will catch the misuse at compile time.
|
|
163
226
|
*/
|
|
164
227
|
getMaturityDate(): LocalDate {
|
|
228
|
+
this.assertNotLink('maturityDate');
|
|
165
229
|
// Prefer oneof bond sub-message if available, fall back to flat fields
|
|
166
230
|
const bond = this.getBondLikeDetails();
|
|
167
231
|
const date = bond ? bond.getMaturityDate() : this.proto.getMaturityDate();
|
|
@@ -187,6 +251,7 @@ class Security {
|
|
|
187
251
|
}
|
|
188
252
|
|
|
189
253
|
getIssuerName(): string {
|
|
254
|
+
this.assertNotLink('issuerName');
|
|
190
255
|
return this.proto.getIssuerName();
|
|
191
256
|
}
|
|
192
257
|
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// package: fintekkers.models.security
|
|
2
|
-
// file: fintekkers/models/security/security_id.proto
|
|
3
|
-
|
|
4
|
-
/* tslint:disable */
|
|
5
|
-
/* eslint-disable */
|
|
6
|
-
|
|
7
|
-
import * as jspb from "google-protobuf";
|
|
8
|
-
import * as fintekkers_models_util_uuid_pb from "../../../fintekkers/models/util/uuid_pb";
|
|
9
|
-
|
|
10
|
-
export class SecurityIdProto extends jspb.Message {
|
|
11
|
-
|
|
12
|
-
hasUuid(): boolean;
|
|
13
|
-
clearUuid(): void;
|
|
14
|
-
getUuid(): fintekkers_models_util_uuid_pb.UUIDProto | undefined;
|
|
15
|
-
setUuid(value?: fintekkers_models_util_uuid_pb.UUIDProto): SecurityIdProto;
|
|
16
|
-
|
|
17
|
-
serializeBinary(): Uint8Array;
|
|
18
|
-
toObject(includeInstance?: boolean): SecurityIdProto.AsObject;
|
|
19
|
-
static toObject(includeInstance: boolean, msg: SecurityIdProto): SecurityIdProto.AsObject;
|
|
20
|
-
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
21
|
-
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
22
|
-
static serializeBinaryToWriter(message: SecurityIdProto, writer: jspb.BinaryWriter): void;
|
|
23
|
-
static deserializeBinary(bytes: Uint8Array): SecurityIdProto;
|
|
24
|
-
static deserializeBinaryFromReader(message: SecurityIdProto, reader: jspb.BinaryReader): SecurityIdProto;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export namespace SecurityIdProto {
|
|
28
|
-
export type AsObject = {
|
|
29
|
-
uuid?: fintekkers_models_util_uuid_pb.UUIDProto.AsObject,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
// source: fintekkers/models/security/security_id.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
|
-
var fintekkers_models_util_uuid_pb = require('../../../fintekkers/models/util/uuid_pb.js');
|
|
25
|
-
goog.object.extend(proto, fintekkers_models_util_uuid_pb);
|
|
26
|
-
goog.exportSymbol('proto.fintekkers.models.security.SecurityIdProto', null, global);
|
|
27
|
-
/**
|
|
28
|
-
* Generated by JsPbCodeGenerator.
|
|
29
|
-
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
30
|
-
* server response, or constructed directly in Javascript. The array is used
|
|
31
|
-
* in place and becomes part of the constructed object. It is not cloned.
|
|
32
|
-
* If no data is provided, the constructed object will be empty, but still
|
|
33
|
-
* valid.
|
|
34
|
-
* @extends {jspb.Message}
|
|
35
|
-
* @constructor
|
|
36
|
-
*/
|
|
37
|
-
proto.fintekkers.models.security.SecurityIdProto = function(opt_data) {
|
|
38
|
-
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
39
|
-
};
|
|
40
|
-
goog.inherits(proto.fintekkers.models.security.SecurityIdProto, jspb.Message);
|
|
41
|
-
if (goog.DEBUG && !COMPILED) {
|
|
42
|
-
/**
|
|
43
|
-
* @public
|
|
44
|
-
* @override
|
|
45
|
-
*/
|
|
46
|
-
proto.fintekkers.models.security.SecurityIdProto.displayName = 'proto.fintekkers.models.security.SecurityIdProto';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
52
|
-
/**
|
|
53
|
-
* Creates an object representation of this proto.
|
|
54
|
-
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
55
|
-
* Optional fields that are not set will be set to undefined.
|
|
56
|
-
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
57
|
-
* For the list of reserved names please see:
|
|
58
|
-
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
59
|
-
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
60
|
-
* JSPB instance for transitional soy proto support:
|
|
61
|
-
* http://goto/soy-param-migration
|
|
62
|
-
* @return {!Object}
|
|
63
|
-
*/
|
|
64
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.toObject = function(opt_includeInstance) {
|
|
65
|
-
return proto.fintekkers.models.security.SecurityIdProto.toObject(opt_includeInstance, this);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Static version of the {@see toObject} method.
|
|
71
|
-
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
72
|
-
* the JSPB instance for transitional soy proto support:
|
|
73
|
-
* http://goto/soy-param-migration
|
|
74
|
-
* @param {!proto.fintekkers.models.security.SecurityIdProto} msg The msg instance to transform.
|
|
75
|
-
* @return {!Object}
|
|
76
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
77
|
-
*/
|
|
78
|
-
proto.fintekkers.models.security.SecurityIdProto.toObject = function(includeInstance, msg) {
|
|
79
|
-
var f, obj = {
|
|
80
|
-
uuid: (f = msg.getUuid()) && fintekkers_models_util_uuid_pb.UUIDProto.toObject(includeInstance, f)
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
if (includeInstance) {
|
|
84
|
-
obj.$jspbMessageInstance = msg;
|
|
85
|
-
}
|
|
86
|
-
return obj;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Deserializes binary data (in protobuf wire format).
|
|
93
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
94
|
-
* @return {!proto.fintekkers.models.security.SecurityIdProto}
|
|
95
|
-
*/
|
|
96
|
-
proto.fintekkers.models.security.SecurityIdProto.deserializeBinary = function(bytes) {
|
|
97
|
-
var reader = new jspb.BinaryReader(bytes);
|
|
98
|
-
var msg = new proto.fintekkers.models.security.SecurityIdProto;
|
|
99
|
-
return proto.fintekkers.models.security.SecurityIdProto.deserializeBinaryFromReader(msg, reader);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Deserializes binary data (in protobuf wire format) from the
|
|
105
|
-
* given reader into the given message object.
|
|
106
|
-
* @param {!proto.fintekkers.models.security.SecurityIdProto} msg The message object to deserialize into.
|
|
107
|
-
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
108
|
-
* @return {!proto.fintekkers.models.security.SecurityIdProto}
|
|
109
|
-
*/
|
|
110
|
-
proto.fintekkers.models.security.SecurityIdProto.deserializeBinaryFromReader = function(msg, reader) {
|
|
111
|
-
while (reader.nextField()) {
|
|
112
|
-
if (reader.isEndGroup()) {
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
var field = reader.getFieldNumber();
|
|
116
|
-
switch (field) {
|
|
117
|
-
case 1:
|
|
118
|
-
var value = new fintekkers_models_util_uuid_pb.UUIDProto;
|
|
119
|
-
reader.readMessage(value,fintekkers_models_util_uuid_pb.UUIDProto.deserializeBinaryFromReader);
|
|
120
|
-
msg.setUuid(value);
|
|
121
|
-
break;
|
|
122
|
-
default:
|
|
123
|
-
reader.skipField();
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return msg;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Serializes the message to binary data (in protobuf wire format).
|
|
133
|
-
* @return {!Uint8Array}
|
|
134
|
-
*/
|
|
135
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.serializeBinary = function() {
|
|
136
|
-
var writer = new jspb.BinaryWriter();
|
|
137
|
-
proto.fintekkers.models.security.SecurityIdProto.serializeBinaryToWriter(this, writer);
|
|
138
|
-
return writer.getResultBuffer();
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Serializes the given message to binary data (in protobuf wire
|
|
144
|
-
* format), writing to the given BinaryWriter.
|
|
145
|
-
* @param {!proto.fintekkers.models.security.SecurityIdProto} message
|
|
146
|
-
* @param {!jspb.BinaryWriter} writer
|
|
147
|
-
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
148
|
-
*/
|
|
149
|
-
proto.fintekkers.models.security.SecurityIdProto.serializeBinaryToWriter = function(message, writer) {
|
|
150
|
-
var f = undefined;
|
|
151
|
-
f = message.getUuid();
|
|
152
|
-
if (f != null) {
|
|
153
|
-
writer.writeMessage(
|
|
154
|
-
1,
|
|
155
|
-
f,
|
|
156
|
-
fintekkers_models_util_uuid_pb.UUIDProto.serializeBinaryToWriter
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* optional fintekkers.models.util.UUIDProto uuid = 1;
|
|
164
|
-
* @return {?proto.fintekkers.models.util.UUIDProto}
|
|
165
|
-
*/
|
|
166
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.getUuid = function() {
|
|
167
|
-
return /** @type{?proto.fintekkers.models.util.UUIDProto} */ (
|
|
168
|
-
jspb.Message.getWrapperField(this, fintekkers_models_util_uuid_pb.UUIDProto, 1));
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @param {?proto.fintekkers.models.util.UUIDProto|undefined} value
|
|
174
|
-
* @return {!proto.fintekkers.models.security.SecurityIdProto} returns this
|
|
175
|
-
*/
|
|
176
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.setUuid = function(value) {
|
|
177
|
-
return jspb.Message.setWrapperField(this, 1, value);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Clears the message field making it undefined.
|
|
183
|
-
* @return {!proto.fintekkers.models.security.SecurityIdProto} returns this
|
|
184
|
-
*/
|
|
185
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.clearUuid = function() {
|
|
186
|
-
return this.setUuid(undefined);
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Returns whether this field is set.
|
|
192
|
-
* @return {boolean}
|
|
193
|
-
*/
|
|
194
|
-
proto.fintekkers.models.security.SecurityIdProto.prototype.hasUuid = function() {
|
|
195
|
-
return jspb.Message.getField(this, 1) != null;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
goog.object.extend(exports, proto.fintekkers.models.security);
|