@fintekkers/ledger-models 0.1.60 → 0.1.62

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.
Files changed (92) hide show
  1. package/babel.config.js +3 -1
  2. package/index.js +1 -15
  3. package/index.js.map +1 -1
  4. package/index.ts +1 -19
  5. package/jest.config.js +4 -0
  6. package/node/fintekkers/models/security/security_pb.test.js +29 -30
  7. package/node/fintekkers/models/security/security_pb.test.js.map +1 -0
  8. package/node/fintekkers/models/security/security_pb.test.ts +33 -0
  9. package/node/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +3 -0
  10. package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
  11. package/node/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
  12. package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
  13. package/node/wrappers/models/position/position.js +14 -9
  14. package/node/wrappers/models/position/position.js.map +1 -1
  15. package/node/wrappers/models/position/position.test.js +43 -0
  16. package/node/wrappers/models/position/position.test.js.map +1 -0
  17. package/node/wrappers/models/position/position.test.ts +70 -0
  18. package/node/wrappers/models/position/position.ts +17 -10
  19. package/node/wrappers/models/security/security.js +1 -1
  20. package/node/wrappers/models/security/security.js.map +1 -1
  21. package/node/wrappers/models/security/security.ts +1 -1
  22. package/node/wrappers/models/transaction/transaction.js +12 -10
  23. package/node/wrappers/models/transaction/transaction.js.map +1 -1
  24. package/node/wrappers/models/transaction/transaction.test.js +26 -0
  25. package/node/wrappers/models/transaction/transaction.test.js.map +1 -0
  26. package/node/wrappers/models/transaction/transaction.test.ts +36 -0
  27. package/node/wrappers/models/transaction/transaction.ts +15 -13
  28. package/node/wrappers/models/transaction/transaction_type.js +44 -0
  29. package/node/wrappers/models/transaction/transaction_type.js.map +1 -0
  30. package/node/wrappers/models/transaction/transaction_type.ts +47 -0
  31. package/node/wrappers/models/utils/date.js +25 -0
  32. package/node/wrappers/models/utils/date.js.map +1 -0
  33. package/node/wrappers/models/utils/date.ts +31 -0
  34. package/node/wrappers/models/utils/datetime.js +4 -4
  35. package/node/wrappers/models/utils/datetime.js.map +1 -1
  36. package/node/wrappers/models/utils/datetime.ts +4 -4
  37. package/node/wrappers/models/utils/requestcontext.js +55 -0
  38. package/node/wrappers/models/utils/requestcontext.js.map +1 -0
  39. package/node/wrappers/models/utils/requestcontext.ts +44 -0
  40. package/node/wrappers/models/utils/requestcontext_d.js +1 -0
  41. package/node/wrappers/models/utils/requestcontext_d.js.map +1 -0
  42. package/node/wrappers/models/utils/requestcontext_d.ts +7 -0
  43. package/node/wrappers/models/utils/serialization.js +6 -4
  44. package/node/wrappers/models/utils/serialization.js.map +1 -1
  45. package/node/wrappers/models/utils/serialization.test.js +13 -54
  46. package/node/wrappers/models/utils/serialization.test.js.map +1 -1
  47. package/node/wrappers/models/utils/serialization.test.ts +12 -10
  48. package/node/wrappers/models/utils/serialization.ts +8 -8
  49. package/node/wrappers/models/utils/serialization.util.js +76 -0
  50. package/node/wrappers/models/utils/serialization.util.js.map +1 -0
  51. package/node/wrappers/models/utils/serialization.util.test.js +24 -0
  52. package/node/wrappers/models/utils/serialization.util.test.js.map +1 -0
  53. package/node/wrappers/models/utils/serialization.util.test.ts +29 -0
  54. package/node/wrappers/models/utils/serialization.util.ts +85 -0
  55. package/node/wrappers/services/portfolio-service/PortfolioService.js +5 -8
  56. package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
  57. package/node/wrappers/services/portfolio-service/PortfolioService.ts +5 -6
  58. package/node/wrappers/{portfolio.test.js → services/portfolio-service/portfolio.test.js} +12 -11
  59. package/node/wrappers/services/portfolio-service/portfolio.test.js.map +1 -0
  60. package/node/wrappers/services/portfolio-service/portfolio.test.ts +40 -0
  61. package/node/wrappers/services/position-service/PositionService.js +4 -6
  62. package/node/wrappers/services/position-service/PositionService.js.map +1 -1
  63. package/node/wrappers/services/position-service/PositionService.ts +4 -22
  64. package/node/wrappers/{position.test.js → services/position-service/position.test.js} +28 -22
  65. package/node/wrappers/services/position-service/position.test.js.map +1 -0
  66. package/node/wrappers/{position.test.ts → services/position-service/position.test.ts} +25 -29
  67. package/node/wrappers/services/security-service/SecurityService.js +4 -8
  68. package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
  69. package/node/wrappers/services/security-service/SecurityService.ts +3 -6
  70. package/node/wrappers/{security.test.js → services/security-service/security.test.js} +26 -19
  71. package/node/wrappers/services/security-service/security.test.js.map +1 -0
  72. package/node/wrappers/{security.test.ts → services/security-service/security.test.ts} +22 -20
  73. package/node/wrappers/services/transaction-service/TransactionService.js +40 -50
  74. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  75. package/node/wrappers/services/transaction-service/TransactionService.ts +13 -15
  76. package/node/wrappers/{transaction.test.js → services/transaction-service/transaction.test.js} +41 -25
  77. package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -0
  78. package/node/wrappers/services/transaction-service/transaction.test.ts +97 -0
  79. package/package.json +4 -2
  80. package/web/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +4 -0
  81. package/web/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
  82. package/web/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
  83. package/web/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
  84. package/node/wrappers/models/utils/util.js +0 -28
  85. package/node/wrappers/models/utils/util.js.map +0 -1
  86. package/node/wrappers/models/utils/util.ts +0 -28
  87. package/node/wrappers/portfolio.test.js.map +0 -1
  88. package/node/wrappers/portfolio.test.ts +0 -36
  89. package/node/wrappers/position.test.js.map +0 -1
  90. package/node/wrappers/security.test.js.map +0 -1
  91. package/node/wrappers/transaction.test.js.map +0 -1
  92. package/node/wrappers/transaction.test.ts +0 -90
