@jayesol/jayeson.lib.sports 2.2.4 → 2.2.5-beta.1205

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var rec=require("@jayesol/jayeson.lib.record"),proto=require("./protobuf_bundle"),codec_1=require("./codec"),SoccerCodec=function(){function e(){this.codecHelper=new codec_1.CodecHelper}return e.prototype.getMatch=function(e,t,r,c,o,n,a,l,p,i){return new rec.SoccerMatchImpl(r,c,o,t,e,n,i,p,a,l)},e.prototype.getEvent=function(e,t,r,c,o,n){return new rec.SoccerEventImpl(e,t,r,c,o,n)},e.prototype.decodeMatch=function(e,u,t,d){var v=this,S=[];return e.forEach(function(e){var t=u[e.id],r={};null!=e.metaInfo&&(r=e.metaInfo);var c=u[e.participants[0]],o=u[e.participants[1]],n=v.codecHelper.coerceInt64(e.startTime),a=u[e.league],l=rec.SoccerGender[e.soccerMatch.gender.toString()],p=u[e.country],i=rec.LeagueType[e.soccerMatch.leagueType.toString()];r=v.codecHelper.populatePKIntoMetaInfo(r,d);var s=v.getMatch(t,[],c,o,n,a,l,p,i,r);S.push(s)}),S},e.prototype.decodeEvent=function(e,i,s,u){var d=this,v=[];return e.forEach(function(e){var t,r=i[e.id],c=[],o=null;switch(proto.SoccerEvent.Type[e.eventType.soccerEventType]){case"NONE":o=rec.SoccerEventType.NONE;break;case"NEXT_CORNER":o=rec.SoccerEventType.NEXT_CORNER;break;case"TOTAL_CORNER":o=rec.SoccerEventType.TOTAL_CORNER;break;case"BOOKING":o=rec.SoccerEventType.BOOKING;break;case"UNCATEGORIZED_SPECIAL":o=rec.SoccerEventType.UNCATEGORIZED_SPECIAL}t=e.metaInfo;var n=i[e.matchId],a=d.decodeState(n,r,e.state,i,s,u);c.push(a);var l=d.getEvent(r,[],c,n,o,t),p=d.getMatch(i[e.matchId],[l],null,null,0,null,null,null,null,null);v.push(p)}),v},e.prototype.decodeRecord=function(e,m,t,r){var I=this,c=[],O={};for(var o in e.forEach(function(e){var t=I.codecHelper.coerceInt64(e.id),r=null,c=m[e.source],o=m[e.matchId],n=m[e.eventId],a=rec.OddType[e.oddType.toString()],l=rec.LBType[e.lbType.toString()],p=e.timeType.soccerTimeType;switch(proto.SoccerTimeType.SettleOn[p.settle.toString()]){case"FT":r=rec.SoccerTimeType.FT;break;case"HT":r=rec.SoccerTimeType.HT}var i=rec.OddFormat[e.format.toString()],s=e.metaInfo,u=I.codecHelper.formatRate(e.rates[0]),d=I.codecHelper.formatRate(e.rates[1]),v=I.codecHelper.formatRate(e.rates[2]);console.log("Base Record rates: "+e.rates[0]+"_"+e.rates[1]+"_"+e.rates[2]+" After format: "+u+"_"+d+"_"+v);var S=e.pivotValue,T=rec.PivotBias[e.pivotBias.toString()],E=rec.PivotType[e.pivotType.toString()],y=m[e.rateIds[0]],h=m[e.rateIds[1]],f=m[e.rateIds[2]],g=new rec.SoccerRecord(o,n,t,a,l,r,c,i,s,u,d,v,S,E,T,y,h,f,!1);void 0===O[o]&&(O[o]={}),void 0===O[o][n]&&(O[o][n]=[]),O[o][n].push(g)}),O){var n=O[o],a=[];for(var l in n){var p=this.getEvent(l,n[l],null,o,null,null);a.push(p)}var i=this.getMatch(o,a,null,null,0,null,null,null,null,null);c.push(i)}return c},e.prototype.decodeState=function(e,t,r,c,o,n,a){void 0===a&&(a=Date.now());var l=r.participantStats[0].scores[0],p=r.participantStats[0].scores[1],i=r.participantStats[1].scores[0],s=r.participantStats[1].scores[1],u=r.duration,d=rec.SoccerSegment[r.soccerEventState.segment.toString()],v=r.soccerEventState.bookPriority,S=new rec.SoccerEventState(u,n,e,t,a,l,i,p,s,d,v),T=this.getEvent(t,null,[S],e,null,{});this.getMatch(e,[T],null,null,0,null,null,null,null,{});return new rec.SoccerEventState(u,n,e,t,a,l,i,p,s,d,v)},e}();exports.SoccerCodec=SoccerCodec;
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var rec=require("@longchau/jayeson.lib.record"),proto=require("./protobuf_bundle"),codec_1=require("./codec"),SoccerCodec=(()=>{function e(){this.codecHelper=new codec_1.CodecHelper}return e.prototype.getMatch=function(e,t,c,r,o,n,a,l,p,i){return new rec.SoccerMatchImpl(c,r,o,t,e,n,i,p,a,l)},e.prototype.getEvent=function(e,t,c,r,o,n){return new rec.SoccerEventImpl(e,t,c,r,o,n)},e.prototype.decodeMatch=function(e,i,t,u){var s=this,d=[];return e.forEach(function(e){var t=i[e.id],c={},r=(null!=e.metaInfo&&(c=e.metaInfo),i[e.participants[0]]),o=i[e.participants[1]],n=s.codecHelper.coerceInt64(e.startTime),a=i[e.league],l=rec.SoccerGender[e.soccerMatch.gender.toString()],p=i[e.country],e=rec.LeagueType[e.soccerMatch.leagueType.toString()],c=s.codecHelper.populatePKIntoMetaInfo(c,u),t=s.getMatch(t,[],r,o,n,a,l,p,e,c);d.push(t)}),d},e.prototype.decodeEvent=function(e,l,p,i){var u=this,s=[];return e.forEach(function(e){var t=l[e.id],c=[],r=null;switch(proto.SoccerEvent.Type[e.eventType.soccerEventType]){case"NONE":r=rec.SoccerEventType.NONE;break;case"NEXT_CORNER":r=rec.SoccerEventType.NEXT_CORNER;break;case"TOTAL_CORNER":r=rec.SoccerEventType.TOTAL_CORNER;break;case"BOOKING":r=rec.SoccerEventType.BOOKING;break;case"UNCATEGORIZED_SPECIAL":r=rec.SoccerEventType.UNCATEGORIZED_SPECIAL}var o=e.metaInfo,n=l[e.matchId],a=u.decodeState(n,t,e.state,l,p,i),a=(c.push(a),u.getEvent(t,[],c,n,r,o)),t=u.getMatch(l[e.matchId],[a],null,null,0,null,null,null,null,null);s.push(t)}),s},e.prototype.decodeRecord=function(e,y,t,c){var r,f=this,o=[],g={};for(r in e.forEach(function(e){var t=f.codecHelper.coerceInt64(e.id),c=null,r=y[e.source],o=y[e.matchId],n=y[e.eventId],a=rec.OddType[e.oddType.toString()],l=rec.LBType[e.lbType.toString()],p=e.timeType.soccerTimeType;switch(proto.SoccerTimeType.SettleOn[p.settle.toString()]){case"FT":c=rec.SoccerTimeType.FT;break;case"HT":c=rec.SoccerTimeType.HT}var p=rec.OddFormat[e.format.toString()],i=e.metaInfo,u=f.codecHelper.formatRate(e.rates[0]),s=f.codecHelper.formatRate(e.rates[1]),d=f.codecHelper.formatRate(e.rates[2]),S=e.pivotValue,v=rec.PivotBias[e.pivotBias.toString()],T=rec.PivotType[e.pivotType.toString()],E=y[e.rateIds[0]],h=y[e.rateIds[1]],e=y[e.rateIds[2]],t=new rec.SoccerRecord(o,n,t,a,l,c,r,p,i,u,s,d,S,T,v,E,h,e,!1);void 0===g[o]&&(g[o]={}),void 0===g[o][n]&&(g[o][n]=[]),g[o][n].push(t)}),g){var n,a=g[r],l=[];for(n in a){var p=this.getEvent(n,a[n],null,r,null,null);l.push(p)}var i=this.getMatch(r,l,null,null,0,null,null,null,null,null);o.push(i)}return o},e.prototype.decodeState=function(e,t,c,r,o,n,a){void 0===a&&(a=Date.now());var l=c.participantStats[0].scores[0],p=c.participantStats[0].scores[1],i=c.participantStats[1].scores[0],u=c.participantStats[1].scores[1],s=c.duration,d=rec.SoccerSegment[c.soccerEventState.segment.toString()],c=c.soccerEventState.bookPriority,S=new rec.SoccerEventState(s,n,e,t,a,l,i,p,u,d,c),S=this.getEvent(t,null,[S],e,null,{});this.getMatch(e,[S],null,null,0,null,null,null,null,{});return new rec.SoccerEventState(s,n,e,t,a,l,i,p,u,d,c)},e})();exports.SoccerCodec=SoccerCodec;
@@ -1,4 +1,4 @@
1
- import * as rec from "@jayesol/jayeson.lib.record";
1
+ import * as rec from "@longchau/jayeson.lib.record";
2
2
  import * as proto from "./protobuf_bundle";
