@fintekkers/ledger-models 1.1.12 → 1.1.14
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/price/price_pb.d.ts +4 -0
- package/node/fintekkers/models/price/price_pb.js +33 -1
- package/node/fintekkers/models/price/price_source_grpc_pb.js +1 -0
- package/node/fintekkers/models/price/price_source_pb.d.ts +13 -0
- package/node/fintekkers/models/price/price_source_pb.js +34 -0
- package/node/wrappers/services/price.search-by-security.test.d.ts +1 -0
- package/node/wrappers/services/price.search-by-security.test.js +49 -0
- package/node/wrappers/services/price.search-by-security.test.js.map +1 -0
- package/node/wrappers/services/price.search-by-security.test.ts +43 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import * as fintekkers_models_util_local_timestamp_pb from "../../../fintekkers/
|
|
|
10
10
|
import * as fintekkers_models_util_uuid_pb from "../../../fintekkers/models/util/uuid_pb";
|
|
11
11
|
import * as fintekkers_models_security_security_pb from "../../../fintekkers/models/security/security_pb";
|
|
12
12
|
import * as fintekkers_models_price_price_type_pb from "../../../fintekkers/models/price/price_type_pb";
|
|
13
|
+
import * as fintekkers_models_price_price_source_pb from "../../../fintekkers/models/price/price_source_pb";
|
|
13
14
|
import * as fintekkers_models_util_object_type_pb from "../../../fintekkers/models/util/object_type_pb";
|
|
14
15
|
import * as fintekkers_models_util_version_pb from "../../../fintekkers/models/util/version_pb";
|
|
15
16
|
|
|
@@ -55,6 +56,8 @@ export class PriceProto extends jspb.Message {
|
|
|
55
56
|
setSecurity(value?: fintekkers_models_security_security_pb.SecurityProto): PriceProto;
|
|
56
57
|
getPriceType(): fintekkers_models_price_price_type_pb.PriceTypeProto;
|
|
57
58
|
setPriceType(value: fintekkers_models_price_price_type_pb.PriceTypeProto): PriceProto;
|
|
59
|
+
getPriceSource(): fintekkers_models_price_price_source_pb.PriceSourceProto;
|
|
60
|
+
setPriceSource(value: fintekkers_models_price_price_source_pb.PriceSourceProto): PriceProto;
|
|
58
61
|
|
|
59
62
|
serializeBinary(): Uint8Array;
|
|
60
63
|
toObject(includeInstance?: boolean): PriceProto.AsObject;
|
|
@@ -78,5 +81,6 @@ export namespace PriceProto {
|
|
|
78
81
|
price?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
|
|
79
82
|
security?: fintekkers_models_security_security_pb.SecurityProto.AsObject,
|
|
80
83
|
priceType: fintekkers_models_price_price_type_pb.PriceTypeProto,
|
|
84
|
+
priceSource: fintekkers_models_price_price_source_pb.PriceSourceProto,
|
|
81
85
|
}
|
|
82
86
|
}
|
|
@@ -31,6 +31,8 @@ var fintekkers_models_security_security_pb = require('../../../fintekkers/models
|
|
|
31
31
|
goog.object.extend(proto, fintekkers_models_security_security_pb);
|
|
32
32
|
var fintekkers_models_price_price_type_pb = require('../../../fintekkers/models/price/price_type_pb.js');
|
|
33
33
|
goog.object.extend(proto, fintekkers_models_price_price_type_pb);
|
|
34
|
+
var fintekkers_models_price_price_source_pb = require('../../../fintekkers/models/price/price_source_pb.js');
|
|
35
|
+
goog.object.extend(proto, fintekkers_models_price_price_source_pb);
|
|
34
36
|
var fintekkers_models_util_object_type_pb = require('../../../fintekkers/models/util/object_type_pb.js');
|
|
35
37
|
goog.object.extend(proto, fintekkers_models_util_object_type_pb);
|
|
36
38
|
var fintekkers_models_util_version_pb = require('../../../fintekkers/models/util/version_pb.js');
|
|
@@ -98,7 +100,8 @@ proto.fintekkers.models.price.PriceProto.toObject = function(includeInstance, ms
|
|
|
98
100
|
validTo: (f = msg.getValidTo()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
99
101
|
price: (f = msg.getPrice()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
|
|
100
102
|
security: (f = msg.getSecurity()) && fintekkers_models_security_security_pb.SecurityProto.toObject(includeInstance, f),
|
|
101
|
-
priceType: jspb.Message.getFieldWithDefault(msg, 12, 0)
|
|
103
|
+
priceType: jspb.Message.getFieldWithDefault(msg, 12, 0),
|
|
104
|
+
priceSource: jspb.Message.getFieldWithDefault(msg, 13, 0)
|
|
102
105
|
};
|
|
103
106
|
|
|
104
107
|
if (includeInstance) {
|
|
@@ -182,6 +185,10 @@ proto.fintekkers.models.price.PriceProto.deserializeBinaryFromReader = function(
|
|
|
182
185
|
var value = /** @type {!proto.fintekkers.models.price.PriceTypeProto} */ (reader.readEnum());
|
|
183
186
|
msg.setPriceType(value);
|
|
184
187
|
break;
|
|
188
|
+
case 13:
|
|
189
|
+
var value = /** @type {!proto.fintekkers.models.price.PriceSourceProto} */ (reader.readEnum());
|
|
190
|
+
msg.setPriceSource(value);
|
|
191
|
+
break;
|
|
185
192
|
default:
|
|
186
193
|
reader.skipField();
|
|
187
194
|
break;
|
|
@@ -288,6 +295,13 @@ proto.fintekkers.models.price.PriceProto.serializeBinaryToWriter = function(mess
|
|
|
288
295
|
f
|
|
289
296
|
);
|
|
290
297
|
}
|
|
298
|
+
f = message.getPriceSource();
|
|
299
|
+
if (f !== 0.0) {
|
|
300
|
+
writer.writeEnum(
|
|
301
|
+
13,
|
|
302
|
+
f
|
|
303
|
+
);
|
|
304
|
+
}
|
|
291
305
|
};
|
|
292
306
|
|
|
293
307
|
|
|
@@ -604,4 +618,22 @@ proto.fintekkers.models.price.PriceProto.prototype.setPriceType = function(value
|
|
|
604
618
|
};
|
|
605
619
|
|
|
606
620
|
|
|
621
|
+
/**
|
|
622
|
+
* optional PriceSourceProto price_source = 13;
|
|
623
|
+
* @return {!proto.fintekkers.models.price.PriceSourceProto}
|
|
624
|
+
*/
|
|
625
|
+
proto.fintekkers.models.price.PriceProto.prototype.getPriceSource = function() {
|
|
626
|
+
return /** @type {!proto.fintekkers.models.price.PriceSourceProto} */ (jspb.Message.getFieldWithDefault(this, 13, 0));
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* @param {!proto.fintekkers.models.price.PriceSourceProto} value
|
|
632
|
+
* @return {!proto.fintekkers.models.price.PriceProto} returns this
|
|
633
|
+
*/
|
|
634
|
+
proto.fintekkers.models.price.PriceProto.prototype.setPriceSource = function(value) {
|
|
635
|
+
return jspb.Message.setProto3EnumField(this, 13, value);
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
|
|
607
639
|
goog.object.extend(exports, proto.fintekkers.models.price);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// package: fintekkers.models.price
|
|
2
|
+
// file: fintekkers/models/price/price_source.proto
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
|
|
7
|
+
import * as jspb from "google-protobuf";
|
|
8
|
+
|
|
9
|
+
export enum PriceSourceProto {
|
|
10
|
+
UNKNOWN_PRICE_SOURCE = 0,
|
|
11
|
+
MARKET = 1,
|
|
12
|
+
TRADE = 2,
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// source: fintekkers/models/price/price_source.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.price.PriceSourceProto', null, global);
|
|
25
|
+
/**
|
|
26
|
+
* @enum {number}
|
|
27
|
+
*/
|
|
28
|
+
proto.fintekkers.models.price.PriceSourceProto = {
|
|
29
|
+
UNKNOWN_PRICE_SOURCE: 0,
|
|
30
|
+
MARKET: 1,
|
|
31
|
+
TRADE: 2
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
goog.object.extend(exports, proto.fintekkers.models.price);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
// A price search for a security filters on SECURITY_ID, never uuIds (LM-398).
|
|
13
|
+
// QueryPriceRequestProto.uuIds holds price IDs only.
|
|
14
|
+
const PriceService_1 = require("./price-service/PriceService");
|
|
15
|
+
const uuid_1 = require("../models/utils/uuid");
|
|
16
|
+
const field_pb_1 = require("../../fintekkers/models/position/field_pb");
|
|
17
|
+
const uuid_pb_1 = require("../../fintekkers/models/util/uuid_pb");
|
|
18
|
+
/**
|
|
19
|
+
* A PriceService whose gRPC client records each search request. Same shape
|
|
20
|
+
* as capturingService in util/object-types.test.ts: importing that file
|
|
21
|
+
* would register its tests here too.
|
|
22
|
+
*/
|
|
23
|
+
function capturingPriceService() {
|
|
24
|
+
const requests = [];
|
|
25
|
+
const stream = (request) => {
|
|
26
|
+
requests.push(request);
|
|
27
|
+
const handlers = {};
|
|
28
|
+
setImmediate(() => { var _a; return (_a = handlers.end) === null || _a === void 0 ? void 0 : _a.call(handlers); });
|
|
29
|
+
return { on(event, handler) { handlers[event] = handler; return this; } };
|
|
30
|
+
};
|
|
31
|
+
const service = Object.create(PriceService_1.PriceService.prototype);
|
|
32
|
+
service.client = { search: stream };
|
|
33
|
+
return { service, requests };
|
|
34
|
+
}
|
|
35
|
+
test('searchBySecurityId sends SECURITY_ID filter and empty uuIds', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const securityId = uuid_1.UUID.random();
|
|
37
|
+
const { service, requests } = capturingPriceService();
|
|
38
|
+
yield service.searchBySecurityId(securityId.toString());
|
|
39
|
+
expect(requests).toHaveLength(1);
|
|
40
|
+
const request = requests[0];
|
|
41
|
+
expect(request.getUuidsList()).toHaveLength(0);
|
|
42
|
+
const filters = request.getSearchPriceInput().getFiltersList();
|
|
43
|
+
expect(filters.map(f => f.getField())).toEqual([field_pb_1.FieldProto.SECURITY_ID]);
|
|
44
|
+
const packed = filters[0].getFieldValuePacked();
|
|
45
|
+
expect(packed.getTypeUrl()).toBe('type.googleapis.com/fintekkers.models.util.UUIDProto');
|
|
46
|
+
const sent = uuid_pb_1.UUIDProto.deserializeBinary(packed.getValue_asU8());
|
|
47
|
+
expect(Array.from(sent.getRawUuid_asU8())).toEqual(Array.from(securityId.toUUIDProto().getRawUuid_asU8()));
|
|
48
|
+
}));
|
|
49
|
+
//# sourceMappingURL=price.search-by-security.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.search-by-security.test.js","sourceRoot":"","sources":["price.search-by-security.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8EAA8E;AAC9E,qD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OAAO,CAAC,mBAAmB,EAAG,CAAC,cAAc,EAAE,CAAC;IAChE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,qBAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAG,CAAC;IACjD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;IACzF,MAAM,IAAI,GAAG,mBAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;AAC7G,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// A price search for a security filters on SECURITY_ID, never uuIds (LM-398).
|
|
2
|
+
// QueryPriceRequestProto.uuIds holds price IDs only.
|
|
3
|
+
import { PriceService } from './price-service/PriceService';
|
|
4
|
+
import { UUID } from '../models/utils/uuid';
|
|
5
|
+
|
|
6
|
+
import { FieldProto } from '../../fintekkers/models/position/field_pb';
|
|
7
|
+
import { UUIDProto } from '../../fintekkers/models/util/uuid_pb';
|
|
8
|
+
import { QueryPriceRequestProto } from '../../fintekkers/requests/price/query_price_request_pb';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A PriceService whose gRPC client records each search request. Same shape
|
|
12
|
+
* as capturingService in util/object-types.test.ts: importing that file
|
|
13
|
+
* would register its tests here too.
|
|
14
|
+
*/
|
|
15
|
+
function capturingPriceService(): { service: PriceService; requests: QueryPriceRequestProto[] } {
|
|
16
|
+
const requests: QueryPriceRequestProto[] = [];
|
|
17
|
+
const stream = (request: QueryPriceRequestProto) => {
|
|
18
|
+
requests.push(request);
|
|
19
|
+
const handlers: Record<string, () => void> = {};
|
|
20
|
+
setImmediate(() => handlers.end?.());
|
|
21
|
+
return { on(event: string, handler: () => void) { handlers[event] = handler; return this; } };
|
|
22
|
+
};
|
|
23
|
+
const service = Object.create(PriceService.prototype) as PriceService;
|
|
24
|
+
(service as unknown as { client: unknown }).client = { search: stream };
|
|
25
|
+
return { service, requests };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
test('searchBySecurityId sends SECURITY_ID filter and empty uuIds', async () => {
|
|
29
|
+
const securityId = UUID.random();
|
|
30
|
+
const { service, requests } = capturingPriceService();
|
|
31
|
+
|
|
32
|
+
await service.searchBySecurityId(securityId.toString());
|
|
33
|
+
|
|
34
|
+
expect(requests).toHaveLength(1);
|
|
35
|
+
const request = requests[0];
|
|
36
|
+
expect(request.getUuidsList()).toHaveLength(0);
|
|
37
|
+
const filters = request.getSearchPriceInput()!.getFiltersList();
|
|
38
|
+
expect(filters.map(f => f.getField())).toEqual([FieldProto.SECURITY_ID]);
|
|
39
|
+
const packed = filters[0].getFieldValuePacked()!;
|
|
40
|
+
expect(packed.getTypeUrl()).toBe('type.googleapis.com/fintekkers.models.util.UUIDProto');
|
|
41
|
+
const sent = UUIDProto.deserializeBinary(packed.getValue_asU8());
|
|
42
|
+
expect(Array.from(sent.getRawUuid_asU8())).toEqual(Array.from(securityId.toUUIDProto().getRawUuid_asU8()));
|
|
43
|
+
});
|