@@ -37,23 +37,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  }
38
38
  };
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.testPosition = void 0;
40
+ var identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
41
+ var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
42
+ var measure_pb_1 = require("../../../fintekkers/models/position/measure_pb");
41
43
  // Model Utils
42
- var field_pb_1 = require("../fintekkers/models/position/field_pb");
43
- //Requests & Services
44
- var PortfolioService_1 = require("./services/portfolio-service/PortfolioService");
45
- var util_1 = require("./models/utils/util");
46
- var PositionService_1 = require("./services/position-service/PositionService");
47
- var position_pb_1 = require("../fintekkers/models/position/position_pb");
48
- var query_position_request_pb_1 = require("../fintekkers/requests/position/query_position_request_pb");
49
- var identifier_pb_1 = require("../fintekkers/models/security/identifier/identifier_pb");
44
+ var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
45
+ var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
46
+ var position_filter_pb_1 = require("../../../fintekkers/models/position/position_filter_pb");
47
+ var datetime_1 = require("../../models/utils/datetime");
48
+ var serialization_util_1 = require("../../models/utils/serialization.util");
50
49
  var any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
51
- var position_util_pb_1 = require("../fintekkers/models/position/position_util_pb");
52
- var position_filter_pb_1 = require("../fintekkers/models/position/position_filter_pb");
53
- var datetime_1 = require("./models/utils/datetime");
54
- var measure_pb_1 = require("../fintekkers/models/position/measure_pb");
55
- // const { Any } = require("google-protobuf/google/protobuf/any_pb");
56
- // const { ProtoSerializationUtil } = require("your_protobuf_util_package"); // Replace "your_protobuf_util_package" with the actual package name for your Protobuf utility functions
50
+ //Requests & Services
51
+ var PortfolioService_1 = require("../../services/portfolio-service/PortfolioService");
52
+ var PositionService_1 = require("../../services/position-service/PositionService");
53
+ var query_position_request_pb_1 = require("../../../fintekkers/requests/position/query_position_request_pb");
54
+ test('test getting a position against the api.fintekkers.org position service', function () { return __awaiter(void 0, void 0, void 0, function () {
55
+ var isTrue;
56
+ return __generator(this, function (_a) {
57
+ switch (_a.label) {
58
+ case 0: return [4 /*yield*/, testPosition()];
59
+ case 1:
60
+ isTrue = _a.sent();
61
+ expect(isTrue).toBe(true);
62
+ return [2 /*return*/];
63
+ }
64
+ });
65
+ }); }, 30000);
57
66
  function get_position(security, portfolio, measures, position_type, fields, additional_filters, as_of) {
58
67
  if (fields === void 0) { fields = [field_pb_1.FieldProto.PORTFOLIO, field_pb_1.FieldProto.SECURITY]; }
59
68
  if (additional_filters === void 0) { additional_filters = []; }
@@ -78,7 +87,7 @@ function get_position(security, portfolio, measures, position_type, fields, addi
78
87
  if (portfolio !== null && portfolio !== undefined) {
79
88
  fieldMapEntry = new position_util_pb_1.FieldMapEntry();
80
89
  fieldMapEntry.setField(field_pb_1.FieldProto.PORTFOLIO_NAME);
81
- fieldMapEntry.setFieldValuePacked((0, util_1.packStringIntoAny)(portfolio.getPortfolioName()));
90
+ fieldMapEntry.setFieldValuePacked((0, serialization_util_1.pack)(portfolio.getPortfolioName()));
82
91
  filters.push(fieldMapEntry);
83
92
  }
84
93
  if (additional_filters !== null && additional_filters.length > 0) {
@@ -86,7 +95,7 @@ function get_position(security, portfolio, measures, position_type, fields, addi
86
95
  }
87
96
  filter_fields = new position_filter_pb_1.PositionFilterProto();
88
97
  filter_fields.setFiltersList(filters);
89
- as_of_proto = as_of.to_date_proto();
98
+ as_of_proto = as_of.toProto();
90
99
  request = new query_position_request_pb_1.QueryPositionRequestProto();
91
100
  request.setPositionType(position_type);
92
101
  request.setPositionView(position_pb_1.PositionViewProto.DEFAULT_VIEW);
@@ -111,20 +120,17 @@ function testPosition() {
111
120
  case 0:
112
121
  now = datetime_1.ZonedDateTime.now();
113
122
  portfolioService = new PortfolioService_1.PortfolioService();
114
- return [4 /*yield*/, portfolioService.searchPortfolio(now.to_date_proto(), field_pb_1.FieldProto.PORTFOLIO_NAME, "Federal Reserve SOMA Holdings")];
123
+ return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), field_pb_1.FieldProto.PORTFOLIO_NAME, "Federal Reserve SOMA Holdings")];
115
124
  case 1:
116
125
  portfolios = _a.sent();
117
126
  fedReservePortfolio = portfolios[0];
118
127
  return [4 /*yield*/, get_position(null, fedReservePortfolio, [measure_pb_1.MeasureProto.DIRECTED_QUANTITY], position_pb_1.PositionTypeProto.TRANSACTION, [field_pb_1.FieldProto.PORTFOLIO_NAME, field_pb_1.FieldProto.SECURITY_ID], [], now)];
119
128
  case 2:
120
129
  positions = _a.sent();
121
- positions[0].getFieldsList().forEach(function (field) { console.log(field); });
122
- positions[0].getMeasuresList().forEach(function (measure) { console.log(measure); });
123
130
  console.log(positions);
124
- return [2 /*return*/];
131
+ return [2 /*return*/, true];
125
132
  }
