Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow subscribing to a journey #201

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

allow subscribing to a journey #201

wants to merge 8 commits into from

Conversation

derhuerst
Copy link
Member

@derhuerst derhuerst commented Nov 28, 2020

@derhuerst derhuerst force-pushed the subscriptions branch 2 times, most recently from 89a7827 to e3f1afe Compare November 29, 2020 13:15
@derhuerst
Copy link
Member Author

derhuerst commented Nov 29, 2020

With the current implementation, subscribing to a specific journey in the future (a different one than the next possible one on the route specified within journey.refreshToken) is not possible. This should be fixed.

TAP version 13
# subscribing to a journey works
{"lang":"en","svcReqL":[{"cfg":{"polyEnc":"GPA"},"meth":"TripSearch","req":{"getPasslist":false,"maxChg":-1,"minChgTime":0,"depLocL":[{"type":"S","lid":"A=1@L=8000236@"}],"viaLocL":null,"arrLocL":[{"type":"S","lid":"A=1@L=8003932@"}],"jnyFltrL":[{"type":"PROD","mode":"INC","value":"952"},{"type":"META","mode":"INC","meta":"notBarrierfree"}],"gisFltrL":[],"getTariff":false,"ushrp":true,"getPT":true,"getIV":false,"getPolyline":false,"outDate":"20201130","outTime":"100000","numF":1,"outFrwd":true}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"z2wayvjg68c2x6cc","err":"OK","svcResL":[{"meth":"TripSearch","err":"OK","res":{"common":{"locL":[{"lid":"A=1@O=Ludwigshafen(Rh)Hbf@X=8433401@Y=49477985@U=80@L=8000236@","type":"S","name":"Ludwigshafen(Rh)Hbf","icoX":0,"extId":"8000236","state":"F","crd":{"x":8433769,"y":49477257,"z":0,"layerX":0,"crdSysX":0},"pCls":314},{"lid":"A=1@O=Meckesheim@X=8812836@Y=49320656@U=80@L=8003932@","type":"S","name":"Meckesheim","icoX":3,"extId":"8003932","state":"F","crd":{"x":8812854,"y":49320683,"z":0,"layerX":0,"crdSysX":0},"pCls":568},{"lid":"A=1@O=Mannheim Hbf@X=8468917@Y=49479352@U=80@L=8000244@","type":"S","name":"Mannheim Hbf","icoX":4,"extId":"8000244","state":"F","crd":{"x":8469268,"y":49479181,"z":0,"layerX":0,"crdSysX":0},"pCls":319}],"prodL":[{"pid":"L::4::S::B1715767794::4_801539_3::*","name":"S 3","nameS":"3","number":"3","icoX":1,"cls":16,"oprX":0,"prodCtx":{"name":"S      3","num":"38335","line":"3","matchId":"3","catOut":"S","catOutS":"s","catOutL":"S-Bahn","catIn":"s","catCode":"4","admin":"801539"}},{"pid":"L::4::S::B1715767794::4_801539_3::*","name":"S 3","nameS":"3","number":"3","icoX":1,"cls":16,"oprX":0,"prodCtx":{"name":"S      3","num":"38335","line":"3","lineId":"4_801539_3","matchId":"3","catOut":"S","catOutS":"s","catOutL":"S-Bahn","catIn":"s","catCode":"4","admin":"801539"}},{"pid":"L::3::DPN::B2339850698::3_ABRE___10b::*","name":"RE 10b","nameS":"RE 10b","number":"19269","icoX":3,"cls":8,"oprX":1,"prodCtx":{"name":"RE 19269","num":"19269","matchId":"10b","catOut":"RE","catOutS":"DPN","catOutL":"Abellio Rail Baden-Württemberg GmbH","catIn":"DPN","catCode":"3","admin":"ABRE__","addName":"RE   10b"},"addName":"RE 10b"}],"polyL":[],"layerL":[{"id":"standard","name":"standard","index":0,"annoCnt":0}],"crdSysL":[{"id":"standard","index":0,"type":"WGS84"}],"opL":[{"name":"DB Regio AG Mitte","icoX":2},{"name":"Abellio Rail Baden-Württemberg GmbH","icoX":7}],"remL":[{"type":"A","code":"PB","prio":200,"icoX":5,"txtN":"Obligation to cover nose and mouth"},{"type":"A","code":"FB","prio":260,"icoX":6,"txtN":"Number of bicycles conveyed limited"},{"type":"A","code":"EH","prio":560,"icoX":5,"txtN":"vehicle-mounted accessaid"},{"type":"A","code":"EA","prio":560,"icoX":5,"txtN":"Behindertengerechte Ausstattung"},{"type":"A","code":"KL","prio":610,"icoX":5,"txtN":"air conditioning"},{"type":"A","code":"pname","prio":0,"icoX":5,"txtN":"RE 19269"}],"icoL":[{"res":"prod_ic","fg":{"r":255,"g":255,"b":255},"bg":{"r":89,"g":87,"b":87}},{"res":"prod_comm_t","fg":{"r":255,"g":255,"b":255},"bg":{"r":68,"g":153,"b":68}},{"res":"RE","txt":"DB Regio AG Mitte"},{"res":"prod_reg","fg":{"r":255,"g":255,"b":255},"bg":{"r":89,"g":87,"b":87}},{"res":"prod_ice","fg":{"r":255,"g":255,"b":255},"bg":{"r":89,"g":87,"b":87}},{"res":"attr_info"},{"res":"attr_bike"},{"res":"DPN","txt":"Abellio Rail Baden-Württemberg GmbH"},{"res":"pt_only"}],"lDrawStyleL":[{"sIcoX":1,"type":"SOLID","bg":{"r":68,"g":153,"b":68}},{"type":"SOLID","bg":{"r":68,"g":153,"b":68}},{"sIcoX":3,"type":"SOLID","bg":{"r":89,"g":87,"b":87}},{"type":"SOLID","bg":{"r":89,"g":87,"b":87}}]},"outConL":[{"cid":"C-0","date":"20201130","dur":"004500","chg":1,"sDays":{"sDaysR":"runs 29. Nov until 12. Dec 2020 ","sDaysB":"0000000000000000000000000000000000000000000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"dep":{"locX":0,"idx":9,"dProdX":0,"dPltfS":{"type":"PL","txt":"3"},"dTimeS":"102100","dProgType":"PROGNOSED","dTZOffset":60,"type":"N"},"arr":{"locX":1,"idx":3,"aPltfS":{"type":"PL","txt":"3"},"aTimeS":"110600","aProgType":"PROGNOSED","aTZOffset":60,"type":"N"},"secL":[{"type":"JNY","dep":{"locX":0,"idx":9,"dProdX":0,"dPltfS":{"type":"PL","txt":"3"},"dTimeS":"102100","dProgType":"PROGNOSED","dTZOffset":60,"type":"N"},"arr":{"locX":2,"idx":11,"aPltfS":{"type":"PL","txt":"11"},"aTimeS":"102600","aProgType":"PROGNOSED","aTZOffset":60,"type":"N"},"jny":{"jid":"1|225400|0|80|30112020","prodX":1,"dirTxt":"Karlsruhe Hbf","status":"P","isRchbl":true,"freq":{"minC":7,"maxC":12,"numC":13},"ctxRecon":"T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011301021$202011301026$S      3$$1$$$","msgL":[{"type":"REM","remX":0,"sty":"I","fLocX":0,"tLocX":2,"fIdx":9,"tIdx":11,"tagL":["RES_JNY_DTL"],"sort":1126170624},{"type":"REM","remX":1,"sty":"I","fLocX":0,"tLocX":2,"fIdx":9,"tIdx":11,"tagL":["RES_JNY_DTL_L"],"sort":1141899264},{"type":"REM","remX":2,"sty":"I","fLocX":0,"tLocX":2,"fIdx":9,"tIdx":11,"tagL":["RES_JNY_DTL"],"sort":1220542464}],"subscr":"F","chgDurR":9,"prodL":[{"prodX":1,"fLocX":0,"tLocX":2,"fIdx":9,"tIdx":11}],"sumLDrawStyleX":0,"resLDrawStyleX":1},"minChg":"000500","resState":"N","resRecommendation":"N"},{"type":"JNY","dep":{"locX":2,"idx":0,"dProdX":2,"dPltfS":{"type":"PL","txt":"9"},"dTimeS":"103500","dProgType":"PROGNOSED","dTZOffset":60,"type":"N"},"arr":{"locX":1,"idx":3,"aPltfS":{"type":"PL","txt":"3"},"aTimeS":"110600","aProgType":"PROGNOSED","aTZOffset":60,"type":"N"},"jny":{"jid":"1|9658|1|80|30112020","prodX":2,"dirTxt":"Heilbronn Hbf","status":"P","isRchbl":true,"ctxRecon":"T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011301035$202011301106$RE 19269$$1$$$","msgL":[{"type":"REM","remX":5,"sty":"I","tagL":["RES_JNY_DTL_H3"],"sort":1073741824},{"type":"REM","remX":0,"sty":"I","fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3,"tagL":["RES_JNY_DTL"],"sort":1126170624},{"type":"REM","remX":1,"sty":"I","fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3,"tagL":["RES_JNY_DTL_L"],"sort":1141899264},{"type":"REM","remX":2,"sty":"I","fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3,"tagL":["RES_JNY_DTL"],"sort":1220542464},{"type":"REM","remX":3,"sty":"I","fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3,"tagL":["RES_JNY_DTL"],"sort":1220542464},{"type":"REM","remX":4,"sty":"I","fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3,"tagL":["RES_JNY_DTL"],"sort":1233649664}],"subscr":"F","prodL":[{"prodX":2,"fLocX":2,"tLocX":1,"fIdx":0,"tIdx":3}],"sumLDrawStyleX":2,"resLDrawStyleX":3},"resState":"N","resRecommendation":"N"}],"ctxRecon":"¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011301021$202011301026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011301035$202011301106$RE 19269$$1$$$","freq":{"minC":7},"conSubscr":"F","resState":"N","resRecommendation":"N","recState":"U","sotRating":0,"isSotCon":false,"showARSLink":false,"sotCtxt":{"cnLocX":0,"calcDate":"20201129","jid":"1|225400|0|80|-1","locMode":"FROM_START","pLocX":0,"reqMode":"UNKNOWN","sectX":0,"calcTime":"141704"},"cksum":"8461d365_3","cksumDti":"ae06d0c8_3"}],"outCtxScrB":"2|OB|MT#11#508941#508941#508986#508986#0#0#325#508920#1#-2147483622#0#1#2|PDH#ec40275a6f45cfa11f6052c5cd9ae044|RD#30112020|RT#100000|US#1","outCtxScrF":"2|OF|MT#11#508941#508941#508986#508986#0#0#325#508920#1#-2147483622#0#1#2|PDH#ec40275a6f45cfa11f6052c5cd9ae044|RD#30112020|RT#100000|US#1","fpB":"20191215","fpE":"20211211","bfATS":-1,"bfIOSTS":-1,"planrtTS":"1606655811","outConGrpL":[{"name":"Alle Verbindungen","icoX":8,"grpid":"pt_only","conScoringL":[{"type":"DT","conScoreL":[{"score":6997692221304603000,"scoreS":"06997692221304602622","conRefL":[0]}],"name":"Departure"},{"type":"AT","conScoreL":[{"score":6997494309211603000,"scoreS":"06997494309211602942","conRefL":[0]}],"name":"Arrival"},{"type":"TI","conScoreL":[{"score":9223173063474938000,"scoreS":"09223173063474937854","conRefL":[0]}],"name":"Duration"}],"initScoringType":"DT"}]}}]}
{"lang":"en","svcReqL":[{"meth":"SubscrUserCreate","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","language":"en","channels":[{"type":"IPHONE","name":"PUSH_IPHONE","address":"c1f7c23d1792859a33397cbe85ee9ffff8a8859c937f9766a610d5462be7491f","channelId":"some-channel","options":[{"type":"NO_SOUND","value":"1"}]}]}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrUserCreate","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}]}
ok 1 should be strictly equal
ok 2 should be truthy
{"lang":"en","svcReqL":[{"meth":"SubscrSearch","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrSearch","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}]}
ok 3 should be deeply equivalent
{"lang":"en","svcReqL":[{"meth":"SubscrCreate","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","channels":[{"channelId":"some-channel"}],"conSubscr":{"ctxRecon":"¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011301021$202011301026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011301035$202011301106$RE 19269$$1$$$","hysteresis":{"minDeviationInterval":1,"notificationStart":30},"monitorFlags":["OF","PF","DF","AF","DV","FTF"],"serviceDays":{"beginDate":"20201129","endDate":"20201202"}}}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrCreate","err":"OK","res":{"result":{"resultCode":"OK"},"subscrId":1349905}}]}
ok 4 subId
{"lang":"en","svcReqL":[{"meth":"SubscrDetails","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","subscrId":1349905}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrDetails","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","subscrId":1349905,"status":"ACTIVE","channels":[{"type":"IPHONE","address":"c1f7c23d1792859a33397cbe85ee9ffff8a8859c937f9766a610d5462be7491f","options":[{"type":"NO_SOUND","value":"1"}],"active":true,"name":"PUSH_IPHONE","channelId":"some-channel","confirmed":true}],"conSubscr":{"ctxRecon":"¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011291021$202011291026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011291035$202011291106$RE 19269$$1$$$","serviceDays":{"beginDate":"20201129","endDate":"20201202","selectedDays":"1111"},"hysteresis":{"minDeviationInterval":1,"notificationStart":30},"monitorFlags":["AF","DF","DV","FTF","OF","PF"],"connectionInfo":[{"arrivalStation":"8000244","arrivalPlatform":"11","arrivalStationName":"Mannheim Hbf","arrivalTime":"2020-11-29T10:26:00Z","departureStation":"8000236","departurePlatform":"3","departureStationName":"Ludwigshafen(Rh)Hbf","departureTime":"2020-11-29T10:21:00Z","productName":"S 3"},{"arrivalStation":"8003932","arrivalPlatform":"3","arrivalStationName":"Meckesheim","arrivalTime":"2020-11-29T11:06:00Z","departureStation":"8000244","departurePlatform":"9","departureStationName":"Mannheim Hbf","departureTime":"2020-11-29T10:35:00Z","productName":"RE 19269"}]},"eventHistory":{"rtEvents":[],"himEvents":[]}}}]}
ok 5 should be truthy
ok 6 should be strictly equal
ok 7 should be deeply equivalent
ok 8 should be deeply equivalent
ok 9 should be truthy
ok 10 should be truthy
not ok 11 should be strictly equal
  ---
    operator: equal
    expected: |-
      '¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011301021$202011301026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011301035$202011301106$RE 19269$$1$$$'
    actual: |-
      '¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011291021$202011291026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011291035$202011291106$RE 19269$$1$$$'
    at: Test.<anonymous> (/Users/j/web/hafas-client/test/e2e/vrn.js:255:4)
    stack: |-
      Error: should be strictly equal
          at Test.assert [as _assert] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:260:54)
          at Test.bound [as _assert] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:84:32)
          at Test.strictEqual (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:424:10)
          at Test.bound [as equal] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:84:32)
          at Test.<anonymous> (/Users/j/web/hafas-client/test/e2e/vrn.js:255:4)
          at processTicksAndRejections (node:internal/process/task_queues:93:5)
  ...
ok 12 should be truthy
ok 13 should be truthy
ok 14 should be truthy
{"lang":"en","svcReqL":[{"meth":"SubscrSearch","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrSearch","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","conSubscrL":[{"subscrId":1349905,"status":"ACTIVE","channels":[{"type":"IPHONE","address":"c1f7c23d1792859a33397cbe85ee9ffff8a8859c937f9766a610d5462be7491f","options":[{"type":"NO_SOUND","value":"1"}],"active":true,"name":"PUSH_IPHONE","channelId":"some-channel","confirmed":true}],"ctxRecon":"¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011291021$202011291026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011291035$202011291106$RE 19269$$1$$$"}]}}]}
not ok 15 should be deeply equivalent
  ---
    operator: deepEqual
    expected: |-
      [ { id: 1349905, status: 'ACTIVE', channels: [ { id: 'some-channel' } ], journeyRefreshToken: '¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011301021$202011301026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011301035$202011301106$RE 19269$$1$$$' } ]
    actual: |-
      [ { id: 1349905, status: 'ACTIVE', channels: [ { id: 'some-channel' } ], journeyRefreshToken: '¶HKI¶T$A=1@O=Ludwigshafen(Rh)Hbf@L=8000236@a=128@$A=1@O=Mannheim Hbf@L=8000244@a=128@$202011291021$202011291026$S      3$$1$$$§T$A=1@O=Mannheim Hbf@L=8000244@a=128@$A=1@O=Meckesheim@L=8003932@a=128@$202011291035$202011291106$RE 19269$$1$$$' } ]
    at: Test.<anonymous> (/Users/j/web/hafas-client/test/e2e/vrn.js:261:4)
    stack: |-
      Error: should be deeply equivalent
          at Test.assert [as _assert] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:260:54)
          at Test.bound [as _assert] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:84:32)
          at Test.tapeDeepEqual (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:501:10)
          at Test.bound [as deepEqual] (/Users/j/web/hafas-client/node_modules/tape/lib/test.js:84:32)
          at Test.<anonymous> (/Users/j/web/hafas-client/test/e2e/vrn.js:261:4)
          at processTicksAndRejections (node:internal/process/task_queues:93:5)
  ...
{"lang":"en","svcReqL":[{"meth":"SubscrDelete","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","subscrId":1349905}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrDelete","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639","subscrId":1349905}}]}
{"lang":"en","svcReqL":[{"meth":"SubscrSearch","req":{"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}],"client":{"type":"IPH","id":"DB-REGIO-VRN","name":"VRN","v":"6000400"},"ext":"DB.R19.04.a","ver":"1.24","auth":{"type":"AID","aid":"p091VRNZz79KtUz5"}}
{"ver":"1.24","ext":"DB.R19.04.a","lang":"eng","id":"","err":"OK","svcResL":[{"meth":"SubscrSearch","err":"OK","res":{"result":{"resultCode":"OK"},"userId":"04e8d10c-f8b1-477e-a305-4cc705e6b639"}}]}
ok 16 should be deeply equivalent

1..16
# tests 16
# pass  14
# fail  2

hafas-client/index.js

Lines 694 to 695 in e3f1afe

// todo: data?
// seems like without it, HAFAS ignores the data inside `journeyRefreshToken`

@derhuerst derhuerst self-assigned this Nov 29, 2020
@derhuerst
Copy link
Member Author

derhuerst commented Nov 29, 2020

There's another call SubscrStatus to silence/deactivate subscriptions:

{
	"channel": {
		"active": false,
		"address": "3b4b49491e1b1094be390ce6197a3fde1df6daaab33de17d37cf649ec8ec0aa7",
		"channelId": "1952745D-F196-4775-B291-A5FCD84A81D4",
		"name": "PUSH_IPHONE",
		"options": [
			{
				"type": "NO_SOUND",
				"value": "1"
			},
			{
				"type": "CUSTOMER_TYPE",
				"value": "com.deutschebahn.vrn"
			}
		],
		"type": "IPHONE"
	},
	"userId": "B3B3CBF1-86F3-4280-BED4-F686A3624B1B"
}

It is also being used to un-silence/re-activate, by just omitting the active: false flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant