@sentio/sdk 1.36.4 → 1.37.0-rc.1

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 (192) hide show
  1. package/lib/aptos/api.d.ts +1 -1
  2. package/lib/aptos/api.js +1 -1
  3. package/lib/aptos/api.js.map +1 -1
  4. package/lib/aptos/aptos-plugin.d.ts +2 -2
  5. package/lib/aptos/aptos-plugin.js +14 -19
  6. package/lib/aptos/aptos-plugin.js.map +1 -1
  7. package/lib/aptos/aptos-processor.d.ts +2 -2
  8. package/lib/aptos/aptos-processor.js +3 -3
  9. package/lib/aptos/aptos-processor.js.map +1 -1
  10. package/lib/aptos/context.d.ts +1 -1
  11. package/lib/aptos/context.js +2 -6
  12. package/lib/aptos/context.js.map +1 -1
  13. package/lib/binds.d.ts +1 -1
  14. package/lib/binds.js +2 -2
  15. package/lib/binds.js.map +1 -1
  16. package/lib/builtin/internal/eacaggregatorproxy_processor.js +18 -18
  17. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  18. package/lib/builtin/internal/erc1155_processor.js +5 -5
  19. package/lib/builtin/internal/erc1155_processor.js.map +1 -1
  20. package/lib/builtin/internal/erc20_processor.js +8 -8
  21. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  22. package/lib/builtin/internal/erc20bytes_processor.js +6 -6
  23. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  24. package/lib/builtin/internal/erc721_processor.js +9 -9
  25. package/lib/builtin/internal/erc721_processor.js.map +1 -1
  26. package/lib/builtin/internal/weth9_processor.js +6 -6
  27. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  28. package/lib/core/account-processor.d.ts +1 -1
  29. package/lib/core/account-processor.js +2 -2
  30. package/lib/core/account-processor.js.map +1 -1
  31. package/lib/core/base-context.d.ts +1 -1
  32. package/lib/core/base-context.js.map +1 -1
  33. package/lib/core/base-processor-template.d.ts +2 -2
  34. package/lib/core/base-processor-template.js +7 -21
  35. package/lib/core/base-processor-template.js.map +1 -1
  36. package/lib/core/base-processor.d.ts +1 -1
  37. package/lib/core/base-processor.js +6 -20
  38. package/lib/core/base-processor.js.map +1 -1
  39. package/lib/core/bind-options.d.ts +5 -6
  40. package/lib/core/bind-options.js.map +1 -1
  41. package/lib/core/context.d.ts +4 -5
  42. package/lib/core/context.js +6 -10
  43. package/lib/core/context.js.map +1 -1
  44. package/lib/core/eth-plugin.d.ts +2 -2
  45. package/lib/core/eth-plugin.js +8 -12
  46. package/lib/core/eth-plugin.js.map +1 -1
  47. package/lib/core/event-tracker.d.ts +1 -1
  48. package/lib/core/event-tracker.js +2 -2
  49. package/lib/core/event-tracker.js.map +1 -1
  50. package/lib/core/exporter.d.ts +1 -1
  51. package/lib/core/exporter.js +2 -2
  52. package/lib/core/exporter.js.map +1 -1
  53. package/lib/core/generic-processor.test.js.map +1 -1
  54. package/lib/core/index.d.ts +1 -1
  55. package/lib/core/index.js +2 -1
  56. package/lib/core/index.js.map +1 -1
  57. package/lib/core/logger.d.ts +1 -1
  58. package/lib/core/logger.js +5 -5
  59. package/lib/core/logger.js.map +1 -1
  60. package/lib/core/meter.d.ts +2 -2
  61. package/lib/core/meter.js +10 -10
  62. package/lib/core/meter.js.map +1 -1
  63. package/lib/core/numberish.d.ts +3 -3
  64. package/lib/core/numberish.js +18 -12
  65. package/lib/core/numberish.js.map +1 -1
  66. package/lib/core/numberish.test.js.map +1 -1
  67. package/lib/core/solana-context.d.ts +2 -3
  68. package/lib/core/solana-context.js.map +1 -1
  69. package/lib/core/solana-options.d.ts +2 -3
  70. package/lib/core/solana-options.js.map +1 -1
  71. package/lib/core/solana-plugin.d.ts +2 -2
  72. package/lib/core/solana-plugin.js +6 -6
  73. package/lib/core/solana-plugin.js.map +1 -1
  74. package/lib/core/solana-processor.d.ts +7 -8
  75. package/lib/core/solana-processor.js +5 -15
  76. package/lib/core/solana-processor.js.map +1 -1
  77. package/lib/core/sui-plugin.d.ts +2 -2
  78. package/lib/core/sui-plugin.js +5 -5
  79. package/lib/core/sui-plugin.js.map +1 -1
  80. package/lib/core/sui-processor.d.ts +8 -9
  81. package/lib/core/sui-processor.js +5 -15
  82. package/lib/core/sui-processor.js.map +1 -1
  83. package/lib/index.d.ts +2 -3
  84. package/lib/index.js +3 -5
  85. package/lib/index.js.map +1 -1
  86. package/lib/processor-runner.js +4 -4
  87. package/lib/processor-runner.js.map +1 -1
  88. package/lib/service.d.ts +3 -4
  89. package/lib/service.js +7 -11
  90. package/lib/service.js.map +1 -1
  91. package/lib/target-ethers-sentio/file.js +1 -0
  92. package/lib/target-ethers-sentio/file.js.map +1 -1
  93. package/lib/target-ethers-sentio/view-function.js +1 -1
  94. package/lib/testing/metric-utils.d.ts +1 -1
  95. package/lib/testing/metric-utils.js.map +1 -1
  96. package/lib/testing/test-processor-server.d.ts +3 -3
  97. package/lib/testing/test-processor-server.js +10 -22
  98. package/lib/testing/test-processor-server.js.map +1 -1
  99. package/lib/utils/conversion.d.ts +1 -1
  100. package/lib/utils/conversion.js.map +1 -1
  101. package/lib/utils/dex-price.test.js.map +1 -1
  102. package/lib/utils/erc20.test.js.map +1 -1
  103. package/lib/utils/price.d.ts +10 -10
  104. package/lib/utils/price.js +1 -1
  105. package/lib/utils/price.js.map +1 -1
  106. package/package.json +4 -2
  107. package/src/aptos/api.ts +1 -1
  108. package/src/aptos/aptos-plugin.ts +10 -11
  109. package/src/aptos/aptos-processor.ts +2 -2
  110. package/src/aptos/context.ts +3 -4
  111. package/src/binds.ts +1 -1
  112. package/src/builtin/internal/eacaggregatorproxy_processor.ts +19 -18
  113. package/src/builtin/internal/erc1155_processor.ts +6 -5
  114. package/src/builtin/internal/erc20_processor.ts +9 -8
  115. package/src/builtin/internal/erc20bytes_processor.ts +7 -6
  116. package/src/builtin/internal/erc721_processor.ts +10 -9
  117. package/src/builtin/internal/weth9_processor.ts +7 -6
  118. package/src/core/account-processor.ts +1 -1
  119. package/src/core/base-context.ts +1 -1
  120. package/src/core/base-processor-template.ts +6 -15
  121. package/src/core/base-processor.ts +4 -13
  122. package/src/core/bind-options.ts +5 -6
  123. package/src/core/context.ts +10 -11
  124. package/src/core/eth-plugin.ts +3 -4
  125. package/src/core/event-tracker.ts +2 -2
  126. package/src/core/exporter.ts +1 -1
  127. package/src/core/index.ts +1 -1
  128. package/src/core/logger.ts +1 -1
  129. package/src/core/meter.ts +2 -2
  130. package/src/core/numberish.ts +12 -6
  131. package/src/core/solana-context.ts +2 -3
  132. package/src/core/solana-options.ts +2 -4
  133. package/src/core/solana-plugin.ts +3 -3
  134. package/src/core/solana-processor.ts +10 -17
  135. package/src/core/sui-plugin.ts +3 -8
  136. package/src/core/sui-processor.ts +11 -18
  137. package/src/index.ts +3 -5
  138. package/src/processor-runner.ts +3 -3
  139. package/src/service.ts +5 -5
  140. package/src/target-ethers-sentio/file.ts +1 -0
  141. package/src/target-ethers-sentio/view-function.ts +1 -1
  142. package/src/testing/metric-utils.ts +1 -1
  143. package/src/testing/test-processor-server.ts +6 -16
  144. package/src/types/global.d.ts +2 -2
  145. package/src/utils/conversion.ts +1 -1
  146. package/src/utils/price.ts +1 -1
  147. package/lib/gen/builtin.d.ts +0 -6
  148. package/lib/gen/builtin.js +0 -3
  149. package/lib/gen/builtin.js.map +0 -1
  150. package/lib/gen/chainquery/protos/chainquery.d.ts +0 -400
  151. package/lib/gen/chainquery/protos/chainquery.js +0 -972
  152. package/lib/gen/chainquery/protos/chainquery.js.map +0 -1
  153. package/lib/gen/google/protobuf/empty.d.ts +0 -16
  154. package/lib/gen/google/protobuf/empty.js +0 -47
  155. package/lib/gen/google/protobuf/empty.js.map +0 -1
  156. package/lib/gen/google/protobuf/struct.d.ts +0 -73
  157. package/lib/gen/google/protobuf/struct.js +0 -371
  158. package/lib/gen/google/protobuf/struct.js.map +0 -1
  159. package/lib/gen/google/protobuf/timestamp.d.ts +0 -18
  160. package/lib/gen/google/protobuf/timestamp.js +0 -71
  161. package/lib/gen/google/protobuf/timestamp.js.map +0 -1
  162. package/lib/gen/index.d.ts +0 -2
  163. package/lib/gen/index.js +0 -19
  164. package/lib/gen/index.js.map +0 -1
  165. package/lib/gen/processor/protos/processor.d.ts +0 -826
  166. package/lib/gen/processor/protos/processor.js +0 -3988
  167. package/lib/gen/processor/protos/processor.js.map +0 -1
  168. package/lib/gen/service/price/protos/price.d.ts +0 -85
  169. package/lib/gen/service/price/protos/price.js +0 -269
  170. package/lib/gen/service/price/protos/price.js.map +0 -1
  171. package/lib/plugin.d.ts +0 -15
  172. package/lib/plugin.js +0 -32
  173. package/lib/plugin.js.map +0 -1
  174. package/lib/state/processor-state.d.ts +0 -3
  175. package/lib/state/processor-state.js +0 -8
  176. package/lib/state/processor-state.js.map +0 -1
  177. package/lib/state/state-storage.d.ts +0 -17
  178. package/lib/state/state-storage.js +0 -60
  179. package/lib/state/state-storage.js.map +0 -1
  180. package/lib/state/state-storage.test.d.ts +0 -1
  181. package/lib/state/state-storage.test.js.map +0 -1
  182. package/src/gen/builtin.ts +0 -22
  183. package/src/gen/chainquery/protos/chainquery.ts +0 -1212
  184. package/src/gen/google/protobuf/empty.ts +0 -58
  185. package/src/gen/google/protobuf/struct.ts +0 -422
  186. package/src/gen/google/protobuf/timestamp.ts +0 -85
  187. package/src/gen/index.ts +0 -3
  188. package/src/gen/processor/protos/processor.ts +0 -4619
  189. package/src/gen/service/price/protos/price.ts +0 -329
  190. package/src/plugin.ts +0 -41
  191. package/src/state/processor-state.ts +0 -3
  192. package/src/state/state-storage.ts +0 -65
