@ai-development-environment/server 0.0.74 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
- package/standalone/.next/server/chunks/ssr/src_components_settings-page_tsx_06dxqc7._.js +1 -1
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/2jvwh8l-4r8jn.js +37 -0
- package/standalone/.next/static/chunks/3r4fi297tsw1d.js +0 -37
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_ssgManifest.js +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,534710,e=>{"use strict";var t=e.i(843476),s=e.i(551757),a=e.i(452330),n=e.i(634398),r=e.i(758925),i=e.i(825398),l=e.i(856522),o=e.i(584026),d=e.i(573474),c=e.i(594831),u=e.i(725981),m=e.i(861745),p=e.i(948148),x=e.i(271645),h=e.i(340953),g=e.i(567745),f=e.i(77071),j=e.i(929592),b=e.i(487486),v=e.i(519455),S=e.i(515288),C=e.i(793479),y=e.i(110204),N=e.i(987968),k=e.i(637611);let w=`query CredentialStoreWritability {
|
|
2
|
-
credentialStoreStatus { readOnly }
|
|
3
|
-
}`,I=null;function E(){let[e,t]=(0,x.useState)(I??!1);return(0,x.useEffect)(()=>{if(null!==I)return;let e=!1;return(0,k.controlPlaneRequest)(w).then(s=>{I=s.credentialStoreStatus.readOnly,e||t(I)}).catch(()=>{}),()=>{e=!0}},[]),e}var A=e.i(45407);function T(){let e=(0,p.useTranslations)("cacheServerSettings"),a=(0,p.useTranslations)("common"),n=(0,p.useTranslations)("credentials"),r=E(),[i,o]=(0,x.useState)(null),[u,m]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[T,D]=(0,x.useState)([]),[R,P]=(0,x.useState)(!0),[L,q]=(0,x.useState)(!1),[H,$]=(0,x.useState)(null),[K,F]=(0,x.useState)(null),B=(0,x.useCallback)(e=>{o(e),m(e.baseUrl??""),I(""),D(e.headers.map(e=>({...e,value:""})))},[]),U=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} } }`);B(e.cacheServerSettings)}catch(e){$(e instanceof Error?e.message:String(e))}finally{P(!1)}},[B]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void U(),0);return()=>window.clearTimeout(e)},[U]);let V=(e,t,s)=>D(a=>a.map((a,n)=>n===e?{...a,[t]:s,..."name"===t&&s!==a.name?{valueConfigured:!1}:{}}:a)),W=async t=>{t.preventDefault(),q(!0);try{let t=T.map(e=>({name:e.name.trim(),value:e.value||null})).filter(e=>e.name),s=await (0,k.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
|
|
4
|
-
saveCacheServerSettings(input: $input) { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
5
|
-
}`,{input:{baseUrl:u.trim(),apiKey:w||null,headers:t}});B(s.saveCacheServerSettings),$(null),F(e("saved"))}catch(e){$(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}},G=async()=>{q(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestCacheServerConnection {
|
|
6
|
-
testCacheServerConnection { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
7
|
-
}`);B(t.testCacheServerConnection),$(null),F(e("connectionSucceeded"))}catch(e){$(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}},_=async()=>{q(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearCacheServerSettings {
|
|
8
|
-
clearCacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
9
|
-
}`);B(t.clearCacheServerSettings),$(null),F(e("removed"))}catch(e){$(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}};return(0,t.jsx)("form",{onSubmit:W,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.DatabaseZap,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:i?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:i?.configured?e("configured"):e("notConfigured")})]}),R?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[H&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:H})}),K&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:K})]}),(0,t.jsx)("p",{className:"rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground",children:e("setupHelp")}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:e("baseUrl")}),(0,t.jsx)(C.Input,{autoComplete:"url",id:"cache-server-base-url",disabled:r,onChange:e=>m(e.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:u}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("baseUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:e("apiKey")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:r,id:"cache-server-api-key",onChange:e=>I(e.target.value),placeholder:i?.apiKeyConfigured?e("apiKeyPlaceholderConfigured"):e("apiKeyPlaceholder"),required:!i?.apiKeyConfigured&&!r,type:"password",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?n("readOnlyNotice"):i?.apiKeyConfigured?e("apiKeyKeepHelp"):e("apiKeyHelp")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:e("headers")}),(0,t.jsxs)(v.Button,{disabled:r,onClick:()=>D(e=>[...e,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,t.jsx)(f.Plus,{}),e("addHeader")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersHelp")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersSetupHelp")}),0===T.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("noHeaders")}):(0,t.jsx)("div",{className:"space-y-2",children:T.map((s,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Input,{"aria-label":e("headerName"),disabled:r,className:"flex-1",onChange:e=>V(a,"name",e.target.value),placeholder:e("headerName"),value:s.name}),(0,t.jsx)(C.Input,{"aria-label":e("headerValue"),autoComplete:"new-password",className:"flex-1",disabled:r,onChange:e=>V(a,"value",e.target.value),placeholder:s.valueConfigured?e("headerValuePlaceholderConfigured"):e("headerValue"),required:!s.valueConfigured&&!r,type:"password",value:s.value}),(0,t.jsx)(v.Button,{"aria-label":e("removeHeader"),disabled:r,onClick:()=>D(e=>e.filter((e,t)=>t!==a)),size:"icon",type:"button",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})]},a))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("confirmRemoveDescription"),onConfirm:_,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:L||!i?.configured||r,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:L||!i?.configured,onClick:()=>void G(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:L||r,type:"submit",children:[L?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}var D=e.i(636162),R=e.i(741120),P=e.i(482022);function L({children:e,href:s}){return(0,t.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:s,rel:"noreferrer",target:"_blank",children:[e,(0,t.jsx)(P.ExternalLink,{"aria-hidden":"true",className:"size-3 shrink-0"})]})}var q=e.i(624687),H=e.i(360583),$=e.i(938882);function K(){let e=(0,p.useTranslations)("iosDeviceSettings"),a=(0,p.useTranslations)("common"),n=(0,m.useLocale)(),i=E(),[c,g]=(0,x.useState)(null),[f,w]=(0,x.useState)(""),[I,A]=(0,x.useState)(""),[T,P]=(0,x.useState)(""),[K,F]=(0,x.useState)(""),[B,U]=(0,x.useState)(""),[V,W]=(0,x.useState)(!1),[G,_]=(0,x.useState)(!0),[O,z]=(0,x.useState)(!1),[J,M]=(0,x.useState)(!1),[Y,Z]=(0,x.useState)(null),[X,Q]=(0,x.useState)(null),ee=(0,x.useCallback)(e=>{g(e),w(e.organizationName),A(e.profileIdentifier),P(e.appStoreConnectIssuerId??""),F(e.appStoreConnectKeyId??""),U("")},[]),et=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query IosDeviceSettings {
|
|
10
|
-
iosDeviceSettings { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
11
|
-
}`);ee(e.iosDeviceSettings)}catch(e){Z(e instanceof Error?e.message:String(e))}finally{_(!1)}},[ee]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void et(),0);return()=>window.clearTimeout(e)},[et]);let es=t=>(0,H.formatDateValue)(t,"short",{locale:n,fallback:e("unavailable")}),ea=async t=>{t.preventDefault(),z(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
|
|
12
|
-
saveIosProfileSettings(input: $input) { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
13
|
-
}`,{input:{organizationName:f,profileIdentifier:I}});ee(t.saveIosProfileSettings),Z(null),Q(e("profileSaved"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{z(!1)}},en=async()=>{z(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
|
|
14
|
-
regenerateIosProfileSigner { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
15
|
-
}`);ee(t.regenerateIosProfileSigner),Z(null),Q(e("signerRegenerated"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{z(!1)}},er=async t=>{t.preventDefault(),M(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
|
|
16
|
-
saveAppStoreConnectSettings(input: $input) { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
17
|
-
}`,{input:{issuerId:T.trim(),keyId:K.trim(),privateKey:B||null}});ee(t.saveAppStoreConnectSettings),Z(null),Q(e("appleSaved"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{M(!1)}},ei=async()=>{M(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
|
|
18
|
-
testAppStoreConnectSettings { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
19
|
-
}`);ee(t.testAppStoreConnectSettings),Z(null),Q(e("appleTestSucceeded"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null),et()}finally{M(!1)}},el=async()=>{M(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
|
|
20
|
-
clearAppStoreConnectSettings { ${$.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
21
|
-
}`);ee(t.clearAppStoreConnectSettings),Z(null),Q(e("appleCleared"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{M(!1)}},eo=async t=>{if(!t.name.toLowerCase().endsWith(".p8")){Z(e("p8Invalid")),Q(null);return}try{let s=await t.text();if(!s.includes("-----BEGIN PRIVATE KEY-----")||!s.includes("-----END PRIVATE KEY-----")){Z(e("p8Invalid")),Q(null);return}U(s),Z(null),Q(e("p8Loaded",{filename:t.name}))}catch{Z(e("p8ReadError")),Q(null)}};return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.Apple,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),Y&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:Y})}),X&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:X})]}),G?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{})," ",e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{className:"space-y-4",onSubmit:ea,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-4"})," ",e("profileTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("profileDescription")})]}),(0,t.jsx)(b.Badge,{variant:"outline",children:c?.signerConfigured?e("signerReady"):e("signerNotGenerated")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-organization-name",children:e("organizationName")}),(0,t.jsx)(C.Input,{id:"ios-organization-name",maxLength:100,onChange:e=>w(e.target.value),required:!0,value:f}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileOrganizationHelp")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-profile-identifier",children:e("profileIdentifier")}),(0,t.jsx)(C.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:e=>A(e.target.value),required:!0,spellCheck:!1,value:I}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileIdentifierHelp")})]})]}),c?.signerConfigured&&(0,t.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,t.jsx)("p",{children:e("signerCreated",{date:es(c.signerCreatedAt)})}),(0,t.jsx)("p",{children:e("signerExpires",{date:es(c.signerExpiresAt)})}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:c.signerFingerprint}),(0,t.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:e("unverifiedWarning")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("regenerateSigner"),cancelLabel:a("cancel"),description:e("regenerateDescription"),onConfirm:en,title:e("regenerateTitle"),trigger:(0,t.jsxs)(v.Button,{disabled:O,type:"button",variant:"outline",children:[(0,t.jsx)(R.RefreshCw,{})," ",e("regenerateSigner")]})}),(0,t.jsxs)(v.Button,{disabled:O,type:"submit",children:[O?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveProfile")]})]})]}),(0,t.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:er,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(r.KeyRound,{className:"size-4"})," ",e("appleTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("appleDescription")})]}),(0,t.jsx)(b.Badge,{className:c?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:c?.appStoreConnectConfigured?e("verified"):e("notVerified")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("p",{className:"sm:col-span-2 text-xs text-muted-foreground",children:[e("appleSetupHelp")," ",(0,t.jsx)(L,{href:"https://appstoreconnect.apple.com/access/integrations/api",children:e("openApiKeys")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-issuer-id",children:e("issuerId")}),(0,t.jsx)(C.Input,{autoCapitalize:"none",id:"app-store-issuer-id",disabled:i,maxLength:100,onChange:e=>P(e.target.value),required:!0,spellCheck:!1,value:T})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-key-id",children:e("keyId")}),(0,t.jsx)(C.Input,{autoCapitalize:"characters",id:"app-store-key-id",disabled:i,maxLength:100,onChange:e=>F(e.target.value),required:!0,spellCheck:!1,value:K})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${V?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),W(!0)},onDragLeave:()=>W(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",W(!0)},onDrop:e=>{if(e.preventDefault(),W(!1),i)return;let t=e.dataTransfer.files.item(0);t&&eo(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"})," ",e("p8DropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"app-store-private-key",disabled:i,onChange:e=>U(e.target.value),placeholder:c?.appStoreConnectPrivateKeyConfigured?e("privateKeyConfiguredPlaceholder"):e("privateKeyPlaceholder"),required:!c?.appStoreConnectPrivateKeyConfigured&&!i,value:B}),(0,t.jsx)(C.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":e("chooseP8"),disabled:i,className:"mt-2 h-auto text-xs",onChange:e=>{let t=e.target.files?.item(0);t&&eo(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c?.appStoreConnectPrivateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),(c?.appStoreConnectLastTestedAt||c?.appStoreConnectPrivateKeyFingerprint)&&(0,t.jsx)(j.Alert,{variant:c.appStoreConnectVerificationError?"destructive":"default",children:(0,t.jsxs)(j.AlertDescription,{children:[(0,t.jsx)("p",{className:"font-medium",children:c.appStoreConnectVerificationError?e("lastTestFailed",{date:es(c.appStoreConnectLastTestedAt)}):e("lastVerified",{date:es(c.appStoreConnectVerifiedAt)})}),c.appStoreConnectVerificationError&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:c.appStoreConnectVerificationError}),c.appStoreConnectPrivateKeyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:c.appStoreConnectPrivateKeyFingerprint})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("clear"),cancelLabel:a("cancel"),description:e("clearDescription"),onConfirm:el,title:e("clearTitle"),trigger:(0,t.jsxs)(v.Button,{disabled:J||!c?.appStoreConnectPrivateKeyConfigured||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("clear")]})}),(0,t.jsxs)(v.Button,{disabled:J||!c?.appStoreConnectPrivateKeyConfigured,onClick:()=>void ei(),type:"button",variant:"outline",children:[(0,t.jsx)(R.RefreshCw,{})," ",e("retest")]}),(0,t.jsxs)(v.Button,{disabled:J||i,type:"submit",children:[J?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveAndVerify")]})]})]})]})]})})}var F=e.i(967489);let B=`
|
|
22
|
-
tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
|
|
23
|
-
tokenConfiguredAt tokenLastUsedAt tokenLastError
|
|
24
|
-
certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
|
|
25
|
-
`;function U(){let e=(0,p.useTranslations)("pushSettings"),s=(0,p.useTranslations)("common"),a=(0,p.useTranslations)("credentials"),n=E(),i=(0,m.useLocale)(),[o,c]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[A,T]=(0,x.useState)(""),[D,P]=(0,x.useState)(""),[q,$]=(0,x.useState)(""),[K,U]=(0,x.useState)("SANDBOX"),[V,W]=(0,x.useState)(""),[G,_]=(0,x.useState)(""),[O,z]=(0,x.useState)(!1),[J,M]=(0,x.useState)(null),Y=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${B} } }`);c(e.pushNotificationSettings),f(e.pushNotificationSettings.tokenTeamId??""),I(e.pushNotificationSettings.tokenKeyId??"")}catch(e){M(e instanceof Error?e.message:String(e))}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void Y(),0);return()=>window.clearTimeout(e)},[Y]);let Z=async e=>{e.preventDefault(),z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${B} } }`,{input:{teamId:g,keyId:w,privateKey:A||null}});c(e.saveApnsTokenSettings),T(""),M(null)}catch(e){M(e instanceof Error?e.message:String(e))}finally{z(!1)}},X=async e=>{e.preventDefault(),z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${B} } }`,{input:{name:D,topic:q,environment:K,p12Base64:V,passphrase:G}});c(e.addApnsCertificateCredential),P(""),$(""),W(""),_(""),M(null)}catch(e){M(e instanceof Error?e.message:String(e))}finally{z(!1)}};return(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(S.CardHeader,{children:(0,t.jsx)(S.CardTitle,{children:e("title")})}),(0,t.jsxs)(S.CardContent,{className:"space-y-6",children:[J&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:J})}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:Z,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("tokenAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tokenDescription")})]}),(0,t.jsx)(b.Badge,{variant:o?.tokenConfigured?"default":"secondary",children:o?.tokenConfigured?e("configured"):e("notConfigured")})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("tokenSetupHelp")," ",(0,t.jsx)(L,{href:"https://developer.apple.com/account/resources/authkeys/add",children:e("createTokenKey")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-team",children:e("teamId")}),(0,t.jsx)(C.Input,{disabled:n,id:"apns-team",onChange:e=>f(e.target.value),value:g})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-key",children:e("keyId")}),(0,t.jsx)(C.Input,{disabled:n,id:"apns-key",onChange:e=>I(e.target.value),value:w})]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("teamIdHelp")," ",(0,t.jsx)(L,{href:"https://developer.apple.com/account#MembershipDetailsCard",children:e("openMembership")})]}),(0,t.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-6",children:[(0,t.jsx)(u.Upload,{})," ",n?a("readOnlyNotice"):A?e("p8Ready"):o?.tokenConfigured?e("replaceP8"):e("chooseP8"),(0,t.jsx)(C.Input,{accept:".p8",className:"sr-only",disabled:n,onChange:e=>{let t=e.target.files?.[0];t&&t.text().then(T)},type:"file"})]}),o?.tokenPrivateKeyFingerprint&&(0,t.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",o.tokenPrivateKeyFingerprint]}),o?.tokenLastError&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:o.tokenLastError}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("removeTokenDescription"),onConfirm:async()=>{c((await (0,k.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${B} } }`)).clearApnsTokenSettings),f(""),I("")},title:e("removeToken"),trigger:(0,t.jsxs)(v.Button,{disabled:O||!o?.tokenConfigured||n,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:O||!g||!w||!A&&!o?.tokenConfigured||n,type:"submit",children:[O?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]}),(0,t.jsx)("div",{className:"border-t"}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:X,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("certificateAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("certificateDescription")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("certificateSetupHelp")," ",(0,t.jsx)(L,{href:"https://developer.apple.com/account/resources/certificates/add",children:e("createCertificate")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("name")}),(0,t.jsx)(C.Input,{disabled:n,onChange:e=>P(e.target.value),value:D})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("topic")}),(0,t.jsx)(C.Input,{disabled:n,onChange:e=>$(e.target.value),value:q})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("environment")}),(0,t.jsxs)(F.Select,{disabled:n,onValueChange:U,value:K,children:[(0,t.jsx)(F.SelectTrigger,{children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsxs)(F.SelectContent,{children:[(0,t.jsx)(F.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,t.jsx)(F.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-5",children:[(0,t.jsx)(r.KeyRound,{})," ",V?e("p12Ready"):e("chooseP12"),(0,t.jsx)(C.Input,{accept:".p12,.pfx",className:"sr-only",disabled:n,onChange:e=>{let t=e.target.files?.[0];t&&new Promise((e,s)=>{let a=new FileReader;a.onerror=()=>s(a.error),a.onload=()=>e(String(a.result).split(",")[1]??""),a.readAsDataURL(t)}).then(W)},type:"file"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("passphrase")}),(0,t.jsx)(C.Input,{disabled:n,onChange:e=>_(e.target.value),type:"password",value:G})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(v.Button,{disabled:O||!D||!q||!V||n,type:"submit",children:[(0,t.jsx)(l.Save,{})," ",e("addCertificate")]})})]}),o?.certificates.map(a=>(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:a.name}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[a.topic," · ",a.environment]}),(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",a.fingerprint]}),a.expiresAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("expires",{date:(0,H.formatDateValue)(a.expiresAt,"short",{locale:i,showTime:!1})})}),a.lastTestedAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("lastTested",{date:(0,H.formatDateValue)(a.lastTestedAt,"short",{locale:i})})}),a.lastError&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:a.lastError})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(v.Button,{disabled:O,onClick:()=>void(async()=>{z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${B} } }`,{id:a.id});c(e.retestApnsCertificateCredential),M(null)}catch(e){M(e instanceof Error?e.message:String(e)),await Y()}finally{z(!1)}})(),size:"sm",variant:"outline",children:[(0,t.jsx)(R.RefreshCw,{})," ",e("retest")]}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("removeCertificateDescription"),onConfirm:async()=>{await (0,k.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:a.id}),await Y()},title:e("removeCertificate"),trigger:(0,t.jsx)(v.Button,{disabled:n,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})})]})]},a.id))]})]})}var V=e.i(508734),W=e.i(799835),G=e.i(520133);let _="siteUrl email tokenConfigured cacheTtlSeconds updatedAt",O="enabled secretConfigured registered registrationId registeredUrl jql configuredAt lastReceivedAt lastOutcome lastError";function z({label:e,value:a,copyLabel:n,copiedLabel:r,help:i,mono:l=!1}){let[o,d]=(0,x.useState)(!1),c=async()=>{try{await navigator.clipboard.writeText(a),d(!0),window.setTimeout(()=>d(!1),2e3)}catch{}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Input,{className:l?"font-mono text-xs":void 0,onFocus:e=>e.target.select(),readOnly:!0,value:a}),(0,t.jsxs)(v.Button,{onClick:()=>void c(),type:"button",variant:"outline",children:[o?(0,t.jsx)(s.CheckCircle2,{}):(0,t.jsx)(V.Copy,{}),o?r:n]})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i})]})}function J(){let e=(0,p.useTranslations)("jiraSettings"),a=(0,p.useTranslations)("common"),n=(0,m.useLocale)(),i=E(),[l,o]=(0,x.useState)(null),[c,u]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[A,T]=(0,x.useState)(!1),[D,P]=(0,x.useState)(null),[q,$]=(0,x.useState)(null),K=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query { jiraWebhookSettings { ${O} } }`);o(e.jiraWebhookSettings),e.jiraWebhookSettings.registeredUrl&&f(e.jiraWebhookSettings.registeredUrl),I(e.jiraWebhookSettings.jql??"")}catch(e){P(e instanceof Error?e.message:String(e))}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{f(`${window.location.origin.replace(/\/$/,"")}/api/public/jira/webhook`),K()},0);return()=>window.clearTimeout(e)},[K]),(0,x.useEffect)(()=>{let e=(0,k.controlPlaneSubscriptions)().subscribe({query:"subscription { jiraWebhookDeliveryChanged { deliveryId } }"},{next:()=>void K(),error:()=>void 0,complete:()=>void 0});return()=>e()},[K]);let F=async(e,t,s,a)=>{T(!0);try{let n=(await (0,k.controlPlaneRequest)(e,a))[t];o(n.settings),u(n.secret),P(null),$(s)}catch(e){P(e instanceof Error?e.message:String(e)),$(null)}finally{T(!1)}},B=async()=>{T(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation { disableJiraWebhook { ${O} } }`);o(t.disableJiraWebhook),u(null),P(null),$(e("webhookDisabled"))}catch(e){P(e instanceof Error?e.message:String(e)),$(null)}finally{T(!1)}},U=l?.secretConfigured??!1,V=l?.registered??!1;return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(W.Webhook,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:e("webhookTitle")})]}),(0,t.jsx)(b.Badge,{className:U?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:V?e("webhookRegistered"):U?e("webhookConfigured"):e("webhookNotConfigured")})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("webhookDescription")}),D&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:D})}),q&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:q})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-url",children:e("webhookUrl")}),(0,t.jsx)(C.Input,{disabled:A||i,id:"jira-webhook-url",onChange:e=>f(e.target.value),value:g}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-jql",children:e("webhookJql")}),(0,t.jsx)(C.Input,{disabled:A||i,id:"jira-webhook-jql",onChange:e=>I(e.target.value),placeholder:"project in (ABC, XYZ)",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookJqlHelp")})]}),c&&!V?(0,t.jsx)(z,{copiedLabel:e("copied"),copyLabel:e("copy"),help:e("webhookSecretHelp"),label:e("webhookSecret"),mono:!0,value:c}):(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",children:e("webhookSecret")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:V?e("webhookSecretRegistered"):U?e("webhookSecretHelp"):e("webhookSecretPending")})]}),V?(0,t.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("webhookRegisteredAs",{id:l?.registrationId??"—"})}),(0,t.jsx)("p",{className:"mt-2",children:(0,t.jsx)(L,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:e("webhookDocs")})})]}):(0,t.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs",children:[(0,t.jsx)("p",{className:"mb-2 font-medium",children:e("setupTitle")}),(0,t.jsx)("p",{className:"mb-2 text-muted-foreground",children:e("manualIntro")}),(0,t.jsxs)("ol",{className:"list-decimal space-y-1 pl-4 text-muted-foreground",children:[(0,t.jsx)("li",{children:e("setupStep1")}),(0,t.jsx)("li",{children:e("setupStep2")}),(0,t.jsx)("li",{children:e("setupStep3",{events:"jira:issue_created, jira:issue_updated, jira:issue_deleted, comment_created, worklog_created, attachment_created, issuelink_created, sprint_started, sprint_closed"})}),(0,t.jsx)("li",{children:e("setupStep4",{jql:"project in (ABC, XYZ)"})})]}),(0,t.jsx)("p",{className:"mt-2",children:(0,t.jsx)(L,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:e("webhookDocs")})})]}),l?.lastReceivedAt&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("lastWebhook",{date:(0,H.formatDateValue)(l.lastReceivedAt,"short",{locale:n}),outcome:l.lastOutcome??"—"})}),l.lastError&&(0,t.jsx)("p",{className:"mt-1 text-destructive",children:l.lastError})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[U&&(0,t.jsx)(v.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,t.jsx)(G.Link,{href:"/jira-webhooks",children:e("viewDeliveries")})}),U&&(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("disableWebhook"),cancelLabel:a("cancel"),description:e("confirmDisableDescription"),onConfirm:B,title:e("confirmDisable"),trigger:(0,t.jsxs)(v.Button,{disabled:A||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("disableWebhook")]})}),U&&(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("rotateWebhook"),cancelLabel:a("cancel"),description:V?e("confirmRotateRegisteredDescription"):e("confirmRotateDescription"),onConfirm:()=>F(`mutation { rotateJiraWebhookSecret { secret settings { ${O} } } }`,"rotateJiraWebhookSecret",V?e("webhookRotatedInJira"):e("webhookRotated")),title:e("confirmRotate"),trigger:(0,t.jsxs)(v.Button,{disabled:A||i,type:"button",variant:"ghost",children:[A?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(R.RefreshCw,{}),e("rotateWebhook")]})}),!U&&(0,t.jsxs)(v.Button,{disabled:A||i,onClick:()=>void F(`mutation { enableJiraWebhook { secret settings { ${O} } } }`,"enableJiraWebhook",e("webhookEnabled")),type:"button",variant:"outline",children:[A?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(r.KeyRound,{}),e("enableWebhook")]}),(0,t.jsxs)(v.Button,{disabled:A||i||!g.trim(),onClick:()=>void F(`mutation Register($input: RegisterJiraWebhookInput!) { registerJiraWebhook(input: $input) { secret settings { ${O} } } }`,"registerJiraWebhook",V?e("webhookReregistered"):e("webhookRegisteredNotice"),{input:{url:g,jql:w.trim()||null}}),type:"button",children:[A?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(W.Webhook,{}),V?e("updateRegistration"):e("registerWebhook")]})]})]})})}function M({embedded:e=!1}={}){let a=(0,p.useTranslations)("jiraSettings"),n=(0,p.useTranslations)("common"),i=(0,p.useTranslations)("credentials"),o=E(),[u,m]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[A,T]=(0,x.useState)(""),[D,R]=(0,x.useState)(null),[P,q]=(0,x.useState)(!0),[H,$]=(0,x.useState)(!1),[K,F]=(0,x.useState)(null),[B,U]=(0,x.useState)(null),[V,W]=(0,x.useState)(!1),G=e=>{m(e),f(e.siteUrl??""),I(e.email??""),T("")},O=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query { jiraSettings { ${_} } }`);G(e.jiraSettings)}catch(e){F(e instanceof Error?e.message:String(e))}finally{q(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void O(),0);return()=>window.clearTimeout(e)},[O]);let z=async e=>{$(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${_} } }`,{input:{siteUrl:g,email:w,apiToken:A||null,resetSite:e}});G(t.saveJiraSettings),R(null),F(null),U(a("saved"))}catch(e){F(e instanceof Error?e.message:String(e)),U(null)}finally{$(!1)}},Y=async()=>{$(!0);try{let e=await (0,k.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");R(e.testJiraConnection),F(null),U(a("connectionSucceeded"))}catch(e){R(null),F(e instanceof Error?e.message:String(e)),U(null)}finally{$(!1)}},Z=async()=>{$(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation { clearJiraCredentials { ${_} } }`);G(e.clearJiraCredentials),R(null),F(null),U(a("removed"))}catch(e){F(e instanceof Error?e.message:String(e))}finally{$(!1)}};return(0,t.jsxs)("section",{className:e?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!e&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:a("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a("description")})]}),P?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),a("loading")]}):(0,t.jsx)("form",{onSubmit:e=>{(e.preventDefault(),u?.siteUrl&&u.siteUrl!==g.trim().replace(/\/$/,""))?W(!0):z(!1)},children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.KeyRound,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:a("credentials")})]}),(0,t.jsx)(b.Badge,{className:u?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:u?.tokenConfigured?a("configured"):a("notConfigured")})]}),K&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:K})}),B&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:B})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:a("siteUrl")}),(0,t.jsx)(C.Input,{autoComplete:"url",id:"jira-site-url",disabled:o,onChange:e=>f(e.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:g}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("siteUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:a("email")}),(0,t.jsx)(C.Input,{autoComplete:"username",id:"jira-email",disabled:o,onChange:e=>I(e.target.value),required:!0,type:"email",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("accountHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:a("apiToken")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:o,id:"jira-token",onChange:e=>T(e.target.value),placeholder:u?.tokenConfigured?a("tokenPlaceholderConfigured"):a("tokenPlaceholder"),required:!u?.tokenConfigured&&!o,type:"password",value:A}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o?i("readOnlyNotice"):u?.tokenConfigured?a("tokenKeepHelp"):a("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a("tokenAcquireHelp")," ",(0,t.jsx)(L,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:a("createToken")})]})]}),D&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:D.displayName}),(0,t.jsx)("p",{className:"text-muted-foreground",children:D.emailAddress??D.accountId})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:Z,title:a("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:H||!u?.tokenConfigured||o,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),a("remove")]})}),(0,t.jsxs)(v.Button,{disabled:H||!u?.tokenConfigured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),a("test")]}),(0,t.jsxs)(v.Button,{disabled:H||o,type:"submit",children:[H?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),a("save")]})]})]})})}),!P&&u?.tokenConfigured&&(0,t.jsx)(J,{}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:n("continue"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:()=>z(!0),onOpenChange:W,open:V,title:a("confirmSiteChange")})]})}var Y=e.i(468096),Z=e.i(257428);let X="tokenConfigured defaultJiraKeyRegex actionsNotificationPollIntervalSeconds cacheTtlSeconds updatedAt",Q="configured appId installationId privateKeyConfigured keyFingerprint appSlug appOwnerLogin appOwnerType accountLogin repositorySelection actionsPermission checksPermission commitStatusesPermission webhookEvents enhancedPipelineWebhooksEnabled enhancedPipelineWebhooksReady enhancedPipelineWebhooksMissing verifiedAt webhookConfigured webhookUrl webhookConfiguredAt webhookLastReceivedAt webhookLastOutcome webhookLastError updatedAt";function ee(e){if(!e?.appSlug)return null;let t=encodeURIComponent(e.appSlug);if("User"===e.appOwnerType)return`https://github.com/settings/apps/${t}`;if(!e.appOwnerLogin)return null;let s=encodeURIComponent(e.appOwnerLogin);return"Organization"===e.appOwnerType?`https://github.com/organizations/${s}/settings/apps/${t}`:"Enterprise"===e.appOwnerType?`https://github.com/enterprises/${s}/settings/apps/${t}`:null}function et({children:e,description:s,id:a,title:n}){return(0,t.jsxs)("section",{"aria-labelledby":a,className:"min-w-0 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:a,children:n}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s})]}),(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:e})]})}function es(){let e=(0,p.useTranslations)("editorSettings"),[s,n]=(0,x.useState)("CODE"),[r,i]=(0,x.useState)(!0),[o,d]=(0,x.useState)(!1),[c,u]=(0,x.useState)(null),[m,h]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{(0,k.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(e=>n(e.worktreeSettings.editorVariant)).catch(e=>h(e instanceof Error?e.message:String(e))).finally(()=>i(!1))},0);return()=>window.clearTimeout(e)},[]);let g=async()=>{d(!0);try{await (0,k.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
|
|
26
|
-
saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
|
|
27
|
-
}`,{editorVariant:s}),u(e("saved")),h(null)}catch(e){h(e instanceof Error?e.message:String(e)),u(null)}finally{d(!1)}};return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Code2,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),m&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:m})}),c&&(0,t.jsx)(j.Alert,{children:(0,t.jsx)(j.AlertDescription,{children:c})}),r?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{})," ",e("loading")]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{className:"min-w-64 flex-1 space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"editor-variant",children:e("label")}),(0,t.jsxs)(F.Select,{onValueChange:e=>n(e),value:s,children:[(0,t.jsx)(F.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsxs)(F.SelectContent,{children:[(0,t.jsx)(F.SelectItem,{value:"CODE",children:e("code")}),(0,t.jsx)(F.SelectItem,{value:"CODE_INSIDERS",children:e("insiders")}),(0,t.jsx)(F.SelectItem,{value:"NONE",children:e("none")})]})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("setupHelp")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[(0,t.jsx)(L,{href:"https://code.visualstudio.com/download",children:e("downloadCode")}),(0,t.jsx)(L,{href:"https://code.visualstudio.com/insiders/",children:e("downloadInsiders")})]})]})]}),(0,t.jsxs)(v.Button,{disabled:o,onClick:()=>void g(),children:[o?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]})})}function ea(){let e=(0,p.useTranslations)("githubAppSettings"),a=(0,p.useTranslations)("common"),n=(0,m.useLocale)(),g=E(),[f,w]=(0,x.useState)(null),[I,A]=(0,x.useState)(""),[T,D]=(0,x.useState)(""),[R,P]=(0,x.useState)(""),[$,K]=(0,x.useState)(""),[F,B]=(0,x.useState)(""),[U,V]=(0,x.useState)(!1),[W,_]=(0,x.useState)(!1),[O,z]=(0,x.useState)(!1),[J,M]=(0,x.useState)(!0),[Y,X]=(0,x.useState)(!1),[et,es]=(0,x.useState)(null),[ea,en]=(0,x.useState)(null),er=ee(f),ei=!f||(f.enhancedPipelineWebhooksMissing?.length??0)>0,el=(0,x.useCallback)(e=>{w(e),A(e.appId??""),D(e.installationId??""),P(""),B(t=>e.webhookUrl??t),V(!!e.webhookUrl),_(e.enhancedPipelineWebhooksEnabled??!1)},[]),eo=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${Q} } }`);el(e.githubAppSettings)}catch(e){es(e instanceof Error?e.message:String(e))}finally{M(!1)}},[el]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{K(window.location.origin),B(`${window.location.origin.replace(/\/$/,"")}/api/public/github/webhook`),eo()},0);return()=>window.clearTimeout(e)},[eo]);let ed=async t=>{t.preventDefault(),X(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
|
|
28
|
-
saveGitHubAppSettings(input: $input) { ${Q} }
|
|
29
|
-
}`,{input:{appId:I.trim(),installationId:T.trim(),privateKey:R||null,...U?{webhookUrl:F.trim()}:{},enhancedPipelineWebhooksEnabled:W}});el(t.saveGitHubAppSettings),es(null),en(R&&f?.configured?e("rotated"):e("saved"))}catch(e){es(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},ec=async()=>{X(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestGitHubAppConnection {
|
|
30
|
-
testGitHubAppConnection { ${Q} }
|
|
31
|
-
}`);el(t.testGitHubAppConnection),es(null),en(e("connectionSucceeded"))}catch(e){es(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},eu=async()=>{X(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
|
|
32
|
-
clearGitHubAppCredentials { ${Q} }
|
|
33
|
-
}`);el(t.clearGitHubAppCredentials),es(null),en(e("removed"))}catch(e){es(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},em=async t=>{if(!t.name.toLowerCase().endsWith(".pem")){es(e("pemFileInvalid")),en(null);return}try{let s=await t.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(s)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(s)){es(e("pemFileInvalid")),en(null);return}P(s),es(null),en(e("pemFileLoaded",{filename:t.name}))}catch{es(e("pemFileReadError")),en(null)}};return(0,t.jsx)("form",{onSubmit:ed,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:f?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.configured?e("verified"):e("notConfigured")})]}),J?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[et&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:et})}),ea&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:ea})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,t.jsx)("h3",{className:"font-medium",children:e("setupTitle")}),(0,t.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,t.jsxs)("li",{children:[e("stepRegister")," ",(0,t.jsx)(L,{href:"https://github.com/settings/apps/new",children:e("registerLink")})]}),(0,t.jsxs)("li",{children:[e("stepHomepage")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:$}),e("stepHomepageSuffix")]}),(0,t.jsx)("li",{children:e("stepPermissions")}),(0,t.jsxs)("li",{children:[e("stepWebhook")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:F}),e("stepWebhookSuffix")]}),(0,t.jsx)("li",{children:e("stepInstall")}),(0,t.jsxs)("li",{children:[e("stepInstallationId")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:"https://github.com/organizations/<Organization-name>/settings/installations/<ID>"}),e("stepInstallationIdSuffix")]}),(0,t.jsx)("li",{children:e("stepCredentials")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:e("appId")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-app-id",inputMode:"numeric",onChange:e=>A(e.target.value),placeholder:e("appIdPlaceholder"),required:!0,value:I})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:e("installationId")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-installation-id",inputMode:"numeric",onChange:e=>D(e.target.value),placeholder:e("installationIdPlaceholder"),required:!0,value:T})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-webhook-url",children:e("webhookUrl")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-app-webhook-url",onChange:e=>{B(e.target.value),V(!0)},placeholder:"https://example.com/api/public/github/webhook",required:!0,type:"url",value:F}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookUrlHelp")})]}),(0,t.jsx)("div",{className:"rounded-lg border p-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(Z.Checkbox,{checked:W,disabled:ei,id:"github-enhanced-pipeline-webhooks",onCheckedChange:e=>_(!0===e)}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{className:"font-medium",htmlFor:"github-enhanced-pipeline-webhooks",children:e("enhancedWebhooks")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("enhancedWebhooksHelp")}),er&&(0,t.jsx)("p",{className:"mt-2 text-xs",children:(0,t.jsx)(L,{href:er,children:e("openAppSettings")})}),f&&!f.enhancedPipelineWebhooksReady&&(f.enhancedPipelineWebhooksMissing?.length??0)>0&&(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-xs text-amber-700 dark:text-amber-300",children:(f.enhancedPipelineWebhooksMissing??[]).map(e=>(0,t.jsx)("li",{children:e},e))})]})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${O?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),z(!0)},onDragLeave:()=>z(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",z(!0)},onDrop:e=>{if(e.preventDefault(),z(!1),g)return;let t=e.dataTransfer.files.item(0);t&&em(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"}),e("pemDropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-40 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:g,id:"github-app-private-key",onChange:e=>P(e.target.value),placeholder:f?.privateKeyConfigured?e("privateKeyPlaceholderConfigured"):e("privateKeyPlaceholder"),required:!f?.privateKeyConfigured&&!g,value:R})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:f?.privateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),f?.configured&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(r.KeyRound,{}),(0,t.jsxs)(j.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)("p",{className:"font-medium",children:e("connectedAs",{app:f.appSlug??"—",account:f.accountLogin??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("connectionDetails",{permission:f.actionsPermission??"—",selection:f.repositorySelection??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("pipelinePermissions",{checks:f.checksPermission??"none",statuses:f.commitStatusesPermission??"none"})}),f.verifiedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastVerified",{date:(0,H.formatDateValue)(f.verifiedAt,"short",{locale:n})})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:f.webhookConfigured?e("webhookConfigured",{url:f.webhookUrl??"—"}):f.webhookUrl?e("webhookNeedsSetup"):e("webhookUnavailable")}),f.webhookLastReceivedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastWebhook",{date:(0,H.formatDateValue)(f.webhookLastReceivedAt,"short",{locale:n}),outcome:f.webhookLastOutcome??"—"})}),f.webhookLastError&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive",children:f.webhookLastError}),f.keyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:f.keyFingerprint})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[f?.webhookConfigured&&(0,t.jsx)(v.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,t.jsx)(G.Link,{href:"/webhooks",children:e("viewDeliveries")})}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("confirmRemoveDescription"),onConfirm:eu,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:Y||!f?.configured||g,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:Y||!f?.configured,onClick:()=>void ec(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:Y||g&&!f?.configured,type:"submit",children:[Y?(0,t.jsx)(N.Spinner,{}):R&&f?.configured?(0,t.jsx)(i.RotateCw,{}):(0,t.jsx)(l.Save,{}),R&&f?.configured?e("rotate"):e("save")]})]})]})]})})})}function en(){let e=(0,p.useTranslations)("githubSettings"),a=(0,p.useTranslations)("common"),r=(0,p.useTranslations)("credentials"),i=E(),[o,u]=(0,x.useState)(null),[m,g]=(0,x.useState)(""),[f,w]=(0,x.useState)(60),[I,A]=(0,x.useState)(null),[T,D]=(0,x.useState)(!0),[R,P]=(0,x.useState)(!1),[q,H]=(0,x.useState)(null),[$,K]=(0,x.useState)(null),F=e=>{u(e),g(""),w(e.actionsNotificationPollIntervalSeconds)},B=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${X} } }`);F(e.githubSettings)}catch(e){H(e instanceof Error?e.message:String(e))}finally{D(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void B(),0);return()=>window.clearTimeout(e)},[B]);let U=async t=>{t.preventDefault(),P(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
|
|
34
|
-
saveGitHubSettings(input: $input) { ${X} }
|
|
35
|
-
}`,{input:{apiToken:m||null,actionsNotificationPollIntervalSeconds:f}});F(t.saveGitHubSettings),A(null),H(null),K(e("saved"))}catch(e){H(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}},V=async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");A(t.testGitHubConnection),H(null),K(e("connectionSucceeded"))}catch(e){A(null),H(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}},W=async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearGitHubCredentials {
|
|
36
|
-
clearGitHubCredentials { ${X} }
|
|
37
|
-
}`);F(t.clearGitHubCredentials),A(null),H(null),K(e("removed"))}catch(e){H(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}};return(0,t.jsx)("form",{onSubmit:U,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.GitPullRequest,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:o?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:o?.tokenConfigured?e("configured"):e("notConfigured")})]}),T?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[q&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:q})}),$&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(s.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:$})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:e("apiToken")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:i,id:"github-token",onChange:e=>g(e.target.value),placeholder:o?.tokenConfigured?e("tokenPlaceholderConfigured"):e("tokenPlaceholder"),required:!o?.tokenConfigured&&!i,type:"password",value:m}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?r("readOnlyNotice"):o?.tokenConfigured?e("tokenKeepHelp"):e("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("tokenAcquireHelp")," ",(0,t.jsx)(L,{href:"https://github.com/settings/personal-access-tokens/new",children:e("createToken")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-actions-poll-interval",children:e("pollInterval")}),(0,t.jsx)(C.Input,{id:"github-actions-poll-interval",max:3600,min:30,onChange:e=>w(Number(e.target.value)),required:!0,type:"number",value:f}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("pollIntervalHelp")})]}),I&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:I.name??I.login}),(0,t.jsxs)("a",{className:"text-sm text-primary hover:underline",href:I.url,rel:"noreferrer",target:"_blank",children:["@",I.login]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("confirmRemoveDescription"),onConfirm:W,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:R||!o?.tokenConfigured||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:R||!o?.tokenConfigured,onClick:()=>void V(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:R,type:"submit",children:[R?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}e.s(["SettingsPage",0,function(){let e=(0,p.useTranslations)("settings");return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(Y.DatabaseEncryptionAlert,{}),(0,t.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,t.jsx)(et,{description:e("developmentGroupDescription"),id:"settings-development",title:e("developmentGroup"),children:(0,t.jsx)(es,{})}),(0,t.jsxs)(et,{description:e("appleGroupDescription"),id:"settings-apple",title:e("appleGroup"),children:[(0,t.jsx)(K,{}),(0,t.jsx)(U,{})]})]}),(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsxs)(et,{description:e("integrationsGroupDescription"),id:"settings-integrations",title:e("integrationsGroup"),children:[(0,t.jsx)(M,{embedded:!0}),(0,t.jsx)(en,{}),(0,t.jsx)(ea,{}),(0,t.jsx)(T,{})]})})]})]})},"githubAppSettingsUrl",0,ee],534710)}]);
|
/package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_ssgManifest.js
RENAMED
|
File without changes
|