73
73
"use strict" ;
74
74
/* WEBPACK VAR INJECTION */ ( function ( Buffer ) {
75
75
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
76
- __webpack_require__ ( 6 ) ;
76
+ __webpack_require__ ( 4 ) ;
77
77
var ResponseStatus = ( function ( ) {
78
78
function ResponseStatus ( ) {
79
79
}
@@ -202,7 +202,7 @@ var ServerEventsClient = (function () {
202
202
headers . set ( "Content-Type" , "text/plain" ) ;
203
203
if ( op === "cmd" ) {
204
204
if ( cmd === "onConnect" ) {
205
- this . connectionInfo = body ;
205
+ this . connectionInfo = mergedBody ;
206
206
if ( typeof body . heartbeatIntervalMs == "string" )
207
207
this . connectionInfo . heartbeatIntervalMs = parseInt ( body . heartbeatIntervalMs ) ;
208
208
if ( typeof body . idleTimeoutMs == "string" )
@@ -582,6 +582,9 @@ var JsonServiceClient = (function () {
582
582
this . userName = userName ;
583
583
this . password = password ;
584
584
} ;
585
+ JsonServiceClient . prototype . setBearerToken = function ( token ) {
586
+ this . headers . set ( "Authorization" , "Bearer " + token ) ;
587
+ } ;
585
588
JsonServiceClient . prototype . get = function ( request , args ) {
586
589
return this . send ( HttpMethods . Get , request , args ) ;
587
590
} ;
@@ -701,7 +704,7 @@ exports.JsonServiceClient = JsonServiceClient;
701
704
var createErrorResponse = function ( errorCode , message ) {
702
705
var error = new ErrorResponse ( ) ;
703
706
error . responseStatus = new ResponseStatus ( ) ;
704
- error . responseStatus . errorCode = errorCode ;
707
+ error . responseStatus . errorCode = errorCode && errorCode . toString ( ) ;
705
708
error . responseStatus . message = message ;
706
709
return error ;
707
710
} ;
@@ -1198,8 +1201,8 @@ function fromByteArray (uint8) {
1198
1201
1199
1202
1200
1203
var base64 = __webpack_require__ ( 2 )
1201
- var ieee754 = __webpack_require__ ( 4 )
1202
- var isArray = __webpack_require__ ( 5 )
1204
+ var ieee754 = __webpack_require__ ( 5 )
1205
+ var isArray = __webpack_require__ ( 6 )
1203
1206
1204
1207
exports . Buffer = Buffer
1205
1208
exports . SlowBuffer = SlowBuffer
@@ -2981,6 +2984,19 @@ function isnan (val) {
2981
2984
2982
2985
/***/ } ) ,
2983
2986
/* 4 */
2987
+ /***/ ( function ( module , exports , __webpack_require__ ) {
2988
+
2989
+ // the whatwg-fetch polyfill installs the fetch() function
2990
+ // on the global object (window or self)
2991
+ //
2992
+ // Return that as the export for use in Webpack, Browserify etc.
2993
+ __webpack_require__ ( 8 ) ;
2994
+ var globalObj = typeof self !== 'undefined' && self || this ;
2995
+ module . exports = globalObj . fetch . bind ( globalObj ) ;
2996
+
2997
+
2998
+ /***/ } ) ,
2999
+ /* 5 */
2984
3000
/***/ ( function ( module , exports ) {
2985
3001
2986
3002
exports . read = function ( buffer , offset , isLE , mLen , nBytes ) {
@@ -3070,7 +3086,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
3070
3086
3071
3087
3072
3088
/***/ } ) ,
3073
- /* 5 */
3089
+ /* 6 */
3074
3090
/***/ ( function ( module , exports ) {
3075
3091
3076
3092
var toString = { } . toString ;
@@ -3080,18 +3096,6 @@ module.exports = Array.isArray || function (arr) {
3080
3096
} ;
3081
3097
3082
3098
3083
- /***/ } ) ,
3084
- /* 6 */
3085
- /***/ ( function ( module , exports , __webpack_require__ ) {
3086
-
3087
- // the whatwg-fetch polyfill installs the fetch() function
3088
- // on the global object (window or self)
3089
- //
3090
- // Return that as the export for use in Webpack, Browserify etc.
3091
- __webpack_require__ ( 8 ) ;
3092
- module . exports = self . fetch . bind ( self ) ;
3093
-
3094
-
3095
3099
/***/ } ) ,
3096
3100
/* 7 */
3097
3101
/***/ ( function ( module , exports ) {
@@ -3681,10 +3685,7 @@ var startListening = function () {
3681
3685
client = new servicestack_client_1 . ServerEventsClient ( BASEURL , [ CHANNEL ] , {
3682
3686
handlers : {
3683
3687
onConnect : function ( e ) {
3684
- sub = e ;
3685
- e . selector = "onConnect" ;
3686
- e . json = JSON . stringify ( e ) ;
3687
- refresh ( e ) ;
3688
+ refresh ( sub = e ) ;
3688
3689
} ,
3689
3690
onJoin : refresh ,
3690
3691
onLeave : refresh ,
0 commit comments