@@ -1,85 +0,0 @@
1
- import Long from "long";
2
- import type { CallContext, CallOptions } from "nice-grpc-common";
3
- import _m0 from "protobufjs/minimal";
4
- export interface CoinID {
5
- symbol?: string | undefined;
6
- address?: CoinID_AddressIdentifier | undefined;
7
- }
8
- export interface CoinID_AddressIdentifier {
9
- address: string;
10
- chain: string;
11
- }
12
- export interface GetPriceRequest {
13
- timestamp: Date | undefined;
14
- coinId: CoinID | undefined;
15
- }
16
- export interface GetPriceResponse {
17
- price: number;
18
- timestamp: Date | undefined;
19
- }
20
- export declare const CoinID: {
21
- encode(message: CoinID, writer?: _m0.Writer): _m0.Writer;
22
- decode(input: _m0.Reader | Uint8Array, length?: number): CoinID;
23
- fromJSON(object: any): CoinID;
24
- toJSON(message: CoinID): unknown;
25
- fromPartial(object: DeepPartial<CoinID>): CoinID;
26
- };
27
- export declare const CoinID_AddressIdentifier: {
28
- encode(message: CoinID_AddressIdentifier, writer?: _m0.Writer): _m0.Writer;
29
- decode(input: _m0.Reader | Uint8Array, length?: number): CoinID_AddressIdentifier;
30
- fromJSON(object: any): CoinID_AddressIdentifier;
31
- toJSON(message: CoinID_AddressIdentifier): unknown;
32
- fromPartial(object: DeepPartial<CoinID_AddressIdentifier>): CoinID_AddressIdentifier;
33
- };
34
- export declare const GetPriceRequest: {
35
- encode(message: GetPriceRequest, writer?: _m0.Writer): _m0.Writer;
36
- decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceRequest;
37
- fromJSON(object: any): GetPriceRequest;
38
- toJSON(message: GetPriceRequest): unknown;
39
- fromPartial(object: DeepPartial<GetPriceRequest>): GetPriceRequest;
40
- };
41
- export declare const GetPriceResponse: {
42
- encode(message: GetPriceResponse, writer?: _m0.Writer): _m0.Writer;
43
- decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceResponse;
44
- fromJSON(object: any): GetPriceResponse;
45
- toJSON(message: GetPriceResponse): unknown;
46
- fromPartial(object: DeepPartial<GetPriceResponse>): GetPriceResponse;
47
- };
48
- export declare type PriceServiceDefinition = typeof PriceServiceDefinition;
49
- export declare const PriceServiceDefinition: {
50
- readonly name: "PriceService";
51
- readonly fullName: "price_service.PriceService";
52
- readonly methods: {
53
- readonly getPrice: {
54
- readonly name: "GetPrice";
55
- readonly requestType: {
56
- encode(message: GetPriceRequest, writer?: _m0.Writer): _m0.Writer;
57
- decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceRequest;
58
- fromJSON(object: any): GetPriceRequest;
59
- toJSON(message: GetPriceRequest): unknown;
60
- fromPartial(object: DeepPartial<GetPriceRequest>): GetPriceRequest;
61
- };
62
- readonly requestStream: false;
63
- readonly responseType: {
64
- encode(message: GetPriceResponse, writer?: _m0.Writer): _m0.Writer;
65
- decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceResponse;
66
- fromJSON(object: any): GetPriceResponse;
67
- toJSON(message: GetPriceResponse): unknown;
68
- fromPartial(object: DeepPartial<GetPriceResponse>): GetPriceResponse;
69
- };
70
- readonly responseStream: false;
71
- readonly options: {};
72
- };
73
- };
74
- };
75
- export interface PriceServiceImplementation<CallContextExt = {}> {
76
- getPrice(request: GetPriceRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetPriceResponse>>;
77
- }
78
- export interface PriceServiceClient<CallOptionsExt = {}> {
79
- getPrice(request: DeepPartial<GetPriceRequest>, options?: CallOptions & CallOptionsExt): Promise<GetPriceResponse>;
80
- }
81
- declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
82
- declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
83
- [K in keyof T]?: DeepPartial<T[K]>;
84
- } : Partial<T>;
85
- export {};
@@ -1,269 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PriceServiceDefinition = exports.GetPriceResponse = exports.GetPriceRequest = exports.CoinID_AddressIdentifier = exports.CoinID = void 0;
7
- /* eslint-disable */
8
- const long_1 = __importDefault(require("long"));
9
- const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const timestamp_1 = require("../../../google/protobuf/timestamp");
11
- function createBaseCoinID() {
12
- return { symbol: undefined, address: undefined };
13
- }
14
- exports.CoinID = {
15
- encode(message, writer = minimal_1.default.Writer.create()) {
16
- if (message.symbol !== undefined) {
17
- writer.uint32(18).string(message.symbol);
18
- }
19
- if (message.address !== undefined) {
20
- exports.CoinID_AddressIdentifier.encode(message.address, writer.uint32(26).fork()).ldelim();
21
- }
22
- return writer;
23
- },
24
- decode(input, length) {
25
- const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
26
- let end = length === undefined ? reader.len : reader.pos + length;
27
- const message = createBaseCoinID();
28
- while (reader.pos < end) {
29
- const tag = reader.uint32();
30
- switch (tag >>> 3) {
31
- case 2:
32
- message.symbol = reader.string();
33
- break;
34
- case 3:
35
- message.address = exports.CoinID_AddressIdentifier.decode(reader, reader.uint32());
36
- break;
37
- default:
38
- reader.skipType(tag & 7);
39
- break;
40
- }
41
- }
42
- return message;
43
- },
44
- fromJSON(object) {
45
- return {
46
- symbol: isSet(object.symbol) ? String(object.symbol) : undefined,
47
- address: isSet(object.address) ? exports.CoinID_AddressIdentifier.fromJSON(object.address) : undefined,
48
- };
49
- },
50
- toJSON(message) {
51
- const obj = {};
52
- message.symbol !== undefined && (obj.symbol = message.symbol);
53
- message.address !== undefined &&
54
- (obj.address = message.address ? exports.CoinID_AddressIdentifier.toJSON(message.address) : undefined);
55
- return obj;
56
- },
57
- fromPartial(object) {
58
- const message = createBaseCoinID();
59
- message.symbol = object.symbol ?? undefined;
60
- message.address = (object.address !== undefined && object.address !== null)
61
- ? exports.CoinID_AddressIdentifier.fromPartial(object.address)
62
- : undefined;
63
- return message;
64
- },
65
- };
66
- function createBaseCoinID_AddressIdentifier() {
67
- return { address: "", chain: "" };
68
- }
69
- exports.CoinID_AddressIdentifier = {
70
- encode(message, writer = minimal_1.default.Writer.create()) {
71
- if (message.address !== "") {
72
- writer.uint32(10).string(message.address);
73
- }
74
- if (message.chain !== "") {
75
- writer.uint32(18).string(message.chain);
76
- }
77
- return writer;
78
- },
79
- decode(input, length) {
80
- const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
81
- let end = length === undefined ? reader.len : reader.pos + length;
82
- const message = createBaseCoinID_AddressIdentifier();
83
- while (reader.pos < end) {
84
- const tag = reader.uint32();
85
- switch (tag >>> 3) {
86
- case 1:
87
- message.address = reader.string();
88
- break;
89
- case 2:
90
- message.chain = reader.string();
91
- break;
92
- default:
93
- reader.skipType(tag & 7);
94
- break;
95
- }
96
- }
97
- return message;
98
- },
99
- fromJSON(object) {
100
- return {
101
- address: isSet(object.address) ? String(object.address) : "",
102
- chain: isSet(object.chain) ? String(object.chain) : "",
103
- };
104
- },
105
- toJSON(message) {
106
- const obj = {};
107
- message.address !== undefined && (obj.address = message.address);
108
- message.chain !== undefined && (obj.chain = message.chain);
109
- return obj;
110
- },
111
- fromPartial(object) {
112
- const message = createBaseCoinID_AddressIdentifier();
113
- message.address = object.address ?? "";
114
- message.chain = object.chain ?? "";
115
- return message;
116
- },
117
- };
118
- function createBaseGetPriceRequest() {
119
- return { timestamp: undefined, coinId: undefined };
120
- }
121
- exports.GetPriceRequest = {
122
- encode(message, writer = minimal_1.default.Writer.create()) {
123
- if (message.timestamp !== undefined) {
124
- timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim();
125
- }
126
- if (message.coinId !== undefined) {
127
- exports.CoinID.encode(message.coinId, writer.uint32(18).fork()).ldelim();
128
- }
129
- return writer;
130
- },
131
- decode(input, length) {
132
- const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
133
- let end = length === undefined ? reader.len : reader.pos + length;
134
- const message = createBaseGetPriceRequest();
135
- while (reader.pos < end) {
136
- const tag = reader.uint32();
137
- switch (tag >>> 3) {
138
- case 1:
139
- message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
140
- break;
141
- case 2:
142
- message.coinId = exports.CoinID.decode(reader, reader.uint32());
143
- break;
144
- default:
145
- reader.skipType(tag & 7);
146
- break;
147
- }
148
- }
149
- return message;
150
- },
151
- fromJSON(object) {
152
- return {
153
- timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
154
- coinId: isSet(object.coinId) ? exports.CoinID.fromJSON(object.coinId) : undefined,
155
- };
156
- },
157
- toJSON(message) {
158
- const obj = {};
159
- message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
160
- message.coinId !== undefined && (obj.coinId = message.coinId ? exports.CoinID.toJSON(message.coinId) : undefined);
161
- return obj;
162
- },
163
- fromPartial(object) {
164
- const message = createBaseGetPriceRequest();
165
- message.timestamp = object.timestamp ?? undefined;
166
- message.coinId = (object.coinId !== undefined && object.coinId !== null)
167
- ? exports.CoinID.fromPartial(object.coinId)
168
- : undefined;
169
- return message;
170
- },
171
- };
172
- function createBaseGetPriceResponse() {
173
- return { price: 0, timestamp: undefined };
174
- }
175
- exports.GetPriceResponse = {
176
- encode(message, writer = minimal_1.default.Writer.create()) {
177
- if (message.price !== 0) {
178
- writer.uint32(9).double(message.price);
179
- }
180
- if (message.timestamp !== undefined) {
181
- timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();
182
- }
183
- return writer;
184
- },
185
- decode(input, length) {
186
- const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
187
- let end = length === undefined ? reader.len : reader.pos + length;
188
- const message = createBaseGetPriceResponse();
189
- while (reader.pos < end) {
190
- const tag = reader.uint32();
191
- switch (tag >>> 3) {
192
- case 1:
193
- message.price = reader.double();
194
- break;
195
- case 2:
196
- message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
197
- break;
198
- default:
199
- reader.skipType(tag & 7);
200
- break;
201
- }
202
- }
203
- return message;
204
- },
205
- fromJSON(object) {
206
- return {
207
- price: isSet(object.price) ? Number(object.price) : 0,
208
- timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
209
- };
210
- },
211
- toJSON(message) {
212
- const obj = {};
213
- message.price !== undefined && (obj.price = message.price);
214
- message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());
215
- return obj;
216
- },
217
- fromPartial(object) {
218
- const message = createBaseGetPriceResponse();
219
- message.price = object.price ?? 0;
220
- message.timestamp = object.timestamp ?? undefined;
221
- return message;
222
- },
223
- };
224
- exports.PriceServiceDefinition = {
225
- name: "PriceService",
226
- fullName: "price_service.PriceService",
227
- methods: {
228
- getPrice: {
229
- name: "GetPrice",
230
- requestType: exports.GetPriceRequest,
231
- requestStream: false,
232
- responseType: exports.GetPriceResponse,
233
- responseStream: false,
234
- options: {},
235
- },
236
- },
237
- };
238
- function toTimestamp(date) {
239
- const seconds = numberToLong(date.getTime() / 1_000);
240
- const nanos = (date.getTime() % 1_000) * 1_000_000;
241
- return { seconds, nanos };
242
- }
243
- function fromTimestamp(t) {
244
- let millis = t.seconds.toNumber() * 1_000;
245
- millis += t.nanos / 1_000_000;
246
- return new Date(millis);
247
- }
248
- function fromJsonTimestamp(o) {
249
- if (o instanceof Date) {
250
- return o;
251
- }
252
- else if (typeof o === "string") {
253
- return new Date(o);
254
- }
255
- else {
256
- return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
257
- }
258
- }
259
- function numberToLong(number) {
260
- return long_1.default.fromNumber(number);
261
- }
262
- if (minimal_1.default.util.Long !== long_1.default) {
263
- minimal_1.default.util.Long = long_1.default;
264
- minimal_1.default.configure();
265
- }
266
- function isSet(value) {
267
- return value !== null && value !== undefined;
268
- }
269
- //# sourceMappingURL=price.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price.js","sourceRoot":"","sources":["../../../../../src/gen/service/price/protos/price.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,gDAAwB;AAExB,iEAAqC;AACrC,kEAA+D;AAsB/D,SAAS,gBAAgB;IACvB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC;AAEY,QAAA,MAAM,GAAG;IACpB,MAAM,CAAC,OAAe,EAAE,SAAqB,iBAAG,C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SAAS,CAAC;AAC/C,CAAC","sourcesContent":["/* eslint-disable */\nimport Long from \"long\";\nimport type { CallContext, CallOptions } from \"nice-grpc-common\";\nimport _m0 from \"protobufjs/minimal\";\nimport { Timestamp } from \"../../../google/protobuf/timestamp\";\n\nexport interface CoinID {\n symbol?: string | undefined;\n address?: CoinID_AddressIdentifier | undefined;\n}\n\nexport interface CoinID_AddressIdentifier {\n address: string;\n chain: string;\n}\n\nexport interface GetPriceRequest {\n timestamp: Date | undefined;\n coinId: CoinID | undefined;\n}\n\nexport interface GetPriceResponse {\n price: number;\n timestamp: Date | undefined;\n}\n\nfunction createBaseCoinID(): CoinID {\n return { symbol: undefined, address: undefined };\n}\n\nexport const CoinID = {\n encode(message: CoinID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {\n if (message.symbol !== undefined) {\n writer.uint32(18).string(message.symbol);\n }\n if (message.address !== undefined) {\n CoinID_AddressIdentifier.encode(message.address, writer.uint32(26).fork()).ldelim();\n }\n return writer;\n },\n\n decode(input: _m0.Reader | Uint8Array, length?: number): CoinID {\n const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCoinID();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n message.symbol = reader.string();\n break;\n case 3:\n message.address = CoinID_AddressIdentifier.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n\n fromJSON(object: any): CoinID {\n return {\n symbol: isSet(object.symbol) ? String(object.symbol) : undefined,\n address: isSet(object.address) ? CoinID_AddressIdentifier.fromJSON(object.address) : undefined,\n };\n },\n\n toJSON(message: CoinID): unknown {\n const obj: any = {};\n message.symbol !== undefined && (obj.symbol = message.symbol);\n message.address !== undefined &&\n (obj.address = message.address ? CoinID_AddressIdentifier.toJSON(message.address) : undefined);\n return obj;\n },\n\n fromPartial(object: DeepPartial<CoinID>): CoinID {\n const message = createBaseCoinID();\n message.symbol = object.symbol ?? undefined;\n message.address = (object.address !== undefined && object.address !== null)\n ? CoinID_AddressIdentifier.fromPartial(object.address)\n : undefined;\n return message;\n },\n};\n\nfunction createBaseCoinID_AddressIdentifier(): CoinID_AddressIdentifier {\n return { address: \"\", chain: \"\" };\n}\n\nexport const CoinID_AddressIdentifier = {\n encode(message: CoinID_AddressIdentifier, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n if (message.chain !== \"\") {\n writer.uint32(18).string(message.chain);\n }\n return writer;\n },\n\n decode(input: _m0.Reader | Uint8Array, length?: number): CoinID_AddressIdentifier {\n const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseCoinID_AddressIdentifier();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.address = reader.string();\n break;\n case 2:\n message.chain = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n\n fromJSON(object: any): CoinID_AddressIdentifier {\n return {\n address: isSet(object.address) ? String(object.address) : \"\",\n chain: isSet(object.chain) ? String(object.chain) : \"\",\n };\n },\n\n toJSON(message: CoinID_AddressIdentifier): unknown {\n const obj: any = {};\n message.address !== undefined && (obj.address = message.address);\n message.chain !== undefined && (obj.chain = message.chain);\n return obj;\n },\n\n fromPartial(object: DeepPartial<CoinID_AddressIdentifier>): CoinID_AddressIdentifier {\n const message = createBaseCoinID_AddressIdentifier();\n message.address = object.address ?? \"\";\n message.chain = object.chain ?? \"\";\n return message;\n },\n};\n\nfunction createBaseGetPriceRequest(): GetPriceRequest {\n return { timestamp: undefined, coinId: undefined };\n}\n\nexport const GetPriceRequest = {\n encode(message: GetPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {\n if (message.timestamp !== undefined) {\n Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim();\n }\n if (message.coinId !== undefined) {\n CoinID.encode(message.coinId, writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n\n decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceRequest {\n const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetPriceRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n break;\n case 2:\n message.coinId = CoinID.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n\n fromJSON(object: any): GetPriceRequest {\n return {\n timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,\n coinId: isSet(object.coinId) ? CoinID.fromJSON(object.coinId) : undefined,\n };\n },\n\n toJSON(message: GetPriceRequest): unknown {\n const obj: any = {};\n message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());\n message.coinId !== undefined && (obj.coinId = message.coinId ? CoinID.toJSON(message.coinId) : undefined);\n return obj;\n },\n\n fromPartial(object: DeepPartial<GetPriceRequest>): GetPriceRequest {\n const message = createBaseGetPriceRequest();\n message.timestamp = object.timestamp ?? undefined;\n message.coinId = (object.coinId !== undefined && object.coinId !== null)\n ? CoinID.fromPartial(object.coinId)\n : undefined;\n return message;\n },\n};\n\nfunction createBaseGetPriceResponse(): GetPriceResponse {\n return { price: 0, timestamp: undefined };\n}\n\nexport const GetPriceResponse = {\n encode(message: GetPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {\n if (message.price !== 0) {\n writer.uint32(9).double(message.price);\n }\n if (message.timestamp !== undefined) {\n Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim();\n }\n return writer;\n },\n\n decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceResponse {\n const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);\n let end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseGetPriceResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.price = reader.double();\n break;\n case 2:\n message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n },\n\n fromJSON(object: any): GetPriceResponse {\n return {\n price: isSet(object.price) ? Number(object.price) : 0,\n timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,\n };\n },\n\n toJSON(message: GetPriceResponse): unknown {\n const obj: any = {};\n message.price !== undefined && (obj.price = message.price);\n message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString());\n return obj;\n },\n\n fromPartial(object: DeepPartial<GetPriceResponse>): GetPriceResponse {\n const message = createBaseGetPriceResponse();\n message.price = object.price ?? 0;\n message.timestamp = object.timestamp ?? undefined;\n return message;\n },\n};\n\nexport type PriceServiceDefinition = typeof PriceServiceDefinition;\nexport const PriceServiceDefinition = {\n name: \"PriceService\",\n fullName: \"price_service.PriceService\",\n methods: {\n getPrice: {\n name: \"GetPrice\",\n requestType: GetPriceRequest,\n requestStream: false,\n responseType: GetPriceResponse,\n responseStream: false,\n options: {},\n },\n },\n} as const;\n\nexport interface PriceServiceImplementation<CallContextExt = {}> {\n getPrice(request: GetPriceRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetPriceResponse>>;\n}\n\nexport interface PriceServiceClient<CallOptionsExt = {}> {\n getPrice(request: DeepPartial<GetPriceRequest>, options?: CallOptions & CallOptionsExt): Promise<GetPriceResponse>;\n}\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;\n\ntype DeepPartial<T> = T extends Builtin ? T\n : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\nfunction toTimestamp(date: Date): Timestamp {\n const seconds = numberToLong(date.getTime() / 1_000);\n const nanos = (date.getTime() % 1_000) * 1_000_000;\n return { seconds, nanos };\n}\n\nfunction fromTimestamp(t: Timestamp): Date {\n let millis = t.seconds.toNumber() * 1_000;\n millis += t.nanos / 1_000_000;\n return new Date(millis);\n}\n\nfunction fromJsonTimestamp(o: any): Date {\n if (o instanceof Date) {\n return o;\n } else if (typeof o === \"string\") {\n return new Date(o);\n } else {\n return fromTimestamp(Timestamp.fromJSON(o));\n }\n}\n\nfunction numberToLong(number: number) {\n return Long.fromNumber(number);\n}\n\nif (_m0.util.Long !== Long) {\n _m0.util.Long = Long as any;\n _m0.configure();\n}\n\nfunction isSet(value: any): boolean {\n return value !== null && value !== undefined;\n}\n"]}
package/lib/plugin.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult } from './gen';
2
- export interface Plugin {
3
- name: string;
4
- supportedHandlers: HandlerType[];
5
- configure(config: ProcessConfigResponse): void;
6
- processBinding(request: DataBinding): Promise<ProcessResult>;
7
- }
8
- export declare class PluginManager {
9
- static INSTANCE: PluginManager;
10
- plugins: Plugin[];
11
- typesToPlugin: Map<HandlerType, Plugin>;
12
- register(plugin: Plugin): void;
13
- configure(config: ProcessConfigResponse): void;
14
- processBinding(request: DataBinding): Promise<ProcessResult>;
15
- }
package/lib/plugin.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PluginManager = void 0;
4
- class PluginManager {
5
- static INSTANCE = new PluginManager();
6
- plugins = [];
7
- typesToPlugin = new Map();
8
- register(plugin) {
9
- this.plugins.push(plugin);
10
- // for (const plugin of this.plugins) {
11
- for (const handlerType of plugin.supportedHandlers) {
12
- const exsited = this.typesToPlugin.get(handlerType);
13
- if (exsited) {
14
- throw new Error(`Duplicate plugin for ${handlerType}: ${exsited.name} and ${plugin.name}`);
15
- }
16
- this.typesToPlugin.set(handlerType, plugin);
17
- }
18
- // }
19
- }
20
- configure(config) {
21
- this.plugins.forEach((plugin) => plugin.configure(config));
22
- }
23
- processBinding(request) {
24
- const plugin = this.typesToPlugin.get(request.handlerType);
25
- if (!plugin) {
26
- throw new Error(`No plugin for ${request.handlerType}`);
27
- }
28
- return plugin.processBinding(request);
29
- }
30
- }
31
- exports.PluginManager = PluginManager;
32
- //# sourceMappingURL=plugin.js.map
package/lib/plugin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;;AAUA,MAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;IAErC,OAAO,GAAa,EAAE,CAAA;IACtB,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAA;IAE9C,QAAQ,CAAC,MAAc;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzB,uCAAuC;QACvC,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,iBAAiB,EAAE;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YACnD,IAAI,OAAO,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,KAAK,OAAO,CAAC,IAAI,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;aAC3F;YACD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;SAC5C;QACD,IAAI;IACN,CAAC;IAED,SAAS,CAAC,MAA6B;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5D,CAAC;IAED,cAAc,CAAC,OAAoB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC1D,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;SACxD;QACD,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;;AA7BH,sCA8BC","sourcesContent":["import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult } from './gen'\n\nexport interface Plugin {\n name: string\n supportedHandlers: HandlerType[]\n\n configure(config: ProcessConfigResponse): void\n processBinding(request: DataBinding): Promise<ProcessResult>\n}\n\nexport class PluginManager {\n static INSTANCE = new PluginManager()\n\n plugins: Plugin[] = []\n typesToPlugin = new Map<HandlerType, Plugin>()\n\n register(plugin: Plugin) {\n this.plugins.push(plugin)\n // for (const plugin of this.plugins) {\n for (const handlerType of plugin.supportedHandlers) {\n const exsited = this.typesToPlugin.get(handlerType)\n if (exsited) {\n throw new Error(`Duplicate plugin for ${handlerType}: ${exsited.name} and ${plugin.name}`)\n }\n this.typesToPlugin.set(handlerType, plugin)\n }\n // }\n }\n\n configure(config: ProcessConfigResponse) {\n this.plugins.forEach((plugin) => plugin.configure(config))\n }\n\n processBinding(request: DataBinding): Promise<ProcessResult> {\n const plugin = this.typesToPlugin.get(request.handlerType)\n if (!plugin) {\n throw new Error(`No plugin for ${request.handlerType}`)\n }\n return plugin.processBinding(request)\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- export declare class ProcessorState {
2
- stateMap: Map<string, any>;
3
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProcessorState = void 0;
4
- class ProcessorState {
5
- stateMap = new Map();
6
- }
7
- exports.ProcessorState = ProcessorState;
8
- //# sourceMappingURL=processor-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processor-state.js","sourceRoot":"","sources":["../../src/state/processor-state.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IACzB,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAA;CAClC;AAFD,wCAEC","sourcesContent":["export class ProcessorState {\n stateMap = new Map<string, any>()\n}\n"]}
@@ -1,17 +0,0 @@
1
- export declare abstract class StateStorage<T> {
2
- protected constructor();
3
- abstract initValue(): T;
4
- key(): string;
5
- getOrRegister(): T;
6
- }
7
- export declare abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {
8
- initValue(): Map<string, T>;
9
- getValue(key: string): T | undefined;
10
- getValues(): T[];
11
- getOrSetValue(key: string, value: T): T;
12
- }
13
- export declare abstract class ListStateStorage<T> extends StateStorage<T[]> {
14
- initValue(): never[];
15
- getValues(): T[];
16
- addValue(value: T): T;
17
- }
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListStateStorage = exports.MapStateStorage = exports.StateStorage = void 0;
4
- class StateStorage {
5
- // TODO learn how to define single instance for all subclasses
6
- constructor() {
7
- //
8
- }
9
- key() {
10
- return this.constructor.name;
11
- }
12
- getOrRegister() {
13
- let metricState = global.PROCESSOR_STATE.stateMap.get(this.key());
14
- if (!metricState) {
15
- metricState = this.initValue();
16
- global.PROCESSOR_STATE.stateMap.set(this.key(), metricState);
17
- }
18
- return metricState;
19
- }
20
- }
21
- exports.StateStorage = StateStorage;
22
- class MapStateStorage extends StateStorage {
23
- initValue() {
24
- return new Map();
25
- }
26
- getValue(key) {
27
- const m = this.getOrRegister();
28
- return m.get(key);
29
- }
30
- getValues() {
31
- const m = this.getOrRegister();
32
- return Array.from(m.values());
33
- }
34
- getOrSetValue(key, value) {
35
- const m = this.getOrRegister();
36
- const oldValue = m.get(key);
37
- if (oldValue) {
38
- console.warn(key, 'has been registered twice, use the previous one');
39
- return oldValue;
40
- }
41
- m.set(key, value);
42
- return value;
43
- }
44
- }
45
- exports.MapStateStorage = MapStateStorage;
46
- class ListStateStorage extends StateStorage {
47
- initValue() {
48
- return [];
49
- }
50
- getValues() {
51
- return this.getOrRegister();
52
- }
53
- addValue(value) {
54
- const m = this.getOrRegister();
55
- m.push(value);
56
- return value;
57
- }
58
- }
59
- exports.ListStateStorage = ListStateStorage;
60
- //# sourceMappingURL=state-storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-storage.js","sourceRoot":"","sources":["../../src/state/state-storage.ts"],"names":[],"mappings":";;;AAAA,MAAsB,YAAY;IAChC,8DAA8D;IAE9D;QACE,EAAE;IACJ,CAAC;IAID,GAAG;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;IAC9B,CAAC;IAED,aAAa;QACX,IAAI,WAAW,GAAM,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QACpE,IAAI,CAAC,WAAW,EAAE;YAChB,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;YAC9B,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAA;SAC7D;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;CACF;AArBD,oCAqBC;AAED,MAAsB,eAAmB,SAAQ,YAA4B;IAC3E,SAAS;QACP,OAAO,IAAI,GAAG,EAAa,CAAA;IAC7B,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QAC9B,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACnB,CAAC;IAED,SAAS;QACP,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/B,CAAC;IAED,aAAa,CAAC,GAAW,EAAE,KAAQ;QACjC,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QAC9B,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,QAAQ,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,iDAAiD,CAAC,CAAA;YACpE,OAAO,QAAQ,CAAA;SAChB;QACD,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAzBD,0CAyBC;AAED,MAAsB,gBAAoB,SAAQ,YAAiB;IACjE,SAAS;QACP,OAAO,EAAE,CAAA;IACX,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,aAAa,EAAE,CAAA;IAC7B,CAAC;IAED,QAAQ,CAAC,KAAQ;QACf,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QAC9B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACb,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAdD,4CAcC","sourcesContent":["export abstract class StateStorage<T> {\n // TODO learn how to define single instance for all subclasses\n\n protected constructor() {\n //\n }\n\n abstract initValue(): T\n\n key(): string {\n return this.constructor.name\n }\n\n getOrRegister(): T {\n let metricState: T = global.PROCESSOR_STATE.stateMap.get(this.key())\n if (!metricState) {\n metricState = this.initValue()\n global.PROCESSOR_STATE.stateMap.set(this.key(), metricState)\n }\n return metricState\n }\n}\n\nexport abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {\n initValue() {\n return new Map<string, T>()\n }\n\n getValue(key: string): T | undefined {\n const m = this.getOrRegister()\n return m.get(key)\n }\n\n getValues(): T[] {\n const m = this.getOrRegister()\n return Array.from(m.values())\n }\n\n getOrSetValue(key: string, value: T): T {\n const m = this.getOrRegister()\n const oldValue = m.get(key)\n if (oldValue) {\n console.warn(key, 'has been registered twice, use the previous one')\n return oldValue\n }\n m.set(key, value)\n return value\n }\n}\n\nexport abstract class ListStateStorage<T> extends StateStorage<T[]> {\n initValue() {\n return []\n }\n\n getValues(): T[] {\n return this.getOrRegister()\n }\n\n addValue(value: T): T {\n const m = this.getOrRegister()\n m.push(value)\n return value\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-storage.test.js","sourceRoot":"","sources":["../../src/state/state-storage.test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,mDAAiD;AACjD,uDAAkD;AAElD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,MAAM,CAAC,eAAe,GAAG,IAAI,gCAAc,EAAE,CAAA;IAE7C,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,SAAU,SAAQ,+BAAoB;YAC1C,MAAM,CAAC,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAA;;QAEnC,MAAM,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAA;QAC5C,IAAA,aAAM,EAAC,CAAC,KAAK,SAAS,CAAC,CAAA;QAEvB,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACrD,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC5D,IAAA,aAAM,EAAC,EAAE,KAAK,EAAE,CAAC,CAAA;QACjB,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAE5C,IAAA,aAAM,EAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;QACnD,IAAA,aAAM,EAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,CAAA;QAClD,IAAA,aAAM,EAAC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,CAAA;IAC7E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { assert } from 'chai'\nimport { MapStateStorage } from './state-storage'\nimport { ProcessorState } from './processor-state'\n\ndescribe('state storage tests', () => {\n global.PROCESSOR_STATE = new ProcessorState()\n\n test('test labels', async () => {\n class TestState extends MapStateStorage<any> {\n static INSTANCE = new TestState()\n }\n const m = TestState.INSTANCE.getOrRegister()\n assert(m !== undefined)\n\n const v1 = TestState.INSTANCE.getOrSetValue('k1', {})\n const v2 = TestState.INSTANCE.getOrSetValue('k1', { a: '' })\n assert(v1 === v2)\n TestState.INSTANCE.getOrSetValue('k2', 'v2')\n\n assert(TestState.INSTANCE.getValues().length === 2)\n assert(global.PROCESSOR_STATE.stateMap.size === 1)\n assert(global.PROCESSOR_STATE.stateMap.keys().next().value === 'TestState')\n })\n})\n"]}
@@ -1,22 +0,0 @@
1
- import Long from 'long'
2
-
3
- type Builtin =
4
- | Date
5
- | Function
6
- | Uint8Array
7
- | string
8
- | number
9
- | boolean
10
- | undefined;
11
-
12
- export type DeepPartial<T> = T extends Builtin
13
- ? T
14
- : T extends Long
15
- ? string | number | Long
16
- : T extends Array<infer U>
17
- ? Array<DeepPartial<U>>
18
- : T extends ReadonlyArray<infer U>
19
- ? ReadonlyArray<DeepPartial<U>>
20
- : T extends {}
21
- ? { [K in keyof T]?: DeepPartial<T[K]> }
22
- : Partial<T>;