PageSourceSearch

https://insomnia.rest/_next/static/chunks/pages/convert-to-design-doc-d82a3330bc9e86dc.js

js insomnia.rest collected 2026-09-24 07:48:34 UTC 6,440 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[811],{1752:function(e,t,r){e.exports=r(6616)},8880:function(e,t,r){"use strict";r(7294);var n=r(9008),o=r.n(n),s=r(1752),i=r.n(s),a=r(4298),c=r.n(a),u=r(5893),d=i()().publicRuntimeConfig;t.Z=function(e){var t,r,n=e.children,s=void 0===n?null:n,i=e.data,a=e.slug,l=i.meta_title?"".concat(i.meta_title," - ").concat(d.siteName):d.siteName;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(o(),{children:[(0,u.jsx)("title",{children:l}),i.meta_description&&(0,u.jsx)("meta",{name:"description",content:i.meta_description}),i.meta_title&&(0,u.jsx)("meta",{property:"og:title",content:i.meta_title},"title"),i.meta_description&&(0,u.jsx)("meta",{property:"og:description",content:i.meta_description}),(0,u.jsx)("link",{rel:"canonical",href:"https://insomnia.rest/".concat(a)}),(0,u.jsx)("meta",{property:"og:image",content:(null===(t=i.meta_image)||void 0===t?void 0:t.url)||(null===(r=i.post_header_image)||void 0===r?void 0:r.url)||d.siteCardImage}),s]}),(0,u.jsx)(c(),{strategy:"afterInteractive",src:"/scripts/github-stars.js"}),(0,u.jsx)(c(),{strategy:"beforeInteractive",src:"/scripts/querystring.js"}),(0,u.jsx)(c(),{async:!0,defer:!0,src:"https://static.cdn.prismic.io/prismic.js?new=true&repo=cms-react-testing"})]})}},5366:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSG:function(){return u}});var n=r(29),o=r(7794),s=r.n(o),i=r(7294),a=r(8880),c=r(5893),u=!0;t.default=function(e){var t=e.page,r=i.createRef(),o=(0,i.useState)(!1),u=o[0],d=o[1],l=(0,i.useState)(!1),p=l[0],m=l[1],x=(0,i.useState)(!1),f=x[0],h=x[1],g=(0,i.useState)(""),b=g[0],_=g[1],y=(0,i.useState)(""),w=y[0],j=y[1],v=(0,i.useState)("{}"),N=v[0],k=v[1],C=function(e){m(!0),_(e)},S=function(e){return new Promise((function(t,r){if(e.type&&-1===e.type.indexOf("json"))return r("File is not JSON");var n=new FileReader;n.onload=function(){try{t(JSON.parse(n.result))}catch(e){return r("File is not valid JSON")}},n.readAsText(e,"utf8")}))},I=function(e){return e.scope?"workspace"===e._type&&"collection"===e.scope:"workspace"===e._type},E=function(e){return 0===e.indexOf("wrk_")},O=function(e){if(!e._type)throw"Missing _type property";if(!e.__export_format)throw"Missing __export_format property";if(!e.resources)throw"Missing resources property";if(!e.resources.length)throw"Resources is empty";if("export"!==e._type)throw'Property _type is not "export"';if(4!==e.__export_format)throw"Property __export_format is not 4";if(e.resources.find((function(e){return function(e){return e.scope&&"designer"===e.scope}(e)})))throw"File is already a design document";if(!e.resources.find((function(e){return I(e)})))throw"Missing collection element from resources array";return!0},R=function(e){var t=e.resources.findIndex((function(e){return I(e)}));return e.resources[t].scope="designer",e.resources.map((function(e){e._id&&E(e._id)&&(e._id+="0"),e._parentId&&E(e._parentId)&&(e._parentId+="0")})),e},D=function(e,t){var r=new Blob([e],{type:"application/json"}),n=window.URL.createObjectURL(r),o=document.createElement("a");o.download=t,o.href=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(n)},F=function(){var e=(0,n.Z)(s().mark((function e(t){var n,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h(!1),m(!1),d(!1),_(""),j(""),k("{}"),r.current.files.length){e.next=3;break}return e.abrupt("return",d(!0));case 3:return e.prev=3,n=r.current.files.item(0),o="design-".concat(n.name),e.next=8,S(n);case 8:if(i=e.sent,O(i)){e.next=11;break}return e.abrupt("return",C("File is not a request collection."));case 11:i=R(i),i=JSON.stringify(i),j(o),k(i),h(!0),setTimeout((function(){D(i,o)}),2e3),e.next=22;break;case 19:return e.prev=19,e.t0=e.catch(3),e.abrupt("return",C("object"===typeof e.t0?e.t0.message:e.t0));case 22:case"end":return e.stop()}}),e,null,[[3,19]])})));return function(t){return e.apply(this,arguments)}}();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.Z,{data:t.data,slug:t.uid}),(0,c.jsx)("div",{className:"w-screen bg-white px-12 py-12 lg:px-0",children:(0,c.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,c.jsxs)("div",{className:"flex flex-col",children:[(0,c.jsx)("h1",{className:"mx-auto max-w-xl font-bold text-3xl mb-6 text-center",children:"Convert Insomnia Request Collection to Design Document"}),(0,c.jsxs)("div",{className:"py-6 px-6 my-3 mx-auto md:w-1/2 border rounded shadow-lg",children:[(0,c.jsx)("p",{className:"mb-6",children:"Convert your Insomnia Request Collection into an Insomnia Design Document with this free online converter."}),(0,c.jsxs)("div",{children:[(0,c.jsx)("input",{type:"file",accept:"application/json",className:"rounded border bg-gray-50 py-3 px-3 w-full block mb-2 ".concat(u?"border-red-400":""),onChange:function(){return d(!1)},ref:r}),(0,c.jsx)("p",{className:"text-gray-500 text-xs text-center mb-6",children:'Open the name dropdown in the header, then "Import/Export > Export Data >
1 Current Workspace > Export > Done"'}),(0,c.jsx)("button",{onClick:F,className:"py-2 px-3 text-white hover:bg-green-600 border hover:border-green-600 bg-purple-600 border-purple-600 rounded",children:"Start Conversion"})]})]}),p&&(0,c.jsxs)("div",{className:"py-3 px-6 my-3 mx-auto md:w-1/2 border rounded bg-red-50 border-red-200",children:[(0,c.jsx)("h2",{className:"font-semibold text-xl mb-2",children:"Error Converting Document"}),(0,c.jsx)("p",{className:"mb-3",children:"The file you uploaded is not a valid request collection, please upload another file and try again."}),(0,c.jsxs)("details",{className:"mb-3",children:[(0,c.jsx)("summary",{children:"Error Message"}),(0,c.jsx)("pre",{className:"p-3 bg-red-50 bg-red-50 rounded",children:b})]})]}),f&&(0,c.jsxs)("div",{className:"py-3 px-6 my-3 mx-auto md:w-1/2 border rounded bg-green-50 border-green-200",children:[(0,c.jsx)("h2",{className:"font-semibold text-xl mb-2",children:"Conversion Completed."}),(0,c.jsx)("p",{className:"mb-3",children:"If the download does not start in a few seconds you can click the link below."}),(0,c.jsx)("a",{className:"cursor-pointer text-blue-600",onClick:function(){return D(N,w)},children:"Download"})]})]})})})]})}},9673:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/convert-to-design-doc",function(){return r(5366)}])},4298:function(e,t,r){e.exports=r(2189)}},function(e){e.O(0,[774,888,179],(function(){return t=9673,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.