@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
66exports [ "default" ] = void 0 ;
77var _crypto = _interopRequireDefault ( require ( "crypto" ) ) ;
88var _Constants = require ( "./Constants" ) ;
9- var _package = _interopRequireDefault ( require ( "../../package.json" ) ) ;
9+ var _Util = require ( "./Util" ) ;
1010function _interopRequireDefault ( e ) { return e && e . __esModule ? e : { "default" : e } ; }
1111function _typeof ( o ) { "@babel/helpers - typeof" ; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( o ) { return typeof o ; } : function ( o ) { return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ; } , _typeof ( o ) ; }
1212function _classCallCheck ( a , n ) { if ( ! ( a instanceof n ) ) throw new TypeError ( "Cannot call a class as a function" ) ; }
@@ -25,18 +25,20 @@ var RestClient = exports["default"] = /*#__PURE__*/function () {
2525 var restEndpoint = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : "https://rest-api.telesign.com" ;
2626 var timeout = arguments . length > 4 && arguments [ 4 ] !== undefined ? arguments [ 4 ] : 15000 ;
2727 var userAgent = arguments . length > 5 && arguments [ 5 ] !== undefined ? arguments [ 5 ] : null ;
28- var contentType = arguments . length > 6 && arguments [ 6 ] !== undefined ? arguments [ 6 ] : "application/x-www-form-urlencoded" ;
28+ var source = arguments . length > 6 && arguments [ 6 ] !== undefined ? arguments [ 6 ] : "node_telesign" ;
29+ var sdkVersionOrigin = arguments . length > 7 && arguments [ 7 ] !== undefined ? arguments [ 7 ] : null ;
30+ var sdkVersionDependency = arguments . length > 8 && arguments [ 8 ] !== undefined ? arguments [ 8 ] : null ;
31+ var contentType = arguments . length > 9 && arguments [ 9 ] !== undefined ? arguments [ 9 ] : "application/x-www-form-urlencoded" ;
2932 _classCallCheck ( this , RestClient ) ;
3033 this . requestWrapper = requestWrapper ;
3134 this . customerId = customerId ;
3235 this . apiKey = apiKey ;
3336 this . restEndpoint = restEndpoint === null ? "https://rest-api.telesign.com" : restEndpoint ;
3437 this . timeout = timeout ;
3538 this . contentType = contentType ;
36- if ( userAgent === null ) {
37- var version = _package [ "default" ] . version ;
38- this . userAgent = "TeleSignSDK/ECMAScript-Node v " . concat ( version ) + " " . concat ( process . arch ) + "/" . concat ( process . platform ) + " " . concat ( process . release . name ) + "/" . concat ( process . version ) ; // Generates a Node useragent - helpful in diagnosing errors
39- }
39+ var currentVersionSdk = sdkVersionOrigin || ( 0 , _Util . getInstalledVersion ) ( ) ;
40+ this . userAgent = "TeleSignSDK/ECMAScript-Node" + " " . concat ( process . arch ) + "/" . concat ( process . platform ) + " " . concat ( process . release . name ) + "/" . concat ( process . version ) // Generates a Node useragent - helpful in diagnosing errors
41+ + " OriginatingSDK/" . concat ( source ) + " SDKVersion/" . concat ( currentVersionSdk ) + ( source !== "node_telesign" ? " DependencySDKVersion/" . concat ( sdkVersionDependency ) : "" ) ;
4042 }
4143
4244 /***
0 commit comments