1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9579],{39579:(e,s,a)=>{a.d(s,{A:()=>L});var i=a(26514),t=a(75834),n=a(42216),r=a.n(n),l=a(78706),o=a(49136),d=a(94554),c=a(69111),h=a(13391),x=a(71983),m=a(87546),j=a(68242),p=a(67361),g=a(85629),u=a(88930),f=a(37172),y=a(18035),b=a(50913),A=a(46225);let v=e=>(0,i.jsxs)(m.A,{variant:"success",show:e.show,children:[(0,i.jsx)("i",{className:"fa fa-key"}),"\xa0 Copy this secret now! It will not be shown again."]}),w=({items:e,allowLogin:s,refetchItems:a})=>{(0,A.useRouter)();let[n,c]=(0,t.useState)(""),[h,f]=(0,t.useState)(""),[y,w]=(0,t.useState)(null),N=e=>{w(null),r().post(`/api/api-keys/${e.name}/regenerate`).then(e=>{w(e.body)}).catch(e=>{c(e.response?.body?.message||(0,x.U)(e.response||e))})},k=e=>{w(null),r().del(`/api/api-keys/${e.name}`).then(()=>{a()}).catch(e=>{c(e.response?.body?.message||(0,x.U)(e.response||e))})};return(0,i.jsxs)(i.Fragment,{children:[y&&(0,i.jsxs)(d.A,{children:[(0,i.jsx)(d.A.Header,{children:(0,i.jsx)("h5",{children:"Regenerated credential"})}),(0,i.jsxs)(d.A.Body,{children:[(0,i.jsxs)("p",{children:["for ",(0,i.jsx)("strong",{children:y.name}),".\xa0"]}),(0,i.jsxs)(l.A,{children:[(0,i.jsx)(o.A,{className:"mt-2",children:(0,i.jsx)(b.A,{copy:y.oneTimeVisibleKeySecret})}),(0,i.jsx)(o.A,{children:(0,i.jsx)(v,{show:!0})})]})]})]}),(0,i.jsxs)(j.A,{striped:!0,responsive:!0,borderless:!0,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{style:{width:"5%"}}),(0,i.jsx)("th",{style:{width:"30%"},children:"Name"}),(0,i.jsx)("th",{style:{width:"15%"},children:s?"Password":"API Key"}),(0,i.jsx)("th",{style:{width:"15%"},children:"Created"}),(0,i.jsx)("th",{style:{width:"15%"},children:"Last Used"}),(0,i.jsx)("th",{style:{width:"10%"}})]})}),(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{style:{textAlign:"center"},children:(0,i.jsx)(p.A,{bg:"secondary",pill:!0,className:"mt-2",children:"New"})}),(0,i.jsx)("td",{children:(0,i.jsx)(g.A.Control,{autoFocus:!0,value:h,onChange:e=>{c(""),f(e.target.value)},placeholder:s?"Username or Email":"API key name"})}),(0,i.jsx)("td",{colSpan:3,style:{width:"50%"},children:(0,i.jsx)(m.A,{show:!!n,children:n})}),(0,i.jsx)("td",{style:{textAlign:"right"},children:(0,i.jsx)(u.A,{variant:"primary",onClick:()=>{c(""),r().post("/api/api-keys").send({name:h,makeUserLogin:s}).then(s=>{f(""),e.unshift(s.body)}).catch(e=>{c(e.response.body?.message||(0,x.U)(e.response||e))})},size:"sm",children:"Create"})})]}),!e?.length&&(0,i.jsx)("tr",{children:(0,i.jsx)("td",{children:(0,i.jsx)("em",{children:"Nothing has been added"})})}),e?.map((e,s)=>(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{style:{textAlign:"center"},children:s+1}),(0,i.jsx)("th",{children:e.name}),(0,i.jsxs)("td",{children:[e.oneTimeVisibleKeySecret?(0,i.jsx)(b.A,{copy:e.oneTimeVisibleKeySecret}):(0,i.jsx)("pre",{children:(0,i.jsxs)("code",{children:["**********",e.last5]})}),(0,i.jsx)(v,{show:!!e.oneTimeVisibleKeySecret})]}),(0,i.jsx)("td",{children:e.created?new Date(e.created).toLocaleDateString():"-"}),(0,i.jsx)("td",{children:e.lastUsed?new Date(e.lastUsed).toLocaleDateString():(0,i.jsx)("em",{children:"Not used"})}),(0,i.jsx)("td",{style:{textAlign:"right"},children:(0,i.jsx)(S,{u:e,regenerate:N,destroy:k,manageLink:e.allowLogin?`/v2/credentials/edit/${encodeURIComponent(e.name)}`:null})})]},e.name))]})]})]})},S=({u:e,regenerate:s,destroy:a,manageLink:t})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(f.A,{size:"sm",id:`edit-credential-${e.name}`,title:"Edit",variant:"outline-danger",children:[t&&(0,i.jsx)(y.A.Item,{href:t,children:"Manage"}),(0,i.jsxs)(y.A.Item,{onClick:()=>confirm("This will create a new secret credential and immediately invalidate the previous one. Continue?")&&s(e),children:["Regenerate ",e.allowLogin?"Password":"Key","..."]}),(0,i.jsx)(y.A.Item,{onClick:()=>confirm("This will REMOVE the credential and it will immediately stop working. Continue?")&&a(e),children:"Destroy..."})]})});var N=a(57706);let k=a(13321).Ay,C=({username:e})=>(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{children:"These user accounts may access a subset of Mailsac functionality - almost everything except managing the account, billing, and API keys or users."}),(0,i.jsxs)("p",{children:["Team Users can ",(0,i.jsx)("strong",{children:"login"})," at the User Login page:"]}),(0,i.jsx)(b.A,{copy:`${window.location.origin}/login-api-key`}),(0,i.jsx)("br",{}),(0,i.jsxs)("p",{children:["or the ",(0,i.jsx)("strong",{children:"SSO"})," login page (if you have SSO configured):"]}),(0,i.jsx)(b.A,{copy:`${window.location.origin}/v2/sso`}),(0,i.jsx)("br",{}),(0,i.jsxs)("p",{children:["In both cases they will ",(0,i.jsx)("strong",{children:"require your Account ID:"})]}),(0,i.jsx)(b.A,{copy:e}),(0,i.jsx)("br",{}),(0,i.jsxs)("p",{children:["Additional information about user logins is available in the\xa0",(0,i.jsx)("a",{href:"https://docs.mailsac.com/en/latest/help/account_management/credential_management/credential_management.html",children:"docs."})]}),(0,i.jsx)("hr",{})]}),I=()=>(0,i.jsxs)("div",{children:[(0,i.jsx)("h4",{children:"QA and Developer API"}),(0,i.jsxs)("p",{children:["API keys are designed for Quality Assurance Engineers, and for software development teams building email-based applications.",(0,i.jsx)("br",{}),"Mailsac has rich email functionality available as REST APIs, web sockets, webhooks, and more."]}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:(0,i.jsx)("a",{href:"https://docs.mailsac.com/en/latest/",target:"_blank",children:"Usage and Getting Started Guides"})}),(0,i.jsx)("li",{children:(0,i.jsx)("p",{children:(0,i.jsx)("a",{href:"/docs/api/#get-an-api-key",children:"API Specification Docs"})})})]}),(0,i.jsx)("br",{}),(0,i.jsx)("h4",{children:"Fetching Mail"}),(0,i.jsxs)("p",{children:["The security tokens below can be used to \xa0",(0,i.jsx)("a",{href:"/docs/fetch-messages-with-pop3",children:"fetch email using POP3."})]}),(0,i.jsxs)("p",{children:["In addition to this SMTP key for all email addresses on your account,\xa0",(0,i.jsx)("a",{href:"/v2/addresses",children:"each email address that you own can have a different password"}),"."]}),(0,i.jsx)("hr",{})]}),L=({allowLogin:e})=>{let{reqUser:s}=(0,h.Jd)(),[a,n]=(0,t.useState)(!1),x=(0,A.useRouter)(),{data:m,error:j}=k("/api/api-keys",e=>r().get(e).then(e=>e.body));if(j)return(0,i.jsxs)("p",{children:["Error: ",(0,i.jsx)("pre",{children:JSON.stringify(j)})]});let p=m?.[e?"loginUserKeys":"apiKeys"];return(0,i.jsxs)(l.A,{children:[(0,i.jsx)(o.A,{sm:4,md:3,children:(0,i.jsx)(N.A,{reqUser:s})}),(0,i.jsx)(o.A,{sm:8,children:(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(d.A,{children:[(0,i.jsx)(d.A.Header,{as:"h3",children:e?"Team Users":"API Keys"}),(0,i.jsxs)(d.A.Body,{children:[a?e?(0,i.jsx)(i.Fragment,{children:s?._id&&(0,i.jsx)(C,{username:s?._id})}):(0,i.jsx)(I,{}):(0,i.jsx)(l.A,{children:(0,i.jsx)(o.A,{children:(0,i.jsxs)(c.A,{onClick:()=>n(!a),className:"pull-right",children:[(0,i.jsx)("i",{className:"fa fa-info-circle"})," \xa0 About"]})})}),(0,i.jsx)(w,{allowLogin:e,items:p,refetchItems:()=>x.reload()})]})]})})})]})}},50913:(e,s,a)=>{a.d(s,{A:()=>o});var i=a(26514),t=a(54311),n=a(3985),r=a(88930),l=a(75834);let o=e=>{let[s,a]=(0,l.useState)(!1);return(0,i.jsxs)(t.A,{className:e.inline?"d-inline-flex":"",children:[(0,i.jsx)(n.A,{style:e.code?{fontFamily:'Menlo,Monaco,Consolas,"Courier New",monospace',fontSize:e.small?"0.7rem":"inherit",padding:e.small?"0.7rem":"inherit"}:{},...e.textarea?{as:"textarea",rows:6}:{},disabled:!0,value:e.display||e.copy}),s?(0,i.jsx)(r.A,{disabled:!0,variant:"outline-secondary",style:{width:"42px"},children:(0,i.jsx)("i",{className:"fa fa-check-circle"})}):(0,i.jsx)(r.A,{onClick:s=>{if(s.preventDefault(),s.stopPropagation(),navigator.clipboard.writeText)navigator.clipboard.writeText(e.copy);else{let s="text/plain",a=new Blob([e.copy],{type:s}),i=new ClipboardItem({[s]:a});navigator.clipboard.write([i])}a(!0),setTimeout(()=>a(!1),3e3)},variant:"outline-secondary",style:{width:"42px"},children:(0,i.jsx)("i",{className:"fa fa-copy"})})]})}},54311:(e,s,a)=>{a.d(s,{A:()=>x});var i=a(77569),t=a.n(i),n=a(75834),r=a(20090),l=a(41088),o=a(24276),d=a(26514);let c=n.forwardRef(({className:e,bsPrefix:s,as:a="span",...i},n)=>(s=(0,r.oU)(s,"input-group-text"),(0,d.jsx)(a,{ref:n,className:t()(e,s
1),...i})));c.displayName="InputGroupText";let h=n.forwardRef(({bsPrefix:e,size:s,hasValidation:a,className:i,as:l="div",...c},h)=>{e=(0,r.oU)(e,"input-group");let x=(0,n.useMemo)(()=>({}),[]);return(0,d.jsx)(o.A.Provider,{value:x,children:(0,d.jsx)(l,{ref:h,...c,className:t()(i,e,s&&`${e}-${s}`,a&&"has-validation")})})});h.displayName="InputGroup";let x=Object.assign(h,{Text:c,Radio:e=>(0,d.jsx)(c,{children:(0,d.jsx)(l.A,{type:"radio",...e})}),Checkbox:e=>(0,d.jsx)(c,{children:(0,d.jsx)(l.A,{type:"checkbox",...e})})})},57706:(e,s,a)=>{a.d(s,{A:()=>f});var i=a(26514),t=a(75834),n=a(42216),r=a.n(n),l=a(22091),o=a(67361),d=a(88930),c=a(87546),h=a(19239),x=a(71729),m=a(71589);let j=a(13321).Ay,p=e=>r().get(e).then(e=>e.body),g=new Set(["cookie","mailsac::free","mailsac::admin-impersonate"]),u=e=>(0,i.jsxs)(l.A.Link,{className:"list-group-item",href:e.href,children:[(0,i.jsx)("i",{className:`fa ${e.icon}`})," ",e.text,"badge"in e?(0,i.jsx)(o.A,{pill:!0,style:{position:"absolute",right:"11px",top:"6px",fontSize:"13px"},children:e.badge}):null]}),f=e=>{let[s,a]=(0,t.useState)(!1),[n,r]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),[b,A]=(0,t.useState)("mailsac.com"),{data:v,error:w}=j("/api/me",p,{skip:e.reqUser}),{data:S,error:N}=j("/api/me/stats",p,{skip:e.reqUser}),k=e.reqUser||v,C=e.stats||S,I=!!(k?.apiKeyName&&!g.has(k.apiKeyName));(0,t.useEffect)(()=>{!f&&C?.domains?.[0]&&(y(!0),A("@"+C.domains[0]))},[C?.domains]);let L=()=>{if(!n)return;let e=n.toLowerCase();if(e.includes("@"))return void window.open("/inbox/"+e,"_self");let s=(b||"@mailsac.com").trim().toLowerCase();s.startsWith("@")||(s="@"+s),window.open("/inbox/"+e+s,"_self")},U=e=>{e.key?.toLowerCase()==="enter"&&L()},T=`sidebar sidebarContent ${s?"sidebar-force-show":""}`;if(!k)return(0,i.jsx)("div",{className:T});let M=(C?.domains.map(e=>`@${e}`)||[]).concat(["@mailsac.com"]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.A,{variant:"outline-primary",className:"toggleButton",onClick:()=>a(!s),"aria-label":"Toggle sidebar",title:"Toggle sidebar",children:["Sidebar",(0,i.jsx)("i",{className:`fa ${s?"fa-chevron-left":"fa-chevron-right"}`,style:{paddingLeft:"15px"}})]}),(0,i.jsxs)("div",{className:T,children:[w||N?(0,i.jsx)(c.A,{className:"alert alert-danger",children:(0,i.jsx)("pre",{children:JSON.stringify(w||N,null,2)})}):null,(0,i.jsxs)(l.A,{className:"list-group flex-column dash-bar left-bar mailsac-sidebar-navbar",children:[(0,i.jsxs)("h4",{className:"list-group-item",children:[k._id,I?(0,i.jsx)(h.A,{placement:"right",overlay:(0,i.jsxs)(x.A,{id:"needs-id-tip-sub-account-login-indicator",children:["User: ",k.apiKeyName]}),children:(0,i.jsx)(o.A,{pill:!0,"aria-label":"Team User Login","data-balloon-pos":"right",style:{textAlign:"center",width:"45px",lineHeight:"1",backgroundColor:"rgb(119, 119, 119) !important",padding:"3px 5px"},className:"pull-right",children:(0,i.jsx)("i",{className:"fa fa-user",style:{padding:"0",margin:"0",fontSize:"14px"}})})}):null]}),(0,i.jsx)("div",{style:{margin:0,padding:0},children:(0,i.jsxs)("div",{className:"choose-inbox",children:[(0,i.jsx)("input",{className:"form-control",style:{textAlign:"right"},type:"text",value:n,placeholder:"anything",onChange:e=>r(e.target.value),onKeyDown:U,autoFocus:!0}),(0,i.jsx)("input",{className:"form-control",type:"text",style:{textAlign:"left"},list:"availableDomainsForInboxChooser",value:b,onClick:()=>{A("")},onChange:e=>A(e.target.value),onKeyDown:U}),(0,i.jsx)("datalist",{id:"availableDomainsForInboxChooser",children:M.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)("div",{className:"d-grid",children:(0,i.jsx)(d.A,{className:"btn btn-primary btn-block",onClick:L,disabled:!n||!b,children:"Check the mail!"})})]})}),(0,i.jsx)(u,{href:"/dashboard",icon:"fa-home",text:"Dashboard"}),I&&k.allowElevate?(0,i.jsx)(u,{href:"/v2/elevate",icon:"fa-level-up",text:"Elevate to Root User"}):null,(0,i.jsx)(u,{href:"/app",icon:"fa-envelope-open-o",text:(0,i.jsxs)("span",{children:["Unified Inbox\xa0",(0,i.jsx)("sup",{children:"BETA"})]})}),(0,i.jsx)(u,{href:"/inbox/starred",icon:"fa-star",text:"Starred Messages"}),(0,i.jsx)(u,{href:"/v2/addresses",icon:"fa-address-card-o",text:"Enhanced Email Addresses",badge:isNaN(C?.addresses?.length)?"-":C?.addresses?.length}),(0,i.jsx)(u,{href:"/v2/domains",icon:"fa-globe",text:"Custom Domains",badge:C&&k?[C?.domains.length,k?.privateDomain+C?.domains.length].join(" / "):"-"}),(0,i.jsx)(u,{href:"/v2/credentials",icon:"fa-key",text:"API Keys & Users"}),(0,i.jsx)(u,{href:"/v2/usage",icon:"fa-bar-chart",text:"Usage and Analytics",badge:C&&k?[(0,m.sI)(k.moAPICount),k.apiMonthlyLimit?(0,m.sI)(k.apiMonthlyLimit):"â"].join(" / "):"-"}),(0,i.jsx)(u,{href:"/email-validation",icon:"fa-check-square",text:"Email Validation"}),(0,i.jsx)(u,{href:"/v2/load-testing",icon:"fa-tachometer",text:"Load Testing"}),(0,i.jsx)(u,{href:"/v2/saml",icon:"fa-sign-in",text:"SAML/SSO"}),(0,i.jsx)(u,{href:"/v2/storage",icon:"fa-floppy-o",text:"Storage",badge:C&&k?(C.storedMessages/k.messageLimit*100).toFixed(0)+"%":"-"}),(0,i.jsx)(u,{href:"/account",icon:"fa-user-circle",text:"Account"}),I?null:(0,i.jsx)(u,{href:"/v2/billing",icon:"fa-credit-card",text:"Billing"}),k.isAdmin?(0,i.jsx)(u,{href:"/admin",icon:"fa-shield",text:"ADMIN"}):null]})]})]})}},71589:(e,s,a)=>{a.d(s,{O1:()=>i,Wr:()=>t,sI:()=>n});let i=e=>e>
11e9?(e/1e9).toLocaleString()+" B":e>1e6?(e/1e6).toLocaleString()+" M":e>1e3?(e/1e3).toLocaleString()+" K":e.toLocaleString(),t=e=>e>1e9?(e/1e9).toLocaleString()+" GB":e>1e6?(e/1e6).toLocaleString()+" MB":e>1e3?(e/1e3).toLocaleString()+" KB":e.toLocaleString(),n=e=>{let s="string"==typeof e?parseFloat(e)||0:e;if(s>1e6){let e=s/1e6,a=r(e);return Math.floor(e)+a+" M"}if(s>1e3){let e=r(s/1e6);return Math.floor(s/1e3)+e+" K"}return s+""},r=e=>{var s=e.toFixed(1).split(".")[1];return"0"==s?"":"."+s}},71983:(e,s,a)=>{a.d(s,{U:()=>i});function i(e){if("string"==typeof e)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)||"Request failed"}catch(e){return"Request failed"}}}}]);
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.