isdata-customer-sdk 0.2.74 → 0.2.76
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/cjs/dify.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/portal.js +1 -1
- package/dist/esm/dify.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/portal.js +1 -1
- package/dist/index.common.js +1779 -2301
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +1779 -2301
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +4 -4
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +10 -10
- package/dist/cjs/chat.js.map +0 -1
- package/dist/cjs/dify.js.map +0 -1
- package/dist/cjs/event.js.map +0 -1
- package/dist/cjs/i18n.js.map +0 -1
- package/dist/cjs/iframe.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/portal.js.map +0 -1
- package/dist/cjs/security.js.map +0 -1
- package/dist/cjs/sms.js.map +0 -1
- package/dist/cjs/utils.js.map +0 -1
- package/dist/esm/chat.js.map +0 -1
- package/dist/esm/dify.js.map +0 -1
- package/dist/esm/event.js.map +0 -1
- package/dist/esm/i18n.js.map +0 -1
- package/dist/esm/iframe.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/portal.js.map +0 -1
- package/dist/esm/security.js.map +0 -1
- package/dist/esm/sms.js.map +0 -1
- package/dist/esm/utils.js.map +0 -1
package/dist/cjs/dify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("axios"),t={},n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,a,i=[];for(a in"string"!=typeof t&&(t="?"),e)if(n.call(e,a)){if((o=e[a])||null!=o&&!isNaN(o)||(o=""),a=r(a),o=r(o),null===a||null===o)continue;i.push(a+"="+o)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var a=o(t[1]),i=o(t[2]);null===a||null===i||a in r||(r[a]=i)}return r};var a=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const o=e.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let r=o.post;return o.post=(e,t,n)=>{let a=window.VITE_SERVICE_BASE_URL||"";if(a){let i=a+e;return r.call(o,i,t,n)}return r.call(o,e,t,n)},o.defaults.headers.post["Content-Type"]="application/json",o.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),o})(window.prefixPath||"");const i=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId;exports.
|
|
1
|
+
"use strict";var e=require("axios"),t={},n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,a,i=[];for(a in"string"!=typeof t&&(t="?"),e)if(n.call(e,a)){if((o=e[a])||null!=o&&!isNaN(o)||(o=""),a=r(a),o=r(o),null===a||null===o)continue;i.push(a+"="+o)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var a=o(t[1]),i=o(t[2]);null===a||null===i||a in r||(r[a]=i)}return r};var a=((n="")=>{n&&(n.startsWith("/")&&(n=n.slice(1,n.length)),n.endsWith("/")&&(n=n.slice(0,-1)));const o=e.create({baseURL:`/${n?n+"/":""}sdata/rest`,timeout:6e4,validateStatus:function(e){return e>=200&&e<300},headers:window.location.search&&t.parse(window.location.search).token||window.token?{token:t.parse(window.location.search).token||window.token}:{}});let r=o.post;return o.post=(e,t,n)=>{let a=window.VITE_SERVICE_BASE_URL||"";if(a){let i=a+e;return r.call(o,i,t,n)}return r.call(o,e,t,n)},o.defaults.headers.post["Content-Type"]="application/json",o.interceptors.response.use(e=>{let{data:t}=e;return"string"==typeof t&&(t=JSON.parse(t)),!t||200===t.status||t instanceof Blob?t instanceof Blob?(e.data=t,e):(e.data=t&&t.result,e):Promise.reject(e)},e=>{if(!e.response||401!==e.response.status)return Promise.reject(e.response)}),o})(window.prefixPath||"");const i=()=>window.appSdk.getAppId()||window.localStorage.MobileAppId;exports.getDifyFileType=e=>({DOCX:"document",TXT:"document",MD:"document",MARKDOWN:"document",MDX:"document",PDF:"document",HTML:"document",XLSX:"document",XLS:"document",VTT:"document",DOC:"document",CSV:"document",EML:"document",MSG:"document",PPTX:"document",PPT:"document",XML:"document",EPUB:"document",JPG:"image",JPEG:"image",PNG:"image",GIF:"image",WEBP:"image",MP3:"audio",M4A:"audio",WAV:"audio",WEBM:"audio",MPGA:"audio",MP4:"video",MOV:"video",MPEG:"video"}[e.toUpperCase()]||"custom"),exports.sendPostToAIAgent=async(e,t,n)=>{let o=(()=>{let e=window.sessionStorage.getItem("iportal_app_id");return e||(e=i()),e})(),r=await(async e=>{let t={param:{appID:e}},n=(await a.post("/dataservice/rest/orchestration/getAppCustomData",t)).data.customData;return n=n?JSON.parse(n):{},n})(o),s=r?.aiAgentServerIP||"";if(!s)return console.error("没有配置AI Agent服务地址,请联系管理员"),void(n&&n("没有配置AI Agent服务地址,请联系管理员"));let c=`${s}/addAndCleanDocument`;a.post(c,JSON.stringify(e)).then(e=>{console.log("发送消息成功:",e),t&&t(e)}).catch(e=>{console.error("发送消息失败:",e),n&&n(e)})};
|