@tsuga/cli 1.212.0 → 1.213.0
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/dist/cli.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -272,7 +272,7 @@ ${sr(e,"Wizard cancelled.",fx)}`,w4=(e,t,r,o,i=Hl)=>{let s=mCe(t);return[sr(r,e,
|
|
|
272
272
|
`)}function kke(e,t){let r=()=>e.reduce((o,i)=>o+i.width,0)+tX.length*(e.length-1);for(;r()>t;){let i=e.filter(s=>(s.column.priority??1)>0&&s.width>vke).sort((s,a)=>(a.column.priority??1)-(s.column.priority??1)||a.width-s.width)[0];if(!i)return;i.width-=1}}function Lke(e,t,r){let o=" ".repeat(Math.max(0,t-EM(e)));return r==="right"?`${o}${e}`:`${e}${o}`}var Mke=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function Dke(e,t){return EM(e)<=t?e:`${e.replace(rX,"").slice(0,Math.max(0,t-1))}\u2026`}function EM(e){return e.replace(rX,"").length}function Fke(e,t){let r=typeof t.value=="function"?t.value(e):zA(e,t.value);return t.format?t.format(r):iX(r)}function iX(e){if(e==null||e==="")return Sd("-");if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="string")return Mke.test(e)?$ke(e):e;if(typeof e=="number"||typeof e=="bigint")return String(e);if(Array.isArray(e)){if(e.length===0)return Sd("-");let t=e.slice(0,Nke).map(o=>iX(o)),r=e.length-t.length;return r>0?`${t.join(", ")} ${Sd(`+${r} more`)}`:t.join(", ")}return typeof e=="object"?Sd(`{${Object.keys(e).length} keys}`):Sd("-")}function $ke(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let r=jm(Es(t));return`${`${r.getFullYear()}-${YA(r.getMonth()+1)}-${YA(r.getDate())}`} ${YA(r.getHours())}:${YA(r.getMinutes())}`}function YA(e){return String(e).padStart(2,"0")}var ag=ge("common-cli/OutputFields",{defaultValue:()=>{}}),_S=ge("common-cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),TM=ge("common-cli/IsInteractive",{defaultValue:()=>!process.env.CI&&process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY}),Fe=e=>nn(e),Wo=k(function*(e,t){yield*nn(JSON.stringify(yield*Bke(e,t),null,2))}),xe=(e,t)=>Wo(e,t),Bke=k(function*(e,t){let r=t??(yield*ag);if(r===void 0||!zc(e))return e;let o=KA(e,r);return o===void 0?yield*sX(r,e,"the printed JSON",!1):o});function sX(e,t,r,o){return new sg({message:`--fields ${e.join(",")} selected nothing from ${r}. Its fields: ${SM(t,2,o).join(", ")}`,suggestions:[o?"Pick paths from the fields listed above; a path into an array names its position, as in items.0.name":"Pick paths from the fields listed above; a path through an array applies to each element","For any other shape, omit --fields and pipe the JSON to jq"]})}function SM(e,t,r){let o=Array.isArray(e)?e.find(zc):e;if(!zc(o)||Array.isArray(o))return[];let i=o;return Object.keys(i).filter(s=>i[s]!==void 0).sort().flatMap(s=>{let a=i[s],u=t<=1?[]:r&&Array.isArray(a)?SM(a[0],t-1,!0).map(p=>`0.${p}`):SM(a,t-1,r);return u.length===0?[s]:u.map(p=>`${s}.${p}`)})}var _M=k(function*(e,t){if(e.length===0){yield*jn("No results.");return}let r=t.fields??(yield*ag);if(r!==void 0&&!e.some(i=>r.some(s=>zA(i,s)!==void 0)))return yield*sX(r,e,"the table rows",!0);let o={truncate:yield*_S,width:eX()};yield*Fe(r===void 0&&t.prettyFormat!==void 0?t.prettyFormat(e,o):oX(e,nX(r??t.defaultFields),o))}),jn=e=>rf(e);function IM(e,t=r=>{process.exit(r)}){e.on("error",r=>{if(r.code==="EPIPE"){t(process.exitCode);return}throw r})}var bM=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["CURSOR_AGENT","agent"],["AGENT","agent"],["AI_AGENT","agent"]],VA=`Agent tip: If the tsuga-cli skill is not loaded, run:
|
|
273
273
|
tsuga docs get skills/tsuga-cli`;function cg(e){return bM.find(([t])=>e[t])?.[1]}var q=n.Object({success:n.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var xM="tsuga-cli";var Td="/v0/oauth",aX=f({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Td}/authorize`,method:"GET",query:n.Partial(n.Object({response_type:n.String({description:"Must be `code`"}),client_id:n.String({description:"First-party client id or CIMD document URL"}),redirect_uri:n.String({description:"Client redirect URI"}),code_challenge:n.String({description:"PKCE code challenge"}),code_challenge_method:n.String({description:"Must be `S256`"}),state:n.String({description:"Opaque client state, echoed back"}),resource:n.String({description:"RFC 8707 resource indicator"})})),response:n.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),cX=f({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Td}/token`,method:"POST",body:n.Partial(n.Object({grant_type:n.String({description:"`authorization_code` or `refresh_token`"}),code:n.String({description:"Authorization code being exchanged"}),code_verifier:n.String({description:"PKCE code verifier"}),redirect_uri:n.String({description:"Must match the redirect URI used on /authorize"}),client_id:n.String({description:"Client id, when sent by the client"}),refresh_token:n.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:n.Object({access_token:n.String(),token_type:n.Literal("Bearer"),expires_in:n.Number({description:"Access token lifetime in seconds"}),refresh_token:n.String()})}),S$t=f({description:"Resolve a signed authorization request handle for the consent page",url:`${Td}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),T$t=f({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Td}/approve`,method:"POST",body:n.Object({handle:n.String({description:"The signed authorization request handle"}),approve:n.Boolean()}),response:n.Object({redirectTo:n.String({description:"The client's redirect URI carrying either the code or the denial"})})}),_$t=f({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Td}/introspect`,method:"POST",body:n.Object({token:n.String()}),response:n.Object({active:n.Boolean(),userId:n.Optional(n.String()),orgId:n.Optional(n.String())})}),Gke=["pending","active","revoked"],jke=n.Object({id:n.String(),createdAt:N(),clientId:n.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:n.String({description:"Display name derived from the client identity"}),userId:n.String(),status:n.Enum(Gke),lastUsedAt:n.Optional(N())}),I$t=f({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Td}/grants`,method:"GET",query:n.Object({allUsers:n.Optional(n.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:n.Array(jke)}),b$t=f({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Td}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:q});function uX(e,t,r){let o=new URL(aX.url,t);return o.search=new URLSearchParams({response_type:"code",client_id:e,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),o.href}var qke=dn({access_token:bt(Se),refresh_token:bt(Se),expires_in:bt(Dc),error:bt(Se),error_description:bt(Se)}),Hke=jo(qke),pX=k(function*(e){let t=yield*Jl,r=v("oauth.token")(function*(o,i){let s=yield*t.post(new URL(cX.url,o).href,{headers:{Accept:"application/json"},body:wk(i,"application/x-www-form-urlencoded")}).pipe(tt(p=>new Ua({message:`OAuth token request failed (${p.message})`,cause:p}))),a=yield*s.json.pipe(G(Hke),di(()=>({})));if(s.status!==200){let p=a.error??`HTTP ${s.status}`;return yield*new tg({message:`OAuth token request failed (${p}${a.error_description?`: ${a.error_description}`:""})`,code:p})}if(!a.access_token||!a.refresh_token||a.expires_in===void 0)return yield*new rg({message:"OAuth token response was missing required fields"});let u=yield*Wn;return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresAt:jm(Es(u+a.expires_in*gd))}});return{exchangeCode:v("oauth.exchangeCode")(function*(o,i){return yield*r(o,{grant_type:"authorization_code",client_id:e,code:i.code,code_verifier:i.verifier,redirect_uri:i.redirectUri})}),refreshTokens:v("oauth.refreshTokens")(function*(o,i){return yield*r(o,{grant_type:"refresh_token",client_id:e,refresh_token:i})})}});function lX(e,t){return uX(xM,e,t)}var Op=class extends Xe()("cli/OAuth",{make:pX(xM)}){static layer=Fo(this,this.make)};var dX=require("node:fs");var WA=k(function*(e,t={}){let r=yield*aa;return k(function*(o,i){let s=yield*zi(e,o,{...t.env===void 0?{}:{env:t.env},...i===void 0?{}:{stdin:{stream:bH(new TextEncoder().encode(i))}}}),{stdout:a,stderr:u,status:p}=yield*pi({stdout:s.stdout.pipe(Ul,wl),stderr:s.stderr.pipe(Ul,wl),status:s.exitCode},{concurrency:"unbounded"});return{status:Number(p),stdout:a,stderr:u}},uo,Gi(aa,r),di(()=>({status:1,stdout:"",stderr:`${e} did not run`})))});var mX="/usr/bin/security",Kke=44;function zke(e){return e===0||e===Kke}function OM(){return process.platform==="darwin"&&AM(mX)}function AM(e){try{return(0,dX.lstatSync)(e).isFile()}catch{return!1}}function Yke(e,t){return["find-generic-password","-s",e,"-a",t,"-w"]}function Vke(e,t){return["delete-generic-password","-s",e,"-a",t]}function Wke(e,t,r){let o=Buffer.from(r,"utf-8").toString("hex");return`add-generic-password -U -s ${e} -a ${t} -X ${o}
|
|
274
274
|
`}var fX=k(function*(e){let t=yield*WA(mX,{env:{}}),r=k(function*(o){if(!OM())return;let{status:i,stdout:s}=yield*t(Yke(e,o));return i===0&&s.trim()||void 0});return{location:"the macOS Keychain",read:r,save:v("keychain.save")(function*(o,i){return OM()?(yield*t(["-i"],Wke(e,o,i))).status===0:!1}),remove:v("keychain.remove")(function*(o){if(!OM())return!0;let{status:i}=yield*t(Vke(e,o));return zke(i)?(yield*r(o))===void 0:!1})}});var es=e=>aE(e).pipe(Kl(t=>t.trim()||void 0),T0(void 0));var gX="/usr/bin/secret-tool",Qke=of({DBUS_SESSION_BUS_ADDRESS:es("DBUS_SESSION_BUS_ADDRESS"),XDG_RUNTIME_DIR:es("XDG_RUNTIME_DIR")}).pipe(Kl(e=>Object.fromEntries(Object.entries(e).flatMap(([t,r])=>r===void 0?[]:[[t,r]]))));function Zke(e){return["lookup","service",e.service,"account",e.account]}function Xke(e,t){return["store","--label",t,"service",e.service,"account",e.account]}function Jke(e){return["clear","service",e.service,"account",e.account]}function eLe(e){return["search","--all","service",e.service,"account",e.account]}function tLe(e){return e.status===0&&e.stdout.trim()===""}function CM(){return process.platform==="linux"&&AM(gX)}var hX=k(function*({service:e,label:t}){let r=yield*Qke.pipe(di(()=>({}))),o=yield*WA(gX,{env:r});return{location:"the login keyring",read:k(function*(s){if(!CM())return;let{status:a,stdout:u}=yield*o(Zke({service:e,account:s}));return a===0&&u.trim()||void 0}),save:v("secretTool.save")(function*(s,a){return CM()?(yield*o(Xke({service:e,account:s},t),a)).status===0:!1}),remove:v("secretTool.remove")(function*(s){return CM()?(yield*o(Jke({service:e,account:s})),tLe(yield*o(eLe({service:e,account:s})))):!0})}});var yX=require("node:os");var At=class extends Je("RequestBodyError"){},qn=class extends Je("LocalFileError"){},_d=class extends Je("InvalidLink"){},IS=class extends Je("SessionCorrupted"){},rLe=[Ps,ng,og,Ed,sg,_d,ig,qn,Yc,bp,xp,tg,At,rg,IS,yd,Ua,Vc],Ar={success:0,failure:1,usage:2,auth:3,api:4,network:5,localState:6},nLe={ApiError:Ar.api,ConfigCorrupted:Ar.localState,ConfigUnreadable:Ar.localState,ExternalCommandError:Ar.failure,FieldsNotFound:Ar.usage,InvalidLink:Ar.usage,KeychainUnwritable:Ar.localState,LocalFileError:Ar.localState,LoginFailed:Ar.auth,NoCredentials:Ar.auth,NonJsonResponse:Ar.network,OAuthTokenError:Ar.auth,RequestBodyError:Ar.usage,ResponseDecodeError:Ar.network,SessionCorrupted:Ar.auth,SessionExpired:Ar.auth,TransportError:Ar.network,UntrustedApiUrl:Ar.usage};function QA(e){return nLe[e._tag]}function ZA(e){return 128+yX.constants.signals[e??"SIGINT"]}function XA(e){return rLe.some(t=>e instanceof t)}function JA(e){return dE(e)&&e._tag==="ShowHelp"}var eC=["Sign in with your browser: tsuga auth login","Save an operation API key: tsuga auth operation-key <OPERATION_API_KEY>"];function EX(e){let t=[`Error: ${e.message}`];return e._tag==="ApiError"&&(e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`)),e.suggestions&&e.suggestions.length>0&&t.push("","Suggestions:",...e.suggestions.map(r=>` - ${r}`)),t.join(`
|
|
275
|
-
`)}var tC=dn({accessToken:lx,accessExpiresAt:lx,refreshToken:bt(Se)}),oLe=jo(Yi(tC)),SX=e=>oLe(e.trim()).pipe(tt(()=>new IS({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),iLe=5*hd;function RM(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+iLe}function TX(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var _X="tsuga-cli",sLe="Tsuga CLI session",ug=class extends Xe()("SecretStore",{make:mt(function*(){let t=process.platform==="linux"?yield*hX({service:_X,label:sLe}):yield*fX(_X);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*SX(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Fo(this,this.make)};var hn=class e extends Xe()("common-cli/OutputFormatter"){static layer=mc(e)(IX("rows"));static pageLayer=mc(e)(IX("page"))};function IX(e){return{rows:(t,r)=>mt(function*(){if(r.pretty??(yield*_S)){if(e==="rows")return yield*_M(t,r);let o=(r.fields??(yield*ag))?.map(i=>i.replace(/^data\./,""));return yield*_M(t,{...r,fields:o})}yield*e==="page"?xe({data:t,metadata:r.metadata},r.fields):Wo(t,r.fields)})}}var wa=class extends Xe()("GlobalFlags"){},bX=ge("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var xX="__tsuga_cluster_id__",aLe=n.Object({}),cLe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function pg(e=aLe){let t=F("status",[n.Object({...e.properties,status:n.Literal("ok")}),cLe]);return Object.assign(NO(yi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var uLe=5,Wc=n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:uLe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var OX=n.Object({type:n.Literal("number"),number:n.String()}),pLe=n.Object({type:n.Literal("string"),string:n.String()}),lLe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),bS=F("type",[OX,pLe,lLe]),dLe=n.Object({by:n.Record(n.String(),bS),computed:n.Record(n.String(),OX)}),mLe=n.Object({type:n.Literal("buckets"),buckets:n.Array(dLe),clusterResponses:n.Optional(pg())}),fLe=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),lg=F("type",[mLe,fLe]);var PM=["all","owning-team-and-public","owning-team-only"],Us=n.Enum(PM,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var CX=1456444800,RX=4927737600,gLe=CX*1e3,hLe=RX*1e3,rC=1704067200,nC=rC+3600,PX=rC*1e3,UX=nC*1e3,wX={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:rC,to:nC}]},yLe={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:PX,to:UX}]},Id=(e,t=rC)=>n.Integer({description:e,examples:[t],minimum:CX,maximum:RX,format:"int64"}),AX=(e,t=PX)=>n.Integer({description:e,examples:[t],minimum:gLe,maximum:hLe,format:"int64"}),Cr=n.Object({from:n.Optional(Id("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Id("End of the query window as a Unix timestamp in seconds",nC))},wX),on=n.Object({from:Id("Start of the query window as a Unix timestamp in seconds"),to:Id("End of the query window as a Unix timestamp in seconds",nC)},wX),No=n.Object({from:AX("Start of the query window as a Unix timestamp in milliseconds"),to:AX("End of the query window as a Unix timestamp in milliseconds",UX)},yLe);var Qc="/v0/logs";var oC=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var xS=0,UM=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(oC,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[xX]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),NX=100,ELe="timestamp",Ap=n.Partial(n.Object({...Cr.properties,query:l({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:xS,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:xS}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${xS} for every cluster.`}),clusterId:l({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Wc,sortBy:l({allowEmpty:!1,default:ELe,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:me,useCanopy:n.Boolean()})),g1t=f({tags:["logs"],url:`${Qc}/count`,method:"GET",query:n.Pick(Ap,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(pg())})}),OS=n.Object({value:n.String(),priority:n.Number()}),h1t=f({tags:["logs"],url:`${Qc}/search`,method:"GET",query:Ap,response:n.Object({logs:n.Optional(n.Array(UM)),attributesToHighlight:n.Optional(n.Array(OS)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(pg(n.Object({nextStartOffset:n.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),SLe=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),kX=n.Object({id:n.String(),pattern:n.Array(SLe),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),wM=n.Object({...Cr.properties,query:l({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(l({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),y1t=f({tags:["logs"],url:`${Qc}/patterns`,method:"GET",query:wM,response:n.Object({patterns:n.Array(kX),sampleSize:n.Number()})}),LX=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(oC)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),E1t=f({tags:["logs"],url:`${Qc}/patterns/clusters`,method:"GET",query:wM,response:n.Object({clusters:n.Array(LX),totalVolume:n.Integer()})}),TLe=50,S1t=f({tags:["logs"],url:`${Qc}/patterns/details`,method:"POST",body:n.Object({...wM.properties,clusters:n.Array(LX,{maxItems:TLe})}),response:n.Object({patterns:n.Array(kX),sampleSize:n.Number()})}),T1t=f({tags:["logs"],url:`${Qc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Wc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(l({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(pg())})});var MX="timestamp";var vX=`${MX}_iso`;var _Le=["pending","running","completed","incomplete","failed"],DX=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(_Le,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),_1t=f({tags:["logs"],url:`${Qc}/exports`,method:"POST",body:n.Object({...n.Pick(Ap,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(l({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${MX}\` also writes a \`${vX}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:ld,description:`IANA timezone the \`${vX}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...DX.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),I1t=f({tags:["logs"],url:`${Qc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:DX}),b1t=f({tags:["logs"],url:`${Qc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:l({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Zc="/v0/metrics",ILe=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(oC)},{additionalProperties:!0}),U1t=f({tags:["metrics"],url:`${Zc}/count`,method:"GET",query:n.Pick(Ap,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),w1t=f({tags:["metrics"],url:`${Zc}/search`,method:"GET",query:Ap,response:n.Object({logs:n.Optional(n.Array(ILe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(OS))},{additionalProperties:!0})}),iC=n.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),sC=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),vM=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],FX=n.Enum(vM,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),$X=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),BX=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),aC=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),bLe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),xLe=n.Object({capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(sC),type:n.Optional(iC),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional($X),teams:n.Optional(BX),seriesCardinality:n.Optional(aC),attributeCardinalities:n.Optional(bLe)}),v1t=f({url:`${Zc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:l({allowEmpty:!1}),kind:n.Optional(FX),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:xLe}),N1t=f({tags:["metrics"],url:Zc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),GX=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:FX,type:iC,temporality:n.Optional(sC),lastSeen:n.Optional($X),teams:n.Optional(BX),seriesCardinality:n.Optional(aC)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),OLe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(GX,{examples:[OLe]});var k1t=f({tags:["metrics"],url:`${Zc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:GX}),AS=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),ALe=["service","env","host","method","status_code"];Object.assign(AS,{examples:[ALe]});var L1t=f({tags:["metrics"],url:`${Zc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:l({allowEmpty:!1}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:AS}),M1t=f({tags:["metrics"],url:`${Zc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(l({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:AS}),NM=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),D1t=f({tags:["metrics"],url:`${Zc}/assets-usage`,method:"GET",query:n.Object({metricName:l({allowEmpty:!1})}),response:NM}),F1t=f({url:`${Zc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:l(),clusterId:n.Optional(l({allowEmpty:!1}))}),response:n.Array(n.String())});var PLe="/v0/aggregation",ULe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),RS=n.Object({parallelism:n.Number(),engine:ULe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),kM=["logs","metrics","traces"];var HX={logs:"Logs",metrics:"Metrics",traces:"Spans"},wLe=[...kM,"connections","log-patterns","spans","rum"];var Q1t={...HX,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},va=[...kM,"rum"];var Z1t={...HX,rum:"RUM events"};var X1t=n.Enum(wLe,{description:"Data source being queried"}),J1t=n.Enum(kM,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Ii=n.Enum(va,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),bd=n.String({description:"Attribute containing the values to aggregate"}),dg=l({description:"Attribute containing the values to aggregate"}),vLe=F("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(bd)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:bd},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:bd},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:bd},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:bd},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:bd},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:bd,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),NLe=F("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(l({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:dg},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:dg},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:dg},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:dg},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:dg},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:dg,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),KX=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),zX=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),YX=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),VX=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),WX=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),QX=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),ZX=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),XX=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),JX=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),kLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),LLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),MLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),DLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),FLe=F("type",[KX,zX,YX,VX,WX,kLe,QX,ZX,XX,MLe,JX],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),$Le=F("type",[KX,zX,YX,VX,WX,LLe,QX,ZX,XX,DLe,JX],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var jX=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),BLe=["linear","log"],CS=n.Enum(BLe,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),GLe=1e3,qX=n.Integer({minimum:1,maximum:GLe}),cC={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},jLe=F("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...cC,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(l()),bucketCount:n.Optional(qX),bounds:n.Optional(jX),boundsScale:n.Optional(CS),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...cC,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(l()),bucketCount:n.Optional(qX),bounds:n.Optional(jX),boundsScale:n.Optional(CS)},{title:"Heatmap",description:"Returns a distribution per time window"})]),uC=15,eBt=128*1024,qLe=["zero","null"],HLe=n.Enum(qLe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),eJ=n.Object({mode:n.Object({type:HLe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),KLe=["avg","sum","min","max","last"],tJ=n.Enum(KLe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var rJ=n.Enum(vM,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),nJ={aggregate:vLe,functions:n.Optional(n.Array(FLe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(eJ),timeAggregate:n.Optional(tJ),metricKind:n.Optional(rJ)},oJ={aggregate:NLe,functions:n.Optional(n.Array($Le,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(eJ),timeAggregate:n.Optional(tJ),metricKind:n.Optional(rJ)},zLe={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},iJ={minItems:1,maxItems:uC,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},sJ=n.Array(n.Object({...nJ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),zLe),PS=n.Array(n.Object({...oJ,filter:n.Optional(l({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),iJ),US=n.Array(n.Object({...nJ,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),pC=n.Array(n.Object({...oJ,filter:l({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...iJ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),aJ=n.Array(n.Omit(pC.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:uC,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var lC=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),xd=l({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),YLe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),VLe=n.Object({fields:n.Array(l(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(l({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),cJ=7;var mg=n.Array(YLe,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),Xc=n.Array(VLe,{maxItems:cJ,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var tBt=f({tags:["aggregation"],url:`${PLe}/multi-query`,method:"POST",body:n.Object({timeRange:No,queries:PS,groupBy:n.Optional(Xc),returnType:jLe,dataSource:Ii,formula:xd,executionOptions:RS,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(l({allowEmpty:!1})),clusterIds:n.Optional(Wc),viewAs:n.Optional(n.Object({owner:l({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Us}))}),response:lg});var uJ=`/${"v1"}/aggregation`,pJ=`/${"v2"}/aggregation`,lJ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),dJ=n.Object({results:n.Array(n.Object({...lJ.properties,value:n.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),WLe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(dJ,{examples:[WLe]});var dC=n.Object({series:n.Array(n.Object({...lJ.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),QLe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(dC,{examples:[QLe]});var mJ=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),fJ="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",gJ=n.Object({results:n.Array(n.Object({group:mJ,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${fJ}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),ZLe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(gJ,{examples:[ZLe]});var mC=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:mJ,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${fJ}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),XLe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(mC,{examples:[XLe]});var JLe=n.Omit(PS.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),eMe=n.Optional(Xc),hJ={timeRange:on,queries:n.Array(JLe,{maxItems:uC,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:eMe,dataSource:Ii},yJ={...hJ,formula:n.Optional(xd)},EJ={...hJ,timeRange:No,formulas:n.Optional(n.Array(l({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},ts=n.Object({clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),SJ=n.Object(yJ,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),tMe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(SJ,{examples:[tMe]});var TJ=n.Object(EJ,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),_J={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(TJ,{examples:[_J]});var fC=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${uJ}/multi-query/scalar`,method:"POST",body:SJ,query:ts,response:dJ}),uBt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${pJ}/multi-query/scalar`,method:"POST",body:TJ,query:ts,response:gJ}),IJ=n.String({...cC,maxLength:Ti,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),bJ=n.Object({...yJ,aggregationWindow:IJ},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),rMe={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(bJ,{examples:[rMe]});var xJ=n.Object({...EJ,aggregationWindow:IJ},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),nMe={..._J,aggregationWindow:"1m"};Object.assign(xJ,{examples:[nMe]});var gC=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${uJ}/multi-query/timeseries`,method:"POST",body:bJ,query:ts,response:dC}),pBt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${pJ}/multi-query/timeseries`,method:"POST",body:xJ,query:ts,response:mC});var oMe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],OJ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,p=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),m=oMe.find(g=>g===r.method);return p===void 0||m===void 0?yield*new Ps({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Jx(m)(sZ(`${e}${p}`,u),{headers:{Accept:"application/json","User-Agent":iMe(t),[OA]:t,[eM]:"1.212.0",[tM]:"752bcf34c8",[rM]:"2026-11-16T16:21:02.247Z",...i},...s?{body:Uk(s)}:{}})});function iMe(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.212.0 (${process.platform}; node ${process.versions.node})`}var sMe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],aMe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],MM=["log","metric","trace","rum"],DM=[...aMe,...MM],cMe=[...sMe,...DM];var fg=["admin","public_editor","public_viewer","teams_only"],AJ=[...fg,"custom"],rs=["admin","editor","viewer"];var Od="/v0/team-membership",FM="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",wS=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum(rs,{description:FM})}),yC=n.Object({userId:l({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:l({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum(rs,{description:FM})}),$M=n.Object({userId:l({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:l({allowEmpty:!1,description:"Team ID to remove the user from."})}),uMe=n.Optional(n.Object({userId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),_Bt=f({tags:["access-control"],url:Od,method:"GET",query:uMe,response:n.Array(wS)}),IBt=f({tags:["access-control"],url:Od,method:"POST",body:yC,response:wS}),bBt=f({tags:["access-control"],url:Od,method:"PUT",body:yC,response:wS}),xBt=f({tags:["access-control"],url:Od,method:"DELETE",body:$M,response:q}),hC=500,EC=n.Object({teamId:l({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(l({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(l({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(rs,{description:FM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:hC,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),pMe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(EC,{examples:[pMe]});var SC=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),lMe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(SC,{examples:[lMe]});var OBt=f({tags:["access-control"],url:`${Od}/bulk-add`,method:"POST",body:EC,response:SC}),ABt=f({tags:["access-control"],url:`${Od}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:hC}),teamId:l({allowEmpty:!1}),role:n.Enum(rs)}),response:n.Object({})}),TC=n.Object({teamId:l({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:hC,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(l({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:hC,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),dMe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(TC,{examples:[dMe]});var _C=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),mMe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(_C,{examples:[mMe]});var CBt=f({tags:["access-control"],url:`${Od}/bulk-remove`,method:"DELETE",body:TC,response:_C});var fMe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},gMe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},hMe={user:fMe,team:gMe};function BM(e){return CJ(e,"team")}function GM(e){return CJ(e,"user")}function CJ(e,t){let r=[],o=hMe[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var yMe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:GM("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:GM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:GM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},NBt=Object.values(yMe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),kBt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:BM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:BM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:BM("viewer"),roleKey:"viewer"}};var LBt=new Set(DM);var EMe={documentation:void 0,logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},SMe=Object.entries(EMe),MBt=new Map(SMe.flatMap(([e,t])=>t?[[t,e]]:[]));var GBt=[Wf,_p,_p.replace(`${pe}.`,"")];var jM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],qM=["light","dark"];var TMe={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},RJ=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var YBt=TMe.light.red.background;var PJ=12,UJ=2,wJ=2;var vJ=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
275
|
+
`)}var tC=dn({accessToken:lx,accessExpiresAt:lx,refreshToken:bt(Se)}),oLe=jo(Yi(tC)),SX=e=>oLe(e.trim()).pipe(tt(()=>new IS({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),iLe=5*hd;function RM(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+iLe}function TX(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var _X="tsuga-cli",sLe="Tsuga CLI session",ug=class extends Xe()("SecretStore",{make:mt(function*(){let t=process.platform==="linux"?yield*hX({service:_X,label:sLe}):yield*fX(_X);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*SX(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Fo(this,this.make)};var hn=class e extends Xe()("common-cli/OutputFormatter"){static layer=mc(e)(IX("rows"));static pageLayer=mc(e)(IX("page"))};function IX(e){return{rows:(t,r)=>mt(function*(){if(r.pretty??(yield*_S)){if(e==="rows")return yield*_M(t,r);let o=(r.fields??(yield*ag))?.map(i=>i.replace(/^data\./,""));return yield*_M(t,{...r,fields:o})}yield*e==="page"?xe({data:t,metadata:r.metadata},r.fields):Wo(t,r.fields)})}}var wa=class extends Xe()("GlobalFlags"){},bX=ge("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var xX="__tsuga_cluster_id__",aLe=n.Object({}),cLe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function pg(e=aLe){let t=F("status",[n.Object({...e.properties,status:n.Literal("ok")}),cLe]);return Object.assign(NO(yi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var uLe=5,Wc=n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:uLe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var OX=n.Object({type:n.Literal("number"),number:n.String()}),pLe=n.Object({type:n.Literal("string"),string:n.String()}),lLe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),bS=F("type",[OX,pLe,lLe]),dLe=n.Object({by:n.Record(n.String(),bS),computed:n.Record(n.String(),OX)}),mLe=n.Object({type:n.Literal("buckets"),buckets:n.Array(dLe),clusterResponses:n.Optional(pg())}),fLe=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),lg=F("type",[mLe,fLe]);var PM=["all","owning-team-and-public","owning-team-only"],Us=n.Enum(PM,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var CX=1456444800,RX=4927737600,gLe=CX*1e3,hLe=RX*1e3,rC=1704067200,nC=rC+3600,PX=rC*1e3,UX=nC*1e3,wX={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:rC,to:nC}]},yLe={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:PX,to:UX}]},Id=(e,t=rC)=>n.Integer({description:e,examples:[t],minimum:CX,maximum:RX,format:"int64"}),AX=(e,t=PX)=>n.Integer({description:e,examples:[t],minimum:gLe,maximum:hLe,format:"int64"}),Cr=n.Object({from:n.Optional(Id("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Id("End of the query window as a Unix timestamp in seconds",nC))},wX),on=n.Object({from:Id("Start of the query window as a Unix timestamp in seconds"),to:Id("End of the query window as a Unix timestamp in seconds",nC)},wX),No=n.Object({from:AX("Start of the query window as a Unix timestamp in milliseconds"),to:AX("End of the query window as a Unix timestamp in milliseconds",UX)},yLe);var Qc="/v0/logs";var oC=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var xS=0,UM=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(oC,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[xX]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),NX=100,ELe="timestamp",Ap=n.Partial(n.Object({...Cr.properties,query:l({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:xS,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:xS}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${xS} for every cluster.`}),clusterId:l({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Wc,sortBy:l({allowEmpty:!1,default:ELe,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:me,useCanopy:n.Boolean()})),g1t=f({tags:["logs"],url:`${Qc}/count`,method:"GET",query:n.Pick(Ap,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(pg())})}),OS=n.Object({value:n.String(),priority:n.Number()}),h1t=f({tags:["logs"],url:`${Qc}/search`,method:"GET",query:Ap,response:n.Object({logs:n.Optional(n.Array(UM)),attributesToHighlight:n.Optional(n.Array(OS)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(pg(n.Object({nextStartOffset:n.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),SLe=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),kX=n.Object({id:n.String(),pattern:n.Array(SLe),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),wM=n.Object({...Cr.properties,query:l({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(l({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),y1t=f({tags:["logs"],url:`${Qc}/patterns`,method:"GET",query:wM,response:n.Object({patterns:n.Array(kX),sampleSize:n.Number()})}),LX=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(oC)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),E1t=f({tags:["logs"],url:`${Qc}/patterns/clusters`,method:"GET",query:wM,response:n.Object({clusters:n.Array(LX),totalVolume:n.Integer()})}),TLe=50,S1t=f({tags:["logs"],url:`${Qc}/patterns/details`,method:"POST",body:n.Object({...wM.properties,clusters:n.Array(LX,{maxItems:TLe})}),response:n.Object({patterns:n.Array(kX),sampleSize:n.Number()})}),T1t=f({tags:["logs"],url:`${Qc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Wc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(l({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(pg())})});var MX="timestamp";var vX=`${MX}_iso`;var _Le=["pending","running","completed","incomplete","failed"],DX=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(_Le,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),_1t=f({tags:["logs"],url:`${Qc}/exports`,method:"POST",body:n.Object({...n.Pick(Ap,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(l({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${MX}\` also writes a \`${vX}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:ld,description:`IANA timezone the \`${vX}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...DX.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),I1t=f({tags:["logs"],url:`${Qc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:DX}),b1t=f({tags:["logs"],url:`${Qc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:l({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Zc="/v0/metrics",ILe=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(oC)},{additionalProperties:!0}),U1t=f({tags:["metrics"],url:`${Zc}/count`,method:"GET",query:n.Pick(Ap,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),w1t=f({tags:["metrics"],url:`${Zc}/search`,method:"GET",query:Ap,response:n.Object({logs:n.Optional(n.Array(ILe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(OS))},{additionalProperties:!0})}),iC=n.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),sC=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),vM=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],FX=n.Enum(vM,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),$X=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),BX=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),aC=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),bLe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),xLe=n.Object({capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(sC),type:n.Optional(iC),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional($X),teams:n.Optional(BX),seriesCardinality:n.Optional(aC),attributeCardinalities:n.Optional(bLe)}),v1t=f({url:`${Zc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:l({allowEmpty:!1}),kind:n.Optional(FX),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:xLe}),N1t=f({tags:["metrics"],url:Zc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),GX=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:FX,type:iC,temporality:n.Optional(sC),lastSeen:n.Optional($X),teams:n.Optional(BX),seriesCardinality:n.Optional(aC)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),OLe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(GX,{examples:[OLe]});var k1t=f({tags:["metrics"],url:`${Zc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:GX}),AS=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),ALe=["service","env","host","method","status_code"];Object.assign(AS,{examples:[ALe]});var L1t=f({tags:["metrics"],url:`${Zc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:l({allowEmpty:!1}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:AS}),M1t=f({tags:["metrics"],url:`${Zc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(l({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:AS}),NM=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),D1t=f({tags:["metrics"],url:`${Zc}/assets-usage`,method:"GET",query:n.Object({metricName:l({allowEmpty:!1})}),response:NM}),F1t=f({url:`${Zc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:l(),clusterId:n.Optional(l({allowEmpty:!1}))}),response:n.Array(n.String())});var PLe="/v0/aggregation",ULe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),RS=n.Object({parallelism:n.Number(),engine:ULe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),kM=["logs","metrics","traces"];var HX={logs:"Logs",metrics:"Metrics",traces:"Spans"},wLe=[...kM,"connections","log-patterns","spans","rum"];var Q1t={...HX,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},va=[...kM,"rum"];var Z1t={...HX,rum:"RUM events"};var X1t=n.Enum(wLe,{description:"Data source being queried"}),J1t=n.Enum(kM,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Ii=n.Enum(va,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),bd=n.String({description:"Attribute containing the values to aggregate"}),dg=l({description:"Attribute containing the values to aggregate"}),vLe=F("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(bd)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:bd},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:bd},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:bd},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:bd},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:bd},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:bd,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),NLe=F("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(l({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:dg},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:dg},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:dg},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:dg},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:dg},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:dg,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),KX=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),zX=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),YX=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),VX=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),WX=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),QX=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),ZX=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),XX=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),JX=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),kLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),LLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),MLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),DLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),FLe=F("type",[KX,zX,YX,VX,WX,kLe,QX,ZX,XX,MLe,JX],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),$Le=F("type",[KX,zX,YX,VX,WX,LLe,QX,ZX,XX,DLe,JX],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var jX=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),BLe=["linear","log"],CS=n.Enum(BLe,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),GLe=1e3,qX=n.Integer({minimum:1,maximum:GLe}),cC={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},jLe=F("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...cC,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(l()),bucketCount:n.Optional(qX),bounds:n.Optional(jX),boundsScale:n.Optional(CS),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...cC,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(l()),bucketCount:n.Optional(qX),bounds:n.Optional(jX),boundsScale:n.Optional(CS)},{title:"Heatmap",description:"Returns a distribution per time window"})]),uC=15,eBt=128*1024,qLe=["zero","null"],HLe=n.Enum(qLe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),eJ=n.Object({mode:n.Object({type:HLe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),KLe=["avg","sum","min","max","last"],tJ=n.Enum(KLe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var rJ=n.Enum(vM,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),nJ={aggregate:vLe,functions:n.Optional(n.Array(FLe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(eJ),timeAggregate:n.Optional(tJ),metricKind:n.Optional(rJ)},oJ={aggregate:NLe,functions:n.Optional(n.Array($Le,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(eJ),timeAggregate:n.Optional(tJ),metricKind:n.Optional(rJ)},zLe={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},iJ={minItems:1,maxItems:uC,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},sJ=n.Array(n.Object({...nJ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),zLe),PS=n.Array(n.Object({...oJ,filter:n.Optional(l({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),iJ),US=n.Array(n.Object({...nJ,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),pC=n.Array(n.Object({...oJ,filter:l({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...iJ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),aJ=n.Array(n.Omit(pC.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:uC,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var lC=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),xd=l({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),YLe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),VLe=n.Object({fields:n.Array(l(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(l({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),cJ=7;var mg=n.Array(YLe,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),Xc=n.Array(VLe,{maxItems:cJ,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var tBt=f({tags:["aggregation"],url:`${PLe}/multi-query`,method:"POST",body:n.Object({timeRange:No,queries:PS,groupBy:n.Optional(Xc),returnType:jLe,dataSource:Ii,formula:xd,executionOptions:RS,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(l({allowEmpty:!1})),clusterIds:n.Optional(Wc),viewAs:n.Optional(n.Object({owner:l({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Us}))}),response:lg});var uJ=`/${"v1"}/aggregation`,pJ=`/${"v2"}/aggregation`,lJ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),dJ=n.Object({results:n.Array(n.Object({...lJ.properties,value:n.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),WLe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(dJ,{examples:[WLe]});var dC=n.Object({series:n.Array(n.Object({...lJ.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),QLe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(dC,{examples:[QLe]});var mJ=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),fJ="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",gJ=n.Object({results:n.Array(n.Object({group:mJ,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${fJ}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),ZLe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(gJ,{examples:[ZLe]});var mC=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:mJ,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${fJ}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),XLe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(mC,{examples:[XLe]});var JLe=n.Omit(PS.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),eMe=n.Optional(Xc),hJ={timeRange:on,queries:n.Array(JLe,{maxItems:uC,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:eMe,dataSource:Ii},yJ={...hJ,formula:n.Optional(xd)},EJ={...hJ,timeRange:No,formulas:n.Optional(n.Array(l({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},ts=n.Object({clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),SJ=n.Object(yJ,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),tMe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(SJ,{examples:[tMe]});var TJ=n.Object(EJ,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),_J={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(TJ,{examples:[_J]});var fC=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${uJ}/multi-query/scalar`,method:"POST",body:SJ,query:ts,response:dJ}),uBt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${pJ}/multi-query/scalar`,method:"POST",body:TJ,query:ts,response:gJ}),IJ=n.String({...cC,maxLength:Ti,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),bJ=n.Object({...yJ,aggregationWindow:IJ},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),rMe={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(bJ,{examples:[rMe]});var xJ=n.Object({...EJ,aggregationWindow:IJ},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),nMe={..._J,aggregationWindow:"1m"};Object.assign(xJ,{examples:[nMe]});var gC=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${uJ}/multi-query/timeseries`,method:"POST",body:bJ,query:ts,response:dC}),pBt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${pJ}/multi-query/timeseries`,method:"POST",body:xJ,query:ts,response:mC});var oMe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],OJ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,p=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),m=oMe.find(g=>g===r.method);return p===void 0||m===void 0?yield*new Ps({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Jx(m)(sZ(`${e}${p}`,u),{headers:{Accept:"application/json","User-Agent":iMe(t),[OA]:t,[eM]:"1.213.0",[tM]:"62f151ccb5",[rM]:"2026-11-17T08:22:59.011Z",...i},...s?{body:Uk(s)}:{}})});function iMe(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.213.0 (${process.platform}; node ${process.versions.node})`}var sMe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],aMe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],MM=["log","metric","trace","rum"],DM=[...aMe,...MM],cMe=[...sMe,...DM];var fg=["admin","public_editor","public_viewer","teams_only"],AJ=[...fg,"custom"],rs=["admin","editor","viewer"];var Od="/v0/team-membership",FM="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",wS=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum(rs,{description:FM})}),yC=n.Object({userId:l({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:l({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum(rs,{description:FM})}),$M=n.Object({userId:l({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:l({allowEmpty:!1,description:"Team ID to remove the user from."})}),uMe=n.Optional(n.Object({userId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),_Bt=f({tags:["access-control"],url:Od,method:"GET",query:uMe,response:n.Array(wS)}),IBt=f({tags:["access-control"],url:Od,method:"POST",body:yC,response:wS}),bBt=f({tags:["access-control"],url:Od,method:"PUT",body:yC,response:wS}),xBt=f({tags:["access-control"],url:Od,method:"DELETE",body:$M,response:q}),hC=500,EC=n.Object({teamId:l({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(l({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(l({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(rs,{description:FM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:hC,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),pMe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(EC,{examples:[pMe]});var SC=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),lMe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(SC,{examples:[lMe]});var OBt=f({tags:["access-control"],url:`${Od}/bulk-add`,method:"POST",body:EC,response:SC}),ABt=f({tags:["access-control"],url:`${Od}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:hC}),teamId:l({allowEmpty:!1}),role:n.Enum(rs)}),response:n.Object({})}),TC=n.Object({teamId:l({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:hC,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(l({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:hC,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),dMe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(TC,{examples:[dMe]});var _C=n.Object({results:n.Array(n.Object({userId:n.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),mMe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(_C,{examples:[mMe]});var CBt=f({tags:["access-control"],url:`${Od}/bulk-remove`,method:"DELETE",body:TC,response:_C});var fMe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},gMe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},hMe={user:fMe,team:gMe};function BM(e){return CJ(e,"team")}function GM(e){return CJ(e,"user")}function CJ(e,t){let r=[],o=hMe[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var yMe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:GM("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:GM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:GM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},NBt=Object.values(yMe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),kBt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:BM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:BM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:BM("viewer"),roleKey:"viewer"}};var LBt=new Set(DM);var EMe={documentation:void 0,logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},SMe=Object.entries(EMe),MBt=new Map(SMe.flatMap(([e,t])=>t?[[t,e]]:[]));var GBt=[Wf,_p,_p.replace(`${pe}.`,"")];var jM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],qM=["light","dark"];var TMe={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},RJ=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var YBt=TMe.light.red.background;var PJ=12,UJ=2,wJ=2;var vJ=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
276
276
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
277
277
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
278
278
|
-----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],_Me=vJ.map(e=>e.key);var tGt=new Set(_Me),rGt=vJ.map(e=>e.key);var IMe={"&":"&","<":"<",">":">",'"':""","'":"'"};function HM(e){return e.replace(/[&<>"']/g,t=>IMe[t]??t)}var hGt={[RA]:MA,[RA.replace(`${pe}.`,"")]:MA,[PA]:LA,[PA.replace(`${pe}.`,"")]:LA,[_p]:Wf,[_p.replace(`${pe}.`,"")]:Wf},yGt={[MA]:RA,[LA]:PA,[Wf]:_p};function IC(e,t){let r={};for(let[o,i]of Object.entries(e))t.includes(o)||(r[o]=i);return r}function NJ(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var bMe=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_pattern_signature","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],xMe=["alert_queries","alert_thresholds","alert_values"],OMe=["alert_event_name","alert_message"],KGt=new Set([...bMe,...OMe]),zGt=new Set(xMe);var KM={aws:"aws",gcp:"gcp",azure:"azure"},Cp=[KM.aws,KM.gcp,KM.azure];var kJ=n.Object({id:n.String({description:"Unique Tsuga cluster ID. Tsuga assigns it when the cluster record is created. Use this value as `clusterId` with public API requests that accept `clusterId`."}),name:n.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:n.Optional(n.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:n.Enum(Cp,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:n.String({description:"Cloud region selected for the cluster using the provider region identifier."})},{$id:"Cluster",description:"Tsuga cluster available to the organization. Use its `id` to scope public API requests that accept `clusterId`."}),LJ="clusterId must be provided when the organization has multiple clusters",AMe={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(kJ,{examples:[AMe]});var bC=f({description:"Lists the Tsuga clusters of the organization, with cloud provider and region: the `clusterId` values other requests accept. These are not Kubernetes clusters.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(kJ)});function gg(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function xC(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}var zM=require("node:os"),Ad=require("node:path");var OC=e=>e.reason._tag==="NotFound";var MJ=new Set(["api.tsuga.com","api.tsuga-staging.com"]),CMe=new Set(["localhost","127.0.0.1","[::1]"]);function DJ(e){let t=e.replace(/\/+$/,"");if(!URL.canParse(t))return $(new Vc({message:`TSUGA_API_URL is not a URL: ${t}`}));if(/[\s"'\\]/.test(t))return $(new Vc({message:`TSUGA_API_URL holds whitespace, quotes or a backslash: ${JSON.stringify(t)}`}));let r=new URL(t);return r.protocol!=="http:"&&r.protocol!=="https:"?$(new Vc({message:`TSUGA_API_URL must use HTTP or HTTPS: ${t}`})):!CMe.has(r.hostname)&&(r.protocol!=="https:"||!MJ.has(r.hostname))?$(new Vc({message:`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...MJ].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`})):A(t)}var vS="https://api.tsuga.com",RMe=dn({operationApiKey:bt(Se),userAuth:bt(tC)}),FJ=dn({operationApiKey:bt(Se),userAuth:bt(tC),credentials:bt(cx(Se,RMe)),defaults:bt(cx(Se,Se)),telemetry:bt(a0)}),$J=dn({lastUpdateCheck:bt(Se)}),PMe=jo(Yi(FJ)),UMe=jo(Yi($J)),wMe=Gl(Yi(FJ,{space:2})),vMe=Gl(Yi($J)),YM=["from","to","query","max-results","cluster"],BJ={from:"-30m",to:"now",query:"*","max-results":"100"};function NMe(e){let{operationApiKey:t,userAuth:r,...o}=e;return!t&&!r?e:{...o,credentials:{...e.credentials,[vS]:{...t?{operationApiKey:t}:{},...r?{userAuth:r}:{},...e.credentials?.[vS]}}}}function GJ(e,t){let r=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let s=o.kind;switch(s){case"operation-api-key":r.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":r.push(`User session: ${gg(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Nt(s)}}else r.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let i={...BJ,...e.defaults};for(let[s,a]of Object.entries(i)){let u=s in e.defaults?" *":"";r.push(` ${s}: ${a}${u}`)}return`${r.join(`
|
|
@@ -282,7 +282,7 @@ Fix its permissions and retry; the CLI will not overwrite a config it cannot rea
|
|
|
282
282
|
`,{mode:384})}),E=k(function*(_,T){let I=_.credentials?.[T]??{};if(I.operationApiKey)return I;let b=yield*r.read(T);return b?{...I,userAuth:b}:I}),h=(_,T,I)=>({..._,credentials:{..._.credentials,[I]:T}}),S=v("config.storeUserAuth")(function*(_,T){let I=yield*g,b=yield*p,{operationApiKey:w}=I.credentials?.[b]??{},M=T&&w?{operationApiKey:w}:{};return(yield*r.save(b,_))?(yield*y(h(I,M,b)),r.location):(yield*y(h(I,{...M,userAuth:_},b)),s)});return{configPath:s,resolveApiUrl:p,resolve:k(function*(_){let T=yield*m,I=yield*p,w=_.operationApiKey??o.operationApiKey?{}:yield*E(T,I),M=TX({flagKey:_.operationApiKey,environmentKey:o.operationApiKey,operationApiKey:w.operationApiKey,userAuth:w.userAuth});yield*Sc({[cZ]:M===void 0?"none":M.kind==="user-session"?"user_session":`operation_api_key_${M.source}`,[uZ]:yield*t.exists(s).pipe(di(()=>!1))});let Y=T.defaults??{},C=_.clusterId?.trim()||o.clusterId||Y.cluster?.trim()||void 0;return{apiUrl:I,credential:M,clusterId:C,defaults:Y}}),getUserAuth:mt(function*(){let _=yield*m,T=yield*p;return(yield*E(_,T)).userAuth}),saveUserAuth:_=>S(_,!1),saveRefreshedUserAuth:_=>S(_,!0).pipe(Xs),saveOperationApiKey:v("config.saveOperationApiKey")(function*(_){let T=yield*g,I=yield*p;yield*y(h(T,{operationApiKey:_},I))}),clearUserAuth:mt(function*(){let _=yield*p,T=yield*g,{operationApiKey:I}=T.credentials?.[_]??{},b=yield*r.remove(_);if(yield*y(h(T,I?{operationApiKey:I}:{},_)),!b)return yield*new ig({message:`The session is still in ${r.location}. Unlock it and run \`tsuga auth logout\` again.`})}),getDefault:k(function*(_){return((yield*g).defaults??{})[_]??BJ[_]}),setDefault:v("config.setDefault")(function*(_,T){let I=yield*g,{[_]:b,...w}=I.defaults??{};yield*y({...I,defaults:T===""?w:{...w,[_]:T}})}),resetDefaults:mt(function*(){let{defaults:_,...T}=yield*g;yield*y(T)}),getTelemetryConsent:X(m,_=>_.telemetry),saveTelemetryConsent:v("config.saveTelemetryConsent")(function*(_){let T=yield*g;yield*y({...T,telemetry:_})}),getLastUpdateCheck:t.readFileString(u).pipe(G(UMe),X(_=>_.lastUpdateCheck),di(()=>{})),saveLastUpdateCheck:v("config.saveLastUpdateCheck")(function*(_){yield*t.makeDirectory(a,{recursive:!0,mode:448});let T=yield*vMe({lastUpdateCheck:_}).pipe(Ln);yield*t.writeFileString(u,`${T}
|
|
283
283
|
`,{mode:384})})}})}){static layer=Fo(this,this.make)};var kMe="Your session expired.",LMe="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed.",AC=k(function*(e,t){let r=yield*Wn;if(!RM(t,r))return t;let o=yield*yt,i=yield*Op,s=(yield*o.getUserAuth.pipe(di(()=>{})))??t;if(!RM(s,r))return s;if(!s.refreshToken)return yield*new yd({message:kMe,suggestions:["Sign in again: tsuga auth login"]});let a=yield*i.refreshTokens(e,s.refreshToken).pipe(li("OAuthTokenError",p=>$(p.code==="invalid_grant"?new yd({message:LMe,suggestions:["Sign in again: tsuga auth login"]}):new Ua({message:`Could not renew your session: ${p.message}. Retry the command.`})))),u=xC(a);return yield*o.saveRefreshedUserAuth(u).pipe(Ro(p=>jn(`Warning: could not save the renewed session (${p.message}). Run \`tsuga auth login\` before the next command.`))),u});var DS=require("node:crypto");var VM={kind:n.Enum(["doc","api"],{description:"`doc` for documentation pages (guides, references, release notes); `api` for API-reference endpoints indexed from the OpenAPI spec. Use this to decide how to present or follow up on the result."}),path:n.String({description:"Path identifying the result. Documentation pages use a slug path (e.g. `data-collection/guides/how-to-add-resource-attributes`). API-reference results use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:n.Optional(n.String({description:'For documentation pages: the heading path inside the page that matched (e.g. "Language setup"). For API results: the matched field or parameter breadcrumb (e.g. "Body \u203A queries"). Absent when the match is the page or endpoint intro.'})),tab:n.Optional(n.String({description:'Tab label inside the page that the result matched. Set when the matching content is inside a <Tabs><Tab label="\u2026"> block. Always absent for API results.'})),anchor:n.Optional(n.String({description:"For documentation pages: the slugified heading ID used as the URL fragment (e.g. `language-setup`). For API results: the Scalar deep-link fragment (`tag/<tag>/<METHOD><path>`). The `link` field already has this baked in."})),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the result in the Tsuga app. Documentation pages include the section anchor and tab query parameter when applicable. API results deep-link into the API reference at `/documentation/api#tag/\u2026`."})},MMe=n.Object({...VM,breadcrumb:n.Array(n.String(),{description:'Heading path inside the page that matched, followed by the tab label when the match is inside a <Tabs><Tab label="\u2026"> block. Empty for a page intro or endpoint-level match.'})}),m2t=f({tags:["docs"],url:"/v0/docs/search",method:"GET",query:n.Object({query:l({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."}),limit:n.Optional(n.Integer({minimum:1,maximum:50,description:"Maximum number of results to return."}))}),response:n.Array(MMe)});var jJ=`/${"v1"}/docs`,qJ=n.Object({path:n.String({description:"Path identifying the page. Documentation pages use a slug path (e.g. `getting-started/send-your-first-logs`). API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:n.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),DMe={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
284
284
|
...`};Object.assign(qJ,{examples:[DMe]});var HJ=n.Object(VM,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),FMe={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(HJ,{examples:[FMe]});var KJ=f({description:"Retrieves the raw markdown of a documentation or API-reference page by path or link. Documentation pages use slug paths such as `getting-started/send-your-first-logs`; API-reference pages use `api/<operationId>`.",operationId:"getDocPage",tags:["public","docs"],url:jJ,method:"GET",query:n.Object({path:l({allowEmpty:!1,description:"Page to fetch: a doc slug path, `api/<operationId>`, or a docs link with or without its host. A `/documentation/<path>` link returns the whole page, ignoring `?tab=` and `#anchor`; an API-reference link `/documentation/api#tag/<tag>/<METHOD><path>` returns that operation's page."})},{description:"Documentation page lookup query."}),response:qJ}),CC=f({description:"Searches Tsuga documentation and API reference, covering product behavior, query syntax (Tsuga queries, PromQL), API fields, dashboard and widget schemas, setup, limits, gotchas and more. Results are ranked by relevance; an empty array means nothing matched.",operationId:"searchDocs",tags:["public","docs"],url:`${jJ}/search`,method:"GET",query:n.Object({query:l({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(HJ)});var NS=`/${"v1"}/logs`,WM=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext",description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),...n.Pick(UM,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),$Me={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(WM,{examples:[$Me]});var zJ=n.Object({query:n.Optional(l({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3,default:NX,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...on.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),BMe={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(zJ,{examples:[BMe]});var kS=f({description:"Searches raw log lines in a time range with Tsuga query syntax: error messages, exceptions, stack traces, the logs of one request or pod. For counts or rates, use an aggregation; to group similar messages, use log patterns. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${NS}/search`,method:"GET",query:zJ,response:n.Object({logs:n.Array(WM,{description:"Log events matching the query and time range."})})}),GMe=n.Object({pattern:n.String({description:"Clustered log pattern formatted as a readable string."}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:n.String({description:"Value of the attribute identified by `key`, common to all logs in the pattern."})},{description:"Attribute key-value pair that is constant across every log matching this pattern, e.g. a shared `level` or `context.team`."}))}),YJ=n.Object({patterns:n.Array(GMe,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Sum of the returned patterns' `size` values. It is not the number of logs matching the query: logs outside the returned patterns are not counted."})},{}),jMe={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:37004};Object.assign(YJ,{examples:[jMe]});var VJ=f({description:"Groups similar log messages into patterns with counts over a time range: the top messages or errors without reading raw lines. For patterns first seen in the range, use new error patterns; for growing ones, error pattern increases. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${NS}/patterns`,method:"GET",query:n.Object({...on.properties,query:l({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:YJ}),qMe=n.Object({exampleLog:n.Optional(WM),team:n.String({description:"Team associated with the new error pattern."}),env:n.String({description:"Environment associated with the new error pattern."}),service:n.String({description:"Service associated with the new error pattern."}),firstSeen:n.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:n.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),WJ=n.Object({newErrorPatterns:n.Array(qMe,{description:"Error patterns first seen in the requested time range."})},{}),HMe={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:1704067200,lastSeen:1704153600,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(WJ,{examples:[HMe]});var QJ=f({description:"Finds error log patterns first seen in the time range: new errors or exceptions, for example after a change. Optionally filtered by team, environment or service. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${NS}/patterns/new`,method:"GET",query:n.Object({...on.properties,team:n.Optional(l({description:"Team name to restrict pattern detection to."})),env:n.Optional(l({description:"Environment to restrict pattern detection to."})),service:n.Optional(l({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:WJ}),KMe=n.Object({team:n.String({description:"Team associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),env:n.String({description:"Environment associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),pattern:n.String({description:"Readable representation of the grouped error log pattern. Generated by Tsuga from matching log messages and returned for every pattern increase."}),increaseTimestamps:n.Array(n.Number({description:"Unix timestamp in milliseconds of a detected spike in this pattern. Tsuga computes these timestamps during pattern-increase analysis; one entry is returned for each spike in the requested time range."}))}),ZJ=n.Object({errorPatternIncreases:n.Array(KMe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),zMe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(ZJ,{examples:[zMe]});var XJ=f({description:"Finds a team's error log patterns whose count increased in the time range: spikes in existing errors. For errors first seen in the range, use new error patterns. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${NS}/patterns/increase`,method:"GET",query:n.Object({...on.properties,team:l({allowEmpty:!1,description:"Team name to analyze for pattern increases. Required; match it to the `context.team` value on the logs you want Tsuga to inspect."}),env:n.Optional(l({allowEmpty:!1,description:"Environment to restrict the analysis to. Optional; match it to the `context.env` value on the logs, or omit it to analyze all environments for the team."})),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:ZJ}),JJ=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),YMe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(JJ,{examples:[YMe]});var VMe=n.Object({...on.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),search:n.Optional(l({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively, e.g. `k8s` or `http.status`."}))},{description:"Log attribute discovery query. Provide a time range, an optional cluster ID, and an optional search text."}),eee=f({description:"Lists log attribute (field, key) names seen in a time range, to find the key to filter or group logs by. Requires a credential that can read all teams: attribute discovery is not team-filtered. To rank fields by their use in dashboards and monitors, use interesting fields. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${NS}/attributes`,method:"GET",query:VMe,response:JJ});var WMe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),QMe="/v0/promql",RC=n.Object({query:l({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:No,step:l({allowEmpty:!1,description:"Evaluation step interval: a positive whole number followed by one unit, `s`, `m`, `h`, `d`, or `w`, such as `60s`, `1m`, or `1h`. A number without a unit, such as `60`, is not accepted."}),returnType:n.Optional(WMe),executionOptions:RS,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster to target. Mutually exclusive with `clusterIds`. Defaults to the first cluster created in the organization when both are omitted."})),clusterIds:n.Optional(Wc)}),ZMe={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(RC,{examples:[ZMe]});var L2t=f({tags:["promql"],url:QMe,method:"POST",body:RC,response:lg});var XMe=`/${"v1"}/promql`,JMe=`/${"v2"}/promql`,tee=n.Object({...n.Pick(RC,["query","step"]).properties,timeRange:on},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),ree=n.Object({clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to query. Set by the client as the clusterId query parameter, not in the JSON body. Required when the organization has multiple clusters; omit only for single-cluster organizations. Unknown cluster IDs return 404."}))}),PC=f({description:'Runs a PromQL (Prometheus query language) range query over metrics and returns timeseries. Use a metric name exactly as the metrics list returns it: names are not translated between OpenTelemetry dots and Prometheus underscores, and a dotted metric or label name must be quoted, as in `{"k8s.pod.memory.working_set"}`. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries).',operationId:"queryPromql",tags:["public","promql"],url:XMe,method:"POST",body:tee,query:ree,response:dC}),eDe=n.Object({...tee.properties,timeRange:No},{description:"PromQL range-query request with the time range in milliseconds. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:17822015e5,to:17822034e5},step:"1m"}]}),H2t=f({description:"Runs a PromQL range query over Tsuga metric data and returns one shared time axis in milliseconds with one series per group aligned to it. Same request as `POST /v1/promql`, with `timeRange` in milliseconds. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromqlV2",tags:["public","promql"],url:JMe,method:"POST",body:eDe,query:ree,response:mC});var Cd="/v0/traces",Z2t=f({tags:["traces"],url:`${Cd}/count`,method:"GET",query:n.Pick(Ap,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),tDe=["unset","ok","error"],rDe=n.Enum(tDe),nDe=["unspecified","internal","server","client","producer","consumer"],oDe=n.Enum(nDe),iee=n.Object({__tsuga_metadata__:n.Optional(n.Object({},{additionalProperties:!0})),context:n.Optional(n.Object({telemetry:n.Optional(n.Object({sdk:n.Optional(n.Object({language:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String())),service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0})),env:n.Optional(n.String())},{additionalProperties:!0})),parent_span_id:n.Optional(n.String()),resource_id:n.Optional(n.String({description:"Key into the `resources` map of a summarized trace, holding the resource context hoisted off this span."})),resource_attributes:n.Object({},{additionalProperties:!0}),span_attributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),duration_ns:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}))),span_id:n.String(),span:n.Object({kind:oDe,name:n.String()}),status_code:n.Optional(rDe),trace_id:n.String()}),see=100;var iDe={...Cr.properties,query:n.Optional(l({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:xS})),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(l({allowEmpty:!1,description:"Attribute to sort by. Attributes other than `start_time` sort numerically; spans where the attribute is missing or not a number come last."})),sortDirection:n.Optional(me),useCanopy:n.Optional(n.Boolean())},X2t=f({tags:["traces"],url:`${Cd}/search`,method:"GET",query:n.Object(iDe),response:n.Object({spans:n.Optional(n.Array(iee)),attributesToHighlight:n.Optional(n.Array(OS)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."}))})}),sDe=n.Object({groupByAttributes:n.Array(l({allowEmpty:!1}),{description:'Glob patterns of span_attributes keys to use as additional grouping dimensions (e.g. "db.*"). Matches against flattened dotted keys of span_attributes only.'}),minLeafSpansToAggregate:n.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:n.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:n.Array(n.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:n.Boolean({description:"Whether to sort the returned spans by start_time (span_id tie-breaker). Set false when the caller reconstructs the trace tree and does not need ordering. Default true."})}),aDe=n.Object({...Cr.properties,traceId:l({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(sDe).properties}),J2t=f({tags:["traces"],url:`${Cd}/summarize`,method:"GET",query:aDe,response:n.Object({resources:n.Record(n.String(),n.Object({},{additionalProperties:!0})),spans:n.Array(iee)})}),eqt=f({tags:["traces"],url:`${Cd}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),cDe=n.Object({key:n.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:n.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:n.Optional(n.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:n.Optional(n.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:n.Optional(n.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),uDe=n.Object({fromNs:n.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:n.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:n.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:n.Array(n.Object({serviceKey:n.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:n.Number({description:"Share of this range attributed to the service, from `0` through `1`, computed from active leaf spans in the range. Weights in one range sum to `1`, except on a range merged from shorter ones: each pairwise merge truncates to the microsecond grid, so the loss grows with the number of merges, a few parts in 10,000 on a typical trace but well below `1` after a long run of very short adjacent ranges. `serviceTotals` carries the same loss."}),durationNs:n.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:n.Array(n.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),pDe=n.Object({serviceKey:n.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:n.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:n.Number({description:"Share of total trace duration attributed to this service, `durationNs / totalDurationNs`, from `0` through `1`. Shares sum to less than `1` because time where no span was running is credited to no service, and because of the merge truncation described on `ranges[].contributions[].weight`, which is the whole shortfall on a trace with no gap."})}),QM=n.Optional(n.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),ZM=n.Optional(n.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),UC=n.Object({traceId:n.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:n.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:n.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:n.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:n.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:n.Array(cDe,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:n.Array(uDe,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:n.Array(pDe,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),lDe={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:'["checkout","prod"]',name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:'["payments","prod"]',name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:'["checkout","prod"]',weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:'["checkout","prod"]',weight:.5,durationNs:"600000000"},{serviceKey:'["payments","prod"]',weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:'["checkout","prod"]',durationNs:"1800000000",share:.75},{serviceKey:'["payments","prod"]',durationNs:"600000000",share:.25}]};Object.assign(UC,{examples:[lDe]});var tqt=f({tags:["traces"],url:`${Cd}/latency-summary`,method:"GET",query:n.Object({...Cr.properties,traceId:l({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:QM,includeRanges:ZM}),response:UC}),dDe=n.Object({traceId:n.String(),spanId:n.String()}),rqt=f({tags:["traces"],url:`${Cd}/span-backlinks`,method:"GET",query:n.Object({...Cr.properties,traceId:l({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(dDe)})),truncated:n.Boolean()})}),nee=n.Object({filter:l({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:No}),mDe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),fDe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),gDe=n.Object({bounds:n.Array(n.Number()),targetCounts:n.Array(n.Number()),baselineCounts:n.Array(n.Number())}),hDe=n.Object({quantileLift:n.Number(),ks:n.Number(),pValue:n.Number(),targetSampleCount:n.Number(),baselineSampleCount:n.Number(),histogram:gDe}),yDe=F("type",[n.Object({type:n.Literal("categorical"),attr:n.String(),values:n.Array(fDe),otherValues:n.Array(mDe)}),n.Object({type:n.Literal("distribution"),attr:n.String(),shift:hDe})]),oee=n.Object({contrastSets:n.Array(yDe),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),EDe=F("type",[n.Object({type:n.Literal("snapshot"),response:oee}),n.Object({type:n.Literal("done"),response:oee}),n.Object({type:n.Literal("error"),message:n.String()})]),SDe=n.Object({targetGroup:nee,baselineGroup:nee,candidateAttrs:n.Optional(n.Array(l({allowEmpty:!1}))),topK:n.Optional(n.Integer({minimum:1,maximum:100})),minLift:n.Optional(n.Number({minimum:1})),minSupport:n.Optional(n.Number({minimum:0,maximum:100})),clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster ID"}))}),nqt=f({tags:["traces"],url:`${Cd}/contrast-sets/stream`,method:"POST",body:SDe,response:EDe});var wC=`/${"v1"}/traces`,XM=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String({description:"Service name associated with the span."})),version:n.Optional(n.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parent_span_id:n.Optional(n.String({description:"`span_id` of this span's parent within the same trace. Empty or absent for a root span."})),resource_id:n.Optional(n.String({description:"Only on summarized traces: key into the response `resources` map holding the resource context (host, cloud, process, SDK) hoisted off this span. `context` keeps `service` and `env` inline."})),resource_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes describing the process/host that emitted the span (e.g. `host.name`, `k8s.pod.name`), as a flat key-value map set by the instrumented service or its SDK."}),span_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes describing this operation (e.g. HTTP method, DB statement), as a flat key-value map set by the instrumented code or auto-instrumentation."}),duration:n.Number({description:"Span duration in milliseconds, derived from the nanosecond `start_time` and `end_time` values."}),duration_ns:n.String({description:"Span duration in nanoseconds, encoded as a string to preserve precision."}),start_time:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),end_time:n.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:n.Optional(n.Object({message:n.String({description:"OpenTelemetry span status description set by the instrumentation, such as the exception message."})},{description:"OpenTelemetry span status description. `message` is set only when `status_code` is `error` and the instrumentation recorded a description."})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0,description:"Key-value attributes recorded with this event, set by the instrumented code when the event was added to the span (e.g. exception details)."}),event_name:n.String({description:"Name of the span event."}),event_timestamp_nanos:n.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}),{description:"OpenTelemetry span links to related spans, possibly in other traces."})),span_id:n.String({description:"Unique span ID within the trace."}),span:n.Object({kind:n.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:n.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),status_code:n.Optional(n.String({description:"OpenTelemetry span status set by the instrumented code: `unset` (default, no explicit status), `ok`, or `error`. Absent if the source span never set a status."})),trace_id:n.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent",description:"Distributed tracing span including timing, identifiers, OpenTelemetry attributes, events, and status metadata."}),TDe={context:{service:{name:"my-service",version:"1.0.0"}},parent_span_id:"187a47da1b2560f8",resource_attributes:{},span_attributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,duration_ns:"23995900",start_time:"1770923469995353600",end_time:"1770923470019349500",span_id:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},status_code:"ok",trace_id:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(XM,{examples:[TDe]});var _De={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},uee=n.Object({...on.properties,query:n.Optional(l({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4,default:see,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(uee,{examples:[_De]});var LS=f({description:"Searches trace spans (APM requests and operations) in a time range with Tsuga query syntax, for example the slow or failing requests of a service. For one whole trace, use the trace summary; for counts or latency percentiles, an aggregation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${wC}/search`,method:"GET",query:uee,response:n.Object({spans:n.Array(XM,{description:"Spans matching the query and time range."})})}),IDe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},pee=n.Object({...on.properties,traceId:l({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:n.Optional(n.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:n.Optional(n.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:n.Optional(n.Array(n.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:n.Optional(n.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(pee,{examples:[IDe]});var lee=f({description:"Returns one trace by trace ID as a compact set of spans: similar spans are merged into summary spans with counts and duration statistics, so large traces fit. Summary spans carry `span_attributes.aggregation.is_summary`. The resource context of each span (host, cloud, process, SDK) is emitted once under `resources`; a span points at its entry with `resource_id` and keeps only `context.service` and `context.env` inline. For where the time went, use the trace latency summary. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${wC}/summarize`,method:"GET",query:pee,response:n.Object({resources:n.Record(n.String(),n.Object({},{additionalProperties:!0}),{description:"Distinct resource contexts of the trace, keyed by the `resource_id` each span carries. Emitted once per resource instead of on every span."}),spans:n.Array(XM,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `span_attributes.aggregation.is_summary`."})})}),bDe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},dee=n.Object({...on.properties,traceId:l({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:QM,includeRanges:ZM},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(dee,{examples:[bDe]});var mee=f({description:"Finds where the time went in one trace (bottleneck, critical path): wall-clock time attributed to the services with active leaf spans, as per-service totals and an optional sequential timeline. For the spans themselves, use the trace summary. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${wC}/latency-summary`,method:"GET",query:dee,response:UC}),aee=e=>n.Object({filter:l({type:"tsuga-query",description:`Tsuga query selecting the ${e} spans. Terms are ANDed by whitespace, as in \`context.service.name:checkout status_code:error\`.`}),timeRange:on},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),fee=n.Object({targetGroup:aee("target"),baselineGroup:aee("baseline"),candidateAttrs:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. Attributes referenced by either group filter, and their known sibling attributes for the same field, are always excluded, so the contrasted condition does not come back as a finding. Omit or pass an empty array to let Tsuga test the attributes among `span_attributes.*`, `context.*`, `span.name`, `span.kind`, `status_code` and `is_root` that take more than one value across samples of both groups, most frequent in the target first; when none varies, `contrastSets` is empty. Numeric attributes with mostly distinct values, such as `duration_ns`, come back as `distribution` entries. Span duration is excluded when a group filter uses it."})),topK:n.Optional(n.Integer({minimum:1,maximum:100,description:"Maximum number of findings to return, strongest first. A finding is one attribute/value pair, and findings are grouped into one `contrastSets` entry per attribute, so a result carries at most this many `values` rows across possibly fewer entries. Valid values are 1 through 100. Defaults to 10."})),minLift:n.Optional(n.Number({minimum:1,description:"Minimum lift a value must reach to be reported as a finding. Lift is the value's coverage of the target group divided by its coverage of the baseline, so `2` keeps only values at least twice as frequent in the target. Raise it to cut weak findings. Defaults to 1.5."})),minSupport:n.Optional(n.Number({minimum:0,maximum:100,description:"Support floor as a percentage: a value is reported as a finding only when it covers at least this much of the target group or of the baseline group. Valid values are 0 through 100. Raise it to drop findings that explain only a handful of spans. Defaults to 0.5."}))},{description:"Contrast-set request. Provide the target group to explain and the baseline to compare it against, plus optional significance tuning. Send `clusterId` as a query parameter, not in the JSON body."}),xDe={targetGroup:{filter:"context.service.name:checkout status_code:error",timeRange:{from:1704067200,to:1704070800}},baselineGroup:{filter:"context.service.name:checkout NOT status_code:error",timeRange:{from:1704067200,to:1704070800}}};Object.assign(fee,{examples:[xDe]});var cee={value:n.String({description:"The attribute value this row is about."}),targetSupport:n.Number({description:"Percentage of target spans carrying this value, from 0 to 100."}),baselineSupport:n.Number({description:"Percentage of baseline spans carrying this value, from 0 to 100."})},gee=n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),ODe=n.Object({type:n.Literal("categorical",{description:"The attribute is compared value by value."}),attr:gee,values:n.Array(n.Object({...cee,lift:n.Optional(n.Number({description:"`targetSupport / baselineSupport`: how many times more frequent the value is in the target group. Absent when the value never appears in the baseline, which makes the lift unbounded."})),pValue:n.Number({description:"Probability that a difference this large would occur if the value were unrelated to the split. Smaller is stronger."})},{title:"ContrastSetValue"}),{description:"Values over-represented in the target group that cleared the lift, support, and significance gates, strongest first. These are the findings."}),otherValues:n.Array(n.Object(cee,{title:"ContrastSetOtherValue"}),{description:"The attribute's other frequent values in the target group, by target percentage descending, as context for reading `values`. Never overlaps `values`."})},{title:"CategoricalContrastSet"}),ADe=n.Object({type:n.Literal("distribution",{description:"The attribute is numeric, such as a duration, and is compared by the shape of its values."}),attr:gee,shift:n.Object({quantileLift:n.Number({description:"How far apart the two groups are, as a ratio: 1 means no change, 3 means about three times apart. It does not tell which group is larger. Read `histogram` for the direction."}),ks:n.Number({description:"Kolmogorov-Smirnov statistic, from 0 to 1: the largest gap between the two cumulative distributions."}),pValue:n.Number({description:"Probability that a difference this large would occur if the two groups had the same distribution. Smaller is stronger."}),targetSampleCount:n.Number({description:"Number of target spans that carry the attribute."}),baselineSampleCount:n.Number({description:"Number of baseline spans that carry the attribute."}),histogram:n.Object({bounds:n.Array(n.Number(),{description:"Bin edges, in the unit of the attribute. One more item than each count list. The bins go from the 2nd to the 98th percentile of both groups, so they do not hold all samples."}),targetCounts:n.Array(n.Number(),{description:"Number of target samples in each bin."}),baselineCounts:n.Array(n.Number(),{description:"Number of baseline samples in each bin."})},{title:"ContrastSetHistogram"})},{title:"ContrastSetShift"})},{title:"DistributionContrastSet"}),CDe=F("type",[ODe,ADe]),hee=n.Object({contrastSets:n.Array(CDe,{description:"One entry per attribute that separates the two groups, strongest first. Read `type` first: a categorical entry lists values, a distribution entry describes how a numeric attribute shifted. An attribute with the same value strings as a stronger entry is left out, so two boolean attributes appear as one entry. Empty when nothing cleared the gates, which means the target and the baseline look alike on the attributes tested."}),targetGroupCount:n.Number({description:"Number of spans matched by the target group filter over its time range. Not a sample: it is a plain count over the whole group."}),baselineGroupCount:n.Number({description:"Number of spans matched by the baseline group filter over its time range. Not a sample: it is a plain count over the whole group."}),failedAttributeCount:n.Number({description:"Number of candidate attributes Tsuga dropped because a query for them failed. Those attributes were not tested at all, so a high count next to an empty `contrastSets` means the comparison was incomplete, not that the two groups are alike."})}),RDe={contrastSets:[{type:"categorical",attr:"span_attributes.http.route",values:[{value:"/checkout/pay",targetSupport:82.4,baselineSupport:11.7,lift:7.04,pValue:1e-4}],otherValues:[{value:"/checkout/cart",targetSupport:9.1,baselineSupport:44.2}]},{type:"distribution",attr:"duration_ns",shift:{quantileLift:4.2,ks:.61,pValue:1e-4,targetSampleCount:1180,baselineSampleCount:8620,histogram:{bounds:[2e6,5e7,2e8,9e8],targetCounts:[40,310,830],baselineCounts:[5100,3200,320]}}}],targetGroupCount:1240,baselineGroupCount:8760,failedAttributeCount:2};Object.assign(hee,{examples:[RDe]});var yee=f({description:"Finds what failing or slow requests have in common that healthy ones do not, for example errors against successes, or before and after a change: compares a target span group with a baseline and returns the attribute values over-represented in the target, and the numeric attributes, such as durations, whose distribution shifted. Each group has its own time range, so a before/after comparison is one call. See [Traces](/documentation/explore/traces).",operationId:"findContrastSets",tags:["public","traces"],url:`${wC}/contrast-sets`,method:"POST",body:fee,query:ts,response:hee});function See(e,t){let r=[],o=Eee(t);for(let i=0;i<e.length;i+=1){let s=e[i];if(s===void 0||s==="--")break;if(s.startsWith("-")){s.includes("=")||(i+=1);continue}let a=o.get(s);if(a===void 0)break;r.push(s),o=Eee(a)}return r.join(" ")}function Eee(e){let t=new Map;for(let r of e.subcommands)for(let o of r.commands)t.set(o.name,o);return t}var Jc=(e,t)=>r=>tt(r,o=>new qn({message:`Could not ${e} ${t}: ${o.message}`})),hg=v("fs.writeAtomic")(function*(e,t){let r=yield*tn,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(Jc("write",o)),yield*r.rename(o,e).pipe(Jc("write",e))}),yg=v("fs.readOrUndefined")(function*(e){return yield*(yield*tn).readFileString(e).pipe(Mu(OC,()=>Oe),BI({onSuccess:r=>r??void 0,onFailure:r=>new qn({message:`Could not read ${e}: ${r.message}`})}))}),Eg=v("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*tn,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(Jc("back up",e)),i});function bi(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var vC=v("fs.parseJsonObject")(function*(e,t){let r=yield*PDe(t).pipe(tt(()=>new qn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return bi(r)?r:yield*new qn({message:`${e} must contain a JSON object at the top level.`})}),PDe=gY(Yi(Lc)),NC=v("fs.formatJsonFile")(function*(e){return`${yield*UDe(e).pipe(Ln)}
|
|
285
|
-
`}),UDe=Gl(Yi(Lc,{space:2}));var wDe=Gl(Yi(Lc)),FS={traceId:(0,DS.randomBytes)(16).toString("hex"),spanId:(0,DS.randomBytes)(8).toString("hex")};function eD(e,t,r){if(e===CC)return Array.isArray(r)?{[yZ]:r.length}:{};let o=e===kS||e===LS,i=e===fC,s=e===PC;if(!(o||i||s||e===gC))return{};let a=t.query??{},u=bi(t.body)?t.body:{},p=bi(r)?r:{},m=o?a:bi(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?p.logs??p.spans:i?p.results:p.series,h=Array.isArray(p.series)?p.series:void 0,S=e===kS?"logs":e===LS?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...S===void 0?{}:{[pZ]:S},[lZ]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof m.from=="number"&&typeof m.to=="number"?{[dZ]:m.to-m.from}:{},...o?{[iM]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[iM]:g.some(_=>bi(_)&&typeof _.filter=="string"&&_.filter.length>0),[mZ]:y.reduce((_,T)=>_+(bi(T)&&Array.isArray(T.fields)?T.fields.length:0),0)},...Array.isArray(E)?{[fZ]:E.length}:{},...h===void 0?{}:{[gZ]:h.length,[hZ]:h.reduce((_,T)=>_+(bi(T)&&Array.isArray(T.points)?T.points.length:0),0)}}}var MS=[],JM=class extends $h{get traceId(){return FS.traceId}end(t,r){super.end(t,r),MS.push({name:this.name.slice(0,200),kind:this.kind,[Ip]:this.spanId,[dd]:cn(this.parent,{onNone:()=>FS.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:Uu(r)&&!dc(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=GDe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,yM))}),MS.length>hM&&MS.shift()}},_ee=BU({span:e=>new JM(e)});function vDe(e,t,r){if(so(e))return{...t,[Ra]:Ar.success};if(dc(e.cause))return{...t,[Ra]:ZA(r),[md]:"Interrupted",...r===void 0?{}:{[vA]:r}};let o=Ru(e.cause);if(JA(o))return{...t,[Ra]:Ar.usage,[md]:"Usage"};if(XA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[Ra]:QA(o),[md]:o._tag,...i===void 0?{}:{[UA]:i},...s===void 0?{}:{[wA]:s}}}return{...t,[Ra]:Ar.failure,[md]:"Unhandled"}}var NDe=[...bM.map(([e])=>e),"CI"],kDe=of(Object.fromEntries(NDe.map(e=>[e,es(e)]))).pipe(Ln);function LDe(e,t,r){let o=e.findIndex(m=>m.startsWith("-")),i=o===-1?[]:e.slice(o,o+gM).map(m=>m.slice(0,eg)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=cg(t)??(t.CI?"ci":r?"terminal":"script"),p=MDe(u,t);return{...i.length>0?{[Vf]:i}:{},...a?{[SS]:"pretty"}:{},[TS]:u,...p===void 0?{}:{[NA]:p}}}function MDe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,DS.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var Iee=k(function*(e,t,r,o){let i=yield*Wn;return yield*e.pipe(Ec(s=>DDe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),DDe=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*pi([TM,kDe,Wn]),s=vDe(e,{[yS]:See(t.argv,t.root),[ES]:i-t.startedAt,...LDe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*FDe(s)))return;let a=yield*(yield*yt).resolveApiUrl,u={...s,[fS]:"1.
|
|
285
|
+
`}),UDe=Gl(Yi(Lc,{space:2}));var wDe=Gl(Yi(Lc)),FS={traceId:(0,DS.randomBytes)(16).toString("hex"),spanId:(0,DS.randomBytes)(8).toString("hex")};function eD(e,t,r){if(e===CC)return Array.isArray(r)?{[yZ]:r.length}:{};let o=e===kS||e===LS,i=e===fC,s=e===PC;if(!(o||i||s||e===gC))return{};let a=t.query??{},u=bi(t.body)?t.body:{},p=bi(r)?r:{},m=o?a:bi(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?p.logs??p.spans:i?p.results:p.series,h=Array.isArray(p.series)?p.series:void 0,S=e===kS?"logs":e===LS?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...S===void 0?{}:{[pZ]:S},[lZ]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof m.from=="number"&&typeof m.to=="number"?{[dZ]:m.to-m.from}:{},...o?{[iM]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[iM]:g.some(_=>bi(_)&&typeof _.filter=="string"&&_.filter.length>0),[mZ]:y.reduce((_,T)=>_+(bi(T)&&Array.isArray(T.fields)?T.fields.length:0),0)},...Array.isArray(E)?{[fZ]:E.length}:{},...h===void 0?{}:{[gZ]:h.length,[hZ]:h.reduce((_,T)=>_+(bi(T)&&Array.isArray(T.points)?T.points.length:0),0)}}}var MS=[],JM=class extends $h{get traceId(){return FS.traceId}end(t,r){super.end(t,r),MS.push({name:this.name.slice(0,200),kind:this.kind,[Ip]:this.spanId,[dd]:cn(this.parent,{onNone:()=>FS.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:Uu(r)&&!dc(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=GDe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,yM))}),MS.length>hM&&MS.shift()}},_ee=BU({span:e=>new JM(e)});function vDe(e,t,r){if(so(e))return{...t,[Ra]:Ar.success};if(dc(e.cause))return{...t,[Ra]:ZA(r),[md]:"Interrupted",...r===void 0?{}:{[vA]:r}};let o=Ru(e.cause);if(JA(o))return{...t,[Ra]:Ar.usage,[md]:"Usage"};if(XA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[Ra]:QA(o),[md]:o._tag,...i===void 0?{}:{[UA]:i},...s===void 0?{}:{[wA]:s}}}return{...t,[Ra]:Ar.failure,[md]:"Unhandled"}}var NDe=[...bM.map(([e])=>e),"CI"],kDe=of(Object.fromEntries(NDe.map(e=>[e,es(e)]))).pipe(Ln);function LDe(e,t,r){let o=e.findIndex(m=>m.startsWith("-")),i=o===-1?[]:e.slice(o,o+gM).map(m=>m.slice(0,eg)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=cg(t)??(t.CI?"ci":r?"terminal":"script"),p=MDe(u,t);return{...i.length>0?{[Vf]:i}:{},...a?{[SS]:"pretty"}:{},[TS]:u,...p===void 0?{}:{[NA]:p}}}function MDe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,DS.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var Iee=k(function*(e,t,r,o){let i=yield*Wn;return yield*e.pipe(Ec(s=>DDe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),DDe=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*pi([TM,kDe,Wn]),s=vDe(e,{[yS]:See(t.argv,t.root),[ES]:i-t.startedAt,...LDe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*FDe(s)))return;let a=yield*(yield*yt).resolveApiUrl,u={...s,[fS]:"1.213.0",[hS]:process.platform==="win32"?"windows":process.platform,[gS]:process.versions.node,[Tp]:FS.traceId,[Ip]:FS.spanId},p=BDe(t.startedAt),m=yield*wDe(p.length>0?{...u,spans:p}:u).pipe(Ln),g=yield*zi(process.execPath,["-e",HDe,`${a}${JZ.url}`,jDe(m,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Xs(g.unref)},e=>e.pipe(uo,hc)),FDe=k(function*(e){let t=yield*tD;if(t!==void 0)return t;let r=yield*yt,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*TM)||e[Ra]!==0)return!1;yield*jn($De);let i=yield*go(yE({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),tD=es("TSUGA_TELEMETRY").pipe(Kl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),Ln),$De="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function BDe(e){let t=new Set(MS.map(r=>r[Ip]));return MS.map(({startTimeMs:r,...o})=>({...o,[dd]:t.has(o[dd])?o[dd]:FS.spanId,start_offset_ms:Math.max(0,r-e)}))}function GDe(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,eg);try{return JSON.stringify(e)?.slice(0,eg)}catch{return}}var Tee=process.platform==="win32"?15e3:1e5;function jDe(e,t){if(Buffer.byteLength(e)<=Tee)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=Tee?r:JSON.stringify({...t,[Vf]:void 0})}var qDe=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},HDe=`(${qDe.toString()})()`;function bee(e){return e.message.includes(LJ)}var xee=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function Oee(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
|
|
286
286
|
`):""}var Aee={CLUSTER_AGGREGATION_STRUCTURE:["Compare the body with a generated one: tsuga aggregation <scalar|timeseries> --generate-skeleton"],TAG_POLICY_ALREADY_EXISTS_ERROR:["Find the existing policy ID with tsuga tag-policies list, then run tsuga tag-policies update <ID> -f policy.json"],URL_NOT_FOUND:["Update the CLI: tsuga self-update"]};function Cee(e){return e!==void 0&&Object.hasOwn(Aee,e)?Aee[e]??[]:[]}function KDe(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function zDe({body:e,query:t}){let r=t?.offset??e?.offset,o=typeof r=="string"?Number(r):r;return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?o:0}var YDe=dn({data:bt(Lc),requestId:bt(Se),error:bt(dn({message:Se,statusCode:bt(Dc),code:bt(Se),details:bt(Lc),hint:bt(Se),docUrl:bt(Se)})),metadata:bt(dn({pagination:bt(dn({totalCount:Dc,pageCount:bt(Dc)}))}))}),VDe=jo(YDe);function WDe(e,t,r){let o=e.metadata?.pagination,i=o===void 0?void 0:Pee(e.data);if(o===void 0||i===void 0)return;let s=t+i.length;if(!(s>=o.totalCount))return`Showing ${i.length} of ${o.totalCount} (offset ${t}). Next page: ${QDe(r,i.length,s)}`}function Pee(e){if(Array.isArray(e))return e;let t=e!==null&&typeof e=="object"?Object.values(e):[],[r]=t;return t.length===1&&Array.isArray(r)?r:void 0}function QDe(e,t,r){let o=[];for(let i=0;i<e.length;i++){let s=e[i]??"";if(s==="--operation-api-key"){o.push(s,"<OPERATION_API_KEY>"),i++;continue}if(s.startsWith("--operation-api-key=")){o.push("--operation-api-key=<OPERATION_API_KEY>");continue}if(s==="--limit"||s==="--offset"){i++;continue}s.startsWith("--limit=")||s.startsWith("--offset=")||o.push(s)}return["tsuga",...o,"--limit",String(t),"--offset",String(r)].map(ZDe).join(" ")}function ZDe(e){return/^[\w./:=@%+,-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function XDe(e,t){let r=Math.round(t/gd);switch(e){case 504:return new xp({message:`The API gave up on the request after ${r}s (HTTP 504): it ran longer than the gateway allows.`,statusCode:e,suggestions:["Narrow the time range or add filters to the query","Ask for fewer results"]});case 502:case 503:return new xp({message:`The API gateway could not reach the server (HTTP ${e}).`,statusCode:e,suggestions:["Retry in a few seconds"]});default:return new xp({message:`Server returned a non-JSON response (HTTP ${e}).`,statusCode:e})}}var Ree=v("api.endpoint")(function*(e,t={}){yield*Sc(eD(e,t,void 0));let{data:r,metadata:o}=t.allPages?yield*JDe(e,t):yield*Uee(e,t).pipe(Zs(i=>mt(function*(){let s=WDe(i,zDe(t),yield*bX);s!==void 0&&(yield*jn(s))})));return yield*Sc(eD(e,t,r)),{data:r,metadata:o}}),JDe=k(function*(e,t){if(eFe(t))return yield*new At({message:"--all cannot be combined with --limit or --offset"});let r=[];for(;;){let o=yield*Uee(e,tFe(e,t,r.length)),i=Pee(o.data),s=o.metadata?.pagination?.totalCount;if(i===void 0||s===void 0)return o;if(r.push(...i),i.length===0||r.length>=s)return{data:rFe(o.data,r),metadata:{pagination:{totalCount:r.length,pageCount:1}}}}});function eFe({body:e,query:t}){let r=e??{};return[t?.limit,t?.offset,r.limit,r.offset].some(o=>o!==void 0)}function tFe(e,t,r){let o={limit:Sp,offset:r};return e.body!==void 0&&n.IsObject(e.body)&&"offset"in e.body.properties?{...t,body:{...t.body,...o}}:{...t,query:{...t.query,...o}}}function rFe(e,t){if(Array.isArray(e))return t;let[r]=Object.keys(e);return{[r??"data"]:t}}var Uee=k(function*(e,t){let r=yield*wa,o=yield*yt,i=yield*Jl,s=yield*o.resolve({operationApiKey:r.operationApiKey,clusterId:r.cluster}),{credential:a}=s;if(a===void 0)return yield*new bp({message:"No credentials.",suggestions:eC});let u=a.kind==="operation-api-key"?a.token:(yield*AC(s.apiUrl,a.userAuth)).accessToken,p=r.rationale?KDe(r.rationale):"",m=yield*OJ(s.apiUrl,"cli",e,s.clusterId===void 0?t:oFe(e,t,s.clusterId),{Authorization:`Bearer ${u}`,...p?{[nM]:p}:{}}),g=yield*Wn,y=yield*i.execute(m).pipe(tt(S=>new Ua({message:`Could not reach ${s.apiUrl}`,cause:S}))),E=(yield*Wn)-g,h=yield*y.json.pipe(G(VDe),tt(()=>XDe(y.status,E)));if(yield*z2("API response").pipe(Y2({method:m.method,url:m.url,status:y.status,requestId:h.requestId})),h.error){let S=h.error.statusCode??y.status,_;S===401?_=[`Replace the rejected credential: ${a.kind==="operation-api-key"?nFe[a.source]:"tsuga auth login"}`]:S===403?_=[`Inspect your identity and permissions: ${r.operationApiKey?"tsuga --operation-api-key <OPERATION_API_KEY> auth whoami":"tsuga auth whoami"}`]:_=Cee(h.error.code);let{hint:T,docUrl:I}=h.error,b=[..._,...T?[T]:[],...I?[`See ${I}`]:[]];return yield*Ps.fromErrorResponse({...h.error,...b.length>0?{suggestions:b}:{}},h.requestId)}return h}),nFe={flag:"tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>",environment:"export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>",config:"tsuga auth operation-key <OPERATION_API_KEY>"},er=k(function*(e,t={}){return(yield*Ze(e,t)).data}),Ze=k(function*(e,t={}){return yield*Ree(e,t).pipe(li("ApiError",r=>mt(function*(){if(!bee(r))return yield*r;let o=yield*Ree(bC).pipe(X(i=>i.data),di(()=>[]));return yield*Ps.fromErrorResponse({message:`${r.message}${Oee(o)}`,statusCode:r.statusCode,code:r.code,details:r.details,suggestions:xee},r.requestId)})))});function oFe(e,t,r){return e.body!==void 0&&n.IsObject(e.body)&&"clusterId"in e.body.properties?{...t,body:{clusterId:r,...t.body}}:{...t,query:{clusterId:r,...t.query}}}var iFe="Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.",rD=(e,t)=>Et({try:()=>JSON.parse(t),catch:r=>new At({message:`${e} is not valid JSON: ${r instanceof Error?r.message:String(r)}`})}),eu=k(function*(e){if(wt(e.file)&&wt(e.data))return yield*new At({message:"-f and -d cannot be combined. Provide the request body with one of them."});let t=ue(e.file);if(t!==void 0){if(t==="-"){let s=yield*Qm,a=yield*Ul(s.stdin).pipe(wl,tt(u=>new At({message:`Could not read stdin: ${u.message}`})));return yield*rD("stdin",a)}let i=yield*(yield*tn).readFileString(t).pipe(tt(s=>new At({message:`Could not read ${t}: ${s.message}`})));return yield*rD(t,i)}let r=ue(e.data);return r!==void 0?yield*rD("--data",r):yield*new At({message:iFe})});function kC(e){return c.HasPropertyKey(e,"~refine")&&c.IsArray(e["~refine"])&&c.Every(e["~refine"],0,t=>c.IsObject(t)&&c.HasPropertyKey(t,"check")&&c.HasPropertyKey(t,"error")&&c.IsFunction(t.check)&&c.IsFunction(t.error))}function ko(e){return c.IsObject(e)&&!c.IsArray(e)}function Rd(e){return c.IsBoolean(e)}function Ue(e){return ko(e)||Rd(e)}function LC(e){return c.HasPropertyKey(e,"additionalItems")&&Ue(e.additionalItems)}function Na(e){return c.HasPropertyKey(e,"additionalProperties")&&Ue(e.additionalProperties)}function MC(e){return c.HasPropertyKey(e,"allOf")&&c.IsArray(e.allOf)&&e.allOf.every(t=>Ue(t))}function wee(e){return c.HasPropertyKey(e,"$anchor")&&c.IsString(e.$anchor)}function DC(e){return c.HasPropertyKey(e,"anyOf")&&c.IsArray(e.anyOf)&&e.anyOf.every(t=>Ue(t))}function nD(e){return c.HasPropertyKey(e,"const")}function Rp(e){return c.HasPropertyKey(e,"contains")&&Ue(e.contains)}function xi(e){return c.HasPropertyKey(e,"default")}function oD(e){return c.HasPropertyKey(e,"dependencies")&&c.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>Ue(t)||c.IsArray(t)&&t.every(r=>c.IsString(r)))}function iD(e){return c.HasPropertyKey(e,"dependentRequired")&&c.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>c.IsArray(t)&&t.every(r=>c.IsString(r)))}function FC(e){return c.HasPropertyKey(e,"dependentSchemas")&&c.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Ue(t))}function Pp(e){return c.HasPropertyKey(e,"$dynamicAnchor")&&c.IsString(e.$dynamicAnchor)}function $C(e){return c.HasPropertyKey(e,"$dynamicRef")&&c.IsString(e.$dynamicRef)}function BC(e){return c.HasPropertyKey(e,"else")&&Ue(e.else)}function sD(e){return c.HasPropertyKey(e,"enum")&&c.IsArray(e.enum)}function aD(e){return c.HasPropertyKey(e,"exclusiveMaximum")&&(c.IsNumber(e.exclusiveMaximum)||c.IsBigInt(e.exclusiveMaximum))}function tu(e){return c.HasPropertyKey(e,"exclusiveMinimum")&&(c.IsNumber(e.exclusiveMinimum)||c.IsBigInt(e.exclusiveMinimum))}function $S(e){return c.HasPropertyKey(e,"format")&&c.IsString(e.format)}function To(e){return c.HasPropertyKey(e,"$id")&&c.IsString(e.$id)}function GC(e){return c.HasPropertyKey(e,"if")&&Ue(e.if)}function Pd(e){return c.HasPropertyKey(e,"items")&&(Ue(e.items)||c.IsArray(e.items)&&e.items.every(t=>Ue(t)))}function jC(e){return Pd(e)&&c.IsArray(e.items)}function cD(e){return c.HasPropertyKey(e,"maximum")&&(c.IsNumber(e.maximum)||c.IsBigInt(e.maximum))}function uD(e){return c.HasPropertyKey(e,"maxContains")&&c.IsNumber(e.maxContains)}function qC(e){return c.HasPropertyKey(e,"maxItems")&&c.IsNumber(e.maxItems)}function pD(e){return c.HasPropertyKey(e,"maxLength")&&c.IsNumber(e.maxLength)}function lD(e){return c.HasPropertyKey(e,"maxProperties")&&c.IsNumber(e.maxProperties)}function ru(e){return c.HasPropertyKey(e,"minimum")&&(c.IsNumber(e.minimum)||c.IsBigInt(e.minimum))}function Ud(e){return c.HasPropertyKey(e,"minContains")&&c.IsNumber(e.minContains)}function Sg(e){return c.HasPropertyKey(e,"minItems")&&c.IsNumber(e.minItems)}function BS(e){return c.HasPropertyKey(e,"minLength")&&c.IsNumber(e.minLength)}function GS(e){return c.HasPropertyKey(e,"minProperties")&&c.IsNumber(e.minProperties)}function dD(e){return c.HasPropertyKey(e,"multipleOf")&&(c.IsNumber(e.multipleOf)||c.IsBigInt(e.multipleOf))}function HC(e){return c.HasPropertyKey(e,"not")&&Ue(e.not)}function KC(e){return c.HasPropertyKey(e,"oneOf")&&c.IsArray(e.oneOf)&&e.oneOf.every(t=>Ue(t))}function jS(e){return c.HasPropertyKey(e,"pattern")&&(c.IsString(e.pattern)||e.pattern instanceof RegExp)}function Tg(e){return c.HasPropertyKey(e,"patternProperties")&&c.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Ue(t))}function wd(e){return c.HasPropertyKey(e,"prefixItems")&&c.IsArray(e.prefixItems)&&e.prefixItems.every(t=>Ue(t))}function _g(e){return c.HasPropertyKey(e,"properties")&&c.IsObject(e.properties)&&Object.values(e.properties).every(t=>Ue(t))}function zC(e){return c.HasPropertyKey(e,"propertyNames")&&(c.IsObject(e.propertyNames)||Ue(e.propertyNames))}function sFe(e){return c.HasPropertyKey(e,"$recursiveAnchor")&&c.IsBoolean(e.$recursiveAnchor)}function qS(e){return sFe(e)&&c.IsEqual(e.$recursiveAnchor,!0)}function YC(e){return c.HasPropertyKey(e,"$recursiveRef")&&c.IsString(e.$recursiveRef)}function VC(e){return c.HasPropertyKey(e,"$ref")&&c.IsString(e.$ref)}function vd(e){return c.HasPropertyKey(e,"required")&&c.IsArray(e.required)&&e.required.every(t=>c.IsString(t))}function WC(e){return c.HasPropertyKey(e,"then")&&Ue(e.then)}function mD(e){return c.HasPropertyKey(e,"type")&&(c.IsString(e.type)||c.IsArray(e.type)&&e.type.every(t=>c.IsString(t)))}function Ig(e){return c.HasPropertyKey(e,"uniqueItems")&&c.IsBoolean(e.uniqueItems)}function HS(e){return c.HasPropertyKey(e,"unevaluatedItems")&&Ue(e.unevaluatedItems)}function KS(e){return c.HasPropertyKey(e,"unevaluatedProperties")&&Ue(e.unevaluatedProperties)}var _o=class{constructor(){let t=new Set,r=new Set;this.stack=[{indices:t,keys:r}]}Push(){let t=new Set,r=new Set;return this.stack.push({indices:t,keys:r}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let r of t)r.GetIndices().forEach(o=>this.GetIndices().add(o)),r.GetKeys().forEach(o=>this.GetKeys().add(o));return!0}},Hn=class extends _o{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=qr.Get().maxErrors}AddError(t,r,o,i){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:o,params:i})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function vee(e,t,r,o){return c.Every(r["~refine"],0,(i,s)=>i.check(o))}function Nee(e,t,r,o,i,s){return c.EveryAll(i["~refine"],0,(a,u)=>a.check(s)||t.AddError("~refine",r,o,{index:u,message:a.error(s)}))}var zS="urn:typebox:root";function nu(e,t){return URL.canParse(e,t)?new URL(e,t):c.IsEqual(t,zS)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function xg(e,t){let r=ko(t)&&To(t)?nu(t.$id,zS).href:zS;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function fD(e,t,r=!0){if(Rd(t))return e;if(Array.isArray(t))return t.reduce((i,s)=>fD(i,s,!1),e);if(!ko(t)||!r&&To(t))return e;let o=!r&&Pp(t)?[...e,t]:e;return Object.keys(t).reduce((i,s)=>fD(i,t[s],!1),o)}function YS(e,t){return e.resourceEntries.get(t)}function kee(e,t){return e.enteredResource||YS(e,t)!==void 0}function aFe(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function cFe(e,t){return To(t)?[...e.ids,t]:e.ids}function uFe(e,t){return e.recursiveAnchor??(qS(t)?t:void 0)}function pFe(e,t){let r=To(t)?fD(e.dynamicAnchors,t):e.dynamicAnchors;return Pp(t)?[...r,t]:r}function lFe(e,t){return To(t)?!1:e.pendingResource}function Lee(e,t){let r=YS(e,t);return r?r.base:To(t)?nu(t.$id,e.lexicalBase).href:e.lexicalBase}function Mee(e,t){let r=YS(e,t);return r?r.base:To(t)&&e.pendingResource?nu(t.$id,e.resourceBase).href:e.resourceBase}function Dee(e,t){return To(t)?!aFe(t):e.useResourceBaseForReference}function dFe(e,t){let r=kee(e,t),o=Dee(e,t);return r||o?Mee(e,t):Lee(e,t)}function mFe(e,t){let r=YS(e,t);return r?r.root:To(t)?t:e.lexicalSchema}function fFe(e,t){return ko(t)&&(To(t)||Pp(t)||c.IsUndefined(e.recursiveAnchor)&&qS(t)||!c.IsUndefined(YS(e,t)))}function Og(e,t){return fFe(e,t)?{...e,ids:cFe(e,t),dynamicAnchors:pFe(e,t),recursiveAnchor:uFe(e,t),pendingResource:lFe(e,t),lexicalBase:Lee(e,t),resourceBase:Mee(e,t),useResourceBaseForReference:Dee(e,t),referenceBase:dFe(e,t),lexicalSchema:mFe(e,t),enteredResource:kee(e,t)}:e}function Fee(e){return Pd(e)&&c.IsArray(e.items)}function $ee(e,t,r,o){return Fee(r)?c.Every(o,0,(s,a)=>c.IsLessThan(a,r.items.length)||Oi(e,t,r.additionalItems,s)&&t.AddIndex(a)):!0}function Bee(e,t,r,o,i,s){return Fee(i)?c.Every(s,0,(u,p)=>{let m=`${r}/additionalItems`,g=`${o}/${p}`;return c.IsLessThan(p,i.items.length)||Ai(e,t,m,g,i.additionalItems,u)&&t.AddIndex(p)}):!0}function Qo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Up(e){return new RegExp(e,"u")}function gFe(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Gee(e){let t=[];return Tg(e)&&t.push(...c.Keys(e.patternProperties)),_g(e)&&t.push(...c.Keys(e.properties).map(gFe)),c.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function jee(e,t,r,o){let i=Up(Gee(r));return c.Every(c.Keys(o),0,(a,u)=>i.test(a)||Oi(e,t,r.additionalProperties,o[a])&&t.AddKey(a))}function qee(e,t,r,o,i,s){let a=Up(Gee(i)),u=[];return c.EveryAll(c.Keys(s),0,(m,g)=>{let y=`${r}/additionalProperties`,E=`${o}/${Qo(m)}`,h=a.test(m)||Ai(e,t,y,E,i.additionalProperties,s[m])&&t.AddKey(m);return h||u.push(m),h})||t.AddError("additionalProperties",r,o,{additionalProperties:u})}function Hee(e,t,r,o){let i=r.allOf.reduce((s,a)=>{let u=new _o;return ct(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function Kee(e,t,r,o,i,s){let a=[],u=i.allOf.reduce((m,g,y)=>{let E=`${r}/allOf/${y}`,h=new Hn,S=qt(e,h,E,o,g,s);return S||a.push(h),S?[...m,h]:m},[]),p=c.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return p||a.forEach(m=>t.AddErrors(m.GetErrors())),p}function zee(e,t,r,o){let i=r.anyOf.reduce((s,a)=>{let u=new _o;return ct(e,u,a,o)?[...s,u]:s},[]);return c.IsGreaterThan(i.length,0)&&t.Merge(i)}function Yee(e,t,r,o,i,s){let a=[],u=i.anyOf.reduce((m,g,y)=>{let E=new Hn,h=`${r}/anyOf/${y}`,S=qt(e,E,h,o,g,s);return S||a.push(E),S?[...m,E]:m},[]),p=c.IsGreaterThan(u.length,0)&&t.Merge(u);return p||a.forEach(m=>t.AddErrors(m.GetErrors())),p||t.AddError("anyOf",r,o,{})}function yD(e,t,r,o){return r}function Vee(e,t,r,o,i,s){return yD(e,t,i,s)||t.AddError("boolean",r,o,{})}function ED(e,t,r,o){return c.IsValueLike(r.const)?c.IsEqual(o,r.const):c.IsDeepEqual(o,r.const)}function Wee(e,t,r,o,i,s){return ED(e,t,i,s)||t.AddError("const",r,o,{allowedValue:i.const})}function hFe(e){return!(Ud(e)&&c.IsEqual(e.minContains,0))}function SD(e,t,r,o){return hFe(r)?!c.IsEqual(o.length,0)&&c.SomeAll(o,(i,s)=>ct(e,t,r.contains,i)&&t.AddIndex(s)):!0}function Qee(e,t,r,o,i,s){return SD(e,t,i,s)||t.AddError("contains",r,o,{minContains:1})}function Zee(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependencies),0,([a,u])=>!c.HasPropertyKey(o,a)||(c.IsArray(u)?u.every(p=>c.HasPropertyKey(o,p)):ct(e,t,u,o)));return i||s}function Xee(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependencies),0,([p,m])=>{let g=`${r}/dependencies/${Qo(p)}`;return!c.HasPropertyKey(s,p)||(c.IsArray(m)?m.every(y=>c.HasPropertyKey(s,y)||t.AddError("dependencies",r,o,{property:p,dependencies:m})):qt(e,t,g,o,m,s))});return a||u}function Jee(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentRequired),0,([a,u])=>!c.HasPropertyKey(o,a)||u.every(p=>c.HasPropertyKey(o,p)));return i||s}function ete(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentRequired),0,([p,m])=>!c.HasPropertyKey(s,p)||c.EveryAll(m,0,g=>c.HasPropertyKey(s,g)||t.AddError("dependentRequired",r,o,{property:p,dependencies:m})));return a||u}function tte(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentSchemas),0,([a,u])=>!c.HasPropertyKey(o,a)||ct(e,t,u,o));return i||s}function rte(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentSchemas),0,([p,m])=>{let g=`${r}/dependentSchemas/${Qo(p)}`;return!c.HasPropertyKey(s,p)||qt(e,t,g,o,m,s)});return a||u}var ns={};Pi(ns,{DynamicRef:()=>YFe,RecursiveRef:()=>HFe,Ref:()=>jFe});var Cg={};Pi(Cg,{Delete:()=>TFe,Get:()=>EFe,Has:()=>yFe,Indices:()=>WS,Set:()=>SFe});function ote(e){throw Error(e)}function nte(){ote("Pointer contains unsafe property key")}function TD(){ote("Cannot set value")}function WS(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function yFe(e,t){let r=e;for(let o of WS(t)){if(!c.IsObject(r)||!c.HasPropertyKey(r,o))return!1;r=r[o]}return!0}function EFe(e,t){let r=e;for(let o of WS(t)){if(!c.IsObject(r)||c.IsUnsafePropertyKey(o))return;r=r[o]}return r}function ite(e,t,r){let o=e;for(let i of t)c.IsUnsafePropertyKey(i)&&nte(),o=c.IsObject(o)?o[i]:void 0;return c.IsUnsafePropertyKey(r)&&nte(),c.IsObject(o)||TD(),o}function SFe(e,t,r){let o=WS(t),i=o.pop();return c.IsUndefined(i)&&TD(),ite(e,o,i)[i]=r,e}function TFe(e,t){let r=WS(t),o=r.pop();c.IsUndefined(o)&&TD();let i=ite(e,r,o);return c.IsArray(i)&&/^(0|[1-9]\d*)$/.test(o)?i.splice(Number(o),1):delete i[o],e}function bD(e,t){return ko(e)&&To(e)?nu(e.$id,t.href):t}function xD(e){return nu(e,zS)}function _D(e){return e.href.split("#")[0]}function _Fe(e,t,r){return ID(e,xD(t),r)}function IFe(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function bFe(e){return e.startsWith("#/")}function ste(e,t){if(c.IsObject(e)&&Pp(e)&&c.IsEqual(e.$dynamicAnchor,t))return e;if(c.IsObject(e))for(let r of c.Keys(e)){let o=ste(e[r],t);if(o)return o}}function ID(e,t,r){if(c.IsEqual(e,r))return t.href;let o=bD(e,t);if(c.IsArray(e))for(let i of e){let s=ID(i,o,r);if(!c.IsUndefined(s))return s}else if(c.IsObject(e))for(let i of c.Keys(e)){let s=ID(e[i],o,r);if(!c.IsUndefined(s))return s}}function ate(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return Cg.Get(e,r)}function xFe(e,t,r){if(!To(e))return;if(c.IsEqual(e.$id,r.hash))return e;let o=new URL(r.href,t.href);if(c.IsEqual(t.pathname,o.pathname))return r.hash.startsWith("#")?ate(e,r):e}function OFe(e,t,r){if(!wee(e))return;let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function AFe(e,t,r){if(!Pp(e))return;let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function CFe(e,t,r){if(ko(e))return xFe(e,t,r)??OFe(e,t,r)??AFe(e,t,r)??ate(e,r)}function RFe(e,t,r){if(c.IsArray(e))return e.reduce((o,i)=>{let s=QC(i,t,r);return c.IsUndefined(s)?o:s},void 0)}function PFe(e,t,r){if(c.IsObject(e))return c.Keys(e).reduce((o,i)=>{if(c.IsEqual(i,"const")||c.IsEqual(i,"enum"))return o;let s=QC(e[i],t,r);return c.IsUndefined(s)?o:s},void 0)}function QC(e,t,r){let o=bD(e,t);return CFe(e,o,r)??RFe(e,o,r)??PFe(e,o,r)}function UFe(e,t,r,o){let i=ZC(e,t,r,o);return ko(i)&&To(i)?i:void 0}function wFe(e,t,r){if(!t.$ref.startsWith("#")||!ko(e.schema)||c.HasPropertyKey(e.schema,"$schema"))return;let o=_Fe(e.lexicalSchema,e.referenceBase,r);if(!(c.IsUndefined(o)||c.IsEqual(o,e.referenceBase)))return{target:r,base:o,root:e.lexicalSchema}}function vFe(e,t,r){let o=e.context[t];if(ko(o))return{target:r,base:t,root:o}}function NFe(e,t,r,o,i){let s=i?vFe(e,o,r):void 0;return c.IsUndefined(s)?wFe(e,t,r):s}function kFe(e,t,r){if(To(r))return;let o=UFe(e.context,e.schema,e.referenceBase,t);if(!(!o||e.ids.includes(o)))return{resource:o}}function LFe(e,t){return c.HasPropertyKey(e,t)?e[t]:void 0}function MFe(e,t,r){return QC(e,t,r)}function DFe(e,t,r){let o=_D(r);if(!c.HasPropertyKey(e,o)||c.IsEqual(o,_D(t)))return;let i=e[o],s=bD(i,new URL(o));return c.IsEqual(r.hash,"")?i:QC(i,s,r)}function ZC(e,t,r,o){let i=xD(r),s=nu(o,i.href);return LFe(e,o)??MFe(t,i,s)??DFe(e,i,s)}function FFe(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function $Fe(e,t){return t?Og(e,t.resource):e}function cte(e,t,r,o){let i=FFe({...e,pendingResource:t},r);return $Fe(i,o)}function BFe(e,t,r){let o=_D(nu(t.$ref,e.referenceBase)),i=!c.IsEqual(o,e.resourceBase),s=NFe(e,t,r,o,i),a=i?kFe(e,o,r):void 0;return{schema:r,stack:cte(e,!0,s,a)}}function GFe(e,t){return{schema:t,stack:cte(e,!c.IsUndefined(t))}}function jFe(e,t){let r=ZC(e.context,IFe(e,t),e.referenceBase,t.$ref);return ko(r)?BFe(e,t,r):GFe(e,r)}function qFe(e){return ko(e.lexicalSchema)&&qS(e.lexicalSchema)}function HFe(e,t){let r=qFe(e)?e.recursiveAnchor:e.lexicalSchema;return ZC(e.context,r,e.lexicalBase,t.$recursiveRef)}function ute(e,t){return nu(t.$dynamicRef,xD(e.lexicalBase).href).hash}function pte(e,t){return e.dynamicAnchors.find(r=>c.IsEqual(r.$dynamicAnchor,t))??ste(e.schema,t)}function KFe(e,t,r){if(!ko(r)||!Pp(r))return r;let o=ute(e,t);return bFe(o)?r:pte(e,r.$dynamicAnchor)}function zFe(e,t){let r=ute(e,t);return pte(e,decodeURIComponent(r.slice(1)))}function YFe(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,o=ZC(e.context,r,e.lexicalBase,t.$dynamicRef);return c.IsUndefined(o)?zFe(e,t):KFe(e,t,o)}function lte(e,t,r,o){let i=ns.DynamicRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Ue(i)&&ct(s,t,i,o)}function dte(e,t,r,o,i,s){let a=ns.DynamicRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Ue(a)&&qt(u,t,r,o,a,s)}function CD(e,t,r,o){return c.Some(r.enum,i=>c.IsValueLike(i)?c.IsEqual(o,i):c.IsDeepEqual(o,i))}function mte(e,t,r,o,i,s){return CD(e,t,i,s)||t.AddError("enum",r,o,{allowedValues:i.enum})}function RD(e,t,r,o){return c.IsLessThan(o,r.exclusiveMaximum)}function fte(e,t,r,o,i,s){return RD(e,t,i,s)||t.AddError("exclusiveMaximum",r,o,{comparison:"<",limit:i.exclusiveMaximum})}function PD(e,t,r,o){return c.IsGreaterThan(o,r.exclusiveMinimum)}function gte(e,t,r,o,i,s){return PD(e,t,i,s)||t.AddError("exclusiveMinimum",r,o,{comparison:">",limit:i.exclusiveMinimum})}var JS={};Pi(JS,{Clear:()=>jte,Entries:()=>D$e,Get:()=>B$e,Has:()=>$$e,IsDate:()=>Rg,IsDateTime:()=>XC,IsDuration:()=>JC,IsEmail:()=>eR,IsHostname:()=>cR,IsIPv4:()=>lR,IsIPv6:()=>dR,IsIdnEmail:()=>uR,IsIdnHostname:()=>pR,IsIri:()=>mR,IsIriReference:()=>wg,IsJsonPointer:()=>gR,IsJsonPointerUriFragment:()=>fR,IsRegex:()=>hR,IsRelativeJsonPointer:()=>yR,IsTime:()=>Pg,IsUri:()=>TR,IsUriReference:()=>ER,IsUriTemplate:()=>SR,IsUrl:()=>_R,IsUuid:()=>IR,Reset:()=>qte,Set:()=>F$e,Test:()=>G$e});var VFe=[0,31,28,31,30,31,30,31,31,30,31,30,31],WFe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function QFe(e){return e%4===0&&(e%100!==0||e%400===0)}function Rg(e){let t=WFe.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&QFe(r)?29:VFe[o])}var ZFe=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Pg(e,t=!0){let r=ZFe.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let o=+r[1],i=+r[2],s=+r[3];if(o>23||i>59||s>60)return!1;if(r[5]){let g=+r[6],y=+r[7];if(g>23||y>59)return!1}if(s<60)return!0;let a=r[5]==="-"?-1:1,u=+(r[6]||0),p=+(r[7]||0);return((o*60+i-a*(u*60+p))%1440+1440)%1440===1439}var XFe=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function XC(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!XFe.test(e.slice(t)))return!1;let o=r.split(/T/i);return o.length===2&&Rg(o[0])&&Pg(o[1])}var JFe=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function JC(e){return JFe.test(e)}var e$e=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function eR(e){return e$e.test(e)}var hte=/^(?!-).*(?<!-)$/,yte=/^(?!..--)/,Ete=/^[a-zA-Z0-9-]*$/,TVt=new RegExp("^\\p{ASCII}*$","u"),Ug=/[^\p{ASCII}]/u;var t$e=/[0-9]/,Ste=/[\u{0660}-\u{0669}]/u,r$e=/[\u{06f0}-\u{06f9}]/u,n$e=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,o$e=/[\u{002d}\u{002b}]/u,UD=new RegExp("\\p{Mn}","u"),i$e=new RegExp("\\p{Mc}","u"),_Vt=new RegExp("\\p{Me}","u"),Tte=/[\p{Mn}\p{Mc}\p{Me}]/u,wD=new RegExp("\\p{L}","u"),s$e=new RegExp("\\p{Nd}","u"),_te=new RegExp("\\p{Script=Greek}","u"),tR=new RegExp("\\p{Script=Hebrew}","u"),Ite=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,bte=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,vD=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,xte=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,a$e=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,c$e=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,Ote=new RegExp([t$e,r$e].map(e=>e.source).join("|"),"u"),Ate=new RegExp([wD,o$e,n$e,s$e,UD,i$e,a$e,c$e].map(e=>e.source).join("|"),"u");function Cte(e){return hte.test(e)&&yte.test(e)&&Ete.test(e)}var vs=36,ZS=1,XS=26,p$e=38,l$e=700,Pte=72,Ute=128;function ND(){throw null}function rR(e){return e.toLowerCase().startsWith("xn--")}function wte(e,t,r){e=r?Math.floor(e/l$e):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(vs-ZS)*XS>>1;)e=Math.floor(e/(vs-ZS)),o+=vs;return o+Math.floor((vs-ZS+1)*e/(e+p$e))}function nR(e){let t=[],r=Ute,o=0,i=Pte,s=e.lastIndexOf("-");if(s>0)for(let u=0;u<s;u++){let p=e.charCodeAt(u);p>=128&&ND(),t.push(p)}let a=s<0?0:s+1;for(;a<e.length;){let u=o,p=1,m=vs;for(;;){a>=e.length&&ND();let y=e.charCodeAt(a++),E;y>=97&&y<=122?E=y-97:y>=48&&y<=57?E=y-48+26:ND(),o+=E*p;let h=m<=i?ZS:m>=i+XS?XS:m-i;if(E<h)break;p*=vs-h,m+=vs}let g=t.length+1;i=wte(o-u,g,u===0),r+=Math.floor(o/g),o%=g,t.splice(o,0,r),o++}return String.fromCodePoint(...t)}function Rte(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var d$e=new RegExp(Ug.source,"gu");function vte(e){let t=e.replace(d$e,""),r=t.length,o=r>0?[t,"-"]:[],i=Array.from(e,m=>m.codePointAt(0)),s=Ute,a=0,u=Pte,p=r;for(;p<i.length;){let m=1/0;for(let g of i)g>=s&&g<m&&(m=g);a+=(m-s)*(p+1),s=m;for(let g of i)if(g<s&&a++,g===s){let y=a;for(let E=vs;;E+=vs){let h=E<=u?ZS:E>=u+XS?XS:E-u;if(y<h)break;let S=h+(y-h)%(vs-h);o.push(Rte(S)),y=Math.floor((y-h)/(vs-h))}o.push(Rte(y)),u=wte(a,p+1,p===r),a=0,p++}a++,s++}return o.join("")}var m$e=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,Nte=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,f$e=/^(?:R|AL|AN)$/;function kte(e){if(rR(e))try{return oR(nR(e.slice(4).toLowerCase()))}catch{return!1}return oR(e)}function Lte(e){let t=String.fromCodePoint(e);return Ote.test(t)?"EN":Ste.test(t)?"AN":UD.test(t)?"NSM":tR.test(t)?"R":bte.test(t)?"AL":wD.test(t)?"L":"ON"}function oR(e){for(let t of e)if(f$e.test(Lte(t.codePointAt(0))))return!0;return!1}function iR(e){let t=!1,r=Nte,o=!1,i=!1,s=!0;for(let a of e){let u=Lte(a.codePointAt(0));if(s){if(u!=="L"&&u!=="R"&&u!=="AL")return!1;t=u==="R"||u==="AL",r=t?m$e:Nte,s=!1}if(!r.test(u))return!1;u==="EN"?o=!0:u==="AN"&&(i=!0)}return!(t&&o&&i)}function g$e(e){return Ug.test(e)&&vte(e).length+4>63}function h$e(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function sR(e){if(g$e(e)||oR(e)&&!iR(e))return!1;let t=[...e],r=t.map(s=>s.codePointAt(0)),o=r.length;if(h$e(t)||Tte.test(t[0]))return!1;let i=!1;for(let s=0;s<o;s++){let a=r[s],u=t[s];if(xte.test(u)||!Ate.test(u))return!1;Ite.test(u)&&(i=!0);let p=r[s-1],m=r[s+1];switch(a){case 183:if(p!==108||m!==108)return!1;break;case 885:if(!m||!_te.test(t[s+1]))return!1;break;case 1523:case 1524:if(!p||!tR.test(t[s-1]))return!1;break;case 8204:if(!p||p<128&&!vD.test(t[s-1]))return!1;break;case 8205:if(!p||!vD.test(t[s-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!i)}function aR(e){if(!rR(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=nR(t);return Ug.test(r)?sR(r):!1}catch{return!1}}function y$e(e){return e.length>0&&e.length<=63}function E$e(e){return y$e(e)&&(aR(e)||Cte(e))}function $te(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>E$e(t))}function S$e(e){return e.length>0&&e.length<=63}function T$e(e){return S$e(e)&&(aR(e)||sR(e))}function _$e(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function Bte(e){if(e.length===0||e.includes(" "))return!1;let t=_$e(e);if(t.length>253)return!1;let r=t.split("."),o=r.some(i=>kte(i));return r.every(i=>T$e(i)&&(!o||iR(i)))}function cR(e){return $te(e)}var I$e=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function uR(e){return I$e.test(e.normalize("NFC"))}function pR(e){return Bte(e)}var b$e=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function lR(e){return b$e.test(e)}var x$e=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function dR(e){return x$e.test(e)}var O$e=/[\x00-\x20\x7f"<>\^`{|}\\]|%(?![0-9a-fA-F]{2})/,A$e=/^(?:[a-z][a-z\d+\-.]*\/\/|(?!(?:[a-z][a-z\d+\-.]*:))[^/?#]*:)/i,C$e=/^(?:[a-z][a-z\d+\-.]*:)?\/\/[^/?#@]*@[^/?#@]*@/i,R$e=/^(?:[a-z][a-z\d+\-.]*:\/\/[^/?#]*\/|\/\/[^/?#]*\/|[a-z][a-z\d+\-.]*:(?!\/\/)|(?![a-z][a-z\d+\-.]*:|\/\/))[^?#]*[\[\]]/i;function wg(e){return!O$e.test(e)&&!A$e.test(e)&&!C$e.test(e)&&!R$e.test(e)&&URL.canParse(e,"http://example.com")}var P$e=/^[a-z][a-z\d+\-.]*:/i;function mR(e){return P$e.test(e)&&wg(e)}var U$e=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function fR(e){return U$e.test(e)}var w$e=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function gR(e){return w$e.test(e)}function hR(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var v$e=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function yR(e){return v$e.test(e)}var N$e=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ER(e){return N$e.test(e)}var k$e=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function SR(e){return k$e.test(e)}var L$e=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function TR(e){return L$e.test(e)}function _R(e){return URL.canParse(e)}var M$e=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function IR(e){return M$e.test(e)}var tr=new Map;function jte(){tr.clear()}function D$e(){return[...tr.entries()]}function F$e(e,t){tr.set(e,t)}function $$e(e){return tr.has(e)}function B$e(e){return tr.get(e)}function G$e(e,t){return tr.get(e)?.(t)??!0}function qte(){jte(),tr.set("date-time",XC),tr.set("date",Rg),tr.set("duration",JC),tr.set("email",eR),tr.set("hostname",cR),tr.set("idn-email",uR),tr.set("idn-hostname",pR),tr.set("ipv4",lR),tr.set("ipv6",dR),tr.set("iri-reference",wg),tr.set("iri",mR),tr.set("json-pointer-uri-fragment",fR),tr.set("json-pointer",gR),tr.set("regex",hR),tr.set("relative-json-pointer",yR),tr.set("time",Pg),tr.set("uri-reference",ER),tr.set("uri-template",SR),tr.set("uri",TR),tr.set("url",_R),tr.set("uuid",IR)}qte();function LD(e,t,r,o){return JS.Test(r.format,o)}function Hte(e,t,r,o,i,s){return LD(e,t,i,s)||t.AddError("format",r,o,{format:i.format})}function Kte(e,t,r,o){let i=WC(r)?r.then:!0,s=BC(r)?r.else:!0;return ct(e,t,r.if,o)?ct(e,t,i,o):ct(e,t,s,o)}function zte(e,t,r,o,i,s){let a=WC(i)?i.then:!0,u=BC(i)?i.else:!0,p=new Hn,m=qt(e,p,`${r}/if`,o,i.if,s)?qt(e,p,`${r}/then`,o,a,s)||t.AddError("if",r,o,{failingKeyword:"then"}):qt(e,t,`${r}/else`,o,u,s)||t.AddError("if",r,o,{failingKeyword:"else"});return m&&t.Merge([p]),m}function j$e(e,t,r,o){return c.Every(r.items,0,(i,s)=>c.IsLessEqualThan(o.length,s)||Oi(e,t,i,o[s])&&t.AddIndex(s))}function q$e(e,t,r,o,i,s){return c.EveryAll(i.items,0,(a,u)=>{let p=`${r}/items/${u}`,m=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||Ai(e,t,p,m,a,s[u])&&t.AddIndex(u)})}function H$e(e,t,r,o){let i=wd(r)?r.prefixItems.length:0;return c.Every(o,i,(s,a)=>Oi(e,t,r.items,s)&&t.AddIndex(a))}function K$e(e,t,r,o,i,s){let a=wd(i)?i.prefixItems.length:0;return c.EveryAll(s,a,(u,p)=>{let m=`${r}/items`,g=`${o}/${p}`;return Ai(e,t,m,g,i.items,u)&&t.AddIndex(p)})}function Yte(e,t,r,o){return jC(r)?j$e(e,t,r,o):H$e(e,t,r,o)}function Vte(e,t,r,o,i,s){return jC(i)?q$e(e,t,r,o,i,s):K$e(e,t,r,o,i,s)}function z$e(e){return Rp(e)}function MD(e,t,r,o){if(!z$e(r))return!0;let i=c.Counted(o,s=>ct(e,t,r.contains,s));return c.IsLessEqualThan(i,r.maxContains)}function Wte(e,t,r,o,i,s){let a=Ud(i)?i.minContains:1;return MD(e,t,i,s)||t.AddError("contains",r,o,{minContains:a,maxContains:i.maxContains})}function DD(e,t,r,o){return c.IsLessEqualThan(o,r.maximum)}function Qte(e,t,r,o,i,s){return DD(e,t,i,s)||t.AddError("maximum",r,o,{comparison:"<=",limit:i.maximum})}function FD(e,t,r,o){return c.IsLessEqualThan(o.length,r.maxItems)}function Zte(e,t,r,o,i,s){return FD(e,t,i,s)||t.AddError("maxItems",r,o,{limit:i.maxItems})}function $D(e,t,r,o){return c.IsMaxLength(o,r.maxLength)}function Xte(e,t,r,o,i,s){return $D(e,t,i,s)||t.AddError("maxLength",r,o,{limit:i.maxLength})}function BD(e,t,r,o){return c.IsLessEqualThan(c.Keys(o).length,r.maxProperties)}function Jte(e,t,r,o,i,s){return BD(e,t,i,s)||t.AddError("maxProperties",r,o,{limit:i.maxProperties})}function Y$e(e){return Rp(e)}function GD(e,t,r,o){if(!Y$e(r))return!0;let i=c.Counted(o,(s,a)=>ct(e,t,r.contains,s)&&t.AddIndex(a));return c.IsGreaterEqualThan(i,r.minContains)}function ere(e,t,r,o,i,s){return GD(e,t,i,s)||t.AddError("contains",r,o,{minContains:i.minContains})}function jD(e,t,r,o){return c.IsGreaterEqualThan(o,r.minimum)}function tre(e,t,r,o,i,s){return jD(e,t,i,s)||t.AddError("minimum",r,o,{comparison:">=",limit:i.minimum})}function qD(e,t,r,o){return c.IsGreaterEqualThan(o.length,r.minItems)}function rre(e,t,r,o,i,s){return qD(e,t,i,s)||t.AddError("minItems",r,o,{limit:i.minItems})}function HD(e,t,r,o){return c.IsMinLength(o,r.minLength)}function nre(e,t,r,o,i,s){return HD(e,t,i,s)||t.AddError("minLength",r,o,{limit:i.minLength})}function KD(e,t,r,o){return c.IsGreaterEqualThan(c.Keys(o).length,r.minProperties)}function ore(e,t,r,o,i,s){return KD(e,t,i,s)||t.AddError("minProperties",r,o,{limit:i.minProperties})}function zD(e,t,r,o){return c.IsMultipleOf(o,r.multipleOf)}function ire(e,t,r,o,i,s){return zD(e,t,i,s)||t.AddError("multipleOf",r,o,{multipleOf:i.multipleOf})}function YD(e,t,r,o){let i=new _o;return!ct(e,i,r.not,o)&&t.Merge([i])}function sre(e,t,r,o,i,s){return YD(e,t,i,s)||t.AddError("not",r,o,{})}function are(e,t,r,o){let i=r.oneOf.reduce((s,a)=>{let u=new _o;return ct(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,1)&&t.Merge(i)}function cre(e,t,r,o,i,s){let a=[],u=[],p=i.oneOf.reduce((g,y,E)=>{let h=new Hn,S=`${r}/oneOf/${E}`,_=qt(e,h,S,o,y,s);return _&&u.push(E),_||a.push(h),_?[...g,h]:g},[]),m=c.IsEqual(p.length,1)&&t.Merge(p);return!m&&c.IsEqual(u.length,0)&&a.forEach(g=>t.AddErrors(g.GetErrors())),m||t.AddError("oneOf",r,o,{passingSchemas:u})}function VD(e,t,r,o){return(c.IsString(r.pattern)?Up(r.pattern):r.pattern).test(o)}function ure(e,t,r,o,i,s){return VD(e,t,i,s)||t.AddError("pattern",r,o,{pattern:i.pattern})}function pre(e,t,r,o){return c.Every(c.Entries(r.patternProperties),0,([i,s])=>{let a=Up(i);return c.Every(c.Entries(o),0,([u,p])=>!a.test(u)||Oi(e,t,s,p)&&t.AddKey(u))})}function lre(e,t,r,o,i,s){return c.EveryAll(c.Entries(i.patternProperties),0,([a,u])=>{let p=`${r}/patternProperties/${Qo(a)}`,m=Up(a);return c.EveryAll(c.Entries(s),0,([g,y])=>{let E=`${o}/${Qo(g)}`;return!m.test(g)||Ai(e,t,p,E,u,y)&&t.AddKey(g)})})}function dre(e,t,r,o){return c.IsEqual(o.length,0)||c.Every(r.prefixItems,0,(i,s)=>c.IsLessEqualThan(o.length,s)||Oi(e,t,i,o[s])&&t.AddIndex(s))}function mre(e,t,r,o,i,s){return c.IsEqual(s.length,0)||c.EveryAll(i.prefixItems,0,(a,u)=>{let p=`${r}/prefixItems/${u}`,m=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||Ai(e,t,p,m,a,s[u])&&t.AddIndex(u)})}function WD(e,t){return e.includes(t)||qr.Get().exactOptionalPropertyTypes}function QD(e,t){return c.IsUndefined(e[t])}function fre(e,t,r,o){let i=vd(r)?r.required:[];return c.Every(c.Entries(r.properties),0,([a,u])=>{let p=!c.HasPropertyKey(o,a)||Oi(e,t,u,o[a])&&t.AddKey(a);return WD(i,a)?p:QD(o,a)||p})}function gre(e,t,r,o,i,s){let a=vd(i)?i.required:[];return c.EveryAll(c.Entries(i.properties),0,([p,m])=>{let g=`${r}/properties/${Qo(p)}`,y=`${o}/${Qo(p)}`,E=()=>!c.HasPropertyKey(s,p)||Ai(e,t,g,y,m,s[p])&&t.AddKey(p);return WD(a,p)?E():QD(s,p)||E()})}function hre(e,t,r,o){return c.Every(c.Keys(o),0,(i,s)=>ct(e,t,r.propertyNames,i))}function yre(e,t,r,o,i,s){let a=[];return c.EveryAll(c.Keys(s),0,(p,m)=>{let g=`${o}/${Qo(p)}`,y=`${r}/propertyNames`,E=qt(e,t,y,g,i.propertyNames,p);return E||a.push(p),E})||t.AddError("propertyNames",r,o,{propertyNames:a})}function Ere(e,t,r,o){let i=ns.RecursiveRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Ue(i)&&ct(s,t,i,o)}function Sre(e,t,r,o,i,s){let a=ns.RecursiveRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Ue(a)&&qt(u,t,r,o,a,s)}function Tre(e,t,r,o){let i=ns.Ref(e,r),s=i.schema??!1,a=new _o,u=Ue(s)&&ct(i.stack,a,s,o);return u&&t.Merge([a]),u}function _re(e,t,r,o,i,s){let a=ns.Ref(e,i),u=a.schema??!1,p=new Hn,m=Ue(u)&&qt(a.stack,p,r,o,u,s);return m&&t.Merge([p]),m||t.AddErrors(p.GetErrors()),m}function Ire(e,t,r,o){return c.Every(r.required,0,i=>c.HasPropertyKey(o,i))}function bre(e,t,r,o,i,s){let a=[];return c.EveryAll(i.required,0,p=>{let m=c.HasPropertyKey(s,p);return m||a.push(p),m})||t.AddError("required",r,o,{requiredProperties:a})}function ZD(e,t,r,o,i){return c.IsEqual(r,"object")?c.IsObjectNotArray(i):c.IsEqual(r,"array")?c.IsArray(i):c.IsEqual(r,"boolean")?c.IsBoolean(i):c.IsEqual(r,"integer")?c.IsInteger(i):c.IsEqual(r,"number")?c.IsNumber(i):c.IsEqual(r,"null")?c.IsNull(i):c.IsEqual(r,"string")?c.IsString(i):c.IsEqual(r,"bigint")?c.IsBigInt(i):c.IsEqual(r,"constructor")?c.IsConstructor(i):c.IsEqual(r,"function")?c.IsFunction(i):c.IsEqual(r,"symbol")?c.IsSymbol(i):c.IsEqual(r,"undefined")?c.IsUndefined(i):c.IsEqual(r,"void")?c.IsUndefined(i):!0}function xre(e,t,r,o,i){return c.Some(r,s=>ZD(e,t,s,o,i))}function Ore(e,t,r,o){return c.IsArray(r.type)?xre(e,t,r.type,r,o):ZD(e,t,r.type,r,o)}function Are(e,t,r,o,i,s){return(c.IsArray(i.type)?xre(e,t,i.type,i,s):ZD(e,t,i.type,i,s))||t.AddError("type",r,o,{type:i.type})}function Cre(e,t,r,o){let i=t.GetIndices();return c.Every(o,0,(s,a)=>(i.has(a)||ct(e,t,r.unevaluatedItems,s))&&t.AddIndex(a))}function Rre(e,t,r,o,i,s){let a=t.GetIndices(),u=[];return c.EveryAll(s,0,(m,g)=>{let y=new Hn,E=(a.has(g)||qt(e,y,r,o,i.unevaluatedItems,m))&&t.AddIndex(g);return E||u.push(g),E})||t.AddError("unevaluatedItems",r,o,{unevaluatedItems:u})}function Pre(e,t,r,o){let i=t.GetKeys();return c.Every(c.Entries(o),0,([s,a])=>i.has(s)||ct(e,t,r.unevaluatedProperties,a)&&t.AddKey(s))}function Ure(e,t,r,o,i,s){let a=t.GetKeys(),u=[];return c.EveryAll(c.Entries(s),0,([m,g])=>{let y=new Hn,E=a.has(m)||qt(e,y,r,o,i.unevaluatedProperties,g)&&t.AddKey(m);return E||u.push(m),E})||t.AddError("unevaluatedProperties",r,o,{unevaluatedProperties:u})}function wre(e){return!c.IsEqual(e.uniqueItems,!1)}function vre(e,t,r,o){if(!wre(r))return!0;let i=new Set(o.map(pp.Hash)).size,s=o.length;return c.IsEqual(i,s)}function Nre(e,t,r,o,i,s){if(!wre(i))return!0;let a=new Set,u=s.reduce((m,g,y)=>{let E=pp.Hash(g);return a.has(E)?[...m,y]:(a.add(E),m)},[]);return c.IsEqual(u.length,0)||t.AddError("uniqueItems",r,o,{duplicateItems:u})}function Oi(e,t,r,o){return t.Push()&&ct(e,t,r,o)&&t.Pop()}function ct(e,t,r,o){let i=Og(e,r);return Rd(r)?yD(i,t,r,o):(!mD(r)||Ore(i,t,r,o))&&(!(c.IsObject(o)&&!c.IsArray(o))||(!vd(r)||Ire(i,t,r,o))&&(!Na(r)||jee(i,t,r,o))&&(!oD(r)||Zee(i,t,r,o))&&(!iD(r)||Jee(i,t,r,o))&&(!FC(r)||tte(i,t,r,o))&&(!Tg(r)||pre(i,t,r,o))&&(!_g(r)||fre(i,t,r,o))&&(!zC(r)||hre(i,t,r,o))&&(!GS(r)||KD(i,t,r,o))&&(!lD(r)||BD(i,t,r,o)))&&(!c.IsArray(o)||(!LC(r)||$ee(i,t,r,o))&&(!Rp(r)||SD(i,t,r,o))&&(!Pd(r)||Yte(i,t,r,o))&&(!Ud(r)||GD(i,t,r,o))&&(!uD(r)||MD(i,t,r,o))&&(!Sg(r)||qD(i,t,r,o))&&(!qC(r)||FD(i,t,r,o))&&(!wd(r)||dre(i,t,r,o))&&(!Ig(r)||vre(i,t,r,o)))&&(!c.IsString(o)||(!BS(r)||HD(i,t,r,o))&&(!pD(r)||$D(i,t,r,o))&&(!$S(r)||LD(i,t,r,o))&&(!jS(r)||VD(i,t,r,o)))&&(!(c.IsNumber(o)||c.IsBigInt(o))||(!tu(r)||PD(i,t,r,o))&&(!aD(r)||RD(i,t,r,o))&&(!ru(r)||jD(i,t,r,o))&&(!cD(r)||DD(i,t,r,o))&&(!dD(r)||zD(i,t,r,o)))&&(!VC(r)||Tre(i,t,r,o))&&(!YC(r)||Ere(i,t,r,o))&&(!$C(r)||lte(i,t,r,o))&&(!nD(r)||ED(i,t,r,o))&&(!sD(r)||CD(i,t,r,o))&&(!GC(r)||Kte(i,t,r,o))&&(!HC(r)||YD(i,t,r,o))&&(!MC(r)||Hee(i,t,r,o))&&(!DC(r)||zee(i,t,r,o))&&(!KC(r)||are(i,t,r,o))&&(!HS(r)||!c.IsArray(o)||Cre(i,t,r,o))&&(!KS(r)||!c.IsObject(o)||Pre(i,t,r,o))&&(!kC(r)||vee(i,t,r,o))}function Ai(e,t,r,o,i,s){return t.Push()&&qt(e,t,r,o,i,s)&&t.Pop()}function qt(e,t,r,o,i,s){if(t.AtCapacity())return!1;let a=Og(e,i);return Rd(i)?Vee(a,t,r,o,i,s):!!(+(!mD(i)||Are(a,t,r,o,i,s))&+(!(c.IsObject(s)&&!c.IsArray(s))||!!(+(!vd(i)||bre(a,t,r,o,i,s))&+(!Na(i)||qee(a,t,r,o,i,s))&+(!oD(i)||Xee(a,t,r,o,i,s))&+(!iD(i)||ete(a,t,r,o,i,s))&+(!FC(i)||rte(a,t,r,o,i,s))&+(!Tg(i)||lre(a,t,r,o,i,s))&+(!_g(i)||gre(a,t,r,o,i,s))&+(!zC(i)||yre(a,t,r,o,i,s))&+(!GS(i)||ore(a,t,r,o,i,s))&+(!lD(i)||Jte(a,t,r,o,i,s))))&+(!c.IsArray(s)||!!(+(!LC(i)||Bee(a,t,r,o,i,s))&+(!Rp(i)||Qee(a,t,r,o,i,s))&+(!Pd(i)||Vte(a,t,r,o,i,s))&+(!Ud(i)||ere(a,t,r,o,i,s))&+(!uD(i)||Wte(a,t,r,o,i,s))&+(!Sg(i)||rre(a,t,r,o,i,s))&+(!qC(i)||Zte(a,t,r,o,i,s))&+(!wd(i)||mre(a,t,r,o,i,s))&+(!Ig(i)||Nre(a,t,r,o,i,s))))&+(!c.IsString(s)||!!(+(!BS(i)||nre(a,t,r,o,i,s))&+(!pD(i)||Xte(a,t,r,o,i,s))&+(!$S(i)||Hte(a,t,r,o,i,s))&+(!jS(i)||ure(a,t,r,o,i,s))))&+(!(c.IsNumber(s)||c.IsBigInt(s))||!!(+(!tu(i)||gte(a,t,r,o,i,s))&+(!aD(i)||fte(a,t,r,o,i,s))&+(!ru(i)||tre(a,t,r,o,i,s))&+(!cD(i)||Qte(a,t,r,o,i,s))&+(!dD(i)||ire(a,t,r,o,i,s))))&+(!VC(i)||_re(a,t,r,o,i,s))&+(!YC(i)||Sre(a,t,r,o,i,s))&+(!$C(i)||dte(a,t,r,o,i,s))&+(!nD(i)||Wee(a,t,r,o,i,s))&+(!sD(i)||mte(a,t,r,o,i,s))&+(!GC(i)||zte(a,t,r,o,i,s))&+(!HC(i)||sre(a,t,r,o,i,s))&+(!MC(i)||Kee(a,t,r,o,i,s))&+(!DC(i)||Yee(a,t,r,o,i,s))&+(!KC(i)||cre(a,t,r,o,i,s))&+(!HS(i)||!c.IsArray(s)||Rre(a,t,r,o,i,s))&+(!KS(i)||!c.IsObject(s)||Ure(a,t,r,o,i,s)))&&(!kC(i)||Nee(a,t,r,o,i,s))}function bR(...e){let[t,r,o]=st.Match(e,{3:(g,y,E)=>[g,y,E],2:(g,y)=>[{},g,y]}),i=xg(t,r),s=new Hn,a=qt(i,s,"#","",r,o),u=s.GetErrors(),p=Q3(),m=u.map(g=>({...g,message:p(g)}));return[a,m]}var kre=0;function JD(){let e=uO();kre=e.maxErrors,e.maxErrors=e.maxParseErrors}function eF(){let e=uO();e.maxErrors=kre}function tF(...e){let[t,r,o]=st.Match(e,{3:(a,u,p)=>[a,u,p],2:(a,u)=>[{},a,u]}),i=xg(t,r),s=new _o;return ct(i,s,r,o)}function Ct(...e){let[t,r,o]=st.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return tF(t,r,o)}function La(...e){let[t,r,o]=st.Match(e,{3:(a,u,p)=>[a,u,p],2:(a,u)=>[{},a,u]}),[i,s]=bR(t,r,o);return s}var wp=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function Lre(e,t,r){return c.IsArray(r)?r.map(o=>yn(e,t.items,o)):r}function Mre(e,t,r){return yn({...e,...t.$defs},mn(t.$ref),r)}function Q$e(e,t){let r=c.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Xi(e,t),i=Gn(o);return _e(i)?_A(i,r):i}function Dre(e,t,r){let o=Q$e(e,t);return yn(e,o,r)}function xR(e){return c.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function Fre(e,t,r){if(!c.IsObject(r)||c.IsArray(r))return r;let o=xR(t);for(let i of c.Keys(r)){if(c.HasPropertyKey(t.properties,i)&&ar(t.properties[i])){r[i]=yn(e,t.properties[i],r[i]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||ar(o)&&Ct(e,o,r[i])){r[i]=yn(e,o,r[i]);continue}delete r[i]}return r}function $re(e,t,r){if(!c.IsObject(r))return r;let o=xR(t),[i,s]=[new RegExp(zr(t)),Jt(t)];for(let a of c.Keys(r)){if(i.test(a)){r[a]=yn(e,s,r[a]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||ar(o)&&Ct(e,o,r[a])){r[a]=yn(e,o,r[a]);continue}delete r[a]}return r}function Bre(e,t,r){return c.HasPropertyKey(e,t.$ref)?yn(e,e[t.$ref],r):r}function Gre(e,t,r){if(!c.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=yn(e,t.items[i],r[i]);return c.IsGreaterThan(r.length,o)?r.slice(0,o):r}function Z$e(e){return c.HasPropertyKey(e,"~kind")||c.HasPropertyKey(e,"~unsafe")}function X$e(e){let t={};for(let r of c.Keys(e)){if(c.IsUnsafePropertyKey(r))continue;let o=Object.getOwnPropertyDescriptor(e,r);o.value=Ld(o.value),c.IsEqual(o.enumerable,!0)?t[r]=o.value:Object.defineProperty(t,r,o)}return t}function J$e(e){let t={};for(let r of c.Keys(e))c.IsUnsafePropertyKey(r)||(t[r]=Ld(e[r]));for(let r of c.Symbols(e))t[r]=Ld(e[r]);return t}function e1e(e){return c.IsClassInstance(e)?e:Z$e(e)?X$e(e):J$e(e)}function t1e(e){return e.map(t=>Ld(t))}function r1e(e){return e.slice()}function n1e(e){return new RegExp(e.source,e.flags)}function o1e(e){return new Map(Ld([...e.entries()]))}function i1e(e){return new Set(Ld([...e.values()]))}function Ld(e){return ho.IsTypeArray(e)?r1e(e):ho.IsRegExp(e)?n1e(e):ho.IsMap(e)?o1e(e):ho.IsSet(e)?i1e(e):c.IsArray(e)?t1e(e):c.IsObject(e)?e1e(e):e}function jre(e){return Ld(e)}function Rr(e){return jre(e)}function qre(e,t,r){for(let o of t.anyOf){let i=yn(e,o,Rr(r));if(Ct(e,o,i))return i}return r}function yn(e,t,r){return et(t)?Lre(e,t,r):Gt(t)?Mre(e,t,r):Ee(t)?Dre(e,t,r):_e(t)?Fre(e,t,r):Ot(t)?$re(e,t,r):St(t)?Bre(e,t,r):He(t)?Gre(e,t,r):z(t)?qre(e,t,r):r}function s1e(e,t){return O.Assign(e,t)}function a1e(e){let t={};for(let r of x3.Keys(e))t[r]=eT(e[r]);return t}function c1e(e){return $n({pattern:zr(e)})}function u1e(e){return rF(q7(e))}function rF(e){return e.map(t=>eT(t))}function eT(e){let t=et(e)?Po(eT(e.items),Af(e)):Ee(e)?eo(rF(e.allOf)):z(e)?ve(u1e(e.anyOf)):_e(e)?he(a1e(e.properties)):Ot(e)?Lf(c1e(e),eT(Jt(e))):He(e)?Ir(rF(e.items)):e;return s1e(e,t)}function vg(e){return eT(e)}function Ma(...e){let[t,r,o]=st.Match(e,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]}),i=qr.Get().unionPrioritySort?vg(r):r;return yn(t,i,o)}var lt={};Pi(lt,{Fail:()=>Md,IsOk:()=>nF,Ok:()=>de,TryArray:()=>p1e,TryBigInt:()=>oF,TryBoolean:()=>I1e,TryNull:()=>C1e,TryNumber:()=>w1e,TryString:()=>v1e,TryUndefined:()=>D1e});function nF(e){return c.IsObject(e)&&c.HasPropertyKey(e,"value")}function de(e){return{value:e}}function Md(){}function p1e(e){return c.IsArray(e)?de(e):de([e])}function l1e(e){return c.IsEqual(e,!0)?de(BigInt(1)):de(BigInt(0))}var d1e=/^-?(0|[1-9]\d*)n$/,m1e=/^-?(0|[1-9]\d*)\.\d+$/,f1e=/^-?(0|[1-9]\d*)$/;function g1e(e){return d1e.test(e)}function h1e(e){return m1e.test(e)}function y1e(e){return f1e.test(e)}function E1e(e){let t=e.toLowerCase();return g1e(e)?de(BigInt(e.slice(0,e.length-1))):h1e(e)?de(BigInt(e.split(".")[0])):y1e(e)?de(BigInt(e)):c.IsEqual(t,"false")?de(BigInt(0)):c.IsEqual(t,"true")?de(BigInt(1)):void 0}function oF(e){return c.IsBigInt(e)?de(e):c.IsBoolean(e)?l1e(e):c.IsNumber(e)?de(BigInt(Math.trunc(e))):c.IsNull(e)?de(BigInt(0)):c.IsString(e)?E1e(e):c.IsUndefined(e)?de(BigInt(0)):void 0}function S1e(e){return c.IsEqual(e,BigInt(0))?de(!1):c.IsEqual(e,BigInt(1))?de(!0):void 0}function T1e(e){return c.IsEqual(e,0)?de(!1):c.IsEqual(e,1)?de(!0):void 0}function _1e(e){return c.IsEqual(e.toLowerCase(),"false")?de(!1):c.IsEqual(e.toLowerCase(),"true")?de(!0):c.IsEqual(e,"0")?de(!1):c.IsEqual(e,"1")?de(!0):void 0}function I1e(e){return c.IsBigInt(e)?S1e(e):c.IsBoolean(e)?de(e):c.IsNumber(e)?T1e(e):c.IsNull(e)?de(!1):c.IsString(e)?_1e(e):c.IsUndefined(e)?de(!1):void 0}function b1e(e){return c.IsEqual(e,BigInt(0))?de(null):void 0}function x1e(e){return c.IsEqual(e,!1)?de(null):void 0}function O1e(e){return c.IsEqual(e,0)?de(null):void 0}function A1e(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?de(null):void 0}function C1e(e){return c.IsBigInt(e)?b1e(e):c.IsBoolean(e)?x1e(e):c.IsNumber(e)?O1e(e):c.IsNull(e)?de(null):c.IsString(e)?A1e(e):c.IsUndefined(e)?de(null):void 0}var Hre=BigInt(Number.MAX_SAFE_INTEGER),Kre=BigInt(Number.MIN_SAFE_INTEGER);function R1e(e){return e<=Hre&&e>=Kre?de(Number(e)):void 0}function P1e(e){return de(e?1:0)}function U1e(e){let t=+e;if(c.IsNumber(t))return de(t);let r=e.toLowerCase();if(c.IsEqual(r,"false"))return de(0);if(c.IsEqual(r,"true"))return de(1);let o=oF(e);return nF(o)?o.value<=Hre&&o.value>=Kre?de(Number(o.value)):void 0:void 0}function w1e(e){return c.IsBigInt(e)?R1e(e):c.IsBoolean(e)?P1e(e):c.IsNumber(e)?de(e):c.IsNull(e)?de(0):c.IsString(e)?U1e(e):c.IsUndefined(e)?de(0):void 0}function v1e(e){return c.IsBigInt(e)?de(e.toString()):c.IsBoolean(e)?de(e.toString()):c.IsNumber(e)?de(e.toString()):c.IsNull(e)?de("null"):c.IsString(e)?de(e):c.IsUndefined(e)?de(""):void 0}function N1e(e){return c.IsEqual(e,BigInt(0))?de(void 0):void 0}function k1e(e){return c.IsEqual(e,!1)?de(void 0):void 0}function L1e(e){return c.IsEqual(e,0)?de(void 0):void 0}function M1e(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?de(void 0):void 0}function D1e(e){return c.IsBigInt(e)?N1e(e):c.IsBoolean(e)?k1e(e):c.IsNumber(e)?L1e(e):c.IsNull(e)?de(void 0):c.IsString(e)?M1e(e):c.IsUndefined(e)?de(e):void 0}function zre(e,t,r){return lt.TryArray(r).value.map(i=>Pr(e,t.items,i))}function Yre(e,t,r){let o=lt.TryBigInt(r);return lt.IsOk(o)?o.value:r}function Vre(e,t,r){let o=lt.TryBoolean(r);return lt.IsOk(o)?o.value:r}function Wre(e,t,r){return Pr({...e,...t.$defs},mn(t.$ref),r)}function Qre(e,t,r){return Pr(e,Gn(t),r)}function Zre(e,t,r){let o=lt.TryNumber(r);return lt.IsOk(o)?Math.trunc(o.value):r}function Xre(e,t,r){let o=Xi(e,t),i=Gn(o);return Pr(e,i,r)}function F1e(e,t,r){let o=lt.TryBigInt(r);return lt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function $1e(e,t,r){let o=lt.TryBoolean(r);return lt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function B1e(e,t,r){let o=lt.TryNumber(r);return lt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function G1e(e,t,r){let o=lt.TryString(r);return lt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function Jre(e,t,r){return c.IsEqual(t.const,r)?r:i9(t)?F1e(e,t,r):s9(t)?$1e(e,t,r):xO(t)?B1e(e,t,r):OO(t)?G1e(e,t,r):_r()}function ene(e,t,r){let o=lt.TryNull(r);return lt.IsOk(o)?o.value:r}function tne(e,t,r){let o=lt.TryNumber(r);return lt.IsOk(o)?o.value:r}function OR(e,t,r,o){let i=c.Keys(o);for(let[s,a]of t)for(let u of i)s.test(u)||(o[u]=Pr(e,r,o[u]));return o}function tT(e,t,r){return Lr(e)&&c.IsUndefined(r[t])}function j1e(e,t,r){let o=c.EntriesRegExp(t.properties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)!s.test(u)||tT(a,u,r)||(r[u]=Pr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?OR(e,o,t.additionalProperties,r):r}function rne(e,t,r){return c.IsObjectNotArray(r)?j1e(e,t,r):r}function q1e(e,t,r){let o=c.EntriesRegExp(t.patternProperties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)s.test(u)&&(r[u]=Pr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?OR(e,o,t.additionalProperties,r):r}function nne(e,t,r){return c.IsObjectNotArray(r)?q1e(e,t,r):r}function one(e,t,r){return c.HasPropertyKey(e,t.$ref)?Pr(e,e[t.$ref],r):r}function ine(e,t,r){let o=lt.TryString(r);return lt.IsOk(o)?o.value:r}function sne(e,t,r){return Pr(e,Gn(t),r)}function ane(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Pr(e,t.items[o],r[o]);return r}function cne(e,t,r){let o=lt.TryUndefined(r);return lt.IsOk(o)?o.value:r}function une(e,t,r){if(t.anyOf.some(a=>Ct(e,a,r)))return r;let s=t.anyOf.map(a=>Pr(e,a,Rr(r))).find(a=>Ct(e,t,a));return c.IsUndefined(s)?r:s}function pne(e,t,r){let o=lt.TryUndefined(r);return lt.IsOk(o)?void 0:r}function Pr(e,t,r){return et(t)?zre(e,t,r):Ko(t)?Yre(e,t,r):yo(t)?Vre(e,t,r):Gt(t)?Wre(e,t,r):Fr(t)?Qre(e,t,r):gn(t)?Zre(e,t,r):Ee(t)?Xre(e,t,r):Ye(t)?Jre(e,t,r):_a(t)?ene(e,t,r):cr(t)?tne(e,t,r):_e(t)?rne(e,t,r):Ot(t)?nne(e,t,r):St(t)?one(e,t,r):Kr(t)?ine(e,t,r):jt(t)?sne(e,t,r):He(t)?ane(e,t,r):Cs(t)?cne(e,t,r):z(t)?une(e,t,r):Yo(t)?pne(e,t,r):r}function vp(...e){let[t,r,o]=st.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return Pr(t,r,o)}function lne(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=En(e,t.items,r[o]);return r}function dne(e,t,r){return En({...e,...t.$defs},mn(t.$ref),r)}function mne(e,t){return c.IsUndefined(t)?c.IsFunction(e.default)?e.default():Rr(e.default):t}function fne(e,t,r){let o=Xi(e,t),i=Gn(o);return En(e,i,r)}function gne(e,t,r){if(!c.IsObject(r))return r;let o=c.Keys(t.properties);for(let i of o){let s=En(e,t.properties[i],r[i]);c.IsUndefined(s)&&(Lr(t.properties[i])||!c.HasPropertyKey(t.properties[i],"default"))||(r[i]=s)}if(!Na(t)||c.IsBoolean(t.additionalProperties))return r;for(let i of c.Keys(r))o.includes(i)||(r[i]=En(e,t.additionalProperties,r[i]));return r}function hne(e,t,r){if(!c.IsObject(r))return r;let[o,i]=[new RegExp(zr(t)),Jt(t)];for(let s of c.Keys(r))o.test(s)&&xi(i)&&(r[s]=En(e,i,r[s]));if(!Na(t))return r;for(let s of c.Keys(r))o.test(s)||(r[s]=En(e,t.additionalProperties,r[s]));return r}function yne(e,t,r){return c.HasPropertyKey(e,t.$ref)?En(e,e[t.$ref],r):r}function Ene(e,t,r){if(!c.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=En(e,o[s],r[s]));return r}function Sne(e,t,r){for(let o of t.anyOf){let i=En(e,o,Rr(r));if(Ct(e,o,i))return i}return r}function En(e,t,r){let o=xi(t)?mne(t,r):r;return et(t)?lne(e,t,o):Gt(t)?dne(e,t,o):Ee(t)?fne(e,t,o):_e(t)?gne(e,t,o):Ot(t)?hne(e,t,o):St(t)?yne(e,t,o):He(t)?Ene(e,t,o):z(t)?Sne(e,t,o):o}function Dd(...e){let[t,r,o]=st.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return En(t,r,o)}function Ng(e){return(...t)=>{let[r,o,i]=st.Match(t,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]});return e.reduce((s,a)=>a(r,o,s),i)}}function H1e(e,t,r){return t["~codec"].decode(r)}function K1e(e,t,r){return t["~codec"].encode(r)}function rr(e,t,r,o){return td(r)?c.IsEqual(e,"Decode")?H1e(t,r,o):K1e(t,r,o):o}function z1e(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=ur(e,t,r.items,o[i]);return rr(e,t,r,o)}function Y1e(e,t,r,o){let i=rr(e,t,r,o);if(!c.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=ur(e,t,r.items,i[s]);return i}function Tne(e,t,r,o){return c.IsEqual(e,"Decode")?z1e(e,t,r,o):Y1e(e,t,r,o)}function _ne(e,t,r,o){return o=ur(e,{...t,...r.$defs},mn(r.$ref),o),rr(e,t,r,o)}function Ine(e){return e.reduce((t,r)=>({...t,...r}),{})}function bne(e,t){for(let r of t)if(!c.IsDeepEqual(e,r))return r;return e}function V1e(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return rr(e,t,r,o);let i=r.allOf.map(u=>ur(e,t,u,Ma(u,Rr(o)))),a=i.every(u=>c.IsObject(u))?Ine(i):bne(o,i);return rr(e,t,r,a)}function W1e(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return rr(e,t,r,o);let i=rr(e,t,r,o),s=r.allOf.map(u=>ur(e,t,u,Ma(u,Rr(i))));return s.every(u=>c.IsObject(u))?Ine(s):bne(i,s)}function xne(e,t,r,o){return c.IsEqual(e,"Decode")?V1e(e,t,r,o):W1e(e,t,r,o)}function Q1e(e,t,r,o){if(!c.IsObjectNotArray(o))return o;for(let i of c.Keys(r.properties))!c.HasPropertyKey(o,i)||tT(r.properties[i],i,o)||(o[i]=ur(e,t,r.properties[i],o[i]));return rr(e,t,r,o)}function Z1e(e,t,r,o){let i=rr(e,t,r,o);if(!c.IsObjectNotArray(i))return i;for(let s of c.Keys(r.properties))!c.HasPropertyKey(i,s)||tT(r.properties[s],s,i)||(i[s]=ur(e,t,r.properties[s],i[s]));return i}function One(e,t,r,o){return c.IsEqual(e,"Decode")?Q1e(e,t,r,o):Z1e(e,t,r,o)}function X1e(e,t,r,o){if(!c.IsObjectNotArray(o))return o;let i=new RegExp(zr(r));for(let s of c.Keys(o))i.test(s)&&(o[s]=ur(e,t,Jt(r),o[s]));return rr(e,t,r,o)}function J1e(e,t,r,o){let i=rr(e,t,r,o);if(!c.IsObjectNotArray(i))return i;let s=new RegExp(zr(r));for(let a of c.Keys(i))s.test(a)&&(i[a]=ur(e,t,Jt(r),i[a]));return i}function Ane(e,t,r,o){return c.IsEqual(e,"Decode")?X1e(e,t,r,o):J1e(e,t,r,o)}function Cne(e,t,r,o){return c.HasPropertyKey(t,r.$ref)?ur(e,t,t[r.$ref],o):o}function Rne(e,t,r,o){return c.IsEqual(e,"Decode")?rr(e,t,r,Cne(e,t,r,o)):Cne(e,t,r,rr(e,t,r,o))}function eBe(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=ur(e,t,r.items[i],o[i]);return rr(e,t,r,o)}function tBe(e,t,r,o){let i=rr(e,t,r,o);if(!c.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=ur(e,t,r.items[s],i[s]);return i}function Pne(e,t,r,o){return c.IsEqual(e,"Decode")?eBe(e,t,r,o):tBe(e,t,r,o)}function rBe(e,t,r,o){for(let i of r.anyOf){if(!Ct(t,i,o))continue;let s=ur(e,t,i,o);return rr(e,t,r,s)}return o}function nBe(e,t,r,o){let i=rr(e,t,r,o);for(let s of r.anyOf){let a=ur(e,t,s,Rr(i));if(Ct(t,s,a))return a}return i}function Une(e,t,r,o){return c.IsEqual(e,"Decode")?rBe(e,t,r,o):nBe(e,t,r,o)}function ur(e,t,r,o){return et(r)?Tne(e,t,r,o):Gt(r)?_ne(e,t,r,o):Ee(r)?xne(e,t,r,o):_e(r)?One(e,t,r,o):Ot(r)?Ane(e,t,r,o):St(r)?Rne(e,t,r,o):He(r)?Pne(e,t,r,o):z(r)?Une(e,t,r,o):rr(e,t,r,o)}var iF=class extends wp{constructor(t,r){super("Decode",t,r)}};function oBe(e,t,r){if(!Ct(e,t,r))throw new iF(r,La(e,t,r));return r}function iBe(e,t,r){let o=qr.Get().unionPrioritySort?vg(t):t;return ur("Decode",e,o,r)}var cer=Ng([(e,t,r)=>Rr(r),(e,t,r)=>Dd(e,t,r),(e,t,r)=>vp(e,t,r),(e,t,r)=>Ma(e,t,r),(e,t,r)=>oBe(e,t,r),(e,t,r)=>iBe(e,t,r)]);var sF=class extends wp{constructor(t,r){super("Encode",t,r)}};function sBe(e,t,r){if(!Ct(e,t,r))throw new sF(r,La(e,t,r));return r}function aBe(e,t,r){let o=qr.Get().unionPrioritySort?vg(t):t;return ur("Encode",e,o,r)}var _er=Ng([(e,t,r)=>Rr(r),(e,t,r)=>aBe(e,t,r),(e,t,r)=>Dd(e,t,r),(e,t,r)=>vp(e,t,r),(e,t,r)=>Ma(e,t,r),(e,t,r)=>sBe(e,t,r)]);var os=class extends Error{constructor(t,r){super(r),this.type=t}};function wne(e,t){return c.IsFunction(t.default)?t.default(t):c.IsObject(t.default)?Rr(t.default):t.default}function vne(e,t){if(Ig(t)&&!xi(t))throw new os(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=Sg(t)?t.minItems:0;return Array.from({length:r},()=>Ur(e,t.items))}function Nne(e,t){return tu(t)?BigInt(t.exclusiveMinimum)+BigInt(1):ru(t)?BigInt(t.minimum):BigInt(0)}function kne(e,t){return!1}function Lne(e,t){let r=Ur(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function Mne(e,t){return Ur({...e,...t.$defs},mn(t.$ref))}function Dne(e,t){return Ur(e,Gn(t))}function Fne(e,t){let r=Ur(e,t.returnType);return()=>r}function $ne(e,t){return tu(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:ru(t)?t.minimum:0}function Bne(e,t){let r=Xi(e,t),o=Gn(r);return Ur(e,o)}function Gne(e,t){return t.const}function jne(e,t){throw new os(t,"Cannot create TNever types")}function qne(e,t){return null}function Hne(e,t){return tu(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:ru(t)?t.minimum:0}function Kne(e,t){return(c.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Ur(e,t.properties[i])}),{})}function zne(e,t){if(GS(t)&&!xi(t))throw new os(t,"Record with the minProperties constraint must have a default annotation");return{}}function Yne(e,t){return c.HasPropertyKey(e,t.$ref)?Ur(e,e[t.$ref]):(()=>{throw new os(t,"Unable to deref Ref")})()}function Vne(e,t){if((jS(t)||$S(t))&&!xi(t))throw Error("Strings with format or pattern constraints must specify default");let o=BS(t)?t.minLength:0;return"".padEnd(o)}function Wne(e,t){return Symbol()}function Qne(e,t){let r=jE(t.pattern);if(Kr(r))throw new os(t,"Unable to create TemplateLiteral due to infinite type expansion");return Ur(e,r)}function Zne(e,t){return Array.from({length:t.minItems},(r,o)=>Ur(e,t.items[o]))}function Xne(e,t){if(c.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Ur(e,t.anyOf[0])}function Ur(e,t){return xi(t)?wne(e,t):et(t)?vne(e,t):Ko(t)?Nne(e,t):yo(t)?kne(e,t):Nr(t)?Lne(e,t):Gt(t)?Mne(e,t):Fr(t)?Dne(e,t):kr(t)?Fne(e,t):gn(t)?$ne(e,t):Ee(t)?Bne(e,t):Ye(t)?Gne(e,t):qo(t)?jne(e,t):_a(t)?qne(e,t):cr(t)?Hne(e,t):_e(t)?Kne(e,t):Ot(t)?zne(e,t):St(t)?Yne(e,t):Kr(t)?Vne(e,t):Ia(t)?Wne(e,t):jt(t)?Qne(e,t):He(t)?Zne(e,t):Cs(t)?void 0:z(t)?Xne(e,t):Yo(t)?void 0:void 0}function Da(...e){let[t,r]=st.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Ur(t,r)}var aF=class extends wp{constructor(t,r){super("Parse",t,r)}};function cBe(e,t,r){JD();let o=La(e,t,r);if(eF(),!Ct(e,t,r))throw new aF(r,o);return r}var jrr=Ng([(e,t,r)=>Rr(r),(e,t,r)=>Dd(e,t,r),(e,t,r)=>vp(e,t,r),(e,t,r)=>Ma(e,t,r),(e,t,r)=>cBe(e,t,r)]);var pBe=he({type:qe("insert"),path:$n(),value:Hr()}),lBe=Object({type:qe("update"),path:$n(),value:Hr()}),dBe=he({type:qe("delete"),path:$n()}),Wrr=ve([pBe,lBe,dBe]);var iu=k(function*(e){if(!e.body)return yield*new At({message:"This command does not accept a request body"});let t=e.body;return t.examples?.length?t.examples[0]:Da(t)});var toe=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)",Np=je("file").pipe(la("f"),te("Read body from file (use - for stdin)"),Te("FILE_PATH"),rt),su=je("data").pipe(la("d"),te("Inline JSON body"),Te("JSON"),rt),au=Jn("generate-skeleton").pipe(te("Print a JSON skeleton for the request body and exit"),Cn(!1)),Vt={from:je("from").pipe(te(`Start of time range${toe}. Start narrow and widen step by step only when the result is empty`),Te("TIMESTAMP"),rt),to:je("to").pipe(te(`End of time range${toe}`),Te("TIMESTAMP"),rt)},kp=je("query").pipe(te("Tsuga query to filter results"),Te("TSUGA_QUERY"),rt),kg=ff("max-results").pipe(op(e=>Number.isSafeInteger(e)&&e>0,()=>"--max-results must be a positive safe integer"),te("Maximum number of results"),Te("COUNT"),rt),Lp={limit:ff("limit").pipe(op(e=>Number.isSafeInteger(e)&&e>=1&&e<=Sp,()=>`--limit must be an integer from 1 to ${Sp}`),te(`Maximum number of items to return, up to ${Sp} (default: ${bA})`),Te("N"),rt),offset:ff("offset").pipe(op(e=>Number.isSafeInteger(e)&&e>=0,()=>"--offset must be a non-negative safe integer"),te("Number of items to skip, to request a later page"),Te("N"),rt),all:Jn("all").pipe(te("Follow every page and print all items as one page; cannot be combined with --limit or --offset"),Cn(!1))},Vr=k(function*(e){return{from:yield*AR("from",e.from),to:yield*AR("to",e.to)}}),AR=k(function*(e,t){let r=yield*yt,o=ue(t)??(yield*r.getDefault(e));if(!o)return yield*new At({message:`--${e} is required`});let i=Math.floor((yield*Wn)/gd),s=yield*Et({try:()=>qA(o,i),catch:a=>new At({message:a instanceof Error?a.message:String(a)})});return Number.isSafeInteger(s)?s:yield*new At({message:`Invalid time value: ${o}. Unix seconds must be a safe integer.`})}),Fd=k(function*(e,t){let r=yield*yt;return ue(t)??(yield*r.getDefault(e))});function roe(e){if(e===null||typeof e!="object"||!("properties"in e))return{};let{properties:t}=e;if(t===null||typeof t!="object")return{};let r={};for(let o of Object.keys(t)){let i=Reflect.get(t,o),s=i!==null&&typeof i=="object"&&"description"in i?Reflect.get(i,"description"):void 0;r[o]=typeof s=="string"?{description:s}:{}}return r}function noe(e,t){let r=e[t];return typeof r=="string"?r:wh(r)&&wt(r)&&typeof r.value=="string"?r.value:void 0}function Sn(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&(t[r]=o);return t}var Kn=(e,t,r)=>P(e,{file:Np,data:su,generateSkeleton:au},v(`cli.${e}`)(function*(o){if(o.generateSkeleton){yield*Wo(yield*iu(r));return}yield*xe(yield*Ze(r,{body:yield*eu(o)}))})).pipe(U(t));var ooe=Kn("scalar","Run aggregation queries and return scalar results",fC);var ioe=Kn("timeseries","Run aggregation queries and return timeseries results",gC);var soe=P("aggregation").pipe(U("Run aggregation queries"),be([ooe,ioe]));var moe=require("node:crypto");var rT=require("node:crypto");function gBe(e){return(0,rT.createHash)("sha256").update(e).digest("base64url")}function aoe(){let e=(0,rT.randomBytes)(32).toString("base64url");return{verifier:e,challenge:gBe(e)}}var poe=require("node:http"),pF=require("node:os");var hBe=[":root{color-scheme:light dark;--bg:#f9fafb;--card:#fff;--fg:#1f2937;--fg-muted:#6b7280;","--logo-1:#08cb00;--logo-2:#008200;--brand:#08cb00;--bloom:#e5e7eb}","@media(prefers-color-scheme:dark){:root{--bg:#18181b;--card:#202023;--fg:#e4e4e7;","--fg-muted:#a1a1aa;--logo-1:#fff;--logo-2:#fff;--bloom:#52525b}}","*{box-sizing:border-box}","body{margin:0;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;","padding:24px;padding-top:14vh;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;","color:var(--fg);background-color:var(--bg);background-image:","radial-gradient(72% 78% at 104% 112%,var(--brand) -20%,transparent 64%),","radial-gradient(46% 46% at 94% -4%,var(--brand) -20%,transparent 64%),","radial-gradient(48% 58% at -8% 68%,var(--bloom) -20%,transparent 64%)}","main{display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;","width:100%;max-width:480px;padding:32px;border-radius:8px;backdrop-filter:blur(8px);","background-color:color-mix(in srgb,var(--card) 55%,transparent);","box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}",".tile{display:flex;padding:6px;border-radius:6px;background-color:var(--card);","box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}",".tile svg{display:block;width:32px;height:32px}",".copy{display:flex;flex-direction:column;gap:8px}","h1{margin:0;font-size:29px;font-weight:600;line-height:1.2}","p{margin:0;font-size:14px;line-height:20px;color:var(--fg-muted)}"].join(""),yBe=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111.94 133.41" aria-hidden="true">','<path fill="var(--logo-2)" d="M40.66,54.06c-11.32,8.54-25.39,13.61-40.66,13.61v-23.36c17.9,0,','33.3-10.6,40.29-25.87v28.28c0,2.48.13,4.93.37,7.34Z"/>','<path fill="var(--logo-2)" d="M67.65,103.01v30.4h-23.36v-35.58c-11.87,10.29-27.34,16.54-44.29,','16.54v-23.36c19.33,0,35.76-12.37,41.8-29.63,3.5,16.76,12.87,31.39,25.85,41.63Z"/>','<rect fill="var(--logo-1)" x="44.29" width="23.36" height=".02"/>','<path fill="var(--logo-1)" d="M111.94,67.67c-16.83,0-32.21-6.14-44.05-16.3,2.32,22.28,21.16,',"39.64,44.05,39.64v23.36c-37.36,0-67.65-30.29-67.65-67.65V.02h23.36c0,24.47,19.83,44.29,44.29,",'44.29v23.36Z"/></svg>'].join("");function cF(e,t){let r=HM(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${r}</title><style>${hBe}</style></head><body><main>`,`<span class="tile">${yBe}</span>`,`<div class="copy"><h1>${r}</h1><p>${HM(t)}</p></div>`,"</main></body></html>"].join("")}var loe="/oauth/callback",SBe=5*hd,TBe=cF("Login complete","You can close this tab and return to the terminal."),coe=cF("Login failed","Return to the terminal for details."),{$match:_Be,Code:IBe,Failed:uF,NotACallback:uoe}=H_();function bBe(e){return(0,pF.platform)()==="darwin"?["open",[e]]:(0,pF.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}var xBe=(e,t,r)=>Be(()=>{let o,i=ne(()=>{o!==void 0&&(e.off("request",o),o=void 0)});return xn(s=>{let a=(u,p,m)=>{u.writeHead(p,{"Content-Type":"text/html"}),u.end(m)};o=(u,p)=>{_Be({NotACallback:()=>a(p,404,coe),Failed:({message:m})=>{a(p,400,coe),s($(new Yc({message:m})))},Code:({code:m})=>{a(p,200,TBe),s(A(m))}})(ABe(u.url??"/",r,t))},e.on("request",o)}).pipe(Qn(i),mv({duration:SBe,orElse:()=>new Yc({message:"Timed out waiting for the browser to complete login (5 minutes)."})}))}),OBe=v("auth.openBrowser")(function*(e){let[t,r]=bBe(e);return yield*uo(G(zi(t,r,{stdin:"ignore",stdout:{stream:"ignore"},stderr:{stream:"ignore"}}),o=>pn(o.unref,o.exitCode))).pipe(_l({onSuccess:o=>Number(o)===0,onFailure:()=>!1}))});function ABe(e,t,r){let o;try{o=new URL(e,t)}catch{return uoe()}if(o.pathname!==loe)return uoe();let i=o.searchParams.get("error");if(i){let a=o.searchParams.get("error_description")??"";return uF({message:`Authorization failed: ${i}${a?` (${a})`:""}`})}if(o.searchParams.get("state")!==r)return uF({message:"State mismatch on OAuth callback; aborting for safety."});let s=o.searchParams.get("code");return s?IBe({code:s}):uF({message:"OAuth callback did not include an authorization code."})}var doe=v("auth.captureAuthorizationCode")(function*(e){let t=yield*Bo(ne(()=>{let p=(0,poe.createServer)();return p.on("connection",m=>m.unref()),p}),p=>ne(()=>p.close())),o=`http://127.0.0.1:${yield*xn(p=>{let m=g=>{p(new Yc({message:`Could not open a loopback port: ${g.message}`}))};t.once("error",m),t.listen(0,"127.0.0.1",()=>{t.off("error",m);let g=t.address();p(g===null||typeof g=="string"?new Yc({message:"Loopback server did not report a usable address."}):A(g.port))})})}`,i=`${o}${loe}`,s=yield*xl(xBe(t,e.state,o),{startImmediately:!0}),a=e.buildAuthorizeUrl(i);return yield*xl(mt(function*(){(yield*OBe(a))?(yield*jn("Opening your browser to complete login..."),yield*jn("If it does not open, visit this URL:")):yield*jn("Visit this URL in your browser to complete login:"),yield*jn(` ${a}`)}),{startImmediately:!0}),{code:yield*Cl(s),redirectUri:i}},uo);var foe=P("login",{},v("cli.auth.login")(function*(){let e=yield*yt,t=yield*Op,r=yield*e.resolveApiUrl,{verifier:o,challenge:i}=aoe(),s=(0,moe.randomBytes)(16).toString("base64url"),{code:a,redirectUri:u}=yield*doe({state:s,buildAuthorizeUrl:g=>lX(r,{redirectUri:g,challenge:i,state:s})}),p=yield*t.exchangeCode(r,{code:a,verifier:o,redirectUri:u}),m=yield*e.saveUserAuth(xC(p));yield*Fe(`Logged in. Session token ${gg(p.accessToken)} saved to ${m}`)})).pipe(U("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)"));var goe=P("logout",{},v("cli.auth.logout")(function*(){yield*(yield*yt).clearUserAuth,yield*Fe("Local user session cleared.")})).pipe(U("Clear the saved user session"));var gr=e=>Cx(Wl,e);var hoe=(e,t)=>Rx(Wl,e,t);var Ht=x(2,(e,t)=>Px(e,t));var yoe=x(e=>Ax(e[0]),(e,t)=>tk(e,t)),Eoe=x(2,(e,t)=>IE(e,t));var Soe=(e,t)=>_E(Wl,e,t);var Toe=x(3,(e,t,r)=>Ux(e,t,r));var _oe=P("operation-key",{key:gr("OPERATION_API_KEY").pipe(Ht("The operation API key to save"),Eoe(e=>e.trim()),Toe(e=>e.length>0,()=>"OPERATION_API_KEY must not be empty or whitespace-only"))},v("cli.auth.operationKey")(function*({key:e}){let t=yield*yt;yield*t.saveOperationApiKey(e),yield*Fe(`Operation API key saved to ${t.configPath}`)})).pipe(U("Save an operation API key to the config file (replaces any saved user session)"));function Ioe(e,t){let r=gg(e.accessToken),o=Date.parse(e.accessExpiresAt),i=!!e.refreshToken;if(Number.isNaN(o))return`Logged in as a user (token ${r}, expires ${e.accessExpiresAt}).`;let s=jm(Es(o));return s<=t?i?`Logged in as a user (token ${r}). Access token expired ${CR(s,t)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${r}). Session expired ${CR(s,t)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${r}). Access token expires in ${CR(t,s)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${r}). Session expires in ${CR(t,s)}, on ${e.accessExpiresAt}.`}function CR(e,t){let r=YZ(VZ({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return r===""?"less than a minute":r}var boe=P("status",{},v("cli.auth.status")(function*(){let e=yield*wa,t=yield*yt,{credential:r}=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});if(!r){yield*Fe("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}let o=r.kind;switch(o){case"user-session":{let i=yield*KH;yield*Fe(Ioe(r.userAuth,i));return}case"operation-api-key":yield*Fe("Authenticated with an operation API key.");return;default:Nt(o)}})).pipe(U("Show the current authentication method"));var xoe=P("token",{},v("cli.auth.token")(function*(){let e=yield*yt,t=yield*e.resolveApiUrl,r=yield*e.getUserAuth;if(!r){let i=t===vS?"":` for ${t}`;return yield*new bp({message:`No user session${i}.`,suggestions:["Sign in with your browser: tsuga auth login"]})}let o=yield*AC(t,r);yield*Fe(o.accessToken)})).pipe(U("Print the saved user access token to stdout"));var $d="/v0/admin-center";var Ooe="^\\S(.*\\S)?$",Gsr=new RegExp(Ooe,"u"),CBe=50,RBe=128,PBe=256,UBe=n.Object({key:n.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:n.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),wBe=n.Object({key:n.String({maxLength:RBe,description:"Tag key to attach to the resource."}),value:n.String({maxLength:PBe,pattern:Ooe,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Wr=n.Array(UBe,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),sn=n.Array(wBe,{title:"Tags",maxItems:CBe,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),Wt=n.Optional(Wr),nr=n.Optional(sn);var Mp="/v0/teams",UR=["public","private"],RR={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},vBe=n.Enum([RR.NAME,RR.CREATED_AT,RR.MEMBER_COUNT,RR.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),wR=n.Object({color:n.Enum(jM,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum(qM,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(RJ,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Lg=n.Object({color:n.Enum(jM),mode:n.Enum(qM)}),NBe=100,kBe=250,Aoe=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(rs),joinedTeamAt:N(),orgRole:n.Enum(AJ),avatar:n.Optional(Lg)}),lF=3,dF=n.Pick(Aoe,["id","name","avatar"]),Dp=n.Object({id:n.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:n.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:n.Optional(n.String({description:"Optional free-text description of the team."})),visibility:n.Enum(UR,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Wt,createdAt:N({description:"Timestamp when Tsuga created the team."}),updatedAt:N({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),memberPreview:n.Optional(n.Array(dF,{description:`First ${lF} members of the team, sorted by name.`})),avatar:n.Optional(wR)}),vR=n.Object({name:n.String({minLength:1,maxLength:NBe,format:Ji,description:"Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization."}),description:Qe(n.String({maxLength:kBe}),{description:"Team description."}),visibility:n.Enum(UR,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:nr,avatar:Qe(wR)}),Coe=n.Object({searchQuery:n.Optional(l({description:"Substring matched against team names, descriptions, and IDs."})),visibility:n.Optional(n.Enum(UR,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."}))}),mF=n.Optional(l({allowEmpty:!1,description:"Exact team name to look up. Returns at most one team, since team names are unique."})),Zsr=f({tags:["teams"],url:Mp,method:"GET",paginated:!0,response:n.Array(Dp),query:n.Object({...Ie,includeMemberPreview:n.Optional(n.Boolean({description:"Adds `memberCount` and `memberPreview` to every returned team."})),...Coe.properties,name:mF,sortBy:n.Optional(vBe),sortDirection:n.Optional(me)})}),Xsr=f({tags:["teams"],url:`${Mp}/:id`,method:"GET",params:n.Object({id:l()}),response:Dp}),PR={NAME:"name",ROLE:"role",ORG_ROLE:"orgRole",JOINED_TEAM_AT:"joinedTeamAt"},LBe=n.Enum([PR.NAME,PR.ROLE,PR.ORG_ROLE,PR.JOINED_TEAM_AT]),Jsr=f({tags:["teams"],url:`${Mp}/:id/members`,method:"GET",paginated:!0,params:n.Object({id:l()}),query:n.Object({...Ie,searchQuery:n.Optional(l({description:"Substring matched against member names, emails, and IDs."})),teamRole:n.Optional(n.Array(n.Enum(rs),{maxItems:rs.length,uniqueItems:!0,description:"Restrict results to members with one of these team roles."})),sortBy:n.Optional(LBe),sortDirection:n.Optional(me)}),response:n.Array(Aoe)}),ear=f({tags:["teams"],url:`${Mp}/:id/assets`,method:"GET",params:n.Object({id:l()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number(),sloCount:n.Number()})}),tar=f({tags:["teams"],url:Mp,method:"POST",body:vR,response:Dp}),rar=f({tags:["teams"],url:`${Mp}/:id`,method:"PUT",params:n.Object({id:l()}),body:vR,response:Dp}),MBe=F("type",[n.Object({type:n.Literal("ids"),teamIds:n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:100})}),n.Object({type:n.Literal("all"),filters:n.Optional(Coe)})]),nar=f({tags:["teams"],url:`${Mp}/bulk-update`,method:"POST",body:n.Object({selection:MBe,config:n.Object({visibility:n.Enum(UR)})}),response:n.Object({})}),oar=f({tags:["teams"],url:`${Mp}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q});var DBe=n.Enum(["agent","billing","cli","mcp-codemode","mcp-server","tadmin","terraform-provider","web-admin","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),Ce=F("type",[n.Object({type:n.Literal("user",{description:"The resource was created or updated by a user."}),id:n.String({description:"Unique identifier of the user actor."}),name:n.String({description:"Display name of the user actor at the time of response."}),avatar:n.Optional(Lg)}),n.Object({type:n.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:n.String({description:"Unique identifier of the operation API key actor."}),name:n.String({description:"Display name of the operation API key actor."}),source:n.Optional(DBe)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var oT=`${$d}/custom-roles`,FBe=50,$Be=3,BBe=20,GBe=["read","write"],nT=n.Enum(["read"],{description:"Access granted on this resource type."}),ut=n.Enum(GBe,{description:"Access granted on this resource type. `write` implies `read`."});var Uoe="Teams the role grants its asset permissions on. `all` covers every team, `public` covers public teams only, `specific` covers the listed teams, and `all-except` covers every team but the listed ones.",woe="Team IDs the scope applies to.",Roe=n.Array(n.String(),{description:woe}),jBe=F("type",[n.Object({type:n.Literal("all")},{title:"CustomRoleAllTeams"}),n.Object({type:n.Literal("public")},{title:"CustomRolePublicTeams"}),n.Object({type:n.Literal("specific"),teamIds:Roe},{title:"CustomRoleSpecificTeams"}),n.Object({type:n.Literal("all-except"),teamIds:Roe},{title:"CustomRoleAllTeamsExcept"})],{description:Uoe}),Poe=n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:FBe,uniqueItems:!0,description:woe}),qBe=F("type",[n.Object({type:n.Literal("all")}),n.Object({type:n.Literal("public")}),n.Object({type:n.Literal("specific"),teamIds:Poe}),n.Object({type:n.Literal("all-except"),teamIds:Poe})],{description:Uoe}),HBe=n.Object({database:nT,inventory:nT,queue:nT,service:nT,"audit-log":nT}),KBe=n.Object({"allowed-domains":ut,"audit-log-stream-destination":ut,"cluster-integration-config":ut,"custom-usage-tag":ut,"databricks-connection":ut,"github-connection":ut,"llm-provider":ut,"retention-policy":ut,"saml-config":ut,"sensitive-data-scanner-rule":ut,"service-target":ut,"team-remap-config":ut,"adaptive-notification-rule":ut,"cloud-account":ut,"dashboard-folder":ut,"monitor-folder":ut,"dashboard-report":ut,"dashboard-share":ut,dashboard:ut,"ingestion-api-key":ut,"log-route":ut,"metric-route":ut,"span-route":ut,monitor:ut,notebook:ut,"notification-integration":ut,"notification-rule":ut,"notification-silence":ut,"operation-api-key":ut,"quality-report":ut,"rum-public-token":ut,"sandbox-configuration":ut,slo:ut,"synthetic-test":ut,"synthetic-variable":ut,"tag-policy":ut,"user-invitation":ut}),voe=n.Object({...n.Partial(n.Object({...HBe.properties,...KBe.properties})).properties,team:ut},{description:"Access level granted per resource type, within the role team scope. An omitted resource type grants no access."});var Noe=n.Array(n.Enum(MM),{description:"Telemetry signals the role can read. An empty array grants no telemetry access."}),fF="Additional restriction applied cluster-side to every telemetry query the role holder runs. Each entry keeps only the data points whose `key` matches one of `values`, and entries are combined with AND.",koe="Attribute key matched against telemetry data points, such as `env` or `service.name`.",Loe="Values the attribute must equal for a data point to be kept. A data point matching any of them is kept.",zBe=n.Array(n.Object({key:n.String({description:koe}),values:n.Array(n.String(),{description:Loe})}),{description:fF}),YBe=n.Array(n.Object({key:l({allowEmpty:!1,description:koe}),values:n.Array(n.String({minLength:1,maxLength:Ti,pattern:"^(?!\\*$)",errorMessage:{pattern:"Must not be '*'."}}),{minItems:1,maxItems:BBe,description:Loe})}),{maxItems:$Be,description:fF}),Bd=n.Object({id:n.String({description:"Tsuga-generated custom role ID assigned at creation."}),name:n.String({description:"Human-readable custom role name, unique across the account."}),description:n.Optional(n.String({description:"Free-form description of the custom role. Absent when not set."})),teamScope:jBe,assets:voe,telemetry:Noe,telemetryQuery:n.Optional(zBe),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:N({description:"Timestamp when Tsuga created the custom role."}),updatedAt:N({description:"Timestamp when Tsuga last updated the custom role."})}),Moe=n.Pick(Bd,["teamScope","assets","telemetry","telemetryQuery"],{description:"What the custom role grants its holder."}),VBe=100,NR=n.Object({name:n.String({minLength:1,maxLength:VBe,format:Ji,description:"Human-readable custom role name, unique across the account."}),description:Qe(l({type:"short"}),{description:"Free-form description of the custom role. Omit on update to keep the current description, or pass null to remove it."}),teamScope:qBe,assets:voe,telemetry:Noe,telemetryQuery:Qe(YBe,{description:`${fF} Omit on update to keep the current restriction, or pass null to remove it.`})}),Sar=f({tags:["custom-roles"],url:oT,method:"GET",response:n.Array(Bd)}),Tar=f({tags:["custom-roles"],url:`${oT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1})}),response:Bd}),_ar=f({tags:["custom-roles"],url:oT,method:"POST",body:NR,response:Bd}),Iar=f({tags:["custom-roles"],url:`${oT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1})}),body:NR,response:Bd}),bar=f({tags:["custom-roles"],url:`${oT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1})}),response:q});var WBe={"ai-sandboxes":"AI tasks",analytics:"Analytics","browser-views":"RUM Browser views","dashboard-reports":"Dashboard reports",dashboards:"Dashboards",databases:"Databases",ecs:"ECS","inventory-all-resources":"All cloud resources","inventory-overview":"Cloud resources overview","inventory-settings":"Cloud resources settings",inventory:"Cloud resources",issues:"Issues",kubernetes:"Kubernetes","log-routes":"Log routes",logs:"Logs","metric-routes":"Metric routes",metrics:"Metrics",mobile:"RUM Mobile",monitor:"Monitors",notebooks:"Notebooks","notification-integrations":"Notification integrations","notification-rules-list":"Notification rules","notification-rules":"Notifications","notification-silences":"Notification silences","ongoing-alerts":"Ongoing alerts",queues:"Queues",routes:"Routes",rum:"RUM views","sensitive-data-scanner":"Sensitive data scanner",serverless:"Serverless",services:"Services",sessions:"Sessions",slo:"SLOs","span-routes":"Span routes",synthetics:"Synthetics","team-map":"Service map",traces:"Traces"},QBe=Object.keys(WBe),gF=n.Enum(QBe,{description:"Stable nav item key within a main sidebar category."}),Doe="Nav item keys shown in the primary sidebar for this category, in display order.",Foe="Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none.",$oe=e=>F("type",[n.Object({type:n.Literal("dashboard"),id:e("Tsuga-generated ID of the dashboard the item opens.")}),n.Object({type:n.Literal("service"),serviceName:e("OpenTelemetry service name of the service whose page the item opens."),serviceNamespace:n.Optional(e("OpenTelemetry service namespace of that service. Omitted for a service without one."))}),n.Object({type:n.Literal("browser-view"),pageId:e("View name identifying the page the item opens."),app:e("Application the view belongs to."),env:e("Environment the view was observed in.")})],{description:"Page the user added to their personal sidebar."}),ZBe=$oe(e=>n.String({description:e})),XBe=$oe(e=>l({allowEmpty:!1,description:e}));var JBe=50,Boe=`Items shown in the primary sidebar for this category, in display order: nav item keys, and pages the user added to their personal sidebar (at most ${JBe} across all categories).`,eGe=n.Array(n.String(),{description:Doe}),tGe=n.Optional(n.Array(n.String(),{description:Foe})),rGe=n.Array(gF,{description:Doe}),nGe=n.Optional(n.Array(gF,{description:Foe})),Goe="Stable category id. Unknown or renamed ids are ignored by the client catalog.",joe="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",qoe=e=>n.Object({categories:n.Array(n.Object({id:n.String({description:Goe}),visible:e,folded:tGe}),{description:joe})}),Hoe=e=>n.Object({categories:n.Array(n.Object({id:l({allowEmpty:!1,description:Goe}),visible:e,folded:nGe}),{description:joe})}),Rar=qoe(eGe),Par=Hoe(rGe),Koe=qoe(n.Array(n.Union([n.String(),ZBe]),{description:Boe})),zoe=Hoe(n.Array(n.Union([gF,XBe]),{description:Boe}));var Woe=["YYYY-MM-DD","DD-MM-YYYY","MM-DD-YYYY"],Qoe=["12h","24h"],iGe=n.Union([n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:n.String()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")}),n.Null()]),sGe=n.Union([F("type",[n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:l()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")})]),n.Null()]),aGe=l({allowEmpty:!1,description:"Identifier of the custom role to assign. Use the `id` returned by the custom role endpoints."}),Zoe=F("type",[n.Object({type:n.Enum(fg,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"Assigns the custom role `customRoleId`."}),customRoleId:aGe})],{description:"Organization role to assign: a built-in role `type`, or `custom` with the `customRoleId` of a custom role."}),cGe=F("type",[n.Object({type:n.Enum(fg,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"The user holds a custom role."}),customRoleId:n.String({description:"Identifier of the custom role. Use it with the custom role endpoints to read what the role grants."})})],{description:"Organization role for the user: a built-in role `type`, or `custom` with the `customRoleId` of the custom role."}),cu=n.Object({email:n.String({description:"Lowercase email address for the user. Use this for display and invitation matching, not as a stable identifier."}),id:n.String({description:"Unique identifier of the user. Generated by Tsuga and stable for the user lifetime."}),name:n.String({description:"Display name of the user."}),role:cGe,orgId:n.String({description:"Identifier of the Tsuga organization the user belongs to."}),orgName:n.Optional(n.String({description:"Display name of the Tsuga organization the user belongs to. Absent when the organization record cannot be resolved."})),avatar:n.Optional(Lg),defaultView:n.Optional(iGe),timezone:n.Optional(n.Union([n.String(),n.Null()],{description:"IANA timezone used to display dates and times (e.g. `Europe/Paris`). Absent or `null` means the timezone is auto-detected from the browser."})),dateFormat:n.Optional(n.Union([n.Enum(Woe),n.Null()],{description:"Preferred format for displaying dates: `YYYY-MM-DD`, `DD-MM-YYYY`, or `MM-DD-YYYY`. Absent or `null` means the Tsuga default format."})),hourFormat:n.Optional(n.Union([n.Enum(Qoe),n.Null()],{description:"Preferred format for displaying times: `12h` (AM/PM) or `24h`. Absent or `null` means the Tsuga default format."})),favoriteDashboards:n.Optional(n.Array(n.String(),{description:"Dashboard IDs the user marked as favorites. Not pruned when a dashboard is deleted, so an ID may no longer resolve."})),favoriteFolders:n.Optional(n.Array(n.String(),{description:"Dashboard folder IDs the user marked as favorites. Not pruned when a folder is deleted, so an ID may no longer resolve."})),filterDataByTeams:n.Optional(n.Boolean({description:"Whether the user wants data across the application filtered to the teams they belong to. Set by the user in their profile settings."})),sidebarNavLayout:n.Optional(Koe),fromSso:n.Boolean({description:"Whether the user account was provisioned or authenticated through SSO."}),createdAt:N({description:"Timestamp when Tsuga created the user."}),updatedAt:N({description:"Timestamp when Tsuga last updated the user."}),teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs the user currently belongs to."}))}),{role:jar,...Yoe}=cu.properties,hF=F("role",[n.Object({...Yoe,role:n.Enum(fg,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer` or `teams_only`."})}),n.Object({...Yoe,role:n.Literal("custom",{description:"The user holds a custom role."}),customRole:Moe})]),Xoe=n.Intersect([Dp,n.Object({userRole:n.Enum(rs)})]),Joe=n.Object({status:n.Literal("authenticated"),token:n.String(),user:hF}),eie=F("status",[Joe,n.Object({status:n.Literal("mfa-required"),mfaToken:n.String({description:"Short-lived token accepted only by the TOTP login endpoints; it grants no other access."}),totpEnrolled:n.Boolean({description:"False when the user still has to set up an authenticator app."})})]),qar=f({tags:["users"],url:"/v0/login",method:"POST",body:n.Object({email:l({type:"email"}),password:l({type:"long"})}),response:eie}),tie="/v0/login/totp",Har=f({tags:["users"],url:`${tie}/setup`,method:"POST",body:n.Object({mfaToken:l({type:"long"})}),response:n.Object({mfaToken:n.String({description:"Replaces the login MFA token; pass it when verifying the first code."}),secret:n.String({description:"Base32 secret for manual entry in the authenticator app."})})}),Kar=f({tags:["users"],url:tie,method:"POST",body:n.Object({mfaToken:l({type:"long"}),code:n.String({pattern:`^[0-9]{${6}}$`,description:"The 6-digit code shown by the authenticator app."})}),response:Joe}),zar=f({tags:["users"],url:"/v0/forgot-password",method:"POST",body:n.Object({email:l({type:"email"})}),response:n.Object({})}),Yar=f({tags:["users"],url:"/v0/reset-password",method:"POST",body:n.Object({resetToken:l(),password:l({type:"user-password"})}),response:n.Object({})}),uGe=["active","expired"],Var=f({tags:["users"],url:"/v0/reset-password-status/:resetToken",method:"GET",params:n.Object({resetToken:l()}),response:n.Object({status:n.Enum(uGe)})}),War=f({tags:["users"],url:"/v0/change-password",method:"POST",body:n.Object({currentPassword:l({type:"long"}),newPassword:l({type:"user-password"})}),response:n.Object({})}),Fp="/v0/users",yF="/v0/current-user",Qar=f({tags:["users"],url:yF,method:"GET",response:hF}),Zar=f({tags:["users"],url:`${yF}/teams`,method:"GET",response:n.Array(Xoe)}),Xar=f({tags:["users"],url:"/v0/logout",method:"POST",response:n.Object({})}),Jar=f({tags:["users"],method:"PATCH",url:yF,body:n.Partial(n.Object({avatar:n.Union([Lg,n.Null()]),defaultView:sGe,timezone:n.Union([n.String({format:ld}),n.Null()]),dateFormat:n.Union([n.Enum(Woe),n.Null()]),hourFormat:n.Union([n.Enum(Qoe),n.Null()]),favoriteDashboards:n.Array(l({allowEmpty:!1})),favoriteFolders:n.Array(l({allowEmpty:!1})),filterDataByTeams:n.Boolean(),sidebarNavLayout:n.Union([zoe,n.Null()]),name:l()}),{minProperties:1}),response:hF}),ecr=f({tags:["users"],url:Fp,method:"GET",response:n.Array(cu),query:n.Optional(n.Object({includeTeamIds:n.Optional(n.Boolean())}))}),Voe={count:n.Integer({description:"Number of members holding the role."}),preview:n.Array(dF,{description:`First ${lF} members holding the role, sorted by name.`})},pGe=F("role",[n.Object({role:n.Enum(fg),...Voe}),n.Object({role:n.Literal("custom"),customRoleId:n.String(),...Voe})]),tcr=f({tags:["users"],url:`${Fp}/role-members`,method:"GET",response:n.Array(pGe,{description:"Member count and preview of every role held by at least one member."})}),iT={NAME:"name",ROLE:"role",LOGIN_METHOD:"fromSso",TEAMS:"teams",CREATED_AT:"createdAt"},rie=n.Partial(n.Object({searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring to match against the member name, email, or ID."})},{description:"Substring matched against the member name, email, or ID"})},{description:"Optional filters applied to narrow the returned members"})),lGe=n.Partial(n.Object({...Ie,includeTeamIds:n.Boolean({description:"When true, include the IDs of the teams each member belongs to."}),filters:rie,sort:n.Object({by:n.Enum([iT.NAME,iT.ROLE,iT.LOGIN_METHOD,iT.TEAMS,iT.CREATED_AT],{description:"Field to sort the returned members by"}),direction:me},{description:"Optional sorting applied to the returned members"})})),rcr=f({tags:["users"],url:`${Fp}/query`,method:"POST",paginated:!0,response:n.Array(cu),body:lGe}),{teamIds:ncr,...dGe}=cu.properties,mGe=n.Object({...dGe,teams:n.Optional(n.Array(Xoe))}),ocr=f({tags:["users"],url:`${Fp}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1})}),query:n.Optional(n.Object({includeTeamRoles:n.Optional(n.Boolean())})),response:mGe}),fGe=_i(rie),icr=f({tags:["users"],method:"PUT",url:`${Fp}/bulk-update-role`,body:n.Object({selection:fGe,role:Zoe}),response:n.Object({})}),scr=f({tags:["users"],url:`${Fp}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),acr=f({tags:["users"],url:`${Fp}/:id/totp`,method:"DELETE",params:n.Object({id:l()}),response:q}),ccr=f({tags:["users"],url:`${Fp}/all-emails`,method:"GET",response:n.Array(n.String())}),nie=["pending","accepted","expired","revoked"],gGe=n.Enum(nie),Gd="/v0/invitations",hGe=10,yGe=n.Object({email:l({type:"email",description:"Lowercase email address to invite into the organization."}),teamId:l({description:"Team ID to add the invited user to after acceptance."}),teamRole:n.Enum(rs,{description:"Role the invited user receives in the target team once accepted: `admin`, `editor`, or `viewer`."}),userRole:Zoe}),ucr=f({tags:["invitations"],url:`${Gd}/create`,method:"POST",body:n.Array(yGe,{maxItems:hGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),pcr=f({tags:["invitations"],url:`${Gd}/resend/:id`,params:n.Object({id:l()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),oie=n.Partial(n.Object({searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring to match against the invitation email, team name, or status."})},{description:"Substring matched against the invitation email, team name, or status"})},{description:"Optional filters applied to narrow the returned invitations"})),EGe=_i(oie),lcr=f({tags:["invitations"],url:`${Gd}/bulk-resend`,method:"POST",body:n.Object({selection:EGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),dcr=f({tags:["invitations"],url:Gd,method:"POST",body:n.Object({secret:l()}),response:n.Object({status:gGe,email:n.String(),teamName:n.Optional(n.String()),avatar:n.Optional(wR)})}),mcr=f({tags:["invitations"],url:`${Gd}/accept`,method:"POST",body:n.Object({name:l({type:"short"}),password:l({type:"user-password"}),secret:l()}),response:eie}),fcr=f({tags:["invitations"],url:`${Gd}/revoke/:id`,params:n.Object({id:l()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),SGe=n.Object({id:n.String({description:"Unique identifier of the invitation. Generated by Tsuga."}),email:n.String({description:"Email address invited to join the organization."}),teamId:n.Optional(n.String({description:"Team ID assigned when the invitation is accepted."})),teamRole:n.Optional(n.Enum(rs,{description:"Team role assigned when the invitation is accepted: `admin`, `editor`, or `viewer`."})),createdBy:n.Optional(n.String({description:"User ID that created the invitation."})),status:n.Enum(nie,{description:"Invitation lifecycle status: `pending`, `accepted`, `expired`, or `revoked`. `expired` can be computed from `expiresAt` when invitations are listed."}),expiresAt:N({description:"Timestamp when the invitation expires if not accepted."}),createdAt:N({description:"Timestamp when Tsuga created the invitation."}),updatedAt:N({description:"Timestamp when Tsuga last updated the invitation."})}),kR={EMAIL:"email",TEAM:"team",STATUS:"status",CREATED_AT:"createdAt"},TGe=n.Partial(n.Object({...Ie,filters:oie,sort:n.Object({by:n.Enum([kR.EMAIL,kR.TEAM,kR.STATUS,kR.CREATED_AT],{description:"Field to sort the returned invitations by"}),direction:me},{description:"Optional sorting applied to the returned invitations"})})),gcr=f({tags:["invitations"],url:`${Gd}/query`,method:"POST",paginated:!0,response:n.Array(SGe),body:TGe});var Mg="/v0/operation-api-keys",iie="tsuga_op",sie="v1";var _Ge=100,aie=n.Enum(PM,{description:"Team-access boundary for the operation API key. Set when the key is created or updated. `all` can reach all teams, `owning-team-and-public` can reach the owning team and public teams, and `owning-team-only` can reach only the owning team."}),Ns=e=>n.Literal("read",{description:e}),pr=e=>n.Enum(["read","write"],{description:e}),sT=n.Partial(n.Object({dashboard:pr("Dashboards and the graphs they contain."),"dashboard-folder":pr("Folders organizing dashboards."),"monitor-folder":pr("Folders organizing monitors."),documentation:Ns("Tsuga documentation and API reference pages, which are public content rather than account data."),"ingestion-api-key":pr("Ingestion API keys, used to send telemetry data to Tsuga."),"rum-public-token":pr("RUM public tokens, embedded in web and mobile applications to send real user monitoring telemetry."),"operation-api-key":pr("Operation API keys, used to authenticate API, Terraform, MCP, and Tsuga CLI clients."),inventory:Ns("Cloud resources discovered by inventory scans."),"cloud-account":pr("Cloud accounts Tsuga scans to discover resources."),"custom-role":pr("Custom global roles, which define what their holders can access across the organization."),"data-deletion-request":pr("Data deletion requests, which delete the telemetry events matching a query on a cluster."),logs:Ns("Ingested log events, through search and aggregation endpoints."),"log-route":pr("Log routes, which select newly ingested logs and apply processors to them."),metrics:Ns("Ingested metrics, through query and aggregation endpoints."),"metric-route":pr("Metric routes, which select newly ingested metrics by name and apply processors to them."),"span-route":pr("Span routes, which select newly ingested spans and apply processors to them."),monitor:pr("Monitors, the alert definitions evaluated against telemetry."),"allowed-domains":pr("Email domains whose users are allowed to join the organization."),queue:Ns("Message queues of the catalog, inferred from telemetry."),"quality-report":Ns("Telemetry quality reports."),billing:Ns("Ingested data volume billed to the organization."),service:Ns("Services of the catalog, inferred from telemetry."),"service-target":pr("Notification targets attached to a service."),slo:pr("Service level objectives and the alerts attached to them."),"notification-rule":pr("Notification rules, which route alert transitions to notification targets."),"adaptive-notification-rule":pr("Adaptive notification rules, which page the owners of the failing service when one of their monitors or SLOs fires."),"notification-integration":pr("Notification integrations, containing the credentials Tsuga uses when sending notifications."),"notification-silence":pr("Notification silences, which suppress matching notification delivery."),"custom-usage-tag":pr("Custom usage tags, the telemetry tag keys tracked as usage dimensions."),"retention-policy":pr("Retention policies applied to logs, metrics, and traces."),"sandbox-configuration":Ns("Sandbox agent configurations of the key's teams, and the sandbox agent runs launched with them."),"tag-policy":pr("Tag policies, which enforce tag requirements on Tsuga-managed assets and telemetry data."),team:pr("Teams, their settings and their memberships."),traces:Ns("Ingested spans, through search and aggregation endpoints."),rum:Ns("Ingested RUM events, through search and aggregation endpoints."),user:pr("User accounts of the organization."),"user-invitation":pr("Invitations for people who do not belong to the organization yet.")}),{description:"Resource types the key can act on, each mapped to `read` or `write`. `write` also grants read access. A resource type absent from the map is not accessible to the key at all."}),Dg=n.Object({id:n.String({description:"Unique identifier of the operation API key. Generated by Tsuga when the key is created. Use this as the stable key identifier when correlating API calls with audit logs or key-management records."}),name:n.String({description:"Display name of the operation API key. Set by the user who created or last updated the key. Returned for every operation-key-authenticated request so clients can show which saved key is active."}),owner:n.String({description:"Identifier of the team that owns the operation API key. Set when the key is created or updated. Combined with `scope`, it determines which team-owned resources the key can reach."}),tags:Wt,scope:aie,permissions:sT,keyLastCharacters:n.String({description:"Last characters of the operation API key secret. Set by Tsuga from the generated secret and returned because the full secret is only shown once at creation. Use this to distinguish saved keys without exposing the secret."}),updatedAt:N(),createdAt:N(),creator:n.Optional(Ce),updater:n.Optional(Ce),expiresAt:n.Optional(N({description:"Timestamp after which the operation API key stops authenticating. Set when the key is created or updated. Returned only for keys that have an expiration date."})),lastUsedAt:n.Optional(N())}),LR=n.Object({name:n.String({format:Ji,minLength:1,maxLength:_Ge,description:"Kebab-case name for the operation API key."}),owner:l({allowEmpty:!1,description:"ID of the team that owns the operation API key. When the caller is an operation API key, the team must be within the caller's scope."}),tags:nr,scope:aie,permissions:sT,expiresAt:Qe(l({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. Send null for a key that never expires. On update, leave it out to keep the current expiration. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."}))}),Ocr=f({tags:["operation-api-keys"],url:Mg,method:"POST",body:LR,response:n.Object({...Dg.properties,key:n.String()})}),Acr=f({tags:["operation-api-keys"],url:Mg,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(Dg)}),Ccr=f({tags:["operation-api-keys"],url:`${Mg}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1})}),response:Dg}),Rcr=f({tags:["operation-api-keys"],url:`${Mg}/:id`,method:"PUT",params:n.Object({id:l()}),body:LR,response:Dg}),Pcr=f({tags:["operation-api-keys"],url:`${Mg}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),Ucr=f({tags:["operation-api-keys"],url:`${Mg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var aT=`/${"v1"}/operation-api-keys`,jd=n.Pick(Dg,["id","name","owner","tags","scope","permissions","keyLastCharacters","expiresAt"],{$id:"OperationApiKey",description:"Operation API key used to authenticate API, Terraform, MCP, and Tsuga CLI clients. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),cie={id:"123-456-abc",name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},keyLastCharacters:"x7Qm"};Object.assign(jd,{examples:[cie]});var uie={...n.Pick(LR,["name","owner","tags","scope","permissions"]).properties,expiresAt:l({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."})},pie=n.Object(uie,{$id:"CreateOperationApiKeyRequest",description:"Operation API key creation request. Provide a kebab-case name, owner team, scope, permissions, expiration date, and optionally tags."}),lie=n.Object(uie,{$id:"UpdateOperationApiKeyRequest",description:"Operation API key update request. Provide the full definition, including name, owner team, scope, permissions, and expiration date."}),die={name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},expiresAt:"2027-01-01T00:00:00.000Z"};Object.assign(pie,{examples:[die]});Object.assign(lie,{examples:[die]});var IGe={...cie,key:`${iie}:${sie}:abc123xyx7Qm`},mie="When the caller is an operation API key, the resulting key cannot have a wider scope than the caller, cannot have a higher permission level than the caller on any resource, must have an expiration in the future, and cannot expire later than the caller's own expiration.",Fcr=f({description:"Lists operation API keys, the machine credentials of the public API, with their owner team, scope, permissions, tags and expiry. Only the last characters of each secret are returned. Keys that send telemetry are ingestion API keys.",operationId:"listOperationApiKeys",tags:["operation-api-keys"],url:aT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(jd)}),$cr=f({description:"Retrieves one operation API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getOperationApiKey",tags:["operation-api-keys"],url:`${aT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the operation API key to retrieve. Use the `id` returned by operation API key list or create responses."})}),response:jd}),bGe=n.Object({...jd.properties,key:n.String({description:"Full operation API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"OperationApiKeyCreated",example:IGe}),Bcr=f({description:`Creates an operation API key. Store the returned \`key\` immediately because Tsuga returns the full secret only in this response. ${mie}`,operationId:"createOperationApiKey",tags:["operation-api-keys"],url:aT,method:"POST",body:pie,response:bGe}),Gcr=f({description:`Updates an operation API key by ID, including name, owner, tags, scope, permissions, and expiration. The secret key value is not rotated by this operation. ${mie} The key to update must also belong to a team within the scope of the caller.`,operationId:"updateOperationApiKey",tags:["operation-api-keys"],url:`${aT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the operation API key to update. Use the `id` returned by operation API key list, get, or create responses."})}),body:lie,response:jd}),jcr=f({description:"Deletes an operation API key by ID. Clients using the deleted key can no longer authenticate with it. When the caller is an operation API key, the key must belong to a team within the scope of the caller.",operationId:"deleteOperationApiKey",tags:["operation-api-keys"],url:`${aT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the operation API key to delete. Use the `id` returned by operation API key list, get, or create responses."})}),response:q});var xGe=`/${"v1"}/me`,fie=n.Object({type:n.Literal("operation-api-key",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `operation-api-key` when the request authenticated with an operation API key."}),...n.Pick(jd,["id","name","owner","scope","permissions","keyLastCharacters","expiresAt"]).properties},{$id:"OperationApiKeyIdentity",description:"Identity and effective access for the operation API key used on the request. Returned when the bearer token is an operation API key. See [API keys](/documentation/account-and-settings/api-keys)."}),OGe={type:"operation-api-key",id:"key-123-abc",name:"ci-deploy",owner:"team-123-abc",scope:"owning-team-and-public",permissions:{dashboard:"write",logs:"read",monitor:"read"},keyLastCharacters:"a9f2",expiresAt:"2026-12-01T00:00:00.000Z"};Object.assign(fie,{examples:[OGe]});var gie=n.Object({type:n.Literal("user",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `user` when the request authenticated with a user OAuth access token."}),...n.Pick(cu,["id","email","name","role","orgId","orgName"]).properties,...n.Required(n.Pick(cu,["favoriteDashboards","favoriteFolders"])).properties},{$id:"UserIdentity",description:"Identity for the user OAuth access token used on the request. Returned when the bearer token is a user access token. Access follows the user organization role rather than an operation-key permission map. See [Members](/documentation/account-and-settings/members)."}),AGe={type:"user",id:"user-123-abc",email:"john@tsuga.com",name:"John Doe",role:{type:"public_viewer"},orgId:"org-123-abc",orgName:"Acme Inc.",favoriteDashboards:["dashboard-123-abc"],favoriteFolders:["folder-123-abc"]};Object.assign(gie,{examples:[AGe]});var CGe=F("type",[fie,gie],{description:"Identity and access for the credential used on the request. Returned for any valid public API credential and discriminated by `type` because the API accepts both operation API keys and user OAuth access tokens."}),hie=f({description:"Returns who the request is authenticated as: for an operation API key, its name, owner team, scope, permissions and expiry; for an OAuth access token, the user, organization and role. Any valid public API credential can call it, without resource permissions.",operationId:"getMe",tags:["public","authentication"],url:xGe,method:"GET",response:CGe});var RGe={all:"all permitted telemetry","owning-team-and-public":"owning team plus public data","owning-team-only":"owning team only"};function PGe(e){switch(e.type){case"operation-api-key":return["Authenticated as an operation API key.",...EF([["Name",e.name],["Key",`\u2022\u2022\u2022\u2022${e.keyLastCharacters}`],["ID",e.id],["Owning team",e.owner],["Data scope",`${e.scope} (${RGe[e.scope]})`],["Expires",e.expiresAt??"never"]]),"",...UGe(e.permissions)].join(`
|
|
287
287
|
`);case"user":return["Authenticated as a user.",...EF([["Name",e.name],["Email",e.email],["ID",e.id],["Role",e.role.type]]),"","Access follows the organization role, not a per-resource permission map."].join(`
|
|
288
288
|
`);default:Nt(e)}}function UGe(e){let t=Object.entries(e).sort(([o],[i])=>o.localeCompare(i)),r=["write","read"].map(o=>[o,t.filter(([,i])=>i===o).map(([i])=>i).sort().join(", ")]).filter(([,o])=>o!=="");return r.length===0?["Permissions: none. This key cannot reach any resource."]:["Permissions:",...EF(r)]}function EF(e){let t=Math.max(...e.map(([r])=>r.length));return e.map(([r,o])=>` ${r.padEnd(t)} ${o}`)}var yie=P("whoami",{output:Dx("output",["text","json"]).pipe(la("o"),te("Output format: text | json"),Cn("text"))},v("cli.auth.whoami")(function*({output:e}){let t=yield*er(hie);if(e==="json"){yield*xe({data:t});return}yield*Fe(PGe(t))})).pipe(U("Ask Tsuga which credential this CLI authenticates as, and print its scope and permissions"));var Eie=P("auth").pipe(U("Manage authentication: user login (OAuth) or operation API key"),be([foe,goe,xoe,_oe,boe,yie]));var wGe="/v0/billing/focus",SF="1.4",qd=31,MR=e=>n.String({description:`${e} UTC, formatted as ISO 8601.`}),cT=n.Object({BilledCost:n.Literal(0,{description:"Always 0 for now."}),BillingAccountId:n.String({description:"Identifier of the organization."}),BillingAccountName:n.String({description:"Name of the organization."}),BillingCurrency:n.Literal("USD",{description:"Currency of the cost columns."}),BillingPeriodEnd:MR("Exclusive end of the calendar month holding the charge,"),BillingPeriodStart:MR("Inclusive start of the calendar month holding the charge,"),ChargeCategory:n.Literal("Usage",{description:"Charge category."}),ChargeClass:n.Null({default:null,description:"Represents corrections to the charge, if any."}),ChargeDescription:n.String({description:"Human-readable summary of the charge."}),ChargeFrequency:n.Literal("Usage-Based",{description:"Charge frequency."}),ChargePeriodEnd:MR("Exclusive end of the day the data was ingested,"),ChargePeriodStart:MR("Inclusive start of the day the data was ingested,"),ConsumedQuantity:n.Number({description:"Uncompressed ingested volume, in gigabytes."}),ConsumedUnit:n.Literal("GB",{description:"Unit of `ConsumedQuantity`."}),ContractedCost:n.Literal(0,{description:"Always 0 for now."}),EffectiveCost:n.Literal(0,{description:"Always 0 for now."}),HostProviderName:n.Literal("Tsuga",{description:"Entity hosting the infrastructure the service runs on."}),InvoiceIssuerName:n.Literal("Tsuga",{description:"Entity issuing the invoice."}),ListCost:n.Literal(0,{description:"Always 0 for now."}),PricingQuantity:n.Number({description:"Billable volume, in gigabytes."}),PricingUnit:n.Literal("GB",{description:"Unit of `PricingQuantity`."}),ServiceCategory:n.Literal("Management and Governance",{description:"FOCUS service category."}),ServiceName:n.String({description:"Tsuga product the data was ingested into: `Tsuga Logs`, `Tsuga Metrics`, `Tsuga Traces`, `Tsuga RUM`, or `Tsuga Profiling`."}),ServiceProviderName:n.Literal("Tsuga",{description:"Entity providing the service."}),ServiceSubcategory:n.Literal("Observability",{description:"FOCUS service subcategory."})}),TF=n.Object(on.properties,{description:`Time range to export. It is widened to whole UTC days and must span at most ${qd} days.`}),dur=f({tags:["billing"],url:wGe,method:"GET",query:TF,response:n.Array(cT)});var Sie=n.Object(cT.properties,{$id:"FocusBillingRow",description:`One FOCUS ${SF} cost and usage row: the volume of one telemetry kind ingested on one UTC day.`}),vGe={BilledCost:0,BillingAccountId:"org-123",BillingAccountName:"Acme",BillingCurrency:"USD",BillingPeriodEnd:"2026-10-01T00:00:00Z",BillingPeriodStart:"2026-09-01T00:00:00Z",ChargeCategory:"Usage",ChargeClass:null,ChargeDescription:"Tsuga Logs data ingested",ChargeFrequency:"Usage-Based",ChargePeriodEnd:"2026-09-23T00:00:00Z",ChargePeriodStart:"2026-09-22T00:00:00Z",ConsumedQuantity:12.5,ConsumedUnit:"GB",ContractedCost:0,EffectiveCost:0,HostProviderName:"Tsuga",InvoiceIssuerName:"Tsuga",ListCost:0,PricingQuantity:12.5,PricingUnit:"GB",ServiceCategory:"Management and Governance",ServiceName:"Tsuga Logs",ServiceProviderName:"Tsuga",ServiceSubcategory:"Observability"};Object.assign(Sie,{examples:[vGe]});var Tie=f({description:`Exports the ingested data volume of the organization as FOCUS ${SF} cost and usage rows (https://focus.finops.org), one per UTC day and telemetry kind. The time range is widened to whole UTC days and must span at most ${qd} days. Cost columns are 0 until Tsuga exposes prices. See [Usage overview](/documentation/account-and-settings/usage-overview).`,operationId:"exportFocusBillingData",tags:["billing"],url:`/${"v1"}/billing/focus`,method:"GET",query:TF,response:n.Array(Sie)});var Io=Jn("pretty").pipe(te("Print an aligned table instead of JSON"),Cn(!1)),_ie=je("fields").pipe(te("Comma-separated dot-paths to keep from the JSON as printed, starting at its root, such as data.name; a path through an array applies to each element. Selects the columns of a --pretty table by their path in each row. Text and binary output are unchanged."),Te("FIELDS"),da(NGe),op(e=>e.length>0,()=>"--fields must contain at least one field name"),rt,da(ue));function NGe(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var kGe=Object.keys(cT.properties),Iie=P("export",{...Vt,pretty:Io},v("cli.billing.export")(function*(e){let t=yield*hn,{from:r,to:o}=yield*Vr(e),i=Math.ceil(o/jA)-Math.floor(r/jA);if(i>qd)return yield*new At({message:`--from/--to span ${i} days; a FOCUS export covers at most ${qd} days. Export one shorter range at a time.`});let s=yield*er(Tie,{query:{from:r,to:o}});yield*t.rows(s,{...e,defaultFields:kGe})})).pipe(U(`Export ingested data volume as FOCUS cost and usage rows, at most ${qd} days per call`));var bie=P("billing").pipe(U("Export billing cost and usage data"),be([Iie]));var xie=P("list",{},v("cli.clusters.list")(function*(){yield*xe(yield*Ze(bC))})).pipe(U("List all Tsuga clusters available to the operation API key"));var Oie=P("clusters").pipe(U("Manage Tsuga cluster selection"),be([xie]));var Aie=P("defaults",{},v("cli.config.resetDefaults")(function*(){yield*(yield*yt).resetDefaults,yield*Fe("Custom defaults cleared")})).pipe(U("Clear all custom defaults"));var Cie=P("reset").pipe(U("Reset configuration values"),be([Aie]));var Rie=P("default",{key:hoe("FLAG_NAME",YM).pipe(Ht(`The flag to set a default for. One of: ${YM.join(" | ")}`)),value:je("value").pipe(te("The default value. Use --value=-1h for dash-prefixed values; an empty value clears the default"),Te("VALUE"),da(e=>e.trim()))},v("cli.config.setDefault")(function*({key:e,value:t}){let r=yield*yt;if(t===""){yield*r.setDefault(e,t),yield*Fe(`Default cleared: ${e}`);return}yield*LGe(e,t),yield*r.setDefault(e,t),yield*Fe(`Default set: ${e} = ${t}`)})).pipe(U("Set a custom default value for a command flag"),qx([{description:"Widen the default log search window",command:"config set default from --value=-1h"},{description:"Go back to the built-in default",command:"config set default from --value ''"}]));function LGe(e,t){switch(e){case"from":case"to":return Xs(AR(e,le(t)));case"max-results":{let r=Number(t);return Number.isSafeInteger(r)&&r>0?Oe:new At({message:`The default for max-results must be a positive safe integer (got: ${t})`})}case"query":case"cluster":return Oe;default:return Nt(e)}}var Pie=P("telemetry",{consent:Soe("STATE",[["on",!0],["off",!1]]).pipe(Ht("Whether to send usage data"))},v("cli.config.setTelemetry")(function*({consent:e}){yield*(yield*yt).saveTelemetryConsent(e);let t=(yield*tD)===void 0?"":" (TSUGA_TELEMETRY overrides it)";yield*Fe(`Usage data: ${e?"on":"off"}${t}`)})).pipe(U("Turn sending anonymous usage data on or off"),qx([{description:"Stop sending usage data",command:"config set telemetry off"}]));var Uie=P("set").pipe(U("Set a configuration value"),be([Rie,Pie]));var wie=v("cli.config.show")(function*(){let e=yield*wa,t=yield*yt,r=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});yield*Fe(GJ(r,t.configPath).trimEnd())});var vie=P("config",{},wie).pipe(U("Show or manage configuration"),be([Uie,Cie]));var Nie=P("get",{path:gr("DOC_PATH").pipe(Ht("Path or link of the page to fetch"))},v("cli.docs.get")(function*({path:e}){yield*Sc({[EZ]:e}),yield*xe(yield*Ze(KJ,{query:{path:e}}))})).pipe(U("Get a documentation page, API-reference page or agent skill by path or link (e.g. 'getting-started/send-your-first-logs', 'api/aggregateScalar' or 'skills/tsuga-cli')"));var kie=P("search",{query:gr("SEARCH_TEXT").pipe(Ht("Text to search for"))},v("cli.docs.search")(function*({query:e}){yield*Sc({[SZ]:e}),yield*xe(yield*Ze(CC,{query:{query:e}}))})).pipe(U("Search Tsuga documentation and the full API reference, ranked by relevance"));var Lie=P("docs").pipe(U("Search and fetch Tsuga documentation and API-reference pages"),be([Nie,kie]));var uT="/v0/sandbox-runs",MGe=["running","completed","failed","cancelled"],DGe=n.Enum(MGe,{description:"Lifecycle status of the sandbox agent run"}),FGe="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",$Ge=50,BGe=25e3,GGe=1e5,Mie=`Claude Code auto memory files kept across runs of a sandbox configuration, keyed by file name: a MEMORY.md index plus the topic files it links, at most ${GGe} characters in total. Runs rewrite them, so review them like any agent output.`,_F=n.Record(n.String(),n.String(),{description:Mie}),IF=n.Record(n.String({pattern:FGe}),n.String({maxLength:BGe}),{additionalProperties:!1,minProperties:1,maxProperties:$Ge,description:Mie,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),Die=30,jGe=F("type",[n.Object({type:n.Literal("quality-report-auto-fix"),ruleKey:n.String({description:"Quality-report rule the run tried to fix."}),teamId:n.Optional(n.String({description:"Team the rule failed for."})),teamName:n.Optional(n.String({description:"Name of that team."})),configurationId:n.Optional(n.String({description:"Sandbox configuration the run used."})),configurationName:n.Optional(n.String({description:"Name of that configuration."}))}),n.Object({type:n.Literal("scheduled"),scheduledRunId:n.String({description:"Scheduled run that launched the run."}),scheduledRunName:n.String({description:"Name of that scheduled run."}),configurationId:n.String({description:"Sandbox configuration the run used."}),configurationName:n.Optional(n.String({description:"Name of that configuration. Missing when the launch failed before the configuration was read."}))})],{description:"What launched the run."}),Fie=n.Object({costUsd:n.Number({description:"Estimated cost in USD, computed by Claude Code from Anthropic list prices."}),inputTokens:n.Number({description:"Input tokens sent to the model."}),outputTokens:n.Number({description:"Output tokens generated by the model."}),cacheReadTokens:n.Number({description:"Input tokens served from the prompt cache."}),turns:n.Number({description:"Agent turns taken."}),agentDurationMs:n.Number({description:"Wall-clock time of the agent session."}),modelDurationMs:n.Number({description:"Time spent waiting on model responses."}),sessionId:n.String({description:"Claude Code session ID."})},{description:"Usage reported by the agent's final result event."}),$ie=200,pT=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:DGe,trigger:jGe,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(Fie),prompt:n.Optional(n.String({description:"Prompt the agent ran with. Returned by the get endpoint only."})),output:n.Optional(n.String({description:"The agent's final output, once the run finished. Returned by the get endpoint only."})),creator:n.Optional(Ce),createdAt:N({description:"When the run started."}),completedAt:n.Optional(N({description:"When the run finished."}))}),Apr=f({tags:["sandbox-runs"],url:uT,method:"GET",response:n.Array(pT)}),Cpr=f({tags:["sandbox-runs"],url:`${uT}/:id`,method:"GET",params:n.Object({id:l()}),response:pT}),Rpr=f({tags:["sandbox-runs"],url:`${uT}/validate`,method:"POST",body:n.Object({runId:l({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:l({allowEmpty:!1,description:"Cluster the run targets; must belong to the operation key's organization."})}),response:n.Object({authorized:n.Boolean({description:"True when the key may execute this sandbox run."})})}),Ppr=f({tags:["sandbox-runs"],url:`${uT}/:id/cancel`,method:"POST",params:n.Object({id:l()}),response:n.Object({})}),Upr=f({tags:["sandbox-runs"],url:`${uT}/:id/complete`,method:"POST",params:n.Object({id:l({description:"Sandbox run the agent finished."})}),body:n.Object({status:n.Enum(["completed","failed"],{description:"Completed when the agent exited successfully, failed otherwise."}),output:n.Optional(n.String({description:"The agent's final output."})),error:n.Optional(n.String({description:"Why the run failed."})),usage:n.Optional(Fie),memory:n.Optional(IF)}),response:n.Object({})});var $p="/v0/sandbox-configurations",qGe=100,HGe=60,Bie="Full names of the repositories (e.g. `org/repo`) the sandbox agent may work in. An empty array means the agent can reach every repository the GitHub App connection is installed on.",Gie=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${Die} when unset.`,jie="Slack channel told when a run of this configuration finishes, through a Slack notification integration. Omit it to notify no one.",KGe=n.Object({type:n.Literal("slack"),integrationId:n.String({description:"Slack notification integration to post with."}),channel:n.String({description:"Slack channel or user that receives the message."})},{description:jie}),zGe=n.Object({type:n.Literal("slack"),integrationId:l({allowEmpty:!1,description:"Slack notification integration to post with."}),channel:l({allowEmpty:!1,description:"Slack channel or user that receives the message."})},{description:jie}),Fg=n.Object({id:n.String({description:"Tsuga-generated sandbox configuration ID."}),name:n.String({description:"Human-readable name of the sandbox configuration."}),owner:n.String({description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(n.String(),{description:Bie}),scope:Us,permissions:sT,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:Gie})),memory:n.Optional(_F),notification:n.Optional(KGe),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:N(),updatedAt:N()}),qie=n.Object({name:n.String({minLength:1,maxLength:qGe,description:"Human-readable name of the sandbox configuration."}),owner:l({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(l({allowEmpty:!1}),{default:[],description:Bie}),scope:Us,permissions:sT,systemPrompt:n.Optional(l({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:HGe,description:Gie})),notification:n.Optional(zGe)}),Bpr=f({tags:["sandbox-configurations"],url:$p,method:"GET",response:n.Array(Fg)}),Gpr=f({tags:["sandbox-configurations"],url:`${$p}/:id`,method:"GET",params:n.Object({id:l()}),response:Fg}),jpr=f({tags:["sandbox-configurations"],url:$p,method:"POST",body:qie,response:Fg}),qpr=f({tags:["sandbox-configurations"],url:`${$p}/:id`,method:"PUT",params:n.Object({id:l()}),body:qie,response:Fg}),Hpr=f({tags:["sandbox-configurations"],url:`${$p}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),lT=n.Object({memory:n.Optional(_F)}),bF=n.Object({memory:IF}),Kpr=f({tags:["sandbox-configurations"],url:`${$p}/:id/memory`,method:"GET",params:n.Object({id:l()}),response:lT}),zpr=f({tags:["sandbox-configurations"],url:`${$p}/:id/memory`,method:"PUT",params:n.Object({id:l()}),body:bF,response:Fg}),Ypr=f({tags:["sandbox-configurations"],url:`${$p}/:id/memory`,method:"DELETE",params:n.Object({id:l()}),response:Fg});var Hie=`/${"v1"}/sandbox-runs`,xF=`/${"v1"}/sandbox-configurations/:id/memory`,Kie="Admin users see every run; other users and operation API keys see only the runs their user started.",OF=n.Object({id:l({allowEmpty:!1,description:"ID of the sandbox configuration."})}),zie=f({description:`Lists the latest ${$ie} sandbox agent runs, newest first, without their prompt and output. ${Kie}`,tags:["private"],url:Hie,method:"GET",response:n.Array(pT)}),Yie=f({description:`Gets a sandbox agent run with its prompt and output. ${Kie}`,tags:["private"],url:`${Hie}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"ID of the sandbox run."})}),response:pT}),Vie=f({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:xF,method:"GET",params:OF,response:lT}),AF=f({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:xF,method:"PUT",params:OF,body:bF,response:lT}),Wie=f({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:xF,method:"DELETE",params:OF,response:lT});var $g=gr("CONFIGURATION_ID").pipe(Ht("The sandbox configuration ID"));var Qie=P("clear",{id:$g},v("cli.sandbox-memory.clear")(function*({id:e}){yield*xe(yield*Ze(Wie,{params:{id:e}}))})).pipe(U("Clear the memory of a sandbox configuration"));var Zie=P("get",{id:$g},v("cli.sandbox-memory.get")(function*({id:e}){yield*xe(yield*Ze(Vie,{params:{id:e}}))})).pipe(U("Get the memory of a sandbox configuration"));var Xie=P("set",{id:$g,file:Np,data:su,generateSkeleton:au},v("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*Wo(yield*iu(AF));return}yield*xe(yield*Ze(AF,{params:{id:e.id},body:yield*eu(e)}))})).pipe(U("Replace the memory of a sandbox configuration"));var Jie=P("sandbox-memory").pipe(U("Read and edit the memory that sandbox agent runs keep per configuration"),be([Zie,Xie,Qie]));function ese(e){let t={};function r(o,i,s,a){if(n.IsObject(o)){for(let[u,p]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(u))continue;let m=u.replace(/([A-Z])/g,"-$1").toLowerCase(),g=u==="filters"||u==="value"||u==="values"?s:u==="exclude"?`exclude-${s}`:s?`${s}-${m}`:m,y="description"in p&&typeof p.description=="string"?p.description:"";r(p,[...i,u],g,u==="value"||u==="values"?`${a} ${y}`.trim():y||a)}return}t[s]={path:i,flag:YGe(s,o,a)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:k(function*(o,i={},s={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new At({message:"The list request body must be a JSON object"});let a={...i,...s};for(let[p,{path:m}]of Object.entries(t)){let g=o[p];if(!wh(g)||In(g))continue;let y=a;for(let[E,h]of m.entries())if(E===m.length-1)y[h]=g.value;else{let S=y[h],_=S!==null&&typeof S=="object"&&!Array.isArray(S)?{...S}:{};y[h]=_,y=_}}let u=e?La(e,a):[];return u.length>0?yield*new At({message:`Invalid list request: ${JSON.stringify(u)}`}):a})}}function YGe(e,t,r){let o;if(n.IsString(t))o=je(e);else if(n.IsBoolean(t))o=Jn(e);else if(n.IsEnum(t))o=CE(e,t.enum.map(i=>[String(i),i]));else if(n.IsArray(t)&&(n.IsString(t.items)||n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items))){let i=n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items)&&t.items.enum.every(s=>typeof s=="number");o=je(e).pipe(Te("VALUE,..."),da(s=>s.split(",").map(a=>{let u=a.trim();return i&&u!==""?Number(u):u}))),r+=" Pass comma-separated values."}else n.IsUnion(t)&&t.anyOf.some(n.IsNull)&&t.anyOf.every(i=>n.IsString(i)||n.IsNull(i))?(o=je(e).pipe(da(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=je(e).pipe(Te("JSON"),t4(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(te(r),rt)}function De(e){let t=e.singularOverride??NJ(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=VGe(t),{get:i,create:s,update:a,delete:u}=e.endpoints,p=[WGe(e,r),...i?[P("get",{id:CF},v("cli.resource.get")(function*({id:m}){yield*xe(yield*Ze(i,{params:{[RF(i)]:m}}))})).pipe(U(`Get ${o} ${t} by ID`))]:[],...s?[Kn("create",`Create a new ${t}`,s)]:[],...a?[P("update",{id:CF,file:Np,data:su,generateSkeleton:au},v("cli.resource.update")(function*(m){if(m.generateSkeleton){yield*Wo(yield*iu(a));return}yield*xe(yield*Ze(a,{params:{[RF(a)]:m.id},body:yield*eu(m)}))})).pipe(U(`Update ${o} ${t} by ID`))]:[],...u?[P("delete",{id:CF},v("cli.resource.delete")(function*({id:m}){yield*xe(yield*Ze(u,{params:{[RF(u)]:m}}))})).pipe(U(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return P(e.commandName).pipe(U(e.description),be(p))}function VGe(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}var CF=gr("ID").pipe(Ht("The resource ID"));function WGe(e,t){let r=e.listDescription??`List all ${t}`,o=ese(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:Lp.limit,offset:Lp.offset,all:Lp.all}:{};return e.enableListBody?P("list",{...o.flags,...i,data:su,generateSkeleton:au},v("cli.resource.list")(function*(s){if(s.generateSkeleton){yield*Wo(yield*iu(e.endpoints.list));return}let a=wt(s.data)?yield*eu({file:K(),data:s.data}):{};yield*xe(yield*Ze(e.endpoints.list,{body:yield*o.apply(s,a,tse(s)),allPages:s.all===!0}))})).pipe(U(r)):P("list",{...o.flags,...i},v("cli.resource.list")(function*(s){let a=yield*o.apply(s,{},tse(s));yield*xe(yield*Ze(e.endpoints.list,{query:a,allPages:s.all===!0}))})).pipe(U(r))}function tse(e){return Sn({limit:e.limit&&ue(e.limit),offset:e.offset&&ue(e.offset)})}function RF(e){let t=e.params;if(t!==null&&typeof t=="object"&&"properties"in t){let{properties:r}=t;if(r!==null&&typeof r=="object"){let o=Object.keys(r);if(o.length===1&&o[0])return o[0]}}return"id"}var rse=De({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:zie,get:Yie}});var nse=P("experimental").pipe(U("Experimental commands that may change or be removed without notice"),be([rse,Jie]));var QGe=`/${"v1"}/feedback`,ose=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),ZGe={id:"request-123-abc"};Object.assign(ose,{examples:[ZGe]});var ise=n.Object({content:l({allowEmpty:!1,type:"long",description:"Free-text feedback content, e.g. what went wrong, what was confusing, or a suggestion. Required and must be non-empty."})}),XGe={content:"The traces command times out for large services."};Object.assign(ise,{examples:[XGe]});var sse=f({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["public","feedback"],url:QGe,method:"POST",body:ise,response:ose});var ase=P("feedback",{message:gr("MESSAGE").pipe(Ht("The feedback to send"),yoe({min:1}))},v("cli.feedback")(function*({message:e}){yield*xe(yield*Ze(sse,{body:{content:e.join(" ")}}))})).pipe(U("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var JGe=`/${"v1"}/grok`,eje=25,tje=100,cse=n.Object({rules:n.Array(l({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:eje,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:n.Array(l({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:tje,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),rje={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(cse,{examples:[rje]});var use=n.Object({results:n.Array(n.Object({sample:n.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:n.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:n.Union([n.Record(n.String(),n.Unknown()),n.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),nje={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(use,{examples:[nje]});var pse=f({url:`${JGe}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:cse,response:use,description:"Tests Grok parsing rules on sample log lines and returns the extracted fields, with the engine log routes use. Requires read access to log routes. A rule that fails to compile returns a 400 with error code `GROK_RULE_VALIDATION_ERROR` and per-rule details in `error.details.ruleErrors`."});var lse=Kn("parse","Parse sample log lines with grok rules and return the extracted fields",pse);var dse=P("grok").pipe(U("Test and preview grok parsing rules"),be([lse]));var hse=require("node:os"),mT=require("node:path");var PF,mse=()=>{PF?.release(),PF=void 0},fse=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=u=>i?(r.push(u),!0):o(u);let s=()=>i?(i=!1,e.write=o,r.splice(0)):[],a={release:()=>{for(let u of s())o(u)},divert:()=>{for(let u of s())t.write(u)}};return PF=a,a},gse=e=>t=>t.pipe(my(r=>r._tag==="ShowHelp"?ne(e.divert):Oe),Qn(ne(e.release)));function oje(e){return process.platform==="win32"?`${e}.cmd`:e}var Bp=v("external.run")(function*(e,t){yield*Fe(` $ ${e} ${t.join(" ")}`),yield*ne(mse);let r=yield*uo(G(zi(oje(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(tt(o=>new Ed({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new Ed({message:`${e} ${t.join(" ")} exited ${r}`})});var dT="tsuga-dev/agent-plugins",Bg="tsuga";var ije=v("cli.installPlugin.autoUpdate")(function*(e){let t=yield*tn,r=(0,mT.join)(e,".claude","settings.json");yield*Fe(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,mT.dirname)(r),{recursive:!0}).pipe(Jc("create",(0,mT.dirname)(r)));let o=yield*yg(r),i=yield*vC(r,o??"{}"),s=i.extraKnownMarketplaces??{};if(!bi(s))return yield*new qn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let a=s[Bg],u=bi(a)?a:{},p={...i,extraKnownMarketplaces:{...s,[Bg]:{source:{source:"github",repo:dT},...u,autoUpdate:!0}}},m=Ac(yield*_b),g=yield*Eg(r,o,m);yield*hg(r,yield*NC(p)),yield*Fe(g===void 0?" created":` patched (backup: ${g})`)}),sje=v("cli.installPlugin.claude")(function*(e,t){yield*Fe("Claude Code \u2192 installing Tsuga plugin"),yield*Bp("claude",["plugin","marketplace","add",dT]),yield*Bp("claude",["plugin","install",`tsuga@${Bg}`]),t&&(yield*ije(e))}),yse=P("claude-code",{autoUpdate:Jn("auto-update").pipe(te("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),Cn(!0))},v("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*sje((0,hse.homedir)(),e),yield*Fe("Restart your claude session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var aje=v("cli.installPlugin.codex")(function*(){yield*Fe("Codex \u2192 installing Tsuga plugin"),yield*Bp("codex",["plugin","marketplace","add",dT]),yield*Bp("codex",["plugin","add",`tsuga@${Bg}`])}),Ese=P("codex",{},v("cli.installPlugin.codexCli")(function*(){yield*aje(),yield*Fe("Restart your codex session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var Sse=P("plugin").pipe(U("Install the Tsuga plugin into a specific LLM CLI"),be([yse,Ese]));var Tse=P("install").pipe(U("Install Tsuga plugins into local LLM CLIs"),be([Sse]));var cje=10,uje=n.Object({key:l({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:n.Optional(l({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:n.Optional(n.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),UF=n.Object({field:n.String({description:"Field name to use in queries. For `kind: attribute`, this is an attribute dot path. For `kind: metric`, this is either a metric name or a `metricName.context.attribute` path when the metric query used a metric attribute."}),kind:n.Enum(["attribute","metric"],{description:"Whether the field is a telemetry attribute or a metric name. `metric` appears only in the metrics bucket, for fields referenced as the aggregated field of a metrics-source query."}),inferredType:n.Enum(["numeric","categorical","unknown"],{description:"Value type inferred from how the field is used: `numeric` when aggregated with sum/average/percentile, referenced by numeric or range filters, or a metric name; `categorical` when only grouped by or matched with equality/text filters; `unknown` otherwise. Evidence-based \u2014 a numeric field used only in equality filters reads as categorical."}),score:n.Number({description:"Relative relevance score computed by Tsuga from how strongly readable dashboards and monitors use this field for the requested scope, discounted when the field is common across the whole organization. Higher values mean stronger evidence that the field is useful for this scope. Scores are intended for ranking, not for comparison across unrelated scopes."}),artifacts:n.Number({description:"Number of distinct readable dashboards and monitors that reference this field and match the requested scope. Tsuga counts an artifact once per field even if it uses the field in multiple widgets or queries."}),globalArtifacts:n.Number({description:"Number of organization-wide dashboards and monitors that reference this field, regardless of the requested scope or caller permissions. Tsuga uses this anonymous baseline to down-rank fields that are common everywhere."}),usage:n.Object({groupBy:n.Number({description:"Number of distinct readable matching artifacts that use this field as a group-by or split dimension."}),filter:n.Number({description:"Number of distinct readable matching artifacts that filter on this field in widget queries, monitor queries, or dashboard-wide filters."}),measure:n.Number({description:"Number of distinct readable matching artifacts that aggregate this field as `aggregate.field`."}),column:n.Number({description:"Number of distinct readable matching artifacts that pin this field as a list-widget column."})},{description:"Distinct-artifact counts by usage kind, explaining why the field ranked where it did; a dashboard referencing the field the same way in many widgets counts once for that usage kind."})}),wF=n.Object({logs:n.Array(UF,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(UF,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(UF,{description:"Top metric names and metric-attribute fields for the requested scope, ranked by score and mined from readable metrics-sourced dashboards and monitors."}),dashboardsMatched:n.Number({description:"Number of dashboards that matched the requested scope and that the caller can read. Dashboards the caller cannot read are removed before field rankings are returned."}),monitorsMatched:n.Number({description:"Number of monitors that matched the requested scope and that the caller can read. Monitors the caller cannot read are removed before field rankings are returned."})}),vF=n.Object({scope:n.Array(uje,{minItems:1,maxItems:cje,description:"Scope entries that define the population to rank fields for, drawn from positive equality pairs in a TQL query, such as service and environment. Tsuga matches entries softly by default: an artifact's contribution is weighted by the fraction of entries it matches."})}),Ndr=f({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:vF,response:wF});var pje=`/${"v1"}/interesting-fields`,lje={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},dje=n.Object(vF.properties,{description:"The scope to rank fields for, as attribute key/value pairs such as a service name and an environment. Entries are matched softly by default: a widget contributes in proportion to how many entries it matches, so a broader scope returns a broader ranking. Set `valueMustMatch` on an entry to make it a hard filter instead: a widget that does not match it exactly contributes nothing, even when other entries match.",examples:[lje]}),_se=f({url:pje,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:dje,response:wF,description:"Ranks the log, trace and metric fields most used for a scope, such as one service, in the organization's dashboards and monitors: which attribute to filter or group by, which metric to chart. Ranking is TF-IDF style, so a field used everywhere scores below one distinctive to the scope. Assets the caller cannot read only feed an anonymous frequency baseline. Requires public API read access to dashboards and monitors."});var Ise=Kn("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",_se);var bse=P("interesting-fields").pipe(U("Discover the telemetry fields an org already uses for a scope"),be([Ise]));var ei="/v0/kubernetes-explorer",mje="^[a-z0-9.-]+$",fje="^[A-Za-z0-9._-]+$",xse=256,Ose=n.Optional(l({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var Jo=e=>n.Optional(n.Array(l({allowEmpty:!1}),{description:e})),NF=["clusters","namespaces","teams","envs"],fT="Names of other filter fields in this query whose values exclude rather than include. Set this to a field name to keep only the resources matching none of that field's values; fields left out keep the resources matching any of their values.",kF={clusterId:Ose,search:n.Optional(n.String({pattern:mje,minLength:1,maxLength:xse,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},Ase={clusterId:Ose,search:n.Optional(n.String({pattern:fje,minLength:1,maxLength:xse,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},Cse=n.Object(kF),Rse=n.Object(Ase),Gg={...kF,includeInternalNamespaces:n.Optional(n.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded, even when `namespaces` names them."})),clusters:Jo("Restrict results to these Kubernetes cluster names."),namespaces:Jo("Restrict results to these namespaces."),teams:Jo("Restrict results to these team names."),envs:Jo("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(NF),{description:fT})),...Ie},gje=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],hje=[...NF,"nodes","deployments","statefulsets","daemonsets","podStatus"],yje={...Gg,nodes:Jo("Restrict results to pods scheduled on these nodes."),deployments:Jo("Restrict results to pods owned by these Deployments."),statefulsets:Jo("Restrict results to pods owned by these StatefulSets."),daemonsets:Jo("Restrict results to pods owned by these DaemonSets."),podStatus:Jo("Restrict results to pods whose resolved status matches any of these values. Typical values are the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute. When exclusiveFilters includes podStatus, keep pods whose status matches none of these values instead."),exclusiveFilters:n.Optional(n.Array(n.Enum(hje),{description:`${fT} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},Eje=["deployment","statefulset","daemonset"],Pse=n.Object({kind:n.Enum(Eje,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:n.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),Use=n.Object({podName:n.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:n.Optional(n.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:n.Enum(gje,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:n.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:n.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:n.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:n.Optional(N({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),LF=n.Object({...Use.properties,workload:n.Optional(Pse),cpuUsageMilli:n.Optional(n.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:n.Optional(n.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:n.Optional(n.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:n.Optional(n.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:n.Optional(n.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),MF=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],Wdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/pods`,query:n.Object({...yje,sortBy:n.Optional(n.Enum(MF,{description:"Field to sort pods by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(LF)}),Sje=["teams","envs"],DF=n.Object({cluster:n.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:n.Optional(n.Array(n.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:n.Optional(n.Array(n.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:n.Optional(n.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:n.Optional(n.Object({Pending:n.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:n.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:n.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:n.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:n.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),Tje=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],Qdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/clusters`,query:n.Object({...Ase,teams:Jo("Restrict to clusters that host workloads from these team names."),envs:Jo("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(Sje),{description:fT})),sortBy:n.Optional(n.Enum(Tje,{description:"Field to sort clusters by."})),sortDirection:n.Optional(me),...Ie}),paginated:!0,response:n.Array(DF)}),_je=["clusters"],Ije=["Ready","NotReady","Unknown"],FF=n.Object({node:n.String({description:"Kubernetes node name from node telemetry."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the node. Present when cluster telemetry is observed."})),status:n.Optional(n.Enum(Ije,{description:"Readiness of the node, derived from its Ready condition. Present when node condition telemetry is observed."})),instanceType:n.Optional(n.String({description:"Cloud instance type backing the node (for example `r7g.2xlarge`). Present when host telemetry is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods scheduled on the node, including pods in internal namespaces since they occupy node capacity. Present when pod telemetry is observed."})),allocatablePods:n.Optional(n.Integer({description:"Maximum number of pods the node can run. Present when node allocatable telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the node, in millicores. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),cpuAllocatableMilli:n.Optional(n.Number({description:"CPU available to pods on the node, in millicores. Present when node allocatable telemetry is observed."})),cpuUtilization:n.Optional(n.Number({description:"Node CPU usage divided by allocatable CPU. Present when both usage and allocatable telemetry are observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent memory usage for the node, in bytes. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),memoryAllocatableBytes:n.Optional(n.Number({description:"Memory available to pods on the node, in bytes. Present when node allocatable telemetry is observed."})),memoryUtilization:n.Optional(n.Number({description:"Node memory usage divided by allocatable memory. Present when both usage and allocatable telemetry are observed."}))}),$F=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],Zdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/nodes`,query:n.Object({...kF,clusters:Jo("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(_je),{description:fT})),sortBy:n.Optional(n.Enum($F,{description:"Field to sort nodes by."})),sortDirection:n.Optional(me),...Ie}),paginated:!0,response:n.Array(FF)}),BF=n.Object({namespace:n.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:n.Optional(n.Array(n.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:n.Optional(n.Array(n.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),GF=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],Xdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/namespaces`,query:n.Object({...Gg,sortBy:n.Optional(n.Enum(GF,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(BF)}),jF=n.Object({deployment:n.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),qF=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],Jdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/deployments`,query:n.Object({...Gg,sortBy:n.Optional(n.Enum(qF,{description:"Field to sort deployments by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(jF)}),HF=n.Object({statefulSet:n.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),KF=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],emr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/statefulsets`,query:n.Object({...Gg,sortBy:n.Optional(n.Enum(KF,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(HF)}),zF=n.Object({daemonSet:n.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:n.Optional(n.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:n.Optional(n.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),YF=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],tmr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/daemonsets`,query:n.Object({...Gg,sortBy:n.Optional(n.Enum(YF,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(zF)}),VF=n.Object({overview:n.Object({...Use.properties,workload:n.Optional(Pse)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:n.Object({cpu:n.Object({usage:n.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:n.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:n.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:n.Object({usage:n.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:n.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:n.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:n.Object({logs:n.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:n.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),wse=n.Object({clusterId:n.Optional(l({allowEmpty:!1})),k8sCluster:l({allowEmpty:!1}),k8sNamespace:l({allowEmpty:!1}),podName:l({allowEmpty:!1})}),rmr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/pod-details`,query:wse,response:VF}),WF=n.Object({configuration:n.Optional(n.Object({spec:n.Record(n.String(),n.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:N({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:n.Record(n.String(),n.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:n.Record(n.String(),n.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:n.Optional(N({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),nmr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/pod-manifest`,query:wse,response:WF}),QF=n.Object({podName:n.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:n.Optional(n.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),ZF=n.Object({overview:n.Object({deploymentName:n.String({description:"Kubernetes Deployment name for this detail response."}),namespace:n.Optional(n.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:n.Optional(n.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:n.Optional(n.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:n.Optional(N({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array(QF,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({replicaSetName:n.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:n.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:n.Optional(N({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),faultyReasons:n.Optional(n.Array(n.String(),{description:"Container status reasons the Kubernetes faulty deployment monitor reported for this revision within the revisions lookback. Present only when the revision was flagged as faulty."})),logsSearchFilter:n.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),omr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/deployment-details`,query:n.Object({clusterId:n.Optional(l({allowEmpty:!1})),k8sCluster:l({allowEmpty:!1}),k8sNamespace:l({allowEmpty:!1}),deploymentName:l({allowEmpty:!1})}),response:ZF}),bje=n.Object({overview:n.Object({statefulSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyReplicas:n.Optional(n.Integer()),desiredReplicas:n.Optional(n.Integer()),latestRevisionAt:n.Optional(N())}),podReplicas:n.Array(QF,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({revisionName:n.String(),firstSeen:n.Optional(N()),faultyReasons:n.Optional(n.Array(n.String()))}))}),imr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/statefulset-details`,query:n.Object({clusterId:n.Optional(l({allowEmpty:!1})),k8sCluster:l({allowEmpty:!1}),k8sNamespace:l({allowEmpty:!1}),statefulSetName:l({allowEmpty:!1})}),response:bje}),xje=n.Object({overview:n.Object({daemonSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyNodes:n.Optional(n.Integer()),desiredNodes:n.Optional(n.Integer()),latestRevisionAt:n.Optional(N())}),podReplicas:n.Array(QF,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:n.Array(n.Object({observedGeneration:n.Integer(),firstSeen:n.Optional(N()),faultyReasons:n.Optional(n.Array(n.String()))}))}),smr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/daemonset-details`,query:n.Object({clusterId:n.Optional(l({allowEmpty:!1})),k8sCluster:l({allowEmpty:!1}),k8sNamespace:l({allowEmpty:!1}),daemonSetName:l({allowEmpty:!1})}),response:xje}),DR=1e3,vse=Pa,FR=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),name:n.Optional(n.String({description:"Name of the Kubernetes Event object, unique within its namespace."})),timestamp:n.Number({description:"Last time the event was observed, in milliseconds since the Unix epoch."}),type:n.Optional(n.String({description:"Event type, `Normal` or `Warning`."})),reason:n.Optional(n.String({description:"Short, machine-readable reason for the event, such as `BackOff` or `FailedScheduling`."})),message:n.Optional(n.String({description:"Human-readable description of the event."})),resourceName:n.Optional(n.String({description:"Name of the Kubernetes resource the event is about."})),resourceKind:n.Optional(n.String({description:"Kind of the Kubernetes resource the event is about, such as `Pod` or `Node`."})),namespace:n.Optional(n.String({description:"Kubernetes namespace the event was recorded in."})),cluster:n.Optional(n.String({description:"Name of the Kubernetes cluster that emitted the event."})),count:n.Optional(n.Integer({description:"Number of times the event occurred."}))}),Oje=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],Aje=[...NF,"resourceKinds","resourceNames"],XF=n.Object({...Gg,resourceKinds:Jo("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:Jo("Restrict results to events about these resource names."),types:n.Optional(n.Array(n.Enum(["Normal","Warning"]),{description:"Restrict results to events of these types."})),exclusiveFilters:n.Optional(n.Array(n.Enum(Aje),{description:fT})),sortBy:n.Optional(n.Enum(Oje)),sortDirection:n.Optional(me)}),amr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/events`,query:XF,paginated:!0,response:n.Array(FR)}),Cje=n.Object({...FR.properties,firstSeen:n.Optional(n.Number({description:"First time the event was observed, in milliseconds since the Unix epoch."})),resourceFieldPath:n.Optional(n.String({description:"Part of the resource the event is about, such as `spec.containers{app}` for one container."})),reportingComponent:n.Optional(n.String({description:"Component that reported the event, such as `kubelet`."})),reportingInstance:n.Optional(n.String({description:"Instance of the reporting component, such as the node name."})),team:n.Optional(n.String()),logsQuery:n.String({description:"TQL log search filter matching every update of the event."})}),cmr=f({tags:["kubernetes-explorer"],method:"GET",url:`${ei}/event-details`,query:n.Object({clusterId:n.Optional(l({allowEmpty:!1})),k8sCluster:l({allowEmpty:!1}),k8sNamespace:l({allowEmpty:!1}),eventName:l({allowEmpty:!1})}),response:Cje});var ks=`/${"v1"}/kubernetes-explorer`,kse=n.Pick(LF,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),Rje={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(kse,{examples:[Rje]});var Lse=n.Pick(DF,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),Pje={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(Lse,{examples:[Pje]});var Mse=n.Pick(BF,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),Uje={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(Mse,{examples:[Uje]});var Dse=n.Pick(FF,["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],{description:"A Kubernetes node with its readiness, instance type, and usage against what it can allocate to pods."}),wje={node:"ip-10-0-1-23.ec2.internal",cluster:"prod-us-east",status:"Ready",instanceType:"r7g.2xlarge",pods:25,allocatablePods:234,cpuUsageMilli:4e3,cpuAllocatableMilli:8e3,cpuUtilization:.5,memoryUsageBytes:4e9,memoryAllocatableBytes:16e9,memoryUtilization:.25};Object.assign(Dse,{examples:[wje]});var Fse=n.Pick(jF,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),vje={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(Fse,{examples:[vje]});var $se=n.Pick(HF,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),Nje={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign($se,{examples:[Nje]});var Bse=n.Pick(zF,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),kje={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(Bse,{examples:[kje]});var Gse=n.Pick(VF,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),Lje={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.working_set",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(Gse,{examples:[Lje]});var jse=n.Pick(WF,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),Mje={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign(jse,{examples:[Mje]});var qse=n.Pick(ZF,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),Dje={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(qse,{examples:[Dje]});var Hse=n.Pick(FR,["timestamp","type","reason","message","resourceName","resourceKind","namespace","cluster","count"],{description:"A Kubernetes event with its type, reason, message, and the resource it is about. `timestamp` is the last occurrence in epoch milliseconds and `count` the number of occurrences."}),Fje={timestamp:17897328e5,type:"Warning",reason:"BackOff",message:"Back-off restarting failed container api in pod api-gateway-7d9f8c6b5-2xk4p_production",resourceName:"api-gateway-7d9f8c6b5-2xk4p",resourceKind:"Pod",namespace:"production",cluster:"prod-us-east",count:3};Object.assign(Hse,{examples:[Fje]});var Kse=n.Object({clusterId:n.Optional(l({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),zse=n.Pick(Cse,["clusterId","search"]);function jg(e){return n.Object({...zse.properties,sortBy:n.Optional(n.Enum(e,{description:"Field to sort results by. Without it the order is not stable between requests, so set it when paging with `offset`."})),sortDirection:n.Optional(me),...We})}var $je=n.Pick(Rse,["clusterId","search"]),Yse=f({description:"Lists Kubernetes (k8s) pods with phase, ready containers, restarts, node, owning workload and CPU and memory usage against limits: find crashing, pending or restarting pods.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/pods`,paginated:!0,query:jg(MF),response:n.Array(kse)}),Vse=f({description:"Lists Kubernetes (k8s) clusters with node readiness, pod phase counts and resource usage. These are not Tsuga clusters, which the clusters list returns.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/clusters`,query:$je,response:n.Array(Lse)}),Wse=f({description:"Lists Kubernetes (k8s) namespaces with pod counts and resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/namespaces`,paginated:!0,query:jg(GF),response:n.Array(Mse)}),Qse=f({description:"Lists Kubernetes (k8s) nodes with readiness, instance type and resource usage against allocatable capacity.",operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/nodes`,paginated:!0,query:jg($F),response:n.Array(Dse)}),Zse=f({description:"Lists Kubernetes (k8s) deployments with replica counts and resource usage. For rollout history, get the deployment details.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/deployments`,paginated:!0,query:jg(qF),response:n.Array(Fse)}),Xse=f({description:"Lists Kubernetes (k8s) StatefulSets with replica counts and resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/statefulsets`,paginated:!0,query:jg(KF),response:n.Array($se)}),Jse=f({description:"Lists Kubernetes (k8s) DaemonSets with eligible-node readiness and resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/daemonsets`,paginated:!0,query:jg(YF),response:n.Array(Bse)}),Nse=100,Bje=n.Object({...zse.properties,...n.Pick(XF,["clusters","namespaces","resourceKinds","types","includeInternalNamespaces"]).properties,limit:n.Optional(n.Integer({minimum:1,maximum:DR,default:Nse,description:`Maximum number of events to return, newest first. Defaults to ${Nse}. Valid values are 1 through ${DR}.`}))}),eae=f({description:`Lists Kubernetes (k8s) events of the last ${vse/dM} hours, newest first, such as BackOff or FailedScheduling warnings, with type, reason, message and the resource concerned. Reads the latest ${DR} event observations; \`search\` matches the resource name.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/events`,query:Bje,response:n.Array(Hse)}),tae=n.Object({...Kse.properties,k8sCluster:l({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:l({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:l({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),rae=f({description:"Returns one Kubernetes pod's status, owning workload, CPU and memory metric names, and ready-to-use log and trace filters. The pod manifest endpoint serves its manifest, labels and annotations.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/pod-details`,query:tae,response:Gse}),nae=f({description:"Returns one Kubernetes pod's manifest from its latest observation: the pod spec (containers, resource requests and limits), labels and annotations.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/pod-manifest`,query:tae,response:jse}),oae=f({description:"Returns one Kubernetes deployment's replica status, backing pods and rollout revisions, with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${ks}/deployment-details`,query:n.Object({...Kse.properties,k8sCluster:l({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:l({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:l({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:qse});var Gje="clusterId";function hr(e,t,r){let o=jje(t,r);return P(e,o,v(`cli.${t.operationId??e}`)(function*(i){let s=i,a={};for(let u of Object.keys(o)){let p=noe(s,u);p!==void 0&&(a[u]=p)}yield*xe(yield*Ze(t,Object.keys(a).length>0?{query:a}:void 0))})).pipe(U(t.description??e))}function jje(e,t){let r=roe(e.query),o={};for(let i of Object.keys(r)){if(i===Gje)continue;let s=i.replace(/([A-Z])/g,"-$1").toLowerCase(),a=s.replace(/-/g,"_").toUpperCase(),u=je(s).pipe(te(r[i]?.description??""),Te(a));o[i]=t?u:u.pipe(rt)}return o}var iae=hr("clusters",Vse,!1);var sae=hr("daemonsets",Jse,!1);var aae=hr("deployment-details",oae,!0);var cae=hr("deployments",Zse,!1);var uae=hr("events",eae,!1);var pae=hr("namespaces",Wse,!1);var lae=hr("nodes",Qse,!1);var dae=hr("pod-details",rae,!0);var mae=hr("pod-manifest",nae,!0);var fae=hr("pods",Yse,!1);var gae=hr("statefulsets",Xse,!1);var hae=P("kubernetes").pipe(U("Explore Kubernetes resources observed across the organization"),be([fae,iae,pae,lae,cae,gae,sae,uae,dae,mae,aae]));var yae=P("attributes",{...Vt,search:je("search").pipe(te("Only list dot-paths containing this text, case-insensitively (e.g. k8s or http.status)"),Te("TEXT"),rt)},v("cli.logs.attributes")(function*(e){let{attributes:t}=yield*er(eee,{query:Sn({...yield*Vr(e),search:ue(e.search)})});yield*xe({data:t})})).pipe(U("List log attribute dot-paths observed in the time range"));var $R=je("env").pipe(te("Filter by environment"),Te("ENV_NAME"),rt);var qje=["team","env","pattern"],Eae=P("error-pattern-increases",{...Vt,team:je("team").pipe(te("Team to query"),Te("TEAM_NAME")),env:$R,pretty:Io},v("cli.logs.errorPatternIncreases")(function*(e){let t=yield*hn,{errorPatternIncreases:r}=yield*er(XJ,{query:Sn({...yield*Vr(e),team:e.team,env:ue(e.env)})});yield*t.rows(r,{...e,defaultFields:qje})})).pipe(U("List error pattern increases for a given team"));var Hje=["team","env","service","firstSeen","lastSeen"],Kje=je("team").pipe(te("Filter by team"),Te("TEAM_NAME"),rt),Sae=P("new-error-patterns",{...Vt,team:Kje,env:$R,service:je("service").pipe(te("Filter by service"),Te("SERVICE_NAME"),rt),pretty:Io},v("cli.logs.newErrorPatterns")(function*(e){let t=yield*hn,{newErrorPatterns:r}=yield*er(QJ,{query:Sn({...yield*Vr(e),team:ue(e.team),env:ue(e.env),service:ue(e.service)})});yield*t.rows(r,{...e,defaultFields:Hje})})).pipe(U("List error patterns first seen in this time range"));var zje=["count","ratio","team","level","pattern"];function Yje(e,t){let r={count:e.size,sampleSize:t,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)r[o==="context.team"?"team":o]=i;return r}var Tae=P("patterns",{...Vt,query:kp.pipe(te("Tsuga query to filter logs before clustering into patterns")),pretty:Io},v("cli.logs.patterns")(function*(e){let t=yield*hn,r=yield*er(VJ,{query:Sn({...yield*Vr(e),query:yield*Fd("query",e.query)})}),{patterns:o,sampleSize:i}=r,s=o.map(a=>Yje(a,i));yield*t.rows(s,{...e,defaultFields:zje})})).pipe(U("List log patterns"));var Vje=k(function*(e){if(e===void 0)return;let t=ue(e);if(t!==void 0)return t;let r=yield*Fd("max-results",K());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new At({message:`The saved default for max-results must be a positive safe integer (got: ${r}). Fix it with \`tsuga config set default max-results --value <N>\`.`}):o}),qg=k(function*(e){let t=e.query===void 0?void 0:yield*Fd("query",e.query),r=yield*Vje(e.maxResults);return Sn({...yield*Vr(e),query:t,maxResults:r})});var Wje=["timestamp","level","message"],_ae=P("search",{...Vt,query:kp,maxResults:kg,pretty:Io},v("cli.logs.search")(function*(e){let t=yield*hn,r=yield*er(kS,{query:yield*qg(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:Wje})})).pipe(U("Search logs"));var Iae=P("logs").pipe(U("Search and analyze logs"),be([_ae,yae,Tae,Sae,Eae]));var JF=`/${"v1"}/metrics`,e$=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:iC,description:n.Optional(n.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:n.Optional(sC),capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. An empty or omitted array means all aggregate types are supported."})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."})),seriesCardinality:n.Optional(aC),attributeCardinalities:n.Optional(n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `attributes`. Omitted when the catalog has no statistics for the metric yet."}))}),bae={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"],seriesCardinality:1250,attributeCardinalities:{"context.team":4,"context.environment":3,"context.region":12}};Object.assign(e$,{examples:[bae]});var xae=n.Omit(e$,["attributes","attributeCardinalities"]);Object.assign(xae,{examples:[IC(bae,["attributes","attributeCardinalities"])]});var Oae=n.Object({from:Id("Unix timestamp in seconds. Required, but does not scope the result."),to:Id("Unix timestamp in seconds. Required, but does not scope the result."),clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. The time range is required but does not scope the result, which comes from a cluster-wide catalog of metric names. Optionally takes a cluster ID."}),Aae=f({description:"Lists or searches metric names with type, unit, temporality and estimated series cardinality, to find the metric to query. Metrics come from OpenTelemetry, Prometheus or cloud provider integrations (AWS CloudWatch, GCP Cloud Monitoring, Azure Monitor). `search` keeps the names containing a substring. `from` and `to` are required but do not scope the result, and a name stays listed after the metric stops reporting; to check for data in a window, run a `count` aggregation. Get one metric for its attributes. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:JF,method:"GET",paginated:!0,query:n.Object({...Oae.properties,...We,search:n.Optional(l({allowEmpty:!1,description:"Keep only metric names containing this value, matched case-insensitively."}))}),response:n.Array(xae)}),Cae=f({description:"Returns one metric's metadata: its attributes (labels, dimensions, tags) with estimated cardinality, type, unit and supported query behavior. `from` and `to` are required but do not scope the result: it reads a cluster-wide catalog whose cardinalities are periodically refreshed estimates. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${JF}/:name`,method:"GET",params:n.Object({name:l({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Oae,response:e$}),Qje=["service","env","host","method","status_code"];Object.assign(AS,{examples:[Qje]});var Rae=n.Pick(NM,["assets"]),Zje={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"team-123-abc"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"team-123-abc"}]};Object.assign(Rae,{examples:[Zje]});var Pae=f({description:"Lists the dashboards and monitors whose queries use a metric, before renaming or dropping it. An empty result does not prove the metric unused: PromQL widgets, SLOs and assets the caller cannot read are not covered. See [How to find which assets use a metric](/documentation/explore/guides/how-to-find-which-assets-use-a-metric).",operationId:"getMetricAssetsUsage",tags:["public","metrics"],url:`${JF}/assets-usage`,method:"GET",query:n.Object({metricName:l({allowEmpty:!1,description:"Metric name to look up, for example `http.server.request.duration`."})}),response:Rae});var Uae=P("assets-usage",{name:gr("METRIC_NAME").pipe(Ht("The metric to look up"))},v("cli.metrics.assetsUsage")(function*({name:e}){yield*xe(yield*Ze(Pae,{query:{metricName:e}}))})).pipe(U("List dashboards and monitors that use a specific metric"));var wae=P("get",{name:gr("METRIC_NAME").pipe(Ht("The metric to retrieve")),...Vt},v("cli.metrics.get")(function*(e){yield*xe(yield*Ze(Cae,{params:{name:e.name},query:yield*Vr(e)}))})).pipe(U("Retrieve a metric by name with its metadata"));var vae=P("list",{...Vt,...Lp,search:je("search").pipe(te("Keep only metric names containing this text (case-insensitive)"),Te("TEXT"),rt)},v("cli.metrics.list")(function*(e){let t=Sn({limit:ue(e.limit),offset:ue(e.offset),search:ue(e.search),...yield*Vr(e)});yield*xe(yield*Ze(Aae,{query:t,allPages:e.all}))})).pipe(U("List metrics with their metadata, sorted by name and paged"));var Nae=P("metrics").pipe(U("List and inspect metrics"),be([vae,wae,Uae]));var Xje="/v0/profiles",Jje=["cpu","samples","sample","wall","offcpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],e2e=20,gT={service:l({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(Jje,{description:"pprof sample type."}),filter:n.Optional(l({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Labels to split the flamegraph by. The stack itself cannot be a group-by."})),limit:n.Optional(n.Integer({minimum:1,default:e2e,description:"Maximum number of groups, ranked by total value."})),minFraction:n.Optional(n.Number({minimum:0,maximum:1,description:"Nodes below this share of the root total fold into their parent."}))},wgr=f({tags:["profiles"],url:`${Xje}/query`,method:"POST",body:n.Object({...gT,timeRange:No,clusterId:n.Optional(l({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:lg});var kae=`/${"v1"}/profiles`,Lae=n.Object({...gT,timeRange:on},{description:"Profile query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{service:"api",type:"cpu",timeRange:{from:1782201500,to:1782203400},filter:"context.env:prod"}]}),t2e=n.Object({stacks:n.Array(n.Object({stack:n.String({description:"Frames from the root to the leaf, joined with `;` (folded stack format)."}),group:n.Record(n.String(),n.String(),{description:"Group-by label values for this stack. Empty when no group-by is requested."}),value:n.Number({description:"Total sample value of this stack, in the unit of the profile type."})}),{description:"One entry per distinct leaf stack, after folding nodes below minFraction."})},{examples:[{stacks:[{stack:"main;handleRequest;encodeJson",group:{},value:125e7},{stack:"main;handleRequest;queryDb",group:{},value:8e8}]}]}),BR=f({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${kae}/query`,method:"POST",body:Lae,query:ts,response:t2e}),r2e=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),Mae=f({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${kae}/pprof`,method:"POST",body:Lae,query:ts,response:r2e});var Dae=v("output.printBytes")(function*(e){let t=yield*Qm;yield*mb(IH(e),t.stdout()).pipe(tt(r=>new qn({message:`Could not write stdout: ${r.message}`})))});var GR={service:je("service").pipe(te("Service the profiles belong to"),Te("SERVICE_NAME")),type:Dx("type",gT.type.enum).pipe(te("Profile type"),Te("PROFILE_TYPE")),...Vt,filter:je("filter").pipe(te("Tsuga query over profile labels (equality, negation, wildcards)"),Te("TSUGA_QUERY"),rt)},jR=k(function*(e){let t=ue(e.filter);return{service:e.service,type:e.type,timeRange:yield*Vr(e),...t===void 0?{}:{filter:t}}});var Fae=P("pprof",{...GR,outputFile:je("output-file").pipe(la("O"),te("Write the profile to this file instead of stdout"),Te("FILE_PATH"),rt)},v("cli.profiles.pprof")(function*(e){let t=ue(e.outputFile);if(t===void 0&&(yield*_S))return yield*new At({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*er(Mae,{body:yield*jR(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*Dae(o);return}yield*(yield*tn).writeFile(t,o).pipe(tt(s=>new qn({message:`Could not write ${t}: ${s.message}`})))})).pipe(U("Download a merged pprof profile (raw protobuf, not gzipped)"));var $ae=Kn("query","Run a raw profile query and print the folded stacks",BR);var n2e=30,o2e=["flat","flatPercent","cum","cumPercent","function"],Bae=P("top",{...GR,limit:ff("limit").pipe(te("Maximum number of functions to print"),Te("COUNT"),Cn(n2e)),pretty:Io},v("cli.profiles.top")(function*(e){let t=yield*hn;if(e.limit<1)return yield*new At({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*er(BR,{body:yield*jR(e)}),{total:o,functions:i}=i2e(r.stacks),s=i.slice(0,e.limit).map(a=>({...a,total:o}));yield*t.rows(s,{...e,defaultFields:o2e})})).pipe(U("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function i2e(e){let t=new Map,r=new Map,o=0;for(let{stack:a,value:u}of e){let p=a.split(";"),m=p[p.length-1];if(m!==void 0){o+=u,t.set(m,(t.get(m)??0)+u);for(let g of new Set(p))r.set(g,(r.get(g)??0)+u)}}let i=a=>o===0?0:Math.round(a/o*1e4)/100,s=[...r.entries()].map(([a,u])=>{let p=t.get(a)??0;return{function:a,flat:p,flatPercent:i(p),cum:u,cumPercent:i(u)}}).sort((a,u)=>u.flat-a.flat||u.cum-a.cum||a.function.localeCompare(u.function));return{total:o,functions:s}}var Gae=P("profiles").pipe(U("Query continuous profiling data"),be([Bae,Fae,$ae]));var jae=Kn("query","Run a PromQL range query over metric data",PC);var qae=P("promql").pipe(U("Run PromQL queries over metric data"),be([jae]));var bo="/v0/monitors",Kae=["alert","resolve","keep_last_status","consider_zero"],zae=["alert","resolve","keep_last_status"];var Yae=["no_aggregation","all","any","each","proportion"],Vae=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var s2e=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Vae,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),a2e=n.Object({formula:l({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Vae,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),c2e=5,u2e=n.Array(s2e,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),p2e=n.Array(a2e,{minItems:1,maxItems:c2e,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),l2e=n.Object({formula:n.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),d2e=n.Object({formula:l({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),Tn=[1,2,3,4,5];var m2e=4;var Wae={timeframe:n.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(Yae,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`."})),proportionAlertThreshold:n.Optional(n.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Qae={timeframe:n.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:n.Array(n.Object({fields:n.Array(l(),{maxItems:m2e,description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty or omitted means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(l({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(Yae,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. With `groupByFields`, send `each` so every group opens and resolves its own alert, as the app does by default; `all`, `any`, and `proportion` raise one alert for the whole monitor. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},f2e={...Wae,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},g2e={...Qae,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},h2e=10,y2e=4320,Zae=`Number of consecutive \`timeframe\`-minute windows, ending at evaluation time, that must all meet the conditions before the monitor alerts, per group for grouped monitors. 1 or omitted checks a single window. A window that does not meet the conditions breaks the run. An empty window, such as a query with \`fill.mode.type\` \`null\` returning nothing, breaks the run under \`noDataBehavior\` \`alert\` or \`resolve\`, takes the previous window's result under \`keep_last_status\`, and counts as 0 under \`consider_zero\`. A query without \`fill\` counts an empty window as 0. When every window is empty (with \`keep_last_status\`, when the oldest is empty and none breaks the run), \`noDataBehavior\` applies as for a single window. Above 1, \`consecutiveWindows\` \xD7 \`timeframe\` must not exceed ${y2e} minutes (3 days).`,E2e=n.Optional(n.Integer({description:Zae})),S2e=n.Optional(n.Integer({minimum:1,maximum:h2e,description:Zae})),Xae="How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero.",Jae="How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state.",ece=KR({type:"metric",description:"Threshold monitor over metric aggregations.",$id:"MonitorConfigurationMetric"}),T2e=zR({type:"metric",description:"Threshold monitor over metric aggregations.",$id:"InputMonitorConfigurationMetric"}),tce=KR({type:"log",description:"Threshold monitor over log aggregations.",$id:"MonitorConfigurationLog"}),_2e=zR({type:"log",description:"Threshold monitor over log aggregations.",$id:"InputMonitorConfigurationLog"}),rce=KR({type:"trace",description:"Threshold monitor over trace aggregations.",$id:"MonitorConfigurationTrace"}),I2e=zR({type:"trace",description:"Threshold monitor over trace aggregations.",$id:"InputMonitorConfigurationTrace"}),nce=KR({type:"rum",description:"Threshold monitor over RUM aggregations.",$id:"MonitorConfigurationRum"}),b2e=zR({type:"rum",description:"Threshold monitor over RUM aggregations. The monitor reads a single RUM stream: fields in `queries` and `groupByFields` that carry a stream prefix (`events.`, `measurements.` or `exceptions.`) must all name the same stream, and unprefixed fields are read from that stream (`events` when no field names one).",$id:"InputMonitorConfigurationRum"}),oce=YR({type:"anomaly-log",description:"Anomaly monitor over log aggregations.",$id:"MonitorConfigurationAnomalyLog"}),x2e=VR({type:"anomaly-log",description:"Anomaly monitor over log aggregations.",$id:"InputMonitorConfigurationAnomalyLog"}),ice=YR({type:"anomaly-metric",description:"Anomaly monitor over metric aggregations.",$id:"MonitorConfigurationAnomalyMetric"}),O2e=VR({type:"anomaly-metric",description:"Anomaly monitor over metric aggregations.",$id:"InputMonitorConfigurationAnomalyMetric"}),sce=YR({type:"anomaly-trace",description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values.",$id:"MonitorConfigurationAnomalyTrace"}),A2e=VR({type:"anomaly-trace",description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values.",$id:"InputMonitorConfigurationAnomalyTrace"}),ace=YR({type:"anomaly-rum",description:"Anomaly monitor over RUM aggregations. Use this configuration when Tsuga should learn historical RUM query behavior and alert on unusual movement in RUM-derived values.",$id:"MonitorConfigurationAnomalyRum"}),C2e=VR({type:"anomaly-rum",description:"Anomaly monitor over RUM aggregations. Set this value to create or update an anomaly monitor that learns historical RUM query behavior and alerts on unusual movement in RUM-derived values. The monitor reads a single RUM stream: fields in `queries` and `groupByFields` that carry a stream prefix (`events.`, `measurements.` or `exceptions.`) must all name the same stream, and unprefixed fields are read from that stream (`events` when no field names one).",$id:"InputMonitorConfigurationAnomalyRum"}),cce=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:n.Optional(n.Array(n.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),R2e=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),uce="When `true`, every new error pattern alerts on the next evaluation, even if it appeared in a single log. When `false` or omitted, a new pattern alerts only once it has lasted at least 5 minutes and matched at least 20 logs, which filters out one-off errors.",P2e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."})),env:n.String({description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose logs are searched for new error patterns."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:uce}))},{$id:"MonitorConfigurationLogErrorPattern"}),U2e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets.",minItems:1})),env:l({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Service names whose logs are searched for new error patterns.",minItems:1}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:uce}))},{$id:"InputMonitorConfigurationLogErrorPattern"}),pce=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case a service scope is required."})),env:n.String({description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPatternIncrease"}),w2e=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case `services` is required."})),env:l({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPatternIncrease"}),lce={type:n.Literal("k8s-faulty-deployment",{description:"Monitor that alerts when a Kubernetes workload (Deployment, StatefulSet, or DaemonSet) keeps failing right after a rollout."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for Kubernetes faulty deployment monitors. Each faulty workload revision is evaluated as its own alert group."})},v2e=["replicaSet","statefulSet","daemonSet"],dce=n.Enum(v2e,{description:"Kubernetes workload type: `replicaSet` (Deployment rollouts), `statefulSet`, or `daemonSet`."}),mce=n.Object({...lce,filter:n.Object({clusterNames:n.Optional(n.Array(n.String(),{description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(n.String(),{description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(dce,{description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched."})},{$id:"MonitorConfigurationK8sFaultyDeployment"}),N2e=n.Object({...lce,filter:n.Object({clusterNames:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(dce,{minItems:1,uniqueItems:!0,description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched. Send an empty object to watch every workload."})},{$id:"InputMonitorConfigurationK8sFaultyDeployment"}),fce={type:n.Literal("faulty-deployment",{description:"Monitor that alerts when Tsuga faulty deployment detection flags a newly deployed service version as faulty."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for faulty deployment monitors. Each faulty service version in an environment is evaluated as its own alert group."})},gce=n.Object({...fce,filter:n.Object({services:n.Optional(n.Array(n.String(),{description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched."})},{$id:"MonitorConfigurationFaultyDeployment"}),k2e=n.Object({...fce,filter:n.Object({services:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(l({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched. Send an empty object to watch every deployment."})},{$id:"InputMonitorConfigurationFaultyDeployment"}),L2e=F("type",[ece,tce,rce,nce,oce,ice,P2e,pce,sce,ace,cce,mce,gce],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),M2e=F("type",[T2e,_2e,I2e,b2e,x2e,O2e,A2e,C2e,U2e,w2e,R2e,N2e,k2e],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var jp=n.Object({id:n.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:n.String({description:"Display name of the monitor and alert source."}),owner:n.String({description:"Team ID that owns and manages the monitor."}),message:n.Optional(n.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:Wt,configuration:L2e,priority:n.Enum(Tn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Us,dashboardId:n.Optional(n.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),folderId:n.Optional(n.String({description:"ID of the monitor folder containing this monitor. Omitted for unfiled monitors."})),pauseUntil:n.Optional(N({description:"Timestamp until which the monitor is snoozed. Omitted when the monitor is not snoozed."})),creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:N({description:"Timestamp when Tsuga created the monitor."}),updatedAt:N({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:n.Array(n.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),t$=F("type",[ece,tce,rce,nce,oce,ice,sce,ace,cce,pce,mce,gce]),Rhr=n.Object({...jp.properties,configuration:t$},{title:"Monitor"}),hT=n.Object({name:l({description:"Display name of the monitor and alert source."}),message:Qe(l({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:nr,configuration:M2e,priority:n.Enum(Tn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:l({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:Qe(l({allowEmpty:!1}),{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."}),folderId:Qe(l({allowEmpty:!1}),{description:"Folder to organize this monitor in. Omit on create or send null to leave it unfiled; omit on update to keep its folder, or send null to remove it. A non-null ID must name a readable monitor folder. Assignment does not change ownership, data access, or evaluation state."}),pauseUntil:Qe(l({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor is snoozed. Must be in the future and at most one month from now. On create: omit or send `null` to leave the monitor active. On update: omit to keep the current snooze, send `null` to clear it."}),permissions:Us,clusterIds:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),Hae=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase","k8s-faulty-deployment","faulty-deployment"],Gp={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var qR=["active","snoozed"],r$=n.Object({folderId:n.Union([n.Null(),l({allowEmpty:!1})],{description:"Return monitors directly assigned to this folder ID, or unfiled monitors when null. Omit to return all monitors."}),owners:ye(l({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:vo({description:"Search query filter for monitors.",valueDescription:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),tags:ye(sn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:ye(n.Enum(Tn),{description:"Restrict results to monitors with one of these priorities",maxItems:Tn.length}),types:ye(n.Enum(Hae),{description:"Restrict results to monitors with these types",maxItems:Hae.length}),activity:ye(n.Enum(qR),{description:"Restrict results by activity status: active monitors or currently snoozed monitors",maxItems:qR.length}),clusterIds:ye(l({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),HR=n.Partial(r$),n$=n.Partial(n.Object({...Ie,filters:HR,sort:n.Object({by:n.Enum([Gp.PRIORITY,Gp.TYPE,Gp.NAME,Gp.OWNER,Gp.TAGS,Gp.CLUSTER_IDS,Gp.PAUSE_UNTIL,Gp.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by. For `priority`, `desc` returns highest-priority monitors first because priority 1 is highest."}),direction:me},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),Phr=f({tags:["monitors"],url:`${bo}/query`,method:"POST",paginated:!0,response:n.Array(jp),body:n$}),Uhr=f({tags:["monitors"],url:`${bo}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(r$,["tags"])))}),response:Wr}),whr=f({tags:["monitors"],url:`${bo}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(r$,["activity"])))}),response:n.Object({all:n.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:n.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:n.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),vhr=f({tags:["monitors"],url:`${bo}/:id`,method:"GET",params:n.Object({id:l()}),response:jp}),Nhr=f({tags:["monitors"],url:bo,method:"POST",body:hT,response:jp}),khr=f({tags:["monitors"],url:`${bo}/:id`,method:"PUT",params:n.Object({id:l()}),body:hT,response:jp}),D2e=100,F2e=_i(HR,{maxIds:D2e}),Lhr=f({tags:["monitors"],url:`${bo}/bulk-update`,method:"PUT",body:n.Object({selection:F2e,owner:n.Optional(l({allowEmpty:!1,description:"Owning team to apply to every selected monitor. Omit to keep current ownership."})),folderId:Qe(l({allowEmpty:!1}),{description:"Folder to assign every selected monitor to. Omit to keep their folders, or send null to make them unfiled. Assignment preserves ownership, data access, and evaluation state."})}),response:n.Object({})}),Mhr=f({tags:["monitors"],url:`${bo}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),$2e=_i(HR),Dhr=f({tags:["monitors"],url:`${bo}/bulk-delete`,method:"DELETE",body:n.Object({selection:$2e}),response:n.Object({})}),Fhr=f({tags:["monitors"],url:`${bo}/:id/snooze`,method:"POST",params:n.Object({id:l()}),body:n.Object({pauseUntil:n.Union([n.Null(),l({allowEmpty:!1,type:"date-time"})])}),response:jp}),B2e=_i(HR,{maxIds:100}),$hr=f({tags:["monitors"],url:`${bo}/bulk-snooze`,method:"POST",body:n.Object({selection:B2e,pauseUntil:l({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),G2e=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],j2e=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],q2e=[...G2e,...j2e],Hd=n.Enum(q2e),H2e=F("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([Hd,n.Null()]),lastChangedAt:N()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(Hd)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(Hd)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(Hd)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(Hd)})]),K2e=n.Object({monitorId:n.String(),currentState:H2e,lastChangedAt:n.Optional(N())}),Bhr=f({tags:["monitors"],url:`${bo}/states/:id`,method:"GET",params:n.Object({id:l()}),response:K2e}),Ghr=f({tags:["monitors"],url:`${bo}/:id/transitions`,method:"GET",params:n.Object({id:l()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:N(),fromState:n.Optional(Hd),toState:n.Optional(Hd),dimension:n.Optional(n.String())}))}),z2e=["unprocessed","processed","failed-to-process"],jhr=f({tags:["monitors"],url:`${bo}/:id/results`,method:"GET",params:n.Object({id:l()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:N(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),bS),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:N(),status:n.Enum(z2e)}))})});function KR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),conditions:u2e,noDataBehavior:n.Enum(Kae,{description:Xae}),...Wae,consecutiveWindows:E2e,queries:US},{$id:r})}function zR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),conditions:p2e,noDataBehavior:n.Enum(Kae,{description:Xae}),...Qae,consecutiveWindows:S2e,queries:pC},{$id:r})}function YR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),condition:l2e,noDataBehavior:n.Enum(zae,{description:Jae}),...f2e,queries:US},{$id:r})}function VR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),condition:d2e,noDataBehavior:n.Enum(zae,{description:Jae}),...g2e,queries:pC},{$id:r})}var hce=F("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),yce=F("type",[n.Object({type:n.Literal("bearer"),token:l({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:l({allowEmpty:!1}),password:l({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:l({allowEmpty:!1}),value:l({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),Ece=F("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(l({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(l({allowEmpty:!1})),password:n.Optional(l({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(l({allowEmpty:!1})),value:n.Optional(l({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var zd="/v0/notifications",Ba=`${zd}/rules`,Sce=`${zd}/slack/setup`,Hg=`${zd}/integrations`,Kd=["triggered","resolved","no-data"],Y2e=["sent","stale","pending","rate-limited","failed","silenced"],V2e=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:n.Integer({description:"Length of the rate-limiting window, in minutes."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."})),o$=n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of notifications this target can send during the rate-limiting window. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window, in minutes. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."}),W2e=n.Optional(o$),Fa=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),$a=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),yT=n.Object({id:n.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:V2e,config:F("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"}),renotifyConfig:Fa},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"}),renotifyConfig:Fa},{$id:"RuleTargetConfigSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:n.String({description:"Identifier of the Jira integration to use"}),integrationName:n.String({description:"Human readable name of the Jira integration"}),projectKey:n.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:n.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(n.String({description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:n.Optional(n.String({description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetConfigJira"})],{description:"Destination that received the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses, and every other type routes through the named integration referenced by `integrationId`."})}),Kg=n.Object({id:l({description:"Identifier of the notification target within this rule. Choose a stable ID that is unique among this rule's targets; Tsuga uses it with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:W2e,config:F("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:l({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:l({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:$a},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(l({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:$a},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:l({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:$a},{$id:"RuleTargetInputSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:l({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:l({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:l({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(l({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:n.Optional(l({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."})}),i$=F("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(n.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),s$=F("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(l(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),Yd=n.Object({id:n.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:n.String({description:"Display name of the notification rule."}),queryString:n.Optional(n.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:i$,prioritiesFilter:n.Array(n.Enum(Tn),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(Kd),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that must match for this rule to fire. An empty array matches every cluster, as does a transition that has no cluster ID."}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:N({description:"Timestamp when Tsuga created the rule."}),updatedAt:N({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:Wt,targets:n.Array(yT,{description:"Destinations that receive a notification whenever this rule matches an alert transition. Every target in the list is notified independently, subject to its own rate limit and renotification settings."}),creator:n.Optional(Ce),updater:n.Optional(Ce)}),ET=n.Object({name:l({description:"Display name of the notification rule."}),queryString:Qe(l({type:"tags-query"}),{description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."}),teamsFilter:s$,prioritiesFilter:n.Array(n.Enum(Tn),{maxItems:Tn.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(Kd),{maxItems:Kd.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:l({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:nr,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(Kg,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),Vd=n.Object({id:n.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:n.String({description:"Display name of the adaptive notification rule."}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:N({description:"Timestamp when Tsuga created the rule."}),updatedAt:N({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),tags:Wt,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:yT,creator:n.Optional(Ce),updater:n.Optional(Ce)}),WR=n.Object({name:l({description:"Display name of the adaptive notification rule."}),owner:l({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:nr,isActive:n.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),monitorIds:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. On update, omitting this field keeps the current monitors; send an empty array to remove them. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. On update, omitting this field keeps the current SLOs; send an empty array to remove them. Send at least one monitor or SLO."})),fallbackTarget:Kg}),Q2e=["active","inactive"],Z2e=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],Tce=n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:vo({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:ye(sn.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:ye(l({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:ye(l({allowEmpty:!1}),{description:"Restrict results to rules that run on any of these cluster IDs. Rules with no cluster restriction are treated as running on every cluster, including the requested ones.",maxItems:50}),status:n.Enum(Q2e,{description:"Restrict results to active or inactive rules."})}),X2e=n.Partial(n.Object({...Ie,filters:n.Partial(Tce),sort:n.Object({by:n.Enum(Z2e,{description:"Field to sort the returned notification rules by."}),direction:me})})),J2e=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...Yd.properties}),eqe=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...Vd.properties}),tqe=F("type",[J2e,eqe]),rqe=n.Object({value:n.String({description:"Email address or integration ID used when filtering destinations."}),label:n.String({description:"Display name of the destination."}),type:n.String({description:"Destination type, such as email or slack."})}),nqe=n.Object({tags:Wr,destinations:n.Array(rqe,{description:"Destination filter options from the matching rules."}),activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching rules regardless of whether they are active."}),active:n.Integer({description:"Number of matching rules that are active."}),inactive:n.Integer({description:"Number of matching rules that are inactive."})})}),oqe=n.Object({filters:n.Optional(n.Partial(Tce,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),tyr=f({tags:["notification-rules"],url:`${Ba}/query`,method:"POST",paginated:!0,body:X2e,response:n.Array(tqe,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),ryr=f({tags:["notification-rules"],url:`${Ba}/options/query`,method:"POST",body:oqe,response:nqe}),nyr=f({tags:["notification-rules"],url:Ba,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(Yd)}),oyr=f({tags:["notification-rules"],url:`${Ba}/:id`,params:n.Object({id:l()}),method:"GET",response:Yd}),iyr=f({tags:["notification-rules"],url:Ba,method:"POST",body:ET,response:Yd}),syr=f({tags:["notification-rules"],url:`${Ba}/:id`,method:"PUT",params:n.Object({id:l()}),body:ET,response:Yd}),ayr=f({tags:["notification-rules"],url:`${Ba}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),cyr=f({tags:["notification-rules"],url:`${Ba}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l(),{uniqueItems:!0})}),response:n.Object({})}),zg=`${zd}/adaptive-rules`,uyr=f({tags:["notification-rules"],url:zg,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(Vd)}),pyr=f({tags:["notification-rules"],url:`${zg}/:id`,params:n.Object({id:l()}),method:"GET",response:Vd}),lyr=f({tags:["notification-rules"],url:zg,method:"POST",body:WR,response:Vd}),dyr=f({tags:["notification-rules"],url:`${zg}/:id`,method:"PUT",params:n.Object({id:l()}),body:WR,response:Vd}),myr=f({tags:["notification-rules"],url:`${zg}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),fyr=f({tags:["notification-rules"],url:`${zg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l(),{uniqueItems:!0})}),response:n.Object({})}),gyr=f({tags:["notification-integrations"],url:`${Sce}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),iqe=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],_ce=n.Object({id:n.String(),name:n.String(),type:n.Enum(iqe),createdAt:N(),ruleCount:n.Number(),creator:n.Optional(Ce),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),sqe=["name","type","ruleCount","createdAt"],aqe=n.Object({searchQuery:vo({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),cqe=n.Partial(n.Object({...Ie,filters:n.Partial(aqe),sort:n.Object({by:n.Enum(sqe,{description:"Field to sort the returned notification integrations by."}),direction:me})})),hyr=f({tags:["notification-integrations"],url:`${Hg}/query`,method:"POST",paginated:!0,body:cqe,response:n.Array(_ce,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),yyr=f({tags:["notification-integrations"],url:`${Ba}/integrations`,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(_ce)}),Eyr=f({tags:["notification-integrations"],url:`${Sce}/callback`,method:"GET",query:n.Object({code:l()}),response:n.Object({success:n.Boolean()})}),uqe={data:"notification_view_data",source:"notification_view_source",dashboard:"notification_view_dashboard",service:"notification_view_service"},Syr=n.Object({type:n.Literal("block_actions"),actions:n.Array(n.Object({type:n.Literal("button"),action_id:n.Enum(Object.values(uqe))}),{minItems:1})}),Tyr=f({tags:["notification-integrations"],url:`${zd}/slack/interactivity`,method:"POST",body:n.String(),response:n.Literal("")}),a$=["POST","PUT"],pqe=n.Record(n.String(),n.String()),lqe=n.Record(n.String(),n.Unknown()),dqe=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),mqe=F("type",[n.Object({type:n.Literal("json"),value:lqe}),n.Object({type:n.Literal("form"),value:dqe})]),fqe=n.Object({ok:n.String(),alert:n.String()}),ST=n.Object({id:n.String(),name:n.String(),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."})),setting:F("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(a$),authentication:hce,customHeaders:n.Optional(pqe),payloadTemplate:mqe,eventNameMapping:n.Optional(fqe)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("jira"),siteUrl:n.String(),email:n.String(),apiTokenLastChars:n.String()})]),tags:Wt}),gqe=n.Object({type:n.Literal("webhook"),url:l({type:"uri"}),method:n.Enum(a$),authentication:yce,customHeaders:n.Record(l({allowEmpty:!1}),l()),payloadTemplate:F("type",[n.Object({type:n.Literal("json"),value:n.Record(l({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(l({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:l({allowEmpty:!1}),alert:l({allowEmpty:!1})}))}),Ice=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:l(),token:l()}),bce=n.Object({type:n.Literal("grafana-irm"),url:l({type:"uri"})}),xce=n.Object({type:n.Literal("pagerduty"),integrationKey:l()}),Oce=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:l({type:"uri"})}),hqe=n.Object({type:n.Literal("servicenow"),instanceName:l({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:l({allowEmpty:!1}),password:l({allowEmpty:!1})}),yqe=n.Object({type:n.Literal("google-chat"),webhookUrl:l({type:"uri"})}),Eqe=n.Object({type:n.Literal("squadcast"),webhookUrl:l({type:"uri"})}),Sqe=n.Object({type:n.Literal("jira"),siteUrl:l({type:"uri",allowEmpty:!1,description:'Base URL of the Jira Cloud site, like "https://your-company.atlassian.net". Tsuga files issues against this site.'}),email:l({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:l({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),Ace=l({allowEmpty:!1,description:"ID of the team that will own the integration, determining which team members can view and manage it. Only an org admin or an admin of this team may set it."}),c$=n.Object({name:l(),owner:Ace,setting:F("type",[Ice,bce,xce,Oce,gqe,hqe,yqe,Eqe,Sqe]),tags:nr}),Tqe=n.Object({type:n.Literal("webhook"),url:n.Optional(l({type:"uri"})),method:n.Optional(n.Enum(a$)),authentication:n.Optional(Ece),customHeaders:n.Optional(n.Record(l({allowEmpty:!1}),l())),payloadTemplate:n.Optional(F("type",[n.Object({type:n.Literal("json"),value:n.Record(l({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(l({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:Qe(n.Object({ok:n.Optional(l({allowEmpty:!1})),alert:n.Optional(l({allowEmpty:!1}))}))}),_qe=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(l({allowEmpty:!1})),username:n.Optional(l({allowEmpty:!1})),password:n.Optional(l({allowEmpty:!1}))}),Iqe=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(l({type:"uri",allowEmpty:!1})),email:n.Optional(l({allowEmpty:!1})),apiToken:n.Optional(l({allowEmpty:!1}))}),bqe=n.Object({type:n.Literal("google-chat"),webhookUrl:l({type:"uri"})}),xqe=n.Object({type:n.Literal("squadcast"),webhookUrl:l({type:"uri"})}),u$=n.Object({name:n.Optional(l()),owner:Ace,tags:nr,setting:n.Optional(F("type",[Ice,bce,xce,Oce,Tqe,_qe,bqe,xqe,Iqe]))}),_yr=f({tags:["notification-integrations"],url:Hg,method:"POST",body:c$,response:ST}),Iyr=f({tags:["notification-integrations"],url:`${Hg}/:id`,method:"GET",params:n.Object({id:l()}),response:ST}),byr=f({tags:["notification-integrations"],url:`${Hg}/:id`,method:"PATCH",params:n.Object({id:l()}),body:u$,response:ST}),xyr=f({tags:["notification-integrations"],url:`${Hg}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),Oqe=F("status",[n.Object({status:n.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:n.Array(n.Object({key:n.String({description:'Jira project key, like "OPS".'}),name:n.String({description:"Human readable Jira project name."}),issueTypes:n.Array(n.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:n.Optional(n.Array(n.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),n.Object({status:n.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:n.String({description:"Human readable reason the Jira metadata could not be loaded."})},{title:"JiraMetadataError"})],{description:"Result of probing Jira for the projects, issue types and statuses reachable with a stored integration. Returns a typed error instead of failing so the rule editor can fall back to free-text entry."}),Oyr=f({tags:["notification-integrations"],url:`${Hg}/:id/jira-metadata`,method:"GET",params:n.Object({id:l()}),response:Oqe}),Ayr=f({tags:["notification-rules"],url:`${bo}/:id/notifications`,method:"GET",params:n.Object({id:l()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(Y2e),tryCount:n.Number(),nextTryAt:N(),createdAt:N(),updatedAt:N(),sentAt:n.Optional(N())})),isTruncated:n.Boolean()})}),Aqe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Cyr=f({tags:["notification-rules"],url:`${Ba}/test`,method:"POST",body:n.Object({notificationRule:ET,targetIds:n.Optional(n.Array(l({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10})),monitorId:n.Optional(l({allowEmpty:!1,description:"Monitor to simulate: the test notification is built like a real alert of this monitor (message, tags, group by values). When omitted, a generic test notification is sent."}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(Aqe,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var Cqe=["healthy","breached","no_data"],qp=n.Enum(Cqe,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Yg=n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:vo({description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs.",valueDescription:"Substring matched case-insensitively against the SLO name or SLO ID."}),tags:ye(sn.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:ye(l({allowEmpty:!1}),{description:"Restrict results to SLOs that run against any of these cluster IDs (SLOs with no cluster restriction are always included)",maxItems:50}),statuses:ye(qp,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"});var Ls="/v0/service-catalog",Rqe=n.Object({team:n.String({description:"Team name observed on telemetry for this service. The emitting service sets it through telemetry attributes. Returned when Tsuga has observed a team value for the service; metadata refreshes weekly or when a new service version appears. For a service the service catalog has not recorded yet, it comes from the trace span metrics of the queried window."})},{description:"A team name observed on telemetry for this service."}),Pqe=n.Object({ingestionApiKey:n.String({description:"Ingestion API key name or identifier observed on telemetry for this service. Tsuga sets it from the key used to ingest matching telemetry. Returned when key metadata is available for the service."}),lastSeenAt:N({description:"Most recent time this ingestion key was observed for the service. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),Uqe=n.Object({version:n.String({description:"Service version value observed in telemetry. The emitting service sets it through `context.service.version`. Returned when Tsuga has observed a version for the service."}),firstSeenAt:N({description:"First time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),lastSeenAt:N({description:"Most recent time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),faulty:n.Optional(n.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:n.Optional(n.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:n.Optional(n.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),wqe=n.Object({language:n.String({description:"Programming language observed for this service. The OpenTelemetry SDK sets it through telemetry metadata. Returned when language metadata is available for the service."}),lastSeenAt:N({description:"Most recent time this language was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A programming language observed for this service, with the last time it was seen."}),vqe=n.Object({protocol:n.String({description:"Observed API protocol, such as `http`, `grpc`, or `graphql`. Tsuga infers it from span metadata. Returned when protocol metadata is available for the service."}),lastSeenAt:N({description:"Most recent time this protocol was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An API protocol observed for this service, with the last time it was seen."}),Nqe=n.Object({framework:n.String({description:"Observed application framework, such as `express`, `fastify`, `django`, or `rails`. Tsuga detects it from OpenTelemetry instrumentation scope. Returned when framework metadata is available for the service."}),lastSeenAt:N({description:"Most recent time this framework was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),kqe=n.Object({platform:n.String({description:"Observed cloud or orchestration platform. Tsuga reads the `cloud.platform` resource attribute, such as `aws_eks` or `aws_lambda`, and adds `kubernetes` when spans carry `k8s.cluster.name` and `aws_ecs` when they carry `aws.ecs.task.arn`. The emitting service or collector sets these resource attributes."}),lastSeenAt:N({description:"Most recent time this platform was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),Lqe=n.Object({provider:n.String({description:"Observed cloud provider, read from the `cloud.provider` resource attribute, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it."}),lastSeenAt:N({description:"Most recent time this provider was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud provider this service runs on, with the last time it was seen."}),Vg=n.Object({id:n.String({description:"Tsuga-generated identifier of this service notification target. Tsuga returns it when the target is created or listed, and clients use it to update or delete the target. It is unique across service targets."}),serviceId:n.String({description:"Identifier of the service catalog entry this target is attached to. Tsuga sets it from the service path parameter and returns it on read and write responses."}),config:yT.properties.config,rateLimit:yT.properties.rateLimit,createdAt:N({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:N({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),p$=n.Object({config:Kg.properties.config,rateLimit:Kg.properties.rateLimit},{description:"Service notification target create request. The caller provides the destination configuration and optional rate limit; Tsuga attaches the target to the service in the path."}),l$=n.Object({config:Kg.properties.config,rateLimit:n.Union([o$,n.Null()],{description:"Per-target rate limit to apply when sending notifications. Set it to `null` to drop the current limit and fall back to the default of 1000 notifications every 10 minutes."})},{description:"Service notification target update request. The caller provides the replacement destination configuration and rate limit; omitted fields are not supported by this schema."}),QR=n.Object({id:n.Optional(n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints. Absent until the hourly service catalog task records the service."})),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(Rqe,{description:"Team names observed on telemetry for this service."}),ingestionApiKeys:n.Array(Pqe,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(Uqe,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(wqe,{description:"Programming languages observed for this service."}),serverProtocols:n.Array(vqe,{description:"API protocols this service exposes (from server-kind spans)"}),frameworks:n.Array(Nqe,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Optional(n.Array(kqe,{description:"Cloud platforms this service is running on. Absent or empty when Tsuga has not observed platform metadata for the service; treat both the same."})),cloudProviders:n.Optional(n.Array(Lqe,{description:"Cloud providers this service is running on. Absent or empty when Tsuga has not observed provider metadata for the service; treat both the same."})),lastSeenAt:n.Optional(N({description:"Most recent time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),firstSeenAt:n.Optional(N({description:"First time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary span kind. The primary span kind is the busiest of `SPAN_KIND_SERVER`, `SPAN_KIND_PRODUCER`, and `SPAN_KIND_CONSUMER` in the service\u2019s busiest env, or `SPAN_KIND_INTERNAL` when the service has none of those; `SPAN_KIND_CLIENT` never counts. Every env of the service uses that same span kind. Omitted when the trace query failed, which is distinct from `0` (the service is quiet)."})),traceErrorRate:n.Optional(n.Number({description:"Percentage of this service\u2019s primary-span-kind calls (see `traceRequestRate`) over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(Vg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:n.Optional(N({description:"Timestamp when Tsuga created this service catalog entry."})),updatedAt:n.Optional(N({description:"Timestamp when Tsuga last updated this service catalog entry."}))}),Mqe=n.Object({spanKind:n.Enum(aZ),count:n.Number()});var Cce=n.Object({...QR.properties,spanKindCounts:n.Array(Mqe),envs:n.Array(n.String())}),Dqe=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],Fqe=n.Object({searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:ye(l({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:ye(l({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:ye(l({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:ye(l({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:n.Boolean({description:"When true, only return services whose request rate over the queried window is non-zero"})}),TT=["1h","4h","24h"];var d$=n.Partial(n.Object({...Ie,clusterId:l(),filters:n.Partial(Fqe,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(Dqe,{description:"Field to sort the returned services by"}),direction:me},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(TT,{description:"Lookback used to select the services returned, which are those with trace span metrics in it, and to compute the trace request rate and trace error rate fields and the span-call totals that pick each service's primary environment. Defaults to `1h`."})})),jyr=f({tags:["service-catalog"],url:`${Ls}/v2/services/query`,method:"POST",paginated:!0,body:d$,response:n.Array(Cce)}),qyr=f({tags:["service-catalog"],query:n.Object({serviceName:l({allowEmpty:!1}),serviceNamespace:n.Optional(l({allowEmpty:!1})),env:l({allowEmpty:!1}),clusterId:n.Optional(l())}),method:"GET",url:`${Ls}/v2/service`,response:Cce}),Hyr=f({tags:["service-catalog"],query:n.Object({serviceName:l({allowEmpty:!1}),serviceNamespace:n.Optional(l({allowEmpty:!1})),clusterId:n.Optional(l())}),method:"GET",url:`${Ls}/v2/service/envs`,response:n.Array(n.Object({env:n.String({description:"Environment the service was observed in."}),ingestedBytes:n.Number({description:"Trace bytes ingested for the service in this environment over the lookback."})}),{description:"Environments the service was observed in, busiest first."})}),Kyr=f({tags:["service-catalog"],method:"GET",url:`${Ls}/services/:serviceId`,params:n.Object({serviceId:l()}),response:QR}),zyr=f({tags:["service-catalog"],method:"GET",url:`${Ls}/services/:serviceId/targets`,params:n.Object({serviceId:l()}),response:n.Array(Vg)}),Yyr=f({tags:["service-catalog"],method:"POST",url:`${Ls}/services/:serviceId/targets`,params:n.Object({serviceId:l()}),body:p$,response:Vg}),Vyr=f({tags:["service-catalog"],method:"PUT",url:`${Ls}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:l(),targetId:l()}),body:l$,response:Vg}),Wyr=f({tags:["service-catalog"],method:"DELETE",url:`${Ls}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:l(),targetId:l()}),response:q}),$qe=["http","rpc","messaging","genai","object_store"],Rce={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},m$=n.Object({...Rce,nodeType:n.Literal("observed",{description:"Discriminator for this node variant. Always `observed` for a graph node matched to a service catalog entry by name and env."}),id:n.Union([n.String(),n.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:n.Optional(n.Number({description:"Ratio of entry requests with at least one error to total entry requests observed on this service. Omitted when no entry requests were observed. Computed from the raw sampled counts, so trace sampling does not affect it."})),entryErrorRequestCount:n.Number({description:"Estimated number of entry requests on this service where at least one entry span had error status, projected from the sampled traces onto the full population."}),entryRequestCount:n.Number({description:"Estimated number of entry requests on this service, projected from the sampled traces onto the full population. Observed as unique trace IDs that have at least one entry span on this service. An entry span is a consumer-kind span, a root span (no parent), or any span whose parent belongs to a different service."})}),Pce={...Rce,endpoint:n.Optional(n.String({description:"Inferred service endpoint address"})),resourceName:n.Optional(n.String({description:"Inferred resource name, e.g. table or queue name"}))},f$=n.Object({...Pce,nodeType:n.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:n.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:n.Optional(n.String({description:"Database name from span_attributes db.namespace. Matches the database catalog `name`."})),databaseSystem:n.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),g$=n.Object({...Pce,nodeType:n.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:n.Enum($qe,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),Bqe=F("nodeType",[m$,f$,g$]),h$=n.Object({from:n.Object({env:n.Optional(n.String({description:"Environment of the source node"})),name:n.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:n.Object({env:n.Optional(n.String({description:"Environment of the target node"})),name:n.String({description:"Name of the target node"}),databaseSystem:n.Optional(n.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:n.Number({description:"Estimated number of cross-service transitions on this directed edge in the graph query window. The graph is built from a uniform sample of traces, so this is projected onto the full population rather than counted directly."}),errorRate:n.Optional(n.Number({description:"Ratio of errored client spans to total client spans observed on this edge. Omitted when no client spans were observed. For edges to inferred services, the originating span is treated as the client span regardless of its kind. Computed from the raw sampled counts, so trace sampling does not affect it."})),errorCount:n.Number({description:"Estimated number of client spans with error status on this edge, projected from the sampled traces onto the full population."}),clientSpanCount:n.Number({description:"Estimated number of client spans on this edge, projected from the sampled traces onto the full population."})},{description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`) in the service graph, with call-volume and error counts observed over the query window."}),Qyr=f({tags:["service-catalog"],url:`${Ls}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:l()}),query:n.Object({...Cr.properties,query:n.Optional(l({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(Bqe),edges:n.Array(h$)})}),Gqe=n.Object({monitors:n.Array(n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns the monitor"}),priority:n.Enum(Tn,{description:"Priority of the monitor"})})),slos:n.Array(n.Object({id:n.String({description:"Identifier of the SLO"}),name:n.String({description:"Display name of the SLO"}),owner:n.String({description:"Team ID that owns the SLO"}),statusCount:n.Partial(n.Record(qp,n.Number()),{description:"Count of SLO statuses for this service: one entry per group matching the service when the SLO groups by service.name, otherwise the overall status"})}))}),Zyr=f({tags:["service-catalog"],method:"GET",url:`${Ls}/services/:serviceId/related-resources`,params:n.Object({serviceId:l()}),response:Gqe}),Xyr=f({tags:["service-catalog"],method:"GET",url:`${Ls}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Uce="/v0/service-catalog/queues",ZR=n.Object({clusterId:n.String(),name:n.String(),env:n.String(),messagingSystem:n.String(),publishPerSecond:n.Number({description:"Messages published per second."}),consumePerSecond:n.Number({description:"Messages consumed per second."}),consumerErrorsPerSecond:n.Number({description:"Messages per second whose consumer span has an error status."}),p90ProcessingMs:n.Number({description:"p90 duration of consumer spans."})}),oEr=f({tags:["service-catalog"],query:n.Object({...Ie,clusterId:n.Optional(l({description:"Cluster ID used to restrict the returned queue catalog entries."})),env:n.Optional(l({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(TT,{description:"Lookback over producer and consumer messaging spans used to list the queues and compute their rates."}))}),method:"GET",paginated:!0,url:Uce,response:n.Array(ZR)}),iEr=f({tags:["service-catalog"],method:"GET",url:`${Uce}/by-name`,query:n.Object({name:l({allowEmpty:!1}),messagingSystem:l({allowEmpty:!1}),env:l({allowEmpty:!1}),clusterId:n.Optional(l({allowEmpty:!1}))}),response:ZR});var wce=`/${"v1"}/queues`,y$=n.Pick(ZR,["name","env","messagingSystem","publishPerSecond","consumePerSecond","consumerErrorsPerSecond","p90ProcessingMs"],{$id:"Queue",description:"Message queue inferred from producer and consumer messaging spans (OpenTelemetry `messaging.*` attributes), with its publish, consume, and consumer error rates."}),jqe={name:"orders",env:"production",messagingSystem:"kafka",publishPerSecond:42.5,consumePerSecond:41.9,consumerErrorsPerSecond:.2,p90ProcessingMs:18.4};Object.assign(y$,{examples:[jqe]});var vce=n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),Nce=f({description:"Lists message queues and topics (Kafka, SQS, RabbitMQ and other messaging systems) inferred from producer and consumer messaging spans, with per-second publish, consume and consumer error rates and p90 processing duration over the stats window.",operationId:"listQueues",tags:["queues"],method:"GET",url:wce,paginated:!0,query:n.Object({...We,clusterId:vce,env:n.Optional(l({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(TT,{description:"Lookback over messaging spans used to list the queues and compute their rates. Defaults to `1h`."}))}),response:n.Array(y$)}),kce=f({description:"Retrieves one message queue or topic by name, messaging system and environment, with its rates. Searches the last hour first, then the last 24 hours.",operationId:"getQueue",tags:["queues"],method:"GET",url:`${wce}/by-name`,query:n.Object({name:l({allowEmpty:!1,description:"Queue name (`messaging.destination.name`)."}),messagingSystem:l({allowEmpty:!1,description:"Messaging system (`messaging.system`), for example `kafka` or `aws_sqs`."}),env:l({allowEmpty:!1,description:"Environment the queue was observed in."}),clusterId:vce}),response:y$});var Lce=P("queues").pipe(U("List and inspect message queues inferred from messaging spans"),be([hr("list",Nce,!1),hr("get",kce,!0)]));var _T=`/${"v1"}/adaptive-notification-rules`,IT=n.Pick(Vd,["id","name","owner","isActive","tags","monitorIds","sloIds","fallbackTarget"],{$id:"AdaptiveRule",description:"Adaptive notification rule that reacts to selected monitors and SLOs. When one of them fires, Tsuga pages the owners of the failing service it identifies from the sampled traces, and pages the fallback target when no owner can be resolved. See [Rules](/documentation/alert/notifications/rules)."}),Mce={name:"Checkout latency",owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],monitorIds:["monitor-123-abc"],sloIds:["slo-456-def"],fallbackTarget:{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}},qqe={id:"123-456-abc",...Mce};Object.assign(IT,{examples:[qqe]});var Dce=f({description:"Lists adaptive notification rules: when a selected monitor or SLO fires, they page the owners of the failing service found in sampled traces, or a fallback target. Standard notification rules have their own endpoint.",operationId:"listAdaptiveNotificationRules",tags:["adaptive-notification-rules"],url:_T,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(IT)}),Fce=f({description:"Retrieves one adaptive notification rule by ID.",operationId:"getAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${_T}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the adaptive notification rule to retrieve. Use the `id` returned by adaptive notification rule list or create responses."})}),response:IT}),E$=n.Pick(WR,["name","owner","tags","isActive","monitorIds","sloIds","fallbackTarget"],{description:"Adaptive notification rule create or update request. Provide the monitors or SLOs the rule reacts to, the owner, the active state, and the fallback target."}),Hqe=Mce;Object.assign(E$,{examples:[Hqe]});var $ce=f({description:"Creates an adaptive notification rule that pages the owners of the failing service when a selected monitor or SLO fires. Only trace monitors, metric monitors over OTel span metrics, and SLOs over traces or OTel span metrics are eligible.",operationId:"createAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:_T,method:"POST",body:E$,response:IT}),Bce=f({description:"Updates an existing adaptive notification rule by ID. Required fields and the fallback target are overwritten; omitted optional fields, including `monitorIds` and `sloIds`, keep their existing values. Send an empty array to clear a list.",operationId:"updateAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${_T}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the adaptive notification rule to update. Use the `id` returned by adaptive notification rule list, get, or create responses."})}),body:E$,response:IT}),Gce=f({description:"Deletes an adaptive notification rule by ID. Its monitors and SLOs keep evaluating, but this rule no longer pages anyone.",operationId:"deleteAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${_T}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the adaptive notification rule to delete. Use the `id` returned by adaptive notification rule list, get, create, or update responses."})}),response:q});var jce=De({commandName:"adaptive-notification-rules",description:"Manage adaptive notification rules",endpoints:{list:Dce,get:Fce,create:$ce,update:Bce,delete:Gce}});var Kqe={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[PEr,XR,bT]=zqe(Kqe),UEr=Object.fromEntries(XR.map(e=>[e,e]));function zqe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let a=e[s];for(let u in a){r.push(u);let p=a[u];Array.isArray(p)&&o.push(...p)}}return[S$(t),S$(r),S$(o)]}function S$(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var T$=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),Yqe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Vqe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),Wqe=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),Qqe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),Zqe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC","RUBY"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),Xqe=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),Jqe=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(N()),protectionEnabled:n.Optional(n.Boolean()),protectionExpiresAt:n.Optional(N())}),eHe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),tHe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),rHe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(N()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),nHe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),oHe=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),ephemeralStorageMib:n.Optional(n.Number({description:"Size of the temporary storage mounted on the function instance, in MiB. Only present for platforms that expose it, such as AWS Lambda."})),codeSha256:n.Optional(n.String())}),iHe=n.Object({kind:n.Optional(n.String())}),sHe=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),aHe=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),cHe=n.Object({protocol:n.Optional(T$),port:n.Optional(n.Number()),instanceProtocol:n.Optional(T$),instancePort:n.Optional(n.Number())}),uHe=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),pHe=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),lHe=n.Object({type:n.String(),name:n.String()}),dHe=n.Object({frontendIp:n.Optional(pHe),backendIpPools:n.Array(lHe)}),mHe=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),fHe=n.Object({protocol:n.Optional(T$),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(mHe)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),gHe=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),hHe=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),gHe]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),yHe=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),EHe=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(cHe),n.Array(uHe)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(yHe),n.Array(hHe)])),azureLoadBalancingRules:n.Optional(n.Array(dHe))}),SHe=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(N()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(N()),status:n.Optional(n.String()),type:n.Optional(n.String())}),THe=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),_He=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),IHe=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),bHe=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([THe,IHe,_He])]),xHe=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),JR=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(xHe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(Yqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(nHe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(eHe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(Vqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(Wqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(iHe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(bHe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(sHe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(oHe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(Qqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(Zqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(Xqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(Jqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(tHe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(rHe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(aHe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:EHe}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(fHe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(SHe)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var Wd="/v0/inventory",qce=["scan_in_progress","success","failure","partial"],I$=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(Cp,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:n.String({description:"Cloud-native account identifier where Tsuga discovered this resource, such as an AWS account ID, GCP project ID, or Azure subscription ID."}),cloudRegion:n.Optional(n.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:n.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:n.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:n.Optional(N({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(N({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:N({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:Wt,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),Wg={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Hce=n.Object({cloudPlatforms:ye(n.Enum(Cp),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:Cp.length}),cloudAccounts:ye(l({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:ye(l({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:ye(n.Enum(bT),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:bT.length}),resourceTypes:ye(n.Enum(XR),{description:"Restrict results to resources of any of these normalized resource types",maxItems:XR.length}),tags:ye(sn.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:n.Boolean({description:"Restrict results by infrastructure-as-code coverage. When true, only resources covered by the configured IaC identifiers are returned; when false, only uncovered resources are returned."}),searchQuery:n.Object({value:l({allowEmpty:!1,description:"Case-insensitive substring matched against resource ID, display name, fully-qualified resource ID, cloud account, region, and resource type. Use the `tags` filter to narrow by tag. Wildcard characters are treated literally."}),exclude:n.Optional(n.Boolean({description:"If true, exclude resources matching this value instead of including them"}))},{description:"Search query filter for resources."})},{description:"Optional filters applied to narrow the returned resources"}),b$=n.Partial(n.Object({...Ie,filters:n.Partial(Hce,{description:"Filters applied to narrow the returned resources."}),sort:n.Object({by:n.Enum([Wg.DISPLAY_NAME,Wg.CLOUD_ACCOUNT,Wg.NATIVE_RESOURCE_TYPE,Wg.CLOUD_REGION,Wg.RESOURCE_TYPE,Wg.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:me},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),$Er=f({tags:["inventory"],method:"POST",url:`${Wd}/resources/query`,paginated:!0,body:b$,response:n.Array(n.Intersect([I$,JR]))}),OHe=["resourceType","cloudAccount","isIacManaged"],BEr=f({tags:["inventory"],method:"POST",url:`${Wd}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(Hce)),groupBy:n.Enum(OHe,{description:"Dimension to group the resource counts by."})}),response:n.Array(n.Object({value:n.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:n.Integer({description:"Number of resources in this group matching the requested filters."})}))}),GEr=f({tags:["inventory"],method:"GET",url:`${Wd}/resources/filter-options`,response:n.Object({cloudRegions:n.Array(n.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:n.Array(n.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Wr})}),jEr=F("type",[n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({description:"AWS account ID that Tsuga scans."}),externalId:n.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:n.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:n.String({description:"Workload identity provider resource name used for federated authentication."})}),n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:n.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:n.String({description:"Azure tenant ID that owns the subscription."})})]),AHe="^[0-9]{12}$",CHe="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",RHe="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",PHe="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",UHe="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",_$="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",wHe=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:AHe,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:l({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({pattern:CHe,minLength:1,maxLength:2048,description:"ARN of the IAM role Tsuga assumes to read inventory in the account.",errorMessage:{pattern:"Must be an IAM role ARN, e.g. arn:aws:iam::123456789012:role/MyRole."}})},{$id:"AwsConnectionSettings"}),vHe=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:RHe,minLength:6,maxLength:30,description:"GCP project ID that Tsuga scans.",errorMessage:{pattern:"Must be a GCP project ID (6-30 chars: lowercase letters, digits, hyphens)."}}),serviceAccountId:n.String({pattern:PHe,minLength:1,maxLength:128,description:"Service account Tsuga impersonates to read inventory.",errorMessage:{pattern:"Must be a service account email, e.g. name@project.iam.gserviceaccount.com."}}),workloadIdentityProvider:n.String({pattern:UHe,minLength:1,maxLength:256,description:"Full resource name of the workload identity provider used for federated authentication, e.g. //iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider.",errorMessage:{pattern:"Must be the full provider resource name: //iam.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<POOL_ID>/providers/<PROVIDER_ID>."}})},{$id:"GcpConnectionSettings"}),NHe=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:_$,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:_$,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:_$,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Kce=F("type",[wHe,vHe,NHe],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),Qg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(Cp,{description:"Cloud provider of the account."}),cloudAccountId:n.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(n.String({description:"Human-readable name for the account shown in Tsuga."})),owner:n.Optional(n.String({description:"Team ID that owns the account."})),organizationId:n.Optional(n.String({description:"Cloud organization identifier, when known."})),createdBy:n.Optional(n.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:N({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(N({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(N({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(qce,{description:"Status of the most recent inventory scan."}))}),x$=n.Object({cloudType:n.Enum(Cp,{description:"Cloud provider of the account."}),cloudAccountId:l({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(l({description:"Human-readable name for the account shown in Tsuga."})),owner:n.Optional(l({allowEmpty:!1,description:"Team ID that will own the account."})),organizationId:n.Optional(l({description:"Cloud organization identifier, when known."})),connectionSettings:Kce,lastScanStatus:n.Optional(n.Enum(qce,{description:"Status of the most recent inventory scan."}))}),Qd=`${Wd}/cloud-accounts`,qEr=f({tags:["inventory"],url:Qd,method:"GET",response:n.Array(Qg)}),HEr=f({tags:["inventory"],url:`${Qd}/:id`,method:"GET",params:n.Object({id:l()}),response:Qg}),KEr=f({tags:["inventory"],url:Qd,method:"POST",body:x$,response:Qg}),O$=n.Object({accountFriendlyName:l({description:"Human-readable name for the account shown in Tsuga."}),owner:Qe(l({allowEmpty:!1}),{description:"Team ID that will own the account. Set to null to remove the owner."})}),zEr=f({tags:["inventory"],url:`${Qd}/:id`,method:"PUT",params:n.Object({id:l()}),body:O$,response:Qg}),YEr=f({tags:["inventory"],url:`${Qd}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),VEr=f({tags:["inventory"],url:`${Wd}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),WEr=f({tags:["inventory"],url:`${Qd}/azure/onboarding`,method:"POST",body:n.Object({tenantId:l()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),QEr=f({tags:["inventory"],method:"POST",url:`${Qd}/validate/:type`,params:n.Object({type:l()}),body:n.Object({data:Kce,id:n.Optional(l())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),zce=`${Wd}/settings`,ZEr=f({tags:["inventory"],url:zce,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),kHe=50,XEr=f({tags:["inventory"],url:zce,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:l({allowEmpty:!1}),value:n.Optional(l({allowEmpty:!1}))}),{maxItems:kHe})}),response:n.Object({})}),JEr=f({tags:["inventory"],url:`${Wd}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var Yce=`/${"v1"}/inventory`,LHe=n.Omit(I$,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. Public inventory resources omit raw provider-native attributes and infrastructure-as-code coverage fields. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Vce=n.Intersect([LHe,JR],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with normalized category, resource type, and public category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),MHe={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(Vce,{examples:[MHe]});var Wce=n.Object({...b$.properties,...We},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),DHe={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(Wce,{examples:[DHe]});var Qce=f({description:"Lists or searches cloud resources (AWS, GCP or Azure, for example EC2 instances or S3 buckets) found by inventory scans of connected cloud accounts, by platform, account, region, resource type, tag or infrastructure-as-code coverage.",operationId:"queryInventoryResources",tags:["inventory"],url:`${Yce}/resources/query`,method:"POST",paginated:!0,body:Wce,response:n.Array(Vce)}),xT=`${Yce}/cloud-accounts`,OT=n.Pick(Qg,["id","cloudType","cloudAccountId","accountFriendlyName","owner"],{$id:"CloudAccount"}),FHe={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",owner:"team-123-abc"};Object.assign(OT,{examples:[FHe]});var Zce=n.Pick(x$,["cloudType","cloudAccountId","accountFriendlyName","owner","connectionSettings"]),$He={cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",owner:"team-123-abc",connectionSettings:{type:"aws",accountId:"123456789012",externalId:"tsuga-external-id",roleArn:"arn:aws:iam::123456789012:role/tsuga-inventory"}};Object.assign(Zce,{examples:[$He]});var Xce=n.Pick(O$,["accountFriendlyName","owner"]),BHe={accountFriendlyName:"Production AWS",owner:"team-123-abc"};Object.assign(Xce,{examples:[BHe]});var cSr=f({description:"Lists the cloud accounts connected to Tsuga (AWS accounts, GCP projects, Azure subscriptions), with provider and display name.",operationId:"listCloudAccounts",tags:["inventory"],url:xT,method:"GET",response:n.Array(OT)}),uSr=f({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${xT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:OT}),pSr=f({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:xT,method:"POST",body:Zce,response:OT}),lSr=f({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${xT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:Xce,response:OT}),dSr=f({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${xT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:q});var Jce=De({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:Qce},enableListBody:!0});var AT=`/${"v1"}/custom-roles`,CT=n.Pick(Bd,["id","name","description","teamScope","assets","telemetry","telemetryQuery"],{$id:"CustomRole",description:"Global role defined by the organization. It sets which teams its holders reach, which telemetry signals they can query, and which resource types they can read or write. See [Custom global roles](/documentation/account-and-settings/roles-and-permissions#custom-global-roles)."}),GHe={id:"123-456-abc",name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(CT,{examples:[GHe]});var A$=n.Pick(NR,["name","description","teamScope","assets","telemetry","telemetryQuery"],{description:"Custom role create or update request. Provide the role name, optional description, team scope, resource type grants, readable telemetry signals, and optional telemetry restriction."}),jHe={name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(A$,{examples:[jHe]});var eue=f({description:"Lists every custom global role (RBAC permissions, access control) of the organization, ordered by name, with what each role grants.",operationId:"listCustomRoles",tags:["custom-roles"],url:AT,method:"GET",response:n.Array(CT)}),tue=f({description:"Retrieves one custom global role by ID.",operationId:"getCustomRole",tags:["custom-roles"],url:`${AT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the custom role to retrieve. Use the `id` returned by custom role list, create, or update responses."})}),response:CT}),rue=f({description:"Creates a custom global role. The name must be unique across the organization. Grants on resource types a custom role cannot configure are dropped. Requires write access on custom roles, which only an operation key scoped to all teams can hold. Only a Global admin can first grant it to a key; a key holding it and write access on operation API keys can then pass it on to the keys it creates or updates.",operationId:"createCustomRole",tags:["custom-roles"],url:AT,method:"POST",body:A$,response:CT}),nue=f({description:"Replaces the name, team scope, resource type grants, and telemetry signals of a custom global role by ID. The new grants apply to every user holding the role. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"updateCustomRole",tags:["custom-roles"],url:`${AT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the custom role to update. Use the `id` returned by custom role list, get, or create responses."})}),body:A$,response:CT}),oue=f({description:"Deletes a custom global role by ID. Fails while a user still holds the role; change their global role first. Pending invitations that carry the role are deleted with it. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"deleteCustomRole",tags:["custom-roles"],url:`${AT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the custom role to delete. Use the `id` returned by custom role list, get, create, or update responses."})}),response:q});var iue=De({commandName:"custom-roles",description:"Manage custom global roles",endpoints:{list:eue,get:tue,create:rue,update:nue,delete:oue}});var Xg="/v0/dashboard-folders",Jg=n.Object({id:n.String({description:"Tsuga-generated dashboard folder ID assigned when the folder is created. Use it as dashboard `folderId` or child-folder `parentFolderId`."}),name:n.String({description:"Display name of the dashboard folder. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the dashboard folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:n.Optional(n.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:Wt,creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:N(),updatedAt:N()},{title:"DashboardFolder"}),C$=n.Object({...Jg.properties,dashboardCount:n.Number({description:"Number of dashboards in this folder and its readable subfolders that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."}),folderCount:n.Number({description:"Number of folders nested directly under this folder that the caller can read."})}),eP=n.Object({name:l({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:l({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:n.Optional(n.Union([n.Null(),l({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:nr}),tP=n.Partial(n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:ye(sn.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:n.Union([n.Null(),l({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),Zg={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},R$=[Zg.OWNER,Zg.TAGS,Zg.DASHBOARD_COUNT,Zg.UPDATED_AT,Zg.NAME],qHe=n.Partial(n.Object({...Ie,filters:tP,sort:n.Object({by:n.Enum([...R$,Zg.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:me},{description:"Optional sorting applied to the returned dashboard folders"})})),NSr=f({tags:["dashboard-folders"],url:`${Xg}/query`,method:"POST",paginated:!0,body:qHe,response:n.Array(C$)}),kSr=f({tags:["dashboard-folders"],url:`${Xg}/:id`,method:"GET",params:n.Object({id:l()}),response:Jg}),LSr=f({tags:["dashboard-folders"],url:Xg,method:"POST",body:eP,response:Jg}),MSr=f({tags:["dashboard-folders"],url:`${Xg}/:id`,method:"PUT",params:n.Object({id:l()}),body:eP,response:Jg}),DSr=f({tags:["dashboard-folders"],url:`${Xg}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),FSr=f({tags:["dashboard-folders"],url:`${Xg}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(tP,["tags"]))}),response:Wr});var RT=`/${"v1"}/dashboard-folders`,rP=n.Pick(Jg,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),sue={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(rP,{examples:[sue]});var aue=n.Pick(C$,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards in it and its readable subfolders."}),HHe={...sue,dashboardCount:10};Object.assign(aue,{examples:[HHe]});var P$=n.Pick(eP,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),KHe={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(P$,{examples:[KHe]});var zHe=n.Object({by:n.Enum(R$,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards in the folder and its readable subfolders, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:me},{description:"Optional sorting applied to the returned dashboard folders"}),cue=n.Object({...We,filters:n.Optional(n.Pick(tP,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(zHe)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),YHe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(cue,{examples:[YHe]});var uue=f({description:"Lists or searches dashboard folders by owning team, name or ID substring, tags or parent folder, with the number of readable dashboards in each folder and its readable subfolders. Returns every folder unless `parentFolderId` is set: a folder ID selects its children, null only top-level folders. Most recently updated first unless `sort` is set.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${RT}/query`,method:"POST",paginated:!0,body:cue,response:n.Array(aue)}),pue=f({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${RT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:rP}),lue=f({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:RT,method:"POST",body:P$,response:rP}),due=f({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${RT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:P$,response:rP}),mue=f({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${RT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:q});var fue=De({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:uue,get:pue,create:lue,update:due,delete:mue},enableListBody:!0});var ja="/v0/dashboards",gue=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],VHe=["bar","distribution","gauge","heatmap","list","pie","query-value","slo","table","timeline","timeseries","top-list"],pTr=[...VHe,"note","group"];var WHe=["ns","us","ms","s","m","h","days"];var QHe=["B","KB","MB","GB","TB","PB"],ZHe=["bit","Kibit","Mibit","Gibit","Tibit","Pibit"],XHe=[...QHe,...ZHe];var JHe=20;var hue=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),yue=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(WHe,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Eue=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte or bit units"}),unit:n.Enum(XHe,{description:"Data size unit of the raw values. Byte units (B, KB, MB, ...) scale in steps of 1000. Bit units (bit, Kibit, Mibit, ...) are binary: values are converted to bytes and scale in steps of 1024 (KiB, MiB, GiB, ...)."})},{$id:"DataNormalizerData",title:"Data"}),Sue=n.Object({type:n.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),Tue=n.Object({type:n.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),_ue=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),Iue=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),bue=n.Object({type:n.Literal("none",{description:"Displays raw values without a unit. Records an explicit removal of the unit, so it is not re-derived from metric metadata"})},{$id:"DataNormalizerNone",title:"None"}),eKe=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),tKe=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:JHe})},{$id:"InputDataNormalizerCustom",title:"Custom"}),lr=F("type",[yue,Eue,Sue,Tue,_ue,Iue,hue,bue,eKe],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),dr=F("type",[yue,Eue,Sue,Tue,_ue,Iue,hue,bue,tKe],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),oP=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(lr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),iP=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(dr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),eh=["background","no-background"],rKe=["table","legend-only","no-legend"];var nKe=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],xue=["alert","warning","success"],Oue=({colors:e,operatorDescription:t,valueDescription:r,colorDescription:o})=>({operator:n.Enum(nKe,{description:t}),value:n.Number({description:r}),color:n.Enum(e,{description:o})}),qa=n.Object(Oue({colors:xue,operatorDescription:"Comparator used to evaluate the metric value",valueDescription:"Threshold value used when evaluating the operator",colorDescription:"Color applied when the condition is met"}),{title:"ConditionalFormatting",description:"Color rule evaluated against the raw query value, before the unit is applied. The first matching rule in the array is applied."}),oKe=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(xue,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),iKe=["sec","min","hour","day"],Ha=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(iKe,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var Ga=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),Zd=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),Xd=n.Object({formula:n.Optional(l({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),l({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),sP={source:Ii,queries:sJ,formula:n.Optional(lC),aliases:n.Optional(Zd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},aP={source:Ii,queries:PS,formula:n.Optional(xd),aliases:n.Optional(Xd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},is=n.Optional(n.Enum(["relative","absolute"],{description:"`absolute` keeps each group at its own value; `relative` shows it as a percentage of the ungrouped total (defaults to absolute)"})),Jd={...sP,groupBy:n.Optional(mg)},em={...aP,groupBy:n.Optional(Xc)},Qr=n.Enum(rKe,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),pt=n.Optional(n.Union([n.Number(),n.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),ss=n.Optional(n.Array(oKe,{description:"Threshold markers displayed on the chart"})),sKe="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",Aue='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',Cue="URL opened in a new tab by the context menu entry. Every `{{group.<field>}}` placeholder is replaced by the URL-encoded value the clicked series has for that group-by field; without placeholders, every series opens the same URL. `{` and `}` are only allowed as part of a placeholder. Tsuga omits the menu entry when the clicked series has no value for one of the referenced fields.",PT=n.Object({label:n.Optional(n.String({description:Aue})),url:n.String({description:Cue})},{$id:"WidgetCustomLink",title:"CustomLink"}),UT=n.Object({label:n.Optional(l({allowEmpty:!1,description:Aue})),url:n.String({pattern:sKe,maxLength:Ti,description:Cue})},{$id:"InputWidgetCustomLink",title:"CustomLink"});var U$=["monitor","slo"],Rue="Events displayed on top of the chart, over its time axis, so they can be correlated with the plotted data. A widget carries at most one overlay, and each kind of overlay carries its own settings.",Pue=n.Literal("service-deployments",{description:"Draws the deployments contained in the time range over the chart"}),Uue="IDs of the teams whose services the app offers in its Services picker. It does not select what is drawn: the overlay draws only the services listed in `services`.",wue="OpenTelemetry service names whose deployments are drawn. Nothing is drawn until at least one service is set.",vue="Environment whose deployments are drawn. Deployments from every environment are drawn when omitted.",aKe=n.Object({type:Pue,teams:n.Optional(n.Array(n.String(),{description:Uue})),services:n.Optional(n.Array(n.String(),{description:wue})),env:n.Optional(n.String({description:vue}))},{$id:"WidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),cKe=n.Object({type:Pue,teams:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:50,description:Uue})),services:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:200,description:wue})),env:n.Optional(l({allowEmpty:!1,description:vue}))},{$id:"InputWidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),Nue="Tsuga query selecting the log events drawn over the chart. Nothing is drawn when omitted. An empty string draws every log event in the time range.",uKe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(n.String({description:Nue}))},{$id:"WidgetLogsOverlay",title:"LogsOverlay"}),pKe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(l({type:"tsuga-query",description:Nue}))},{$id:"InputWidgetLogsOverlay",title:"LogsOverlay"}),kue="Kinds of alert drawn over the chart. Both monitor and SLO alerts are drawn when omitted. On its own, it does not make the overlay draw: set `query` or a filter too.",Lue="Case-insensitive substring matched against the alert, the same way the Ongoing alerts page matches its search box. An empty string matches every alert. Nothing is drawn unless `query` or at least one filter is set.",Mue="Narrows the drawn alerts. An alert must match every listed filter, and a filter matches when the alert has any of its values.",Due="Names of the teams owning the monitor, or the SLO for an SLO alert. Names rather than IDs, matching how the Ongoing alerts page filters by owner.",Fue="Group-by dimensions that raised the alert, each formatted as `key:value`. An alert matches when any of its triggering dimensions is listed.",$ue="Priorities the alert was raised at. A monitor alert takes its priority from the monitor, an SLO alert from the SLO alert that fired.",Bue="IDs of the clusters the alert was raised on. Alerts raised on no cluster are always drawn.",lKe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(U$),{description:kue})),query:n.Optional(n.String({description:Lue})),filters:n.Optional(n.Object({team:n.Optional(n.Array(n.String(),{description:Due})),triggeredBy:n.Optional(n.Array(n.String(),{description:Fue})),priority:n.Optional(n.Array(n.Enum(Tn),{description:$ue})),cluster:n.Optional(n.Array(n.String(),{description:Bue}))},{description:Mue}))},{$id:"WidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),dKe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(U$),{maxItems:U$.length,description:kue})),query:n.Optional(l({description:Lue})),filters:n.Optional(n.Object({team:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:50,description:Due})),triggeredBy:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:50,description:Fue})),priority:n.Optional(n.Array(n.Enum(Tn),{maxItems:Tn.length,description:$ue})),cluster:n.Optional(n.Array(l({allowEmpty:!1}),{maxItems:50,description:Bue}))},{description:Mue}))},{$id:"InputWidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),tm=F("type",[aKe,uKe,lKe],{title:"EventsOverlay",description:Rue}),rm=F("type",[cKe,pKe,dKe],{title:"EventsOverlay",description:Rue}),mKe=n.Object({name:n.String({description:"Display name of the table column"}),...sP,source:Ii,normalizer:n.Optional(lr),precision:pt},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),fKe=n.Object({name:l({description:"Display name of the table column"}),...aP,source:Ii,normalizer:n.Optional(dr),precision:pt},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),gKe=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),hKe=n.Array(n.Object({id:l({description:"ID of the column to sort by: `label` for the grouping column, or `col-<index>` with the zero-based position of the entry in `columns`."}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),cP=n.Array(n.Object({id:n.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),uP=n.Array(n.Object({id:l({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Gue=["horizontal","vertical"],yKe=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(oP,{description:"Custom columns to display for each log"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:n.Optional(cP)},{$id:"GraphVisualizationList",title:"List"}),EKe=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:l({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(iP,{description:"Custom columns to display for each log. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),l(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute; an empty string shows an empty header. An entry whose key matches no column has no effect."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(uP)},{$id:"InputGraphVisualizationList",title:"List"}),nP=F("type",[n.Object({type:n.Literal("auto",{description:"Automatically choose this axis bound"})}),n.Object({type:n.Literal("number",{description:"Use a fixed numeric axis bound"}),value:n.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),Hp=n.Object({min:nP,max:nP,scale:F("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),Kp=n.Object({min:nP,max:nP,scale:F("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({minimum:0,description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),jue=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),que=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var SKe=["regular","dashed"],th=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(SKe)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. Each entry is `{groupId, lineStyle}`, where `groupId` is `_q<n>` for query n or `_value` for the formula. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),TKe=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Hp),lineStyleOptions:n.Optional(th),normalizer:n.Optional(lr),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),_Ke=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Kp),lineStyleOptions:n.Optional(th),normalizer:n.Optional(dr),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),IKe=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(oP,{description:"Custom columns to display for each database row"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:n.Optional(cP)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),bKe=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(iP,{description:"Custom columns to display for each database row. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),l(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute; an empty string shows an empty header. An entry whose key matches no column has no effect."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(uP)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),xKe=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),normalizer:n.Optional(lr)},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),OKe=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),AKe=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Qr),normalizer:n.Optional(lr)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),CKe=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Qr),normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),RKe=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Hp),normalizer:n.Optional(lr),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),PKe=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Kp),normalizer:n.Optional(dr),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),UKe=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(lr)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),wKe=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:l({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(l({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),vKe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Gue,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),NKe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:l({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Gue,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),kKe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:n.String({description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(oP,{description:"Custom columns to display for each span"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:n.Optional(cP)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),LKe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:l({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(iP,{description:"Custom columns to display for each span. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),l(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute; an empty string shows an empty header. An entry whose key matches no column has no effect."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(uP)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),MKe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:n.String({description:"Query that selects RUM events for the list"}),listColumns:n.Optional(n.Array(oP,{description:"Custom columns to display for each RUM event. Attributes are read without their stream prefix, e.g. `view.name` rather than `events.view.name`."})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets."})),defaultSorting:n.Optional(cP)},{$id:"GraphVisualizationListRum",title:"ListRum"}),DKe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:l({type:"tsuga-query",description:"Query that selects RUM events for the list. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`) and filter on a single stream per query. A query without stream-prefixed fields searches the `events` stream."}),listColumns:n.Optional(n.Array(iP,{description:"Custom columns to display for each RUM event. Set attributes without their stream prefix, e.g. `view.name` rather than `events.view.name`. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),l(),{description:"Column headers, keyed by the `attribute` of the matching `listColumns` entry. A column without an entry shows its attribute; an empty string shows an empty header. An entry whose key matches no column has no effect."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(uP)},{$id:"InputGraphVisualizationListRum",title:"ListRum"}),zp=n.Array(n.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Yp=n.Array(l({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget. Only the first expression is rendered; later entries are stored and ignored."}),FKe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:zp,aliases:n.Optional(Zd),timeBucket:n.Optional(Ha),normalizer:n.Optional(lr),precision:pt,legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Hp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(th),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),$Ke=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Yp,aliases:n.Optional(Xd),timeBucket:n.Optional(Ha),normalizer:n.Optional(dr),precision:pt,legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Kp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(th),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),BKe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:zp,aliases:n.Optional(Zd),backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(lr)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),GKe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Yp,aliases:n.Optional(Xd),backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),w$=["red","pink","violet","blue","cyan","green","yellow","orange"],pP=n.Enum(w$,{description:"Color palette used to render the heatmap intensity gradient"}),lP=n.Object({from:n.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:n.Enum(w$,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),Hue=Oue({colors:w$,operatorDescription:"Comparator used to evaluate each time bucket value against `value`",valueDescription:"Bound of the section, compared with `operator`",colorDescription:"Color of the time buckets in this section"}),Kue={title:"TimelineSection",description:"Range of values shown as one state, evaluated against the raw value of each time bucket, before the unit is applied."},jKe=n.Object({...Hue,name:n.Optional(n.String({description:"Name of the state, shown in the legend"}))},Kue),qKe=n.Object({...Hue,name:n.Optional(l({allowEmpty:!1,description:"Name of the state, shown in the legend"}))},Kue),HKe=10,zue="Rules that assign each time bucket to a state. Among the sections whose condition the value matches, the one whose `value` is closest to it applies, so `> 5` overrides `> 0` above 5 regardless of order. `not_equal` sections apply only when nothing else matches, and ties go to the earlier section. Buckets that match no section are shown in a neutral color.",KKe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:zp,aliases:n.Optional(Zd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(lP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:pt,normalizer:n.Optional(lr)},{$id:"GraphVisualizationGaugePromql",title:"GaugePromql"}),zKe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:Yp,aliases:n.Optional(Xd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(lP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:pt,normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationGaugePromql",title:"GaugePromql"}),YKe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:zp,aliases:n.Optional(Zd),normalizer:n.Optional(lr),precision:pt,conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),VKe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Yp,aliases:n.Optional(Xd),normalizer:n.Optional(dr),precision:pt,conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),WKe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:zp,aliases:n.Optional(Zd),normalizer:n.Optional(lr),precision:pt,legendMode:n.Optional(Qr)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),QKe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Yp,aliases:n.Optional(Xd),normalizer:n.Optional(dr),precision:pt,legendMode:n.Optional(Qr)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),ZKe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:zp,aliases:n.Optional(Zd),timeBucket:n.Optional(Ha),precision:pt,normalizer:n.Optional(lr),thresholds:ss,legendMode:n.Optional(Qr),yAxisSettings:n.Optional(Hp),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),XKe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Yp,aliases:n.Optional(Xd),timeBucket:n.Optional(Ha),precision:pt,normalizer:n.Optional(dr),thresholds:ss,legendMode:n.Optional(Qr),yAxisSettings:n.Optional(Kp),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),JKe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:zp,precision:pt,normalizer:n.Optional(lr),percentileMarkers:n.Optional(jue)},{$id:"GraphVisualizationDistributionPromql",title:"DistributionPromql"}),eze=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Yp,precision:pt,normalizer:n.Optional(dr),percentileMarkers:n.Optional(que)},{$id:"InputGraphVisualizationDistributionPromql",title:"DistributionPromql"}),tze=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:zp,precision:pt,normalizer:n.Optional(lr),palette:n.Optional(pP),yAxisSettings:n.Optional(Hp)},{$id:"GraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),rze=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Yp,precision:pt,normalizer:n.Optional(dr),palette:n.Optional(pP),yAxisSettings:n.Optional(Kp)},{$id:"InputGraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),nze=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Jd,groupByMode:is,timeBucket:n.Optional(Ha),normalizer:n.Optional(lr),precision:pt,legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Hp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(th),customLink:n.Optional(PT),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),oze=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...em,groupByMode:is,timeBucket:n.Optional(Ha),normalizer:n.Optional(dr),precision:pt,legendMode:n.Optional(Qr),thresholds:ss,yAxisSettings:n.Optional(Kp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(th),customLink:n.Optional(UT),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),Yue="Requests stacked rendering for a top-list widget. Tsuga renders stacked rows only for one count or sum query with exactly two grouped fields, no formula, non-negative values, and a single-cluster context; otherwise the widget renders as a normal top list.",ize=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Jd,groupByMode:is,normalizer:n.Optional(lr),precision:pt,conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Yue})),legendMode:n.Optional(Qr),customLink:n.Optional(PT)},{$id:"GraphVisualizationTopList",title:"TopList"}),sze=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...em,groupByMode:is,normalizer:n.Optional(dr),precision:pt,conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Yue})),legendMode:n.Optional(Qr),customLink:n.Optional(UT)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),Vue=n.Literal("timeline",{description:"Displays each group as a row of time buckets, colored by the section their value falls in"}),aze=n.Object({type:Vue,...Jd,groupByMode:is,timeBucket:n.Optional(Ha),normalizer:n.Optional(lr),precision:pt,sections:n.Array(jKe,{description:zue}),legendMode:n.Optional(Qr)},{$id:"GraphVisualizationTimeline",title:"Timeline"}),cze=n.Object({type:Vue,...em,groupByMode:is,timeBucket:n.Optional(Ha),normalizer:n.Optional(dr),precision:pt,sections:n.Array(qKe,{maxItems:HKe,description:zue}),legendMode:n.Optional(Qr)},{$id:"InputGraphVisualizationTimeline",title:"Timeline"}),uze=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Jd,groupByMode:is,normalizer:n.Optional(lr),precision:pt,legendMode:n.Optional(Qr),customLink:n.Optional(PT)},{$id:"GraphVisualizationPie",title:"Pie"}),pze=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...em,groupByMode:is,normalizer:n.Optional(dr),precision:pt,legendMode:n.Optional(Qr),customLink:n.Optional(UT)},{$id:"InputGraphVisualizationPie",title:"Pie"}),lze=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...sP,backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(lr)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),dze=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...aP,backgroundMode:n.Optional(n.Enum(eh,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(qa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:pt,normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),mze=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Jd,groupByMode:is,timeBucket:n.Optional(Ha),precision:pt,normalizer:n.Optional(lr),thresholds:ss,legendMode:n.Optional(Qr),yAxisSettings:n.Optional(Hp),customLink:n.Optional(PT),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationBar",title:"Bar"}),fze=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...em,groupByMode:is,timeBucket:n.Optional(Ha),precision:pt,normalizer:n.Optional(dr),thresholds:ss,legendMode:n.Optional(Qr),yAxisSettings:n.Optional(Kp),customLink:n.Optional(UT),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Wue='Attribute that switches the count to "Groups" mode: records are grouped by this attribute, the aggregation produces one value per group, and the chart buckets those per-group values. When omitted, individual records are bucketed.',Que=n.String({description:Wue}),Zue=l({description:Wue}),gze=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Jd,group:n.Optional(Que),precision:pt,normalizer:n.Optional(lr),percentileMarkers:n.Optional(jue),boundsScale:n.Optional(CS)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),hze=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...em,group:n.Optional(Zue),precision:pt,normalizer:n.Optional(dr),percentileMarkers:n.Optional(que),boundsScale:n.Optional(CS)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),yze=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Jd,group:n.Optional(Que),precision:pt,normalizer:n.Optional(lr),palette:n.Optional(pP),yAxisSettings:n.Optional(Hp),eventsOverlay:n.Optional(tm)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),Eze=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...em,group:n.Optional(Zue),precision:pt,normalizer:n.Optional(dr),palette:n.Optional(pP),yAxisSettings:n.Optional(Kp),eventsOverlay:n.Optional(rm)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),Sze=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...sP,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(lP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:pt,normalizer:n.Optional(lr)},{$id:"GraphVisualizationGauge",title:"Gauge"}),Tze=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...aP,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied. Defaults to 100 when omitted."})),colorThresholds:n.Optional(n.Array(lP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:pt,normalizer:n.Optional(dr)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),_ze=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(mKe,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(mg),groupByMode:is,defaultSorting:n.Optional(gKe),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."})),customLink:n.Optional(PT)},{$id:"GraphVisualizationTable",title:"Table"}),Ize=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(fKe,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Xc),groupByMode:is,defaultSorting:n.Optional(hKe),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`, counting from 0. Columns without an entry keep their default width."})),customLink:n.Optional(UT)},{$id:"InputGraphVisualizationTable",title:"Table"}),bze=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(gue,{description:"Background color used to render the note"})),noteAlign:n.Optional(Ga),noteJustifyContent:n.Optional(Ga)},{$id:"GraphVisualizationNote",title:"Note"}),xze=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(l({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(gue,{description:"Background color used to render the note"})),noteAlign:n.Optional(Ga),noteJustifyContent:n.Optional(Ga)},{$id:"InputGraphVisualizationNote",title:"Note"}),Xue=n.Object({type:n.Literal("group",{description:"Full-width header that groups the widgets referencing it through `groupId`. Its name is the widget `name`."})},{$id:"GraphVisualizationGroup",title:"Group"}),Jue=["summary","table"],epe="Displays the latest status of SLOs as summary cards with the result count per status, a table of results, or both. Status is not recomputed over the dashboard time range.",tpe="Id of the SLO to display. Omit it to cover every SLO that matches `filters`.",rpe="Narrows the SLOs the widget covers. Omit it, or any of its fields, to apply no filter.",Oze="Restrict results to SLOs owned by any of these team IDs",Aze="Restrict results to SLOs that have at least one of the listed key/value tags",npe="Keep only the results whose status is one of these values. A result is one cluster of an ungrouped SLO, or one group of a grouped SLO.",ope="Keep only the results matching every key filter. A result's values for a key are its group-by value when its SLO groups by that field, and its SLO's tag values for that key. A result matches when one of its values is in `values`, or, with `exclude: true`, when none is; a result with no value for the key only matches an exclusion.",ipe="Group-by field or tag key to filter on, such as `context.team`",spe="Values compared with the result's group-by value and its SLO's tag values for `key`",ape="If true, keep the results with none of these values instead of those with at least one",cpe="Groups the results by SLO, by owning team, or by the value of a tag key or group-by field. Omit it to list results ungrouped. Only the `table` section is grouped, so include `table` in `display`.",upe="Tag key or group-by field to group by, such as `env` or `context.team`. A result falls under each value it has for this key: its group-by value when its SLO groups by this field, and its SLO's tag values for this key. Results with no value for the key are not shown.",ppe="Sections to show: `summary` for the result count per status, `table` for the list of results.",lpe=n.Object({type:n.Literal("slo",{description:"Groups the results by their SLO"})},{$id:"SloWidgetOrganizeBySlo",title:"SLO"}),dpe=n.Object({type:n.Literal("team",{description:"Groups the results by the team owning their SLO"})},{$id:"SloWidgetOrganizeByTeam",title:"Team"}),Cze=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:n.String({description:upe})},{$id:"SloWidgetOrganizeByKey",title:"Key"}),Rze=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:l({allowEmpty:!1,description:upe})},{$id:"InputSloWidgetOrganizeByKey",title:"Key"}),Pze=F("type",[lpe,dpe,Cze],{title:"SloWidgetOrganizeBy",description:cpe}),Uze=F("type",[lpe,dpe,Rze],{title:"SloWidgetOrganizeBy",description:cpe}),wze=n.Object({type:n.Literal("slo",{description:epe}),sloId:n.Optional(n.String({description:tpe})),filters:n.Optional(n.Object({owners:n.Optional(n.Object({values:n.Array(n.String()),exclude:n.Optional(n.Boolean())},{description:Oze})),tags:n.Optional(n.Object({values:Wr,exclude:n.Optional(n.Boolean())},{description:Aze})),statuses:n.Optional(n.Object({values:n.Array(qp),exclude:n.Optional(n.Boolean())},{description:npe})),keys:n.Optional(n.Array(n.Object({key:n.String({description:ipe}),values:n.Array(n.String(),{description:spe}),exclude:n.Optional(n.Boolean({description:ape}))}),{description:ope}))},{description:rpe})),organizeBy:n.Optional(Pze),display:n.Array(n.Enum(Jue),{description:ppe})},{$id:"GraphVisualizationSlo",title:"Slo"}),vze=n.Object({type:n.Literal("slo",{description:epe}),sloId:n.Optional(l({allowEmpty:!1,description:tpe})),filters:n.Optional(n.Object({owners:n.Optional(Yg.properties.owners),tags:n.Optional(Yg.properties.tags),statuses:n.Optional(ye(qp,{description:npe,maxItems:3})),keys:n.Optional(n.Array(n.Object({key:l({allowEmpty:!1,description:ipe}),values:n.Array(l({allowEmpty:!1}),{maxItems:50,description:spe}),exclude:n.Optional(n.Boolean({description:ape}))}),{maxItems:50,description:ope}))},{description:rpe})),organizeBy:n.Optional(Uze),display:n.Array(n.Enum(Jue),{minItems:1,uniqueItems:!0,description:ppe})},{$id:"InputGraphVisualizationSlo",title:"Slo"}),Nze=F("type",[TKe,IKe,xKe,AKe,RKe,UKe,FKe,BKe,KKe,YKe,WKe,ZKe,JKe,tze,nze,ize,aze,uze,lze,Sze,mze,gze,yze,_ze,yKe,bze,Xue,vKe,kKe,MKe,wze],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),mpe=F("type",[_Ke,bKe,OKe,CKe,PKe,wKe,$Ke,GKe,zKe,VKe,QKe,XKe,eze,rze,oze,sze,cze,pze,dze,Tze,fze,hze,Eze,Ize,EKe,xze,Xue,NKe,LKe,DKe,vze],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),v$=n.Object({x:n.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:n.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:n.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:n.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${UJ}\xD7${wJ} (width\xD7height) grid units, except note widgets which can go down to 1\xD71, and group widgets which span the full ${PJ} columns.`}),fpe="ID of the dashboard tab that shows the widget. Widgets without a tab, or whose tab no longer exists, are shown in the first tab.",gpe="ID of the group widget the widget belongs to. The group must be in the same tab, and cannot itself belong to a group.",dP=n.Object({id:n.String({description:"Unique identifier of the graph widget inside the dashboard. Set by the caller when the graph is created; use it to target the graph in later update requests."}),name:n.Optional(n.String({description:"Display name of the graph widget."})),description:n.Optional(n.String({description:"Optional text shown with the graph widget."})),descriptionAlign:n.Optional(Ga),descriptionJustifyContent:n.Optional(Ga),visualization:Nze,layout:n.Optional(v$),tabId:n.Optional(n.String({description:fpe})),groupId:n.Optional(n.String({description:gpe}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),kze=n.Object({id:l({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:n.Optional(l({description:"Display name of the graph widget."})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:n.Optional(Ga),descriptionJustifyContent:n.Optional(Ga),visualization:mpe,layout:n.Optional(v$),tabId:n.Optional(l({description:fpe})),groupId:n.Optional(l({description:gpe}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),N$=n.Object({name:Qe(l(),{description:"Display name of the graph widget. Pass null to remove it."}),description:Qe(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:Qe(Ga,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:Qe(Ga,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(mpe),layout:Qe(v$,{description:"Grid position and size of the widget. Pass null to remove it."})},{title:"GraphPatch",description:"Partial update of a single dashboard widget. Omitted fields keep their current values, and `visualization` and `layout` are replaced as a whole when provided."}),Lze=10,Mze=n.Array(n.Object({key:n.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(n.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),Dze=n.Array(n.Object({key:l({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(l({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:Lze,description:"Dashboard-wide filters applied to every widget on the dashboard."}),hpe="Ordered tabs splitting the dashboard widgets into separate pages. When omitted or empty, the dashboard shows all its widgets on a single page.",Fze=n.Object({id:n.String({description:"Unique identifier of the tab inside the dashboard."}),name:n.String({description:"Display name of the tab."})}),$ze=n.Object({id:l({allowEmpty:!1,description:"Unique identifier of the tab inside the dashboard."}),name:l({allowEmpty:!1,description:"Display name of the tab."})}),Bze=20,rh=n.Object({id:n.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:n.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the dashboard. Set by the caller on create or update and used for dashboard access control."}),graphs:n.Array(dP,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(Mze),tabs:n.Optional(n.Array(Fze,{description:hpe})),createdAt:N({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:N({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(Ce),updater:n.Optional(Ce),tags:Wt,timePreset:n.Optional(n.Enum(mM,{description:"Relative time preset used when opening the dashboard."})),clusterIds:n.Optional(n.Array(n.String(),{description:"Clusters selected when opening the dashboard."})),folderId:n.Optional(n.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),mP=n.Object({name:l({description:"Display name of the dashboard."}),owner:l({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:n.Array(kze,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(Dze),tabs:n.Optional(n.Array($ze,{maxItems:Bze,description:hpe})),tags:nr,timePreset:n.Optional(n.Enum(mM,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),clusterIds:Qe(Wc,{description:"IDs of the clusters to select when opening the dashboard (its default clusters). Optional; omit on update to keep the current clusters, or pass null to clear them."}),folderId:n.Optional(n.Union([n.Null(),l({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),Ms={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},ype=[Ms.OWNER,Ms.TAGS,Ms.WIDGET_COUNT,Ms.UPDATED_AT,Ms.NAME],nm=n.Partial(n.Object({ids:ye(l({allowEmpty:!1}),{description:"Restrict results to dashboards with any of these IDs",maxItems:50}),owners:ye(l({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),widgetQuery:n.Object({value:l({allowEmpty:!1,description:"Substring matched case-insensitively against every text value in the widget queries (filters, aggregate types such as `percentile`, fields, metric names and PromQL), in the group-by fields and in the dashboard-wide filters applied to every widget. Display settings, such as the widget type, legend or units, and note text are not matched. Omit the whole `widgetQuery` filter to skip it."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards with a matching widget or dashboard-wide filter instead of including them"}))},{description:"Text filter for what dashboard widgets query, such as a service, field, metric or function. Returns dashboards with at least one matching widget or dashboard-wide filter; get a returned dashboard by ID to read its widgets."}),tags:ye(sn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.Null(),l({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),Gze=n.Partial(n.Object({...Ie,filters:nm,sort:n.Object({by:n.Enum([Ms.IS_FAVORITE,Ms.OWNER,Ms.TAGS,Ms.WIDGET_COUNT,Ms.UPDATED_AT,Ms.NAME],{description:"Field to sort the returned dashboards by"}),direction:me},{description:"Optional sorting applied to the returned dashboards"})})),k$=n.Object({...n.Omit(rh,["graphs"]).properties,widgetCount:n.Number({description:"Number of widgets on the dashboard."})}),lTr=f({tags:["dashboards"],url:`${ja}/query`,method:"POST",paginated:!0,response:n.Array(k$),body:Gze}),dTr=f({tags:["dashboards"],url:`${ja}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(nm,["tags"]))}),response:Wr}),mTr=f({tags:["dashboards"],url:`${ja}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(nm))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),fTr=f({tags:["dashboards"],url:`${ja}/:id`,method:"GET",params:n.Object({id:l()}),response:rh}),gTr=f({tags:["dashboards"],url:ja,method:"POST",body:mP,response:rh}),hTr=f({tags:["dashboards"],url:`${ja}/:id`,method:"PATCH",params:n.Object({id:l()}),body:n.Partial(mP),response:rh}),jze=_i(nm,{maxIds:100}),yTr=f({tags:["dashboards"],url:`${ja}/bulk-update`,method:"PUT",body:n.Object({selection:jze,owner:n.Optional(l({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:Qe(l({allowEmpty:!1}),{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."})}),response:n.Object({})}),ETr=f({tags:["dashboards"],url:`${ja}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),qze=f({tags:["dashboards"],url:`${ja}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:l({allowEmpty:!1}),graphId:l({allowEmpty:!1})}),body:N$,response:dP}),STr=eZ(qze),Hze=_i(nm),TTr=f({tags:["dashboards"],url:`${ja}/bulk-delete`,method:"DELETE",body:n.Object({selection:Hze}),response:n.Object({})});var nh=`/${"v1"}/dashboards`,fP=n.Pick(rh,["id","name","owner","graphs","filters","tags","timePreset","clusterIds","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),Epe={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",clusterIds:["cluster-123-abc"]};Object.assign(fP,{examples:[Epe]});var Spe=n.Pick(k$,["id","name","owner","widgetCount","filters","tags","timePreset","clusterIds","folderId"],{$id:"DashboardSummary",description:"Dashboard as listed by the dashboard query: its fields without `graphs`, plus the number of widgets. Retrieve the dashboard by ID to read its widgets."});Object.assign(Spe,{examples:[{...IC(Epe,["graphs"]),widgetCount:1}]});var Kze=n.Object({by:n.Enum([...ype],{description:"Field to sort the returned dashboards by: `owner` sorts by owning team ID, `tags` sorts by tag key/value pairs, `widgetCount` sorts by the number of graphs on the dashboard, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by dashboard name."}),direction:me},{description:"Optional sorting applied to the returned dashboards"}),Tpe=n.Object({...We,filters:n.Optional(n.Pick(nm,["owners","searchQuery","widgetQuery","tags","folderId"])),sort:n.Optional(Kze)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),zze={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},widgetQuery:{value:"service:api-gateway"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Tpe,{examples:[zze]});var _pe=f({description:"Lists or searches dashboards by name or ID substring, by what their widgets query (a service, field, metric or function), owning team, tags or folder. Results omit widgets (`graphs`) and give `widgetCount`; get a dashboard by ID to read its widgets. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${nh}/query`,method:"POST",paginated:!0,body:Tpe,response:n.Array(Spe)}),Ipe=f({description:"Retrieves one dashboard by ID, with its widgets (graphs, charts) and their queries.",operationId:"getDashboard",tags:["dashboards"],url:`${nh}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:fP}),L$=n.Pick(mP,["name","owner","graphs","filters","tags","timePreset","clusterIds","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset and default clusters."}),bpe={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",clusterIds:["cluster-123-abc"],folderId:null};Object.assign(L$,{examples:[bpe]});var xpe=n.Object(N$.properties,{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; every body field is optional and omitted fields keep their current values."}),Yze={name:"Request Latency P99",description:"p99 request latency for the API gateway.",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}};Object.assign(xpe,{examples:[Yze]});var Ope=f({description:"Creates a dashboard owned by the specified team, with its widgets (graphs). The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:nh,method:"POST",body:L$,response:fP}),Ape=f({description:"Updates a dashboard by ID, such as its widgets (graphs, charts), filters or folder. Top-level fields are patched and omitted ones keep their values, but a sent array replaces the stored one whole: a `graphs` array missing a widget deletes that widget. Read the dashboard first and send back every widget you keep, or change one widget with the dashboard graph update.",operationId:"updateDashboard",tags:["dashboards"],url:`${nh}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(L$,{examples:[bpe]}),response:fP}),Vze=n.Object({id:l({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),Cpe=f({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${nh}/:id`,method:"DELETE",params:Vze,response:q}),M$=f({description:"Updates one widget (graph, chart) of a dashboard by dashboard ID and graph ID, without resending the dashboard. Sent fields are patched and null clears them; a sent `visualization` or `layout` replaces the stored one whole.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${nh}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:l({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:xpe,response:dP});var Rpe=P("update-graph",{id:gr("DASHBOARD_ID").pipe(Ht("The dashboard that contains the widget")),graphId:gr("GRAPH_ID").pipe(Ht("The widget to update, from the dashboard `graphs[].id`")),file:Np,data:su,generateSkeleton:au},v("cli.dashboards.update-graph")(function*(e){if(e.generateSkeleton){yield*Wo(yield*iu(M$));return}yield*xe(yield*Ze(M$,{params:{id:e.id,graphId:e.graphId},body:yield*eu(e)}))})).pipe(U("Update one widget of a dashboard without resending the dashboard: sent fields are patched, omitted ones keep their values, and null clears a field. A sent `visualization` or `layout` replaces the stored one whole, so send it complete"));var Ppe=De({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:_pe,get:Ipe,create:Ope,update:Ape,delete:Cpe},enableListBody:!0,extraSubcommands:[Rpe]});var Upe="tsuga_in:v1:";var Wze=100,D$=3,oh=n.Object({id:n.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:n.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:n.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:n.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Wr,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:N({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:N({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(Ce),updater:n.Optional(Ce),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),wT=n.Object({name:n.String({format:Ji,minLength:1,maxLength:Wze,description:"Kebab-case name for the ingestion API key."}),owner:l({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:sn,teamOverrideFields:n.Union([n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:D$,description:"Array form."}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this key. Send null to clear existing override fields."})}),ih="/v0/ingestion-api-keys",VTr=f({tags:["ingestion-api-keys"],url:ih,method:"POST",body:wT,response:n.Object({...oh.properties,key:n.String({description:"Full secret value of the ingestion API key. Generated by Tsuga and returned only in this create response; subsequent get and list responses expose only `keyLastCharacters`. Store it immediately, since it cannot be retrieved again after this response."})})}),WTr=f({tags:["ingestion-api-keys"],url:ih,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(oh)}),QTr=f({tags:["ingestion-api-keys"],url:`${ih}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1})}),response:oh}),ZTr=f({tags:["ingestion-api-keys"],url:`${ih}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1})}),body:wT,response:oh}),XTr=f({tags:["ingestion-api-keys"],url:`${ih}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1})}),response:q}),JTr=f({tags:["ingestion-api-keys"],url:`${ih}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var vT=`/${"v1"}/ingestion-api-keys`,NT=n.Pick(oh,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),wpe={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(NT,{examples:[wpe]});var vpe=n.Pick(wT,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest",description:"Ingestion API key creation request. Provide a kebab-case name, owner team, required tags, and required team override fields as an array of fields or null."}),Npe=n.Pick(wT,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest",description:"Ingestion API key update request. Provide the full metadata definition, including name, owner team, tags, and team override fields."}),kpe={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(vpe,{examples:[kpe]});Object.assign(Npe,{examples:[kpe]});var Qze={...wpe,key:`${Upe}abc123xyx7Qm`},Lpe=f({description:"Lists ingestion API keys, the credentials collectors, agents, SDKs and HTTP clients use to send telemetry to Tsuga, with their owners, tags and team override fields.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:vT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(NT)}),a_r=f({description:"Retrieves one ingestion API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${vT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:NT}),Zze=n.Object({...NT.properties,key:n.String({description:"Full Tsuga-generated ingestion API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"IngestionApiKeyCreated",example:Qze}),Mpe=f({description:"Creates an ingestion API key for telemetry intake. Store the returned `key` immediately because Tsuga returns the full secret only in this response.",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:vT,method:"POST",body:vpe,response:Zze}),Dpe=f({description:"Updates ingestion API key metadata by ID, including name, owner, tags, and team override fields. The secret key value is not rotated by this operation.",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${vT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the ingestion API key to update. Use the `id` returned by ingestion API key list, get, or create responses."})}),body:Npe,response:NT}),Fpe=f({description:"Deletes an ingestion API key by ID. Telemetry clients using the deleted key can no longer send data with it.",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${vT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the ingestion API key to delete. Use the `id` returned by ingestion API key list, create, or update responses."})}),response:q});var $pe=De({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:Lpe,create:Mpe,update:Dpe,delete:Fpe}});var Bpe=15,gP={id:n.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:n.Optional(n.String({description:"Optional user-provided processor note."})),tags:Wt,updatedAt:n.Optional(N({description:"Timestamp when Tsuga last updated the processor."}))},hP={id:l({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:n.Optional(l({type:"long",description:"Optional processor note."})),tags:nr,updatedAt:n.Optional(N({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},Gpe={...gP,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},jpe={...hP,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},Xze=F("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),Jze=F("subtype",[n.Object({targetAttribute:l({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:l({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:l({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:l({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:l({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:l({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:l({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:Bpe,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(l({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),qpe=n.Object({...Gpe,params:Xze}),Hpe=n.Object({...jpe,params:Jze}),Kpe={...gP,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},zpe={...hP,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},eYe=F("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),tYe=F("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:l({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:l({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:l({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:l({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),rYe=n.Object({...zpe,params:tYe}),nYe=n.Object({...Kpe,params:eYe}),Ype={...gP,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Vpe={...hP,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Wpe=5,oYe=F("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the IP address to look up"}),targetAttribute:n.String({description:"Target map attribute where geolocation details will be written"}),redactSource:n.Boolean({description:"Whether to replace a public IP address in the source attribute with `[REDACTED_IP]`. Private IP addresses and non-IP values are left unchanged."}),subtype:n.Literal("geo-ip",{description:"Resolves an IP address attribute to geolocation details."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),iYe=F("subtype",[n.Object({attributeName:l({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(l({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(l({type:"long"}),{maxItems:Wpe,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:l({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:l({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:l({allowEmpty:!1,description:"Attribute containing the IP address to look up"}),targetAttribute:l({allowEmpty:!1,description:"Target map attribute where geolocation details will be written"}),redactSource:n.Boolean({description:"Whether to replace a public IP address in the source attribute with `[REDACTED_IP]`. Private IP addresses and non-IP values are left unchanged."}),subtype:n.Literal("geo-ip",{description:"Resolves an IP address attribute to geolocation details."})}),n.Object({sourceAttribute:l({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:l({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:l({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:l({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),Qpe=n.Object({...Ype,params:oYe}),Zpe=n.Object({...Vpe,params:iYe}),sYe=n.Object({...jpe,params:F("subtype",[n.Object({targetAttribute:l({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:l({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),n.Object({targetAttribute:l({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:l({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:l({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:Bpe,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(l({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),Xpe=n.Object({...zpe,params:F("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:l({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:l({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})})])}),aYe=n.Object({...Vpe,params:n.Object({attributeName:l({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(l({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(l({type:"long"}),{maxItems:Wpe,description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),Jpe=F("type",[Xpe,aYe,sYe]),cYe=n.Object({...Gpe,params:F("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),ele=n.Object({...Kpe,params:F("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})})])}),uYe=n.Object({...Ype,params:n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),tle=F("type",[ele,uYe,cYe]),pYe=11,rle=n.Cyclic({OutputProcessor:n.Union([nYe,Qpe,qpe,ole("OutputProcessor","log")])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),nle=n.Cyclic({InputProcessor:n.Union([rYe,Zpe,Hpe,ile("InputProcessor","log")])},"InputProcessor",{description:"Processing step executed sequentially on route logs"}),h_r=n.Cyclic({OutputSpansProcessor:n.Union([ele,Qpe,qpe,ole("OutputSpansProcessor","span")])},"OutputSpansProcessor",{description:"Processing step executed sequentially on route spans"}),y_r=n.Cyclic({InputSpansProcessor:n.Union([Xpe,Zpe,Hpe,ile("InputSpansProcessor","span")])},"InputSpansProcessor",{description:"Processing step executed sequentially on route spans"});function ole(e,t){return n.Object({...gP,params:n.Object({items:n.Array(n.Object({query:n.String({description:`Query that determines whether ${t}s enter this branch`}),processors:n.Array(n.Ref(e),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:`Split processor. It sends each ${t} through the first matching conditional branch.`})})}function ile(e,t){return n.Object({...hP,params:n.Object({items:n.Array(n.Object({query:l({type:"tsuga-query",description:`Query that determines whether ${t}s enter this branch`}),processors:n.Array(n.Ref(e),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:pYe,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:`Split processor. It sends each ${t} through the first matching conditional branch.`})})}var lYe="/v0/logs",Ka=`${lYe}/routes`,uu=n.Object({id:n.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:n.String({description:"Human-readable route name shown in Tsuga."}),description:n.Optional(n.String({description:"Optional free-text note about the route's purpose, set by the caller. This metadata is not evaluated when matching or processing logs."})),isEnabled:n.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:n.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:n.Number({description:"Tsuga-assigned evaluation order, unique across all routes and dense (no gaps). Enabled routes are checked from lower rank to higher rank during ingestion, and every route whose query matches a log applies its processors to it \u2014 matching is not stopped after the first hit. New routes are appended with the highest rank; deleting a route shifts all higher ranks down by one to close the gap. Use `PUT /:id/modify-ranking` to move a route to a different rank, which shifts the routes between its old and new position accordingly."}),tags:Wt,owner:n.String({description:"ID of the team that owns the route. Determines which team members can view and manage it, and which tag policies apply to it. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(rle,{description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."}),creator:n.Optional(Ce),updater:n.Optional(Ce),updatedAt:N({description:"Timestamp when Tsuga last updated the route."}),createdAt:N({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:N({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),kT=n.Object({name:l({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:Qe(l({type:"long"}),{description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."}),isEnabled:n.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:l({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:nr,owner:l({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(nle,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var dYe=["active","inactive"],mYe=["isEnabled","name","query","owner","tags","processors","rank","assetUpdatedAt"],sle=n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to routes owned by any of these team IDs.",maxItems:50}),searchQuery:vo({description:"Search query filter for routes.",valueDescription:"Case-insensitive substring matched against route name and ID."}),status:n.Enum(dYe,{description:"Restrict results to enabled (`active`) or disabled (`inactive`) routes."})}),F$=n.Partial(n.Object({...Ie,filters:n.Partial(sle),sort:n.Object({by:n.Enum(mYe,{description:"Field to sort the returned routes by."}),direction:me})})),$$=n.Object({filters:n.Optional(n.Partial(n.Omit(sle,["status"]),{description:"Filters applied before counting enabled and disabled routes."}))}),B$=n.Object({totalCount:n.Integer({description:"Number of matching routes, whether they are enabled or disabled."}),active:n.Integer({description:"Number of matching routes that are enabled."}),inactive:n.Integer({description:"Number of matching routes that are disabled."})}),A_r=f({tags:["routes"],url:`${Ka}/query`,method:"POST",paginated:!0,body:F$,response:n.Array(uu,{description:"Matching log routes after they are filtered, sorted, and paginated."})}),C_r=f({tags:["routes"],url:`${Ka}/counts/query`,method:"POST",body:$$,response:B$}),R_r=f({tags:["routes"],url:Ka,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(uu)}),P_r=f({tags:["routes"],url:`${Ka}/:id`,params:n.Object({id:l()}),method:"GET",response:uu}),U_r=f({tags:["routes"],url:Ka,method:"POST",body:kT,response:uu}),w_r=f({tags:["routes"],url:`${Ka}/:id`,method:"PUT",body:kT,params:n.Object({id:l()}),response:uu}),v_r=f({tags:["routes"],url:`${Ka}/:id/clone`,method:"POST",params:n.Object({id:l()}),body:kT,response:uu}),N_r=f({tags:["routes"],url:`${Ka}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),k_r=f({description:"Moves a route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique. Affects the route's evaluation order for newly ingested logs; does not change any route's processors or other fields.",tags:["routes"],url:`${Ka}/:id/modify-ranking`,method:"PUT",params:n.Object({id:l()}),body:n.Object({rank:n.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:n.Object({})}),L_r=f({description:"Sets a route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested logs while keeping it saved and its rank unchanged.",tags:["routes"],url:`${Ka}/:id/enable`,method:"PUT",params:n.Object({id:l()}),body:n.Object({enable:n.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:uu});var LT=`/${"v1"}/routes`,ale={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"team-123-abc",processors:[{id:"parse-gateway-message",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]},cle={name:"Normalize Checkout Logs",description:"Maps service fields and extracts key/value details",isEnabled:!0,query:"context.service.name:checkout",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"context.service.name",targetAttribute:"service",keepOrigin:!1,overrideTarget:!0}]}},{id:"parse-logfmt-message",type:"parse-attribute",tags:[],params:{subtype:"key-value",sourceAttribute:"message",targetAttribute:"logfmt",keyValueSplitter:"=",pairsSplitter:" ",acceptStandaloneKey:!1}}]},MT=n.Pick(uu,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Team-owned log processing definition that selects newly ingested logs and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),fYe={id:"123-456-abc",...ale},gYe={id:"456-789-def",...cle};Object.assign(MT,{examples:[fYe,gYe]});var ule=f({description:"Lists log routes: ingest pipelines of log processors that parse (Grok, key-value, URL, user agent, GeoIP), map and enrich incoming logs, in evaluation order, earlier routes first.",operationId:"listRoutes",tags:["routes"],url:LT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(MT)}),ple=f({description:"Retrieves one log route by ID.",operationId:"getRoute",tags:["routes"],url:`${LT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:MT}),G$=n.Pick(kT,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(G$,{examples:[ale,cle]});var lle=f({description:"Creates a log route, an ingest pipeline that parses, maps and enriches incoming logs, at the end of the evaluation order. It applies only to logs ingested after the cluster receives the updated configuration. Test Grok rules before saving with the Grok parse endpoint.",operationId:"createRoute",tags:["routes"],url:LT,method:"POST",body:G$,response:MT}),dle=f({description:"Updates an existing log route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${LT}/:id`,method:"PUT",body:G$,params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:MT}),mle=f({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${LT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:q});var fle=De({commandName:"log-routes",description:"Manage log routes",endpoints:{list:ule,get:ple,create:lle,update:dle,delete:mle}});var pu="/v0/metrics/routes",Vp=n.Object({id:n.String({description:"Tsuga-generated metrics route ID assigned when the route is created."}),name:n.String({description:"Human-readable metrics route name shown in Tsuga."}),description:n.Optional(n.String({description:"Optional free-text note about the metrics route's purpose, set by the caller. This metadata is not evaluated when matching or processing metrics."})),isEnabled:n.Boolean({description:"Whether this route is active for newly ingested metrics. Disabled routes remain saved but do not process metrics."}),metricNameRegex:n.String({description:"Regex matched against metric names to decide which metrics enter the route processor chain. Supported syntax is the Rust regex subset used for metric names: literals, `.`, character classes like `[a-z]`, escaped classes like `\\d`, `\\w`, `\\s`, anchors, groups, alternation, and repetitions like `*`, `+`, `?`, `{2}`, `{2,5}`. Escape regex metacharacters (`\\ . + * ? ( ) | [ ] { } ^ $`) to match them literally. Inline flags, look-around, backreferences, atomic groups, and possessive quantifiers are rejected."}),rank:n.Number({description:"Tsuga-assigned evaluation order, unique across all metrics routes and dense (no gaps)."}),tags:Wt,owner:n.String({description:"ID of the team that owns the metrics route. Determines which team members can view and manage it. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(tle,{description:"Processors applied in array order to metrics that match the route, each transforming the output of the previous one."}),creator:n.Optional(Ce),updater:n.Optional(Ce),updatedAt:N({description:"Timestamp when Tsuga last updated the metrics route."}),createdAt:N({description:"Timestamp when Tsuga created the metrics route."}),assetUpdatedAt:N({description:"Timestamp when Tsuga last changed metrics route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"MetricRoute"}),yP=n.Object({name:l({allowEmpty:!1,description:"Human-readable metrics route name shown in Tsuga."}),description:Qe(l({type:"long"}),{description:"Optional free-text note about the metrics route's purpose. This metadata is not evaluated when matching or processing metrics."}),isEnabled:n.Boolean({description:"Set to true for the route to process newly ingested matching metrics. Set to false to save it without running it."}),metricNameRegex:l({allowEmpty:!1,description:"Regex matched against metric names to decide which metrics enter the route processor chain. Supported syntax is the Rust regex subset used for metric names: literals, `.`, character classes like `[a-z]`, escaped classes like `\\d`, `\\w`, `\\s`, anchors, groups, alternation, and repetitions like `*`, `+`, `?`, `{2}`, `{2,5}`. Escape regex metacharacters (`\\ . + * ? ( ) | [ ] { } ^ $`) to match them literally. Inline flags, look-around, backreferences, atomic groups, and possessive quantifiers are rejected."}),tags:nr,owner:l({allowEmpty:!1,description:"ID of the team that will own the metrics route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(Jpe,{maxItems:50,description:"Processors applied in array order to metrics that match the route, each transforming the output of the previous one. Supported processors are create format-string, create category, map attributes, and parse grok."})}),tIr=f({tags:["metric-routes"],url:`${pu}/query`,method:"POST",paginated:!0,body:F$,response:n.Array(Vp,{description:"Matching metrics routes after they are filtered, sorted, and paginated."})}),rIr=f({tags:["metric-routes"],url:`${pu}/counts/query`,method:"POST",body:$$,response:B$}),nIr=f({tags:["metric-routes"],url:pu,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(Vp)}),oIr=f({tags:["metric-routes"],url:`${pu}/:id`,params:n.Object({id:l()}),method:"GET",response:Vp}),iIr=f({tags:["metric-routes"],url:pu,method:"POST",body:yP,response:Vp}),sIr=f({tags:["metric-routes"],url:`${pu}/:id`,method:"PUT",body:yP,params:n.Object({id:l()}),response:Vp}),aIr=f({tags:["metric-routes"],url:`${pu}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),cIr=f({description:"Moves a metrics route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique.",tags:["metric-routes"],url:`${pu}/:id/modify-ranking`,method:"PUT",params:n.Object({id:l()}),body:n.Object({rank:n.Integer({minimum:1,description:"Target rank for the metrics route, from 1 to the total number of metrics routes. Requests outside that range are rejected."})}),response:n.Object({})}),uIr=f({description:"Sets a metrics route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested metrics while keeping it saved and its rank unchanged.",tags:["metric-routes"],url:`${pu}/:id/enable`,method:"PUT",params:n.Object({id:l()}),body:n.Object({enable:n.Boolean({description:"Set to true to enable the metrics route, or false to disable it."})}),response:Vp});var DT=`/${"v1"}/metrics/routes`,FT=n.Pick(Vp,["id","name","description","isEnabled","metricNameRegex","tags","owner","processors"],{$id:"MetricRoute",description:"Team-owned metrics processing definition that selects newly ingested metrics by name and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),hYe={id:"123-456-abc",name:"Normalize HTTP Server Metrics",description:"Maps legacy attribute names onto the OpenTelemetry conventions",isEnabled:!0,metricNameRegex:"^http\\.server\\..*$",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"svc",targetAttribute:"service.name",keepOrigin:!1,overrideTarget:!0}]}}]};Object.assign(FT,{examples:[hYe]});var gle=f({description:"Lists metric routes: ingest pipelines that rename, parse or create attributes on incoming metrics, in evaluation order, earlier routes first.",operationId:"listMetricRoutes",tags:["metric-routes"],url:DT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(FT)}),hle=f({description:"Retrieves one metric route by ID.",operationId:"getMetricRoute",tags:["metric-routes"],url:`${DT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the metric route to retrieve. Use the `id` returned by metric route list or create responses."})}),response:FT}),j$=n.Pick(yP,["name","description","isEnabled","metricNameRegex","tags","owner","processors"],{description:"Metrics route create or update request. Provide the route metadata, metric name regex, owner team, enabled state, tags, and ordered processors."}),yYe={name:"Normalize HTTP Server Metrics",description:"Maps legacy attribute names onto the OpenTelemetry conventions",isEnabled:!0,metricNameRegex:"^http\\.server\\..*$",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"svc",targetAttribute:"service.name",keepOrigin:!1,overrideTarget:!0}]}}]};Object.assign(j$,{examples:[yYe]});var yle=f({description:"Creates a metric route, an ingest pipeline that renames, parses or creates attributes on incoming metrics, at the end of the evaluation order. It applies only to metrics ingested after the cluster receives the updated configuration.",operationId:"createMetricRoute",tags:["metric-routes"],url:DT,method:"POST",body:j$,response:FT}),Ele=f({description:"Updates an existing metric route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Metric routes affect only newly ingested metrics after the cluster receives the updated configuration.",operationId:"updateMetricRoute",tags:["metric-routes"],url:`${DT}/:id`,method:"PUT",body:j$,params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the metric route to update. Use the `id` returned by metric route list, get, or create responses."})}),response:FT}),Sle=f({description:"Deletes a metric route by ID and compacts the evaluation order for remaining routes. The route stops processing future metrics after the cluster receives the updated configuration.",operationId:"deleteMetricRoute",tags:["metric-routes"],url:`${DT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the metric route to delete. Use the `id` returned by metric route list, create, or update responses."})}),response:q});var Tle=De({commandName:"metric-routes",description:"Manage metric routes",endpoints:{list:gle,get:hle,create:yle,update:Ele,delete:Sle}});var sh="/v0/monitor-folders",ah=n.Object({id:n.String({description:"Tsuga-generated monitor folder ID assigned when the folder is created. Use it as monitor `folderId` or child-folder `parentFolderId`."}),name:n.String({description:"Display name of the monitor folder. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the monitor folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:n.Optional(n.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:Wt,creator:n.Optional(Ce),updater:n.Optional(Ce),createdAt:N({description:"Timestamp when Tsuga created the monitor folder."}),updatedAt:N({description:"Timestamp when Tsuga last updated the monitor folder."})},{title:"MonitorFolder"}),q$=n.Object({...ah.properties,monitorCount:n.Number({description:"Number of monitors in this folder and its readable subfolders that the caller can read. Returned only by folder list responses; callers without monitor read access see 0."}),folderCount:n.Number({description:"Number of folders nested directly under this folder that the caller can read."})}),EP=n.Object({name:l({allowEmpty:!1,description:"Display name of the monitor folder."}),owner:l({allowEmpty:!1,description:"ID of the team that owns the monitor folder and controls folder access."}),parentFolderId:n.Optional(n.Union([n.Null(),l({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:nr}),SP=n.Partial(n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to monitor folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:l({allowEmpty:!1,description:"Substring matched case-insensitively against monitor folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitor folders matching this value instead of including them"}))},{description:"Text filter for monitor folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:ye(sn.items,{description:"Restrict results to monitor folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:n.Union([n.Null(),l({allowEmpty:!1})],{description:"Parent folder filter for monitor folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned monitor folders"})),$T={OWNER:"owner",TAGS:"tags",MONITOR_COUNT:"monitorCount",UPDATED_AT:"updatedAt",NAME:"name"},H$=[$T.OWNER,$T.TAGS,$T.MONITOR_COUNT,$T.UPDATED_AT,$T.NAME],EYe=n.Partial(n.Object({...Ie,filters:SP,sort:n.Object({by:n.Enum(H$,{description:"Field to sort the returned monitor folders by"}),direction:me},{description:"Optional sorting applied to the returned monitor folders"})})),CIr=f({tags:["monitor-folders"],url:`${sh}/query`,method:"POST",paginated:!0,body:EYe,response:n.Array(q$)}),RIr=f({tags:["monitor-folders"],url:`${sh}/:id`,method:"GET",params:n.Object({id:l()}),response:ah}),PIr=f({tags:["monitor-folders"],url:sh,method:"POST",body:EP,response:ah}),UIr=f({tags:["monitor-folders"],url:`${sh}/:id`,method:"PUT",params:n.Object({id:l()}),body:EP,response:ah}),wIr=f({tags:["monitor-folders"],url:`${sh}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),vIr=f({tags:["monitor-folders"],url:`${sh}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(SP,["tags"]))}),response:Wr});var BT=`/${"v1"}/monitor-folders`,TP=n.Pick(ah,["id","name","owner","parentFolderId","tags"],{$id:"MonitorFolder",description:"Folder used to organize monitors into a two-level hierarchy"}),_le={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(TP,{examples:[_le]});var Ile=n.Pick(q$,["id","name","owner","parentFolderId","tags","monitorCount"],{$id:"MonitorFolderWithMonitorCount",description:"Folder used to organize monitors into a two-level hierarchy, including the number of readable monitors in it and its readable subfolders."}),SYe={..._le,monitorCount:10};Object.assign(Ile,{examples:[SYe]});var K$=n.Pick(EP,["name","owner","parentFolderId","tags"],{description:"Monitor folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),TYe={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(K$,{examples:[TYe]});var _Ye=n.Object({by:n.Enum(H$,{description:"Field to sort the returned monitor folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `monitorCount` sorts by the number of readable monitors in the folder and its readable subfolders, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:me},{description:"Optional sorting applied to the returned monitor folders"}),ble=n.Object({...We,filters:n.Optional(n.Pick(SP,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(_Ye)},{description:"Monitor folder query request. Use filters, sorting, limit, and offset to page through visible monitor folders."}),IYe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(ble,{examples:[IYe]});var xle=f({description:"Lists or searches monitor folders by owning team, name or ID substring, tags or parent folder, with the number of readable monitors in each folder and its readable subfolders. Returns every folder unless `parentFolderId` is set: a folder ID selects its children, null only top-level folders. Most recently updated first unless `sort` is set.",operationId:"queryMonitorFolders",tags:["monitor-folders"],url:`${BT}/query`,method:"POST",paginated:!0,body:ble,response:n.Array(Ile)}),Ole=f({description:"Retrieves one monitor folder by ID.",operationId:"getMonitorFolder",tags:["monitor-folders"],url:`${BT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the monitor folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:TP}),Ale=f({description:"Creates a monitor folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createMonitorFolder",tags:["monitor-folders"],url:BT,method:"POST",body:K$,response:TP}),Cle=f({description:"Updates an existing monitor folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateMonitorFolder",tags:["monitor-folders"],url:`${BT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the monitor folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:K$,response:TP}),Rle=f({description:"Deletes an empty monitor folder by ID. The request fails if the folder still contains monitors or child folders; monitors and child folders are not moved or deleted automatically.",operationId:"deleteMonitorFolder",tags:["monitor-folders"],url:`${BT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the monitor folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:q});var Ple=De({commandName:"monitor-folders",description:"Manage monitor folders",endpoints:{list:xle,get:Ole,create:Ale,update:Cle,delete:Rle},enableListBody:!0});var GT=`/${"v1"}/monitors`,ch=n.Pick(jp,["id","name","message","tags","configuration","priority","owner","dashboardId","folderId","pauseUntil","permissions","clusterIds"],{$id:"Monitor",description:"Saved alert definition that evaluates telemetry and creates alert transitions. Notification delivery is configured separately with notification rules. See [Monitors](/documentation/alert/monitors/index)."}),QIr=n.Object({...ch.properties,configuration:t$},{description:"Saved alert definition that evaluates telemetry and creates alert transitions, restricted to the kinds that raise ongoing alerts. Same shape as `Monitor` without the `log-error-pattern` configuration. See [Monitors](/documentation/alert/monitors/index)."}),wle={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,consecutiveWindows:1,groupByFields:[],aggregationAlertLogic:"no_aggregation",queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"team-123-abc",dashboardId:"789-abc-def",folderId:"folder-123-abc",permissions:"all",clusterIds:[]},vle={name:"High CPU Utilization By Service",message:"More than half of grouped services have been above the CPU threshold for 2 consecutive 10-minute windows.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,consecutiveWindows:2,groupByFields:[{fields:["context.service.name"],limit:10}],aggregationAlertLogic:"proportion",proportionAlertThreshold:50,queries:[{aggregate:{type:"average",field:"system.cpu.utilization"},filter:"context.service.name:checkout"}],conditions:[{formula:"q1",operator:"greater_than",threshold:.8}],noDataBehavior:"keep_last_status"},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",folderId:"folder-123-abc",permissions:"all",clusterIds:[]},Nle={name:"Certificate Expiry Warning",message:"A certificate is approaching expiry.",tags:[{key:"environment",value:"production"}],configuration:{type:"certificate-expiry",warnBeforeInDays:30,cloudAccounts:["aws-prod"],aggregationAlertLogic:"each",noDataBehavior:"resolve"},priority:3,owner:"team-123-abc",dashboardId:"789-abc-def",folderId:"folder-123-abc",permissions:"all",clusterIds:[]},kle={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",folderId:"folder-123-abc",permissions:"all",clusterIds:[]},Lle={name:"Error Pattern Increase Detector",message:"An existing error pattern is spiking.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern-increase",aggregationAlertLogic:"each",noDataBehavior:"resolve",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",folderId:"folder-123-abc",permissions:"all",clusterIds:[]},Mle={name:"Faulty Deployment Detector",message:"A workload keeps failing after its last rollout.",tags:[{key:"team",value:"platform"}],configuration:{type:"k8s-faulty-deployment",aggregationAlertLogic:"each",filter:{clusterNames:["prod-eu-west-1"],namespaces:["checkout"],envs:["production"],workloadTypes:["replicaSet","statefulSet"]}},priority:2,owner:"team-123-abc",permissions:"all",clusterIds:[]},Dle={name:"Service Faulty Deployment Detector",message:"A newly deployed service version is faulty.",tags:[{key:"team",value:"platform"}],configuration:{type:"faulty-deployment",aggregationAlertLogic:"each",filter:{services:["checkout-api"],envs:["production"]}},priority:2,owner:"team-123-abc",permissions:"all",clusterIds:[]},bYe={id:"123-456-abc",...wle},xYe={id:"234-567-bcd",...vle},OYe={id:"345-678-cde",...Nle},AYe={id:"456-789-def",...kle},CYe={id:"567-890-efa",...Lle},RYe={id:"678-901-fab",...Mle},PYe={id:"789-012-abc",...Dle};Object.assign(ch,{examples:[bYe,xYe,OYe,AYe,CYe,RYe,PYe]});var Ule=n.Pick(n$,["filters","sort","limit","offset"]),Fle=n.Object({...Ule.properties,...We,filters:n.Optional(n.Object({...Ule.properties.filters.properties,activity:n.Optional(n.Enum(qR,{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}))},{description:"Filters applied to narrow the returned monitors"}))},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),UYe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Fle,{examples:[UYe]});var $le=f({description:"Lists or searches monitors (alerts, alert rules) by name, ID or query text, owner team, tag, priority, type, activity (active or snoozed), cluster or folder. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${GT}/query`,method:"POST",paginated:!0,body:Fle,response:n.Array(ch)}),Ble=f({description:"Retrieves one monitor (alert rule) definition by ID.",operationId:"getMonitor",tags:["monitors"],url:`${GT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:ch}),Gle=["name","message","tags","configuration","priority","owner","dashboardId","folderId","pauseUntil","permissions","clusterIds"],jle=n.Pick(hT,Gle,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),qle=n.Pick(hT,Gle,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, `clusterIds`, `pauseUntil`, and `folderId` keep their existing values. Omitted `dashboardId` keeps the dashboard link; send `null` to clear it."}),Hle=wle,Kle=vle,zle=Nle,Yle=kle,Vle=Lle,Wle=Mle,Qle=Dle;Object.assign(jle,{examples:[Hle,Kle,zle,Yle,Vle,Wle,Qle]});Object.assign(qle,{examples:[Hle,Kle,zle,Yle,Vle,Wle,Qle]});var Zle=f({description:"Creates a monitor (alert, alert rule) owned by the specified team, on logs, metrics, traces, anomalies, certificate expiry, new or increasing error patterns, or faulty Kubernetes or service deployments. Notification rules decide where its alerts are sent.",operationId:"createMonitor",tags:["monitors"],url:GT,method:"POST",body:jle,response:ch}),Xle=f({description:"Updates a monitor (alert) by ID, such as its query, thresholds or snooze (`pauseUntil`, which pauses evaluation). Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, `clusterIds`, `pauseUntil`, and `folderId` keep their existing values. Omitted `dashboardId` keeps the dashboard link; send `null` to clear it.",operationId:"updateMonitor",tags:["monitors"],url:`${GT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:qle,response:ch}),wYe=n.Object({id:l({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),Jle=f({description:"Deletes a monitor (alert) by ID: it stops evaluating and alerting.",operationId:"deleteMonitor",tags:["monitors"],url:`${GT}/:id`,method:"DELETE",params:wYe,response:q});var ede=De({commandName:"monitors",description:"Manage monitors",endpoints:{list:$le,get:Ble,create:Zle,update:Xle,delete:Jle},enableListBody:!0});var jT=`/${"v1"}/notification-integrations`,qT=n.Pick(ST,["id","name","owner","setting","tags"],{$id:"NotificationIntegration",description:"A reusable external destination that notification rules can send to. See [Integrations](/documentation/alert/notifications/index#integrations). Slack integrations are OAuth-based and are not readable, creatable, or editable through this API; connect Slack from the app."}),vYe={id:"456-def-abc",name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKeyLastChars:"ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(qT,{examples:[vYe]});var tde=f({description:"Lists notification destinations (integrations, contact points) such as PagerDuty, incident.io, Grafana IRM, Squadcast, ServiceNow, Jira, Microsoft Teams, Google Chat or webhooks. Slack integrations do not appear here because they are OAuth-based.",operationId:"listNotificationIntegrations",tags:["public","notification-integrations"],url:jT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(qT)}),rde=f({description:"Retrieves one non-OAuth notification integration by ID.",operationId:"getNotificationIntegration",tags:["notification-integrations"],url:`${jT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification integration to retrieve. Use the `id` returned by notification integration list or create responses."})}),response:qT}),nde=n.Pick(c$,["name","owner","setting","tags"],{description:"Notification integration create request containing the display name, owning team, destination setting, and tags. `setting.type` cannot be `slack`; add Slack integrations from the app instead."}),NYe={name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKey:"abcdef1234567890ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(nde,{examples:[NYe]});var ode=f({description:"Creates a non-OAuth notification destination, such as PagerDuty or a webhook, that notification rules can target. Slack is connected through OAuth in the app instead.",operationId:"createNotificationIntegration",tags:["notification-integrations"],url:jT,method:"POST",body:nde,response:qT}),ide=n.Pick(u$,["name","owner","setting","tags"],{description:"Notification integration update request. `owner` has to be sent on every update; the other omitted fields keep their existing values."}),kYe={name:"Primary on-call",owner:"team-123-abc"};Object.assign(ide,{examples:[kYe]});var sde=f({description:"Updates an existing non-OAuth notification integration by ID. `owner` has to be sent on every update, even when it does not change. The submitted `setting` is overwritten in full; the other omitted fields keep their existing values.",operationId:"updateNotificationIntegration",tags:["notification-integrations"],url:`${jT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification integration to update. Use the `id` returned by notification integration list, get, or create responses."})}),body:ide,response:qT}),ade=f({description:"Deletes a non-OAuth notification integration by ID. Deletion is blocked while a notification rule still targets the integration; remove it from those rules first.",operationId:"deleteNotificationIntegration",tags:["notification-integrations"],url:`${jT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification integration to delete. Use the `id` returned by notification integration list, get, or create responses."})}),response:q});var cde=De({commandName:"notification-integrations",description:"Manage notification integrations",endpoints:{list:tde,get:rde,create:ode,update:sde,delete:ade}});var HT=`/${"v1"}/notification-rules`,KT=n.Pick(Yd,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),ude={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}]},LYe={id:"123-456-abc",...ude};Object.assign(KT,{examples:[LYe]});var pde=f({description:"Lists notification rules (alert routing): which alerts, matched by query, team, priority, transition or cluster, are sent to which destinations, such as Slack, PagerDuty, email or webhooks. Adaptive notification rules, which page service owners, have their own endpoint.",operationId:"listNotificationRules",tags:["notification-rules"],url:HT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(KT)}),lde=f({description:"Retrieves one notification rule by ID.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${HT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:KT}),z$=n.Pick(ET,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),MYe=ude;Object.assign(z$,{examples:[MYe]});var dde=f({description:"Creates a notification rule that sends matching alert transitions to destinations such as Slack, PagerDuty, email or webhooks. Monitors evaluate independently of notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:HT,method:"POST",body:z$,response:KT}),mde=f({description:"Updates an existing notification rule by ID. Required fields and the submitted target list are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${HT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:z$,response:KT}),DYe=n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),fde=f({description:"Deletes a notification rule by ID. Alerting monitors continue to evaluate, but this rule no longer sends notifications.",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${HT}/:id`,method:"DELETE",params:DYe,response:q});var gde=De({commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:pde,get:lde,create:dde,update:mde,delete:fde}});var Wp=`${zd}/silences`,FYe=["active","inactive"],yde=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),$Ye=n.Partial(n.Record(yde,n.Array(n.Object({startTime:n.String({format:QL,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({format:QL,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),BYe=n.Partial(n.Record(yde,n.Array(n.Object({startTime:n.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),_P='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Ede="One-time silence schedule with specific start and end times",Sde="Recurring weekly silence schedule",GYe=F("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({format:ZL,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({format:ZL,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:n.Optional(n.String({format:ld,description:_P}))},{$id:"InputSilenceScheduleOneTime",description:Ede}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:$Ye,timeZone:n.Optional(n.String({format:ld,description:_P}))},{$id:"InputSilenceScheduleRecurring",description:Sde})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),jYe=F("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future when created or updated."}),timeZone:n.Optional(n.String({description:_P}))},{$id:"OutputSilenceScheduleOneTime",description:Ede}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:BYe,timeZone:n.Optional(n.String({description:_P}))},{$id:"OutputSilenceScheduleRecurring",description:Sde})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),qYe="monitor_id",Tde=`Query on the alerting monitor tags and group-by dimensions, e.g. \`env:prod AND service:bridge\`. The monitor itself can be targeted with \`${qYe}:<monitor id>\`.`,IP=n.Object({name:l({description:"Display name of the silence"}),reason:l({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:l({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:nr,isActive:n.Boolean({description:"Set to true for the silence to suppress matching notifications while its schedule is active. Set to false to keep the silence without suppressing anything."}),schedule:GYe,notificationRuleIds:Qe(n.Array(l()),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Mutually exclusive with `prioritiesFilter`, `transitionTypesFilter`, and `queryString`: a request combining this field with any of those is rejected."}),queryString:Qe(l({type:"tags-query"}),{description:Tde}),teamsFilter:s$,prioritiesFilter:n.Array(n.Enum(Tn),{maxItems:Tn.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(Kd),{maxItems:Kd.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),om=n.Object({id:n.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:Wt,isActive:n.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:jYe,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Set only when `prioritiesFilter`, `transitionTypesFilter`, and `queryString` are not used to filter alerts."})),queryString:n.Optional(n.String({description:Tde})),teamsFilter:i$,prioritiesFilter:n.Array(n.Enum(Tn),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(Kd),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:N(),updatedAt:N(),creator:n.Optional(Ce),updater:n.Optional(Ce)}),hde=["one-time","recurring"];var HYe=["name","isActive","schedule","owner","tags","updatedAt"],_de=n.Object({owners:ye(l({allowEmpty:!1}),{description:"Restrict results to silences owned by any of these team IDs.",maxItems:50}),searchQuery:vo({description:"Search query filter for notification silences.",valueDescription:"Case-insensitive substring matched against silence name and ID."}),tags:ye(sn.items,{description:"Restrict results to silences that have at least one of the listed key/value tags.",maxItems:50}),scheduleTypes:ye(n.Enum(hde),{description:"Restrict results to silences with these schedule types.",maxItems:hde.length}),status:n.Enum(FYe,{description:"Restrict results to effectively active or inactive silences."})}),KYe=n.Partial(n.Object({...Ie,filters:n.Partial(_de),sort:n.Object({by:n.Enum(HYe,{description:"Field to sort the returned notification silences by."}),direction:me})})),zYe=n.Object({tags:Wr,activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching silences regardless of whether they are active."}),active:n.Integer({description:"Number of matching silences that are active, meaning enabled with a schedule that has not expired."}),inactive:n.Integer({description:"Number of matching silences that are disabled or whose schedule has expired."})})}),YYe=n.Object({filters:n.Optional(n.Partial(_de,{description:"Filters applied before collecting tag and active-count options."}))}),kbr=f({tags:["notification-silences"],url:`${Wp}/query`,method:"POST",paginated:!0,body:KYe,response:n.Array(om,{description:"Matching notification silences after they are filtered, sorted, and paginated."})}),Lbr=f({tags:["notification-silences"],url:`${Wp}/options/query`,method:"POST",body:YYe,response:zYe}),Mbr=f({tags:["notification-silences"],url:Wp,method:"GET",response:n.Array(om)}),Dbr=f({tags:["notification-silences"],url:`${Wp}/:id`,params:n.Object({id:l()}),method:"GET",response:om}),Fbr=f({tags:["notification-silences"],url:Wp,method:"POST",body:IP,response:om}),$br=f({tags:["notification-silences"],url:`${Wp}/:id`,method:"PUT",params:n.Object({id:l()}),body:IP,response:om}),Bbr=f({tags:["notification-silences"],url:`${Wp}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),Gbr=f({tags:["notification-silences"],url:`${Wp}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l(),{uniqueItems:!0})}),response:n.Object({})});var zT=`/${"v1"}/notification-silences`,YT=n.Pick(om,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Scheduled mute rule that suppresses matching notification delivery while monitors continue evaluating. See [Silences](/documentation/alert/notifications/silences)."}),VYe={id:"sil-weekend-maintenance",name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},WYe={id:"sil-critical-routing",name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(YT,{examples:[VYe,WYe]});var Ide=f({description:"Lists notification silences: muted alerts and maintenance windows, one-time or recurring weekly, matched by query, team, priority, transition or notification rule.",operationId:"listNotificationSilences",tags:["notification-silences"],url:zT,method:"GET",response:n.Array(YT)}),bde=f({description:"Retrieves one notification silence by ID.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${zT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:YT}),Y$=n.Pick(IP,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{description:"Notification silence create or update request. Provide the mute reason, owner, schedule, filters, active state, and tags."}),QYe={name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},ZYe={name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(Y$,{examples:[QYe,ZYe]});var xde=f({description:"Creates a notification silence to mute alerts, for example during a maintenance window. Matching notifications not yet sent are suppressed while the schedule is active, including queued ones; monitors keep evaluating, so alerts still transition and show in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:zT,method:"POST",body:Y$,response:YT}),Ode=f({description:"Updates an existing notification silence by ID. Required fields are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${zT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Y$,response:YT}),XYe=n.Object({id:l({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),Ade=f({description:"Deletes a notification silence. Any notification not yet sent is re-evaluated against the remaining silences and, if none match, is delivered normally; notifications already marked as silenced are not resent.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${zT}/:id`,method:"DELETE",params:XYe,response:q});var Cde=De({commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Ide,get:bde,create:xde,update:Ode,delete:Ade}});var JYe="tsuga_rum:v1:";var eVe=100,Rde=["web","ios","android"],Pde="Whether intake records the IP address each request comes from as `client.address` on RUM records, and derives the `geo` location from it.",Ude="Kind of application the token is issued for. Only `web` telemetry is checked against `allowedUrlPrefixes`, since mobile applications do not send an `Origin` header.",uh=n.Object({id:n.String({description:"Tsuga-generated RUM public token ID assigned when the token is created."}),name:n.String({description:"Human-readable token name. Names must be kebab-case when creating or updating tokens."}),token:n.String({description:`Full token value, prefixed with \`${JYe}\`, to configure in the RUM browser or mobile SDK. RUM tokens are public by design, so the value is not masked on subsequent reads and never changes after creation.`}),owner:n.String({description:"Team ID that owns and manages the RUM public token."}),applicationType:n.Enum(Rde,{description:Ude}),allowedUrlPrefixes:n.Array(n.String(),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. Always empty for `ios` and `android` applications."}),collectClientIp:n.Boolean({description:Pde}),tags:Wr,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this token."})),updatedAt:N({description:"Timestamp when the token metadata was last updated."}),createdAt:N({description:"Timestamp when the token was created."}),creator:n.Optional(Ce),updater:n.Optional(Ce),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),VT=n.Object({name:n.String({format:Ji,minLength:1,maxLength:eVe,description:"Kebab-case name for the RUM public token."}),owner:l({allowEmpty:!1,description:"Team ID that will own and manage the RUM public token."}),applicationType:n.Enum(Rde,{description:`${Ude} Fixed at creation: an update must resend the token's current value.`}),allowedUrlPrefixes:n.Array(n.String({format:X7}),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. At least one prefix is required for `web` applications, and the array must be empty for `ios` and `android` applications."}),collectClientIp:n.Optional(n.Boolean({description:`${Pde} Defaults to false on creation. Omit it on update to keep the current value.`})),tags:sn,teamOverrideFields:n.Union([n.Array(l({allowEmpty:!1}),{minItems:1,maxItems:D$,description:"Array form."}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this token. Send null to clear existing override fields."})}),ph="/v0/rum-public-tokens",axr=f({tags:["rum-public-tokens"],url:ph,method:"POST",body:VT,response:uh}),cxr=f({tags:["rum-public-tokens"],url:ph,method:"GET",paginated:!0,query:n.Object(Ie),response:n.Array(uh)}),uxr=f({tags:["rum-public-tokens"],url:`${ph}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1})}),response:uh}),pxr=f({tags:["rum-public-tokens"],url:`${ph}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1})}),body:VT,response:uh}),lxr=f({tags:["rum-public-tokens"],url:`${ph}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1})}),response:q}),dxr=f({tags:["rum-public-tokens"],url:`${ph}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(l({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var WT=`/${"v1"}/public-tokens`,QT=n.Pick(uh,["id","name","token","owner","applicationType","allowedUrlPrefixes","collectClientIp","tags","teamOverrideFields"],{$id:"PublicToken",description:"Public token used by the RUM browser and mobile SDKs to send real user monitoring data to Tsuga. The token value is public by design and is included in every response. See [API keys](/documentation/account-and-settings/api-keys)."}),tVe={id:"123-456-abc",name:"my-web-app",token:"tsuga_rum:v1:abc123xyzABC123xyzABC123",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],collectClientIp:!1,tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(QT,{examples:[tVe]});var wde=n.Pick(VT,["name","owner","applicationType","allowedUrlPrefixes","collectClientIp","tags","teamOverrideFields"],{$id:"CreatePublicTokenRequest",description:"RUM public token creation request. Provide a kebab-case name, owner team, application type, allowed URL prefixes (required for `web`, empty for `ios` and `android`), tags including an `env` tag, and team override fields as an array of fields or null. Set `collectClientIp` to record client IP addresses."}),vde={name:"my-web-app",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],collectClientIp:!1,tags:[{key:"env",value:"production"}],teamOverrideFields:null};Object.assign(wde,{examples:[vde]});var Nde=n.Pick(VT,["name","owner","applicationType","allowedUrlPrefixes","collectClientIp","tags","teamOverrideFields"],{$id:"UpdatePublicTokenRequest",description:"RUM public token update request. Provide the full definition, including name, owner team, allowed URL prefixes, tags including an `env` tag, and team override fields. `collectClientIp` is optional and keeps its current value when omitted. The application type must match the existing token and the token value itself never changes."});Object.assign(Nde,{examples:[vde]});var kde=f({description:"Lists RUM public tokens, used by browser and mobile applications to send real user monitoring data, with their owners, allowed URL prefixes and tags.",operationId:"listPublicTokens",tags:["public-tokens"],url:WT,method:"GET",paginated:!0,query:n.Object(We),response:n.Array(QT)}),Lde=f({description:"Retrieves one RUM public token by ID, including the full token value to configure in the SDK.",operationId:"getPublicToken",tags:["public-tokens"],url:`${WT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the public token to retrieve. Use the `id` returned by public token list or create responses."})}),response:QT}),Mde=f({description:"Creates a RUM public token for a browser or mobile application. The response includes the full token value to configure in the SDK; it can be read again later with the get and list operations.",operationId:"createPublicToken",tags:["public-tokens"],url:WT,method:"POST",body:wde,response:QT}),Dde=f({description:"Updates RUM public token metadata by ID, including name, owner, application type, allowed URL prefixes, client IP collection, tags, and team override fields. Every field except `collectClientIp` is required: the application type is fixed at creation, so resend the token's current value. The token value is not rotated by this operation.",operationId:"updatePublicToken",tags:["public-tokens"],url:`${WT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the public token to update. Use the `id` returned by public token list, get, or create responses."})}),body:Nde,response:QT}),Fde=f({description:"Deletes a RUM public token by ID. Applications configured with the deleted token can no longer send RUM data with it.",operationId:"deletePublicToken",tags:["public-tokens"],url:`${WT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the public token to delete. Use the `id` returned by public token list, get, or create responses."})}),response:q});var $de=De({commandName:"public-tokens",description:"Manage public tokens used by the RUM browser and mobile SDKs",endpoints:{list:kde,get:Lde,create:Mde,update:Dde,delete:Fde}});var rVe={critical:3,important:2,normal:1},Ke=e=>({label:e,weight:rVe[e]}),nVe={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:Ke("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:Ke("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:Ke("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"no-team-override-mismatch":{key:"no-team-override-mismatch",title:`${oM} matches ${AA}`,summary:`Detects logs and spans whose ${oM} resource attribute names a different team than the ${AA} resolved at ingestion.`,rationale:`${AA} is reserved and comes from the ingestion API key, so a \`team\` resource attribute never reassigns ownership. A disagreement means the sender expects an ownership Tsuga did not apply.`,objectType:"resource",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Drop the `team` resource attribute, or set the ingestion API key team override fields to read ownership from a differently named attribute."},"service-name-present":{key:"service-name-present",title:`${CA} present`,summary:`Logs and spans must populate ${CA} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Ke("critical"),recommendation:`Populate ${CA} in all log and span payloads.`},"no-orphan-spans":{key:"no-orphan-spans",title:"No orphan spans",summary:"Every span with parent_span_id references an existing span in the same trace.",rationale:"Trace integrity depends on preserving parent-child hierarchies.",objectType:"span",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Emit parent spans before their children so references always resolve."},"metric-unit-consistency":{key:"metric-unit-consistency",title:"Name\u2192unit consistency",summary:"All series for a metric name report the same UCUM-compliant unit across the lookback period.",rationale:"Avoid ambiguity when charting and alerting on metrics with shared names.",objectType:"metric",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Align exporters so each metric name emits a single consistent unit across services and environments."},"host-name-present":{key:"host-name-present",title:`${kA} presence`,summary:`Logs and spans must populate ${kA} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Ke("important"),recommendation:`Populate ${kA} in all log and span payloads.`},"inconsistent-attribute-naming":{key:"inconsistent-attribute-naming",title:"Consistent attribute naming",summary:"Detects attributes with multiple naming variants (e.g., userId vs user_id).",rationale:"Consistent naming improves queryability.",objectType:"log",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"no-dynamic-log-attribute-names":{key:"no-dynamic-log-attribute-names",title:"No dynamic log attribute names",summary:"Detects attribute names that embed numbers or IDs (e.g., item_1.price, item_2.price or cache.3f9a8c1e.hits).",rationale:"Each distinct name is a new attribute: they cannot be queried together and crowd real attributes out of the attribute list.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Move the number or ID into an attribute value (e.g., item.id) instead of the name."},"no-dynamic-span-attribute-names":{key:"no-dynamic-span-attribute-names",title:"No dynamic span attribute names",summary:"Detects span attribute names that embed numbers or IDs (e.g., item_1.price, item_2.price or cache.3f9a8c1e.hits).",rationale:"Each distinct name is a new attribute: they cannot be queried together and crowd real attributes out of the attribute list.",objectType:"span",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Move the number or ID into an attribute value (e.g., item.id) instead of the name."},"no-excessive-log-attributes":{key:"no-excessive-log-attributes",title:"No excessive log attributes",summary:"Detects clusters whose logs carry too many distinct attribute names.",rationale:"Every distinct name is a separate attribute: past a few thousand, the attribute list becomes hard to search and real attributes get lost among one-off names.",objectType:"log",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Stop sending attributes that are never queried.",scope:"global"},"no-excessive-span-attributes":{key:"no-excessive-span-attributes",title:"No excessive span attributes",summary:"Detects clusters whose spans carry too many distinct attribute names.",rationale:"Every distinct name is a separate attribute: past a few thousand, the attribute list becomes hard to search and real attributes get lost among one-off names.",objectType:"span",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Stop sending attributes that are never queried.",scope:"global"},"no-duplicate-attr-values":{key:"no-duplicate-attr-values",title:"No duplicate attribute values",summary:"Detects when different attributes consistently carry identical values across logs (e.g., err.type and error.type always having the same value).",rationale:"Redundant attributes waste storage and complicate querying. Consolidate to one.",objectType:"log",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Remove DEBUG-level logging from production environment or adjust log level configuration."},"no-multiline-logs":{key:"no-multiline-logs",title:"No ungrouped multiline logs",summary:"Detects orphaned stack-trace and traceback continuation lines that should have been grouped into a single log entry by the collector.",rationale:"Ungrouped multiline logs fragment errors across many entries, making them harder to read, search, and alert on.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Configure multiline grouping on the log collector using a line_start_pattern (e.g. a timestamp regex) so stack traces are sent as a single entry."},"no-error-logs-as-info":{key:"no-error-logs-as-info",title:"No error logs mapped as info",summary:"Detects INFO-level logs that carry error fields such as error.*, err.*, exception.*, or a stack trace.",rationale:"A log with error or exception attributes but an INFO severity is never surfaced as an error, so teams miss real failures caused by a misconfigured level mapper or bad logging.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:Ke("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Add a notification destination to every monitor - a monitor without notifications is effectively silent."},"no-future-dated-logs":{key:"no-future-dated-logs",title:"No future-dated logs",summary:"Detects logs with timestamps more than 59 minutes ahead of their intake time.",rationale:"Future-dated logs break dashboards, alerting, and log ordering - they indicate clock skew or incorrect timestamp generation.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of the team's metrics that are neither referenced by a dashboard or monitor nor queried in the last 30 days. Fails at 40% or more.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:Ke("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"team"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:Ke("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:Ke("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Tune thresholds, widen the time window, or change the aggregation to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:Ke("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:Ke("important"),recommendation:"Remove, rename, or backfill log fields that are referenced by dashboards or monitors but have not been seen in the last 24 hours.",scope:"global"},"k8s-recommended-attributes":{key:"k8s-recommended-attributes",title:"Kubernetes recommended resource attributes",summary:"Kubernetes logs and spans should populate core identity attributes and at least one workload-ownership attribute.",rationale:"These attributes let Tsuga correlate telemetry with the Kubernetes objects that produced it, which is required for faulty-deployment detection and rollback suggestions.",objectType:"resource",category:"collection-coverage",impact:Ke("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:Ke("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:Ke("important"),recommendation:"Configure the Kubernetes change-event collector (for example the OpenTelemetry k8sobjects receiver) so change events for Pod, Deployment, ReplicaSet, StatefulSet, DaemonSet, Namespace and Node are ingested."},"otel-collector-self-metrics":{key:"otel-collector-self-metrics",title:"OpenTelemetry Collector self-metrics",summary:"A cluster collecting Kubernetes metrics through an OpenTelemetry Collector also emits the collector self-metrics (otelcol_*).",rationale:"The Kubernetes receivers feed the Kubernetes explorer. Without the collector self-metrics there is no way to tell a healthy pipeline from one that drops data or fails to export, so a stale or missing Kubernetes view cannot be explained.",objectType:"metric",category:"collection-coverage",impact:Ke("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"histograms-delta-temporality":{key:"histograms-delta-temporality",title:"Histograms sent with delta temporality",summary:"The team sends its histogram metrics with delta temporality.",rationale:"Cumulative histograms carry bucket counts since process start, so percentiles over a time window need per-series differences at query time and break on every restart. Delta histograms hold the distribution of each interval and aggregate directly across series and services.",objectType:"metric",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Send histograms with delta temporality, for example by setting OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta on OpenTelemetry SDKs or by adding a cumulativetodelta processor to the collector metrics pipeline.",scope:"team"},"service-telemetry-coverage":{key:"service-telemetry-coverage",title:"Services send logs, traces and span metrics",summary:`Each service of the team sends logs, traces, ${DA} and ${FA}.`,rationale:"Investigations move between the logs, traces and span metrics of a service. A service missing one of them leaves a blind spot, and a service without span metrics is not listed on the Services page.",objectType:"resource",category:"collection-coverage",impact:Ke("important"),recommendation:`Instrument each listed service with OpenTelemetry so it sends logs and traces, and generate ${DA} and ${FA} from its spans with the span metrics connector.`,scope:"team"},"use-standard-attributes":{key:"use-standard-attributes",title:"Standard attribute usage",summary:"Detects log attributes that should be remapped to Tsuga standard attributes.",rationale:"Standard attributes enable consistent querying, out-of-the-box dashboards, and cross-team correlation.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Ke("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Ke("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."},"db-logs-trace-correlation":{key:"db-logs-trace-correlation",title:"Database logs correlated with traces",summary:`Database logs should carry ${Tp} so they can be tied back to the trace that issued the query.`,rationale:"Linking database server logs to client traces lets users jump from a slow request to the exact query log. Without a trace id, database logs cannot be joined to the request that produced them.",objectType:"log",category:"telemetry-hygiene",impact:Ke("normal"),recommendation:"Enable trace correlation on the database log pipeline (for example via SQLcommenter, which embeds the traceparent in each statement) so query logs carry a trace id.",scope:"team"},"logs-missing-trace-id":{key:"logs-missing-trace-id",title:"Logs from traced services carry a trace id",summary:`Logs emitted by services that send traces should carry ${Tp} so they can be correlated with their trace.`,rationale:"A service that already emits traces can stamp the active trace id on every log. Logs without it cannot be opened from a trace or used to explain a slow or failing request.",objectType:"log",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Enable log correlation in the OpenTelemetry SDK or logging library of each traced service so every log carries the active trace id.",scope:"team"},"assets-comply-with-tag-policies":{key:"assets-comply-with-tag-policies",title:"Assets comply with tag policies",summary:"Every asset owned by the team (dashboards, monitors, routes, keys, SLOs, notification rules and silences) carries the tags required by the active asset tag policies that apply to it.",rationale:"Tag policies are only enforced when an asset is created or updated, so assets that predate a policy stay non-compliant and break tag-based ownership, filtering and cost attribution.",objectType:"tag-policy",category:"observability-assets",impact:Ke("important"),recommendation:"Edit each non-compliant asset to add the missing tags and remove the disallowed tags required by the tag policy.",scope:"team"},"data-complies-with-tag-policies":{key:"data-complies-with-tag-policies",title:"Data complies with tag policies",summary:"Logs, metrics and traces sent by the team raise no violations of the active data tag policies that apply to it during the lookback window.",rationale:"Telemetry that violates a data tag policy is flagged or dropped at ingestion, so teams lose data and tag-based queries, dashboards and monitors miss it.",objectType:"tag-policy",category:"telemetry-hygiene",impact:Ke("important"),recommendation:"Set the tags required by each violated data tag policy at the source, for example as resource attributes in the OpenTelemetry SDK or collector.",scope:"team"}},Bde={"postgresql-server-metrics-collected":{label:"PostgreSQL",systemValues:["postgresql"],metricPrefixes:["postgresql.","pg_"],receiver:"postgresqlreceiver"},"mysql-server-metrics-collected":{label:"MySQL",systemValues:["mysql","mariadb"],metricPrefixes:["mysql.","mysql_"],receiver:"mysqlreceiver"},"mongodb-server-metrics-collected":{label:"MongoDB",systemValues:["mongodb"],metricPrefixes:["mongodb.","mongodbatlas.","mongodb_"],receiver:"mongodbreceiver"},"redis-server-metrics-collected":{label:"Redis",systemValues:["redis"],metricPrefixes:["redis.","redis_"],receiver:"redisreceiver"},"memcached-server-metrics-collected":{label:"Memcached",systemValues:["memcached"],metricPrefixes:["memcached.","memcached_"],receiver:"memcachedreceiver"},"couchdb-server-metrics-collected":{label:"CouchDB",systemValues:["couchdb"],metricPrefixes:["couchdb.","couchdb_"],receiver:"couchdbreceiver"},"elasticsearch-server-metrics-collected":{label:"Elasticsearch",systemValues:["elasticsearch"],metricPrefixes:["elasticsearch.","elasticsearch_"],receiver:"elasticsearchreceiver"},"oracledb-server-metrics-collected":{label:"Oracle DB",systemValues:["oracle.db","oracle"],metricPrefixes:["oracledb.","oracledb_"],receiver:"oracledbreceiver"},"sqlserver-server-metrics-collected":{label:"Microsoft SQL Server",systemValues:["microsoft.sql_server","mssql"],metricPrefixes:["sqlserver.","mssql_"],receiver:"sqlserverreceiver"},"saphana-server-metrics-collected":{label:"SAP HANA",systemValues:["sap.hana","hanadb"],metricPrefixes:["saphana."],receiver:"saphanareceiver"},"cassandra-server-metrics-collected":{label:"Cassandra",systemValues:["cassandra"],metricPrefixes:["cassandra.","cassandra_"]},"clickhouse-server-metrics-collected":{label:"ClickHouse",systemValues:["clickhouse"],metricPrefixes:["ClickHouse"]},"couchbase-server-metrics-collected":{label:"Couchbase",systemValues:["couchbase"],metricPrefixes:["couchbase_"]},"neo4j-server-metrics-collected":{label:"Neo4j",systemValues:["neo4j"],metricPrefixes:["neo4j_"]},"opensearch-server-metrics-collected":{label:"OpenSearch",systemValues:["opensearch"],metricPrefixes:["opensearch_"]},"db2-server-metrics-collected":{label:"IBM Db2",systemValues:["ibm.db2","db2"],metricPrefixes:["ibm_db2_"]}},oVe=Object.fromEntries(Object.keys(Bde).map(e=>{let{label:t,receiver:r}=Bde[e];return[e,{key:e,title:`${t} server metrics collected`,summary:`${t} seen in client spans should have its server metrics collected.`,rationale:"Server metrics (connections, throughput, replication, contention) are needed to investigate database slowness beyond what client spans show. A detected database with no server metrics has a gap in its monitoring setup.",objectType:"metric",category:"collection-coverage",impact:Ke("important"),recommendation:r?`Configure the ${r} OpenTelemetry receiver so ${t} server metrics are collected.`:`Collect ${t} server metrics, for example via its Prometheus exporter.`,scope:"global"}]})),iVe=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),sVe=bT.filter(e=>e.startsWith("azure_")&&!iVe.has(e)),Gde={"aws-sqs-metrics-collected":{label:"Amazon SQS",source:"AWS/SQS",nativeResourceTypes:["aws_sqs_queue"],metricPrefixes:["aws_sqs_"]},"aws-sns-metrics-collected":{label:"Amazon SNS",source:"AWS/SNS",nativeResourceTypes:["aws_sns_topic"],metricPrefixes:["aws_sns_"]},"aws-kinesis-metrics-collected":{label:"Amazon Kinesis Data Streams",source:"AWS/Kinesis",nativeResourceTypes:["aws_kinesis_data_stream"],metricPrefixes:["aws_kinesis_"]},"aws-dynamodb-metrics-collected":{label:"Amazon DynamoDB",source:"AWS/DynamoDB",nativeResourceTypes:["aws_dynamodb_table"],metricPrefixes:["aws_dynamodb_"]},"aws-rds-metrics-collected":{label:"Amazon RDS",source:"AWS/RDS",nativeResourceTypes:["aws_rds_instance"],metricPrefixes:["aws_rds_"]},"aws-elasticache-metrics-collected":{label:"Amazon ElastiCache",source:"AWS/ElastiCache",nativeResourceTypes:["aws_elasticache"],metricPrefixes:["aws_elasticache_"]},"aws-s3-metrics-collected":{label:"Amazon S3",source:"AWS/S3",nativeResourceTypes:["aws_s3_bucket"],metricPrefixes:["aws_s3_"]},"aws-ebs-metrics-collected":{label:"Amazon EBS",source:"AWS/EBS",nativeResourceTypes:["aws_ebs_volume"],metricPrefixes:["aws_ebs_"]},"aws-efs-metrics-collected":{label:"Amazon EFS",source:"AWS/EFS",nativeResourceTypes:["aws_efs"],metricPrefixes:["aws_efs_"]},"aws-ec2-metrics-collected":{label:"Amazon EC2",source:"AWS/EC2",nativeResourceTypes:["aws_ec2_instance"],metricPrefixes:["aws_ec2_"]},"aws-lambda-metrics-collected":{label:"AWS Lambda",source:"AWS/Lambda",nativeResourceTypes:["aws_lambda_function"],metricPrefixes:["aws_lambda_"]},"aws-ecs-metrics-collected":{label:"Amazon ECS",source:"AWS/ECS",nativeResourceTypes:["aws_ecs_cluster","aws_ecs_service","aws_ecs_task"],metricPrefixes:["aws_ecs_"]},"aws-ecr-metrics-collected":{label:"Amazon ECR",source:"AWS/ECR",nativeResourceTypes:["aws_ecr_repository"],metricPrefixes:["aws_ecr_"]},"aws-elb-metrics-collected":{label:"Elastic Load Balancing",source:"AWS/ApplicationELB, AWS/NetworkELB",nativeResourceTypes:["aws_elastic_load_balancer"],metricPrefixes:["aws_applicationelb_","aws_networkelb_","aws_gatewayelb_","aws_elb_"]},"aws-cloudfront-metrics-collected":{label:"Amazon CloudFront",source:"AWS/CloudFront",nativeResourceTypes:["aws_cloudfront_distribution"],metricPrefixes:["aws_cloudfront_"]},"aws-acm-metrics-collected":{label:"AWS Certificate Manager",source:"AWS/CertificateManager",nativeResourceTypes:["aws_acm_certificate"],metricPrefixes:["aws_certificatemanager_"]},"gcp-pubsub-metrics-collected":{label:"Google Cloud Pub/Sub",source:"pubsub.googleapis.com",nativeResourceTypes:["gcp_pubsub_topic"],metricPrefixes:["pubsub.googleapis.com/"]},"gcp-storage-metrics-collected":{label:"Google Cloud Storage",source:"storage.googleapis.com",nativeResourceTypes:["gcp_bucket"],metricPrefixes:["storage.googleapis.com/"]},"gcp-compute-metrics-collected":{label:"Google Compute Engine",source:"compute.googleapis.com",nativeResourceTypes:["gcp_compute_instance","gcp_compute_disk"],metricPrefixes:["compute.googleapis.com/"]},"gcp-cloud-sql-metrics-collected":{label:"Google Cloud SQL",source:"cloudsql.googleapis.com",nativeResourceTypes:["gcp_cloud_sql_instance"],metricPrefixes:["cloudsql.googleapis.com/"]},"gcp-gke-metrics-collected":{label:"Google Kubernetes Engine",source:"kubernetes.io, container.googleapis.com",nativeResourceTypes:["gcp_gke_cluster"],metricPrefixes:["kubernetes.io/","container.googleapis.com/"]},"gcp-cloud-run-metrics-collected":{label:"Google Cloud Run",source:"run.googleapis.com",nativeResourceTypes:["gcp_cloud_run_service","gcp_cloud_run_job","gcp_cloud_run_function"],metricPrefixes:["run.googleapis.com/"]},"gcp-artifact-registry-metrics-collected":{label:"Google Artifact Registry",source:"artifactregistry.googleapis.com",nativeResourceTypes:["gcp_artifact_registry_repository"],metricPrefixes:["artifactregistry.googleapis.com/"]},"gcp-load-balancing-metrics-collected":{label:"Google Cloud Load Balancing",source:"loadbalancing.googleapis.com",nativeResourceTypes:["gcp_forwarding_rule"],metricPrefixes:["loadbalancing.googleapis.com/"]},"gcp-bigtable-metrics-collected":{label:"Google Cloud Bigtable",source:"bigtable.googleapis.com",nativeResourceTypes:["gcp_bigtable_instance"],metricPrefixes:["bigtable.googleapis.com/"]},"gcp-spanner-metrics-collected":{label:"Google Cloud Spanner",source:"spanner.googleapis.com",nativeResourceTypes:["gcp_spanner_instance"],metricPrefixes:["spanner.googleapis.com/"]},"gcp-firestore-metrics-collected":{label:"Google Cloud Firestore",source:"firestore.googleapis.com",nativeResourceTypes:["gcp_firestore_database"],metricPrefixes:["firestore.googleapis.com/"]},"gcp-app-engine-metrics-collected":{label:"Google App Engine",source:"appengine.googleapis.com",nativeResourceTypes:["gcp_app_engine_service"],metricPrefixes:["appengine.googleapis.com/"]},"azure-metrics-collected":{label:"Azure",source:"Azure Monitor",nativeResourceTypes:sVe,metricPrefixes:["azure_"]}},aVe=Object.fromEntries(Object.keys(Gde).map(e=>{let{label:t,source:r}=Gde[e];return[e,{key:e,title:`${t} metrics collected`,summary:`${t} resources found in inventory should have their metrics collected.`,rationale:"A resource that appears in inventory but whose metrics are not collected leaves its dashboards and resource-explorer views empty and impossible to alert on.",objectType:"metric",category:"collection-coverage",impact:Ke("important"),recommendation:`Enable the ${r} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),cVe={...nVe,...oVe,...aVe},jde=Object.values(cVe);var qde=["passed","failed","ignored"],uVe=10,pVe=n.Enum(qde,{description:"Evaluation outcome for this rule row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),lVe=["aws-sqs-metrics-collected","aws-sns-metrics-collected","aws-kinesis-metrics-collected","aws-dynamodb-metrics-collected","aws-rds-metrics-collected","aws-elasticache-metrics-collected","aws-s3-metrics-collected","aws-ebs-metrics-collected","aws-efs-metrics-collected","aws-ec2-metrics-collected","aws-lambda-metrics-collected","aws-ecs-metrics-collected","aws-ecr-metrics-collected","aws-elb-metrics-collected","aws-cloudfront-metrics-collected","aws-acm-metrics-collected","gcp-pubsub-metrics-collected","gcp-storage-metrics-collected","gcp-compute-metrics-collected","gcp-cloud-sql-metrics-collected","gcp-gke-metrics-collected","gcp-cloud-run-metrics-collected","gcp-artifact-registry-metrics-collected","gcp-load-balancing-metrics-collected","gcp-bigtable-metrics-collected","gcp-spanner-metrics-collected","gcp-firestore-metrics-collected","gcp-app-engine-metrics-collected","azure-metrics-collected"],dVe=["postgresql-server-metrics-collected","mysql-server-metrics-collected","mongodb-server-metrics-collected","redis-server-metrics-collected","memcached-server-metrics-collected","couchdb-server-metrics-collected","elasticsearch-server-metrics-collected","oracledb-server-metrics-collected","sqlserver-server-metrics-collected","saphana-server-metrics-collected","cassandra-server-metrics-collected","clickhouse-server-metrics-collected","couchbase-server-metrics-collected","neo4j-server-metrics-collected","opensearch-server-metrics-collected","db2-server-metrics-collected"],W$=["unrouted-logs","no-over-routed-logs","team-has-route","no-team-override-mismatch","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-dynamic-log-attribute-names","no-dynamic-span-attribute-names","no-excessive-log-attributes","no-excessive-span-attributes","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-error-logs-as-info","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","otel-collector-self-metrics","histograms-delta-temporality","service-telemetry-coverage","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation","logs-missing-trace-id","assets-comply-with-tag-policies","data-complies-with-tag-policies",...dVe,...lVe],Hde=n.Enum(W$),mVe=["log","metric","resource","span","api-key","dashboard","monitor","route","tag-policy"],fVe=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],gVe=["critical","important","normal"],hVe=["team","global"],Q$=n.Object({key:n.Enum(W$),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(mVe),category:n.Enum(fVe),impact:n.Object({label:n.Enum(gVe),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(hVe))}),ZT=n.Object({type:n.String({description:"Tsuga asset or telemetry kind referenced by this example. Set by the rule evaluator from the failing object, record, or lookup result; examples include `monitor`, `dashboard`, `metric`, `log`, and `api-key`."}),label:n.String({description:"Human-readable summary of the example. Set by the rule evaluator from the asset name, telemetry identifier, or lookup result so clients can display the example without following the link."}),link:n.Object({to:n.String({description:"In-app route that opens the example in Tsuga. Set by the rule evaluator when the example has a product surface for inspection."}),search:n.Optional(n.Unknown({description:"Route search payload for the in-app link. Set when the destination needs query-string state such as a search query, time range, or table filter."})),params:n.Optional(n.Unknown({description:"Route params for the in-app link. Set when the destination route needs path parameters such as an asset identifier."}))},{description:"In-app deep link for inspecting the example. Returned when Tsuga can route from the quality-report row to a relevant product page."})}),V$=n.Intersect([Q$,n.Object({id:n.Optional(n.String()),status:pVe,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(ZT)),exampleCount:n.Optional(n.Integer()),evaluatedAt:n.Optional(n.String())})]),yVe=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(Q$),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(V$)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(V$)}))}),Z$=n.Object({id:n.String({description:"Identifier of this persisted quality-report row. Generated by Tsuga when report rows are stored. Returned on every row. Treat it as an opaque ID."}),reportId:n.String({description:"Identifier shared by rows from the same report generation for the same team or global cluster-wide scope. Generated by Tsuga when the report is stored. Returned on every row."}),ruleId:n.Enum(W$,{description:"Stable key for the telemetry-quality rule evaluated by this row. Set by Tsuga from the quality-rule catalog. Returned on every row. The enum may grow as Tsuga adds rules; clients should display unknown future values as opaque rule keys if they do not have local labels."}),owner:n.Optional(n.String({description:"Team identifier this row applies to. Set to the owning team ID for team-scoped rules. Returned for team rows; omitted for global cluster-wide rows."})),status:n.Enum(qde,{description:"Evaluation outcome for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),score:n.Number({description:"Normalized score for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Values are between 0 and 1."}),weight:n.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:n.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:n.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:n.Optional(n.String({description:"Recommendation stored with this row. Set by the rule evaluator when the report is generated. Returned when a recommendation was persisted; omitted otherwise. The latest-report endpoint does not recompute or default it at read time."})),examples:n.Optional(n.Array(ZT,{description:`Assets, logs, metrics, or links supporting this rule result. Set by the rule evaluator when the report is generated. Returned when examples were persisted and visible to the caller; global row examples are returned only to admin users. Truncated to the first ${uVe}; compare against exampleCount to detect truncation.`})),exampleCount:n.Optional(n.Integer({description:"Total number of examples persisted for this row, before the preview truncation applied to examples. Returned whenever examples are visible to the caller."})),evaluatedAt:n.Optional(n.String({description:"ISO timestamp at which the rule evaluator produced this result: the report generation time, or, when evaluation failed then, the time of the last successful result for the same rule and scope, which the row carries instead. Omitted when the rule never evaluated successfully for this scope (`status` is then ignored) and on rows stored before this field existed."})),createdAt:n.String({description:"ISO timestamp the row was generated at"})}),wxr=f({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:yVe}),bP=n.Optional(l({allowEmpty:!1,description:"Identifier of the cluster whose latest quality-report rows are returned. Use the id from the clusters API. Required when the organization has multiple clusters; omit only in single-cluster organizations. Unknown cluster IDs return RESOURCE_NOT_FOUND."})),vxr=f({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",paginated:!0,query:n.Object({clusterId:bP,team:n.Optional(l({allowEmpty:!1})),...Ie}),response:n.Array(Z$,{description:"Latest persisted rule evaluation rows for the cluster"})}),Nxr=f({tags:["quality-reports"],url:"/v0/quality-reports/:id/examples",method:"GET",paginated:!0,params:n.Object({id:l({allowEmpty:!1})}),query:n.Object(Ie),response:n.Object({examples:n.Array(ZT)})}),kxr=f({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:Hde,teamId:n.Optional(l({allowEmpty:!1})),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(l({allowEmpty:!1}))}),response:n.Object({rule:Q$,result:V$,teamId:n.Optional(n.String()),teamName:n.Optional(n.String())})}),Lxr=f({tags:["quality-reports"],url:"/v0/quality-reports/auto-fix",method:"POST",body:n.Object({ruleKey:Hde,teamId:n.Optional(l({allowEmpty:!1})),clusterId:bP,configurationId:l({allowEmpty:!1})}),response:n.Object({runId:n.String()})}),Mxr=new Map(jde.map(e=>[e.key,e]));var Kde=`/${"v1"}/quality-reports`,zde=n.Pick(Z$,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","exampleCount","evaluatedAt","createdAt"],{$id:"QualityReportRow",description:"Persisted evaluation of one telemetry-quality rule for a team or cluster-wide scope. See [Quality reports](/documentation/account-and-settings/quality-reports)."}),EVe={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,evaluatedAt:"2026-02-26T12:00:00.000Z",createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(zde,{examples:[EVe]});var SVe=n.Object({clusterId:bP,team:n.Optional(l({allowEmpty:!1,description:"Team name used to scope the report. Matched against Tsuga team names. Optional; when set, returns only rows for that team and omits global rows. Unknown team names return RESOURCE_NOT_FOUND; teams the caller cannot access return an empty result."})),...We},{description:"Latest quality report lookup query."}),Yde=f({description:"Returns a cluster's latest quality report on telemetry and observability assets, optionally for one team: a score, findings and a recommendation per rule, covering telemetry hygiene, collection coverage, usage, and checks on routes, dashboards, monitors, API keys and tag policies. A cluster holds one row per rule per team.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${Kde}/latest`,method:"GET",paginated:!0,query:SVe,response:n.Array(zde)}),X$=f({description:"Pages through the stored examples of one quality-report row, past the preview the latest report returns. The row's full example count is in `metadata.pagination.totalCount`.",operationId:"getQualityReportExamples",tags:["quality-reports"],url:`${Kde}/:id/examples`,method:"GET",paginated:!0,params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the quality-report row whose examples are returned. Use the id from the latest-report endpoint. Unknown ids, rows the caller cannot access, and cluster-wide rows requested by a non-admin all return RESOURCE_NOT_FOUND."})}),query:n.Object(We,{description:"Page of the row examples to return."}),response:n.Object({examples:n.Array(ZT,{description:"Requested page of the examples stored for this row. Empty when the rule evaluation produced none, or when the offset is past the last one."})},{description:"One page of the examples stored for a quality-report row."})});var TVe=["type","label"],Vde=P("examples",{id:gr("ID").pipe(Ht("The quality report row whose examples are returned")),...Lp,pretty:Io},v("cli.quality-reports.examples")(function*(e){let t=yield*hn,r=yield*Ze(X$,{params:{id:e.id},query:Sn({limit:ue(e.limit),offset:ue(e.offset)}),allPages:e.all});if(!Ct(X$.response,r.data))return yield*new Ps({message:"The API returned quality report examples the CLI could not read"});yield*t.rows(r.data.examples,{...e,defaultFields:TVe,metadata:r.metadata})})).pipe(U("List the examples stored for one quality report row"));var Wde=De({commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:Yde},extraSubcommands:[Vde]});var za=`${$d}/retention-policies`,Qde=3650,_Ve=n.Integer({description:"Number of days Tsuga retains matching telemetry."}),Zde=n.Integer({minimum:1,maximum:Qde,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${Qde}.`}),lu=n.Object({id:n.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:n.Optional(n.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:n.Optional(n.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:n.Enum(va,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:_Ve,isEnabled:n.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:N({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:N({description:"Timestamp when Tsuga last updated the retention policy."})}),xP=n.Object({env:Qe(l(),{description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."}),teamId:Qe(l(),{description:"Team ID this policy applies to. Omit for a policy that is not team-specific."}),dataSource:n.Enum(va,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:Zde,isEnabled:n.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),Xde=n.Array(n.Object({env:l(),dataSource:n.Enum(va),durationDays:n.Union([Zde,n.Null()]),isEnabled:n.Boolean()})),Jde=n.Object({inserted:n.Array(lu),updated:n.Array(lu),deleted:n.Array(lu)}),cOr=f({tags:["retention-policies"],url:za,method:"POST",body:xP,response:lu}),uOr=f({tags:["retention-policies"],url:za,method:"GET",response:n.Array(lu)}),pOr=f({tags:["retention-policies"],url:`${za}/:id`,method:"GET",params:n.Object({id:l()}),response:lu}),lOr=f({tags:["retention-policies"],url:`${za}/:id`,method:"PUT",params:n.Object({id:l()}),body:xP,response:lu}),dOr=f({tags:["retention-policies"],url:`${za}/bulk-update`,method:"POST",body:Xde,response:Jde}),mOr=f({tags:["retention-policies"],url:`${za}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:l(),policies:Xde}),response:Jde}),fOr=f({tags:["retention-policies"],url:`${za}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),XT=["past-24-hours","past-7-days","past-30-days"],gOr=f({tags:["retention-policies"],url:`${za}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:l()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(XT),dataSource:n.Enum(va)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(XT),dataSource:n.Enum(va),teamId:n.String(),requestedHistoryDays:n.Number()})}),IVe=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var bVe=n.Array(n.Object({bucket:n.Enum(IVe),count:n.Number()})),hOr=f({tags:["retention-policies"],url:`${za}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:l()}),body:n.Object({observationWindow:n.Enum(XT),dataSource:n.Enum(va)}),response:n.Object({observationWindow:n.Enum(XT),dataSource:n.Enum(va),teamId:n.String(),histogram:bVe})}),yOr=f({tags:["retention-policies"],url:`${za}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(va),observationWindow:n.Enum(XT),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var JT=`/${"v1"}/retention-policies`,e_=n.Pick(lu,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Retention rule for logs, metrics, or traces. Policies can apply globally, to an environment, or to a team depending on which scope fields are present. See [Retention](/documentation/account-and-settings/retention)."}),xVe={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(e_,{examples:[xVe]});var eme=f({description:"Lists retention policies: how long logs, traces and other telemetry are kept, by signal, environment and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:JT,method:"GET",response:n.Array(e_)}),tme=f({description:"Retrieves one retention policy by ID.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${JT}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:e_}),J$=n.Pick(xP,["env","teamId","dataSource","durationDays","isEnabled"],{description:"Retention policy create or update request. Provide the telemetry signal, retention duration, enabled state, and optional environment or team scope."}),OVe={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(J$,{examples:[OVe]});var rme=f({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team. Only one policy may exist per combination of data source, environment, and team; creating a duplicate combination fails.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:JT,method:"POST",body:J$,response:e_}),nme=f({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${JT}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:J$,response:e_}),ome=f({description:"Deletes a retention policy by ID. Retention resolution falls back to the next broader matching policy when one exists.",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${JT}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:q});var ime=De({commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:eme,get:tme,create:rme,update:nme,delete:ome}});var OP=`/${"v1"}/services`,e1=n.Pick(QR,["id","serviceName","serviceNamespace","env","teams","versions","languages","serverProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","traceRequestRate","traceErrorRate"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),AVe={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",traceRequestRate:2.36,traceErrorRate:8.2};Object.assign(e1,{examples:[AVe]});var CVe=n.Pick(d$,["filters","sort","statsWindow"]),sme=n.Object({...CVe.properties,...We,clusterId:n.Optional(l({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."}))},{description:"Service query request. Use filters, sorting, limit, and offset to page through services. Each service returns one row per environment it was observed in."}),RVe={filters:{searchQuery:{value:"checkout"},envs:{values:["prod"]}},sort:{by:"traceErrorRate",direction:"desc"},limit:10,offset:0};Object.assign(sme,{examples:[RVe]});var ame=f({description:"Lists or searches services seen in traces (APM service catalog) with owner teams, environments, versions with faulty deployment detection, languages, frameworks, request rate and error rate. One row per service and environment with span data in `statsWindow`, including services the catalog has not recorded yet, which carry no `id`, `firstSeenAt` or `lastSeenAt` and only `teams` in observed metadata. At most 1000 service names, keeping those with the most span calls.",operationId:"queryServices",tags:["services"],url:`${OP}/query`,method:"POST",paginated:!0,body:sme,response:n.Array(e1)}),cme=f({description:"Retrieves one telemetry-inferred service (service catalog entry) by the service ID the services query returns.",operationId:"getService",tags:["services"],url:`${OP}/:serviceId`,method:"GET",params:n.Object({serviceId:l({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service query responses."})}),response:e1}),PVe=n.Pick(m$,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Service graph node matched to a service catalog entry by name and env. `id`/`namespace` are null when multiple namespaces share the observed service name."}),UVe=n.Pick(g$,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),wVe=n.Pick(f$,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),vVe=F("nodeType",[PVe,wVe,UVe]),NVe=n.Pick(h$,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),kVe=n.Optional(n.Integer({...Cr.properties.from,description:"Start of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),LVe=n.Optional(n.Integer({...Cr.properties.to,description:"End of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),MVe=l({type:"tsuga-query",default:"*",description:"Tsuga query used to filter spans considered for the graph. Defaults to `*`, which applies no additional filter beyond the service identity."}),ume=f({description:"Returns the dependency graph (service map) of one service: the upstream and downstream services and databases seen in its spans, as nodes and edges with call and error counts. Pass both `from` and `to` for a deterministic window; `query` filters the spans. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${OP}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:l({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:n.Object({from:kVe,to:LVe,query:n.Optional(MVe)},{description:"Service graph query. Use time range and optional span query filters."}),response:n.Object({clusterId:n.String({description:"Cluster ID the graph was built from"}),nodes:n.Array(vVe,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:n.Array(NVe,{description:"Directed dependency edges between graph nodes."})})}),AP=`${OP}/:serviceId/notification-targets`,CP=n.Pick(Vg,["id","serviceId","config","rateLimit"],{$id:"ServiceNotificationTarget",description:"Notification target attached to a service, used by adaptive notification rules to page the service owners. See [Rules](/documentation/alert/notifications/rules)."}),t1={rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}},DVe={id:"789-abc-def",serviceId:"123-456-abc",...t1};Object.assign(CP,{examples:[DVe]});var RP=l({allowEmpty:!1,description:"Identifier of the service the notification target belongs to. Use the `id` returned by service list or get responses."}),MOr=f({description:"Lists the notification targets attached to one service: where adaptive notification rules page its owners. Each target has an ID, a destination and a rate limit.",operationId:"listServiceNotificationTargets",tags:["services"],url:AP,method:"GET",params:n.Object({serviceId:RP}),response:n.Array(CP)}),FVe=n.Pick(p$,["config","rateLimit"],{description:"Service notification target create request. Provide the delivery destination and an optional per-target rate limit.",examples:[t1]}),$Ve=n.Pick(l$,["config","rateLimit"],{description:"Service notification target update request. The submitted destination and rate limit overwrite the stored ones.",examples:[t1]}),DOr=f({description:"Attaches a notification target to a service. Adaptive notification rules matching the service page this target on alert transitions.",operationId:"createServiceNotificationTarget",tags:["services"],url:AP,method:"POST",params:n.Object({serviceId:RP}),body:FVe,response:CP}),FOr=f({description:"Updates one notification target attached to a service.",operationId:"updateServiceNotificationTarget",tags:["services"],url:`${AP}/:targetId`,method:"PUT",params:n.Object({serviceId:RP,targetId:l({allowEmpty:!1,description:"Identifier of the notification target to update. Use the `id` returned by service notification target list or create responses."})}),body:$Ve,response:CP}),$Or=f({description:"Detaches a notification target from a service. Notification rules stop paging this destination for the service.",operationId:"deleteServiceNotificationTarget",tags:["services"],url:`${AP}/:targetId`,method:"DELETE",params:n.Object({serviceId:RP,targetId:l({allowEmpty:!1,description:"Identifier of the notification target to delete. Use the `id` returned by service notification target list or create responses."})}),response:q});var pme=De({commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:ame,get:cme},enableListBody:!0});var du="/v0/slos",BVe=[7,30,90],GVe=["good","bad"],fme=n.Enum(GVe,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),jVe=["good","bad","ignore"],gme=n.Enum(jVe,{description:"How to treat time buckets with no data: good (count as meeting the SLO), bad (count as breaching it), or ignore (exclude from the error budget)"}),lme=30,dme=1440,hme=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],mme={sli:n.Optional(n.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:n.Optional(n.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:qp},qVe=n.Object({overall:n.Object(mme,{description:"Latest overall evaluation for the cluster"}),perGroup:n.Array(n.Object({groupKey:n.Record(n.String(),bS,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...mme}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),yme=n.Record(n.String(),qVe,{description:"Latest evaluation results keyed by cluster ID."}),r1=n.Object({queries:US,formula:lC},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Tsuga evaluates this query formula during SLO evaluation and returns it as part of the saved SLO configuration. Returned queries include Tsuga-derived missing-point fill: event SLO queries use zero fill, and time SLO queries keep missing points null."}),n1=n.Object({queries:aJ,formula:xd},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on. Do not send per-query fill; Tsuga derives the fill behavior from the SLO type."}),HVe=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({description:"Burn-rate multiplier that triggers this alert. The short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"}),KVe=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({minimum:1,maximum:100,description:"Burn-rate multiplier that triggers this alert. Required for burn-rate alerts; valid input is 1 through 100. Non-template values are accepted; short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"});var zVe=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({description:"SLI percentage threshold for this alert. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),YVe=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"SLI percentage threshold for this alert. Required for threshold alerts; valid input is greater than 0 and less than 100. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),VVe=F("type",[HVe,zVe],{description:"Alert trigger configuration: burn-rate or threshold"}),Eme=F("type",[KVe,YVe],{description:"Alert trigger configuration: burn-rate or threshold"}),o1=n.Enum(Tn,{description:"Alert priority (1 is highest, 5 is lowest)"}),i1=n.Object({id:n.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:n.String({description:"Parent SLO ID for this alert."}),priority:o1,configuration:VVe,createdAt:N({description:"Timestamp when Tsuga created the alert."}),updatedAt:N({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),WVe=n.Object({priority:o1,configuration:Eme}),QVe=n.Object({id:n.Optional(l({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:o1,configuration:Eme}),ZVe=F("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ii,goodQuery:r1,totalQuery:r1,groupByFields:n.Optional(mg),noDataBehavior:fme},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ii,query:r1,sliceSizeMinutes:n.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:n.Object({operator:n.Enum(hme,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),normalizer:n.Optional(lr),groupByFields:n.Optional(mg),noDataBehavior:gme},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),XVe=F("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ii,goodQuery:n1,totalQuery:n1,groupByFields:n.Optional(Xc),noDataBehavior:fme},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ii,query:n1,sliceSizeMinutes:n.Integer({minimum:lme,maximum:dme,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${lme} through ${dme}.`}),threshold:n.Object({operator:n.Enum(hme,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),normalizer:n.Optional(dr),groupByFields:n.Optional(Xc),noDataBehavior:gme},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),JVe=n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),Sme=n.Enum(BVe,{type:"integer",description:"Rolling SLO evaluation window in days. Set by the caller on create or update and returned on read and list responses. Allowed values are 7, 30, and 90."}),e4e=n.Array(n.String(),{description:"Cluster IDs this SLO is evaluated on. An empty array means every cluster."}),t4e=n.Array(l({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. An empty array means every cluster. Omitting the field runs on every cluster when creating and preserves the current scope when updating. Values must reference existing clusters."}),lh=n.Object({id:n.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:n.String({description:"Display name of the SLO, set by the caller."}),description:n.Optional(n.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:Wt,configuration:ZVe,target:n.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:Sme,owner:n.String({description:"Team ID that owns the SLO"}),permissions:Us,clusterIds:e4e,creator:n.Optional(Ce),updater:n.Optional(Ce),alerts:n.Array(i1,{description:"Alerts attached to this SLO"}),createdAt:N({description:"Timestamp when Tsuga created the SLO."}),updatedAt:N({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),r4e=n.Object({...lh.properties,results:yme},{title:"SloWithResults"}),PP=n.Object({name:l({allowEmpty:!1,description:"Display name of the SLO."}),description:Qe(l({type:"long"}),{description:"Free-form, caller-provided description of what the SLO measures. Optional."}),tags:nr,configuration:XVe,target:JVe,timeframeDays:Sme,owner:l({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:Us,clusterIds:n.Optional(t4e),alerts:n.Array(WVe,{description:"Alerts to create on this SLO. Send an empty array for none."})}),s1=n.Object({...n.Omit(PP,["alerts"]).properties,alerts:n.Array(QVe,{description:"Alerts attached to this SLO. The SLO owns its alerts: the set is reconciled to exactly this list \u2014 existing alerts are matched by id, alerts without an id are created, and existing alerts absent from the list are deleted. Send an empty array to clear all alerts."})}),a1=n.Partial(Yg),n4e=["name","owner","tags","updatedAt","sli","errorBudget","status"],c1=n.Partial(n.Object({...Ie,filters:a1,sort:n.Object({by:n.Enum(n4e,{description:"Field to sort by"}),direction:me},{description:"Optional sorting applied to the returned SLOs"})})),rAr=f({tags:["slos"],url:`${du}/query`,method:"POST",paginated:!0,response:n.Array(r4e),body:c1}),nAr=f({tags:["slos"],url:`${du}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(Yg,["tags","statuses"])))}),response:Wr}),oAr=f({tags:["slos"],url:`${du}/:id`,method:"GET",params:n.Object({id:l()}),response:lh}),iAr=f({tags:["slos"],url:`${du}/:id/results`,method:"GET",params:n.Object({id:l()}),response:yme}),sAr=f({tags:["slos"],url:du,method:"POST",body:PP,response:lh}),aAr=f({tags:["slos"],url:`${du}/:id`,method:"PUT",params:n.Object({id:l()}),body:s1,response:lh}),cAr=f({tags:["slos"],url:`${du}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),o4e=_i(a1),uAr=f({tags:["slos"],url:`${du}/bulk-delete`,method:"DELETE",body:n.Object({selection:o4e}),response:n.Object({})}),i4e=_i(a1,{maxIds:100}),pAr=f({tags:["slos"],url:`${du}/bulk-update`,method:"PUT",body:n.Object({selection:i4e,owner:l({allowEmpty:!1})}),response:n.Object({})});var t_=`/${"v1"}/slos`,s4e=n.Pick(i1,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),r_=n.Object({...n.Pick(lh,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:n.Array(s4e,{description:"Alerts attached to this SLO"})},{$id:"Slo",description:"Service Level Objective definition: its SLI configuration, target percentage, rolling timeframe, cluster scope, and attached alerts"}),a4e={id:"123-456-abc",name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{id:"alert-123-abc",sloId:"123-456-abc",priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(r_,{examples:[a4e]});var Tme=n.Pick(c1,["filters","sort","limit","offset"]),_me=n.Object({...Tme.properties,...We,filters:Tme.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),c4e={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(_me,{examples:[c4e]});var Ime=f({description:"Lists or searches SLOs (service level objectives, error budgets) by owner, tag, status or cluster.",operationId:"querySlos",tags:["slos"],url:`${t_}/query`,method:"POST",paginated:!0,body:_me,response:n.Array(r_)}),bme=f({description:"Retrieves one SLO definition by ID.",operationId:"getSlo",tags:["slos"],url:`${t_}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:r_}),xme=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],Ome=n.Pick(PP,xme,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),Ame=n.Pick(s1,xme,{$id:"UpdateSloRequest",description:"SLO update request. Send all required SLO fields and the full alert list. Alerts are reconciled to exactly the provided list: alerts with a known id are updated, alerts without an id are created, and existing alerts absent from the list are deleted. Omit `clusterIds` to preserve the current cluster scope; send an empty array to run on all clusters."}),Cme={name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(Ome,{examples:[Cme]});Object.assign(Ame,{examples:[Cme]});var Rme=f({description:"Creates an SLO (service level objective) owned by the specified team, with its alerts: event-based (good and total queries) or time-based (a thresholded query over evaluation slices).",operationId:"createSlo",tags:["slos"],url:t_,method:"POST",body:Ome,response:r_}),Pme=f({description:"Replaces an existing SLO definition by ID. Send the full SLO input shape, including configuration, ownership, permissions, cluster scope, and the reconciled alert list. Changing configuration, target, timeframe, permissions, or cluster scope resets the evaluation state of every alert on the SLO, so each alert ignores the transitions it recorded before the update. The SLO status and error budget are recomputed from the telemetry in the rolling window and are not cleared by an update.",operationId:"updateSlo",tags:["slos"],url:`${t_}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:Ame,response:r_}),Ume=f({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${t_}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:q});var wme=De({commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:Ime,get:bme,create:Rme,update:Pme,delete:Ume},enableListBody:!0});var mu=`${$d}/tag-policies`;var u4e=["logs","metrics","traces"],u1=n.Array(n.Enum(u4e,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),vme=n.Union([xA.items,u1.items]),p4e=n.Object({teamIds:n.Array(n.String(),{description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope that limits where this policy applies. Omitted means the policy applies to all teams."}),l4e=F("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:u1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:xA},{title:"TsugaAssetTagPolicy"})]),d4e=F("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:u1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:xA},{title:"TsugaAssetTagPolicy"})]),Nme="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",m4e=n.Unsafe({...l4e,description:Nme}),f4e=n.Unsafe({...d4e,description:Nme}),im=n.Object({id:n.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:n.String({description:"Human-readable tag policy name."}),description:n.Optional(n.String({description:"Optional user-provided policy description."})),isActive:n.Boolean({description:"Whether Tsuga currently evaluates this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be set to false."}),tagKey:n.String({description:"Tag key enforced by this policy."}),allowedTagValues:n.Array(n.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:n.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists. Reserved policies cannot be set to false."}),teamScope:n.Optional(p4e),configuration:m4e,creator:n.Optional(Ce),updater:n.Optional(Ce),owner:n.Optional(n.String({description:"Team ID that owns and manages the policy."})),createdAt:N({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:N({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:N({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var n_=n.Object({name:l({description:"Human-readable tag policy name."}),description:Qe(l(),{description:"Optional policy description."}),isActive:n.Boolean({description:"Set to true for Tsuga to evaluate this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject a false value."}),tagKey:l({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:n.Array(l({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists. Tsuga trims each submitted value before storing the policy."}),isRequired:n.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists. Reserved policies reject a false value."}),teamScope:n.Optional(n.Object({teamIds:n.Array(l(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope to store for this policy. Omit this field to apply the policy to all teams."})),configuration:f4e,owner:l({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),g4e=["name","isActive","tagKey","allowedTagValues","updatedAt"],kme=n.Object({searchQuery:vo({description:"Search query filter for tag policies.",valueDescription:"Case-insensitive substring matched against policy name, tag key, and allowed tag values."}),teamIds:ye(l({allowEmpty:!1}),{description:"Restrict results to policies that apply to any of these team IDs. Policies with no team scope apply to every team, so they always match.",minItems:1,uniqueItems:!0}),assetTypes:ye(vme,{description:"Restrict results to policies covering any of these asset types. Policies with an empty `configuration.assetTypes` cover every asset type of their configuration type, so they match any requested value of that type.",minItems:1,uniqueItems:!0}),configurationType:n.Enum(["telemetry","tsuga_asset"],{description:"Restrict results to data policies (`telemetry`) or asset policies (`tsuga_asset`)."}),status:n.Enum(["active","inactive"],{description:"Restrict results to active or inactive policies."})},{description:"Optional filters applied to narrow the returned tag policies."}),h4e=n.Partial(n.Object({...Ie,filters:n.Partial(kme),sort:n.Object({by:n.Enum(g4e,{description:"Field to sort the returned tag policies by."}),direction:me})})),PAr=f({tags:["tag-policies"],url:`${mu}/query`,method:"POST",paginated:!0,body:h4e,response:n.Array(im,{description:"Matching tag policies after they are filtered, sorted, and paginated."})}),y4e=n.Object({activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching policies regardless of whether they are active."}),active:n.Integer({description:"Number of matching policies that are active."}),inactive:n.Integer({description:"Number of matching policies that are inactive."})})}),E4e=n.Object({filters:n.Optional(n.Partial(n.Omit(kme,["status"]),{description:"Filters applied before collecting the active counts."}))}),UAr=f({tags:["tag-policies"],url:`${mu}/active-counts/query`,method:"POST",body:E4e,response:y4e}),wAr=f({tags:["tag-policies"],url:mu,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(l(),{maxItems:100})),assetTypes:n.Optional(n.Array(vme)),searchQuery:n.Optional(l())}),response:n.Array(im)}),vAr=f({tags:["tag-policies"],url:`${mu}/:id`,method:"GET",params:n.Object({id:l()}),response:im}),NAr=f({tags:["tag-policies"],url:mu,method:"POST",body:n_,response:im}),kAr=f({tags:["tag-policies"],url:`${mu}/:id`,method:"PUT",params:n.Object({id:l()}),body:n_,response:im}),LAr=f({tags:["tag-policies"],url:`${mu}/:id`,method:"DELETE",params:n.Object({id:l()}),response:q}),MAr=f({tags:["tag-policies"],url:`${$d}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(mS),teamId:l()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),tagPolicyId:n.String()}))}),Lme=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),Mme=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("rum-public-token"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("metric-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo"),n.Literal("span-route")]),S4e=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(Mme,Lme)}),T4e=n.Omit(Lme,["total"]),_4e=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(Mme,T4e)}),Dme=n.Object({totals:S4e,byTeam:n.Record(n.String(),_4e)}),DAr=f({tags:["tag-policies"],url:`${mu}/:id/stats`,method:"GET",params:n.Object({id:l()}),response:Dme}),FAr=f({tags:["tag-policies"],url:`${mu}/new-policy-stats`,method:"POST",body:n_,response:Dme});var o_=`/${"v1"}/tag-policies`,Fme={name:"Required Environment Tag",description:"Requires dashboards and monitors to declare an environment.",isActive:!0,tagKey:"environment",allowedTagValues:["production","staging"],isRequired:!0,teamScope:{teamIds:["team-123-abc"],mode:"include"},configuration:{type:"tsuga_asset",assetTypes:["dashboard","monitor"]},owner:"team-123-abc"},$me={name:"Telemetry Environment Policy",description:"Warns when telemetry is missing a known deployment environment.",isActive:!0,tagKey:"deployment.environment.name",allowedTagValues:["production","staging","development"],isRequired:!0,configuration:{type:"telemetry",assetTypes:[],shouldInsertWarning:!0,dropSample:25},owner:"team-123-abc"},I4e={id:"123-456-abc",...Fme},b4e={id:"456-789-def",...$me},i_=n.Pick(im,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga-managed assets or telemetry data. See [Tag policies](/documentation/account-and-settings/tag-policies)."}),x4e=I4e,O4e=b4e;Object.assign(i_,{examples:[x4e,O4e]});var p1=n.Pick(n_,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{description:"Tag policy create or update request. Provide policy identity, owner, enforced tag key, allowed values, team scope, active state, and asset or telemetry configuration."}),A4e=Fme,C4e=$me;Object.assign(p1,{examples:[A4e,C4e]});var Bme=f({description:"Lists tag policies: required tags and allowed values enforced on assets or telemetry, with their team scope.",operationId:"listTagPolicies",tags:["tag-policies"],url:o_,method:"GET",response:n.Array(i_)}),Gme=f({description:"Retrieves one tag policy by ID.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${o_}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:i_}),jme=f({description:"Creates a tag policy for Tsuga-managed assets or telemetry data. Use the configuration type to choose the policy surface.",operationId:"createTagPolicy",tags:["tag-policies"],url:o_,method:"POST",body:p1,response:i_}),qme=f({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject changes to `tagKey` and reject `isActive: false` or `isRequired: false`.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${o_}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:p1,response:i_}),Hme=f({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be deleted.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${o_}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:q});var Kme=De({commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:Bme,get:Gme,create:jme,update:qme,delete:Hme}});var dh=`/${"v1"}/team-memberships`,l1=n.Pick(yC,["userId","teamId","roleKey"],{description:"Team membership request. Provide the user, team, and role assignment."}),R4e={userId:"user-123-abc",teamId:"team-123-abc",roleKey:"viewer"};Object.assign(l1,{examples:[R4e]});var zme=n.Pick($M,["userId","teamId"],{description:"Team membership removal request. Provide the user and team to disconnect."}),P4e={userId:"user-123-abc",teamId:"team-123-abc"};Object.assign(zme,{examples:[P4e]});var UP=n.Pick(wS,["id","userId","teamId","roleKey"],{$id:"TeamMembership",description:"Membership connecting one user to one team with a team role. See [Members](/documentation/account-and-settings/members) and [Teams](/documentation/account-and-settings/teams)."}),U4e={id:"membership-123-abc",userId:"user-123-abc",teamId:"team-123-abc",roleKey:"viewer"};Object.assign(UP,{examples:[U4e]});var Yme=f({description:"Lists team memberships, which users belong to which teams with which team role, optionally for one user or one team.",operationId:"getTeamMemberships",tags:["team-memberships"],url:dh,method:"GET",query:n.Optional(n.Object({userId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for the user with this ID. Omit to include memberships for any user."})),teamId:n.Optional(l({allowEmpty:!1,description:"Restrict results to memberships for the team with this ID. Omit to include memberships for any team."}))})),response:n.Array(UP)}),Vme=f({description:"Adds an existing organization user to a team with the requested team role. Fails if the user is already a member of the team; use bulk add if you want existing memberships to be skipped instead of rejected.",operationId:"addUserToTeam",tags:["team-memberships"],url:dh,method:"POST",body:l1,response:UP}),rCr=f({description:"Updates an existing team membership role. The user must already belong to the team.",operationId:"updateTeamMembership",tags:["team-memberships"],url:dh,method:"PUT",body:l1,response:UP}),Wme=f({description:"Removes a user from a team. This changes team access and may affect visibility of team-owned resources.",operationId:"removeUserFromTeam",tags:["team-memberships"],url:dh,method:"DELETE",body:zme,response:q}),nCr=f({description:"Adds multiple existing users to one team by user ID or email. The response reports per-user outcomes so callers can retry or inspect unresolved users.",operationId:"bulkAddUsersToTeam",tags:["team-memberships"],url:`${dh}/bulk-add`,method:"POST",body:EC,response:SC}),oCr=f({description:"Removes multiple users from one team by user ID or email. The response reports per-user outcomes so callers can inspect users that were missing or not members.",operationId:"bulkRemoveUsersFromTeam",tags:["team-memberships"],url:`${dh}/bulk-remove`,method:"DELETE",body:TC,response:_C});var Qme=De({commandName:"team-memberships",description:"Manage which users belong to which teams, and with which team role",endpoints:{list:Yme,create:Vme},extraSubcommands:[Kn("delete","Remove a user from a team",Wme)]});var s_=`/${"v1"}/teams`,a_=n.Pick(Dp,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership, visibility, and access to team-owned Tsuga resources. See [Teams](/documentation/account-and-settings/teams)."}),w4e={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(a_,{examples:[w4e]});var Zme=f({description:"Lists teams, the groups of users that own services, dashboards, monitors, routes, keys and policies.",operationId:"listTeams",tags:["teams"],url:s_,method:"GET",paginated:!0,query:n.Object({...We,name:mF}),response:n.Array(a_)}),Xme=f({description:"Retrieves one team by ID.",operationId:"getTeam",tags:["teams"],url:`${s_}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:a_}),d1=n.Pick(vR,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),v4e={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(d1,{examples:[v4e]});var Jme=f({description:"Creates a team for ownership and access control: assets and keys name a team as their owner. A new team sits outside every existing team, so the operation key must be scoped to all teams: a key scoped to its owning team cannot create teams, even with write access to teams.",operationId:"createTeam",tags:["teams"],url:s_,method:"POST",body:d1,response:a_}),efe=f({description:"Replaces a team definition by ID, including description, visibility, and tags. The name cannot be changed and must match the current one.",operationId:"updateTeam",tags:["teams"],url:`${s_}/:id`,method:"PUT",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:d1,response:a_}),tfe=f({description:"Deletes a team. Fails while the team still owns resources (dashboards, monitors, routes, API keys, etc.); reassign or delete those first. Team memberships are removed automatically as part of the deletion.",operationId:"deleteTeam",tags:["teams"],url:`${s_}/:id`,method:"DELETE",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:q});var rfe=De({commandName:"teams",description:"Manage teams",endpoints:{list:Zme,get:Xme,create:Jme,update:efe,delete:tfe}});var nfe=`/${"v1"}/users`,m1=n.Pick(cu,["id","email","name","role"],{$id:"User",description:"User account in the authenticated organization. See [Members](/documentation/account-and-settings/members)."}),N4e={id:"user-123-abc",email:"alex@example.com",name:"Alex Rivera",role:{type:"public_viewer"}};Object.assign(m1,{examples:[N4e]});var ofe=f({description:"Lists the users of the organization with their ID, email, name and organization role. Team memberships have their own endpoint.",operationId:"listUsers",tags:["users"],url:nfe,method:"GET",response:n.Array(m1)}),ife=f({description:"Retrieves one user by ID.",operationId:"getUser",tags:["users"],url:`${nfe}/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Identifier of the organization user to retrieve. Use the `id` returned by list users responses."})}),response:m1});var sfe=De({commandName:"users",description:"List and inspect the users of the organization (read-only)",endpoints:{list:ofe,get:ife}});var afe=[jce,Jce,iue,fue,Ppe,$pe,fle,Tle,Ple,ede,cde,gde,Cde,$de,Wde,ime,pme,wme,Kme,Qme,rfe,sfe];var f1={r:8,g:203,b:0},g1={r:0,g:130,b:0},h1=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function cfe(e=process.stdout.isTTY&&!process.env.NO_COLOR){if(!e)return`
|
|
@@ -310,7 +310,7 @@ ${a}`:`[${e}]`),a&&u?`${a}
|
|
|
310
310
|
${u}`:a||u}function R1(e,{maxDepth:t=1e3,numbersAsFloat:r=!1,strictTemporal:o=!1}={}){if(m_(e)!=="object")throw new TypeError("stringify can only be called with an object");let i=C1(0,e,"",t,r,o);return i[i.length-1]!==`
|
|
311
311
|
`?i+`
|
|
312
312
|
`:i}function l3e(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}var d3e=v("cli.setup.codex")(function*(e,t,r,o){let i=yield*tn,s=(0,P1.join)(e,".codex"),a=(0,P1.join)(s,"config.toml");yield*Fe(`Codex \u2192 ${a}`),yield*i.makeDirectory(s,{recursive:!0}).pipe(Jc("create",s));let u=yield*yg(a),p=yield*u===void 0?A({}):Et({try:()=>O1(u),catch:()=>new qn({message:`${a} is not valid TOML. Fix or remove it before re-running.`})}),m="otel"in p,{otel:g,...y}=p,E={...y,otel:l3e(t,r,o)},h=yield*Eg(a,u,yield*kP);yield*hg(a,R1(E)),yield*Fe(h===void 0?" created":m?` replaced existing [otel] tables (backup: ${h})`:` appended (backup: ${h})`)}),jfe=P("codex",{endpoint:LP,ingestionApiKey:MP,includePrompts:DP("user prompts")},v("cli.setup.codexCli")(function*(e){yield*d3e((0,Gfe.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*Fe(NP)})).pipe(U("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var qfe=P("setup").pipe(U("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),be([vfe,jfe]));var Hfe=Kn("contrast-sets","Compare two groups of spans and return the attributes that separate them",yee);var GP=je("trace-id").pipe(te("Trace ID to summarize"),Te("TRACE_ID"));var Kfe=P("latency-summary",{traceId:GP,...Vt,minRangeDurationMs:e4("min-range-duration-ms").pipe(te("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),Te("MILLISECONDS"),rt),ranges:Jn("ranges").pipe(te("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),Cn(!0))},v("cli.traces.latencySummary")(function*(e){yield*xe(yield*Ze(mee,{query:Sn({traceId:e.traceId,...yield*Vr(e),minRangeDurationMs:ue(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(U("Summarize where wall-clock time is spent in a trace, attributed per service"));var m3e=["start_time","duration","context.service.name","span.name","status_code","trace_id"],zfe=P("search",{...Vt,query:kp,maxResults:kg,pretty:Io},v("cli.traces.search")(function*(e){let t=yield*hn,{spans:r}=yield*er(LS,{query:yield*qg(e)});yield*t.rows(r,{...e,defaultFields:m3e})})).pipe(U("Search spans"));var Yfe=P("summarize",{traceId:GP,...Vt},v("cli.traces.summarize")(function*(e){yield*xe(yield*Ze(lee,{query:{traceId:e.traceId,...yield*Vr(e)}}))})).pipe(U("Summarize a trace by aggregating groups of similar spans into summary spans. Each span keeps service and env inline and points at its full resource context in `resources` via `resource_id`"));var Vfe=P("traces").pipe(U("Search and summarize traces"),be([Hfe,zfe,Yfe,Kfe]));var Wfe="/logs",Qfe="/explorer",U1="/analytics";var Zfe=n.Object({id:n.String({description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."}),url:n.String({description:"Relative app URL (path and search) the short link opens. Search parameters use the app URL encoding: object and array values are JSON-stringified, then URL-encoded."}),expiresAt:N({description:"Timestamp after which the short link stops resolving."})},{$id:"ShortUrl",description:"A short link copied with **Copy page URL** in the app, resolved to the app URL it opens. See [Copy and paste](/documentation/keyboard-shortcuts#copy-and-paste)."}),f3e={id:"aB3-dE5fG-h7J",url:"/logs?query=level%3Aerror&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(Zfe,{examples:[f3e]});var Xfe=f({description:"Resolves a short link copied with **Copy page URL** to the app URL it opens, which carries the page state, such as the query, filters and time range. An expired or unknown code returns 404.",operationId:"getShortUrl",tags:["short-urls"],url:`/${"v1"}/short-urls/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."})}),response:Zfe});var Jfe=n.Object({id:n.String({description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."}),title:n.Optional(n.String({description:"Name of the widget the link was shared from. Omitted when the widget had no name."})),search:n.String({description:"Analytics search parameters captured when the link was created, without the leading `?`. Values use the app URL encoding: object and array values are JSON-stringified, then URL-encoded. `timeZone` is the time zone of the user who created the link, which the shared image uses."}),dashboardId:n.Optional(n.String({description:"ID of the dashboard holding the shared widget. Omitted for Analytics shares."})),graphId:n.Optional(n.String({description:"ID of the shared widget on its dashboard. Omitted for Analytics shares."})),url:n.String({description:"Absolute app URL a signed-in browser opening the share link is redirected to: the widget on its dashboard, or Analytics. It carries no `timeZone`, so the app shows the result in the time zone of the viewer."}),expiresAt:N({description:"Timestamp after which the share link stops resolving."})},{$id:"WidgetShare",description:"A widget share link created from Analytics or a dashboard widget, with the query it renders. See [Share links](/documentation/visualize/analytics/index#share-links)."}),g3e={id:"kL9-mN2pQ-r4S",title:"Checkout errors",search:"source=logs&queries=%5B%7B%22aggregate%22%3A%7B%22type%22%3A%22count%22%7D%2C%22filter%22%3A%22service%3Acheckout%22%7D%5D&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",dashboardId:"dashboard-123-abc",graphId:"graph-123-abc",url:"https://app.tsuga.com/dashboards/dashboard-123-abc?openedGraph=graph-123-abc&openedGraphReadonly=true&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(Jfe,{examples:[g3e]});var ege=f({description:"Resolves a widget share link, whose unfurl only shows an image, to the query behind it: widget title, Analytics search and dashboard. An expired or unknown code returns 404.",operationId:"getWidgetShare",tags:["public","widget-shares"],url:`/${"v1"}/widget-shares/:id`,method:"GET",params:n.Object({id:l({allowEmpty:!1,description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."})}),response:Jfe});var h3e=/^\/l\/([^/]+)\/?$/,y3e=/^\/v0\/widget-shares\/[^/]+\/([^/]+?)(?:\/image\.png)?\/?$/,E3e={[Wfe]:"logs-explorer",[Qfe]:"logs-explorer","/traces":"traces-explorer",[U1]:"analytics"};function S3e(e){if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:"||!T3e(t.hostname))return;let r=y3e.exec(t.pathname);if(r?.[1])return{type:"widget-share",code:decodeURIComponent(r[1])};if(t.hostname.startsWith("api."))return;let o=h3e.exec(t.pathname);return o?.[1]?{type:"explorer-short-link",origin:t.origin,code:decodeURIComponent(o[1])}:{type:"app-url",url:t}}function T3e(e){return e==="localhost"||e==="127.0.0.1"||["tsuga.com","tsuga-staging.com"].some(t=>e===t||e.endsWith(`.${t}`))}function w1(e,t,{search:r=t.search,...o}={}){return Et({try:()=>{let i=_3e(r);return"timeRange"in i&&(i.timeRange=I3e(i.timeRange)),{type:e,url:t.href,view:b3e(t.pathname),path:t.pathname,...o,searchParams:i}},catch:()=>new _d({message:"The link contains an invalid time range."})})}function _3e(e){let t={};for(let[r,o]of new URLSearchParams(e))try{t[r]=JSON.parse(o)}catch{t[r]=o}return t}function I3e(e){if(e===null||typeof e!="object")return e;let{type:t,from:r,to:o}=e;return t!=="absolute"||typeof r!="number"||typeof o!="number"?e:{type:t,from:Ac(Es(r)),to:Ac(Es(o))}}function b3e(e){return e.startsWith("/dashboards/")?"dashboard":E3e[e]}var tge=P("unshorten",{url:gr("URL").pipe(Ht("A short link from Copy page URL, a widget share link, or a full app.tsuga.com URL"))},v("cli.unshorten")(function*({url:e}){let t=yield*Et({try:()=>S3e(e.trim()),catch:()=>new _d({message:"The link contains invalid URL encoding."})});if(t===void 0)return yield*new _d({message:`Not a Tsuga short link, widget share link, or app URL: ${e}`,suggestions:["Pass a short link (https://app.tsuga.com/l/<code>), a widget share link (https://api.tsuga.com/v0/widget-shares/<orgId>/<code>), or an app.tsuga.com URL"]});switch(t.type){case"app-url":yield*xe({data:yield*w1("app-url",t.url)});return;case"explorer-short-link":{let r=yield*er(Xfe,{params:{id:t.code}});yield*xe({data:yield*w1("explorer-short-link",new URL(r.url,t.origin),{expiresAt:r.expiresAt})});return}case"widget-share":{let r=yield*er(ege,{params:{id:t.code}}),o=new URL(r.url);yield*xe({data:yield*w1("widget-share",o,{search:r.search,expiresAt:r.expiresAt,widget:{title:r.title,dashboardId:r.dashboardId,graphId:r.graphId,analyticsUrl:new URL(`${U1}?${r.search}`,o.origin).href}})});return}default:Nt(t)}})).pipe(U("Expand a Tsuga short link or widget share link and decode its query, time range, and view"));var rge=ufe.pipe(be([{group:"Resources",commands:afe},{group:"Query & explore",commands:[Iae,Nae,Vfe,Gae,Ife,soe,Ufe,dse,bse,hae,Lce,qae,bie,nse,tge]},{group:"Documentation, help & feedback",commands:[Lie,ase,Ofe]},{group:"Setup & config",commands:[Eie,vie,Oie,qfe,Tse,Cfe]}]),Hx(ag,e=>e.fields),Hx(wa,e=>({operationApiKey:ue(e.operationApiKey),cluster:ue(e.cluster),rationale:ue(e.rationale)})),M4(hn.pageLayer)),v1=rge.pipe(Hx(c_,()=>({root:rge})));function nge(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=(r[i]??0)-(o[i]??0);if(s!==0)return s}return 0}var x3e=3e3,O3e="https://registry.npmjs.org/@tsuga/cli/latest",A3e=dn({version:Se}),C3e=jo(A3e),R3e=v("cli.checkForUpdate")(function*(e){let t=yield*yt,r=yield*Jl,o=yield*Wn,i=yield*t.getLastUpdateCheck;if(i&&o-Date.parse(i)<Pa)return;let s=yield*r.get(O3e).pipe(G(jk),G(a=>a.json),G(C3e),$2(x3e),M2);In(s)||(nge(s.value.version,e)>0&&(yield*jn(`
|
|
313
|
-
Update available: ${e} \u2192 ${s.value.version}`),yield*jn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(Ac(Es(o))))}),oge=e=>hc(R3e(e));IM(process.stdout);IM(process.stderr);var P3e=Rm(yt.layer,Op.layer).pipe(Pm(ug.layer),Pm(l3),Pm(UY)),N1=process.argv.slice(2),age=N1.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),k1,cge=e=>{k1=e;for(let t of HA)process.removeListener(t,cge)};for(let e of HA)process.once(e,cge);var uge=fse(process.stdout,process.stderr);process.on("exit",uge.release);var ige=Ak(v1,{version:"1.
|
|
313
|
+
Update available: ${e} \u2192 ${s.value.version}`),yield*jn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(Ac(Es(o))))}),oge=e=>hc(R3e(e));IM(process.stdout);IM(process.stderr);var P3e=Rm(yt.layer,Op.layer).pipe(Pm(ug.layer),Pm(l3),Pm(UY)),N1=process.argv.slice(2),age=N1.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),k1,cge=e=>{k1=e;for(let t of HA)process.removeListener(t,cge)};for(let e of HA)process.once(e,cge);var uge=fse(process.stdout,process.stderr);process.on("exit",uge.release);var ige=Ak(v1,{version:"1.213.0"})(N1).pipe(gse(uge)),sge=cg(process.env)?jn(VA):Oe,U3e=age?ige:Iee(ige,N1,v1,()=>k1).pipe(pn(oge("1.213.0")));U3e.pipe(Ro(e=>XA(e)?pn(e.pipe(EX,jn,pn(sge)),ne(()=>process.exitCode=QA(e))):JA(e)&&!age?pn(e.commandPath.length>1?sge:Oe,ne(()=>process.exitCode=Ar.usage)):$(e)),jI(P3e),j2(_ee),Gi(d3,!0),e=>Z2(e,{teardown:(t,r)=>Uu(t)&&dc(t.cause)?r(ZA(k1)):Iv(t,r)}));
|
|
314
314
|
/**
|
|
315
315
|
* The following is a list of HTTP status codes and their meanings.
|
|
316
316
|
*
|