PageSourceSearch

https://astron.ai/assets/Api-DLKY3am0.js

js astron.ai collected 2026-10-01 16:40:26 UTC 10,095 bytes, 1 lines download raw bytes

1import{r as p,j as e}from"./index-CJQpyVoF.js";import{c as B,d as q}from"./useUrlParam-CZ4aw4md.js";import{h as R,c as $,i as H,j as O}from"./userAuth-Bzc-YaEz.js";import{u as K}from"./useTranslation-CZJVCIH1.js";import{F as m}from"./index-ByGsukvN.js";import{B as h}from"./button-COlcySkY.js";import{S as V}from"./index-BQyCNz27.js";import{M as W}from"./index-CSwuRCeV.js";import{I as y}from"./index-CS8YAtyi.js";import{s as o}from"./inviteCode-D9rgtvJs.js";import"./base64-Cs2W2fcZ.js";import"./context-DKhv_b6t.js";import"./Compact-BviLumD4.js";import"./motion-BwoXtl0z.js";import"./collapse-BbEVqHco.js";import"./zoom-DpNIHBsI.js";import"./reactNode-CvZomqk2.js";import"./row-BXqHUWkn.js";import"./responsiveObserver-DyJXlrPc.js";import"./index-34CVpSRX.js";import"./index-DnoH8i83.js";import"./index-Cb4CfQq0.js";import"./ContextIsolator-hwtSycux.js";import"./useLocale-Dmo9Agcu.js";import"./compact-item-5orumCwJ.js";import"./Overflow-Dh_HYkSz.js";import"./PurePanel-CKKM5xpM.js";import"./SearchOutlined-D1PhykWn.js";import"./CheckOutlined-DczzTUs8.js";import"./DownOutlined-Bedvisqk.js";import"./ActionButton-DJ1XBOXE.js";import"./index-Cbb5YXZ-.js";import"./fade-DU7Y_kU8.js";import"./Skeleton-CRGI6EI_.js";const G="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='13.0000118px'%20viewBox='0%200%2015%2013.0000118'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='助手1.0概览'%20transform='translate(-26.500000,%20-104.931980)'%20stroke='%23333333'%20stroke-width='2'%3e%3cg%20id='箭头左_arrow-left'%20transform='translate(27.500000,%20105.931986)'%3e%3cline%20x1='1.2490009e-15'%20y1='5.5'%20x2='13'%20y2='5.5'%20id='路径'%3e%3c/line%3e%3cpolyline%20id='路径'%20points='6%2011%200%205.5%206%200'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",J="_api_swap_12czr_1",Q="_api_container_12czr_6",X="_divider_12czr_10",Y="_divider_circle_12czr_13",Z="_api_header_12czr_24",ee="_api_header_title_12czr_33",se="_api_header_subtitle_12czr_40",ie="_api_step_12czr_46",te="_step_12czr_56",ae="_step_index_12czr_59",ce="_step_detail_12czr_63",pe="_title_12czr_69",re="_subtitle_12czr_74",le="_fun_12czr_80",ne="_statistic_12czr_86",de="_certified_card_12czr_93",oe="_certified_card_title_12czr_100",_e="_appid_box_12czr_123",me="_appid_download_12czr_128",he="_appid_select_12czr_141",xe="_appid_select_title_12czr_148",ue="_appid_select_appid_12czr_155",fe="_appid_select_divide_12czr_164",be="_certified_card_tips_12czr_177",Ae="_cer_divide_12czr_183",je="_cer_info_12czr_187",ve="_info_label_12czr_191",ge="_info_res_12czr_197",s={api_swap:J,api_container:Q,divider:X,divider_circle:Y,api_header:Z,api_header_title:ee,api_header_subtitle:se,api_step:ie,step:te,step_index:ae,step_detail:ce,title:pe,subtitle:re,fun:le,statistic:ne,certified_card:de,certified_card_title:oe,appid_box:_e,appid_download:me,appid_select:he,appid_select_title:xe,appid_select_appid:ue,appid_select_divide:fe,certified_card_tips:be,cer_divide:Ae,cer_info:je,info_label:ve,info_res:ge},Ne=()=>e.jsx("div",{className:s.divider,children:[1,2,3,4,5,6].map((z,i)=>e.jsx("div",{className:s.divider_circle},i))});function ps({_isOpenapi:z=!1}){const{t:i}=K(),[n]=m.useForm(),C=B(),[b,S]=p.useState(!1),[r]=q(),[x,A]=p.useState(""),[d,k]=p.useState([]),[u,j]=p.useState(""),[t,F]=p.useState(null),[we,ye]=p.useState({}),[v,D]=p.useState(0),[f,I]=p.useState(!1),[E,_]=p.useState(!1),[g,M]=p.useState(),N=async(c,a)=>{try{await O({botId:x,appId:a||u}),D(v+1),o.success(i("appManage.bindAppSuccess"))}catch(l){o.error(l==null?void 0:l.msg)}finally{I(!1)}},P=()=>{if(!u){o.warning(i("appManage.bindAppTip"));return}N(null,u)},T=async(c,a)=>{j(a),A(c),N(null,a)},w=async()=>{const a=(await R()).map(l=>({value:l.appId,label:l.appName||l.appId}));k(a)},U=async c=>{const a=await $(c);F(a)},L=()=>{n.validateFields().then(c=>{H(c).then(()=>{o.success(i("appManage.createAppSuccess")),_(!1),n.resetFields(),w()}).catch(a=>{o.error((a==null?void 0:a.message)||i("appManage.createAppFailed")),console.log(a)})})};return p.useEffect(()=>{r.get("id")&&A(r.get("id"));const c=r.get("version")!=="1"?"https://www.xfyun.cn/doc/spark/Agent04-API%E6%8E%A5%E5%85%A5.html":"https://www.xfyun.cn/doc/spark/SparkAssistantAPI.html";M(c)},[r]),p.useEffect(()=>{d!=null&&d.length?U(x):b||(w(),S(!0))},[d,v,b]),e.jsxs("section",{className:s.api_swap,children:[e.jsxs("section",{className:s.api_container,children:[e.jsxs("div",{className:s.api_header,children:[e.jsx("img",{src:G,alt:"",style:{marginRight:"10px",cursor:"pointer"},onClick:()=>C(-1)}),e.jsx("span",{className:s.api_header_title,children:i("botApi.botApi")}),e.jsx("span",{className:s.api_header_subtitle,children:i("botApi.botApiDesc")})]}),e.jsxs("div",{className:s.api_step,children:[e.jsxs("div",{className:s.step,children:[e.jsx("img",{src:"https://aixfyun-cn-bj.xfyun.cn/bbs/75713.7
15546409925/cir.svg",alt:"",className:s.step_index}),e.jsxs("div",{className:s.step_detail,children:[e.jsx("span",{className:s.title,children:i("botApi.bindApp")}),e.jsx("span",{className:s.subtitle,children:i("botApi.bindAppDesc")}),e.jsxs("span",{className:s.fun,onClick:()=>{_(!0)},children:[i("botApi.createApi")," "," >"]})]})]}),e.jsx(Ne,{}),e.jsxs("div",{className:s.step,children:[e.jsx("img",{src:"https://aixfyun-cn-bj.xfyun.cn/bbs/84687.53848944922/cir2.svg",alt:"",className:s.step_index}),e.jsxs("div",{className:s.step_detail,children:[e.jsx("span",{className:s.title,children:i("botApi.callService")}),e.jsx("span",{className:s.subtitle,children:i("botApi.callServiceDesc")}),e.jsx("span",{className:s.fun,onClick:()=>{window.open(g)},children:i("botApi.apiDoc")})]})]})]}),e.jsx("div",{className:s.statistic,children:e.jsxs("div",{className:s.certified_card,children:[e.jsxs("div",{className:s.certified_card_title,children:[e.jsx("span",{children:i("botApi.apiCertInfo")}),e.jsx("div",{onClick:()=>{window.open(g)},children:i("botApi.viewApiDoc")})]}),e.jsxs("div",{className:s.appid_box,children:[e.jsxs("div",{className:s.appid_select,children:[(t==null?void 0:t.appId)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:s.appid_select_title,children:i("botApi.bindAppID")}),e.jsx("span",{className:s.appid_select_appid,title:t.appId,children:t&&t.appId}),e.jsx("span",{className:s.appid_select_divide}),e.jsx("span",{className:s.appid_select_title,children:i("botApi.appName")}),e.jsx("span",{className:s.appid_select_appid,title:t==null?void 0:t.appName,children:t&&t.appName?t.appName:i("botApi.unNamed")}),r.get("version")!=="1"&&e.jsx(h,{type:"primary",ghost:!0,size:"small",loading:f,style:{marginLeft:30,color:"#fff",height:"30px",lineHeight:"30px",fontSize:"12px"},onClick:()=>T(x,t.appId),children:i("botApi.updateBind")})]}),!(t!=null&&t.appId)&&e.jsxs(e.Fragment,{children:[e.jsx(V,{showSearch:!0,style:{width:192},placeholder:i("botApi.selectApp"),onChange:c=>{j(c)},options:d,filterOption:(c,a)=>((a==null?void 0:a.label)??"").includes(c),filterSort:(c,a)=>((c==null?void 0:c.label)??"").toLowerCase().localeCompare(((a==null?void 0:a.label)??"").toLowerCase())}),e.jsx(h,{type:"primary",ghost:!0,size:"small",loading:f,style:{marginLeft:10,color:"#fff",height:"30px",lineHeight:"30px",fontSize:"12px"},onClick:()=>P(),children:i("botApi.bindAppBtn")})]})]}),r.get("version")!=="1"&&e.jsxs("div",{style:{marginTop:"4px"},children:[e.jsx("a",{className:s.appid_download,href:"https://astron-oss-s.oss-ap-southeast-1.aliyuncs.com/code/workflow_openapi_demo_python.py.zip",children:i("botApi.pythonDemoDownload")}),e.jsx("a",{className:s.appid_download,href:"https://astron-oss-s.oss-ap-southeast-1.aliyuncs.com/code/WorkflowRequest.java.zip",children:i("botApi.javaDemoDownload")})]})]}),e.jsxs("div",{className:s.certified_card_tips,children:[e.jsx("span",{style:{color:"#DE9B7C"},children:"*"}),i("botApi.bindAppTips")]}),e.jsx("img",{src:"https://aixfyun-cn-bj.xfyun.cn/bbs/16415.126278163174/%E8%99%9A%E7%BA%BF.svg",alt:"",className:s.cer_divide}),e.jsxs("div",{className:`${s.cer_info}`,children:[e.jsxs("span",{className:s.info_label,children:[i("botApi.serviceUrl"),":"]}),e.jsx("span",{className:s.info_res,title:t!=null&&t.serviceUrl?t==null?void 0:t.serviceUrl:null,children:t!=null&&t.serviceUrl?t==null?void 0:t.serviceUrl:i("botApi.bindAppTips2")})]}),e.jsxs("div",{className:`${s.cer_info}`,children:[e.jsx("span",{className:s.info_label,children:"API Secret:"}),e.jsx("span",{className:s.info_res,children:(t==null?void 0:t.apiSecret)||i("botApi.bindAppTips2")})]}),e.jsxs("div",{className:`${s.cer_info}`,children:[e.jsx("span",{className:s.info_label,children:"API Key:"}),e.jsx("span",{className:s.info_res,children:(t==null?void 0:t.apiKey)||i("botApi.bindAppTips2")})]}),r.get("version")!=="1"&&e.jsxs("div",{className:`${s.cer_info}`,children:[e.jsx("span",{className:s.info_label,children:"API Flowid"}),e.jsx("span",{className:s.info_res,children:(t==null?void 0:t.flowId)||i("botApi.bindAppTips2")})]})]})})]}),e.jsx(W,{open:E,onCancel:()=>{_(!1),n.resetFields()},title:i("botApi.createApp"),width:500,centered:!0,maskClosable:!1,footer:[e.jsx(h,{onClick:()=>{_(!1),n.resetFields()},children:i("btnCancel")}),e.jsx(h,{type:"primary",loading:f,onClick:()=>{L()},children:i("btnOk")})],children:e.jsx("div",{className:s.createAppModal,children:e.jsxs(m,{form:n,name:"promptForm",initialValues:{remember:!0},autoComplete:"off",children:[e.jsx(m.Item,{label:i("botApi.createAppName"),name:"appName",rules:[{required:!0,message:i("botApi.createAppNameRequired")}],colon:!1,labelCol:{span:24},wrapperCol:{span:24},children:e.jsx(y,{placeholder:i("botApi.createAppNamePlaceholder")})}),e.jsx(m.Item,{label:i("botApi.createAppDesc"),name:"appDesc",rules:[{required:!0,message:i("botApi.createAppDescRequired")}],labelCol:{span:24},wrapperCol:{span:24},children:e.jsx(y.TextArea,{placeholder:i("botApi.createAppDescPlaceholder"),rows:4})})]})})})]})}export{ps as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.