126
133
  });
127
134
  });
128
135
  }
129
- exports.testPosition = testPosition;
130
136
  //# sourceMappingURL=position.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";AAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAET,8FAA+F;AAC/F,+EAAuG;AAEvG,6EAA8E;AAG9E,cAAc;AACd,yEAA0E;AAC1E,yFAAqF;AACrF,6FAA6F;AAC7F,wDAA4D;AAE5D,4EAA6D;AAC7D,iEAA6D;AAE7D,qBAAqB;AACrB,sFAAqF;AACrF,mFAAkF;AAClF,6GAA4G;AAE5G,IAAI,CAAC,yEAAyE,EAAE;;;;oBAC/D,qBAAM,YAAY,EAAE,EAAA;;gBAA7B,MAAM,GAAG,SAAoB;gBACnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC3B,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,YAAY,CAAC,QAAsB,EACtC,SAAwB,EACxB,QAAuB,EACvB,aAA+B,EAC/B,MAAoD,EACpD,kBAAuB,EAAE,KAA2B;IADpD,uBAAA,EAAA,UAAU,qBAAU,CAAC,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC;IACpD,mCAAA,EAAA,uBAAuB;IAAE,sBAAA,EAAA,QAAQ,wBAAa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,EAAC;;;;CACb"}
@@ -1,32 +1,29 @@
1
1
  // Models
2
2
 
3
+ import { IdentifierProto } from '../../../fintekkers/models/security/identifier/identifier_pb';
4
+ import { PositionTypeProto, PositionViewProto } from '../../../fintekkers/models/position/position_pb';
5
+ import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
6
+ import { MeasureProto } from '../../../fintekkers/models/position/measure_pb';
7
+ import { PortfolioProto } from '../../../fintekkers/models/portfolio/portfolio_pb';
8
+
3
9
  // Model Utils
4
- import { FieldProto } from '../fintekkers/models/position/field_pb';
5
- import * as uuid from './models/utils/uuid';
6
- import * as dt from './models/utils/datetime';
10
+ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
11
+ import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
12
+ import { PositionFilterProto } from '../../../fintekkers/models/position/position_filter_pb';
13
+ import { ZonedDateTime } from '../../models/utils/datetime';
7
14
 
8
- //Requests & Services
9
- import { PortfolioService } from './services/portfolio-service/PortfolioService';
10
- import { PortfolioProto } from '../fintekkers/models/portfolio/portfolio_pb';
11
- import { QueryPortfolioRequestProto } from '../fintekkers/requests/portfolio/query_portfolio_request_pb';
12
-
13
- import { packStringIntoAny } from './models/utils/util';
14
- import { PositionService } from './services/position-service/PositionService';
15
- import { PositionProto, PositionTypeProto, PositionViewProto } from '../fintekkers/models/position/position_pb';
16
- import { QueryPositionRequestProto } from '../fintekkers/requests/position/query_position_request_pb';
17
- import { CreatePortfolioResponseProto } from '../fintekkers/requests/portfolio/create_portfolio_response_pb';
18
- import { IdentifierProto } from '../fintekkers/models/security/identifier/identifier_pb';
15
+ import { pack } from '../../models/utils/serialization.util';
19
16
  import { Any } from 'google-protobuf/google/protobuf/any_pb';
20
- import { FieldMapEntry } from '../fintekkers/models/position/position_util_pb';
21
- import { PositionFilterProto } from '../fintekkers/models/position/position_filter_pb';
22
- import { ZonedDateTime } from './models/utils/datetime';
23
- import { SecurityProto } from '../fintekkers/models/security/security_pb';
24
- import { MeasureProto } from '../fintekkers/models/position/measure_pb';
25
- import { SecurityService } from './services/security-service/SecurityService';
26
17
 
