dingtalk-jsapi
Version:
钉钉 模块化 多端统一 API
1 lines • 2.2 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatLog=exports.diagnosticMessageMap=exports.LogLevel=void 0;var LogLevel;!function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(LogLevel=exports.LogLevel||(exports.LogLevel={}));var diagLog=function(e,o,r,t){return void 0===t&&(t=void 0),{code:e,category:o,message:r,solution:t}};exports.diagnosticMessageMap={config_debug_deprecated:diagLog(1010,LogLevel.WARN,"This is a deprecated feature (dd.debug - debug:true), recommend use dd.devConfig"),dd_config_wrap_deprecated:diagLog(1020,LogLevel.WARN,"You don 't use a dd.config, so you don't need to wrap dd.ready, recommend remove dd.ready"),not_support_event_on:diagLog(1030,LogLevel.WARN,"\"event.on\" do not support the current platform ('{0}')"),not_support_event_off:diagLog(1040,LogLevel.WARN,"\"event.off\" do not support the current platform ('{0}')"),repeat_config:diagLog(1040,LogLevel.WARN,"dd.config has been executed, please don't repeat config"),JsBridge_init_fail:diagLog(5010,LogLevel.ERROR,"JsBridge initialization fails, jsapi will not work"),auto_bridge_init_error:diagLog(5020,LogLevel.ERROR,"auto bridgeInit error"),JsBridge_init_fail_dd_config:diagLog(5010,LogLevel.ERROR,'JsBridge initialization failed and "dd.config" failed to call'),not_support_env:diagLog(4040,LogLevel.ERROR,"Do not support the current environment:'{0}'"),call_api_support_platform_error:diagLog(4050,LogLevel.ERROR,"'{0}' do not support the current platform ('{1}')"),call_api_config_platform_error:diagLog(4060,LogLevel.ERROR,"This API method is not configured for the platform ('{0}')"),call_api_on_before_error:diagLog(4060,LogLevel.ERROR,"Call Hook:onBeforeInvokeAPI failed , reason: '{0}'"),call_api_on_after_error:diagLog(4060,LogLevel.ERROR,"Call Hook:onAfterInvokeAPI failed , reason: '{0}'")},exports.formatLog=function(e){for(var o,r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var i="[DINGTALK-JSAPI] "+e.category+" "+e.code+": "+e.message.replace(/{(\d)}/g,function(e,o){return r[o]||e});return"object"==typeof process&&"production"!==(null===(o=null===process||void 0===process?void 0:process.env)||void 0===o?void 0:o.NODE_ENV)&&console.warn(i),i};
;