3
3
  import { ICodec, EncodeAction } from "./codec";
4
4
  export declare class TennisCodec implements ICodec {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var rec=require("@jayesol/jayeson.lib.record"),proto=require("./protobuf_bundle"),codec_1=require("./codec"),TennisCodec=function(){function e(){this.codecHelper=new codec_1.CodecHelper}return e.prototype.getMatch=function(e,t,n,r,o,a,c,i,s){return new rec.TennisMatchImpl(n,r,o,t,e,a,c,i,s)},e.prototype.getEvent=function(e,t,n,r,o,a){return new rec.TennisEventImpl(e,t,n,r,o,a)},e.prototype.decodeMatch=function(e,l,t,u){var d=this,v=[];return e.forEach(function(e){var t=l[e.id],n=l[e.participants[0]],r=l[e.participants[1]],o=d.codecHelper.coerceInt64(e.startTime),a=l[e.league],c=rec.TennisGender[e.tennisMatch.gender.toString()],i=e.metaInfo,s=l[e.country];i=d.codecHelper.populatePKIntoMetaInfo(i,u);var p=d.getMatch(t,[],n,r,o,a,c,s,i);v.push(p)}),v},e.prototype.decodeEvent=function(e,i,s,p){var l=this,t=[],u={};for(var n in e.forEach(function(e){var t,n=i[e.id],r=null;switch(proto.TennisEvent.Type[e.eventType.tennisEventType]){case"NONE":r=rec.TennisEventType.NONE;break;case"GAME":r=rec.TennisEventType.GAME;break;case"SET":r=rec.TennisEventType.SET;break;case"POINT":r=rec.TennisEventType.POINT;break;case"HOME_GAME":r=rec.TennisEventType.HOME_GAME;break;case"AWAY_GAME":r=rec.TennisEventType.AWAY_GAME}t=e.metaInfo;var o=[];null!=e.state&&o.push(l.decodeState(i[e.matchId],n,e.state,i,s,p));var a=i[e.matchId],c=l.getEvent(n,[],o,a,r,t);void 0===u[a]&&(u[a]=[]),u[a].push(c)}),u){var r=this.getMatch(n,u[n],null,null,0,null,null,null,null);t.push(r)}return t},e.prototype.decodeRecord=function(e,I,t,n){var S=this,r=[],M={};for(var o in e.forEach(function(e){var t=S.codecHelper.coerceInt64(e.id),n=I[e.source],r=I[e.matchId],o=I[e.eventId],a=rec.OddType[e.oddType.toString()],c=rec.LBType[e.lbType.toString()],i=e.timeType.tennisTimeType,s=new rec.TennisTimeType(i.match,i.set,i.game),p=rec.OddFormat[e.format.toString()],l=e.metaInfo,u=S.codecHelper.formatRate(e.rates[0]),d=S.codecHelper.formatRate(e.rates[1]),v=S.codecHelper.formatRate(e.rates[2]);console.log("Base Record rates: "+e.rates[0]+"_"+e.rates[1]+"_"+e.rates[2]+" After format: "+u+"_"+d+"_"+v);var T=e.pivotValue,h=rec.PivotBias[e.pivotBias.toString()],f=rec.PivotType[e.pivotType.toString()],E=I[e.rateIds[0]],y=I[e.rateIds[1]],g=I[e.rateIds[2]],m=new rec.TennisRecord(r,o,t,a,c,s,n,p,l,u,d,v,T,f,h,E,y,g,!1);void 0===M[r]&&(M[r]={}),void 0===M[r][o]&&(M[r][o]=[]),M[r][o].push(m)}),M){var a=M[o],c=[];for(var i in a){var s=this.getEvent(i,a[i],null,o,null,null);c.push(s)}var p=this.getMatch(o,c,null,null,0,null,null,null,null);r.push(p)}return r},e.prototype.decodeState=function(e,t,n,r,o,a,c){void 0===c&&(c=Date.now());var i=n.participantStats[0].scores,s=n.participantStats[1].scores;if(i.length<10)for(var p=i.length,l=0;p+l<10;l++)i.push(-1);if(s.length<10){var u=s.length;for(l=0;u+l<10;l++)s.push(-1)}var d=new rec.TennisStats(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9]),v=new rec.TennisStats(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]),T=n.duration,h=n.tennisEventState.set,f=n.tennisEventState.game,E=n.tennisEventState.bookPriority;return new rec.TennisEventState(d,v,T,a,e,t,E,c,h,f)},e}();exports.TennisCodec=TennisCodec;
