1import{T as h,r as y,o as u,d as p,b as a,w as n,a as e,e as k,f as l,t,m as M,u as r,n as b,F as S,g as C}from"./app-0028cbd5.js";import{_ as j}from"./ActionMessage-26936bb0.js";import{_ as T}from"./ActionSection-b7306a18.js";import{_ as B}from"./Checkbox-184387f5.js";import{_ as V}from"./ConfirmationModal-f626d7cd.js";import{_ as q}from"./DangerButton-2790108b.js";import{_ as O}from"./DialogModal-c782fb11.js";import{_ as D}from"./FormSection-3c640620.js";import{_ as F}from"./InputError-987e898b.js";import{_ as L}from"./InputLabel-1dbd30cd.js";import{_ as w}from"./PrimaryButton-f45e43ea.js";import{_ as $}from"./SecondaryButton-4a9bc8f7.js";import{S as x}from"./SectionBorder-98f25a98.js";import{_ as G}from"./TextInput-7c1617f5.js";import"./SectionTitle-29b231b5.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./Modal-98f458d5.js";import"./CloseIcon-15595f41.js";const N={class:"col-span-6 sm:col-span-4"},z={key:0},K={class:"mt-10 sm:mt-0"},Q={class:"space-y-6"},U={class:"break-all"},Z={class:"flex items-center ml-2"},H={key:0,class:"text-sm text-gray-400"},J=["onClick"],W={key:1},X={class:"mt-10 sm:mt-0"},Y={class:"space-y-6"},ee=e("div",{class:"bg-slate-700 p-4"},[e("code",{class:"text-white"},'headers: {"Authorization" : `Bearer ${token}`}')],-1),le=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"ping"),e("p",null,[e("strong",null,"Sandbox-Endpoint: "),l("https://staging.netracuni.com/api/ping")]),e("p",null,[e("strong",null,"Method: "),l("GET")]),e("p",null,[e("strong",null,"Response: "),l("200 Ok")])],-1),se=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"tax labels"),e("p",null,[e("strong",null,"Sandbox-Endpoint: "),l("https://staging.netracuni.com/api/tax-labels")]),e("p",null,[e("strong",null,"Method: "),l("GET")]),e("p",null,[e("strong",null,"Response: "),l("Array")])],-1),ne=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"create-invoice"),e("p",null,[e("strong",null,"Sandbox-Endpoint: "),l("https://staging.netracuni.com/api/create-invoice")]),e("p",null,[e("strong",null,"Method: "),l("POST")]),e("p",null,[e("strong",null,"Response: "),l("Object")])],-1),te=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"Create Invoice Request Data"),e("p",null,"{"),e("p",{class:"ml-4"},[e("strong",null,"externalReference:"),l(" 'A7kP9xQ2mL5Z' "),e("small",null,"- Type: string, Optional (must be unique) and the maximum allowed length is 128 characters")]),e("p",{class:"ml-4"},[e("strong",null,"paymentType:"),l(" 1 "),e("small",null,"- Type: integer, Optional")]),e("p",{class:"ml-4"},[e("strong",null,"buyerId:"),l(' "10:12345678" '),e("small",null,"- Type: string, Optional")]),e("p",{class:"ml-4"},[e("strong",null,"buyerOpt:"),l(' "20:123456" '),e("small",null,"- Type: string, just for voucher(paymentType:5)")]),e("p",{class:"ml-4"},[e("strong",null,"email:"),l(' "[email protected]" '),e("small",null,'- Type: string, Optional (must be a valid email address and available in packages that include the "Send Invoice by Email" feature)')]),e("p",{class:"ml-4"},[e("strong",null,"items: [")]),e("p",{class:"ml-8"},"{"),e("p",{class:"ml-10"},[e("strong",null,"name:"),l(" 'Item name', "),e("small",null,"- Type: string")]),e("p",{class:"ml-10"},[e("strong",null,"taxLabels:"),l(" ['A'], "),e("small",null,"- Type: array")]),e("p",{class:"ml-10"},[e("strong",null,"unit:"),l(" 'KOM', "),e("small",null,"- Type: string")]),e("p",{class:"ml-10"},[e("strong",null,"quantity:"),l(" 2, "),e("small",null,"- Type: number")]),e("p",{class:"ml-10"},[e("strong",null,"price:"),l(" 256.55, "),e("small",null,"- Type: number")]),e("p",{class:"ml-8"},"},"),e("p",{class:"ml-6"},"]"),e("p",null,"}")],-1),ae={key:2},oe={class:"mt-10 sm:mt-0"},ie={class:"space-y-6"},re={class:"text-sky-500 hover:text-sky-400 underline",href:"https://staging.netracuni.com",target:"_blank"},ue=e("div",{class:"bg-slate-700 p-4"},[e("code",{class:"text-white"},'headers: {"Authorization" : `Bearer ${token}`}')],-1),pe=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"ping"),e("p",null,[e("strong",null,"Endpoint: "),l("https://netracuni.com/api/ping")]),e("p",null,[e("strong",null,"Method: "),l("GET")]),e("p",null,[e("strong",null,"Response: "),l("200 Ok")])],-1),me=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"tax labels"),e("p",null,[e("strong",null,"Endpoint: "),l("https://netracuni.com/api/tax-labels")]),e("p",null,[e("strong",null,"Method: "),l("GET")]),e("p",null,[e("strong",null,"Response: "),l("Array")])],-1),de=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"create-invoice"),e("p",null,[e("strong",null,"Endpoint: "),l("https://netracuni.com/api/create-invoice")]),e("p",null,[e("strong",null,"Method: "),l("POST")]),e("p",null,[e("strong",null,"Response: "),l("Object")])],-1),ce=e("div",null,[e("h2",{class:"text-lg font-medium underline"},"Create Invoice Request Data"),e("p",null,"{"),e("p",{class:"ml-4"},[e("strong",null,"externalReference:"),l(" 'A7kP9xQ2mL5Z' "),e("small",null,"- Type: string, Optional (must be unique) and the maximum allowed length is 128 characters")]),e("p",{class:"ml-4"},[e("strong",null,"paymentType:"),l(" 1 "),e("small",null,"- Type: integer, Optional")]),e("p",{class:"ml-4"},[e("strong",null,"buyerId:"),l(' "10:12345678" '),e("small",null,"- Type: string, Optional")]),e("p",{class:"ml-4"},[e("strong",null,"buyerOpt:"),l(' "20:123456" '),e("small",null,"- Type: string, just for voucher(paymentType:5)")]),e("p",{class:"ml-4"},[e("strong",null,"email:"),l(' "[email protected]" '),e("small",null,'- Type: string, Optional (must be a valid email address and available in packages that include the "Send Invoice by Email" feature)')]
1),e("p",{class:"ml-4"},[e("strong",null,"items: [")]),e("p",{class:"ml-8"},"{"),e("p",{class:"ml-10"},[e("strong",null,"name:"),l(" 'Item name', "),e("small",null,"- Type: string")]),e("p",{class:"ml-10"},[e("strong",null,"taxLabels:"),l(" ['A'], "),e("small",null,"- Type: array")]),e("p",{class:"ml-10"},[e("strong",null,"unit:"),l(" 'KOM', "),e("small",null,"- Type: string")]),e("p",{class:"ml-10"},[e("strong",null,"quantity:"),l(" 2, "),e("small",null,"- Type: number")]),e("p",{class:"ml-10"},[e("strong",null,"price:"),l(" 256.55, "),e("small",null,"- Type: number")]),e("p",{class:"ml-8"},"},"),e("p",{class:"ml-6"},"]"),e("p",null,"}")],-1),_e={key:0,class:"mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 break-all"},ge={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ve={class:"flex items-center"},fe={class:"ml-2 text-sm text-gray-600"},Ve={__name:"ApiTokenManager",props:{tokens:Array,availablePermissions:Array,defaultPermissions:Array},setup(g){const m=h({name:"",permissions:g.defaultPermissions}),c=h({permissions:[]}),f=h({}),v=y(!1),_=y(null),d=y(null),E=()=>{m.post(route("api-tokens.store"),{preserveScroll:!0,onSuccess:()=>{v.value=!0,m.reset()}})},P=()=>{c.put(route("api-tokens.update",_.value),{preserveScroll:!0,preserveState:!0,onSuccess:()=>_.value=null})},I=s=>{d.value=s},R=()=>{f.delete(route("api-tokens.destroy",d.value),{preserveScroll:!0,preserveState:!0,onSuccess:()=>d.value=null})};return(s,i)=>(u(),p("div",null,[a(D,{onSubmitted:E},{title:n(()=>[l(t(s.__("api_tokens.create.title")),1)]),description:n(()=>[l(t(s.__("api_tokens.create.des")),1)]),form:n(()=>[e("div",N,[a(L,{for:"name",value:s.__("api_tokens.create.name_lbl")},null,8,["value"]),a(G,M({id:"name",modelValue:r(m).name,"onUpdate:modelValue":i[0]||(i[0]=o=>r(m).name=o),type:"text",class:"mt-1 block w-full"},{autofocus:!s.appInfo.isApp}),null,16,["modelValue"]),a(F,{message:r(m).errors.name,class:"mt-2"},null,8,["message"])])]),actions:n(()=>[a(j,{on:r(m).recentlySuccessful,class:"mr-3"},{default:n(()=>[l(t(s.__("api_tokens.created_btn")),1)]),_:1},8,["on"]),a(w,{class:b({"opacity-25":r(m).processing}),disabled:r(m).processing},{default:n(()=>[l(t(s.__("api_tokens.create_btn")),1)]),_:1},8,["class","disabled"])]),_:1}),g.tokens.length>0?(u(),p("div",z,[a(x),e("div",K,[a(T,null,{title:n(()=>[l(t(s.__("api_tokens.manage.title")),1)]),description:n(()=>[l(t(s.__("api_tokens.manage.des")),1)]),content:n(()=>[e("div",Q,[(u(!0),p(S,null,C(g.tokens,o=>(u(),p("div",{key:o.id,class:"flex items-center justify-between"},[e("div",U,t(o.name),1),e("div",Z,[o.last_used_ago?(u(),p("div",H,t(s.__("api_tokens.manage.last_used"))+" "+t(o.last_used_ago),1)):k("",!0),e("button",{class:"cursor-pointer ml-6 text-sm text-red-500",onClick:A=>I(o)},t(s.__("datagrid.delete_modal_title")),9,J)])]))),128))])]),_:1})])])):k("",!0),s.$page.props.env=="staging"?(u(),p("div",W,[a(x),e("div",X,[a(T,null,{title:n(()=>[l(t(s.__("api_tokens.sandbox_endpoints.title")),1)]),description:n(()=>[l(t(s.__("api_tokens.sandbox_endpoints.des")),1)]),content:n(()=>[e("div",Y,[e("div",null,[e("p",null,t(s.__("api_token.auth_header_des")),1)]),ee,le,se,ne,te])]),_:1})])])):(u(),p("div",ae,[a(x),e("div",oe,[a(T,null,{title:n(()=>[l(t(s.__("api_tokens.endpoints.title")),1)]),description:n(()=>[l(t(s.__("api_tokens.endpoints.des")),1)]),content:n(()=>[e("div",ie,[e("div",null,[e("p",null,t(s.__("api_token.sandbox.des")),1),e("p",null,[e("a",re,t(s.__("api_token.sandbox.register")),1)])]),e("div",null,[e("p",null,t(s.__("api_token.auth_header_des")),1)]),ue,pe,me,de,ce])]),_:1})])])),a(O,{show:v.value,onClose:i[2]||(i[2]=o=>v.value=!1)},{title:n(()=>[l(t(s.__("api_tokens.value_modal.title")),1)]),content:n(()=>[e("div",null,t(s.__("api_tokens.value_modal.des")),1),s.$page.props.jetstream.flash.token?(u(),p("div",_e,t(s.$page.props.jetstream.flash.token),1)):k("",!0)]),footer:n(()=>[a($,{onClick:i[1]||(i[1]=o=>v.value=!1)},{default:n(()=>[l(t(s.__("Close")),1)]),_:1})]),_:1},8,["show"]),a(O,{show:_.value!=null,onClose:i[5]||(i[5]=o=>_.value=null)},{title:n(()=>[l(" API Token Permissions ")]),content:n(()=>[e("div",ge,[(u(!0),p(S,null,C(g.availablePermissions,o=>(u(),p("div",{key:o},[e("label",ve,[a(B,{checked:r(c).permissions,"onUpdate:checked":i[3]||(i[3]=A=>r(c).permissions=A),value:o},null,8,["checked","value"]),e("span",fe,t(o),1)])]))),128))])]),footer:n(()=>[a($,{onClick:i[4]||(i[4]=o=>_.value=null)},{default:n(()=>[l(" Cancel ")]),_:1}),a(w,{class:b(["ml-3",{"opacity-25":r(c).processing}]),disabled:r(c).processing,onClick:P},{default:n(()=>[l(" Save ")]),_:1},8,["class","disabled"])]),_:1},8,["show"]),a(V,{show:d.value!=null,onClose:i[7]||(i[7]=o=>d.value=null)},{title:n(()=>[l(t(s.__("api_tokens.delete.title")),1)]),content:n(()=>[l(t(s.__("api_tokens.delete.des")),1)]),footer:n(()=>[a($,{onClick:i[6]||(i[6]=o=>d.value=null)},{default:n(()=>[l(t(s.__("Cancel")),1)]),_:1}),a(q,{class:b(["ml-3",{"opacity-25":r(f).processing}]),disabled:r(f).processing,onClick:R},{default:n(()=>[l(t(s.__("Delete")),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]))}};export{Ve 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.