import{d as h,a as u}from"./dataSchema-liIE6AFZ.js";import"./locale-2oqXkJWO.js";import{C as f}from"./collection-nnUjKAuT.js";import"./manifest--hA2W8VB.js";const y={docLink:"https://docs.mia-platform.eu/docs/microfrontend-composer/back-kit/components/crud_export_client",description:{en:"Client for Mia-Platform CRUD service export route",it:"Client per la rotta di export del servizio CRUD di Mia-Platform "},label:"CRUD Export Client",mocks:{fetch:n=>{const{basePath:a,dataSchema:i}=n,o=new f(i);if(a){const{pathname:s,origin:c}=new URL(a,window.document.baseURI);return[{handler:async(d,{body:l=""}={})=>{if(typeof l!="string")return new Response("Bad Request",{status:400});try{return new Response(new ReadableStream({start(e){const p=`
`,m=new TextEncoder;async function r(t){if(t.length===0){e.close();return}e.enqueue(m.encode(JSON.stringify(t.shift()).concat(p))),r(t)}r(o.export(d))}}),{status:200,statusText:"OK",headers:new Headers({"Content-Type":"application/x-ndjson","Transfer-Encoding":"chunked"})})}catch{return new Response("Internal Server Error",{status:500})}},method:"POST",url:{pathname:s,origin:c}}]}return[]}},definitions:{...h,dataSchema:u},properties:{dataSchema:{$ref:"#/definitions/dataSchema",__mia_configuration:{label:"Data Schema",priority:"high","shared-key":"back-kit/data-schema"}},exportInternalUrl:{type:"string",__mia_configuration:{attribute:"export-internal-url",label:"Internal CRUD Url",description:"Url to be called internally to get `jsonl` formatted data"}},primaryKey:{type:"string",default:"_id",__mia_configuration:{attribute:"primary-key",label:"Primary Key",description:"primary key to filter selected data when `selected only export` option is enabled"}},streamSaverIFrameSrc:{type:"string",__mia_configuration:{attribute:"stream-saver-iframe-src",label:"Streamsaver IFrame source",description:"When downloading this component may use the `streamsaver` service worker. This property sets the location where the relevant iframe can be found"}},basePath:{type:"string",__mia_configuration:{description:"The URL base path used to reach the export service",label:"CRUD Service base path",attribute:!0,priority:"high","schema-hint":"mia/endpoints"}}},type:"connector"};var w=y;export{w as default};