1
+ Object.defineProperty(exports,"__esModule",{value:!0});var rec=require("@longchau/jayeson.lib.record"),proto=require("./protobuf_bundle"),codec_1=require("./codec"),TennisCodec=(()=>{function e(){this.codecHelper=new codec_1.CodecHelper}return e.prototype.getMatch=function(e,t,n,r,o,c,a,i,s){return new rec.TennisMatchImpl(n,r,o,t,e,c,a,i,s)},e.prototype.getEvent=function(e,t,n,r,o,c){return new rec.TennisEventImpl(e,t,n,r,o,c)},e.prototype.decodeMatch=function(e,s,t,p){var l=this,u=[];return e.forEach(function(e){var t=s[e.id],n=s[e.participants[0]],r=s[e.participants[1]],o=l.codecHelper.coerceInt64(e.startTime),c=s[e.league],a=rec.TennisGender[e.tennisMatch.gender.toString()],i=e.metaInfo,e=s[e.country],i=l.codecHelper.populatePKIntoMetaInfo(i,p),t=l.getMatch(t,[],n,r,o,c,a,e,i);u.push(t)}),u},e.prototype.decodeEvent=function(e,c,a,i){var t,s=this,n=[],p={};for(t in e.forEach(function(e){var t=c[e.id],n=null;switch(proto.TennisEvent.Type[e.eventType.tennisEventType]){case"NONE":n=rec.TennisEventType.NONE;break;case"GAME":n=rec.TennisEventType.GAME;break;case"SET":n=rec.TennisEventType.SET;break;case"POINT":n=rec.TennisEventType.POINT;break;case"HOME_GAME":n=rec.TennisEventType.HOME_GAME;break;case"AWAY_GAME":n=rec.TennisEventType.AWAY_GAME}var r=e.metaInfo,o=[],e=(null!=e.state&&o.push(s.decodeState(c[e.matchId],t,e.state,c,a,i)),c[e.matchId]),t=s.getEvent(t,[],o,e,n,r);void 0===p[e]&&(p[e]=[]),p[e].push(t)}),p){var r=this.getMatch(t,p[t],null,null,0,null,null,null,null);n.push(r)}return n},e.prototype.decodeRecord=function(e,y,t,n){var r,g=this,o=[],m={};for(r in e.forEach(function(e){var t=g.codecHelper.coerceInt64(e.id),n=y[e.source],r=y[e.matchId],o=y[e.eventId],c=rec.OddType[e.oddType.toString()],a=rec.LBType[e.lbType.toString()],i=e.timeType.tennisTimeType,i=new rec.TennisTimeType(i.match,i.set,i.game),s=rec.OddFormat[e.format.toString()],p=e.metaInfo,l=g.codecHelper.formatRate(e.rates[0]),u=g.codecHelper.formatRate(e.rates[1]),d=g.codecHelper.formatRate(e.rates[2]),v=e.pivotValue,T=rec.PivotBias[e.pivotBias.toString()],h=rec.PivotType[e.pivotType.toString()],E=y[e.rateIds[0]],f=y[e.rateIds[1]],e=y[e.rateIds[2]],t=new rec.TennisRecord(r,o,t,c,a,i,n,s,p,l,u,d,v,h,T,E,f,e,!1);void 0===m[r]&&(m[r]={}),void 0===m[r][o]&&(m[r][o]=[]),m[r][o].push(t)}),m){var c,a=m[r],i=[];for(c in a){var s=this.getEvent(c,a[c],null,r,null,null);i.push(s)}var p=this.getMatch(r,i,null,null,0,null,null,null,null);o.push(p)}return o},e.prototype.decodeState=function(e,t,n,r,o,c,a){void 0===a&&(a=Date.now());var i=n.participantStats[0].scores,s=n.participantStats[1].scores;if(i.length<10)for(var p=i.length,l=0;p+l<10;l++)i.push(-1);if(s.length<10)for(var u=s.length,l=0;u+l<10;l++)s.push(-1);var d=new rec.TennisStats(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9]),v=new rec.TennisStats(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]),T=n.duration,h=n.tennisEventState.set,E=n.tennisEventState.game,n=n.tennisEventState.bookPriority;return new rec.TennisEventState(d,v,T,c,e,t,n,a,h,E)},e})();exports.TennisCodec=TennisCodec;
package/package.json CHANGED
@@ -1,57 +1,49 @@
1
- {
2
- "name": "@jayesol/jayeson.lib.sports",
3
- "version": "2.2.4",
4
- "description": "",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "dependencies": {
8
- "@jayesol/jayeson.lib.delivery": "2.0.6",
9
- "@jayesol/jayeson.lib.record": "2.1.0",
10
- "@jayesol/jayeson.lib.streamfinder": "2.0.0",
11
- "@jayesol/jayeson.model": "2.0.1",
12
- "circular-json": "^0.4.0",
13
- "gulp-jspm-build": "^0.0.16",
14
- "injection-js": "^2.1.0",
15
- "protobufjs": "^6.7.3",
16
- "reflect-metadata": "^0.1.10",
17
- "ts-promise": "^1.0.0",
18
- "typescript-collections": "^1.2.5",
19
- "underscore": "^1.8.3"
20
- },
21
- "devDependencies": {
22
- "@types/jasmine": "^2.5.52",
23
- "@types/jasmine-expect": "^3.6.1",
24
- "@types/long": "^3.0.31",
25
- "@types/node": "^7.0.22",
26
- "chai": "^3.5.0",
27
- "del": "^3.0.0",
28
- "eventemitter3": "^2.0.3",
29
- "glob": "^7.1.2",
30
- "gulp": "^3.9.1",
31
- "gulp-install": "^1.1.0",
32
- "gulp-jasmine": "^2.4.2",
33
- "gulp-jspm-builder": "^1.1.1",
34
- "gulp-rename": "^1.2.2",
35
- "gulp-run": "^1.7.1",
36
- "gulp-typescript": "^3.1.6",
37
- "gulp-uglify": "^3.0.0",
38
- "jasmine": "^2.6.0",
39
- "jspm": "^0.16.55",
40
- "semver": "^5.4.1",
41
- "typescript": "^2.5.2"
42
- },
43
- "scripts": {
44
- "test": "gulp test",
45
- "prepare": "gulp compile",
46
- "prepublishOnly": "gulp prepublish",
47
- "publish": "gulp jspm"
48
- },
49
- "repository": {
50
- "type": "git"
51
- },
52
- "author": "",
53
- "license": "ISC",
54
- "directories": {
55
- "lib": "lib"
56
- }
57
- }
1
+ {
2
+ "name": "@jayesol/jayeson.lib.sports",
3
+ "version": "2.2.5-beta.1205",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "build": "gulp compile",
8
+ "clean": "gulp clean",
9
+ "clean:all": "rm -rf node_modules dist",
10
+ "test": "gulp test",
11
+ "full-build": "npm run clean:all && npm install && npm run build"
12
+ },
13
+ "dependencies": {
14
+ "@jayesol/jayeson.lib.delivery": "2.0.7-beta.0",
15
+ "@jayesol/jayeson.lib.record": "2.1.0-beta.1202",
16
+ "@jayesol/jayeson.lib.streamfinder": "2.0.0",
17
+ "@jayesol/jayeson.model": "2.1.0-beta.1205v2",
18
+ "circular-json": "^0.4.0",
19
+ "estraverse": "^5.3.0",
20
+ "injection-js": "^2.2.0",
21
+ "long": "^4.0.0",
22
+ "protobufjs": "^7.2.4",
23
+ "reflect-metadata": "^0.1.13",
24
+ "ts-promise": "^1.0.0",
25
+ "typescript-collections": "^1.3.3",
26
+ "underscore": "^1.13.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/jasmine": "^4.3.0",
30
+ "@types/node": "^20.19.24",
31
+ "chai": "^4.3.0",
32
+ "del": "^6.1.1",
33
+ "eventemitter3": "^5.0.0",
34
+ "glob": "^7.2.3",
35
+ "gulp": "^4.0.2",
36
+ "gulp-install": "^1.1.0",
37
+ "gulp-jasmine": "^4.0.0",
38
+ "gulp-jspm-builder": "^1.1.1",
39
+ "gulp-rename": "^2.0.0",
40
+ "gulp-run": "^1.7.1",
41
+ "gulp-typescript": "^5.0.1",
42
+ "gulp-uglify": "^3.0.2",
43
+ "jasmine": "^4.5.0",
44
+ "merge-stream": "^2.0.0",
45
+ "protobufjs-cli": "^1.1.3",
46
+ "semver": "^7.5.0",
47
+ "typescript": "^4.9.0"
48
+ }
49
+ }