@freelog/tools-lib 0.1.110 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service-API/presentables.d.ts +5 -0
- package/dist/service-API/resources.d.ts +4 -0
- package/dist/service-API/storages.d.ts +1 -1
- package/dist/service-API/user.d.ts +8 -0
- package/dist/tools-lib.cjs.development.js +45 -16
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +45 -16
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +1 -1
- package/package.json +1 -1
- package/src/service-API/presentables.ts +287 -282
- package/src/service-API/recombinations/index.ts +4 -3
- package/src/service-API/resources.ts +511 -497
- package/src/service-API/storages.ts +1 -1
- package/src/service-API/user.ts +28 -1
- package/src/utils/linkTo.ts +2 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("moment")),r=require("@freelog/resource-policy-lang/dist"),n=require("querystring"),o=e(require("axios")),u=e(require("nprogress"));require("nprogress/nprogress.css");var a=require("crypto-js"),s=e(require("i18next")),i=e(require("js-cookie"));function c(e,t,r,n,o,u,a){try{var s=e[u](a),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var u=e.apply(t,r);function a(e){c(u,n,o,a,s,"next",e)}function s(e){c(u,n,o,a,s,"throw",e)}a(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function v(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t.indexOf(r=u[n])>=0||(o[r]=e[r]);return o}var p,h=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function i(e,t,r,n){var o=Object.create((t&&t.prototype instanceof l?t:l).prototype),u=new I(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var s=y(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var i=c(e,t,r);if("normal"===i.type){if(n=r.done?"completed":"suspendedYield",i.arg===d)continue;return{value:i.arg,done:r.done}}"throw"===i.type&&(n="completed",r.method="throw",r.arg=i.arg)}}}(e,r,u),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=i;var d={};function l(){}function f(){}function v(){}var p={};p[o]=function(){return this};var h=Object.getPrototypeOf,m=h&&h(h(_([])));m&&m!==t&&r.call(m,o)&&(p=m);var g=v.prototype=l.prototype=Object.create(p);function R(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){var n;this._invoke=function(o,u){function a(){return new t((function(n,a){!function n(o,u,a,s){var i=c(e[o],e,u);if("throw"!==i.type){var d=i.arg,l=d.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){d.value=e,a(d)}),(function(e){return n("throw",e,a,s)}))}s(i.arg)}(o,u,n,a)}))}return n=n?n.then(a,a):a()}}function y(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return u.next=u}}return{next:w}}function w(){return{value:void 0,done:!0}}return f.prototype=g.constructor=v,v.constructor=f,f.displayName=s(v,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},R(T.prototype),T.prototype[u]=function(){return this},e.AsyncIterator=T,e.async=function(t,r,n,o,u){void 0===u&&(u=Promise);var a=new T(i(t,r,n,o),u);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},R(g),s(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var s=r.call(u,"catchLoc"),i=r.call(u,"finallyLoc");if(s&&i){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&("break"===e||"continue"===e)&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var a=u?u.completion:{};return a.type=e,a.arg=t,u?(this.method="next",this.next=u.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(p={exports:{}}),p.exports),m=require("@freelog/resource-policy-lang").compile;function g(e){var t="http://"+e+".testfreelog.com";return window.location.origin.includes(".freelog.com")&&(t="https://"+e+".freelog.com"),t}function R(){return(R=d(h.mark((function e(t,n){var o,u,a;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m(t,n,g("qi"),window.location.origin.endsWith(".freelog.com")?"prod":"dev");case 3:return u={audiences:(o=e.sent).state_machine.audiences,fsmStates:Object.entries(o.state_machine.states).map((function(e){return{name:e[0],serviceStates:e[1].serviceStates,events:e[1].transitions.map((function(e){return{id:e.code,name:e.name,args:e.args,state:e.toState}}))}}))},a=r.report(u),e.abrupt("return",{error:null,text:a.audienceInfos[0].content+a.content});case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",{error:[e.t0.message]});case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var T={__proto__:null,humanizeSize:function(e){if(e<=0)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]},formatDateTime:function(e,r){return void 0===r&&(r=!1),t(e).format("YYYY/MM/DD"+(r?" HH:mm":""))},completeUrlByDomain:g,policyCodeTranslationToText:function(e,t){return R.apply(this,arguments)},resourceTypeKeyArrToResourceType:function(e){return e.join(" / ")}},y={__proto__:null,EXHIBIT_NAME:new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s|@|\$|#)).{1,60}$/),RESOURCE_NAME:new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s|@|\$|#)).{1,60}$/),RESOURCE_TYPE:new RegExp(/^[a-z0-9][a-z0-9_]{1,18}[a-z0-9]$/),CUSTOM_KEY:new RegExp(/^[a-zA-Z0-9_]{1,20}$/),NODE_NAME:new RegExp(/^[\u4E00-\u9FA5|a-zA-Z0-9]{2,24}$/),NODE_DOMAIN:new RegExp(/^[a-z0-9][a-z0-9-]{2,22}[a-z0-9]$/),PAY_PASSWORD:new RegExp(/^\d{6}$/),MOBILE_PHONE_NUMBER:new RegExp(/^1[345789]\d{9}$/),EMAIL_ADDRESS:new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/),USERNAME:new RegExp(/^([A-Za-z0-9][A-Za-z0-9-]{0,28})?[A-Za-z0-9]$/),PASSWORD:new RegExp(/^(?=.*[0-9])(?=.*[a-zA-Z])(.{6,24})$/),NATURAL_NUMBER:new RegExp(/^[0-9]*$/),POSITIVE_INTEGER:new RegExp(/^[1-9]\d*$/),MAX_2_DECIMAL_POSITIVE_NUMBER:new RegExp(/^\d+(.\d{1,2})?$/),BUCKET_NAME:new RegExp(/^([a-z0-9][a-z0-9-]{0,61})?[a-z0-9]$/),JS_VARIABLE_NAME:new RegExp(/^[A-Za-z$_][\w$_]*$/)},b=["resourceID"],E=["nodeID","showPage"],I=["nodeID","showPage"];function _(e){var t=(void 0===e?{}:e).goTo;return"/login"+w({goTo:t?encodeURIComponent(t):void 0})}function w(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){var u=o[r],a=u[0],s=u[1];a&&s&&(t[a]=s)}var i=n.stringify(t);return i?"?"+i:""}var q,x,P,S={__proto__:null,home:function(e){return f(void 0===e?{}:e),"/home"},activities:function(e){return f(void 0===e?{}:e),"/activities"},activity:function(e){return"/activity/"+e.activityID},dashboard:function(e){return f(void 0===e?{}:e),"/dashboard"},market:function(e){return"/market"+w({query:(void 0===e?{}:e).query})},exampleNodes:function(e){return f(void 0===e?{}:e),"/examples"},resourceDetails:function(e){return"/resource/details/"+e.resourceID+w(v(e,b))},resourceCreator:function(e){return f(void 0===e?{}:e),"/resource/creator"},myResources:function(e){return f(void 0===e?{}:e),"/resource/list"},myCollects:function(e){return f(void 0===e?{}:e),"/resource/collect"},resourceInfo:function(e){return"/resource/info/"+e.resourceID},resourceAuth:function(e){return"/resource/auth/"+e.resourceID},resourceCreateVersion:function(e){return"/resource/version/creator/"+e.resourceID},resourceVersion:function(e){return"/resource/version/info/"+e.resourceID+"/"+e.version},nodeCreator:function(e){return f(void 0===e?{}:e),"/node/creator"},nodeManagement:function(e){var t=e.showPage;return"/node/formal/"+e.nodeID+w(l({showPage:void 0===t?"exhibit":t},v(e,E)))},exhibitManagement:function(e){return"/node/exhibit/formal/"+e.exhibitID},informNodeManagement:function(e){var t=e.showPage;return"/node/informal/"+e.nodeID+w(l({showPage:void 0===t?"exhibit":t},v(e,I)))},informExhibitManagement:function(e){return"/node/exhibit/informal/"+e.exhibitID},storageSpace:function(e){return"/storage"+w(l({},void 0===e?{}:e))},objectDetails:function(e){return"/storage"+w(l({},e))},resourceCreateSuccess:function(e){return"/result/resource/create/success/"+e.resourceID},resourceVersionCreateSuccess:function(e){return"/result/resource/version/create/success/"+e.resourceID+"/"+e.version},nodeCreateSuccess:function(e){return"/result/node/create/success/"+e.nodeID},invitation:function(e){var t=l({},void 0===e?{}:e);return"/invitation"+w({returnUrl:t.goTo?encodeURIComponent(t.goTo):void 0})},exception403:function(e){var t=l({},void 0===e?{}:e).from||"";if(!t){var r=window.location;t=r.href.replace(r.origin,"")}return"/exception/403"+w({from:t})},login:_,logon:function(e){var t=(void 0===e?{}:e).goTo;return"/logon"+w({goTo:t?encodeURIComponent(t):void 0})},retrieveUserPassword:function(e){var t=(void 0===e?{}:e).goTo;return"/retrieve"+w({goTo:t?encodeURIComponent(t):void 0})},retrievePayPassword:function(e){return f(void 0===e?{}:e),"/retrievePayPassword"},wallet:function(e){return f(void 0===e?{}:e),"/logged/wallet"},contract:function(e){return f(void 0===e?{}:e),"/logged/contract"},setting:function(e){return f(void 0===e?{}:e),"/logged/setting"}};!function(e){e[e.resource=1]="resource",e[e.node=2]="node",e[e.consumer=3]="consumer"}(q||(q={})),function(e){e[e.resource=1]="resource",e[e.exhibit=2]="exhibit",e[e.user=3]="user"}(x||(x={})),function(e){e[e.pending=0]="pending",e[e.authorized=1]="authorized",e[e.stopped=2]="stopped"}(P||(P={}));var G={__proto__:null,resourceTypes:["json","widget","image","audio","markdown","theme","reveal_slide","license","video","catalog"],pageSize:100,momentDateFormat:"YYYY-MM-DD",momentDateTimeFormat:"YYYY-MM-DD HH:mm",get EnumContractPartyIdentityType(){return q},get EnumSubjectType(){return x},get EnumContractStatus(){return P}},O=["presentableId"],D=["presentableId"],N=["presentableId"],k=["presentableId"],A=["presentableId"],C=["presentableId"],j=["presentableId"],L=["presentableId"],U=["nodeId"],B=["nodeId"],M=["bucketName"],z=["bucketName"],F=["objectIdOrName"],$=["sha1"],V=["objectIdOrName"];function Y(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/storages/files/list/info",params:t})}var H=["resourceIdOrName"],Q=["resourceId"],Z=["resourceId"],W=["resourceId"],J=["resourceId","version"],K=["fileSha1"],X=["fileSha1"],ee=["resourceId"],te=["resourceId"],re=["resourceId"],ne=["resourceId"],oe=["resourceId"],ue=["loginName"],ae=["nodeId"],se=["nodeId"],ie=["nodeId"],ce=["nodeId"],de=["nodeId"],le=["testResourceId"],fe=["testResourceId"],ve=["nodeId"],pe=["nodeId"],he=["nodeId"],me=["nodeId"],ge=["contractId"],Re=["contractId"],Te=["accountId"],ye=["userId"],be=["contractId"],Ee=["recordId"];function Ie(e){return void 0===e&&(e=300),new Promise((function(t){setTimeout((function(){t()}),e)}))}var _e={__proto__:null,getSHA1Hash:function(e){return new Promise((function(t){var r=new FileReader;r.onload=function(){var e=a.lib.WordArray.create(r.result),n=a.SHA1(e).toString();t(n)},r.readAsArrayBuffer(e)}))},generateRandomCode:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<e;r++)t.push("ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"[Math.floor(61*Math.random())]);return t.join("")},getUserIDByCookies:function(){var e=document.cookie.split("; ").find((function(e){return e.startsWith("uid=")}));return e?Number(e.replace("uid=","")):-1},transformServerAPIContractState:function(e){var t=e.status,r=e.authStatus;if(0===t){if(1===r||3===r)return"active";if(2===r)return"testActive";if(128===r)return"inactive"}return 1===t?"terminal":"exception"},promiseSleep:Ie};function we(){return(we=d(h.mark((function e(t,r){var n,o,u,a,s;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===r&&(r=function(){}),0!==(n=t.sha1).length){e.next=4;break}return e.abrupt("return",[]);case 4:o=[].concat(n),u=[];case 6:return e.next=9,Y({sha1:o});case 9:if(o=(a=e.sent.data).filter((function(e){return e.metaAnalyzeStatus&&1===e.metaAnalyzeStatus})).map((function(e){return e.sha1})),s=a.filter((function(e){return!e.metaAnalyzeStatus||1!==e.metaAnalyzeStatus})).map((function(e){var t="fail";return e.metaAnalyzeStatus?2===e.metaAnalyzeStatus&&(t="success"):t="nonentity",{sha1:e.sha1,state:t,info:e}})),r&&r(s),u=[].concat(u,s),0!==o.length){e.next=17;break}return e.abrupt("break",21);case 17:return e.next=19,Ie(3e3);case 19:e.next=6;break;case 21:return e.abrupt("return",u);case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qe={Node:{__proto__:null,create:function(e){return Ge.Request({method:"POST",url:"/v2/nodes",data:e})},details:function(e){return Ge.Request(e.nodeId?{method:"GET",url:"/v2/nodes/"+e.nodeId}:{method:"GET",url:"/v2/nodes/detail",params:e})},nodes:function(e){return Ge.Request({method:"GET",url:"/v2/nodes",params:e})}},Exhibit:{__proto__:null,createPresentable:function(e){return Ge.Request({method:"POST",url:"/v2/presentables",data:e})},updatePresentable:function(e){var t=e.presentableId,r=v(e,O);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t,data:r})},presentablesOnlineStatus:function(e){var t=e.presentableId,r=v(e,D);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/onlineStatus",data:r})},presentableDetails:function(e){if(e.nodeId)return Ge.Request({method:"GET",url:"/v2/presentables/detail",params:e});var t=e.presentableId,r=v(e,N);return Ge.Request({method:"GET",url:"/v2/presentables/"+t,params:r})},presentables:function(e){return Ge.Request({method:"GET",url:"/v2/presentables",params:e})},presentableList:function(e){return Ge.Request({method:"GET",url:"/v2/presentables/list",params:e})},dependencyTree:function(e){var t=e.presentableId,r=v(e,k);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/dependencyTree",params:r})},relationTree:function(e){var t=e.presentableId,r=v(e,A);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/relationTree",params:r})},authTree:function(e){var t=e.presentableId,r=v(e,C);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/authTree",params:r})},presentablesVersion:function(e){var t=e.presentableId,r=v(e,j);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/version",data:r})},updateRewriteProperty:function(e){var t=e.presentableId,r=v(e,L);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/rewriteProperty",data:r})},batchAuth:function(e){var t=e.nodeId,r=v(e,U);return Ge.Request({method:"GET",url:"/v2/auths/presentables/nodes/"+t+"/batchAuth/result",params:r})},contractAppliedPresentable:function(e){var t=e.nodeId,r=v(e,B);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/contractAppliedPresentable",params:r})}},Storage:{__proto__:null,createBucket:function(e){return Ge.Request({method:"POST",url:"/v1/storages/buckets",data:e})},bucketList:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets",params:e})},spaceStatistics:function(e){return void 0===e&&(e={}),Ge.Request({method:"GET",url:"/v1/storages/buckets/spaceStatistics",params:e})},deleteBucket:function(e){return Ge.Request({method:"DELETE",url:"/v1/storages/buckets/"+e.bucketName})},bucketDetails:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+e.bucketName})},objectList:function(e){var t=e.bucketName,r=v(e,M);return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+t+"/objects",params:r})},userNodeDataList:function(e){return Ge.Request({method:"GET",url:"/v2/storages/buckets/.UserNodeData/objects",params:e})},createObject:function(e){var t=e.bucketName,r=v(e,z);return Ge.Request({method:"POST",url:"/v1/storages/buckets/"+t+"/objects",data:r})},objectDetails:function(e){return Ge.Request(e.objectIdOrName?{method:"GET",url:"/v1/storages/objects/"+encodeURIComponent(e.objectIdOrName),params:e}:{method:"GET",url:"/v1/storages/buckets/"+e.bucketName+"/objects/"+e.objectId,params:e})},deleteObjects:function(e){return Ge.Request({method:"DELETE",url:"/v1/storages/buckets/"+e.bucketName+"/objects/"+e.objectIds,data:e})},bucketIsExist:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+e.bucketName+"/isExist"})},downloadObject:function(e){return window.location.href=Ge.Format.completeUrlByDomain("qi")+"/v1/storages/objects/"+e.objectIdOrName+"/file"},fileIsExist:function(e){return Ge.Request({method:"GET",url:"/v1/storages/files/fileIsExist",params:e})},uploadFile:function(e,t,r){void 0===r&&(r=!1);for(var n=new FormData,o=0,u=Object.entries(e);o<u.length;o++){var a=u[o],s=a[1];s&&n.append(a[0],s)}if(!r)return Ge.Request(l({method:"POST",url:"/v1/storages/files/upload",data:n},t));var i=null;return[Ge.Request(l({method:"POST",url:"/v1/storages/files/upload",data:n,cancelToken:new Ge.Axios.CancelToken((function(e){i=e}))},t)),i]},uploadImage:function(e,t){for(var r=new FormData,n=0,o=Object.entries(e);n<o.length;n++){var u=o[n],a=u[1];a&&r.append(u[0],a)}return Ge.Request(l({method:"POST",url:"/v1/storages/files/uploadImage",data:r},t))},updateObject:function(e){var t=e.objectIdOrName,r=v(e,F);return Ge.Request({method:"PUT",url:"/v2/storages/objects/"+t,data:r})},batchObjectList:function(e){return Ge.Request({method:"GET",url:"/v1/storages/objects/list",params:e})},fileProperty:function(e){var t=e.sha1,r=v(e,$);return Ge.Request({method:"GET",url:"/v1/storages/files/"+t+"/property",params:r})},cycleDependencyCheck:function(e){var t=e.objectIdOrName,r=v(e,V);return Ge.Request({method:"POST",url:"/v1/storages/objects/"+t+"/cycleDependencyCheck",data:r})},clearUserNodeData:function(e){var t=l({},e);return Ge.Request({method:"DELETE",url:"/v2/storages/buckets/.UserNodeData/objects/clear",data:t})},filesListInfo:Y},Collection:{__proto__:null,collectResource:function(e){return Ge.Request({method:"POST",url:"/v2/collections/resources",data:e})},collectionResources:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources",params:e})},deleteCollectResource:function(e){return Ge.Request({method:"DELETE",url:"/v2/collections/resources/"+e.resourceId})},isCollected:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources/isCollected",params:e})},collectedCount:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources/"+e.resourceId+"/count"})}},Resource:{__proto__:null,create:function(e){return Ge.Request({method:"POST",url:"/v2/resources",data:e})},update:function(e){return Ge.Request({method:"PUT",url:"/v2/resources/"+e.resourceId,data:e})},list:function(e){return Ge.Request({method:"GET",url:"/v2/resources",params:e})},info:function(e){var t=e.resourceIdOrName,r=v(e,H);return Ge.Request({method:"GET",url:"/v2/resources/"+encodeURIComponent(t),params:r})},batchInfo:function(e){return Ge.Request({method:"GET",url:"/v2/resources/list",params:e})},dependencyTree:function(e){var t=e.resourceId,r=v(e,Q);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/dependencyTree",params:r})},authTree:function(e){var t=e.resourceId,r=v(e,Z);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/authTree",params:r})},createVersion:function(e){var t=e.resourceId,r=v(e,W);return Ge.Request({method:"POST",url:"/v2/resources/"+t+"/versions",data:r})},resourceVersionInfo1:function(e){var t=e.resourceId,r=e.version,n=v(e,J);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/versions/"+r,params:n})},resourceVersionInfo2:function(e){return Ge.Request({method:"GET",url:"/v2/resources/versions/detail",params:e})},getResourceVersionBySha1:function(e){var t=e.fileSha1,r=v(e,K);return Ge.Request({method:"GET",url:"/v2/resources/files/"+t+"/versions",params:r})},getResourceBySha1:function(e){var t=e.fileSha1,r=v(e,X);return Ge.Request({method:"GET",url:"/v2/resources/files/"+t,params:r})},updateResourceVersionInfo:function(e){return Ge.Request({method:"PUT",url:"/v2/resources/"+e.resourceId+"/versions/"+e.version,data:e})},saveVersionsDraft:function(e){return Ge.Request({method:"POST",url:"/v2/resources/"+e.resourceId+"/versions/drafts",data:e})},lookDraft:function(e){return Ge.Request({method:"GET",url:"/v2/resources/"+e.resourceId+"/versions/drafts",params:e})},resourceIsUsedByOther:function(e){return Ge.Request({method:"GET",url:"/v2/resources/versions/isCanBeCreate",params:e})},resourcesDownload:function(e){return window.location.href=Ge.Format.completeUrlByDomain("qi")+"/v2/resources/"+e.resourceId+"/versions/"+e.version+"/download"},batchGetCoverageVersions:function(e){var t=e.resourceId,r=v(e,ee);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/contracts/coverageVersions",params:r})},resolveResources:function(e){return Ge.Request({method:"GET",url:"/v2/resources/"+e.resourceId+"/resolveResources"})},batchSetContracts:function(e){var t=e.resourceId,r=v(e,te);return Ge.Request({method:"PUT",url:"/v2/resources/"+t+"/versions/batchSetContracts",data:r})},cycleDependencyCheck:function(e){var t=e.resourceId,r=v(e,re);return Ge.Request({method:"POST",url:"/v2/resources/"+t+"/versions/cycleDependencyCheck",data:r})},relationTree:function(e){var t=e.resourceId,r=v(e,ne);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/relationTree",params:r})},relationTreeAuth:function(e){var t=e.resourceId,r=v(e,oe);return Ge.Request({method:"GET",url:"/v2/auths/resources/"+t+"/relationTreeAuth",params:r})},batchAuth:function(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/auths/resources/batchAuth/results",params:t})}},User:{__proto__:null,login:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/passport/login",data:t},{noRedirect:!0})},logout:function(e){var t=l({},void 0===e?{}:e);return Ge.Request({method:"GET",url:"/v2/passport/logout",params:t},{noRedirect:!0})},currentUserInfo:function(){return Ge.Request({method:"GET",url:"/v2/users/current"})},userDetails:function(e){return Ge.Request({method:"GET",url:"/v2/users/detail",params:e})},logon:function(e){return Ge.Request({method:"POST",url:"/v2/users",data:e})},resetPassword:function(e){var t=e.loginName,r=v(e,ue);return Ge.Request({method:"PUT",url:"/v2/users/"+t+"/resetPassword",data:r})},updatePassword:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/updatePassword",data:e})},uploadHeadImg:function(e,t){for(var r=new FormData,n=0,o=Object.entries(e);n<o.length;n++){var u=o[n],a=u[1];a&&r.append(u[0],a)}return Ge.Request(l({method:"POST",url:"/v2/users/current/uploadHeadImg",data:r},t))},updateDetailInfo:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/detailInfo",data:e})},verifyLoginPassword:function(e){return Ge.Request({method:"GET",url:"/v2/users/verifyLoginPassword",params:e})},areasProvinces:function(e){return void 0===e&&(e={}),Ge.Request({method:"GET",url:"/v2/areas/provinces",params:e})},updateMobileOrEmail:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/mobileOrEmail",data:e})},registerOrBind:function(e){return Ge.Request({method:"POST",url:"/v2/thirdParty/registerOrBind",data:e},{noRedirect:!0})}},InformalNode:{__proto__:null,testResources:function(e){var t=e.nodeId,r=v(e,ae);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources",params:r})},createRules:function(e){var t=e.nodeId,r=v(e,se);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules",data:r})},batchTestResources:function(e){var t=e.nodeId,r=v(e,ie);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/list",params:r})},dependencyTree:function(e){var t=e.nodeId,r=v(e,ce);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/dependencyTree/search",params:r})},putRules:function(e){var t=e.nodeId,r=v(e,de);return Ge.Request({method:"PUT",url:"/v2/testNodes/"+t+"/rules",data:r})},testNodeRules:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/"+e.nodeId+"/rules"})},updateTestResourceContracts:function(e){var t=e.testResourceId,r=v(e,le);return Ge.Request({method:"PUT",url:"/v2/testNodes/testResources/"+t,data:r})},dependencyTreeFilter:function(e){var t=e.testResourceId,r=v(e,fe);return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+t+"/dependencyTree/filter",params:r})},testResourcesDependencyTree:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId+"/dependencyTree"})},testResourcesAuthTree:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId+"/authTree"})},testResourceDetails:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId})},searchTestResourcesByDependency:function(e){var t=e.nodeId,r=v(e,ve);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/searchByDependency",params:r})},rulesRematch:function(e){var t=e.nodeId,r=v(e,pe);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules/rematch",data:r})},rulesPreExecution:function(e){var t=e.nodeId,r=v(e,he);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules/preExecution",data:r})},batchGetAuths:function(e){var t=e.nodeId,r=v(e,me);return Ge.Request({method:"GET",url:"/v2/auths/exhibits/"+t+"/test/batchAuth/results",params:r})}},Contract:{__proto__:null,contractDetails:function(e){var t=e.contractId,r=v(e,ge);return Ge.Request({method:"GET",url:"/v2/contracts/"+t,params:r})},contracts:function(e){return Ge.Request({method:"GET",url:"/v2/contracts",params:e})},batchContracts:function(e){return Ge.Request({method:"GET",url:"/v2/contracts/list",params:e})},transitionRecords:function(e){var t=e.contractId,r=v(e,Re);return Ge.Request({method:"GET",url:"/v2/contracts/"+t+"/transitionRecords",params:r})}},Transaction:{__proto__:null,details:function(e){var t=e.accountId,r=v(e,Te);return Ge.Request({method:"GET",url:"/v2/transactions/details/"+t,params:r})},individualAccounts:function(e){var t=e.userId,r=v(e,ye);return Ge.Request({method:"GET",url:"/v2/accounts/individualAccounts/"+t,params:r})},transactionDetails:function(e){return Ge.Request({method:"GET",url:"/v2/transactions/records/"+e.recordId})},activateIndividualAccounts:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts/activate",data:t})},changePassword:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts",data:t})},resetPassword:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts/resetPassword",data:t})},verifyTransactionPassword:function(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/accounts/individualAccounts/verifyTransactionPassword",params:t})}},Captcha:{__proto__:null,sendVerificationCode:function(e){return Ge.Request({method:"POST",url:"/v2/messages/send",data:e})},verifyVerificationCode:function(e){return Ge.Request({method:"GET",url:"/v2/messages/verify",params:e})}},Event:{__proto__:null,transaction:function(e){var t=e.contractId,r=v(e,be);return Ge.Request({method:"POST",url:"/v2/contracts/"+t+"/events/payment",data:r})}},Activity:{__proto__:null,list4Client:function(e){return Ge.Request({method:"GET",url:"/v2/activities/list4Client",params:e})},find4Client:function(e){return Ge.Request({method:"GET",url:"/v2/activities/find4Client",params:e})},adsList:function(e){return Ge.Request({method:"GET",url:"/v2/activities/ads/list4Client",params:e})},adsDetails:function(e){return Ge.Request({method:"GET",url:"/v2/activities/ads/find4Client",params:e})}},TestQualification:{__proto__:null,betaCodesActivate:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/testQualifications/beta/codes/activate",data:t})},betaApply:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/testQualifications/beta/apply",data:t})},getBetaApply1:function(e){var t=l({},void 0===e?{}:e);return Ge.Request({method:"GET",url:"/v2/testQualifications/beta/apply/current",params:t})},getBetaApply2:function(e){var t=e.recordId,r=v(e,Ee);return Ge.Request({method:"GET",url:"/v2/testQualifications/beta/apply/"+t,data:r})}},Statistic:{__proto__:null,transactionsCommon:function(e){return Ge.Request({method:"GET",url:"/v2/statistics/transactions/common",params:e})}},I18n:{__proto__:null,configsList:function(e){return Ge.Request({method:"POST",url:"/v2/i18n/configs/list",data:e})}},recombination:{__proto__:null,getFilesSha1Info:function(e,t){return we.apply(this,arguments)}}},xe={200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"};function Pe(){return(Pe=d(h.mark((function e(t,r){var n,u,a;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=void 0!==(n=(void 0===r?{}:r).noRedirect)&&n,e.next=3,o.request(t);case 3:if(30!==(a=e.sent).errCode&&30!==a.errCode||u){e.next=8;break}return e.next=7,qe.User.logout();case 7:window.location.replace(""+g("user")+_({goTo:window.location.href}));case 8:return e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.location.hostname.includes(".com")&&(o.defaults.withCredentials=!0,o.defaults.baseURL=g("qi")),o.interceptors.request.use((function(e){return u.start(),e}),(function(e){return u.done(),Promise.reject(e)})),o.interceptors.response.use((function(e){var t;if(u.done(),200!==e.status)throw new Error(JSON.stringify({description:xe[e.status],message:e.status}));var r=e.data;if(null==(t=e.headers["content-disposition"])||!t.includes("attachment;"))return r}),(function(e){return u.done(),Promise.reject(e)}));var Se,Ge={Format:T,Regexp:y,LinkTo:S,Predefined:G,Axios:o,Request:function(e,t){return Pe.apply(this,arguments)},Tool:_e},Oe=[{value:"en_US",label:"English"},{value:"zh_CN",label:"简体中文"}];exports.FI18n={i18nNext:new(function(){function e(){this._loadingData="NotStart",this._taskQueue=[],this._currentLanguage=i.get("locale")||"zh_CN",(Se=this).ready()}var t=e.prototype;return t.ready=function(){var e=d(h.mark((function e(){var t,r,n;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=function(){for(;Se._taskQueue.length>0;){var e=Se._taskQueue.shift();e&&e()}},r=function(){var e=d(h.mark((function e(){return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("End"!==Se._loadingData){e.next=3;break}return t(),e.abrupt("return");case 3:if("Start"!==Se._loadingData){e.next=5;break}return e.abrupt("return");case 5:return Se._loadingData="Start",e.next=8,Se._handleData();case 8:t();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=new Promise((function(e){Se._taskQueue.push(e)})),r(),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t.t=function(e,t){return s.t(e,t)},t.changeLanguage=function(e){i.set("locale",e,{expires:36525,domain:Ge.Format.completeUrlByDomain("").replace(/http(s)?:\/\//,"")})},t.getAllLanguage=function(){return Oe},t.getCurrentLanguage=function(){return Se._currentLanguage},t._handleData=function(){var e=d(h.mark((function e(){var t,r,n;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Se._currentLanguage,r=window.localStorage.getItem("i18nextResources"),n=r?JSON.parse(r):null){e.next=9;break}return e.next=6,Se._fetchData();case 6:n=e.sent,e.next=10;break;case 9:Se._fetchData();case 10:return e.next=12,s.init({resources:n,lng:t,fallbackLng:"zh_CN",interpolation:{escapeValue:!1}});case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t._fetchData=function(){var e=d(h.mark((function e(){var t,r,n,u,a,s,i,c;return h.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.get("https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json",{withCredentials:!1});case 2:for(t={},r={},n=0,u=Object.entries(e.sent);n<u.length;n++)t[s=(a=u[n])[0]]=(i=a[1]).en_US,r[s]=i.zh_CN;return c={en_US:{translation:t},zh_CN:{translation:r}},window.localStorage.setItem("i18nextResources",JSON.stringify(c)),e.abrupt("return",c);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e}())},exports.FServiceAPI=qe,exports.FUtil=Ge;
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("moment")),r=require("@freelog/resource-policy-lang/dist"),n=require("querystring"),o=e(require("axios")),u=e(require("nprogress"));require("nprogress/nprogress.css");var a=require("crypto-js"),s=e(require("i18next")),i=e(require("js-cookie"));function c(e,t,r,n,o,u,a){try{var s=e[u](a),i=s.value}catch(e){return void r(e)}s.done?t(i):Promise.resolve(i).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var u=e.apply(t,r);function a(e){c(u,n,o,a,s,"next",e)}function s(e){c(u,n,o,a,s,"throw",e)}a(void 0)}))}}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function v(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t.indexOf(r=u[n])>=0||(o[r]=e[r]);return o}var h,p=(function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function i(e,t,r,n){var o=Object.create((t&&t.prototype instanceof l?t:l).prototype),u=new I(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return{value:void 0,done:!0}}for(r.method=o,r.arg=u;;){var a=r.delegate;if(a){var s=y(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var i=c(e,t,r);if("normal"===i.type){if(n=r.done?"completed":"suspendedYield",i.arg===d)continue;return{value:i.arg,done:r.done}}"throw"===i.type&&(n="completed",r.method="throw",r.arg=i.arg)}}}(e,r,u),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=i;var d={};function l(){}function f(){}function v(){}var h={};h[o]=function(){return this};var p=Object.getPrototypeOf,m=p&&p(p(_([])));m&&m!==t&&r.call(m,o)&&(h=m);var g=v.prototype=l.prototype=Object.create(h);function R(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){var n;this._invoke=function(o,u){function a(){return new t((function(n,a){!function n(o,u,a,s){var i=c(e[o],e,u);if("throw"!==i.type){var d=i.arg,l=d.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){d.value=e,a(d)}),(function(e){return n("throw",e,a,s)}))}s(i.arg)}(o,u,n,a)}))}return n=n?n.then(a,a):a()}}function y(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return u.next=u}}return{next:w}}function w(){return{value:void 0,done:!0}}return f.prototype=g.constructor=v,v.constructor=f,f.displayName=s(v,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},R(T.prototype),T.prototype[u]=function(){return this},e.AsyncIterator=T,e.async=function(t,r,n,o,u){void 0===u&&(u=Promise);var a=new T(i(t,r,n,o),u);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},R(g),s(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var s=r.call(u,"catchLoc"),i=r.call(u,"finallyLoc");if(s&&i){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&("break"===e||"continue"===e)&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var a=u?u.completion:{};return a.type=e,a.arg=t,u?(this.method="next",this.next=u.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(h={exports:{}}),h.exports),m=require("@freelog/resource-policy-lang").compile;function g(e){var t="http://"+e+".testfreelog.com";return window.location.origin.includes(".freelog.com")&&(t="https://"+e+".freelog.com"),t}function R(){return(R=d(p.mark((function e(t,n){var o,u,a;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m(t,n,g("qi"),window.location.origin.endsWith(".freelog.com")?"prod":"dev");case 3:return u={audiences:(o=e.sent).state_machine.audiences,fsmStates:Object.entries(o.state_machine.states).map((function(e){return{name:e[0],serviceStates:e[1].serviceStates,events:e[1].transitions.map((function(e){return{id:e.code,name:e.name,args:e.args,state:e.toState}}))}}))},a=r.report(u),e.abrupt("return",{error:null,text:a.audienceInfos[0].content+a.content});case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",{error:[e.t0.message]});case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var T={__proto__:null,humanizeSize:function(e){if(e<=0)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]},formatDateTime:function(e,r){return void 0===r&&(r=!1),t(e).format("YYYY/MM/DD"+(r?" HH:mm":""))},completeUrlByDomain:g,policyCodeTranslationToText:function(e,t){return R.apply(this,arguments)},resourceTypeKeyArrToResourceType:function(e){return e.join(" / ")}},y={__proto__:null,EXHIBIT_NAME:new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s|@|\$|#)).{1,60}$/),RESOURCE_NAME:new RegExp(/^(?!.*(\\|\/|:|\*|\?|"|<|>|\||\s|@|\$|#)).{1,60}$/),RESOURCE_TYPE:new RegExp(/^[a-z0-9][a-z0-9_]{1,18}[a-z0-9]$/),CUSTOM_KEY:new RegExp(/^[a-zA-Z0-9_]{1,20}$/),NODE_NAME:new RegExp(/^[\u4E00-\u9FA5|a-zA-Z0-9]{2,24}$/),NODE_DOMAIN:new RegExp(/^[a-z0-9][a-z0-9-]{2,22}[a-z0-9]$/),PAY_PASSWORD:new RegExp(/^\d{6}$/),MOBILE_PHONE_NUMBER:new RegExp(/^1[345789]\d{9}$/),EMAIL_ADDRESS:new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/),USERNAME:new RegExp(/^([A-Za-z0-9][A-Za-z0-9-]{0,28})?[A-Za-z0-9]$/),PASSWORD:new RegExp(/^(?=.*[0-9])(?=.*[a-zA-Z])(.{6,24})$/),NATURAL_NUMBER:new RegExp(/^[0-9]*$/),POSITIVE_INTEGER:new RegExp(/^[1-9]\d*$/),MAX_2_DECIMAL_POSITIVE_NUMBER:new RegExp(/^\d+(.\d{1,2})?$/),BUCKET_NAME:new RegExp(/^([a-z0-9][a-z0-9-]{0,61})?[a-z0-9]$/),JS_VARIABLE_NAME:new RegExp(/^[A-Za-z$_][\w$_]*$/)},b=["resourceID"],E=["nodeID","showPage"],I=["nodeID","showPage"];function _(e){var t=(void 0===e?{}:e).goTo;return"/login"+w({goTo:t?encodeURIComponent(t):void 0})}function w(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){var u=o[r],a=u[0],s=u[1];a&&s&&(t[a]=s)}var i=n.stringify(t);return i?"?"+i:""}var q,x,P,S={__proto__:null,home:function(e){return f(void 0===e?{}:e),"/home"},activities:function(e){return f(void 0===e?{}:e),"/activities"},activity:function(e){return"/activity/"+e.activityID},dashboard:function(e){return f(void 0===e?{}:e),"/dashboard"},market:function(e){return"/market"+w(l({},void 0===e?{}:e))},exampleNodes:function(e){return f(void 0===e?{}:e),"/examples"},resourceDetails:function(e){return"/resource/details/"+e.resourceID+w(v(e,b))},resourceCreator:function(e){return f(void 0===e?{}:e),"/resource/creator"},myResources:function(e){return f(void 0===e?{}:e),"/resource/list"},myCollects:function(e){return f(void 0===e?{}:e),"/resource/collect"},resourceInfo:function(e){return"/resource/info/"+e.resourceID},resourceAuth:function(e){return"/resource/auth/"+e.resourceID},resourceCreateVersion:function(e){return"/resource/version/creator/"+e.resourceID},resourceVersion:function(e){return"/resource/version/info/"+e.resourceID+"/"+e.version},nodeCreator:function(e){return f(void 0===e?{}:e),"/node/creator"},nodeManagement:function(e){var t=e.showPage;return"/node/formal/"+e.nodeID+w(l({showPage:void 0===t?"exhibit":t},v(e,E)))},exhibitManagement:function(e){return"/node/exhibit/formal/"+e.exhibitID},informNodeManagement:function(e){var t=e.showPage;return"/node/informal/"+e.nodeID+w(l({showPage:void 0===t?"exhibit":t},v(e,I)))},informExhibitManagement:function(e){return"/node/exhibit/informal/"+e.exhibitID},storageSpace:function(e){return"/storage"+w(l({},void 0===e?{}:e))},objectDetails:function(e){return"/storage"+w(l({},e))},resourceCreateSuccess:function(e){return"/result/resource/create/success/"+e.resourceID},resourceVersionCreateSuccess:function(e){return"/result/resource/version/create/success/"+e.resourceID+"/"+e.version},nodeCreateSuccess:function(e){return"/result/node/create/success/"+e.nodeID},invitation:function(e){var t=l({},void 0===e?{}:e);return"/invitation"+w({returnUrl:t.goTo?encodeURIComponent(t.goTo):void 0})},exception403:function(e){var t=l({},void 0===e?{}:e).from||"";if(!t){var r=window.location;t=r.href.replace(r.origin,"")}return"/exception/403"+w({from:t})},login:_,logon:function(e){var t=(void 0===e?{}:e).goTo;return"/logon"+w({goTo:t?encodeURIComponent(t):void 0})},retrieveUserPassword:function(e){var t=(void 0===e?{}:e).goTo;return"/retrieve"+w({goTo:t?encodeURIComponent(t):void 0})},retrievePayPassword:function(e){return f(void 0===e?{}:e),"/retrievePayPassword"},wallet:function(e){return f(void 0===e?{}:e),"/logged/wallet"},contract:function(e){return f(void 0===e?{}:e),"/logged/contract"},setting:function(e){return f(void 0===e?{}:e),"/logged/setting"}};!function(e){e[e.resource=1]="resource",e[e.node=2]="node",e[e.consumer=3]="consumer"}(q||(q={})),function(e){e[e.resource=1]="resource",e[e.exhibit=2]="exhibit",e[e.user=3]="user"}(x||(x={})),function(e){e[e.pending=0]="pending",e[e.authorized=1]="authorized",e[e.stopped=2]="stopped"}(P||(P={}));var G={__proto__:null,resourceTypes:["json","widget","image","audio","markdown","theme","reveal_slide","license","video","catalog"],pageSize:100,momentDateFormat:"YYYY-MM-DD",momentDateTimeFormat:"YYYY-MM-DD HH:mm",get EnumContractPartyIdentityType(){return q},get EnumSubjectType(){return x},get EnumContractStatus(){return P}},O=["presentableId"],D=["presentableId"],N=["presentableId"],k=["presentableId"],A=["presentableId"],j=["presentableId"],C=["presentableId"],L=["presentableId"],U=["nodeId"],B=["nodeId"],M=["bucketName"],z=["bucketName"],F=["objectIdOrName"],$=["sha1"],V=["objectIdOrName"];function Y(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/storages/files/list/info",params:t})}var H=["resourceIdOrName"],Q=["resourceId"],Z=["resourceId"],W=["resourceId"],J=["resourceId","version"],K=["fileSha1"],X=["fileSha1"],ee=["resourceId"],te=["resourceId"],re=["resourceId"],ne=["resourceId"],oe=["resourceId"],ue=["loginName"],ae=["nodeId"],se=["nodeId"],ie=["nodeId"],ce=["nodeId"],de=["nodeId"],le=["testResourceId"],fe=["testResourceId"],ve=["nodeId"],he=["nodeId"],pe=["nodeId"],me=["nodeId"],ge=["contractId"],Re=["contractId"],Te=["accountId"],ye=["userId"],be=["contractId"],Ee=["recordId"];function Ie(e){return void 0===e&&(e=300),new Promise((function(t){setTimeout((function(){t()}),e)}))}var _e={__proto__:null,getSHA1Hash:function(e){return new Promise((function(t){var r=new FileReader;r.onload=function(){var e=a.lib.WordArray.create(r.result),n=a.SHA1(e).toString();t(n)},r.readAsArrayBuffer(e)}))},generateRandomCode:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<e;r++)t.push("ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"[Math.floor(61*Math.random())]);return t.join("")},getUserIDByCookies:function(){var e=document.cookie.split("; ").find((function(e){return e.startsWith("uid=")}));return e?Number(e.replace("uid=","")):-1},transformServerAPIContractState:function(e){var t=e.status,r=e.authStatus;if(0===t){if(1===r||3===r)return"active";if(2===r)return"testActive";if(128===r)return"inactive"}return 1===t?"terminal":"exception"},promiseSleep:Ie};function we(){return(we=d(p.mark((function e(t,r){var n,o,u,a,s;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===r&&(r=function(){}),0!==(n=t.sha1).length){e.next=4;break}return e.abrupt("return",[]);case 4:o=[].concat(n),u=[];case 6:return console.log(o.join(","),"needHandleSha1.join()90ojlskdfjsdlk"),e.next=10,Y({sha1:o.join(",")});case 10:if(o=(a=e.sent.data).filter((function(e){return e.metaAnalyzeStatus&&1===e.metaAnalyzeStatus})).map((function(e){return e.sha1})),s=a.filter((function(e){return!e.metaAnalyzeStatus||1!==e.metaAnalyzeStatus})).map((function(e){var t="fail";return e.metaAnalyzeStatus?2===e.metaAnalyzeStatus&&(t="success"):t="nonentity",{sha1:e.sha1,state:t,info:e}})),r&&r(s),u=[].concat(u,s),0!==o.length){e.next=18;break}return e.abrupt("break",22);case 18:return e.next=20,Ie(3e3);case 20:e.next=6;break;case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qe={Node:{__proto__:null,create:function(e){return Ge.Request({method:"POST",url:"/v2/nodes",data:e})},details:function(e){return Ge.Request(e.nodeId?{method:"GET",url:"/v2/nodes/"+e.nodeId}:{method:"GET",url:"/v2/nodes/detail",params:e})},nodes:function(e){return Ge.Request({method:"GET",url:"/v2/nodes",params:e})}},Exhibit:{__proto__:null,createPresentable:function(e){return Ge.Request({method:"POST",url:"/v2/presentables",data:e})},updatePresentable:function(e){var t=e.presentableId,r=v(e,O);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t,data:r})},presentablesOnlineStatus:function(e){var t=e.presentableId,r=v(e,D);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/onlineStatus",data:r})},presentableDetails:function(e){if(e.nodeId)return Ge.Request({method:"GET",url:"/v2/presentables/detail",params:e});var t=e.presentableId,r=v(e,N);return Ge.Request({method:"GET",url:"/v2/presentables/"+t,params:r})},presentables:function(e){return Ge.Request({method:"GET",url:"/v2/presentables",params:e})},presentableList:function(e){return Ge.Request({method:"GET",url:"/v2/presentables/list",params:e})},dependencyTree:function(e){var t=e.presentableId,r=v(e,k);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/dependencyTree",params:r})},relationTree:function(e){var t=e.presentableId,r=v(e,A);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/relationTree",params:r})},authTree:function(e){var t=e.presentableId,r=v(e,j);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/authTree",params:r})},presentablesVersion:function(e){var t=e.presentableId,r=v(e,C);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/version",data:r})},updateRewriteProperty:function(e){var t=e.presentableId,r=v(e,L);return Ge.Request({method:"PUT",url:"/v2/presentables/"+t+"/rewriteProperty",data:r})},batchAuth:function(e){var t=e.nodeId,r=v(e,U);return Ge.Request({method:"GET",url:"/v2/auths/presentables/nodes/"+t+"/batchAuth/result",params:r})},contractAppliedPresentable:function(e){var t=e.nodeId,r=v(e,B);return Ge.Request({method:"GET",url:"/v2/presentables/"+t+"/contractAppliedPresentable",params:r})}},Storage:{__proto__:null,createBucket:function(e){return Ge.Request({method:"POST",url:"/v1/storages/buckets",data:e})},bucketList:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets",params:e})},spaceStatistics:function(e){return void 0===e&&(e={}),Ge.Request({method:"GET",url:"/v1/storages/buckets/spaceStatistics",params:e})},deleteBucket:function(e){return Ge.Request({method:"DELETE",url:"/v1/storages/buckets/"+e.bucketName})},bucketDetails:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+e.bucketName})},objectList:function(e){var t=e.bucketName,r=v(e,M);return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+t+"/objects",params:r})},userNodeDataList:function(e){return Ge.Request({method:"GET",url:"/v2/storages/buckets/.UserNodeData/objects",params:e})},createObject:function(e){var t=e.bucketName,r=v(e,z);return Ge.Request({method:"POST",url:"/v1/storages/buckets/"+t+"/objects",data:r})},objectDetails:function(e){return Ge.Request(e.objectIdOrName?{method:"GET",url:"/v1/storages/objects/"+encodeURIComponent(e.objectIdOrName),params:e}:{method:"GET",url:"/v1/storages/buckets/"+e.bucketName+"/objects/"+e.objectId,params:e})},deleteObjects:function(e){return Ge.Request({method:"DELETE",url:"/v1/storages/buckets/"+e.bucketName+"/objects/"+e.objectIds,data:e})},bucketIsExist:function(e){return Ge.Request({method:"GET",url:"/v1/storages/buckets/"+e.bucketName+"/isExist"})},downloadObject:function(e){return window.location.href=Ge.Format.completeUrlByDomain("qi")+"/v1/storages/objects/"+e.objectIdOrName+"/file"},fileIsExist:function(e){return Ge.Request({method:"GET",url:"/v1/storages/files/fileIsExist",params:e})},uploadFile:function(e,t,r){void 0===r&&(r=!1);for(var n=new FormData,o=0,u=Object.entries(e);o<u.length;o++){var a=u[o],s=a[1];s&&n.append(a[0],s)}if(!r)return Ge.Request(l({method:"POST",url:"/v1/storages/files/upload",data:n},t));var i=null;return[Ge.Request(l({method:"POST",url:"/v1/storages/files/upload",data:n,cancelToken:new Ge.Axios.CancelToken((function(e){i=e}))},t)),i]},uploadImage:function(e,t){for(var r=new FormData,n=0,o=Object.entries(e);n<o.length;n++){var u=o[n],a=u[1];a&&r.append(u[0],a)}return Ge.Request(l({method:"POST",url:"/v1/storages/files/uploadImage",data:r},t))},updateObject:function(e){var t=e.objectIdOrName,r=v(e,F);return Ge.Request({method:"PUT",url:"/v2/storages/objects/"+t,data:r})},batchObjectList:function(e){return Ge.Request({method:"GET",url:"/v1/storages/objects/list",params:e})},fileProperty:function(e){var t=e.sha1,r=v(e,$);return Ge.Request({method:"GET",url:"/v1/storages/files/"+t+"/property",params:r})},cycleDependencyCheck:function(e){var t=e.objectIdOrName,r=v(e,V);return Ge.Request({method:"POST",url:"/v1/storages/objects/"+t+"/cycleDependencyCheck",data:r})},clearUserNodeData:function(e){var t=l({},e);return Ge.Request({method:"DELETE",url:"/v2/storages/buckets/.UserNodeData/objects/clear",data:t})},filesListInfo:Y},Collection:{__proto__:null,collectResource:function(e){return Ge.Request({method:"POST",url:"/v2/collections/resources",data:e})},collectionResources:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources",params:e})},deleteCollectResource:function(e){return Ge.Request({method:"DELETE",url:"/v2/collections/resources/"+e.resourceId})},isCollected:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources/isCollected",params:e})},collectedCount:function(e){return Ge.Request({method:"GET",url:"/v2/collections/resources/"+e.resourceId+"/count"})}},Resource:{__proto__:null,create:function(e){return Ge.Request({method:"POST",url:"/v2/resources",data:e})},update:function(e){return Ge.Request({method:"PUT",url:"/v2/resources/"+e.resourceId,data:e})},list:function(e){return Ge.Request({method:"GET",url:"/v2/resources",params:e})},info:function(e){var t=e.resourceIdOrName,r=v(e,H);return Ge.Request({method:"GET",url:"/v2/resources/"+encodeURIComponent(t),params:r})},batchInfo:function(e){return Ge.Request({method:"GET",url:"/v2/resources/list",params:e})},dependencyTree:function(e){var t=e.resourceId,r=v(e,Q);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/dependencyTree",params:r})},authTree:function(e){var t=e.resourceId,r=v(e,Z);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/authTree",params:r})},createVersion:function(e){var t=e.resourceId,r=v(e,W);return Ge.Request({method:"POST",url:"/v2/resources/"+t+"/versions",data:r})},resourceVersionInfo1:function(e){var t=e.resourceId,r=e.version,n=v(e,J);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/versions/"+r,params:n})},resourceVersionInfo2:function(e){return Ge.Request({method:"GET",url:"/v2/resources/versions/detail",params:e})},getResourceVersionBySha1:function(e){var t=e.fileSha1,r=v(e,K);return Ge.Request({method:"GET",url:"/v2/resources/files/"+t+"/versions",params:r})},getResourceBySha1:function(e){var t=e.fileSha1,r=v(e,X);return Ge.Request({method:"GET",url:"/v2/resources/files/"+t,params:r})},updateResourceVersionInfo:function(e){return Ge.Request({method:"PUT",url:"/v2/resources/"+e.resourceId+"/versions/"+e.version,data:e})},saveVersionsDraft:function(e){return Ge.Request({method:"POST",url:"/v2/resources/"+e.resourceId+"/versions/drafts",data:e})},lookDraft:function(e){return Ge.Request({method:"GET",url:"/v2/resources/"+e.resourceId+"/versions/drafts",params:e})},resourceIsUsedByOther:function(e){return Ge.Request({method:"GET",url:"/v2/resources/versions/isCanBeCreate",params:e})},resourcesDownload:function(e){return window.location.href=Ge.Format.completeUrlByDomain("qi")+"/v2/resources/"+e.resourceId+"/versions/"+e.version+"/download"},batchGetCoverageVersions:function(e){var t=e.resourceId,r=v(e,ee);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/contracts/coverageVersions",params:r})},resolveResources:function(e){return Ge.Request({method:"GET",url:"/v2/resources/"+e.resourceId+"/resolveResources"})},batchSetContracts:function(e){var t=e.resourceId,r=v(e,te);return Ge.Request({method:"PUT",url:"/v2/resources/"+t+"/versions/batchSetContracts",data:r})},cycleDependencyCheck:function(e){var t=e.resourceId,r=v(e,re);return Ge.Request({method:"POST",url:"/v2/resources/"+t+"/versions/cycleDependencyCheck",data:r})},relationTree:function(e){var t=e.resourceId,r=v(e,ne);return Ge.Request({method:"GET",url:"/v2/resources/"+t+"/relationTree",params:r})},relationTreeAuth:function(e){var t=e.resourceId,r=v(e,oe);return Ge.Request({method:"GET",url:"/v2/auths/resources/"+t+"/relationTreeAuth",params:r})},batchAuth:function(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/auths/resources/batchAuth/results",params:t})},resourcesRecommend:function(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/resources/recommend",params:t})}},User:{__proto__:null,login:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/passport/login",data:t},{noRedirect:!0})},logout:function(e){var t=l({},void 0===e?{}:e);return Ge.Request({method:"GET",url:"/v2/passport/logout",params:t},{noRedirect:!0})},currentUserInfo:function(){return Ge.Request({method:"GET",url:"/v2/users/current"})},userDetails:function(e){return Ge.Request({method:"GET",url:"/v2/users/detail",params:e})},logon:function(e){return Ge.Request({method:"POST",url:"/v2/users",data:e})},resetPassword:function(e){var t=e.loginName,r=v(e,ue);return Ge.Request({method:"PUT",url:"/v2/users/"+t+"/resetPassword",data:r})},updatePassword:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/updatePassword",data:e})},uploadHeadImg:function(e,t){for(var r=new FormData,n=0,o=Object.entries(e);n<o.length;n++){var u=o[n],a=u[1];a&&r.append(u[0],a)}return Ge.Request(l({method:"POST",url:"/v2/users/current/uploadHeadImg",data:r},t))},updateDetailInfo:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/detailInfo",data:e})},verifyLoginPassword:function(e){return Ge.Request({method:"GET",url:"/v2/users/verifyLoginPassword",params:e})},areasProvinces:function(e){return void 0===e&&(e={}),Ge.Request({method:"GET",url:"/v2/areas/provinces",params:e})},updateMobileOrEmail:function(e){return Ge.Request({method:"PUT",url:"/v2/users/current/mobileOrEmail",data:e})},registerOrBind:function(e){return Ge.Request({method:"POST",url:"/v2/thirdParty/registerOrBind",data:e},{noRedirect:!0})},thirdPartyUnbind:function(e){return Ge.Request({method:"PUT",url:"/v2/thirdParty/unbind",data:e})},thirdPartyList:function(e){return void 0===e&&(e={}),Ge.Request({method:"GET",url:"/v2/thirdParty/list",data:e})}},InformalNode:{__proto__:null,testResources:function(e){var t=e.nodeId,r=v(e,ae);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources",params:r})},createRules:function(e){var t=e.nodeId,r=v(e,se);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules",data:r})},batchTestResources:function(e){var t=e.nodeId,r=v(e,ie);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/list",params:r})},dependencyTree:function(e){var t=e.nodeId,r=v(e,ce);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/dependencyTree/search",params:r})},putRules:function(e){var t=e.nodeId,r=v(e,de);return Ge.Request({method:"PUT",url:"/v2/testNodes/"+t+"/rules",data:r})},testNodeRules:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/"+e.nodeId+"/rules"})},updateTestResourceContracts:function(e){var t=e.testResourceId,r=v(e,le);return Ge.Request({method:"PUT",url:"/v2/testNodes/testResources/"+t,data:r})},dependencyTreeFilter:function(e){var t=e.testResourceId,r=v(e,fe);return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+t+"/dependencyTree/filter",params:r})},testResourcesDependencyTree:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId+"/dependencyTree"})},testResourcesAuthTree:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId+"/authTree"})},testResourceDetails:function(e){return Ge.Request({method:"GET",url:"/v2/testNodes/testResources/"+e.testResourceId})},searchTestResourcesByDependency:function(e){var t=e.nodeId,r=v(e,ve);return Ge.Request({method:"GET",url:"/v2/testNodes/"+t+"/testResources/searchByDependency",params:r})},rulesRematch:function(e){var t=e.nodeId,r=v(e,he);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules/rematch",data:r})},rulesPreExecution:function(e){var t=e.nodeId,r=v(e,pe);return Ge.Request({method:"POST",url:"/v2/testNodes/"+t+"/rules/preExecution",data:r})},batchGetAuths:function(e){var t=e.nodeId,r=v(e,me);return Ge.Request({method:"GET",url:"/v2/auths/exhibits/"+t+"/test/batchAuth/results",params:r})}},Contract:{__proto__:null,contractDetails:function(e){var t=e.contractId,r=v(e,ge);return Ge.Request({method:"GET",url:"/v2/contracts/"+t,params:r})},contracts:function(e){return Ge.Request({method:"GET",url:"/v2/contracts",params:e})},batchContracts:function(e){return Ge.Request({method:"GET",url:"/v2/contracts/list",params:e})},transitionRecords:function(e){var t=e.contractId,r=v(e,Re);return Ge.Request({method:"GET",url:"/v2/contracts/"+t+"/transitionRecords",params:r})}},Transaction:{__proto__:null,details:function(e){var t=e.accountId,r=v(e,Te);return Ge.Request({method:"GET",url:"/v2/transactions/details/"+t,params:r})},individualAccounts:function(e){var t=e.userId,r=v(e,ye);return Ge.Request({method:"GET",url:"/v2/accounts/individualAccounts/"+t,params:r})},transactionDetails:function(e){return Ge.Request({method:"GET",url:"/v2/transactions/records/"+e.recordId})},activateIndividualAccounts:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts/activate",data:t})},changePassword:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts",data:t})},resetPassword:function(e){var t=l({},e);return Ge.Request({method:"PUT",url:"/v2/accounts/individualAccounts/resetPassword",data:t})},verifyTransactionPassword:function(e){var t=l({},e);return Ge.Request({method:"GET",url:"/v2/accounts/individualAccounts/verifyTransactionPassword",params:t})}},Captcha:{__proto__:null,sendVerificationCode:function(e){return Ge.Request({method:"POST",url:"/v2/messages/send",data:e})},verifyVerificationCode:function(e){return Ge.Request({method:"GET",url:"/v2/messages/verify",params:e})}},Event:{__proto__:null,transaction:function(e){var t=e.contractId,r=v(e,be);return Ge.Request({method:"POST",url:"/v2/contracts/"+t+"/events/payment",data:r})}},Activity:{__proto__:null,list4Client:function(e){return Ge.Request({method:"GET",url:"/v2/activities/list4Client",params:e})},find4Client:function(e){return Ge.Request({method:"GET",url:"/v2/activities/find4Client",params:e})},adsList:function(e){return Ge.Request({method:"GET",url:"/v2/activities/ads/list4Client",params:e})},adsDetails:function(e){return Ge.Request({method:"GET",url:"/v2/activities/ads/find4Client",params:e})}},TestQualification:{__proto__:null,betaCodesActivate:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/testQualifications/beta/codes/activate",data:t})},betaApply:function(e){var t=l({},e);return Ge.Request({method:"POST",url:"/v2/testQualifications/beta/apply",data:t})},getBetaApply1:function(e){var t=l({},void 0===e?{}:e);return Ge.Request({method:"GET",url:"/v2/testQualifications/beta/apply/current",params:t})},getBetaApply2:function(e){var t=e.recordId,r=v(e,Ee);return Ge.Request({method:"GET",url:"/v2/testQualifications/beta/apply/"+t,data:r})}},Statistic:{__proto__:null,transactionsCommon:function(e){return Ge.Request({method:"GET",url:"/v2/statistics/transactions/common",params:e})}},I18n:{__proto__:null,configsList:function(e){return Ge.Request({method:"POST",url:"/v2/i18n/configs/list",data:e})}},recombination:{__proto__:null,getFilesSha1Info:function(e,t){return we.apply(this,arguments)}}},xe={200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"};function Pe(){return(Pe=d(p.mark((function e(t,r){var n,u,a;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=void 0!==(n=(void 0===r?{}:r).noRedirect)&&n,e.next=3,o.request(t);case 3:if(30!==(a=e.sent).errCode&&30!==a.errCode||u){e.next=8;break}return e.next=7,qe.User.logout();case 7:window.location.replace(""+g("user")+_({goTo:window.location.href}));case 8:return e.abrupt("return",a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}window.location.hostname.includes(".com")&&(o.defaults.withCredentials=!0,o.defaults.baseURL=g("qi")),o.interceptors.request.use((function(e){return u.start(),e}),(function(e){return u.done(),Promise.reject(e)})),o.interceptors.response.use((function(e){var t;if(u.done(),200!==e.status)throw new Error(JSON.stringify({description:xe[e.status],message:e.status}));var r=e.data;if(null==(t=e.headers["content-disposition"])||!t.includes("attachment;"))return r}),(function(e){return u.done(),Promise.reject(e)}));var Se,Ge={Format:T,Regexp:y,LinkTo:S,Predefined:G,Axios:o,Request:function(e,t){return Pe.apply(this,arguments)},Tool:_e},Oe=[{value:"en_US",label:"English"},{value:"zh_CN",label:"简体中文"}];exports.FI18n={i18nNext:new(function(){function e(){this._loadingData="NotStart",this._taskQueue=[],this._currentLanguage=i.get("locale")||"zh_CN",(Se=this).ready()}var t=e.prototype;return t.ready=function(){var e=d(p.mark((function e(){var t,r,n;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=function(){for(;Se._taskQueue.length>0;){var e=Se._taskQueue.shift();e&&e()}},r=function(){var e=d(p.mark((function e(){return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("End"!==Se._loadingData){e.next=3;break}return t(),e.abrupt("return");case 3:if("Start"!==Se._loadingData){e.next=5;break}return e.abrupt("return");case 5:return Se._loadingData="Start",e.next=8,Se._handleData();case 8:t();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=new Promise((function(e){Se._taskQueue.push(e)})),r(),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t.t=function(e,t){return s.t(e,t)},t.changeLanguage=function(e){i.set("locale",e,{expires:36525,domain:Ge.Format.completeUrlByDomain("").replace(/http(s)?:\/\//,"")})},t.getAllLanguage=function(){return Oe},t.getCurrentLanguage=function(){return Se._currentLanguage},t._handleData=function(){var e=d(p.mark((function e(){var t,r,n;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Se._currentLanguage,r=window.localStorage.getItem("i18nextResources"),n=r?JSON.parse(r):null){e.next=9;break}return e.next=6,Se._fetchData();case 6:n=e.sent,e.next=10;break;case 9:Se._fetchData();case 10:return e.next=12,s.init({resources:n,lng:t,fallbackLng:"zh_CN",interpolation:{escapeValue:!1}});case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t._fetchData=function(){var e=d(p.mark((function e(){var t,r,n,u,a,s,i,c;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.get("https://freelog-i18n.oss-cn-shenzhen.aliyuncs.com/configs/i18n.json",{withCredentials:!1});case 2:for(t={},r={},n=0,u=Object.entries(e.sent);n<u.length;n++)t[s=(a=u[n])[0]]=(i=a[1]).en_US,r[s]=i.zh_CN;return c={en_US:{translation:t},zh_CN:{translation:r}},window.localStorage.setItem("i18nextResources",JSON.stringify(c)),e.abrupt("return",c);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e}())},exports.FServiceAPI=qe,exports.FUtil=Ge;
|
|
2
2
|
//# sourceMappingURL=tools-lib.cjs.production.min.js.map
|