dingtalk-jsapi
Version:
钉钉 模块化 多端统一 API
1 lines • 2.26 kB
JavaScript
;var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function c(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?n(e.value):i(e.value).then(a,c)}u((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){u.label=n[1];break}if(6===n[0]&&u.label<a[1]){u.label=a[1],a=n;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(n);break}a[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],o=0}finally{i=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,o,a,c,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return c={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkJsApi=exports.getAllJsApi=void 0;var mobile_1=require("../entry/mobile"),allApiListCache;exports.getAllJsApi=function(){return __awaiter(void 0,void 0,void 0,function(){var e,t;return __generator(this,function(n){switch(n.label){case 0:return allApiListCache?[2,allApiListCache]:[4,mobile_1._invoke("runtime.getModules",{})];case 1:return e=n.sent(),t=[],Object.keys(e).forEach(function(n){e[n].forEach(function(e){t.push(n+"."+e)})}),allApiListCache=t,[2,t]}})})},exports.checkJsApi=function(e){return __awaiter(void 0,void 0,void 0,function(){var t,n;return __generator(this,function(r){switch(r.label){case 0:return[4,exports.getAllJsApi()];case 1:return t=r.sent(),n={},e.jsApiList.forEach(function(e){n[e]=-1!==t.indexOf(e)}),[2,n]}})})};