27
- // const { Any } = require("google-protobuf/google/protobuf/any_pb");
18
+ //Requests & Services
19
+ import { PortfolioService } from '../../services/portfolio-service/PortfolioService';
20
+ import { PositionService } from '../../services/position-service/PositionService';
21
+ import { QueryPositionRequestProto } from '../../../fintekkers/requests/position/query_position_request_pb';
28
22
 
29
- // const { ProtoSerializationUtil } = require("your_protobuf_util_package"); // Replace "your_protobuf_util_package" with the actual package name for your Protobuf utility functions
23
+ test('test getting a position against the api.fintekkers.org position service', async () => {
24
+ const isTrue = await testPosition();
25
+ expect(isTrue).toBe(true);
26
+ }, 30000);
30
27
 
31
28
  async function get_position(security:SecurityProto,
32
29
  portfolio:PortfolioProto,
@@ -54,7 +51,7 @@ async function get_position(security:SecurityProto,
54
51
  if (portfolio !== null && portfolio !== undefined) {
55
52
  const fieldMapEntry = new FieldMapEntry();
56
53
  fieldMapEntry.setField(FieldProto.PORTFOLIO_NAME);
57
- fieldMapEntry.setFieldValuePacked(packStringIntoAny(portfolio.getPortfolioName()));
54
+ fieldMapEntry.setFieldValuePacked(pack(portfolio.getPortfolioName()));
58
55
 
59
56
  filters.push(fieldMapEntry);
60
57
  }
@@ -66,7 +63,7 @@ async function get_position(security:SecurityProto,
66
63
  const filter_fields = new PositionFilterProto();
67
64
  filter_fields.setFiltersList(filters);
68
65
 
69
- const as_of_proto = as_of.to_date_proto();
66
+ const as_of_proto = as_of.toProto();
70
67
 
71
68
  const request = new QueryPositionRequestProto();
72
69
  request.setPositionType(position_type);
@@ -83,14 +80,14 @@ async function get_position(security:SecurityProto,
83
80
  return positions;
84
81
  }
85
82
 
86
- async function testPosition(): Promise<void> {
83
+ async function testPosition(): Promise<boolean> {
87
84
  //Get the Federal Reserve portfolio
88
85
  const now = ZonedDateTime.now();
89
86
 
90
87
  const portfolioService = new PortfolioService();
91
88
 
92
89
  let portfolios = await portfolioService.searchPortfolio(
93
- now.to_date_proto(),
90
+ now.toProto(),
94
91
  FieldProto.PORTFOLIO_NAME,
95
92
  "Federal Reserve SOMA Holdings");
96
93
  const fedReservePortfolio = portfolios[0];
@@ -101,9 +98,8 @@ async function testPosition(): Promise<void> {
101
98
  [FieldProto.PORTFOLIO_NAME, FieldProto.SECURITY_ID], [], now);
102
99
 
103
100
 
104
- positions[0].getFieldsList().forEach((field) => { console.log(field); });
105
- positions[0].getMeasuresList().forEach((measure) => { console.log(measure); });
106
101
  console.log(positions);
102
+
103
+ return true;
107
104
  }
108
105
 
109
- export { testPosition };
@@ -37,9 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SecurityService = void 0;
40
- var grpc = require("@grpc/grpc-js");
41
40
  var util_1 = require("util");
42
- var util_2 = require("../../models/utils/util");
41
+ var serialization_util_1 = require("../../models/utils/serialization.util");
43
42
  // Model Utils
44
43
  var position_filter_pb_1 = require("../../../fintekkers/models/position/position_filter_pb");
45
44
  // Requests & Services
@@ -47,10 +46,10 @@ var security_service_grpc_pb_1 = require("../../../fintekkers/services/security-
47
46
  var query_security_request_pb_1 = require("../../../fintekkers/requests/security/query_security_request_pb");
48
47
  var create_security_request_pb_1 = require("../../../fintekkers/requests/security/create_security_request_pb");
49
48
  var security_1 = require("../../models/security/security");
49
+ var requestcontext_1 = require("../../models/utils/requestcontext");
50
50
  var SecurityService = /** @class */ (function () {
51
51
  function SecurityService() {
52
- // this.client = new SecurityClient('api.fintekkers.org:8082', grpc.credentials.createSsl());
53
- this.client = new security_service_grpc_pb_1.SecurityClient('localhost:8082', grpc.credentials.createInsecure());
52
+ this.client = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
54
53
  }
55
54
  SecurityService.prototype.validateCreateSecurity = function (security) {
56
55
  return __awaiter(this, void 0, void 0, function () {
@@ -99,14 +98,11 @@ var SecurityService = /** @class */ (function () {
99
98
  stream2 = tmpClient.search(searchRequest);
100
99
  return [2 /*return*/, new Promise(function (resolve, reject) {
101
100
  stream2.on('data', function (response) {
102
- console.log('Result of the security search call');
103
- console.log('Response:', response);
104
101
  response.getSecurityResponseList().forEach(function (security) {
105
102
  listSecurities.push(new security_1.default(security));
106
103
  });
107
104
  });
108
105
  stream2.on('end', function () {
109
- console.log('Stream ended.');
110
106
  resolve(listSecurities);
111
107
  });
112
108
  stream2.on('error', function (err) {
@@ -128,7 +124,7 @@ var SecurityService = /** @class */ (function () {
128
124
  positionFilter = new position_filter_pb_1.PositionFilterProto();
129
125
  positionFilter.setObjectClass('PositionFilter');
130
126
  positionFilter.setVersion('0.0.1');
131
- fieldMapEntry = (0, util_2.createFieldMapEntry)(fieldProto, fieldValue);
127
+ fieldMapEntry = (0, serialization_util_1.createFieldMapEntry)(fieldProto, fieldValue);
132
128
  positionFilter.setFiltersList([fieldMapEntry]);
133
129
  searchRequest.setSearchSecurityInput(positionFilter);
134
130
  tmpClient = this.client;
@@ -1 +1 @@
1
- {"version":3,"file":"SecurityService.js","sourceRoot":"","sources":["SecurityService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAsC;AACtC,6BAAiC;AAIjC,gDAA8D;AAI9D,cAAc;AACd,6FAA6F;AAG7F,sBAAsB;AACtB,mHAAwG;AACxG,6GAA4G;AAE5G,+GAA8G;AAE9G,2DAAsD;AAEtD;IAGE;QACE,6FAA6F;QAC7F,IAAI,CAAC,MAAM,GAAG,IAAI,yCAAc,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IACxF,CAAC;IAEK,gDAAsB,GAA5B,UAA6B,QAAuB;;;;;;wBAC5C,aAAa,GAAG,IAAI,uDAA0B,EAAE,CAAC;wBACvD,aAAa,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;wBAChD,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,C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,CAAC,OAAO,CAAC,CAAC;wBAE7B,aAAa,GAAG,IAAA,wCAAmB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;wBAClE,cAAc,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;wBAE/C,aAAa,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC;wBAE/C,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;wBAExB,cAAc,GAAe,EAAE,CAAC;wBAuB/B,qBAAM,0BAA0B,EAAE,EAAA;4BAAzC,sBAAO,SAAkC,EAAC;;;;KAC3C;IACH,sBAAC;AAAD,CAAC,AAvED,IAuEC;AAEQ,0CAAe"}
@@ -3,7 +3,7 @@ import { promisify } from 'util';
3
3
 
4
4
  // Models
5
5
  import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
6
- import { createFieldMapEntry } from '../../models/utils/util';
6
+ import { createFieldMapEntry } from '../../models/utils/serialization.util';
7
7
  import { LocalTimestampProto } from '../../../fintekkers/models/util/local_timestamp_pb';
8
8
  import { SummaryProto } from '../../../fintekkers/requests/util/errors/summary_pb';
9
9
 
@@ -18,13 +18,13 @@ import { QuerySecurityResponseProto } from '../../../fintekkers/requests/securit
18
18
  import { CreateSecurityRequestProto } from '../../../fintekkers/requests/security/create_security_request_pb';
19
19
  import { CreateSecurityResponseProto } from '../../../fintekkers/requests/security/create_security_response_pb';
20
20
  import Security from '../../models/security/security';
21
+ import EnvConfig from '../../models/utils/requestcontext';
21
22
 
22
23
  class SecurityService {
23
24
  private client: SecurityClient;
24
25
 
25
26
  constructor() {
26
- // this.client = new SecurityClient('api.fintekkers.org:8082', grpc.credentials.createSsl());
27
- this.client = new SecurityClient('localhost:8082', grpc.credentials.createInsecure());
27
+ this.client = new SecurityClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
28
28
  }
29
29
 
30
30
  async validateCreateSecurity(security: SecurityProto): Promise<SummaryProto> {
@@ -73,15 +73,12 @@ class SecurityService {
73
73
 
74
74
  return new Promise<Security[]>((resolve, reject) => {
75
75
  stream2.on('data', (response:QuerySecurityResponseProto) => {
76
- console.log('Result of the security search call');
77
- console.log('Response:', response);
78
76
  response.getSecurityResponseList().forEach((security) => {
79
77
  listSecurities.push(new Security(security));
80
78
  });
81
79
  });
82
80
 
83
81
  stream2.on('end', () => {
84
- console.log('Stream ended.');
85
82
  resolve(listSecurities);
86
83
  });
87
84
 
@@ -36,19 +36,30 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.testSecurity = void 0;
40
39
  // Models
41
- var security_pb_1 = require("../fintekkers/models/security/security_pb");
42
- var coupon_frequency_pb_1 = require("../fintekkers/models/security/coupon_frequency_pb");
43
- var decimal_value_pb_1 = require("../fintekkers/models/util/decimal_value_pb");
44
- var coupon_type_pb_1 = require("../fintekkers/models/security/coupon_type_pb");
45
- var security_type_pb_1 = require("../fintekkers/models/security/security_type_pb");
46
- var local_date_pb_1 = require("../fintekkers/models/util/local_date_pb");
40
+ var security_pb_1 = require("../../../fintekkers/models/security/security_pb");
41
+ var coupon_frequency_pb_1 = require("../../../fintekkers/models/security/coupon_frequency_pb");
42
+ var decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
43
+ var coupon_type_pb_1 = require("../../../fintekkers/models/security/coupon_type_pb");
44
+ var security_type_pb_1 = require("../../../fintekkers/models/security/security_type_pb");
45
+ var local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
47
46
  // Model Utils
48
- var field_pb_1 = require("../fintekkers/models/position/field_pb");
49
- var uuid = require("./models/utils/uuid");
50
- var dt = require("./models/utils/datetime");
51
- var SecurityService_1 = require("./services/security-service/SecurityService");
47
+ var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
48
+ var uuid = require("../../models/utils/uuid");
49
+ var dt = require("../../models/utils/datetime");
50
+ var SecurityService_1 = require("./SecurityService");
51
+ test('test creating a security against the api.fintekkers.org security service', function () { return __awaiter(void 0, void 0, void 0, function () {
52
+ var isTrue;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0: return [4 /*yield*/, testSecurity()];
56
+ case 1:
57
+ isTrue = _a.sent();
58
+ expect(isTrue).toBe(true);
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); }, 30000);
52
63
  function testSecurity() {
53
64
  return __awaiter(this, void 0, void 0, function () {
54
65
  var id_proto, now, securityService, usd_security, security, faceValue, couponRate, issueDate, maturityDate, validationSummary, createSecurityResponse, searchResults;
@@ -59,7 +70,7 @@ function testSecurity() {
59
70
  now = dt.ZonedDateTime.now();
60
71
  securityService = new SecurityService_1.SecurityService();
61
72
  return [4 /*yield*/, securityService
62
- .searchSecurity(now.to_date_proto(), field_pb_1.FieldProto.ASSET_CLASS, 'Cash')
73
+ .searchSecurity(now.toProto(), field_pb_1.FieldProto.ASSET_CLASS, 'Cash')
63
74
  .then(function (securities) {
64
75
  return securities[0];
65
76
  })];
@@ -70,7 +81,7 @@ function testSecurity() {
70
81
  security.setVersion('0.0.1');
71
82
  security.setUuid(id_proto);
72
83
  security.setSettlementCurrency(usd_security.proto);
73
- security.setAsOf(now.to_date_proto());
84
+ security.setAsOf(now.toProto());
74
85
  security.setAssetClass('FixedIncome');
75
86
  security.setCouponFrequency(coupon_frequency_pb_1.CouponFrequencyProto.SEMIANNUALLY);
76
87
  security.setCouponType(coupon_type_pb_1.CouponTypeProto.FIXED);
@@ -97,19 +108,15 @@ function testSecurity() {
97
108
  return [4 /*yield*/, securityService.validateCreateSecurity(security)];
98
109
  case 2:
99
110
  validationSummary = _a.sent();
100
- console.log(validationSummary);
101
111
  return [4 /*yield*/, securityService.createSecurity(security)];
102
112
  case 3:
103
113
  createSecurityResponse = _a.sent();
104
- console.log(createSecurityResponse);
105
- return [4 /*yield*/, securityService.searchSecurity(now.to_date_proto(), field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income')];
114
+ return [4 /*yield*/, securityService.searchSecurity(now.toProto(), field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income')];
106
115
  case 4:
107
116
  searchResults = _a.sent();
108
- console.log('There are %d securities in this response', searchResults.length);
109
- return [2 /*return*/];
117
+ return [2 /*return*/, true];
110
118
  }
111
119
  });
112
120
  });
113
121
  }
114
- exports.testSecurity = testSecurity;
115
122
  //# sourceMappingURL=security.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.test.js","sourceRoot":"","sources":["security.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS;AACT,+EAAgF;AAChF,+FAA+F;AAC/F,qFAAqF;AACrF,qFAAqF;AACrF,yFAAyF;AACzF,+EAA+E;AAE/E,cAAc;AACd,yEAA0E;AAE1E,8CAAgD;AAChD,gDAAkD;AAGlD,qDAAoD;AAEpD,IAAI,CAAC,0EAA0E,EAAE;;;;oBAChE,qBAAM,YAAY,EAAE,EAAA;;gBAA7B,MAAM,GAAG,SAAoB;gBACnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC3B,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,YAAY;;;;;;oBACnB,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;oBAC5C,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;oBAE7B,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;oBAE3B,qBAAM,eAAe;6BACrC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,qBAAU,CAAC,WAAW,EAAE,MAAM,CAAC;6BAC7D,IAAI,CAAC,UAAC,UAAU;4BACf,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;wBACvB,CAAC,CAAC,EAAA;;oBAJA,YAAY,GAAG,SAIf;oBAEE,QAAQ,GAAG,IAAI,2BAAa,EAAE,CAAC;oBACrC,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,CAAC,CAAC,KAAK;oBACjC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACzB,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACvB,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;oBAEvC,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;oBACtC,QAAQ,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC;oBAE9B,qBAAM,eAAe,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAA;;oBAA1E,iBAAiB,GAAG,SAAsD;oBAErB,qBAAM,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAA;;oBAAnG,sBAAsB,GAA+B,SAA8C;oBAEnF,qBAAM,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,EAAA;;oBAA3G,aAAa,GAAG,SAA2F;oBAE/G,sBAAO,IAAI,EAAC;;;;CACb"}
@@ -1,28 +1,33 @@
1
1
  // Models
2
- import { SecurityProto } from '../fintekkers/models/security/security_pb';
3
- import { CouponFrequencyProto } from '../fintekkers/models/security/coupon_frequency_pb';
4
- import { DecimalValueProto } from '../fintekkers/models/util/decimal_value_pb';
5
- import { CouponTypeProto } from '../fintekkers/models/security/coupon_type_pb';
6
- import { SecurityTypeProto } from '../fintekkers/models/security/security_type_pb';
7
- import { LocalDateProto } from '../fintekkers/models/util/local_date_pb';
2
+ import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
3
+ import { CouponFrequencyProto } from '../../../fintekkers/models/security/coupon_frequency_pb';
4
+ import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
5
+ import { CouponTypeProto } from '../../../fintekkers/models/security/coupon_type_pb';
6
+ import { SecurityTypeProto } from '../../../fintekkers/models/security/security_type_pb';
7
+ import { LocalDateProto } from '../../../fintekkers/models/util/local_date_pb';
8
8
 
9
9
  // Model Utils
10
- import { FieldProto } from '../fintekkers/models/position/field_pb';
10
+ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
11
11
 
12
- import * as uuid from './models/utils/uuid';
13
- import * as dt from './models/utils/datetime';
12
+ import * as uuid from '../../models/utils/uuid';
13
+ import * as dt from '../../models/utils/datetime';
14
14
 
15
- import { CreateSecurityResponseProto } from '../fintekkers/requests/security/create_security_response_pb';
16
- import { SecurityService } from './services/security-service/SecurityService';
15
+ import { CreateSecurityResponseProto } from '../../../fintekkers/requests/security/create_security_response_pb';
16
+ import { SecurityService } from './SecurityService';
17
17
 
18
- async function testSecurity(): Promise<void> {
18
+ test('test creating a security against the api.fintekkers.org security service', async () => {
19
+ const isTrue = await testSecurity();
20
+ expect(isTrue).toBe(true);
21
+ }, 30000);
22
+
23
+ async function testSecurity(): Promise<boolean> {
19
24
  const id_proto = uuid.UUID.random().toUUIDProto();
20
25
  const now = dt.ZonedDateTime.now();
21
26
 
22
27
  const securityService = new SecurityService();
23
28
 
24
29
  let usd_security = await securityService
25
- .searchSecurity(now.to_date_proto(), FieldProto.ASSET_CLASS, 'Cash')
30
+ .searchSecurity(now.toProto(), FieldProto.ASSET_CLASS, 'Cash')
26
31
  .then((securities) => {
27
32
  return securities[0];
28
33
  });
@@ -32,7 +37,7 @@ async function testSecurity(): Promise<void> {
32
37
  security.setVersion('0.0.1');
33
38
  security.setUuid(id_proto);
34
39
  security.setSettlementCurrency(usd_security.proto);
35
- security.setAsOf(now.to_date_proto());
40
+ security.setAsOf(now.toProto());
36
41
  security.setAssetClass('FixedIncome');
37
42
  security.setCouponFrequency(CouponFrequencyProto.SEMIANNUALLY);
38
43
  security.setCouponType(CouponTypeProto.FIXED);
@@ -63,13 +68,10 @@ async function testSecurity(): Promise<void> {
63
68
  security.setDescription('Dummy US Treasury 10Y Bond');
64
69
 
65
70
  var validationSummary = await securityService.validateCreateSecurity(security);
66
- console.log(validationSummary);
67
71
 
68
72
  var createSecurityResponse:CreateSecurityResponseProto = await securityService.createSecurity(security);
69
- console.log(createSecurityResponse);
70
73
 
71
- var searchResults = await securityService.searchSecurity(now.to_date_proto(), FieldProto.ASSET_CLASS, 'Fixed Income');
72
- console.log('There are %d securities in this response', searchResults.length);
73
- }
74
+ var searchResults = await securityService.searchSecurity(now.toProto(), FieldProto.ASSET_CLASS, 'Fixed Income');
74
75
 
75
- export { testSecurity };
76
+ return true;
77
+ }
@@ -37,21 +37,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TransactionService = void 0;
40
- var grpc = require("@grpc/grpc-js");
41
40
  var util_1 = require("util");
42
41
  // Models
43
42
  var transaction_1 = require("../../models/transaction/transaction");
44
- var util_2 = require("../../models/utils/util");
43
+ var serialization_util_1 = require("../../models/utils/serialization.util");
45
44
  // Model Utils
46
45
  var position_filter_pb_1 = require("../../../fintekkers/models/position/position_filter_pb");
47
46
  // Requests & Services
48
47
  var transaction_service_grpc_pb_1 = require("../../../fintekkers/services/transaction-service/transaction_service_grpc_pb");
49
48
  var create_transaction_request_pb_1 = require("../../../fintekkers/requests/transaction/create_transaction_request_pb");
50
49
  var query_transaction_request_pb_1 = require("../../../fintekkers/requests/transaction/query_transaction_request_pb");
50
+ var requestcontext_1 = require("../../models/utils/requestcontext");
51
51
  var TransactionService = /** @class */ (function () {
52
52
  function TransactionService() {
53
- // this.client = new SecurityClient('api.fintekkers.org:8082', grpc.credentials.createSsl());
54
- this.client = new transaction_service_grpc_pb_1.TransactionClient('localhost:8082', grpc.credentials.createInsecure());
53
+ this.client = new transaction_service_grpc_pb_1.TransactionClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
55
54
  }
56
55
  TransactionService.prototype.validateCreateTransaction = function (transaction) {
57
56
  return __awaiter(this, void 0, void 0, function () {
@@ -91,55 +90,46 @@ var TransactionService = /** @class */ (function () {
91
90
  });
92
91
  });
93
92
  };
94
- TransactionService.prototype.searchTransaction = function (asOf, fieldProto, fieldValue) {
95
- return __awaiter(this, void 0, void 0, function () {
96
- function processStreamSynchronously() {
97
- return __awaiter(this, void 0, void 0, function () {
98
- var stream2;
99
- return __generator(this, function (_a) {
100
- stream2 = tmpClient.search(searchRequest);
101
- return [2 /*return*/, new Promise(function (resolve, reject) {
102
- stream2.on('data', function (response) {
103
- console.log('Result of the transaction search call');
104
- console.log('Response:', response);
105
- response.getTransactionResponseList().forEach(function (transaction) {
106
- listTransactions.push(new transaction_1.default(transaction));
107
- });
108
- console.log('Size of transactions:', listTransactions.length);
109
- });
110
- stream2.on('end', function () {
111
- console.log('Stream ended.');
112
- resolve(listTransactions);
113
- });
114
- stream2.on('error', function (err) {
115
- console.error('Error in the stream:', err);
116
- reject(err);
93
+ TransactionService.prototype.searchTransaction = function (asOf, fieldProto, fieldValue, maxResults) {
94
+ if (maxResults === void 0) { maxResults = 100; }
95
+ var searchRequest = new query_transaction_request_pb_1.QueryTransactionRequestProto();
96
+ searchRequest.setObjectClass('SecurityRequest');
97
+ searchRequest.setVersion('0.0.1');
98
+ searchRequest.setAsOf(asOf);
99
+ var positionFilter = new position_filter_pb_1.PositionFilterProto();
100
+ positionFilter.setObjectClass('PositionFilter');
101
+ positionFilter.setVersion('0.0.1');
102
+ var fieldMapEntry = (0, serialization_util_1.createFieldMapEntry)(fieldProto, fieldValue);
103
+ positionFilter.setFiltersList([fieldMapEntry]);
104
+ searchRequest.setSearchTransactionInput(positionFilter);
105
+ searchRequest.setLimit(maxResults);
106
+ var tmpClient = this.client;
107
+ function processStreamSynchronously() {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var stream2, results;
110
+ return __generator(this, function (_a) {
111
+ stream2 = tmpClient.search(searchRequest);
112
+ results = [];
113
+ return [2 /*return*/, new Promise(function (resolve, reject) {
114
+ stream2.on('data', function (response) {
115
+ response.getTransactionResponseList().forEach(function (transaction) {
116
+ var txn = new transaction_1.default(transaction);
117
+ results.push(txn);
117
118
  });
118
- })];
119
- });
119
+ });
120
+ stream2.on('end', function () {
121
+ console.log("Stream ended with ", results.length);
122
+ resolve(results);
123
+ });
124
+ stream2.on('error', function (err) {
125
+ console.error('Error in the stream:', err);
126
+ reject(err);
127
+ });
128
+ })];
120
129
  });
121
- }
122
- var searchRequest, positionFilter, fieldMapEntry, tmpClient, listTransactions;
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0:
126
- searchRequest = new query_transaction_request_pb_1.QueryTransactionRequestProto();
127
- searchRequest.setObjectClass('SecurityRequest');
128
- searchRequest.setVersion('0.0.1');
129
- searchRequest.setAsOf(asOf);
130
- positionFilter = new position_filter_pb_1.PositionFilterProto();
131
- positionFilter.setObjectClass('PositionFilter');
132
- positionFilter.setVersion('0.0.1');
133
- fieldMapEntry = (0, util_2.createFieldMapEntry)(fieldProto, fieldValue);
134
- positionFilter.setFiltersList([fieldMapEntry]);
135
- searchRequest.setSearchTransactionInput(positionFilter);
136
- tmpClient = this.client;
137
- listTransactions = [];
138
- return [4 /*yield*/, processStreamSynchronously()];
139
- case 1: return [2 /*return*/, _a.sent()];
140
- }
141
130
  });
142
- });
131
+ }
132
+ return processStreamSynchronously();
143
133
  };
144
134
  return TransactionService;
145
135
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionService.js","sourceRoot":"","sources":["TransactionService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAsC;AACtC,6BAAiC;AAEjC,SAAS;AACT,oEAA+D;AAC/D,gDAA8D;AAI9D,cAAc;AACd,6FAA6F;AAG7F,sBAAsB;AACtB,4HAAiH;AACjH,wHAAuH;AAEvH,sHAAqH;AAIrH;IAGE;QACE,6FAA6F;QAC7F,IAAI,CAAC,MAAM,GAAG,IAAI,+CAAiB,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;IAC3F,CAAC;IAEK,sDAAyB,GAA/B,UAAgC,WAAwB;;;;;;wBAChD,a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