@jayesol/jayeson.lib.sports 2.2.6-beta.0 → 2.2.6

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/lib/module.js DELETED
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SportsFeedCoreService = exports.SportsFeedCoreComponentModule = void 0;
27
- const D = __importStar(require("@jayesol/jayeson.lib.delivery"));
28
- const injection_js_1 = require("injection-js");
29
- const message_class_1 = require("./message_class");
30
- const receive_1 = require("./receive");
31
- const core_1 = require("./core");
32
- const dispatch_1 = require("./dispatch");
33
- const client_1 = require("./client");
34
- class SportsFeedCoreComponentModule {
35
- static getBindingArray(exclude = [], wireFormat = "", outputStreamName = client_1.MemoryDispatcher.MEMORY_STREAM) {
36
- return [
37
- { provide: message_class_1.StartSubscribeFeed, useValue: new message_class_1.StartSubscribeFeed(exclude, wireFormat) },
38
- { provide: message_class_1.SportsFeedMessageGroup, useValue: new message_class_1.SportsFeedMessageGroup() },
39
- { provide: D.StreamNameCode, useClass: D.StreamNameCode },
40
- { provide: receive_1.InEndPointEventHandler, useClass: receive_1.InEndPointEventHandler },
41
- { provide: core_1.FSRepoImpl.outputStream, useValue: outputStreamName },
42
- core_1.FSRepoImpl,
43
- { provide: core_1.AbstractFSRepo, useExisting: core_1.FSRepoImpl },
44
- { provide: core_1.FSREPO_IMPL, useExisting: core_1.FSRepoImpl },
45
- dispatch_1.RelayEPG,
46
- dispatch_1.EndPointGroupManager,
47
- core_1.TTLConfig,
48
- core_1.RecycleBin,
49
- receive_1.StreamCommandProcessor,
50
- receive_1.SportsFeedInProcessor,
51
- { provide: D.IMessageGroupProcessor, useExisting: receive_1.SportsFeedInProcessor },
52
- { provide: dispatch_1.EPGM_IMPL, useExisting: dispatch_1.EndPointGroupManager },
53
- client_1.FeedView,
54
- client_1.SportsFeedClient
55
- ];
56
- }
57
- }
58
- exports.SportsFeedCoreComponentModule = SportsFeedCoreComponentModule;
59
- class SportsFeedCoreService {
60
- constructor(streamFinder, feedScope) {
61
- const subscriberFactory = function (processor) {
62
- const config = new D.SubscriberConfig();
63
- config.streamFinder = streamFinder;
64
- config.discoveryPattern = {
65
- 70: ['.*']
66
- };
67
- config.processors = {
68
- 70: processor
69
- };
70
- config.schemes = ['ws', 'http', 'https', 'wss'];
71
- config.feedScope = feedScope;
72
- return new D.Subscriber(config);
73
- };
74
- const injector = injection_js_1.ReflectiveInjector.resolveAndCreate(SportsFeedCoreComponentModule.getBindingArray().concat([
75
- { provide: D.Subscriber, useFactory: subscriberFactory, deps: [receive_1.SportsFeedInProcessor] }
76
- ]));
77
- this.client = injector.get(client_1.SportsFeedClient);
78
- this.subscriber = injector.get(D.Subscriber);
79
- }
80
- getClient() {
81
- return this.client;
82
- }
83
- getSubscriber() {
84
- return this.subscriber;
85
- }
86
- }
87
- exports.SportsFeedCoreService = SportsFeedCoreService;
package/lib/mutable.d.ts DELETED
@@ -1,118 +0,0 @@
1
- import { OddType, LBType, TimeType, OddFormat, PivotBias, PivotType, StringMap, IBetEvent, IBetRecord, IBetEventState, IBetMatch, PartitionKey } from "@jayesol/jayeson.lib.record";
2
- import { IndexedSnapshot } from "./data_structure";
3
- export interface ObjectMap<T> {
4
- [index: string]: T;
5
- }
6
- export interface Aggregatable<T> {
7
- aggregateInsert(t: T): any;
8
- aggregateUpdate(t: T): any;
9
- aggregateDelete(t: T): boolean;
10
- isEmpty(): boolean;
11
- }
12
- export interface Buildable<T> {
13
- build(): T;
14
- }
15
- export interface Mergeable<T> {
16
- merge(t: T): any;
17
- }
18
- export interface ParentOf<T> {
19
- insertChild(t: T): string;
20
- updateChild(t: T): any;
21
- deleteChild(t: T): string;
22
- }
23
- export interface IIndexedSnapshotBuilder extends ParentOf<IBetMatch>, Buildable<IndexedSnapshot> {
24
- reset(key: PartitionKey): IIndexedSnapshotBuilder;
25
- markPartitionAsUpdated(key: PartitionKey, time?: number): any;
26
- replaceMatch(build: IBetMatch): any;
27
- }
28
- export interface IBetMatchBuilder extends Aggregatable<IBetMatch>, ParentOf<IBetEvent>, Buildable<IBetMatch> {
29
- replaceEvent(evt: IBetEvent): any;
30
- reset(key: PartitionKey): IBetMatchBuilder;
31
- }
32
- export interface IBetEventBuilder extends Aggregatable<IBetEvent>, ParentOf<IBetRecord>, Buildable<IBetEvent> {
33
- reset(key: PartitionKey): any;
34
- }
35
- export interface IBetEventStateBuilder extends Mergeable<IBetEventState>, Buildable<IBetEventState> {
36
- }
37
- export interface IBetRecordBuilder extends Mergeable<IBetRecord>, Buildable<IBetRecord> {
38
- }
39
- export declare class Const {
40
- static readonly AGGREGATE_KEY: string;
41
- static readonly SEPARATOR: string;
42
- static generateKey(rec: IBetRecord): string;
43
- }
44
- export declare abstract class B2RecordBuilder implements IBetRecordBuilder {
45
- protected _eventId: string;
46
- protected _matchId: string;
47
- protected _id: number;
48
- protected _oddType: OddType;
49
- protected _lbType: LBType;
50
- protected _timetype: TimeType;
51
- protected _sportbook: string;
52
- protected _meta: StringMap;
53
- protected _oddFormat: OddFormat;
54
- protected _rateOver: number;
55
- protected _rateUnder: number;
56
- protected _rateEqual: number;
57
- protected _pivotValue: number;
58
- protected _pivotType: PivotType;
59
- protected _pivotBias: PivotBias;
60
- protected _rateOverId: string;
61
- protected _rateUnderId: string;
62
- protected _rateEqualId: string;
63
- protected _isSwapped: boolean;
64
- constructor(rec: IBetRecord);
65
- eventId(): string;
66
- matchId(): string;
67
- id(): number;
68
- oddType(): OddType;
69
- lbType(): LBType;
70
- timetype(): TimeType;
71
- sportbook(): string;
72
- meta(): StringMap;
73
- oddFormat(): OddFormat;
74
- rateOver(): number;
75
- rateUnder(): number;
76
- rateEqual(): number;
77
- pivotValue(): number;
78
- pivotType(): PivotType;
79
- pivotBias(): PivotBias;
80
- rateOverId(): string;
81
- rateUnderId(): string;
82
- rateEqualId(): string;
83
- isSwapped(): boolean;
84
- setEventId(eventId: string): void;
85
- setMatchId(matchId: string): void;
86
- setId(id: number): void;
87
- setOddType(oddType: OddType): void;
88
- setLbType(lbType: LBType): void;
89
- setTimeType(timetype: TimeType): void;
90
- setSportbook(sportbook: string): void;
91
- setMeta(meta: StringMap): void;
92
- setOddFormat(oddFormat: OddFormat): void;
93
- setRateOver(rateOver: number): void;
94
- setRateUnder(rateUnder: number): void;
95
- setRateEqual(rateEqual: number): void;
96
- setPivotValue(pivotValue: number): void;
97
- setPivotType(pivotType: PivotType): void;
98
- setPivotBias(pivotBias: PivotBias): void;
99
- setRateOverId(rateOverId: string): void;
100
- setRateUnderId(rateUnderId: string): void;
101
- setRateEqualId(rateEqualId: string): void;
102
- setSwapped(isSwapped: boolean): void;
103
- build(): IBetRecord;
104
- merge(rec: IBetRecord): void;
105
- mergeFrom(record: IBetRecord): void;
106
- }
107
- /**
108
- * TODO:
109
- * Fix use SoccerMatch interface instead of
110
- * Implementation to check type
111
- */
112
- export declare class BuilderProvider {
113
- static getMatchBuilder(match: IBetMatch): IBetMatchBuilder;
114
- static getEventBuilder(event: IBetEvent): IBetEventBuilder;
115
- static getRecordBuilder(record: IBetRecord): IBetRecordBuilder;
116
- static getEventStateBuilder(state: IBetEventState): IBetEventStateBuilder;
117
- static getSnapshotBuilder(parentSs: IndexedSnapshot): IIndexedSnapshotBuilder;
118
- }