@tsuga/cli 1.1.1 → 1.3.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/README.md +27 -3
- package/dist/cli.js +71 -71
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`)}displayWidth(
|
|
4
|
-
`+" ".repeat(n+l)),c+
|
|
5
|
-
${c}`)}boxWrap(
|
|
6
|
-
`)}};function
|
|
2
|
+
"use strict";var kw=Object.create;var Op=Object.defineProperty;var Mw=Object.getOwnPropertyDescriptor;var Dw=Object.getOwnPropertyNames;var Gw=Object.getPrototypeOf,$w=Object.prototype.hasOwnProperty;var hn=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),vt=(e,r)=>{for(var n in r)Op(e,n,{get:r[n],enumerable:!0})},jw=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Dw(r))!$w.call(e,i)&&i!==n&&Op(e,i,{get:()=>r[i],enumerable:!(o=Mw(r,i))||o.enumerable});return e};var df=(e,r,n)=>(n=e!=null?kw(Gw(e)):{},jw(r||!e||!e.__esModule?Op(n,"default",{value:e,enumerable:!0}):n,e));var Ti=hn(xp=>{var Os=class extends Error{constructor(r,n,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=r,this.nestedError=void 0}},Ap=class extends Os{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};xp.CommanderError=Os;xp.InvalidArgumentError=Ap});var As=hn(Cp=>{var{InvalidArgumentError:qw}=Ti(),Rp=class{constructor(r,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,r[0]){case"<":this.required=!0,this._name=r.slice(1,-1);break;case"[":this.required=!1,this._name=r.slice(1,-1);break;default:this.required=!0,this._name=r;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(r,n){return n===this.defaultValue||!Array.isArray(n)?[r]:n.concat(r)}default(r,n){return this.defaultValue=r,this.defaultValueDescription=n,this}argParser(r){return this.parseArg=r,this}choices(r){return this.argChoices=r.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new qw(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,o):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Bw(e){let r=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+r+">":"["+r+"]"}Cp.Argument=Rp;Cp.humanReadableArgName=Bw});var wp=hn(Up=>{var{humanReadableArgName:Fw}=As(),Pp=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(r){this.helpWidth=this.helpWidth??r.helpWidth??80}visibleCommands(r){let n=r.commands.filter(i=>!i._hidden),o=r._getHelpCommand();return o&&!o._hidden&&n.push(o),this.sortSubcommands&&n.sort((i,a)=>i.name().localeCompare(a.name())),n}compareOptions(r,n){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(r).localeCompare(o(n))}visibleOptions(r){let n=r.options.filter(i=>!i.hidden),o=r._getHelpOption();if(o&&!o.hidden){let i=o.short&&r._findOption(o.short),a=o.long&&r._findOption(o.long);!i&&!a?n.push(o):o.long&&!a?n.push(r.createOption(o.long,o.description)):o.short&&!i&&n.push(r.createOption(o.short,o.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];let n=[];for(let o=r.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(r){return r._argsDescription&&r.registeredArguments.forEach(n=>{n.description=n.description||r._argsDescription[n.name()]||""}),r.registeredArguments.find(n=>n.description)?r.registeredArguments:[]}subcommandTerm(r){let n=r.registeredArguments.map(o=>Fw(o)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,n){return n.visibleCommands(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(r,n){return n.visibleOptions(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(r,n){return n.visibleGlobalOptions(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(r,n){return n.visibleArguments(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(r){let n=r._name;r._aliases[0]&&(n=n+"|"+r._aliases[0]);let o="";for(let i=r.parent;i;i=i.parent)o=i.name()+" "+o;return o+n+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){let n=[];return r.argChoices&&n.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&n.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&n.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&n.push(`env: ${r.envVar}`),n.length>0?`${r.description} (${n.join(", ")})`:r.description}argumentDescription(r){let n=[];if(r.argChoices&&n.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&n.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),n.length>0){let o=`(${n.join(", ")})`;return r.description?`${r.description} ${o}`:o}return r.description}formatHelp(r,n){let o=n.padWidth(r,n),i=n.helpWidth??80;function a(E,A){return n.formatItem(E,o,A,n)}let c=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(r))}`,""],m=n.commandDescription(r);m.length>0&&(c=c.concat([n.boxWrap(n.styleCommandDescription(m),i),""]));let l=n.visibleArguments(r).map(E=>a(n.styleArgumentTerm(n.argumentTerm(E)),n.styleArgumentDescription(n.argumentDescription(E))));l.length>0&&(c=c.concat([n.styleTitle("Arguments:"),...l,""]));let f=n.visibleOptions(r).map(E=>a(n.styleOptionTerm(n.optionTerm(E)),n.styleOptionDescription(n.optionDescription(E))));if(f.length>0&&(c=c.concat([n.styleTitle("Options:"),...f,""])),n.showGlobalOptions){let E=n.visibleGlobalOptions(r).map(A=>a(n.styleOptionTerm(n.optionTerm(A)),n.styleOptionDescription(n.optionDescription(A))));E.length>0&&(c=c.concat([n.styleTitle("Global Options:"),...E,""]))}let y=n.visibleCommands(r).map(E=>a(n.styleSubcommandTerm(n.subcommandTerm(E)),n.styleSubcommandDescription(n.subcommandDescription(E))));return y.length>0&&(c=c.concat([n.styleTitle("Commands:"),...y,""])),c.join(`
|
|
3
|
+
`)}displayWidth(r){return ff(r).length}styleTitle(r){return r}styleUsage(r){return r.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(r){return this.styleDescriptionText(r)}styleOptionDescription(r){return this.styleDescriptionText(r)}styleSubcommandDescription(r){return this.styleDescriptionText(r)}styleArgumentDescription(r){return this.styleDescriptionText(r)}styleDescriptionText(r){return r}styleOptionTerm(r){return this.styleOptionText(r)}styleSubcommandTerm(r){return r.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(r){return this.styleArgumentText(r)}styleOptionText(r){return r}styleArgumentText(r){return r}styleSubcommandText(r){return r}styleCommandText(r){return r}padWidth(r,n){return Math.max(n.longestOptionTermLength(r,n),n.longestGlobalOptionTermLength(r,n),n.longestSubcommandTermLength(r,n),n.longestArgumentTermLength(r,n))}preformatted(r){return/\n[^\S\r\n]/.test(r)}formatItem(r,n,o,i){let c=" ".repeat(2);if(!o)return c+r;let m=r.padEnd(n+r.length-i.displayWidth(r)),l=2,y=(this.helpWidth??80)-n-l-2,E;return y<this.minWidthToWrap||i.preformatted(o)?E=o:E=i.boxWrap(o,y).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(n+l)),c+m+" ".repeat(l)+E.replace(/\n/g,`
|
|
5
|
+
${c}`)}boxWrap(r,n){if(n<this.minWidthToWrap)return r;let o=r.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,a=[];return o.forEach(c=>{let m=c.match(i);if(m===null){a.push("");return}let l=[m.shift()],f=this.displayWidth(l[0]);m.forEach(y=>{let E=this.displayWidth(y);if(f+E<=n){l.push(y),f+=E;return}a.push(l.join(""));let A=y.trimStart();l=[A],f=this.displayWidth(A)}),a.push(l.join(""))}),a.join(`
|
|
6
|
+
`)}};function ff(e){let r=/\x1b\[\d*(;\d*)*m/g;return e.replace(r,"")}Up.Help=Pp;Up.stripColor=ff});var kp=hn(vp=>{var{InvalidArgumentError:Hw}=Ti(),Np=class{constructor(r,n){this.flags=r,this.description=n||"",this.required=r.includes("<"),this.optional=r.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(r),this.mandatory=!1;let o=Kw(r);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(r,n){return this.defaultValue=r,this.defaultValueDescription=n,this}preset(r){return this.presetArg=r,this}conflicts(r){return this.conflictsWith=this.conflictsWith.concat(r),this}implies(r){let n=r;return typeof r=="string"&&(n={[r]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(r){return this.envVar=r,this}argParser(r){return this.parseArg=r,this}makeOptionMandatory(r=!0){return this.mandatory=!!r,this}hideHelp(r=!0){return this.hidden=!!r,this}_concatValue(r,n){return n===this.defaultValue||!Array.isArray(n)?[r]:n.concat(r)}choices(r){return this.argChoices=r.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new Hw(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,o):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?gf(this.name().replace(/^no-/,"")):gf(this.name())}is(r){return this.short===r||this.long===r}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Lp=class{constructor(r){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,r.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(r,n){let o=n.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return n.negate===(a===r)}};function gf(e){return e.split("-").reduce((r,n)=>r+n[0].toUpperCase()+n.slice(1))}function Kw(e){let r,n,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(r=a.shift()),i.test(a[0])&&(n=a.shift()),!r&&o.test(a[0])&&(r=a.shift()),!r&&i.test(a[0])&&(r=n,n=a.shift()),a[0].startsWith("-")){let c=a[0],m=`option creation failed due to '${c}' in option flags '${e}'`;throw/^-[^-][^-]/.test(c)?new Error(`${m}
|
|
7
7
|
- a short flag is a single dash and a single character
|
|
8
8
|
- either use a single dash and a single character (for a short flag)
|
|
9
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${
|
|
10
|
-
- too many short flags`):i.test(c)?new Error(`${
|
|
11
|
-
- too many long flags`):new Error(`${
|
|
12
|
-
- unrecognised flag format`)}if(
|
|
9
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${m}
|
|
10
|
+
- too many short flags`):i.test(c)?new Error(`${m}
|
|
11
|
+
- too many long flags`):new Error(`${m}
|
|
12
|
+
- unrecognised flag format`)}if(r===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:r,longFlag:n}}vp.Option=Np;vp.DualOptions=Lp});var hf=hn(yf=>{function zw(e,r){if(Math.abs(e.length-r.length)>3)return Math.max(e.length,r.length);let n=[];for(let o=0;o<=e.length;o++)n[o]=[o];for(let o=0;o<=r.length;o++)n[0][o]=o;for(let o=1;o<=r.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===r[o-1]?a=0:a=1,n[i][o]=Math.min(n[i-1][o]+1,n[i][o-1]+1,n[i-1][o-1]+a),i>1&&o>1&&e[i-1]===r[o-2]&&e[i-2]===r[o-1]&&(n[i][o]=Math.min(n[i][o],n[i-2][o-2]+1))}return n[e.length][r.length]}function Yw(e,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));let n=e.startsWith("--");n&&(e=e.slice(2),r=r.map(c=>c.slice(2)));let o=[],i=3,a=.4;return r.forEach(c=>{if(c.length<=1)return;let m=zw(e,c),l=Math.max(e.length,c.length);(l-m)/l>a&&(m<i?(i=m,o=[c]):m===i&&o.push(c))}),o.sort((c,m)=>c.localeCompare(m)),n&&(o=o.map(c=>`--${c}`)),o.length>1?`
|
|
13
13
|
(Did you mean one of ${o.join(", ")}?)`:o.length===1?`
|
|
14
|
-
(Did you mean ${o[0]}?)`:""}
|
|
15
|
-
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=
|
|
16
|
-
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[
|
|
17
|
-
- already used by option '${n.flags}'`)}this.options.push(
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(
|
|
14
|
+
(Did you mean ${o[0]}?)`:""}yf.suggestSimilar=Yw});var _f=hn(jp=>{var Vw=require("node:events").EventEmitter,Mp=require("node:child_process"),mr=require("node:path"),xs=require("node:fs"),ce=require("node:process"),{Argument:Qw,humanReadableArgName:Ww}=As(),{CommanderError:Dp}=Ti(),{Help:Zw,stripColor:Xw}=wp(),{Option:Tf,DualOptions:Jw}=kp(),{suggestSimilar:Ef}=hf(),Gp=class e extends Vw{constructor(r){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=r||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>ce.stdout.write(n),writeErr:n=>ce.stderr.write(n),outputError:(n,o)=>o(n),getOutHelpWidth:()=>ce.stdout.isTTY?ce.stdout.columns:void 0,getErrHelpWidth:()=>ce.stderr.isTTY?ce.stderr.columns:void 0,getOutHasColors:()=>$p()??(ce.stdout.isTTY&&ce.stdout.hasColors?.()),getErrHasColors:()=>$p()??(ce.stderr.isTTY&&ce.stderr.hasColors?.()),stripColor:n=>Xw(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(r){return this._outputConfiguration=r._outputConfiguration,this._helpOption=r._helpOption,this._helpCommand=r._helpCommand,this._helpConfiguration=r._helpConfiguration,this._exitCallback=r._exitCallback,this._storeOptionsAsProperties=r._storeOptionsAsProperties,this._combineFlagAndOptionalValue=r._combineFlagAndOptionalValue,this._allowExcessArguments=r._allowExcessArguments,this._enablePositionalOptions=r._enablePositionalOptions,this._showHelpAfterError=r._showHelpAfterError,this._showSuggestionAfterError=r._showSuggestionAfterError,this}_getCommandAndAncestors(){let r=[];for(let n=this;n;n=n.parent)r.push(n);return r}command(r,n,o){let i=n,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,c,m]=r.match(/([^ ]+) *(.*)/),l=this.createCommand(c);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,m&&l.arguments(m),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(r){return new e(r)}createHelp(){return Object.assign(new Zw,this.configureHelp())}configureHelp(r){return r===void 0?this._helpConfiguration:(this._helpConfiguration=r,this)}configureOutput(r){return r===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,r),this)}showHelpAfterError(r=!0){return typeof r!="string"&&(r=!!r),this._showHelpAfterError=r,this}showSuggestionAfterError(r=!0){return this._showSuggestionAfterError=!!r,this}addCommand(r,n){if(!r._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=r._name),(n.noHelp||n.hidden)&&(r._hidden=!0),this._registerCommand(r),r.parent=this,r._checkForBrokenPassThrough(),this}createArgument(r,n){return new Qw(r,n)}argument(r,n,o,i){let a=this.createArgument(r,n);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(r){return r.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(r){let n=this.registeredArguments.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(r.required&&r.defaultValue!==void 0&&r.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${r.name()}'`);return this.registeredArguments.push(r),this}helpCommand(r,n){if(typeof r=="boolean")return this._addImplicitHelpCommand=r,this;r=r??"help [command]";let[,o,i]=r.match(/([^ ]+) *(.*)/),a=n??"display help for command",c=this.createCommand(o);return c.helpOption(!1),i&&c.arguments(i),a&&c.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=c,this}addHelpCommand(r,n){return typeof r!="object"?(this.helpCommand(r,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=r,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(r,n){let o=["preSubcommand","preAction","postAction"];if(!o.includes(r))throw new Error(`Unexpected value for event passed to hook : '${r}'.
|
|
16
|
+
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[r]?this._lifeCycleHooks[r].push(n):this._lifeCycleHooks[r]=[n],this}exitOverride(r){return r?this._exitCallback=r:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(r,n,o){this._exitCallback&&this._exitCallback(new Dp(r,n,o)),ce.exit(r)}action(r){let n=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),r.apply(this,a)};return this._actionHandler=n,this}createOption(r,n){return new Tf(r,n)}_callParseArg(r,n,o,i){try{return r.parseArg(n,o)}catch(a){if(a.code==="commander.invalidArgument"){let c=`${i} ${a.message}`;this.error(c,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(r){let n=r.short&&this._findOption(r.short)||r.long&&this._findOption(r.long);if(n){let o=r.long&&this._findOption(r.long)?r.long:r.short;throw new Error(`Cannot add option '${r.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
|
|
17
|
+
- already used by option '${n.flags}'`)}this.options.push(r)}_registerCommand(r){let n=i=>[i.name()].concat(i.aliases()),o=n(r).find(i=>this._findCommand(i));if(o){let i=n(this._findCommand(o)).join("|"),a=n(r).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(r)}addOption(r){this._registerOption(r);let n=r.name(),o=r.attributeName();if(r.negate){let a=r.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,r.defaultValue===void 0?!0:r.defaultValue,"default")}else r.defaultValue!==void 0&&this.setOptionValueWithSource(o,r.defaultValue,"default");let i=(a,c,m)=>{a==null&&r.presetArg!==void 0&&(a=r.presetArg);let l=this.getOptionValue(o);a!==null&&r.parseArg?a=this._callParseArg(r,a,l,c):a!==null&&r.variadic&&(a=r._concatValue(a,l)),a==null&&(r.negate?a=!1:r.isBoolean()||r.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,m)};return this.on("option:"+n,a=>{let c=`error: option '${r.flags}' argument '${a}' is invalid.`;i(a,c,"cli")}),r.envVar&&this.on("optionEnv:"+n,a=>{let c=`error: option '${r.flags}' value '${a}' from env '${r.envVar}' is invalid.`;i(a,c,"env")}),this}_optionEx(r,n,o,i,a){if(typeof n=="object"&&n instanceof Tf)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(n,o);if(c.makeOptionMandatory(!!r.mandatory),typeof i=="function")c.default(a).argParser(i);else if(i instanceof RegExp){let m=i;i=(l,f)=>{let y=m.exec(l);return y?y[0]:f},c.default(a).argParser(i)}else c.default(i);return this.addOption(c)}option(r,n,o,i){return this._optionEx({},r,n,o,i)}requiredOption(r,n,o,i){return this._optionEx({mandatory:!0},r,n,o,i)}combineFlagAndOptionalValue(r=!0){return this._combineFlagAndOptionalValue=!!r,this}allowUnknownOption(r=!0){return this._allowUnknownOption=!!r,this}allowExcessArguments(r=!0){return this._allowExcessArguments=!!r,this}enablePositionalOptions(r=!0){return this._enablePositionalOptions=!!r,this}passThroughOptions(r=!0){return this._passThroughOptions=!!r,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(r=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!r,this}getOptionValue(r){return this._storeOptionsAsProperties?this[r]:this._optionValues[r]}setOptionValue(r,n){return this.setOptionValueWithSource(r,n,void 0)}setOptionValueWithSource(r,n,o){return this._storeOptionsAsProperties?this[r]=n:this._optionValues[r]=n,this._optionValueSources[r]=o,this}getOptionValueSource(r){return this._optionValueSources[r]}getOptionValueSourceWithGlobals(r){let n;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(r)!==void 0&&(n=o.getOptionValueSource(r))}),n}_prepareUserArgs(r,n){if(r!==void 0&&!Array.isArray(r))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},r===void 0&&n.from===void 0){ce.versions?.electron&&(n.from="electron");let i=ce.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(n.from="eval")}r===void 0&&(r=ce.argv),this.rawArgs=r.slice();let o;switch(n.from){case void 0:case"node":this._scriptPath=r[1],o=r.slice(2);break;case"electron":ce.defaultApp?(this._scriptPath=r[1],o=r.slice(2)):o=r.slice(1);break;case"user":o=r.slice(0);break;case"eval":o=r.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(r,n){this._prepareForParse();let o=this._prepareUserArgs(r,n);return this._parseCommand([],o),this}async parseAsync(r,n){this._prepareForParse();let o=this._prepareUserArgs(r,n);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(r,n,o){if(xs.existsSync(r))return;let i=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${r}' does not exist
|
|
19
19
|
- if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${i}`;throw new Error(a)}_executeSubCommand(
|
|
21
|
+
- ${i}`;throw new Error(a)}_executeSubCommand(r,n){n=n.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,E){let A=mr.resolve(y,E);if(xs.existsSync(A))return A;if(i.includes(mr.extname(E)))return;let ye=i.find(Ue=>xs.existsSync(`${A}${Ue}`));if(ye)return`${A}${ye}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=r._executableFile||`${this._name}-${r._name}`,m=this._executableDir||"";if(this._scriptPath){let y;try{y=xs.realpathSync(this._scriptPath)}catch{y=this._scriptPath}m=mr.resolve(mr.dirname(y),m)}if(m){let y=a(m,c);if(!y&&!r._executableFile&&this._scriptPath){let E=mr.basename(this._scriptPath,mr.extname(this._scriptPath));E!==this._name&&(y=a(m,`${E}-${r._name}`))}c=y||c}o=i.includes(mr.extname(c));let l;ce.platform!=="win32"?o?(n.unshift(c),n=If(ce.execArgv).concat(n),l=Mp.spawn(ce.argv[0],n,{stdio:"inherit"})):l=Mp.spawn(c,n,{stdio:"inherit"}):(this._checkForMissingExecutable(c,m,r._name),n.unshift(c),n=If(ce.execArgv).concat(n),l=Mp.spawn(ce.execPath,n,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(E=>{ce.on(E,()=>{l.killed===!1&&l.exitCode===null&&l.kill(E)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new Dp(y,"commander.executeSubCommandAsync","(close)")):ce.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(c,m,r._name);else if(y.code==="EACCES")throw new Error(`'${c}' not executable`);if(!f)ce.exit(1);else{let E=new Dp(1,"commander.executeSubCommandAsync","(error)");E.nestedError=y,f(E)}}),this.runningCommand=l}_dispatchSubcommand(r,n,o){let i=this._findCommand(r);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,n.concat(o));else return i._parseCommand(n,o)}),a}_dispatchHelpCommand(r){r||this.help();let n=this._findCommand(r);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(r,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((r,n)=>{r.required&&this.args[n]==null&&this.missingArgument(r.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let r=(o,i,a)=>{let c=i;if(i!==null&&o.parseArg){let m=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;c=this._callParseArg(o,i,a,m)}return c};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((c,m)=>r(o,m,c),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=r(o,a,o.defaultValue))),n[i]=a}),this.processedArgs=n}_chainOrCall(r,n){return r&&r.then&&typeof r.then=="function"?r.then(()=>n()):n()}_chainOrCallHooks(r,n){let o=r,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[n]!==void 0).forEach(a=>{a._lifeCycleHooks[n].forEach(c=>{i.push({hookedCommand:a,callback:c})})}),n==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(r,n,o){let i=r;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,n))}),i}_parseCommand(r,n){let o=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),r=r.concat(o.operands),n=o.unknown,this.args=r.concat(n),r&&this._findCommand(r[0]))return this._dispatchSubcommand(r[0],r.slice(1),n);if(this._getHelpCommand()&&r[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(r[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,r,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let c;return c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent&&(c=this._chainOrCall(c,()=>{this.parent.emit(a,r,n)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,r,n);else if(r.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",r,n);this.listenerCount("command:*")?this.emit("command:*",r,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(r){if(r)return this.commands.find(n=>n._name===r||n._aliases.includes(r))}_findOption(r){return this.options.find(n=>n.is(r))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(r=>{r.options.forEach(n=>{n.mandatory&&r.getOptionValue(n.attributeName())===void 0&&r.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let r=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});r.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=r.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(r=>{r._checkForConflictingLocalOptions()})}parseOptions(r){let n=[],o=[],i=n,a=r.slice();function c(l){return l.length>1&&l[0]==="-"}let m=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(m&&!c(l)){this.emit(`option:${m.name()}`,l);continue}if(m=null,c(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!c(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);m=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(c(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&o.length===0){if(this._findCommand(l)){n.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l),a.length>0&&n.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:n,unknown:o}}opts(){if(this._storeOptionsAsProperties){let r={},n=this.options.length;for(let o=0;o<n;o++){let i=this.options[o].attributeName();r[i]=i===this._versionOptionName?this._version:this[i]}return r}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((r,n)=>Object.assign(r,n.opts()),{})}error(r,n){this._outputConfiguration.outputError(`${r}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0}));let o=n||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,
|
|
25
|
-
`),this._exit(0,"commander.version",
|
|
26
|
-
Expecting one of '${o.join("', '")}'`);let i=`${
|
|
27
|
-
`)}),this}_outputHelpIfRequested(
|
|
28
|
-
`)}function
|
|
29
|
-
`)}var hd="/oauth/callback",yP=5*ap,hP="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",Ja="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function EP(e){if((0,yd.platform)()!=="darwin")return!1;try{let t=(0,fd.spawn)("open",[e],{stdio:"ignore",detached:!0});return t.on("error",()=>{}),t.unref(),!0}catch{}return!1}async function TP(e,t,n){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},yP),c=(u,l,f,y)=>{u.writeHead(l,{"Content-Type":"text/html"}),u.end(f),clearTimeout(a),y()};e.on("request",(u,l)=>{let f=new URL(u.url??"/",n);if(f.pathname!==hd){l.writeHead(404,{"Content-Type":"text/html"}),l.end(Ja);return}let y=f.searchParams.get("error");if(y){let S=f.searchParams.get("error_description")??"";c(l,400,Ja,()=>i(new Error(`Authorization failed: ${y}${S?` (${S})`:""}`)));return}if(f.searchParams.get("state")!==t){c(l,400,Ja,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(l,400,Ja,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(l,200,hP,()=>o(E))})})}async function Ed(e){let t=(0,gd.createServer)();t.on("connection",a=>a.unref()),await new Promise((a,c)=>{t.once("error",c),t.listen(0,"127.0.0.1",()=>{t.off("error",c),a()})});let{port:n}=t.address(),o=`http://127.0.0.1:${n}`,i=`${o}${hd}`;try{let a=e.buildAuthorizeUrl(i),c=EP(a);return q(c?"Opening your browser to complete login. If it does not open, visit:":"Visit this URL in your browser to complete login:"),q(` ${a}`),{code:await TP(t,e.state,o),redirectUri:i}}finally{t.close()}}var g={};kt(g,{Assign:()=>IP,Clone:()=>ri,Create:()=>bU,Discard:()=>OU,Metrics:()=>Dt,Update:()=>AU});var Dt={assign:0,create:0,clone:0,discard:0,update:0};function IP(e,t){return Dt.assign+=1,{...e,...t}}var s={};kt(s,{Entries:()=>BP,EntriesRegExp:()=>FP,Every:()=>GP,EveryAll:()=>jP,GraphemeCount:()=>vP,HasPropertyKey:()=>qP,IsArray:()=>on,IsAsyncIterator:()=>xP,IsBigInt:()=>ti,IsBoolean:()=>Sd,IsClassInstance:()=>LP,IsConstructor:()=>RP,IsDeepEqual:()=>gp,IsEqual:()=>J,IsFunction:()=>xd,IsGreaterEqualThan:()=>Cd,IsGreaterThan:()=>NP,IsInteger:()=>dp,IsIterator:()=>CP,IsLessEqualThan:()=>Rd,IsLessThan:()=>kP,IsMaxLength:()=>DP,IsMinLength:()=>$P,IsMultipleOf:()=>wP,IsNull:()=>ns,IsNumber:()=>os,IsObject:()=>an,IsObjectNotArray:()=>PP,IsString:()=>xr,IsSymbol:()=>UP,IsUndefined:()=>fp,IsValueLike:()=>MP,Keys:()=>rs,Symbols:()=>HP,Values:()=>KP});function Sr(e,t,n){return e>=t&&e<=n}function Td(e){return Sr(e,127462,127487)}function _P(e){return Sr(e,65024,65039)}function bP(e){return Sr(e,768,879)||Sr(e,6832,6911)||Sr(e,7616,7679)||Sr(e,65056,65071)}function ts(e){return e>65535?2:1}function Id(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(bP(n)||_P(n))t+=ts(n);else break}return t}function lp(e,t){let n=e.codePointAt(t),o=t+ts(n);for(o=Id(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+ts(i),o=Id(e,o)}return Td(n)&&o<e.length&&Td(e.codePointAt(o))&&(o+=ts(e.codePointAt(o))),o}function _d(e){return Sr(e,55296,56319)||Sr(e,768,879)||e===8205}function bd(e){let t=0,n=0;for(;n<e.length;)n=lp(e,n),t++;return t}function OP(e,t){let n=0,o=0;for(;o<e.length;)if(o=lp(e,o),n++,n>=t)return!0;return!1}function AP(e,t){let n=0,o=0;for(;o<e.length;)if(o=lp(e,o),n++,n>t)return!1;return!0}function Od(e,t){let n=0;for(;n<e.length;){if(_d(e.charCodeAt(n)))return OP(e,t);if(n++,n>=t)return!0}return!1}function Ad(e,t){let n=0;for(;n<e.length;){if(_d(e.charCodeAt(n)))return AP(e,t);if(n++,n>t)return!1}return!0}function on(e){return Array.isArray(e)}function xP(e){return an(e)&&Symbol.asyncIterator in e}function ti(e){return J(typeof e,"bigint")}function Sd(e){return J(typeof e,"boolean")}function RP(e){if(fp(e)||!xd(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function xd(e){return J(typeof e,"function")}function dp(e){return Number.isInteger(e)}function CP(e){return an(e)&&Symbol.iterator in e}function ns(e){return J(e,null)}function os(e){return Number.isFinite(e)}function PP(e){return an(e)&&!on(e)}function an(e){return J(typeof e,"object")&&!ns(e)}function xr(e){return J(typeof e,"string")}function UP(e){return J(typeof e,"symbol")}function fp(e){return J(e,void 0)}function J(e,t){return e===t}function NP(e,t){return e>t}function kP(e,t){return e<t}function Rd(e,t){return e<=t}function Cd(e,t){return e>=t}function wP(e,t){if(ti(e)||ti(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!os(e)||dp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<n}function LP(e){if(!an(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return ns(t)?!1:J(typeof t.constructor,"function")&&!(J(t.constructor,globalThis.Object)||J(t.constructor.name,"Object"))}function MP(e){return ti(e)||Sd(e)||ns(e)||os(e)||xr(e)||fp(e)}function vP(e){return bd(e)}function DP(e,t){return Ad(e,t)}function $P(e,t){return Od(e,t)}function GP(e,t,n){for(let o=t;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function jP(e,t,n){let o=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(o=!1);return o}function qP(e,t){return J(t,"__proto__")||J(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function FP(e){return rs(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function BP(e){return Object.entries(e)}function rs(e){return Object.getOwnPropertyNames(e)}function HP(e){return Object.getOwnPropertySymbols(e)}function KP(e){return Object.values(e)}function zP(e,t){if(!an(t))return!1;let n=rs(e);return J(n.length,rs(t).length)&&n.every(o=>gp(e[o],t[o]))}function VP(e,t){return on(t)&&J(e.length,t.length)&&e.every((n,o)=>gp(e[o],t[o]))}function gp(e,t){return on(e)?VP(e,t):an(e)?zP(e,t):J(e,t)}var nt={};kt(nt,{IsBigInt64Array:()=>sU,IsBigUint64Array:()=>cU,IsBoolean:()=>YP,IsDate:()=>mU,IsFloat32Array:()=>iU,IsFloat64Array:()=>aU,IsInt16Array:()=>tU,IsInt32Array:()=>nU,IsInt8Array:()=>XP,IsMap:()=>lU,IsNumber:()=>QP,IsRegExp:()=>pU,IsSet:()=>uU,IsString:()=>WP,IsTypeArray:()=>ZP,IsUint16Array:()=>rU,IsUint32Array:()=>oU,IsUint8Array:()=>JP,IsUint8ClampedArray:()=>eU});function YP(e){return e instanceof Boolean}function QP(e){return e instanceof Number}function WP(e){return e instanceof String}function ZP(e){return globalThis.ArrayBuffer.isView(e)}function XP(e){return e instanceof globalThis.Int8Array}function JP(e){return e instanceof globalThis.Uint8Array}function eU(e){return e instanceof globalThis.Uint8ClampedArray}function tU(e){return e instanceof globalThis.Int16Array}function rU(e){return e instanceof globalThis.Uint16Array}function nU(e){return e instanceof globalThis.Int32Array}function oU(e){return e instanceof globalThis.Uint32Array}function iU(e){return e instanceof globalThis.Float32Array}function aU(e){return e instanceof globalThis.Float64Array}function sU(e){return e instanceof globalThis.BigInt64Array}function cU(e){return e instanceof globalThis.BigUint64Array}function pU(e){return e instanceof globalThis.RegExp}function mU(e){return e instanceof globalThis.Date}function uU(e){return e instanceof globalThis.Set}function lU(e){return e instanceof globalThis.Map}function fU(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function gU(e){return e.map(t=>yp(t))}function yU(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(n)){let i=n[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:yp(i.value)})}return t}function hU(e){return new RegExp(e.source,e.flags)}function yp(e){return e instanceof RegExp?hU(e):fU(e)?e:s.IsArray(e)?gU(e):s.IsObject(e)?yU(e):e}function ri(e){return Dt.clone+=1,yp(e)}var xt={};kt(xt,{Get:()=>IU,Reset:()=>EU,Set:()=>TU});var sn={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function EU(){sn.immutableTypes=!1,sn.maxErrors=8,sn.useEval=!0,sn.exactOptionalPropertyTypes=!1,sn.enumerableKind=!1}function TU(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(sn,t,{value:n})}}function IU(){return sn}function _U(e,t,n={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function Pd(e,t){return{...e,...t}}function bU(e,t,n={}){Dt.create+=1;let o=xt.Get(),i=Pd(t,n),a=o.enumerableKind?Pd(i,e):_U(i,e);return o.immutableTypes?Object.freeze(a):a}function OU(e,t){Dt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(ri(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function AU(e,t,n){Dt.update+=1;let o=xt.Get(),i=ri(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function _(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function O(e){return s.IsObject(e)}function Ud(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function Nd(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&O(e.type)}function kd(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function wd(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&O(e.type)}function Ld(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Md(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&O(e.type)}function vd(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Dd(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&O(e.type)}function C(e,t,n){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:n},{})}function $d(e){return _(e,"Deferred")}function hp(e){return g.Update(e,{"~immutable":!0},{})}function Rr(e){return hp(e)}function cn(e){return O(e)&&s.HasPropertyKey(e,"~immutable")}function Vn(e){return g.Discard(e,["~optional"])}function ut(e){return g.Update(e,{"~optional":!0},{})}function is(e){return ut(e)}function we(e){return O(e)&&s.HasPropertyKey(e,"~optional")}function as(e){return g.Discard(e,["~readonly"])}function lt(e){return g.Update(e,{"~readonly":!0},{})}function ss(e){return lt(e)}function pn(e){return O(e)&&s.HasPropertyKey(e,"~readonly")}function $t(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function ee(e){return _(e,"Array")}function cs(e){return g.Discard(e,["~kind","type","items"])}function Bt(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function et(e){return _(e,"AsyncIterator")}function Gd(e){return g.Discard(e,["~kind","type","iteratorItems"])}function jd(e){return{enumerable:xt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var ps=class{constructor(){globalThis.Object.defineProperty(this,"~kind",jd("Base")),globalThis.Object.defineProperty(this,"~guard",jd({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Rt(e){return _(e,"Base")}function Cr(e,t,n={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function Le(e){return _(e,"Constructor")}function qd(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function Pr(e,t,n={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function Me(e){return _(e,"Function")}function Fd(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function Ue(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function pe(e){return _(e,"Ref")}function Ur(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Yn(e){return _(e,"Generic")}var Bd="(?!)";function W(e){return g.Create({"~kind":"Never"},{not:{}},e)}function ar(e){return _(e,"Never")}function SU(){return["(not-resolvable)",W()]}function xU(){return["(not-generic)",W()]}function RU(e,t,n){return[e,Ur(t,n)]}function CU(e,t,n){return t in e?Hd(e,t,e[t],n):SU()}function Hd(e,t,n,o){return Yn(n)?RU(t,n.parameters,n.expression):pe(n)?CU(e,n.$ref,o):xU()}function Kd(e,t,n){return Hd(e,"(anonymous)",t,n)}function Ht(e,t,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},n)}function ue(e){return _(e,"Cyclic")}var ie={};kt(ie,{Match:()=>PU});function PU(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Ke(e){return g.Create({"~kind":"Unknown"},{},e)}function dt(e){return _(e,"Unknown")}function ni(...e){let[t,n]=ie.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Ke(),Ke()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function Se(e){return _(e,"Infer")}function Qn(e){return g.Create({"~kind":"Any"},{},e)}function ot(e){return _(e,"Any")}function zd(e){return s.IsObjectNotArray(e)}function Vd(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function Yd(e,t){let n=zd(e)?Vd(e):e;return g.Create({"~kind":"Enum"},{enum:n},t)}function xe(e){return _(e,"Enum")}function Ct(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return _(e,"Intersect")}function Qd(e){return g.Discard(e,["~kind","allOf"])}function B(){throw new Error("Unreachable")}var kr={};kt(kr,{Hash:()=>VU,HashCode:()=>rf});function UU(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&t.add(o);n=Object.getPrototypeOf(n)}return[...t]}function NU(e){return typeof e=="number"}var it;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(it||(it={}));var Wn=BigInt("14695981039346656037"),[kU,wU]=[BigInt("1099511628211"),BigInt("18446744073709551616")],LU=Array.from({length:256}).map((e,t)=>BigInt(t)),Jd=new Float64Array(1),ef=new DataView(Jd.buffer),tf=new Uint8Array(Jd.buffer);function ze(e){Wn=Wn^LU[e],Wn=Wn*kU%wU}function MU(e){ze(it.Array);for(let t of e)Nr(t)}function vU(e){ze(it.BigInt),ef.setBigInt64(0,e);for(let t of tf)ze(t)}function Zd(e){ze(it.Boolean),ze(e?1:0)}function DU(e){ze(it.Constructor),Nr(e.toString())}function $U(e){ze(it.Date),Nr(e.getTime())}function GU(e){ze(it.Function),Nr(e.toString())}function jU(e){ze(it.Null)}function Xd(e){ze(it.Number),ef.setFloat64(0,e,!0);for(let t of tf)ze(t)}function qU(e){ze(it.Object);for(let t of UU(e).sort())Nr(t),Nr(e[t])}function FU(e){ze(it.RegExp),Ep(e.toString())}var BU=new TextEncoder;function Ep(e){ze(it.String);for(let t of BU.encode(e))ze(t)}function HU(e){ze(it.Symbol),Nr(e.toString())}function KU(e){ze(it.TypeArray);let t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)ze(t[n])}function zU(e){return ze(it.Undefined)}function Nr(e){return nt.IsTypeArray(e)?KU(e):nt.IsDate(e)?$U(e):nt.IsRegExp(e)?FU(e):nt.IsBoolean(e)?Zd(e.valueOf()):nt.IsString(e)?Ep(e.valueOf()):nt.IsNumber(e)?Xd(e.valueOf()):NU(e)?Xd(e):s.IsArray(e)?MU(e):s.IsBoolean(e)?Zd(e):s.IsBigInt(e)?vU(e):s.IsConstructor(e)?DU(e):s.IsNull(e)?jU(e):s.IsObject(e)?qU(e):s.IsString(e)?Ep(e):s.IsSymbol(e)?HU(e):s.IsUndefined(e)?zU(e):s.IsFunction(e)?GU(e):B()}function rf(e){return Wn=BigInt("14695981039346656037"),Nr(e),Wn}function VU(e){return rf(e).toString(16).padStart(16,"0")}function nf(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var YU=nf;function of(){return YU}var oi=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,o=mn(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=mn(n)?c=>n["~codec"].encode(t(c)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},ii=class{constructor(t){this.type=t}Decode(t){return new oi(this.type,t)}};function ms(e){return new ii(e)}function sf(e,t){return ms(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function cf(e,t){return ms(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function mn(e){return O(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function WU(e,t){let n=us(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":n},{})}function pf(e,t,n="error"){return WU(e,{refine:t,message:n})}function us(e){return O(e)&&s.HasPropertyKey(e,"~refine")}var mf="-?(?:0|[1-9][0-9]*)n";function ai(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function ht(e){return _(e,"BigInt")}function ls(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function at(e){return _(e,"Boolean")}function si(e){return g.Create({"~kind":"Identifier"},{name:e})}function uf(e){return _(e,"Identifier")}var ds="-?(?:0|[1-9][0-9]*)";function un(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Ge(e){return _(e,"Integer")}function Kt(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function tt(e){return _(e,"Iterator")}function lf(e){return g.Discard(e,["~kind","type","iteratorItems"])}var Tp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function ZU(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Tp(e)})()}function V(e,t){return g.Create({"~kind":"Literal"},{type:ZU(e),const:e},t)}function fs(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function df(e){return Z(e)&&s.IsBigInt(e.const)}function ff(e){return Z(e)&&s.IsBoolean(e.const)}function Zn(e){return Z(e)&&s.IsNumber(e.const)}function Xn(e){return Z(e)&&s.IsString(e.const)}function Z(e){return _(e,"Literal")}function wr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function zt(e){return _(e,"Null")}var gs="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Pt(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function Te(e){return _(e,"Number")}function Jn(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function Vt(e){return _(e,"Symbol")}function gf(e){return s.Keys(e).filter(t=>!we(e[t]))}function yf(e){return s.Keys(e)}function ys(e){return s.Values(e)}function XU(e,t={}){let n=gf(e),o=n.length>0?{required:n}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=XU;function M(e){return _(e,"Object")}function hf(e){return g.Discard(e,["~kind","type","properties","required"])}function ln(...e){let[t,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Ke(),Ke()]});return g.Create({"~kind":"Parameter"},{name:t,extends:n,equals:o},{})}function Ef(e){return _(e,"Parameter")}function Yt(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function Ve(e){return _(e,"Promise")}function Tf(e){return g.Discard(e,["~kind","type","item"])}var hs=".*";function ft(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Ne(e){return _(e,"String")}function gt(e,t){let n="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:n,patternProperties:o})}var eo=`^${ds}$`,to=`^${gs}$`,Qt=`^${hs}$`;function ci(e,t,n={}){return C("Record",[e,t],n)}function JU(e,t,n={}){return R({},ci(e,t,n))}function Es(e,t,n={}){return JU(e,t,n)}function If(e,t){return gt(e,t)}function Et(e){return s.Keys(e.patternProperties)[0]}function ro(e){let t=Et(e);return s.IsEqual(t,eo)?un():s.IsEqual(t,to)?Pt():ft()}function Ye(e){return e.patternProperties[Et(e)]}function Ie(e){return _(e,"Record")}function dn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Lr(e){return _(e,"Rest")}function Ts(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function _f(e){return _(e,"This")}function je(e,t={}){let[n,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},t)}function Y(e){return _(e,"Tuple")}function bf(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function no(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Wt(e){return _(e,"Undefined")}function G(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function b(e){return _(e,"Union")}function Of(e){return g.Discard(e,["~kind","anyOf"])}function Af(e){return g.Create({"~kind":"Unsafe"},{},e)}function Sf(e){return _(e,"Unsafe")}function Is(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function Tt(e){return _(e,"Void")}function tN(e,t){return s.IsEqual(e,"Array")?$t(t[0]):s.IsEqual(e,"AsyncIterator")?Bt(t[0]):s.IsEqual(e,"Iterator")?Kt(t[0]):s.IsEqual(e,"Promise")?Yt(t[0]):s.IsEqual(e,"Awaited")?Ri(t[0]):s.IsEqual(e,"Capitalize")?mi(t[0]):s.IsEqual(e,"ConstructorParameters")?gi(t[0]):s.IsEqual(e,"Evaluate")?_p(t[0]):s.IsEqual(e,"Exclude")?yi(t[0],t[1]):s.IsEqual(e,"Extract")?hi(t[0],t[1]):s.IsEqual(e,"Index")?ao(t[0],t[1]):s.IsEqual(e,"InstanceType")?Ei(t[0]):s.IsEqual(e,"Lowercase")?ui(t[0]):s.IsEqual(e,"NonNullable")?Ti(t[0]):s.IsEqual(e,"Omit")?Ii(t[0],t[1]):s.IsEqual(e,"Options")?co(t[0],t[1]):s.IsEqual(e,"Parameters")?_i(t[0]):s.IsEqual(e,"Partial")?bi(t[0]):s.IsEqual(e,"Pick")?Oi(t[0],t[1]):s.IsEqual(e,"Readonly")?Ai(t[0]):s.IsEqual(e,"KeyOf")?so(t[0]):s.IsEqual(e,"Record")?ci(t[0],t[1]):s.IsEqual(e,"Required")?Si(t[0]):s.IsEqual(e,"ReturnType")?xi(t[0]):s.IsEqual(e,"Uncapitalize")?li(t[0]):s.IsEqual(e,"Uppercase")?di(t[0]):_s(Ue(e),t)}function fn(){throw Error("Unreachable")}var rN=(e,t=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),sr=e=>{let[t,n]=e;return rN([...t,...n])};function Uf(e){return ln(e[0],e[2],e[4])}function Nf(e){return ln(e[0],e[2],e[2])}function kf(e){return ln(e[0],Ke(),e[2])}function wf(e){return ln(e,Ke(),Ke())}function Lf(e){return sr(e)}function Mf(e){return e[1]}function vf(e){return sr(e)}function Df(e){return e[1]}function $f(e){return tN(e[0],e[1])}function Gf(e){return null}function jf(e){return ft()}function qf(e){return Pt()}function Ff(e){return ls()}function Bf(e){return no()}function Hf(e){return wr()}function Kf(e){return un()}function zf(e){return ai()}function Vf(e){return Ke()}function Yf(e){return Qn()}function Qf(e){return N({})}function Wf(e){return W()}function Zf(e){return Jn()}function Xf(e){return Is()}function Jf(e){return Ts()}function eg(e){return e[1]}function tg(e){return V(e)}function rg(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function ng(e){return e[1]}function og(e){return pi(e)}function ig(e){return V(BigInt(e))}function ag(e){return V(s.IsEqual(e,"true"))}function sg(e){return V(parseFloat(e))}function cg(e){return V(e)}function pg(e){return e.length>0}function mg(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function ug(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function lg(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var xf=(e,t)=>t.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?ao(n,i[0]):s.IsEqual(i.length,0)?$t(n):fn()},e),Rf=(e,t)=>s.IsEqual(t.length,3)?fi(e,t[0],t[1],t[2]):e;function dg(e){let[t,n,o,i]=e;return Rf(t?so(xf(n,o)):xf(n,o),i)}function Ip(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,o,i]=t,a=Ip(o,i);if(s.IsEqual(n,"&"))return U(a)?Ct([e,...a.allOf]):Ct([e,a]);if(s.IsEqual(n,"|"))return b(a)?G([e,...a.anyOf]):G([e,a]);fn()})():e}function fg(e){let[t,n]=e;return Ip(t,n)}function gg(e){let[t,n]=e;return Ip(t,n)}function yg(e){return hp(e[1])}function hg(e){return e[1]}function Eg(e){return Ur(e[0],e[2])}function Tg(e){return s.IsEqual(e.length,4)?ni(e[1],e[3]):s.IsEqual(e.length,2)?ni(e[1],Ke()):fn()}function Ig(e){return`${e}`}function _g(e){return Ge(e[3])?eo:Te(e[3])?to:Vt(e[3])?Qt:Ne(e[3])?Qt:fn()}function bg(e){return e.length>0}function Og(e){return e.length>0}function Ag(e){let[t,n,o,i,a]=e;return{[n]:t&&o?lt(ut(a)):t&&!o?lt(a):!t&&o?ut(a):a}}function Sg(e){return sr(e)}function xg(e){return e.reduce((t,n)=>s.HasPropertyKey(n,eo)||s.HasPropertyKey(n,to)||s.HasPropertyKey(n,Qt)?[t[0],g.Assign(t[1],n)]:[g.Assign(t[0],n),t[1]],[{},{}])}function Rg(e){return xg(e[1])}function Cg(e){let[t,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(t,o)}function Pg(e){return s.IsEqual(e.length,5)?lt(ut(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?lt(e[3]):ut(e[3]):fn()}function Ug(e){return lt(ut(e[1]))}function Ng(e){return lt(e[1])}function kg(e){return ut(e[0])}function wg(e){return s.IsEqual(e.length,2)?dn(e[1]):s.IsEqual(e.length,1)?e[0]:fn()}function Lg(e){return sr(e)}function Mg(e){return je(e[1])}function vg(e){return lt(ut(e[4]))}function Dg(e){return lt(e[3])}function $g(e){return ut(e[3])}function Gg(e){return e[2]}function jg(e){return s.IsEqual(e.length,2)?dn(e[1]):s.IsEqual(e.length,1)?e[0]:fn()}function qg(e){return sr(e)}function Fg(e){return Pr(e[1],e[4])}function Bg(e){return Cr(e[2],e[5])}function Cf(e,t){return s.IsEqual(e,"remove")?vd(t):s.IsEqual(e,"add")?Ld(t):t}function Hg(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Pf(e,t){return s.IsEqual(e,"remove")?kd(t):s.IsEqual(e,"add")?Ud(t):t}function Kg(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function zg(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Vg(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?oo(si(e[3]),e[5],e[6][0],Cf(e[1],Pf(e[8],e[10]))):oo(si(e[3]),e[5],Ue(e[3]),Cf(e[1],Pf(e[8],e[10])))}function Yg(e){return Ue(e)}function Qg(e){return co(e[2],e[4])}function Wg(e){return parseFloat(e)}function Zg(e){return s.IsEqual(e,"true")}function Xg(e){return null}function Jg(e){return{[e[0]]:e[2]}}function ey(e){return sr(e)}function nN(e){return e.reduce((t,n)=>g.Assign(t,n),{})}function ty(e){return nN(e[1])}function ry(e){return sr(e)}function ny(e){return e[1]}function oy(e){return ai()}function iy(e){return ft()}function ay(e){return Pt()}function sy(e){return un()}function cy(e){return W()}function py(e){return V(e)}function my(e){return G(e[1])}function uy(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function ly(e){return[e[0],...e[1]]}function dy(e){return e[1]}function fy(e){return sr(e)}function gy(e){return s.IsEqual(e.length,2)?e[1]:[]}function yy(e){let t=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Ur(t,io(n,o,a))}}function hy(e){let t=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:io(t,n,i)}}function Ey(e){return{[e[1]]:Ur(e[2],e[4])}}function Ty(e){return{[e[1]]:e[3]}}function Iy(e){return null}function _y(e){return xg(sr(e))}function by(e){return e[1]}function Oy(e){let t=e[0],n=e[1];return bp(g.Assign(t,n[0]))}function ae(e){return on(e)&&J(e.length,2)}function aN(e,t){return J(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ve(e,t){let[n,...o]=e;return xr(n)?(()=>{let i=aN(n,t);return J(i.length,2)?i:ve(o,t)})():[]}function Op(e,t){return Array.from({length:t-e+1},(n,o)=>String.fromCharCode(e+o))}var Ay=[...Op(97,122),...Op(65,90)],Ap="0",Sp=Op(49,57),po=[Ap,...Sp],Sy=" ",mo=`
|
|
30
|
-
`;var
|
|
31
|
-
`,n),([o,i])=>[[
|
|
32
|
-
`,n),([o,i])=>[[
|
|
33
|
-
`,e),([
|
|
34
|
-
`,n),([o,i])=>[[
|
|
35
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),hh=(e,t=[])=>p(p(Lp(e),([n,o])=>p(iw(o),([i,a])=>[[n,i],a])),([n,o])=>hh(o,[...t,n]),()=>[t,e]),aw=e=>p(p(hh(e),([t,n])=>p(p(p(Lp(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[_y(t),n]),Lp=e=>p(p(ow(e),([t,n])=>p(p(ew(n),([o,i])=>[o,i],()=>p(tw(n),([o,i])=>[o,i],()=>p(rw(n),([o,i])=>[o,i],()=>p(nw(n),([o,i])=>[o,i],()=>[])))),([o,i])=>p(By(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[by(t),n]),sw=e=>p(p(Lp(e),([t,n])=>p(aw(n),([o,i])=>[[t,o],i])),([t,n])=>[Oy(t),n]),Eh=e=>p(p(sw(e),([t,n])=>[t,n],()=>p(mk(e),([t,n])=>[t,n],()=>p(X(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function Th(e){let t=Up(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:B()}function pi(e,t={}){return C("TemplateLiteral",[e],t)}function Ih(e){return R({},pi(e,{}))}function pw(e){let t=Th(e);return Ih(t)}function _h(e,t={}){let n=s.IsString(e)?pw(e):Ih(e);return g.Update(n,{},t)}function Re(e){return _(e,"TemplateLiteral")}var k={};kt(k,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>Mp,IsExtendsFalse:()=>mw,IsExtendsTrue:()=>Oh,IsExtendsTrueLike:()=>be,IsExtendsUnion:()=>bh});function Mp(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function bh(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function x(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Oh(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function F(){return g.Create({"~kind":"ExtendsFalse"},{})}function mw(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function be(e){return bh(e)||Oh(e)}function Us(e){let t=fh(e);return s.IsEqual(t.length,2)?t[0]:B()}function uw(e){return!0}function Ah(e){let[t,...n]=e;return O(t)?lw(t)?Ah(n):!1:!0}function Sh(e){return s.IsEqual(e.length,0)?!1:Ah(e)}function lw(e){return b(e)?Sh(e.anyOf):Z(e)?uw(e.const):!1}function Ns(e){return Sh(e)}function xh(e,t,n=[]){let[o,...i]=e;return s.IsString(o)?xh(i,t,[...n,`${o}${t}`]):n}function dw(e,t){return s.IsEqual(e.length,0)?[`${t}`]:xh(e,t)}function Rh(e,t,n=[]){let[o,...i]=t;return O(o)?Rh(e,i,[...n,...Ch(e,o)]):n}function Ch(e,t){return b(t)?Rh(e,t.anyOf):Z(t)?dw(e,t.const):B()}function Ph(e,t){let[n,...o]=t;return O(n)?Ph(Ch(e,n),o):e}function fw(e){return e.map(t=>V(t))}function gw(e){let t=Ph([],e),n=fw(t);return G(n)}function yw(e){return s.IsEqual(e.length,0)?B():s.IsEqual(e.length,1)&&Z(e[0])?e[0]:gw(e)}function Qe(e){let t=Us(e);return Ns(t)?yw(t):ft()}function hw(e){return s.IsString(e)||s.IsNumber(e)?V(e):s.IsNull(e)?wr():W()}function Gt(e){return e.map(n=>hw(n))}function Ci(e){let t=Gt(e);return G(t)}function gn(e){return Ci(e.enum)}function Ew(e,t,n,o){let i=re(e,n,o);return be(i)?x(g.Assign(g.Assign(e,i.inferred),{[t]:n})):F()}function Tw(e,t){return x(e)}function Iw(e,t,n){let o=Ci(n);return re(e,t,o)}function Uh(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,t,o);return be(a)?Uh(a.inferred,t,i):F()})():x(e)}function _w(e,t,n){let o=Qe(n);return re(e,t,o)}function Nh(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,t,o);return be(a)?x(a.inferred):Nh(e,t,i)})():F()}function H(e,t,n){return ot(n)?Tw(e,t):xe(n)?Iw(e,t,n.enum):Se(n)?Ew(e,n.name,t,n.extends):U(n)?Uh(e,t,n.allOf):Re(n)?_w(e,t,n.pattern):b(n)?Nh(e,t,n.anyOf):dt(n)?x(e):F()}function kh(e,t,n){return Se(n)?H(e,t,n):ot(n)?x(e):dt(n)?x(e):Mp(e)}function bw(e,t){let n=cn(e),o=cn(t);return n&&o||!n&&o?!0:!(n&&!o)}function wh(e,t,n,o){return ee(o)?bw(t,o)?re(e,n,o.items):F():H(e,t,o)}function Lh(e,t,n){return et(n)?re(e,t,n.iteratorItems):H(e,Bt(t),n)}function Mh(e,t,n){return ht(n)?x(e):H(e,t,n)}function vh(e,t,n){return at(n)?x(e):H(e,t,n)}function Ow(e,t,n,o,i){let a=Se(o)?t:o,c=Se(o)?o:t,u=we(t),l=we(o),f=re(e,a,c);return!u&&l?F():be(f)?Pi(f.inferred,n,i):F()}function Aw(e,t,n,o){let[i,...a]=o;return O(i)?Ow(e,t,n,i,a):we(t)?x(e):F()}function Sw(e,t,n){let[o,...i]=t;return O(o)?Aw(e,o,i,n):x(e)}function Pi(e,t,n){return Sw(e,t,n)}function ks(e,t,n){return Tt(n)?x(e):re(e,t,n)}function Dh(e,t,n,o){return Le(o)?(()=>{let i=Pi(e,t,o.parameters);return be(i)?ks(i.inferred,n,o.instanceType):F()})():F()}function $h(e,t,n){return re(e,gn(t),n)}function Gh(e,t,n,o){return Me(o)?(()=>{let i=Pi(e,t,o.parameters);return be(i)?ks(i.inferred,n,o.returnType):F()})():F()}function jh(e,t,n){return Ge(n)?x(e):Te(n)?x(e):H(e,t,n)}var Ui="equal",xw="disjoint",Ni="left-inside",ki="right-inside";function wi(e,t){let n=[dt(e)?k.ExtendsFalse():Xe({},e,t),dt(e)?k.ExtendsTrue({}):Xe({},t,e)];return k.IsExtendsTrueLike(n[0])&&k.IsExtendsTrueLike(n[1])?Ui:k.IsExtendsTrueLike(n[0])&&k.IsExtendsFalse(n[1])?Ni:k.IsExtendsFalse(n[0])&&k.IsExtendsTrueLike(n[1])?ki:xw}function Rw(e){return b(e)?Zt(e.anyOf):[e]}function Zt(e){return e.reduce((t,n)=>[...t,...Rw(n)],[])}function vp(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function qh(e){let t=vp(e.items);return N(t)}function Cw(e,t){return pn(e)?!!pn(t):!1}function Pw(e,t){return we(e)?!!we(t):!1}function Uw(e,t){let n=Cw(e,t),o=Pw(e,t),i=Ce([e,t]),a=as(Vn(i));return n&&o?lt(ut(a)):n&&!o?lt(a):!n&&o?ut(a):a}function Nw(e,t,n){return n in e?n in t?Uw(e[n],t[n]):e[n]:n in t?t[n]:W()}function kw(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:Nw(e,t,i)}),{})}function Fh(e){return M(e)?e.properties:Y(e)?vp(e.items):B()}function Bh(e,t){let n=Fh(e),o=Fh(t),i=kw(n,o);return N(i)}function Hh(e,t){let n=wi(e,t);return s.IsEqual(n,Ni)?e:s.IsEqual(n,ki)||s.IsEqual(n,Ui)?t:W()}function Kh(e){return M(e)||Y(e)}function zh(e){return U(e)?Ce(e.allOf):e}function ww(e,t){let n=zh(e),o=zh(t),i=Kh(n),a=Kh(o);return i&&a?Bh(Dr(n),o):i&&!a?Dr(n):!i&&a?o:Hh(Dr(n),o)}function Vh(e,t,n=[]){let[o,...i]=t;return s.IsUndefined(o)?n.length===0?[e]:n:Vh(e,i,[...n,ww(e,o)])}function Yh(e,t,n=[]){let[o,...i]=e;return O(o)?Yh(i,t,[...n,...Li([o],t)]):n}function Li(e,t=[]){let[n,...o]=e;return O(n)?b(n)?Li(o,Yh(n.anyOf,t)):Li(o,Vh(n,t)):t}function Ce(e){let t=Li(e);return Dp(t)}function cr(e){return Dp(e)}function Dr(e){return U(e)?Ce(e.allOf):b(e)?cr(e.anyOf):e}function yn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?W():G(e)}function Lw(e,t){return t.filter(n=>wi(e,n)!==ki)}function Mw(e,t){let n=t.some(o=>{let i=wi(e,o);return s.IsEqual(i,Ni)||s.IsEqual(i,Ui)});return s.IsEqual(n,!1)}function vw(e,t){let n=Dr(e);return ot(n)?[n]:Mw(n,t)?[...Lw(n,t),n]:t}function $p(e,t=[]){let[n,...o]=e;return O(n)?M(n)?$p(o,[...t,n]):$p(o,vw(n,t)):t}function Dp(e){let t=$p(e),n=Zt(t);return n.length===0?W():n.length===1?n[0]:G(n)}function Dw(e,t,n,o){let i=I(e,t,n);return g.Update(Dr(i),{},o)}function Qh(e,t,n,o){return Dw(e,t,n,o)}function Wh(e,t,n){let o=Ce(t);return re(e,o,n)}function Zh(e,t,n){return tt(n)?re(e,t,n.iteratorItems):H(e,Kt(t),n)}function ws(e,t,n){return t===n?x(e):F()}function $w(e,t,n){return Z(n)?ws(e,t,n.const):ht(n)?x(e):H(e,V(t),n)}function Gw(e,t,n){return Z(n)?ws(e,t,n.const):at(n)?x(e):H(e,V(t),n)}function jw(e,t,n){return Z(n)?ws(e,t,n.const):Te(n)?x(e):H(e,V(t),n)}function qw(e,t,n){return Z(n)?ws(e,t,n.const):Ne(n)?x(e):H(e,V(t),n)}function Xh(e,t,n){return s.IsBigInt(t.const)?$w(e,t.const,n):s.IsBoolean(t.const)?Gw(e,t.const,n):s.IsNumber(t.const)?jw(e,t.const,n):s.IsString(t.const)?qw(e,t.const,n):B()}function Jh(e,t,n){return Se(n)?H(e,t,n):x(e)}function eE(e,t,n){return zt(n)?x(e):H(e,t,n)}function tE(e,t,n){return Te(n)?x(e):H(e,t,n)}function Fw(e,t,n){return we(t)?we(n)?x(e):F():x(e)}function Bw(e,t,n){return Se(n)&&ar(n.extends)?F():(()=>{let o=re(e,t,n);return be(o)?Fw(o.inferred,t,n):F()})()}function Hw(e,t){return e.reduce((n,o)=>o in t?be(t[o])?{...n,...t[o].inferred}:B():B(),{})}function Kw(e,t,n){let o={};for(let c of s.Keys(n))o[c]=c in t?Bw({},t[c],n[c]):we(n[c])?Se(n[c])?x(g.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>be(c)),a=i?Hw(s.Keys(o),o):{};return i?x(a):F()}function zw(e,t,n){let o=Kw(e,t,n);return be(o)?x(g.Assign(e,o.inferred)):F()}function Vw(e,t,n){return zw(e,t,n)}function rE(e,t,n){return M(n)?Vw(e,t,n.properties):H(e,N(t),n)}function nE(e,t,n){return Ve(n)?re(e,t,n.item):H(e,Yt(t),n)}function oE(e,t,n){return Ne(n)?x(e):H(e,t,n)}function iE(e,t,n){return Vt(n)?x(e):H(e,t,n)}function aE(e,t,n){let o=Qe(t);return re(e,o,n)}function Gp(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Mi(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function jp(e){return Lr(e)?Se(e.items)?ee(e.items.extends)?Gp(e.items.name,e.items.extends.items):dt(e.items.extends)?Gp(e.items.name,e.items.extends):void 0:B():void 0}function Ls(e){return Se(e)?Gp(e.name,e.extends):void 0}function qp(e,t,n=[]){let[o,...i]=e;return O(o)?(()=>{let a=re({},o,t);return be(a)?qp(i,t,[...n,o]):void 0})():n}function sE(e,t,n,o){let i=qp(n,o);return s.IsArray(i)?x(g.Assign(e,{[t]:je(i)})):F()}function Ms(e,t,n,o){let i=qp(n,o);return s.IsArray(i)?x(g.Assign(e,{[t]:G(i)})):F()}function Yw(e){return[...e].reverse()}function Fp(e,t){return t?Yw(e):e}function Qw(e){let t=e.length>0?e[0]:void 0,n=O(t)?jp(t):void 0;return O(n)}function Ww(e,t,n,o,i,a){let c=re(e,n,i);return be(c)?cE(c.inferred,t,o,a):F()}function Zw(e,t,n,o,i){let a=jp(o);return Mi(a)?sE(e,a.name,Fp(n,t),a.type):(()=>{let[c,...u]=n;return O(c)?Ww(e,t,c,u,o,i):F()})()}function Xw(e,t,n,o){let[i,...a]=o;return O(i)?Zw(e,t,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function cE(e,t,n,o){return Xw(e,t,n,o)}function Jw(e,t,n){let o=vs(e,{callstack:[]},n),i=Qw(o);return cE(e,i,Fp(t,i),Fp(o,i))}function pE(e,t,n){let o=Ls(n);return Mi(o)?Ms(e,o.name,t,o.type):(()=>{let[i,...a]=t;return O(i)?(()=>{let c=re(e,i,n);return be(c)?pE(c.inferred,a,n):F()})():x(e)})()}function mE(e,t,n){let o=vs(e,{callstack:[]},t);return Y(n)?Jw(e,o,n.items):ee(n)?pE(e,o,n.items):H(e,je(o),n)}function uE(e,t,n){return Tt(n)?x(e):Wt(n)?x(e):H(e,t,n)}function lE(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,t,o);return be(a)?x(a.inferred):lE(e,t,i)})():F()}function Bp(e,t,n){let[o,...i]=t;return O(o)?(()=>{let a=lE(e,o,n);return be(a)?Bp(a.inferred,i,n):F()})():x(e)}function dE(e,t,n){let o=Ls(n);return Mi(o)?Ms(e,o.name,t,o.type):b(n)?Bp(e,t,n.anyOf):Bp(e,t,[n])}function fE(e,t,n){return Se(n)?H(e,t,n):ot(n)?x(e):dt(n)?x(e):F()}function gE(e,t,n){return Tt(n)?x(e):H(e,t,n)}function re(e,t,n){return ot(t)?kh(e,t,n):ee(t)?wh(e,t,t.items,n):et(t)?Lh(e,t.iteratorItems,n):ht(t)?Mh(e,t,n):at(t)?vh(e,t,n):Le(t)?Dh(e,t.parameters,t.instanceType,n):xe(t)?$h(e,t,n):Me(t)?Gh(e,t.parameters,t.returnType,n):Ge(t)?jh(e,t,n):U(t)?Wh(e,t.allOf,n):tt(t)?Zh(e,t.iteratorItems,n):Z(t)?Xh(e,t,n):ar(t)?Jh(e,t,n):zt(t)?eE(e,t,n):Te(t)?tE(e,t,n):M(t)?rE(e,t.properties,n):Ve(t)?nE(e,t.item,n):Ne(t)?oE(e,t,n):Vt(t)?iE(e,t,n):Re(t)?aE(e,t.pattern,n):Y(t)?mE(e,t.items,n):Wt(t)?uE(e,t,n):b(t)?dE(e,t.anyOf,n):dt(t)?fE(e,t,n):Tt(t)?gE(e,t,n):F()}function io(e,t,n={}){return C("Interface",[e,t],n)}function lo(e){return O(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function yE(e,t,n={}){return R({},io(e,t,n))}function eL(e,t,n){return e.includes(n)?!0:$r([...e,n],t,t[n])}function hE(e,t,n){let o=ys(n);return hn(e,t,o)}function hn(e,t,n){let[o,...i]=n;return O(o)?$r(e,t,o)?!0:hn(e,t,i):!1}function $r(e,t,n){return pe(n)?eL(e,t,n.$ref):ee(n)?$r(e,t,n.items):et(n)?$r(e,t,n.iteratorItems):Le(n)?hn(e,t,[...n.parameters,n.instanceType]):Me(n)?hn(e,t,[...n.parameters,n.returnType]):lo(n)?hE(e,t,n.parameters[1]):U(n)?hn(e,t,n.allOf):tt(n)?$r(e,t,n.iteratorItems):M(n)?hE(e,t,n.properties):Ve(n)?$r(e,t,n.item):b(n)?hn(e,t,n.anyOf):Y(n)?hn(e,t,n.items):Ie(n)?$r(e,t,Ye(n)):!1}function Ds(e,t,n){return $r(e,t,n)}function tL(e,t){return t.reduce((n,o)=>o in e?Ds([o],e,e[o])?[...n,o]:n:B(),[])}function EE(e){let t=yf(e);return tL(e,t)}function rL(e,t,n){return n.includes(t)?n:t in e?Gr(e,e[t],[...n,t]):B()}function TE(e,t,n){let o=ys(t);return fo(e,o,n)}function fo(e,t,n){return t.reduce((o,i)=>Gr(e,i,o),n)}function Gr(e,t,n){return pe(t)?rL(e,t.$ref,n):ee(t)?Gr(e,t.items,n):et(t)?Gr(e,t.iteratorItems,n):Le(t)?fo(e,[...t.parameters,t.instanceType],n):Me(t)?fo(e,[...t.parameters,t.returnType],n):lo(t)?TE(e,t.parameters[1],n):U(t)?fo(e,t.allOf,n):tt(t)?Gr(e,t.iteratorItems,n):M(t)?TE(e,t.properties,n):Ve(t)?Gr(e,t.item,n):b(t)?fo(e,t.anyOf,n):Y(t)?fo(e,t.items,n):Ie(t)?Gr(e,Ye(t),n):n}function IE(e,t,n){return Gr(e,n,[t])}function nL(e){return Qn()}function oL(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:Xt(e[n])}),{})}function vi(e){return e.reduce((t,n)=>[...t,Xt(n)],[])}function Xt(e){return pe(e)?nL(e.$ref):ee(e)?$t(Xt(e.items),cs(e)):et(e)?Bt(Xt(e.iteratorItems)):Le(e)?Cr(vi(e.parameters),Xt(e.instanceType)):Me(e)?Pr(vi(e.parameters),Xt(e.returnType)):U(e)?Ct(vi(e.allOf)):tt(e)?Kt(Xt(e.iteratorItems)):M(e)?N(oL(e.properties)):Ve(e)?Yt(Xt(e.item)):Ie(e)?Es(ro(e),Xt(Ye(e))):b(e)?G(vi(e.anyOf)):Y(e)?je(vi(e.items)):e}function iL(e,t){return t in e?Xt(e[t]):Ke()}function _E(e){return iL(e.$defs,e.$ref)}function aL(e,t,n){let o=It(e,{callstack:[]},t),i=Di({},{callstack:[]},n);return Ce([...o,N(i)])}function sL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],c=lo(a)?aL(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function bE(e,t,n){let o=IE(e,t,n),i=sL(e,o);return Ht(i,t)}function OE(e,t){return t in e?pe(e[t])?OE(e,e[t].$ref):e[t]:W()}function Jt(e,t){return OE(e,t)}function AE(e){return ue(e)?_E(e):e}function Xe(e,t,n){let o=AE(t),i=AE(n);return re(e,o,i)}function cL(e,t,n){if(Se(t)||go(t)||k.IsExtendsTrueLike(Xe({},t,n)))return;let o={parameter:e,extends:n,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function SE(e,t,n,o,i){let a=I(e,t,i);return cL(n,a,o),g.Assign(e,{[n]:a})}function pL(e,t,n,o,i){let a=I(e,t,n.extends),c=I(e,t,n.equals),[u,...l]=i;return O(u)?Hp(SE(e,t,n.name,a,u),t,o,l):Hp(SE(e,t,n.name,a,c),t,o,[])}function Hp(e,t,n,o){let[i,...a]=n;return O(i)?pL(e,t,i,a,o):e}function xE(e,t,n,o){return Hp(e,t,n,o)}function mL(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function RE(e,t,n,o){let i=It(e,t,o);return _s(n,i)}function uL(e,t,n,o){return RE(e,t,Ue(n),o)}function lL(e,t,n,o,i,a){let c=It(e,t,a),u=xE(e,t,o,c),l=I(u,{callstack:[...t.callstack,n]},i);return I(e,t,l)}function $s(e,t,n,o){let[i,a]=Kd(e,n,o);return Yn(a)?s.IsEqual(mL(t.callstack),i)?uL(e,t,i,o):lL(e,t,i,a.parameters,a.expression,o):RE(e,t,n,o)}function _s(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function CE(e,t){return $s({},{callstack:[]},e,t)}function go(e){return _(e,"Call")}function PE(e){return Ve(e)?PE(e.item):e}function dL(e,t,n,o){let i=I(e,t,n);return g.Update(PE(i),{},o)}function UE(e,t,n,o){return w(e,[n])?dL(e,t,n,o):Ri(n,o)}function NE(e,t){return e(t)}function kE(e,t){return s.IsString(t)?V(NE(e,t)):V(t)}function wE(e,t){let n=Qe(t);return pr(e,n)}function LE(e,t){let n=t.map(o=>pr(e,o));return G(n)}function pr(e,t){return Z(t)?kE(e,t.const):Re(t)?wE(e,t.pattern):b(t)?LE(e,t.anyOf):t}function mi(e,t={}){return C("Capitalize",[e],t)}function ME(e,t={}){return R({},mi(e,t))}function ui(e,t={}){return C("Lowercase",[e],t)}function vE(e,t={}){return R({},ui(e,t))}function li(e,t={}){return C("Uncapitalize",[e],t)}function DE(e,t={}){return R({},li(e,t))}function di(e,t={}){return C("Uppercase",[e],t)}function $E(e,t={}){return R({},di(e,t))}var fL=e=>e[0].toUpperCase()+e.slice(1),gL=e=>e.toLowerCase(),yL=e=>e[0].toLowerCase()+e.slice(1),hL=e=>e.toUpperCase();function EL(e,t,n,o){let i=I(e,t,n);return g.Update(pr(fL,i),{},o)}function GE(e,t,n,o){return w(e,[n])?EL(e,t,n,o):mi(n,o)}function TL(e,t,n,o){let i=I(e,t,n);return g.Update(pr(gL,i),{},o)}function jE(e,t,n,o){return w(e,[n])?TL(e,t,n,o):ui(n,o)}function IL(e,t,n,o){let i=I(e,t,n);return g.Update(pr(yL,i),{},o)}function qE(e,t,n,o){return w(e,[n])?IL(e,t,n,o):li(n,o)}function _L(e,t,n,o){let i=I(e,t,n);return g.Update(pr(hL,i),{},o)}function FE(e,t,n,o){return w(e,[n])?_L(e,t,n,o):di(n,o)}function fi(e,t,n,o,i={}){return C("Conditional",[e,t,n,o],i)}function BE(e,t,n,o,i={}){return R({},fi(e,t,n,o,i))}function bL(e,t,n,o,i,a,c){let u=I(e,t,n),l=I(e,t,o),f=Xe(e,u,l);return g.Update(k.IsExtendsUnion(f)?G([I(f.inferred,t,i),I(e,t,a)]):k.IsExtendsTrue(f)?I(f.inferred,t,i):I(e,t,a),{},c)}function HE(e,t,n,o,i,a,c){return w(e,[n,o])?bL(e,t,n,o,i,a,c):fi(n,o,i,a,c)}function gi(e,t={}){return C("ConstructorParameters",[e],t)}function KE(e,t={}){return R({},gi(e,t))}function OL(e){return Le(e)?I({},{callstack:[]},je(e.parameters)):W()}function AL(e,t,n,o){let i=I(e,t,n);return g.Update(OL(i),{},o)}function zE(e,t,n,o){return w(e,[n])?AL(e,t,n,o):gi(n,o)}function yi(e,t,n={}){return C("Exclude",[e,t],n)}function VE(e,t,n={}){return R({},yi(e,t,n))}function YE(e,t){return e.reduce((n,o)=>[...n,...QE(o,t)],[])}function QE(e,t){let n=Xe({},e,t);return k.IsExtendsTrueLike(n)?[]:[e]}function SL(e,t){let n=xe(e)?YE(Gt(e.enum),t):b(e)?YE(Zt(e.anyOf),t):QE(e,t);return cr(n)}function xL(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(SL(a,c),{},i)}function Gs(e,t,n,o,i){return w(e,[n,o])?xL(e,t,n,o,i):yi(n,o,i)}function hi(e,t,n={}){return C("Extract",[e,t],n)}function WE(e,t,n={}){return R({},hi(e,t,n))}function ZE(e,t){return e.reduce((n,o)=>[...n,...XE(o,t)],[])}function XE(e,t){let n=Xe({},e,t);return k.IsExtendsTrueLike(n)?[e]:[]}function RL(e,t){let n=xe(e)?ZE(Gt(e.enum),t):b(e)?ZE(Zt(e.anyOf),t):XE(e,t);return cr(n)}function CL(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(RL(a,c),{},i)}function JE(e,t,n,o,i){return w(e,[n,o])?CL(e,t,n,o,i):hi(n,o,i)}var PL=new RegExp("^(?:0|[1-9][0-9]*)$");function yo(e){let t=`${e}`;return PL.test(t)?parseInt(t):e}function UL(e){return V(yo(e))}function eT(e){return e.map(t=>tT(t))}function tT(e){return U(e)?Ct(eT(e.allOf)):b(e)?G(eT(e.anyOf)):Z(e)?UL(e.const):e}function rT(e,t){let n=tT(t),o=Xe({},n,Pt());return k.IsExtendsTrueLike(o)?e:W()}function nT(e,t){let n=Jt(e,t);return er(n)}function js(e){return e.reduce((t,n)=>[...t,...er(n)],[])}function oT(e){let t=Gt(e);return js(t)}function iT(e){let t=Ce(e);return er(t)}function aT(e){return[`${e}`]}function sT(e){let t=Qe(e);return er(t)}function er(e){return ue(e)?nT(e.$defs,e.$ref):xe(e)?oT(e.enum):U(e)?iT(e.allOf):Z(e)?aT(e.const):Re(e)?sT(e.pattern):b(e)?js(e.anyOf):[]}function ho(e){return er(e)}function NL(e,t){return t in e?[e[t]]:[]}function kL(e,t){return t.reduce((n,o)=>[...n,...NL(e,o)],[])}function cT(e,t){let n=ho(t),o=kL(e,n);return cr(o)}function wL(e){return V(yo(e))}function pT(e){return e.map(t=>Kp(t))}function Kp(e){return U(e)?Ct(pT(e.allOf)):b(e)?G(pT(e.anyOf)):Z(e)?wL(e.const):e}function LL(e,t){return e.reduceRight((n,o,i)=>{let a=Xe({},V(i),t);return k.IsExtendsTrueLike(a)?[o,...n]:n},[])}function ML(e,t){let n=Kp(t),o=LL(e,n);return yn(o)}function vL(e){return yn(e)}function mT(e,t){return Te(t)||Ge(t)?vL(e):ML(e,t)}function DL(e){return e.reduce((t,n)=>fs(n)?[...t,V(n)]:t,[])}function Eo(e){let t=DL(e);return G(t)}function ao(e,t,n={}){return C("Index",[e,t],n)}function uT(e,t,n={}){let o=s.IsArray(t)?Eo(t):t;return R({},ao(e,o,n))}function lT(e,t){let n=Jt(e,t);return jt(n)}function $L(e,t){let n=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=n.reduce((y,E)=>({...y,[E]:e[E]}),{}),c=o.reduce((y,E)=>({...y,[E]:t[E]}),{}),u=i.reduce((y,E)=>({...y,[E]:Ce([e[E],t[E]])}),{}),l=g.Assign(a,c);return g.Assign(l,u)}function dT(e){return e.reduce((t,n)=>$L(t,jt(n)),{})}function fT(e){let t=qh(je(e));return jt(t)}function GL(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:cr([e[a],t[a]])}),{})}function gT(e,t){let[n,...o]=e;return O(n)?gT(o,GL(t,jt(n))):t}function yT(e){let[t,...n]=e;return O(t)?gT(n,jt(t)):B()}function jt(e){return ue(e)?lT(e.$defs,e.$ref):U(e)?dT(e.allOf):b(e)?yT(e.anyOf):Y(e)?fT(e.items):M(e)?e.properties:{}}function To(e){let t=jt(e);return N(t)}function jL(e){return ue(e)||U(e)||b(e)?To(e):e}function qL(e,t){let n=jL(e);return ee(n)?rT(n.items,t):M(n)?cT(n.properties,t):Y(n)?mT(n.items,t):W()}function FL(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(qL(a,c),{},i)}function hT(e,t,n,o,i){return w(e,[n,o])?FL(e,t,n,o,i):ao(n,o,i)}function Ei(e,t={}){return C("InstanceType",[e],t)}function ET(e,t={}){return R({},Ei(e,t))}function BL(e){return Le(e)?e.instanceType:W()}function HL(e,t,n,o){let i=I(e,t,n);return g.Update(BL(i),{},o)}function TT(e,t,n,o={}){return w(e,[n])?HL(e,t,n,o):Ei(n,o)}function KL(e,t,n,o,i){let a=It(e,{callstack:[]},n),c=Di(e,{callstack:[]},o),u=Ce([...a,N(c)]);return g.Update(u,{},i)}function IT(e,t,n,o,i){return w(e,n)?KL(e,t,n,o,i):io(n,o,i)}function so(e,t={}){return C("KeyOf",[e],t)}function _T(e,t={}){return R({},so(e,t))}function bT(){return G([Pt(),ft(),Jn()])}function OT(e){return Pt()}function zL(e){return e.reduce((n,o)=>fs(o)?[...n,V(yo(o))]:B(),[])}function AT(e){let t=s.Keys(e),n=zL(t);return yn(n)}function ST(e){return ro(e)}function xT(e){let t=e.map((n,o)=>V(o));return yn(t)}function VL(e){return ue(e)||U(e)||b(e)?To(e):e}function YL(e){let t=VL(e);return ot(t)?bT():ee(t)?OT(t.items):M(t)?AT(t.properties):Ie(t)?ST(t):Y(t)?xT(t.items):W()}function QL(e,t,n,o){let i=I(e,t,n);return g.Update(YL(i),{},o)}function RT(e,t,n,o){return w(e,[n])?QL(e,t,n,o):so(n,o)}function WL(e){let t=Qe(e);return zp(t)}function CT(e){return e.reduce((t,n)=>[...t,...zp(n)],[])}function zp(e){return xe(e)?CT(Gt(e.enum)):Xn(e)||Zn(e)?[e]:Re(e)?WL(e.pattern):b(e)?CT(e.anyOf):[]}function PT(e){return zp(e)}function oo(e,t,n,o,i={}){return C("Mapped",[e,t,n,o],i)}function UT(e,t,n,o,i={}){return R({},oo(e,t,n,o,i))}function ZL(e,t,n,o,i){let a=g.Assign(e,{[n.name]:o}),c=I(a,t,i);return Re(c)?Qe(c.pattern):c}function XL(e,t,n,o,i){let a=g.Assign(e,{[n.name]:o});return I(a,t,i)}function JL(e,t,n,o,i,a){let c=XL(e,t,n,o,a),u=ZL(e,t,n,o,i);return Xn(u)||Zn(u)?{[u.const]:c}:{}}function eM(e,t,n,o,i,a){return o.reduce((c,u)=>({...c,...JL(e,t,n,u,i,a)}),{})}function tM(e,t,n,o,i,a){let c=PT(o),u=eM(e,t,n,c,i,a);return N(u)}function rM(e,t,n,o,i,a,c){let u=I(e,t,o);return g.Update(tM(e,t,n,u,i,a),{},c)}function NT(e,t,n,o,i,a,c){return w(e,[o])?rM(e,t,n,o,i,a,c):oo(n,o,i,a,c)}function nM(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:bE(e,i,e[i])}),{})}function oM(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function iM(e,t){let n=EE(e),o=nM(e,n),i=oM(e,n),a={...o,...i};return g.Update(a,{},t)}function kT(e,t,n,o){let i=g.Assign(e,n);return iM(i,o)}function Ti(e,t={}){return C("NonNullable",[e],t)}function wT(e,t={}){return R({},Ti(e,t))}function aM(e){let t=G([wr(),no()]);return Gs({},{callstack:[]},e,t,{})}function sM(e,t,n,o){let i=I(e,t,n);return g.Update(aM(i),{},o)}function LT(e,t,n,o){return w(e,[n])?sM(e,t,n,o):Ti(n,o)}function qs(e){let t=To(e);return M(t)?t.properties:B()}function Ii(e,t,n={}){return C("Omit",[e,t],n)}function MT(e,t,n={}){let o=s.IsArray(t)?Eo(t):t;return R({},Ii(e,o,n))}function cM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function pM(e,t){let n=qs(e),o=ho(t),i=cM(n,o);return N(i)}function mM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(pM(a,c),{},i)}function vT(e,t,n,o,i){return w(e,[n,o])?mM(e,t,n,o,i):Ii(n,o,i)}function co(e,t){return C("Options",[e,t],{})}function Fs(e,t){return R({},co(e,t))}function uM(e,t,n,o){let i=I(e,t,n);return g.Update(i,{},o)}function DT(e,t,n,o){return w(e,[n])?uM(e,t,n,o):co(n,o)}function _i(e,t={}){return C("Parameters",[e],t)}function $T(e,t={}){return R({},_i(e,t))}function lM(e){return Me(e)?I({},{callstack:[]},je(e.parameters)):W()}function dM(e,t,n,o){let i=I(e,t,n);return g.Update(lM(i),{},o)}function GT(e,t,n,o){return w(e,[n])?dM(e,t,n,o):_i(n,o)}function bi(e,t={}){return C("Partial",[e],t)}function jT(e,t={}){return R({},bi(e,t))}function qT(e,t){let n=Jt(e,t),o=jr(n);return Ht(g.Assign(e,{[t]:o}),t)}function FT(e){let t=e.map(n=>jr(n));return Ce(t)}function BT(e){let t=e.map(n=>jr(n));return G(t)}function HT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:is(e[i])}),{});return N(t)}function jr(e){return ue(e)?qT(e.$defs,e.$ref):U(e)?FT(e.allOf):b(e)?BT(e.anyOf):M(e)?HT(e.properties):N({})}function fM(e,t,n,o){let i=I(e,t,n);return g.Update(jr(i),{},o)}function KT(e,t,n,o){return w(e,[n])?fM(e,t,n,o):bi(n,o)}function Oi(e,t,n={}){return C("Pick",[e,t],n)}function zT(e,t,n={}){let o=s.IsArray(t)?Eo(t):t;return R({},Oi(e,o,n))}function gM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function yM(e,t){let n=qs(e),o=ho(t),i=gM(n,o);return N(i)}function hM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(yM(a,c),{},i)}function VT(e,t,n,o,i){return w(e,[n,o])?hM(e,t,n,o,i):Oi(n,o,i)}function Ai(e,t={}){return C("ReadonlyType",[e],t)}function YT(e,t={}){return R({},Ai(e,t))}function QT(e){return Rr($t(e))}function WT(e,t){let n=Jt(e,t),o=qr(n);return Ht(g.Assign(e,{[t]:o}),t)}function ZT(e){let t=e.map(n=>qr(n));return Ce(t)}function XT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:ss(e[i])}),{});return N(t)}function JT(e){return Rr(je(e))}function eI(e){let t=e.map(n=>qr(n));return G(t)}function qr(e){return ee(e)?QT(e.items):ue(e)?WT(e.$defs,e.$ref):U(e)?ZT(e.allOf):M(e)?XT(e.properties):Y(e)?JT(e.items):b(e)?eI(e.anyOf):e}function EM(e,t,n,o){let i=I(e,t,n);return g.Update(qr(i),{},o)}function tI(e,t,n,o){return w(e,[n])?EM(e,t,n,o):Ai(n,o)}function rI(e){return gt(Qt,e)}function nI(e){return N({true:e,false:e})}function oI(e,t){let n=Ci(e);return Fr(n,t)}function iI(e,t){return gt(eo,t)}function aI(e,t){let n=Ce(e);return Fr(n,t)}function sI(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function cI(e,t){return gt(to,t)}function pI(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?gt(e.pattern.toString(),t):gt(Qt,t)}function mI(e,t){let n=Us(e);return Ns(n)?Fr(Qe(e),t):gt(e,t)}function TM(e){return e.some(t=>Ne(t)||Te(t)||Ge(t))}function IM(e,t){return s.IsEqual(TM(e),!0)?gt(Qt,t):void 0}function _M(e,t){return e.reduce((n,o)=>Z(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:t}:n,{})}function bM(e,t){let n=_M(e,t);return N(n)}function uI(e,t){let n=Zt(e),o=IM(n,t);return O(o)?o:bM(n,t)}function Fr(e,t){return ot(e)?rI(t):at(e)?nI(t):xe(e)?oI(e.enum,t):Ge(e)?iI(e,t):U(e)?aI(e.allOf,t):Z(e)?sI(e.const,t):Te(e)?cI(e,t):b(e)?uI(e.anyOf,t):Ne(e)?pI(e,t):Re(e)?mI(e.pattern,t):N({})}function OM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(Fr(a,c),{},i)}function lI(e,t,n,o,i){return w(e,[n])?OM(e,t,n,o,i):ci(n,o,i)}function dI(e,t,n){return n in e?Ds([n],e,e[n])?Ue(n):I(e,t,e[n]):Ue(n)}function fI(e,t){let n=Jt(e,t),o=Br(n);return Ht(g.Assign(e,{[t]:o}),t)}function gI(e){let t=e.map(n=>Br(n));return Ce(t)}function yI(e){let t=e.map(n=>Br(n));return G(t)}function hI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Vn(e[i])}),{});return N(t)}function Br(e){return ue(e)?fI(e.$defs,e.$ref):U(e)?gI(e.allOf):b(e)?yI(e.anyOf):M(e)?hI(e.properties):N({})}function Si(e,t={}){return C("Required",[e],t)}function EI(e,t={}){return R({},Si(e,t))}function AM(e,t,n,o){let i=I(e,t,n);return g.Update(Br(i),{},o)}function TI(e,t,n,o){return w(e,[n])?AM(e,t,n,o):Si(n,o)}function xi(e,t={}){return C("ReturnType",[e],t)}function II(e,t={}){return R({},xi(e,t))}function SM(e){return Me(e)?e.returnType:W()}function xM(e,t,n,o){let i=I(e,t,n);return g.Update(SM(i),{},o)}function _I(e,t,n,o){return w(e,[n])?xM(e,t,n,o):xi(n,o)}function bI(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function RM(e){return e.join("|")}function CM(e){return e.slice(1,e.length-1)}function PM(e,t,n){return Hr(t,`${n}${e}`)}function UM(e,t){return Hr(e,`${t}${mf}`)}function NM(e,t){return Hr(e,`${t}${ds}`)}function kM(e,t){return Hr(e,`${t}${gs}`)}function wM(e,t){return Yp(G([V("false"),V("true")]),e,t)}function LM(e,t){return Hr(e,`${t}${hs}`)}function MM(e,t,n){return Hr(t,`${n}${CM(e)}`)}function vM(e,t,n,o=[]){let i=Gt(e);return Vp(i,t,n)}function Vp(e,t,n,o=[]){let[i,...a]=e;return O(i)?Vp(a,t,n,[...o,Yp(i,[],"")]):Hr(t,`${n}(${RM(o)})`)}function Yp(e,t,n){return xe(e)?vM(e.enum,t,n):Ge(e)?NM(t,n):Z(e)?PM(e.const,t,n):ht(e)?UM(t,n):at(e)?wM(t,n):Te(e)?kM(t,n):Ne(e)?LM(t,n):Re(e)?MM(e.pattern,t,n):b(e)?Vp(e.anyOf,t,n):Bd}function Hr(e,t){let[n,...o]=e;return O(n)?Yp(n,o,t):t}function DM(e){return`^${Hr(e,"")}$`}function OI(e){let t=DM(e);return bI(t)}function $M(e,t,n,o){let i=It(e,t,n);return g.Update(OI(i),{},o)}function AI(e,t,n,o){return w(e,n)?$M(e,t,n,o):pi(n,o)}function GM(e){return Lr(e)?Y(e.items)?Qp(e.items.items):Se(e.items)?[e]:pe(e.items)?[e]:[W()]:[e]}function Qp(e){return e.reduce((n,o)=>[...n,...GM(o)],[])}function jM(e,t){return t in e}function qM(e,t){return U(t)?w(e,t.allOf):b(t)?w(e,t.anyOf):pe(t)?jM(e,t.$ref):!0}function w(e,t){let[n,...o]=t;return O(n)?qM(e,n)?w(e,o):!1:!0}function $i(e,t,n){return Dd(e)?$i(e.type,"remove",n):wd(e)?$i(e.type,t,"remove"):Md(e)?$i(e.type,"add",n):Nd(e)?$i(e.type,t,"add"):[e,t,n]}function FM(e,t){return s.IsEqual(e,"remove")?as(t):s.IsEqual(e,"add")?lt(t):t}function BM(e,t){return s.IsEqual(e,"remove")?Vn(t):s.IsEqual(e,"add")?ut(t):t}function Di(e,t,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:I(e,t,n[i])}),{})}function vs(e,t,n){let o=It(e,t,n);return Qp(o)}function It(e,t,n){return n.map(o=>I(e,t,o))}function HM(e,t,n,o,i){return s.IsEqual(n,"Awaited")?UE(e,t,o[0],i):s.IsEqual(n,"Capitalize")?GE(e,t,o[0],i):s.IsEqual(n,"Conditional")?HE(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?zE(e,t,o[0],i):s.IsEqual(n,"Evaluate")?Qh(e,t,o[0],i):s.IsEqual(n,"Exclude")?Gs(e,t,o[0],o[1],i):s.IsEqual(n,"Extract")?JE(e,t,o[0],o[1],i):s.IsEqual(n,"Index")?hT(e,t,o[0],o[1],i):s.IsEqual(n,"InstanceType")?TT(e,t,o[0],i):s.IsEqual(n,"Interface")?IT(e,t,o[0],o[1],i):s.IsEqual(n,"KeyOf")?RT(e,t,o[0],i):s.IsEqual(n,"Lowercase")?jE(e,t,o[0],i):s.IsEqual(n,"Mapped")?NT(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?kT(e,t,o[0],i):s.IsEqual(n,"NonNullable")?LT(e,t,o[0],i):s.IsEqual(n,"Pick")?VT(e,t,o[0],o[1],i):s.IsEqual(n,"Options")?DT(e,t,o[0],o[1]):s.IsEqual(n,"Parameters")?GT(e,t,o[0],i):s.IsEqual(n,"Partial")?KT(e,t,o[0],i):s.IsEqual(n,"Omit")?vT(e,t,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?tI(e,t,o[0],i):s.IsEqual(n,"Record")?lI(e,t,o[0],o[1],i):s.IsEqual(n,"Required")?TI(e,t,o[0],i):s.IsEqual(n,"ReturnType")?_I(e,t,o[0],i):s.IsEqual(n,"TemplateLiteral")?AI(e,t,o[0],i):s.IsEqual(n,"Uncapitalize")?qE(e,t,o[0],i):s.IsEqual(n,"Uppercase")?FE(e,t,o[0],i):C(n,o,i)}function I(e,t,n){let o=cn(n),i=$i(n,pn(n)?"add":"none",we(n)?"add":"none"),a=Rt(i[0])?i[0].Clone():i[0],c=pe(a)?dI(e,t,a.$ref):ee(a)?$t(I(e,t,a.items),cs(a)):et(a)?Bt(I(e,t,a.iteratorItems),Gd(a)):go(a)?$s(e,t,a.target,a.arguments):Le(a)?Cr(It(e,t,a.parameters),I(e,t,a.instanceType),qd(a)):$d(a)?HM(e,t,a.action,a.parameters,a.options):Me(a)?Pr(It(e,t,a.parameters),I(e,t,a.returnType),Fd(a)):U(a)?Ct(It(e,t,a.allOf),Qd(a)):tt(a)?Kt(I(e,t,a.iteratorItems),lf(a)):M(a)?N(Di(e,t,a.properties),hf(a)):Ve(a)?Yt(I(e,t,a.item),Tf(a)):Ie(a)?If(Et(a),I(e,t,Ye(a))):Lr(a)?dn(I(e,t,a.items)):Y(a)?je(vs(e,t,a.items),bf(a)):b(a)?G(It(e,t,a.anyOf),Of(a)):a,u=o?Rr(c):c;return FM(i[1],BM(i[2],u))}function R(e,t){return I(e,{callstack:[]},t)}function Ri(e,t={}){return C("Awaited",[e],t)}function SI(e,t={}){return R({},Ri(e,t))}function _p(e,t={}){return C("Evaluate",[e],t)}function qt(e,t={}){return R({},_p(e,t))}function bp(e,t={}){return C("Module",[e],t)}function xI(e,t={}){return R({},bp(e,t))}function RI(...e){let[t,n,o]=ie.Match(e,{2:(c,u)=>s.IsString(c)?[{},c,u]:[c,u,{}],3:(c,u,l)=>[c,u,l],1:c=>[{},c,{}]}),i=Eh(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(t,{callstack:[]},i[0]):W();return g.Update(a,{},o)}var r={};kt(r,{Any:()=>Qn,Array:()=>$t,AsyncIterator:()=>Bt,Awaited:()=>SI,Base:()=>ps,BigInt:()=>ai,Boolean:()=>ls,Call:()=>CE,Capitalize:()=>ME,Codec:()=>ms,Conditional:()=>BE,Constructor:()=>Cr,ConstructorParameters:()=>KE,Cyclic:()=>Ht,Decode:()=>sf,DecodeBuilder:()=>ii,Encode:()=>cf,EncodeBuilder:()=>oi,Enum:()=>Yd,Evaluate:()=>qt,Exclude:()=>VE,Extends:()=>Xe,ExtendsResult:()=>k,Extract:()=>WE,Function:()=>Pr,Generic:()=>Ur,Identifier:()=>si,Immutable:()=>Rr,Index:()=>uT,Infer:()=>ni,InstanceType:()=>ET,Instantiate:()=>R,Integer:()=>un,Interface:()=>yE,Intersect:()=>Ct,IsAny:()=>ot,IsArray:()=>ee,IsAsyncIterator:()=>et,IsBase:()=>Rt,IsBigInt:()=>ht,IsBoolean:()=>at,IsCall:()=>go,IsCodec:()=>mn,IsConstructor:()=>Le,IsCyclic:()=>ue,IsEnum:()=>xe,IsFunction:()=>Me,IsGeneric:()=>Yn,IsIdentifier:()=>uf,IsImmutable:()=>cn,IsInfer:()=>Se,IsInteger:()=>Ge,IsIntersect:()=>U,IsIterator:()=>tt,IsKind:()=>_,IsLiteral:()=>Z,IsNever:()=>ar,IsNull:()=>zt,IsNumber:()=>Te,IsObject:()=>M,IsOptional:()=>we,IsParameter:()=>Ef,IsPromise:()=>Ve,IsReadonly:()=>pn,IsRecord:()=>Ie,IsRef:()=>pe,IsRefine:()=>us,IsRest:()=>Lr,IsSchema:()=>O,IsString:()=>Ne,IsSymbol:()=>Vt,IsTemplateLiteral:()=>Re,IsThis:()=>_f,IsTuple:()=>Y,IsUndefined:()=>Wt,IsUnion:()=>b,IsUnknown:()=>dt,IsUnsafe:()=>Sf,IsVoid:()=>Tt,Iterator:()=>Kt,KeyOf:()=>_T,Literal:()=>V,Lowercase:()=>vE,Mapped:()=>UT,Module:()=>xI,Never:()=>W,NonNullable:()=>wT,Null:()=>wr,Number:()=>Pt,Object:()=>N,Omit:()=>MT,Optional:()=>is,Options:()=>Fs,Parameter:()=>ln,Parameters:()=>$T,Partial:()=>jT,Pick:()=>zT,Promise:()=>Yt,Readonly:()=>ss,ReadonlyType:()=>YT,Record:()=>Es,RecordKey:()=>ro,RecordKeyAsPattern:()=>Et,RecordValue:()=>Ye,Ref:()=>Ue,Refine:()=>pf,Required:()=>EI,Rest:()=>dn,ReturnType:()=>II,Script:()=>RI,String:()=>ft,Symbol:()=>Jn,TemplateLiteral:()=>_h,This:()=>Ts,Tuple:()=>je,Uncapitalize:()=>DE,Undefined:()=>no,Union:()=>G,Unknown:()=>Ke,Unsafe:()=>Af,Uppercase:()=>$E,Void:()=>Is});var Wp=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],ofe=r.Enum(Wp),KM=["CLUSTER_AGGREGATION_STRUCTURE"],ife=r.Object({code:r.Enum(Wp),message:r.String()}),CI=[...Wp,...KM,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],PI=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var zM=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],VM=[...CI,...PI,...zM],afe=r.Object({code:r.Optional(r.Enum(VM,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),sfe=r.Object({code:r.Optional(r.Enum(CI,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),cfe=r.Object({code:r.Optional(r.Enum(PI,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),pfe=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),mfe=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var UI="lowercase-email",Zp="iana-timezone",Xp="simple-time",Jp="simple-date-time";var YM=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),QM=/[a-zA-Z0-9-_]+/,WM=/\./,lfe=YM(QM,WM);var NI="lowercase-domain";var Bs="kebab-case";var kI="camel-case";var ZM=new Set;function A(e,t,n={}){let o=t.map(i=>{let a=i;return a.$id?(ZM.add(i),r.Ref(a.$id)):i});return r.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function mr(e,t){return r.Object({values:r.Array(e,{maxItems:t.maxItems}),exclude:r.Optional(r.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}var te={limit:r.Optional(r.Integer({minimum:1,maximum:1e3,description:"Maximum number of items to return in this page. Valid values are 1 through 1000."})),offset:r.Optional(r.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages."}))},XM=r.Object({totalCount:r.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:r.Integer({description:"Total number of pages available for the requested `limit`."})}),hfe=r.Object({pagination:XM},{$id:"ResponseMetadata"});function T(e={}){return r.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:n}={}){let o=e?0:1,i=n===void 0?{}:{description:n};switch(t){case"camel-case":return r.String({format:kI,minLength:o,maxLength:250,...i});case"kebab-case":return r.String({format:Bs,minLength:o,maxLength:250,...i});case"email":return r.String({format:UI,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return r.String({format:NI,minLength:o,maxLength:250,...i});case"tsuga-query":return r.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return r.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return r.String({format:"date-time",...i});case"uri":return r.String({format:"uri",...i});case"user-password":return r.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return r.String({minLength:o,maxLength:5e4,...i});case"short":return r.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return r.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return r.String({format:"time",...i});case"readonly-sql-query":return r.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:Ze(t)}}function d({body:e,description:t,method:n,operationId:o,params:i,tags:a,query:c,paginated:u,response:l,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,S=>E[S.slice(1)]),method:n,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}:{method:n,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}}function wI(e,t){if(!t||typeof t!="object")return e;let n=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&n.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&n.append(o,String(i))}),`${e}?${n.toString()}`}var L=r.Object({success:r.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",example:{success:!0}});var em="tsuga-cli",En="/v0/oauth",LI=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${En}/authorize`,method:"GET",query:r.Partial(r.Object({response_type:r.String({description:"Must be `code`"}),client_id:r.String({description:"First-party client id or CIMD document URL"}),redirect_uri:r.String({description:"Client redirect URI"}),code_challenge:r.String({description:"PKCE code challenge"}),code_challenge_method:r.String({description:"Must be `S256`"}),state:r.String({description:"Opaque client state, echoed back"}),resource:r.String({description:"RFC 8707 resource indicator"})})),response:r.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),MI=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${En}/token`,method:"POST",body:r.Partial(r.Object({grant_type:r.String({description:"`authorization_code` or `refresh_token`"}),code:r.String({description:"Authorization code being exchanged"}),code_verifier:r.String({description:"PKCE code verifier"}),redirect_uri:r.String({description:"Must match the redirect URI used on /authorize"}),client_id:r.String({description:"Client id, when sent by the client"}),refresh_token:r.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:r.Object({access_token:r.String(),token_type:r.Literal("Bearer"),expires_in:r.Number({description:"Access token lifetime in seconds"}),refresh_token:r.String()})}),wfe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${En}/authorization-request`,method:"GET",query:r.Object({handle:r.String()}),response:r.Object({clientId:r.String(),clientName:r.String(),redirectUri:r.String()})}),Lfe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${En}/approve`,method:"POST",body:r.Object({handle:r.String({description:"The signed authorization request handle"}),approve:r.Boolean()}),response:r.Object({redirectTo:r.String({description:"The client's redirect URI carrying either the code or the denial"})})}),Mfe=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${En}/introspect`,method:"POST",body:r.Object({token:r.String()}),response:r.Object({active:r.Boolean(),userId:r.Optional(r.String()),orgId:r.Optional(r.String())})}),JM=["pending","active","revoked"],e0=r.Object({id:r.String(),createdAt:T(),clientId:r.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:r.String({description:"Display name derived from the client identity"}),userId:r.String(),status:r.Enum(JM),lastUsedAt:r.Optional(T())}),vfe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${En}/grants`,method:"GET",query:r.Object({allUsers:r.Optional(r.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:r.Array(e0)}),Dfe=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${En}/grants/:id`,method:"DELETE",params:r.Object({id:r.String()}),response:L});function vI(e,t){let n=new URL(LI.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:em,redirect_uri:t.redirectUri,code_challenge:t.challenge,code_challenge_method:"S256",state:t.state}).toString(),n.href}function t0(e){if(!e)return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}async function r0(e,t){let n=await fetch(new URL(MI.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(t).toString()}),o=await n.text(),i=t0(o);if(n.status!==200){let a=i.error??`HTTP ${n.status}`;throw new Error(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`)}if(!i.access_token||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,expiresAt:new Date(Date.now()+i.expires_in*ip)}}async function DI(e,t){return r0(e,{grant_type:"authorization_code",client_id:em,code:t.code,code_verifier:t.verifier,redirect_uri:t.redirectUri})}var Kr=require("node:fs"),$I=require("node:os"),tm=require("node:path");var GI=(0,tm.join)((0,$I.homedir)(),".config","tsuga"),Gi=(0,tm.join)(GI,"config.json"),n0="https://api.tsuga.com";function jI(e){return id(e.credential)}function ji(){if(!(0,Kr.existsSync)(Gi))return{};try{return JSON.parse((0,Kr.readFileSync)(Gi,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Gi}
|
|
36
|
-
Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function
|
|
37
|
-
`,{mode:384})}function
|
|
24
|
+
`),this.outputHelp({error:!0}));let o=n||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,r)}_parseOptionsEnv(){this.options.forEach(r=>{if(r.envVar&&r.envVar in ce.env){let n=r.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(r.required||r.optional?this.emit(`optionEnv:${r.name()}`,ce.env[r.envVar]):this.emit(`optionEnv:${r.name()}`))}})}_parseOptionsImplied(){let r=new Jw(this.options),n=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&n(o.attributeName())&&r.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!n(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(r){let n=`error: missing required argument '${r}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(r){let n=`error: option '${r.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){let n=`error: required option '${r.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,n){let o=c=>{let m=c.attributeName(),l=this.getOptionValue(m),f=this.options.find(E=>E.negate&&m===E.attributeName()),y=this.options.find(E=>!E.negate&&m===E.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||c},i=c=>{let m=o(c),l=m.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${m.envVar}'`:`option '${m.flags}'`},a=`error: ${i(r)} cannot be used with ${i(n)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let n="";if(r.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let c=a.createHelp().visibleOptions(a).filter(m=>m.long).map(m=>m.long);i=i.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);n=Ef(r,i)}let o=`error: unknown option '${r}'${n}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(r){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,o=n===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${n} argument${o} but got ${r.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let r=this.args[0],n="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),n=Ef(r,i)}let o=`error: unknown command '${r}'${n}`;this.error(o,{code:"commander.unknownCommand"})}version(r,n,o){if(r===void 0)return this._version;this._version=r,n=n||"-V, --version",o=o||"output the version number";let i=this.createOption(n,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${r}
|
|
25
|
+
`),this._exit(0,"commander.version",r)}),this}description(r,n){return r===void 0&&n===void 0?this._description:(this._description=r,n&&(this._argsDescription=n),this)}summary(r){return r===void 0?this._summary:(this._summary=r,this)}alias(r){if(r===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),r===n._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(r);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(r),this}aliases(r){return r===void 0?this._aliases:(r.forEach(n=>this.alias(n)),this)}usage(r){if(r===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(o=>Ww(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=r,this}name(r){return r===void 0?this._name:(this._name=r,this)}nameFromFilename(r){return this._name=mr.basename(r,mr.extname(r)),this}executableDir(r){return r===void 0?this._executableDir:(this._executableDir=r,this)}helpInformation(r){let n=this.createHelp(),o=this._getOutputContext(r);n.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=n.formatHelp(this,n);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(r){r=r||{};let n=!!r.error,o,i,a;return n?(o=m=>this._outputConfiguration.writeErr(m),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=m=>this._outputConfiguration.writeOut(m),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:n,write:m=>(i||(m=this._outputConfiguration.stripColor(m)),o(m)),hasColors:i,helpWidth:a}}outputHelp(r){let n;typeof r=="function"&&(n=r,r=void 0);let o=this._getOutputContext(r),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(c=>c.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let a=this.helpInformation({error:o.error});if(n&&(a=n(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(c=>c.emit("afterAllHelp",i))}helpOption(r,n){return typeof r=="boolean"?(r?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(r=r??"-h, --help",n=n??"display help for command",this._helpOption=this.createOption(r,n),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(r){return this._helpOption=r,this}help(r){this.outputHelp(r);let n=Number(ce.exitCode??0);n===0&&r&&typeof r!="function"&&r.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(r,n){let o=["beforeAll","before","after","afterAll"];if(!o.includes(r))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${o.join("', '")}'`);let i=`${r}Help`;return this.on(i,a=>{let c;typeof n=="function"?c=n({error:a.error,command:a.command}):c=n,c&&a.write(`${c}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(r){let n=this._getHelpOption();n&&r.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function If(e){return e.map(r=>{if(!r.startsWith("--inspect"))return r;let n,o="127.0.0.1",i="9229",a;return(a=r.match(/^(--inspect(-brk)?)$/))!==null?n=a[1]:(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=a[1],o=a[3],i=a[4]),n&&i!=="0"?`${n}=${o}:${parseInt(i)+1}`:r})}function $p(){if(ce.env.NO_COLOR||ce.env.FORCE_COLOR==="0"||ce.env.FORCE_COLOR==="false")return!1;if(ce.env.FORCE_COLOR||ce.env.CLICOLOR_FORCE!==void 0)return!0}jp.Command=Gp;jp.useColor=$p});var Af=hn(kt=>{var{Argument:bf}=As(),{Command:qp}=_f(),{CommanderError:eN,InvalidArgumentError:Sf}=Ti(),{Help:tN}=wp(),{Option:Of}=kp();kt.program=new qp;kt.createCommand=e=>new qp(e);kt.createOption=(e,r)=>new Of(e,r);kt.createArgument=(e,r)=>new bf(e,r);kt.Command=qp;kt.Option=Of;kt.Argument=bf;kt.Help=tN;kt.CommanderError=eN;kt.InvalidArgumentError=Sf;kt.InvalidOptionArgumentError=Sf});var xf=df(Af(),1),{program:t3,createCommand:r3,createArgument:n3,createOption:o3,CommanderError:i3,InvalidArgumentError:a3,InvalidOptionArgumentError:s3,Command:Rf,Argument:c3,Option:Bp,Help:p3}=xf.default;function Qe(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function Ei(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Cf(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function Pf(e){if(e.overrideKey)return{kind:"operation-api-key",token:e.overrideKey};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}function Uf(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Qe(e)}}function Rs(e,r){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=r}var _b=require("node:crypto");var Ii=require("node:crypto");function rN(e){return(0,Ii.createHash)("sha256").update(e).digest("base64url")}function wf(){let e=(0,Ii.randomBytes)(32).toString("base64url");return{verifier:e,challenge:rN(e)}}var $f=require("node:child_process"),jf=require("node:http"),Zp=require("node:os");var h3=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var R3=60*1e3;var p4=1/1e6,Hp=1e3,Kp=60*Hp,cN=60*Kp,Ps=24*cN,u4=7*Ps,m4=30*Ps;var zp=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var pN={s:1,m:60,h:3600,d:86400};function Lf(e){for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<48||n>57)return!1}return!0}function vf(){return Math.floor(Date.now()/1e3)}function Us(e){if(typeof e=="number")return e;if(e==="now")return vf();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?pN[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&Lf(i))return vf()-parseInt(i,10)*o}}if(Lf(e)&&e.length>0)return parseInt(e,10);let r=Date.parse(e);if(!Number.isNaN(r))return Math.floor(r/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}function B(e){process.stdout.write(`${e}
|
|
28
|
+
`)}function W(e){B(JSON.stringify(e,null,2))}var kf=["json","tsv","csv"];function Yp(e){let r=kf.find(n=>n===e);if(r!==void 0)return r;throw new Error(`--output must be one of: ${kf.join(", ")} (got: ${e})`)}function Vp(e){let r=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);if(r.length===0)throw new Error("--fields must contain at least one field name");return r}function Mf(e,r){let n=e;for(let o of r.split(".")){if(n===null||typeof n!="object"||!Object.hasOwn(n,o))return;n=n[o]}return n}function Qp(e,r){let n=Object.create(null);for(let o of r){let i=Mf(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let m=n;for(let l of a)(typeof m[l]!="object"||m[l]===null)&&(m[l]=Object.create(null)),m=m[l];m[c]=i}return n}function Df(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var uN={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function mN(e){let r=Df(e);return r===null?"":r.replace(/[\\\t\r\n]/g,n=>uN[n]??n)}function lN(e){let r=Df(e);return r===null?"":/[,"\n\r]/.test(r)?`"${r.replaceAll('"','""')}"`:r}function Wp(e,r,n){if(r.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?lN:mN,a=n.map(m=>i(m)).join(o),c=r.map(m=>n.map(l=>i(Mf(m,l))).join(o));return[a,...c].join(`
|
|
29
|
+
`)}var qf="/oauth/callback",fN=5*Kp,gN="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",ws="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function yN(e){return(0,Zp.platform)()==="darwin"?["open",[e]]:(0,Zp.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function hN(e){let[r,n]=yN(e),o=(0,$f.spawnSync)(r,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function TN(e,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},fN),c=(m,l,f,y)=>{m.writeHead(l,{"Content-Type":"text/html"}),m.end(f),clearTimeout(a),y()};e.on("request",(m,l)=>{let f=new URL(m.url??"/",n);if(f.pathname!==qf){l.writeHead(404,{"Content-Type":"text/html"}),l.end(ws);return}let y=f.searchParams.get("error");if(y){let A=f.searchParams.get("error_description")??"";c(l,400,ws,()=>i(new Error(`Authorization failed: ${y}${A?` (${A})`:""}`)));return}if(f.searchParams.get("state")!==r){c(l,400,ws,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(l,400,ws,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(l,200,gN,()=>o(E))})})}async function Bf(e){let r=(0,jf.createServer)();r.on("connection",a=>a.unref()),await new Promise((a,c)=>{r.once("error",c),r.listen(0,"127.0.0.1",()=>{r.off("error",c),a()})});let{port:n}=r.address(),o=`http://127.0.0.1:${n}`,i=`${o}${qf}`;try{let a=e.buildAuthorizeUrl(i);return hN(a)?B("Opening your browser to complete login..."):(B("Visit this URL in your browser to complete login:"),B(` ${a}`)),{code:await TN(r,e.state,o),redirectUri:i}}finally{r.close()}}var g={};vt(g,{Assign:()=>EN,Clone:()=>bi,Create:()=>_L,Discard:()=>bL,Metrics:()=>Gt,Update:()=>SL});var Gt={assign:0,create:0,clone:0,discard:0,update:0};function EN(e,r){return Gt.assign+=1,{...e,...r}}var s={};vt(s,{Entries:()=>BN,EntriesRegExp:()=>qN,Every:()=>GN,EveryAll:()=>$N,GraphemeCount:()=>kN,HasPropertyKey:()=>jN,IsArray:()=>Tn,IsAsyncIterator:()=>AN,IsBigInt:()=>_i,IsBoolean:()=>Qf,IsClassInstance:()=>LN,IsConstructor:()=>xN,IsDeepEqual:()=>tu,IsEqual:()=>te,IsFunction:()=>Wf,IsGreaterEqualThan:()=>Xf,IsGreaterThan:()=>UN,IsInteger:()=>Jp,IsIterator:()=>RN,IsLessEqualThan:()=>Zf,IsLessThan:()=>wN,IsMaxLength:()=>MN,IsMinLength:()=>DN,IsMultipleOf:()=>NN,IsNull:()=>ks,IsNumber:()=>Ms,IsObject:()=>En,IsObjectNotArray:()=>CN,IsString:()=>Mr,IsSymbol:()=>PN,IsUndefined:()=>eu,IsValueLike:()=>vN,Keys:()=>vs,Symbols:()=>FN,Values:()=>HN});function kr(e,r,n){return e>=r&&e<=n}function Ff(e){return kr(e,127462,127487)}function IN(e){return kr(e,65024,65039)}function _N(e){return kr(e,768,879)||kr(e,6832,6911)||kr(e,7616,7679)||kr(e,65056,65071)}function Ls(e){return e>65535?2:1}function Hf(e,r){for(;r<e.length;){let n=e.codePointAt(r);if(_N(n)||IN(n))r+=Ls(n);else break}return r}function Xp(e,r){let n=e.codePointAt(r),o=r+Ls(n);for(o=Hf(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Ls(i),o=Hf(e,o)}return Ff(n)&&o<e.length&&Ff(e.codePointAt(o))&&(o+=Ls(e.codePointAt(o))),o}function Kf(e){return kr(e,55296,56319)||kr(e,768,879)||e===8205}function zf(e){let r=0,n=0;for(;n<e.length;)n=Xp(e,n),r++;return r}function bN(e,r){let n=0,o=0;for(;o<e.length;)if(o=Xp(e,o),n++,n>=r)return!0;return!1}function SN(e,r){let n=0,o=0;for(;o<e.length;)if(o=Xp(e,o),n++,n>r)return!1;return!0}function Yf(e,r){let n=0;for(;n<e.length;){if(Kf(e.charCodeAt(n)))return bN(e,r);if(n++,n>=r)return!0}return!1}function Vf(e,r){let n=0;for(;n<e.length;){if(Kf(e.charCodeAt(n)))return SN(e,r);if(n++,n>r)return!1}return!0}function Tn(e){return Array.isArray(e)}function AN(e){return En(e)&&Symbol.asyncIterator in e}function _i(e){return te(typeof e,"bigint")}function Qf(e){return te(typeof e,"boolean")}function xN(e){if(eu(e)||!Wf(e))return!1;let r=Function.prototype.toString.call(e);return!!(/^class\s/.test(r)||/\[native code\]/.test(r))}function Wf(e){return te(typeof e,"function")}function Jp(e){return Number.isInteger(e)}function RN(e){return En(e)&&Symbol.iterator in e}function ks(e){return te(e,null)}function Ms(e){return Number.isFinite(e)}function CN(e){return En(e)&&!Tn(e)}function En(e){return te(typeof e,"object")&&!ks(e)}function Mr(e){return te(typeof e,"string")}function PN(e){return te(typeof e,"symbol")}function eu(e){return te(e,void 0)}function te(e,r){return e===r}function UN(e,r){return e>r}function wN(e,r){return e<r}function Zf(e,r){return e<=r}function Xf(e,r){return e>=r}function NN(e,r){if(_i(e)||_i(r))return BigInt(e)%BigInt(r)===0n;let n=1e-10;if(!Ms(e)||Jp(e)&&1/r%1===0)return!0;let o=e%r;return Math.min(Math.abs(o),Math.abs(o-r))<n}function LN(e){if(!En(e))return!1;let r=globalThis.Object.getPrototypeOf(e);return ks(r)?!1:te(typeof r.constructor,"function")&&!(te(r.constructor,globalThis.Object)||te(r.constructor.name,"Object"))}function vN(e){return _i(e)||Qf(e)||ks(e)||Ms(e)||Mr(e)||eu(e)}function kN(e){return zf(e)}function MN(e,r){return Vf(e,r)}function DN(e,r){return Yf(e,r)}function GN(e,r,n){for(let o=r;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function $N(e,r,n){let o=!0;for(let i=r;i<e.length;i++)n(e[i],i)||(o=!1);return o}function jN(e,r){return te(r,"__proto__")||te(r,"constructor")?Object.prototype.hasOwnProperty.call(e,r):r in e}function qN(e){return vs(e).map(r=>[new RegExp(`^${r}$`),e[r]])}function BN(e){return Object.entries(e)}function vs(e){return Object.getOwnPropertyNames(e)}function FN(e){return Object.getOwnPropertySymbols(e)}function HN(e){return Object.values(e)}function KN(e,r){if(!En(r))return!1;let n=vs(e);return te(n.length,vs(r).length)&&n.every(o=>tu(e[o],r[o]))}function zN(e,r){return Tn(r)&&te(e.length,r.length)&&e.every((n,o)=>tu(e[o],r[o]))}function tu(e,r){return Tn(e)?zN(e,r):En(e)?KN(e,r):te(e,r)}var at={};vt(at,{IsBigInt64Array:()=>aL,IsBigUint64Array:()=>sL,IsBoolean:()=>YN,IsDate:()=>pL,IsFloat32Array:()=>oL,IsFloat64Array:()=>iL,IsInt16Array:()=>eL,IsInt32Array:()=>rL,IsInt8Array:()=>ZN,IsMap:()=>mL,IsNumber:()=>VN,IsRegExp:()=>cL,IsSet:()=>uL,IsString:()=>QN,IsTypeArray:()=>WN,IsUint16Array:()=>tL,IsUint32Array:()=>nL,IsUint8Array:()=>XN,IsUint8ClampedArray:()=>JN});function YN(e){return e instanceof Boolean}function VN(e){return e instanceof Number}function QN(e){return e instanceof String}function WN(e){return globalThis.ArrayBuffer.isView(e)}function ZN(e){return e instanceof globalThis.Int8Array}function XN(e){return e instanceof globalThis.Uint8Array}function JN(e){return e instanceof globalThis.Uint8ClampedArray}function eL(e){return e instanceof globalThis.Int16Array}function tL(e){return e instanceof globalThis.Uint16Array}function rL(e){return e instanceof globalThis.Int32Array}function nL(e){return e instanceof globalThis.Uint32Array}function oL(e){return e instanceof globalThis.Float32Array}function iL(e){return e instanceof globalThis.Float64Array}function aL(e){return e instanceof globalThis.BigInt64Array}function sL(e){return e instanceof globalThis.BigUint64Array}function cL(e){return e instanceof globalThis.RegExp}function pL(e){return e instanceof globalThis.Date}function uL(e){return e instanceof globalThis.Set}function mL(e){return e instanceof globalThis.Map}function dL(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function fL(e){return e.map(r=>ru(r))}function gL(e){let r={},n=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(n)){let i=n[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(r,o,{...i,value:ru(i.value)})}return r}function yL(e){return new RegExp(e.source,e.flags)}function ru(e){return e instanceof RegExp?yL(e):dL(e)?e:s.IsArray(e)?fL(e):s.IsObject(e)?gL(e):e}function bi(e){return Gt.clone+=1,ru(e)}var Rt={};vt(Rt,{Get:()=>EL,Reset:()=>hL,Set:()=>TL});var In={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function hL(){In.immutableTypes=!1,In.maxErrors=8,In.useEval=!0,In.exactOptionalPropertyTypes=!1,In.enumerableKind=!1}function TL(e){for(let r of s.Keys(e)){let n=e[r];n!==void 0&&Object.defineProperty(In,r,{value:n})}}function EL(){return In}function IL(e,r,n={}){for(let o of Object.keys(r))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:r[o]});return e}function Jf(e,r){return{...e,...r}}function _L(e,r,n={}){Gt.create+=1;let o=Rt.Get(),i=Jf(r,n),a=o.enumerableKind?Jf(i,e):IL(i,e);return o.immutableTypes?Object.freeze(a):a}function bL(e,r){Gt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(bi(e)),i=new Set(r);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function SL(e,r,n){Gt.update+=1;let o=Rt.Get(),i=bi(e);for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:r[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function _(e,r){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],r)}function O(e){return s.IsObject(e)}function eg(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function tg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&O(e.type)}function rg(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function ng(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&O(e.type)}function og(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function ig(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&O(e.type)}function ag(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function sg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&O(e.type)}function P(e,r,n){return g.Create({"~kind":"Deferred"},{action:e,parameters:r,options:n},{})}function cg(e){return _(e,"Deferred")}function nu(e){return g.Update(e,{"~immutable":!0},{})}function Dr(e){return nu(e)}function _n(e){return O(e)&&s.HasPropertyKey(e,"~immutable")}function no(e){return g.Discard(e,["~optional"])}function yt(e){return g.Update(e,{"~optional":!0},{})}function Ds(e){return yt(e)}function Me(e){return O(e)&&s.HasPropertyKey(e,"~optional")}function Gs(e){return g.Discard(e,["~readonly"])}function ht(e){return g.Update(e,{"~readonly":!0},{})}function $s(e){return ht(e)}function bn(e){return O(e)&&s.HasPropertyKey(e,"~readonly")}function $t(e,r){return g.Create({"~kind":"Array"},{type:"array",items:e},r)}function re(e){return _(e,"Array")}function js(e){return g.Discard(e,["~kind","type","items"])}function Yt(e,r){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},r)}function ot(e){return _(e,"AsyncIterator")}function pg(e){return g.Discard(e,["~kind","type","iteratorItems"])}function ug(e){return{enumerable:Rt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var qs=class{constructor(){globalThis.Object.defineProperty(this,"~kind",ug("Base")),globalThis.Object.defineProperty(this,"~guard",ug({check:r=>this.Check(r),errors:r=>this.Errors(r)}))}Check(r){return!0}Errors(r){return[]}Convert(r){return r}Clean(r){return r}Default(r){return r}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Ct(e){return _(e,"Base")}function Gr(e,r,n={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:r},n)}function De(e){return _(e,"Constructor")}function mg(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function $r(e,r,n={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:r},n)}function Ge(e){return _(e,"Function")}function lg(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function we(e,r){return g.Create({"~kind":"Ref"},{$ref:e},r)}function pe(e){return _(e,"Ref")}function jr(e,r){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:r})}function oo(e){return _(e,"Generic")}var dg="(?!)";function X(e){return g.Create({"~kind":"Never"},{not:{}},e)}function lr(e){return _(e,"Never")}function OL(){return["(not-resolvable)",X()]}function AL(){return["(not-generic)",X()]}function xL(e,r,n){return[e,jr(r,n)]}function RL(e,r,n){return r in e?fg(e,r,e[r],n):OL()}function fg(e,r,n,o){return oo(n)?xL(r,n.parameters,n.expression):pe(n)?RL(e,n.$ref,o):AL()}function gg(e,r,n){return fg(e,"(anonymous)",r,n)}function Vt(e,r,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:r},n)}function le(e){return _(e,"Cyclic")}var ae={};vt(ae,{Match:()=>CL});function CL(e,r){return r[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function We(e){return g.Create({"~kind":"Unknown"},{},e)}function Tt(e){return _(e,"Unknown")}function Si(...e){let[r,n]=ae.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,We(),We()]});return g.Create({"~kind":"Infer"},{type:"infer",name:r,extends:n},{})}function xe(e){return _(e,"Infer")}function io(e){return g.Create({"~kind":"Any"},{},e)}function st(e){return _(e,"Any")}function yg(e){return s.IsObjectNotArray(e)}function hg(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function Tg(e,r){let n=yg(e)?hg(e):e;return g.Create({"~kind":"Enum"},{enum:n},r)}function Re(e){return _(e,"Enum")}function Pt(e,r={}){return g.Create({"~kind":"Intersect"},{allOf:e},r)}function w(e){return _(e,"Intersect")}function Eg(e){return g.Discard(e,["~kind","allOf"])}function H(){throw new Error("Unreachable")}var Br={};vt(Br,{Hash:()=>zL,HashCode:()=>xg});function PL(e){let r=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&r.add(o);n=Object.getPrototypeOf(n)}return[...r]}function UL(e){return typeof e=="number"}var ct;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(ct||(ct={}));var ao=BigInt("14695981039346656037"),[wL,NL]=[BigInt("1099511628211"),BigInt("18446744073709551616")],LL=Array.from({length:256}).map((e,r)=>BigInt(r)),Sg=new Float64Array(1),Og=new DataView(Sg.buffer),Ag=new Uint8Array(Sg.buffer);function Ze(e){ao=ao^LL[e],ao=ao*wL%NL}function vL(e){Ze(ct.Array);for(let r of e)qr(r)}function kL(e){Ze(ct.BigInt),Og.setBigInt64(0,e);for(let r of Ag)Ze(r)}function _g(e){Ze(ct.Boolean),Ze(e?1:0)}function ML(e){Ze(ct.Constructor),qr(e.toString())}function DL(e){Ze(ct.Date),qr(e.getTime())}function GL(e){Ze(ct.Function),qr(e.toString())}function $L(e){Ze(ct.Null)}function bg(e){Ze(ct.Number),Og.setFloat64(0,e,!0);for(let r of Ag)Ze(r)}function jL(e){Ze(ct.Object);for(let r of PL(e).sort())qr(r),qr(e[r])}function qL(e){Ze(ct.RegExp),ou(e.toString())}var BL=new TextEncoder;function ou(e){Ze(ct.String);for(let r of BL.encode(e))Ze(r)}function FL(e){Ze(ct.Symbol),qr(e.toString())}function HL(e){Ze(ct.TypeArray);let r=new Uint8Array(e.buffer);for(let n=0;n<r.length;n++)Ze(r[n])}function KL(e){return Ze(ct.Undefined)}function qr(e){return at.IsTypeArray(e)?HL(e):at.IsDate(e)?DL(e):at.IsRegExp(e)?qL(e):at.IsBoolean(e)?_g(e.valueOf()):at.IsString(e)?ou(e.valueOf()):at.IsNumber(e)?bg(e.valueOf()):UL(e)?bg(e):s.IsArray(e)?vL(e):s.IsBoolean(e)?_g(e):s.IsBigInt(e)?kL(e):s.IsConstructor(e)?ML(e):s.IsNull(e)?$L(e):s.IsObject(e)?jL(e):s.IsString(e)?ou(e):s.IsSymbol(e)?FL(e):s.IsUndefined(e)?KL(e):s.IsFunction(e)?GL(e):H()}function xg(e){return ao=BigInt("14695981039346656037"),qr(e),ao}function zL(e){return xg(e).toString(16).padStart(16,"0")}function Rg(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var YL=Rg;function Cg(){return YL}var Oi=class{constructor(r,n){this.type=r,this.decode=n}Encode(r){let n=this.type,o=Sn(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=Sn(n)?c=>n["~codec"].encode(r(c)):r,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Ai=class{constructor(r){this.type=r}Decode(r){return new Oi(this.type,r)}};function Bs(e){return new Ai(e)}function Ug(e,r){return Bs(e).Decode(r).Encode(()=>{throw Error("Encode not implemented")})}function wg(e,r){return Bs(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(r)}function Sn(e){return O(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function QL(e,r){let n=Fs(e)?[...e["~refine"],r]:[r];return g.Update(e,{"~refine":n},{})}function Ng(e,r,n="error"){return QL(e,{refine:r,message:n})}function Fs(e){return O(e)&&s.HasPropertyKey(e,"~refine")}var Lg="-?(?:0|[1-9][0-9]*)n";function xi(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function St(e){return _(e,"BigInt")}function Hs(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function pt(e){return _(e,"Boolean")}function Ri(e){return g.Create({"~kind":"Identifier"},{name:e})}function vg(e){return _(e,"Identifier")}var Ks="-?(?:0|[1-9][0-9]*)";function On(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Be(e){return _(e,"Integer")}function Qt(e,r){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},r)}function it(e){return _(e,"Iterator")}function kg(e){return g.Discard(e,["~kind","type","iteratorItems"])}var iu=class extends Error{constructor(r){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:r},writable:!1,configurable:!1,enumerable:!1})}};function WL(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new iu(e)})()}function Y(e,r){return g.Create({"~kind":"Literal"},{type:WL(e),const:e},r)}function zs(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Mg(e){return J(e)&&s.IsBigInt(e.const)}function Dg(e){return J(e)&&s.IsBoolean(e.const)}function so(e){return J(e)&&s.IsNumber(e.const)}function co(e){return J(e)&&s.IsString(e.const)}function J(e){return _(e,"Literal")}function Fr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Wt(e){return _(e,"Null")}var Ys="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Ut(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function Ie(e){return _(e,"Number")}function po(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function Zt(e){return _(e,"Symbol")}function Gg(e){return s.Keys(e).filter(r=>!Me(e[r]))}function $g(e){return s.Keys(e)}function Vs(e){return s.Values(e)}function ZL(e,r={}){let n=Gg(e),o=n.length>0?{required:n}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},r)}var N=ZL;function k(e){return _(e,"Object")}function jg(e){return g.Discard(e,["~kind","type","properties","required"])}function An(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,We(),We()]});return g.Create({"~kind":"Parameter"},{name:r,extends:n,equals:o},{})}function qg(e){return _(e,"Parameter")}function Xt(e,r){return g.Create({"~kind":"Promise"},{type:"promise",item:e},r)}function Xe(e){return _(e,"Promise")}function Bg(e){return g.Discard(e,["~kind","type","item"])}var Qs=".*";function Et(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Ne(e){return _(e,"String")}function It(e,r){let n="object",o={[e]:r};return g.Create({"~kind":"Record"},{type:n,patternProperties:o})}var uo=`^${Ks}$`,mo=`^${Ys}$`,Jt=`^${Qs}$`;function Ci(e,r,n={}){return P("Record",[e,r],n)}function XL(e,r,n={}){return C({},Ci(e,r,n))}function Ws(e,r,n={}){return XL(e,r,n)}function Fg(e,r){return It(e,r)}function Ot(e){return s.Keys(e.patternProperties)[0]}function lo(e){let r=Ot(e);return s.IsEqual(r,uo)?On():s.IsEqual(r,mo)?Ut():Et()}function Je(e){return e.patternProperties[Ot(e)]}function _e(e){return _(e,"Record")}function xn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Hr(e){return _(e,"Rest")}function Zs(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function Hg(e){return _(e,"This")}function Fe(e,r={}){let[n,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},r)}function V(e){return _(e,"Tuple")}function Kg(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function fo(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function er(e){return _(e,"Undefined")}function $(e,r={}){return g.Create({"~kind":"Union"},{anyOf:e},r)}function S(e){return _(e,"Union")}function zg(e){return g.Discard(e,["~kind","anyOf"])}function Yg(e){return g.Create({"~kind":"Unsafe"},{},e)}function Vg(e){return _(e,"Unsafe")}function Xs(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function At(e){return _(e,"Void")}function ev(e,r){return s.IsEqual(e,"Array")?$t(r[0]):s.IsEqual(e,"AsyncIterator")?Yt(r[0]):s.IsEqual(e,"Iterator")?Qt(r[0]):s.IsEqual(e,"Promise")?Xt(r[0]):s.IsEqual(e,"Awaited")?Yi(r[0]):s.IsEqual(e,"Capitalize")?Ui(r[0]):s.IsEqual(e,"ConstructorParameters")?ki(r[0]):s.IsEqual(e,"Evaluate")?su(r[0]):s.IsEqual(e,"Exclude")?Mi(r[0],r[1]):s.IsEqual(e,"Extract")?Di(r[0],r[1]):s.IsEqual(e,"Index")?ho(r[0],r[1]):s.IsEqual(e,"InstanceType")?Gi(r[0]):s.IsEqual(e,"Lowercase")?wi(r[0]):s.IsEqual(e,"NonNullable")?$i(r[0]):s.IsEqual(e,"Omit")?ji(r[0],r[1]):s.IsEqual(e,"Options")?Eo(r[0],r[1]):s.IsEqual(e,"Parameters")?qi(r[0]):s.IsEqual(e,"Partial")?Bi(r[0]):s.IsEqual(e,"Pick")?Fi(r[0],r[1]):s.IsEqual(e,"Readonly")?Hi(r[0]):s.IsEqual(e,"KeyOf")?To(r[0]):s.IsEqual(e,"Record")?Ci(r[0],r[1]):s.IsEqual(e,"Required")?Ki(r[0]):s.IsEqual(e,"ReturnType")?zi(r[0]):s.IsEqual(e,"Uncapitalize")?Ni(r[0]):s.IsEqual(e,"Uppercase")?Li(r[0]):Js(we(e),r)}function Rn(){throw Error("Unreachable")}var tv=(e,r=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),dr=e=>{let[r,n]=e;return tv([...r,...n])};function Jg(e){return An(e[0],e[2],e[4])}function ey(e){return An(e[0],e[2],e[2])}function ty(e){return An(e[0],We(),e[2])}function ry(e){return An(e,We(),We())}function ny(e){return dr(e)}function oy(e){return e[1]}function iy(e){return dr(e)}function ay(e){return e[1]}function sy(e){return ev(e[0],e[1])}function cy(e){return null}function py(e){return Et()}function uy(e){return Ut()}function my(e){return Hs()}function ly(e){return fo()}function dy(e){return Fr()}function fy(e){return On()}function gy(e){return xi()}function yy(e){return We()}function hy(e){return io()}function Ty(e){return N({})}function Ey(e){return X()}function Iy(e){return po()}function _y(e){return Xs()}function by(e){return Zs()}function Sy(e){return e[1]}function Oy(e){return Y(e)}function Ay(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function xy(e){return e[1]}function Ry(e){return Pi(e)}function Cy(e){return Y(BigInt(e))}function Py(e){return Y(s.IsEqual(e,"true"))}function Uy(e){return Y(parseFloat(e))}function wy(e){return Y(e)}function Ny(e){return e.length>0}function Ly(e){return e.reduce((r,n)=>s.IsEqual(n.length,3)?[...r,[n[1]]]:[...r,[]],[])}function vy(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function ky(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var Qg=(e,r)=>r.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?ho(n,i[0]):s.IsEqual(i.length,0)?$t(n):Rn()},e),Wg=(e,r)=>s.IsEqual(r.length,3)?vi(e,r[0],r[1],r[2]):e;function My(e){let[r,n,o,i]=e;return Wg(r?To(Qg(n,o)):Qg(n,o),i)}function au(e,r){return s.IsEqual(r.length,3)?(()=>{let[n,o,i]=r,a=au(o,i);if(s.IsEqual(n,"&"))return w(a)?Pt([e,...a.allOf]):Pt([e,a]);if(s.IsEqual(n,"|"))return S(a)?$([e,...a.anyOf]):$([e,a]);Rn()})():e}function Dy(e){let[r,n]=e;return au(r,n)}function Gy(e){let[r,n]=e;return au(r,n)}function $y(e){return nu(e[1])}function jy(e){return e[1]}function qy(e){return jr(e[0],e[2])}function By(e){return s.IsEqual(e.length,4)?Si(e[1],e[3]):s.IsEqual(e.length,2)?Si(e[1],We()):Rn()}function Fy(e){return`${e}`}function Hy(e){return Be(e[3])?uo:Ie(e[3])?mo:Zt(e[3])?Jt:Ne(e[3])?Jt:Rn()}function Ky(e){return e.length>0}function zy(e){return e.length>0}function Yy(e){let[r,n,o,i,a]=e;return{[n]:r&&o?ht(yt(a)):r&&!o?ht(a):!r&&o?yt(a):a}}function Vy(e){return dr(e)}function Qy(e){return e.reduce((r,n)=>s.HasPropertyKey(n,uo)||s.HasPropertyKey(n,mo)||s.HasPropertyKey(n,Jt)?[r[0],g.Assign(r[1],n)]:[g.Assign(r[0],n),r[1]],[{},{}])}function Wy(e){return Qy(e[1])}function Zy(e){let[r,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(r,o)}function Xy(e){return s.IsEqual(e.length,5)?ht(yt(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?ht(e[3]):yt(e[3]):Rn()}function Jy(e){return ht(yt(e[1]))}function eh(e){return ht(e[1])}function th(e){return yt(e[0])}function rh(e){return s.IsEqual(e.length,2)?xn(e[1]):s.IsEqual(e.length,1)?e[0]:Rn()}function nh(e){return dr(e)}function oh(e){return Fe(e[1])}function ih(e){return ht(yt(e[4]))}function ah(e){return ht(e[3])}function sh(e){return yt(e[3])}function ch(e){return e[2]}function ph(e){return s.IsEqual(e.length,2)?xn(e[1]):s.IsEqual(e.length,1)?e[0]:Rn()}function uh(e){return dr(e)}function mh(e){return $r(e[1],e[4])}function lh(e){return Gr(e[2],e[5])}function Zg(e,r){return s.IsEqual(e,"remove")?ag(r):s.IsEqual(e,"add")?og(r):r}function dh(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function Xg(e,r){return s.IsEqual(e,"remove")?rg(r):s.IsEqual(e,"add")?eg(r):r}function fh(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function gh(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function yh(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?go(Ri(e[3]),e[5],e[6][0],Zg(e[1],Xg(e[8],e[10]))):go(Ri(e[3]),e[5],we(e[3]),Zg(e[1],Xg(e[8],e[10])))}function hh(e){return we(e)}function Th(e){return Eo(e[2],e[4])}function Eh(e){return parseFloat(e)}function Ih(e){return s.IsEqual(e,"true")}function _h(e){return null}function bh(e){return{[e[0]]:e[2]}}function Sh(e){return dr(e)}function rv(e){return e.reduce((r,n)=>g.Assign(r,n),{})}function Oh(e){return rv(e[1])}function Ah(e){return dr(e)}function xh(e){return e[1]}function Rh(e){return xi()}function Ch(e){return Et()}function Ph(e){return Ut()}function Uh(e){return On()}function wh(e){return X()}function Nh(e){return Y(e)}function Lh(e){return $(e[1])}function vh(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function kh(e){return[e[0],...e[1]]}function Mh(e){return e[1]}function Dh(e){return dr(e)}function Gh(e){return s.IsEqual(e.length,2)?e[1]:[]}function $h(e){let r=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:jr(r,yo(n,o,a))}}function jh(e){let r=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:yo(r,n,i)}}function qh(e){return{[e[1]]:jr(e[2],e[4])}}function Bh(e){return{[e[1]]:e[3]}}function Fh(e){return null}function Hh(e){return Qy(dr(e))}function Kh(e){return e[1]}function zh(e){let r=e[0],n=e[1];return cu(g.Assign(r,n[0]))}function se(e){return Tn(e)&&te(e.length,2)}function iv(e,r){return te(r.indexOf(e),0)?[e,r.slice(e.length)]:[]}function $e(e,r){let[n,...o]=e;return Mr(n)?(()=>{let i=iv(n,r);return te(i.length,2)?i:$e(o,r)})():[]}function pu(e,r){return Array.from({length:r-e+1},(n,o)=>String.fromCharCode(e+o))}var Yh=[...pu(97,122),...pu(65,90)],uu="0",mu=pu(49,57),Io=[uu,...mu],Vh=" ",_o=`
|
|
30
|
+
`;var Kr="_",ec=".",Qh="$",tc="-";var Wh="//",Zh="/*",sv="*/";function Xh(e){let r=e.indexOf(sv);return te(r,-1)?"":e.slice(r+2)}function Jh(e){let r=e.indexOf(_o);return te(r,-1)?"":e.slice(r)}function cv(e){return e.replace(/^[ \t\r\f\v]+/,"")}function rc(e){let r=cv(e);return r.startsWith(Zh)?rc(Xh(r.slice(2))):r.startsWith(Wh)?rc(Jh(r.slice(2))):r}function _t(e){let r=e.trimStart();return r.startsWith(Zh)?_t(Xh(r.slice(2))):r.startsWith(Wh)?_t(Jh(r.slice(2))):r}function pv(e,r){return e.includes(r)}function bo(e,r,n,o=""){let i=$e(e,n);return se(i)?pv(r,i[0])?bo(e,r,i[1],o):bo(e,r,i[1],`${o}${i[0]}`):[o,n]}function nc(e,r){let n=$e([e],r);return se(n)?n:["",r]}function uv(e){return nc(tc,e)}function mv(e){return $e(mu,e)}var lv=[...Io,Kr];function dv(e){return bo(lv,[Kr],e)}function fv(e){let r=uv(e);return se(r)?(()=>{let n=$e([uu],r[1]);return se(n)?[`${r[0]}${n[0]}`,n[1]]:(()=>{let o=mv(r[1]);return se(o)?(()=>{let i=dv(o[1]);return se(i)?[`${r[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function oc(e){return fv(_t(e))}function gv(e){let r=oc(e);return se(r)?(()=>{let n=$e(["n"],r[1]);return se(n)?[`${r[0]}`,n[1]]:[]})():[]}function eT(e){return gv(e)}function lu(e,r){return $e([e],r)}function h(e,r){return te(e,"")?["",r]:e.startsWith(_o)?lu(e,rc(r)):e.startsWith(Vh)?lu(e,r):lu(e,_t(r))}var tT=[...Yh,Kr,Qh];function yv(e){return $e(tT,e)}var hv=[...tT,...Io];function rT(e,r=""){let n=$e(hv,e);return se(n)?rT(n[1],`${r}${n[0]}`):[r,e]}function Tv(e){let r=yv(e);return se(r)?(()=>{let n=rT(r[1]);return se(n)?[`${r[0]}${n[0]}`,n[1]]:[]})():[]}function be(e){return Tv(_t(e))}var Ev=[...Io,Kr];function Iv(e){return nc(tc,e)}function _v(e){return se($e([ec],e))}function nT(e){let r=bo(Ev,[Kr],e);return se(r)?te(r[0],"")?[]:[r[0],r[1]]:[]}function bv(e,r){let n=$e([ec],r);return se(n)?(()=>{let o=nT(n[1]);return se(o)?[`${e}0${n[0]}${o[0]}`,o[1]]:[]})():[]}function Sv(e,r){let n=oc(r);return se(n)?(()=>{let o=$e([ec],n[1]);return se(o)?(()=>{let i=nT(o[1]);return se(i)?[`${e}${n[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${n[0]}`,o[1]]})():[`${e}${n[0]}`,n[1]]})():[]}function Ov(e){let r=Iv(e);return se(r)?_v(r[1])?bv(r[0],r[1]):Sv(r[0],r[1]):[]}function ic(e){return Ov(_t(e))}function oT(e,r){let[n,...o]=e;return Mr(n)?r.startsWith(n)?!0:oT(o,r):!1}function zr(e,r,n=""){return te(r,"")?[]:oT(e,r)?[n,r]:(()=>{let[o,i]=[r.slice(0,1),r.slice(1)];return zr(e,i,`${n}${o}`)})()}function Av(e,r,n){return n.startsWith(e)?(()=>{let o=zr([r],n.slice(e.length));return se(o)?o[1].startsWith(r)?[`${o[0]}`,o[1].slice(r.length)]:[]:[]})():[]}function xv(e,r,n){return n.startsWith(e)?(()=>{let o=zr([_o,r],n.slice(e.length));return se(o)?o[1].startsWith(r)?[`${o[0]}`,o[1].slice(r.length)]:[]:[]})():[]}function iT(e,r,n,o){return n?Av(e,r,_t(o)):xv(e,r,_t(o))}function Rv(e,r){return $e(e,r)}function Cv(e,r){return iT(e,e,!1,r)}function Pv(e,r){let n=Rv(e,r);return se(n)?Cv(n[0],`${n[0]}${n[1]}`):[]}function ac(e,r){return Pv(e,_t(r))}function aT(e,r){let n=zr(e,r);return se(n)?te(n[0],"")?[]:n:[]}var u=(e,r,n=()=>[])=>e.length===2?r(e):n(),wv=e=>u(u(be(e),([r,n])=>u(h("extends",n),([o,i])=>u(ee(i),([a,c])=>u(h("=",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[Jg(r),n]),Nv=e=>u(u(be(e),([r,n])=>u(h("extends",n),([o,i])=>u(ee(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[ey(r),n]),Lv=e=>u(u(be(e),([r,n])=>u(h("=",n),([o,i])=>u(ee(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[ty(r),n]),vv=e=>u(be(e),([r,n])=>[ry(r),n]),pT=e=>u(u(wv(e),([r,n])=>[r,n],()=>u(Nv(e),([r,n])=>[r,n],()=>u(Lv(e),([r,n])=>[r,n],()=>u(vv(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),uT=(e,r=[])=>u(u(pT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>uT(o,[...r,n]),()=>[r,e]),kv=e=>u(u(uT(e),([r,n])=>u(u(u(pT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[ny(r),n]),gu=e=>u(u(h("<",e),([r,n])=>u(kv(n),([o,i])=>u(h(">",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[oy(r),n]),mT=(e,r=[])=>u(u(ee(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>mT(o,[...r,n]),()=>[r,e]),Mv=e=>u(u(mT(e),([r,n])=>u(u(u(ee(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[iy(r),n]),Dv=e=>u(u(h("<",e),([r,n])=>u(Mv(n),([o,i])=>u(h(">",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[ay(r),n]),Gv=e=>u(u(be(e),([r,n])=>u(Dv(n),([o,i])=>[[r,o],i])),([r,n])=>[sy(r),n]),lT=e=>u(u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[cy(r),n]),dT=e=>u(h("string",e),([r,n])=>[py(r),n]),fT=e=>u(h("number",e),([r,n])=>[uy(r),n]),$v=e=>u(h("boolean",e),([r,n])=>[my(r),n]),jv=e=>u(h("undefined",e),([r,n])=>[ly(r),n]),qv=e=>u(h("null",e),([r,n])=>[dy(r),n]),gT=e=>u(h("integer",e),([r,n])=>[fy(r),n]),Bv=e=>u(h("bigint",e),([r,n])=>[gy(r),n]),Fv=e=>u(h("unknown",e),([r,n])=>[yy(r),n]),Hv=e=>u(h("any",e),([r,n])=>[hy(r),n]),Kv=e=>u(h("object",e),([r,n])=>[Ty(r),n]),zv=e=>u(h("never",e),([r,n])=>[Ey(r),n]),yT=e=>u(h("symbol",e),([r,n])=>[Iy(r),n]),Yv=e=>u(h("void",e),([r,n])=>[_y(r),n]),Vv=e=>u(h("this",e),([r,n])=>[by(r),n]),Qv=e=>u(u(dT(e),([r,n])=>[r,n],()=>u(fT(e),([r,n])=>[r,n],()=>u($v(e),([r,n])=>[r,n],()=>u(jv(e),([r,n])=>[r,n],()=>u(qv(e),([r,n])=>[r,n],()=>u(gT(e),([r,n])=>[r,n],()=>u(Bv(e),([r,n])=>[r,n],()=>u(Fv(e),([r,n])=>[r,n],()=>u(Hv(e),([r,n])=>[r,n],()=>u(Kv(e),([r,n])=>[r,n],()=>u(zv(e),([r,n])=>[r,n],()=>u(yT(e),([r,n])=>[r,n],()=>u(Yv(e),([r,n])=>[r,n],()=>u(Vv(e),([r,n])=>[r,n],()=>[])))))))))))))),([r,n])=>[r,n]),Wv=e=>u(u(h("${",e),([r,n])=>u(ee(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Sy(r),n]),du=e=>u(zr(["${","`"],e),([r,n])=>[Oy(r),n]),hT=e=>u(u(u(du(e),([r,n])=>u(Wv(n),([o,i])=>u(hT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(u(du(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(du(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[Ay(r),n]),yu=e=>u(u(h("`",e),([r,n])=>u(hT(n),([o,i])=>u(h("`",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[xy(r),n]),Zv=e=>u(yu(e),([r,n])=>[Ry(r),n]),Xv=e=>u(eT(e),([r,n])=>[Cy(r),n]),Jv=e=>u(u(h("true",e),([r,n])=>[r,n],()=>u(h("false",e),([r,n])=>[r,n],()=>[])),([r,n])=>[Py(r),n]),ek=e=>u(ic(e),([r,n])=>[Uy(r),n]),tk=e=>u(ac(["'",'"'],e),([r,n])=>[wy(r),n]),rk=e=>u(u(Xv(e),([r,n])=>[r,n],()=>u(Jv(e),([r,n])=>[r,n],()=>u(ek(e),([r,n])=>[r,n],()=>u(tk(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),nk=e=>u(u(u(h("keyof",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Ny(r),n]),TT=(e,r=[])=>u(u(u(h("[",e),([n,o])=>u(ee(o),([i,a])=>u(h("]",a),([c,m])=>[[n,i,c],m]))),([n,o])=>[n,o],()=>u(u(h("[",e),([n,o])=>u(h("]",o),([i,a])=>[[n,i],a])),([n,o])=>[n,o],()=>[])),([n,o])=>TT(o,[...r,n]),()=>[r,e]),ok=e=>u(TT(e),([r,n])=>[Ly(r),n]),ik=e=>u(u(u(h("extends",e),([r,n])=>u(ee(n),([o,i])=>u(h("?",i),([a,c])=>u(ee(c),([m,l])=>u(h(":",l),([f,y])=>u(ee(y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[vy(r),n]),ak=e=>u(u(u(h("(",e),([r,n])=>u(ee(n),([o,i])=>u(h(")",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(Qv(e),([r,n])=>[r,n],()=>u(Tk(e),([r,n])=>[r,n],()=>u(Ok(e),([r,n])=>[r,n],()=>u(Zv(e),([r,n])=>[r,n],()=>u(rk(e),([r,n])=>[r,n],()=>u(Uk(e),([r,n])=>[r,n],()=>u(Pk(e),([r,n])=>[r,n],()=>u(vk(e),([r,n])=>[r,n],()=>u(Mk(e),([r,n])=>[r,n],()=>u(Gv(e),([r,n])=>[r,n],()=>u(kk(e),([r,n])=>[r,n],()=>[])))))))))))),([r,n])=>[ky(r),n]),ET=e=>u(u(nk(e),([r,n])=>u(ak(n),([o,i])=>u(ok(i),([a,c])=>u(ik(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[My(r),n]),IT=e=>u(u(u(h("&",e),([r,n])=>u(ET(n),([o,i])=>u(IT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),_T=e=>u(u(ET(e),([r,n])=>u(IT(n),([o,i])=>[[r,o],i])),([r,n])=>[Dy(r),n]),bT=e=>u(u(u(h("|",e),([r,n])=>u(_T(n),([o,i])=>u(bT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),sc=e=>u(u(_T(e),([r,n])=>u(bT(n),([o,i])=>[[r,o],i])),([r,n])=>[Gy(r),n]),sk=e=>u(u(h("readonly",e),([r,n])=>u(sc(n),([o,i])=>[[r,o],i])),([r,n])=>[$y(r),n]),ck=e=>u(u(h("|",e),([r,n])=>u(sc(n),([o,i])=>[[r,o],i])),([r,n])=>[jy(r),n]),pk=e=>u(u(gu(e),([r,n])=>u(h("=",n),([o,i])=>u(ee(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[qy(r),n]),uk=e=>u(u(u(h("infer",e),([r,n])=>u(be(n),([o,i])=>u(h("extends",i),([a,c])=>u(sc(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[r,n],()=>u(u(h("infer",e),([r,n])=>u(be(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>[])),([r,n])=>[By(r),n]),ee=e=>u(u(uk(e),([r,n])=>[r,n],()=>u(ck(e),([r,n])=>[r,n],()=>u(sk(e),([r,n])=>[r,n],()=>u(sc(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),mk=e=>u(ic(e),([r,n])=>[Fy(r),n]),lk=e=>u(be(e),([r,n])=>[r,n]),dk=e=>u(ac(["'",'"'],e),([r,n])=>[r,n]),fk=e=>u(u(h("[",e),([r,n])=>u(be(n),([o,i])=>u(h(":",i),([a,c])=>u(u(gT(c),([m,l])=>[m,l],()=>u(fT(c),([m,l])=>[m,l],()=>u(dT(c),([m,l])=>[m,l],()=>u(yT(c),([m,l])=>[m,l],()=>[])))),([m,l])=>u(h("]",l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[Hy(r),n]),ST=e=>u(u(mk(e),([r,n])=>[r,n],()=>u(lk(e),([r,n])=>[r,n],()=>u(dk(e),([r,n])=>[r,n],()=>u(fk(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),gk=e=>u(u(u(h("readonly",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Ky(r),n]),yk=e=>u(u(u(h("?",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[zy(r),n]),OT=e=>u(u(gk(e),([r,n])=>u(ST(n),([o,i])=>u(yk(i),([a,c])=>u(h(":",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[Yy(r),n]),AT=e=>u(u(u(h(",",e),([r,n])=>u(h(`
|
|
31
|
+
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>u(h(`
|
|
32
|
+
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(",",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(`
|
|
33
|
+
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),xT=(e,r=[])=>u(u(OT(e),([n,o])=>u(AT(o),([i,a])=>[[n,i],a])),([n,o])=>xT(o,[...r,n]),()=>[r,e]),hk=e=>u(u(xT(e),([r,n])=>u(u(u(OT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Vy(r),n]),hu=e=>u(u(h("{",e),([r,n])=>u(hk(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Wy(r),n]),Tk=e=>u(hu(e),([r,n])=>[Zy(r),n]),Ek=e=>u(u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(ee(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(ee(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(ee(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>[])))),([r,n])=>[Xy(r),n]),Ik=e=>u(u(h("readonly",e),([r,n])=>u(ee(n),([o,i])=>u(h("?",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Jy(r),n]),_k=e=>u(u(h("readonly",e),([r,n])=>u(ee(n),([o,i])=>[[r,o],i])),([r,n])=>[eh(r),n]),bk=e=>u(u(ee(e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[th(r),n]),sT=e=>u(u(Ek(e),([r,n])=>[r,n],()=>u(Ik(e),([r,n])=>[r,n],()=>u(_k(e),([r,n])=>[r,n],()=>u(bk(e),([r,n])=>[r,n],()=>u(ee(e),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),RT=e=>u(u(u(h("...",e),([r,n])=>u(sT(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(sT(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[rh(r),n]),CT=(e,r=[])=>u(u(RT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>CT(o,[...r,n]),()=>[r,e]),Sk=e=>u(u(CT(e),([r,n])=>u(u(u(RT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[nh(r),n]),Ok=e=>u(u(h("[",e),([r,n])=>u(Sk(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[oh(r),n]),Ak=e=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[ih(r),n]),xk=e=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(ee(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[ah(r),n]),Rk=e=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(ee(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[sh(r),n]),Ck=e=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(ee(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[ch(r),n]),cT=e=>u(u(Ak(e),([r,n])=>[r,n],()=>u(xk(e),([r,n])=>[r,n],()=>u(Rk(e),([r,n])=>[r,n],()=>u(Ck(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),PT=e=>u(u(u(h("...",e),([r,n])=>u(cT(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(cT(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[ph(r),n]),UT=(e,r=[])=>u(u(PT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>UT(o,[...r,n]),()=>[r,e]),wT=e=>u(u(UT(e),([r,n])=>u(u(u(PT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[uh(r),n]),Pk=e=>u(u(h("(",e),([r,n])=>u(wT(n),([o,i])=>u(h(")",i),([a,c])=>u(h("=>",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[mh(r),n]),Uk=e=>u(u(h("new",e),([r,n])=>u(h("(",n),([o,i])=>u(wT(i),([a,c])=>u(h(")",c),([m,l])=>u(h("=>",l),([f,y])=>u(ee(y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[lh(r),n]),wk=e=>u(u(u(h("+",e),([r,n])=>u(h("readonly",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("-",e),([r,n])=>u(h("readonly",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("readonly",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])))),([r,n])=>[dh(r),n]),Nk=e=>u(u(u(h("+",e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("-",e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("?",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])))),([r,n])=>[fh(r),n]),Lk=e=>u(u(u(h("as",e),([r,n])=>u(ee(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[gh(r),n]),vk=e=>u(u(h("{",e),([r,n])=>u(wk(n),([o,i])=>u(h("[",i),([a,c])=>u(be(c),([m,l])=>u(h("in",l),([f,y])=>u(ee(y),([E,A])=>u(Lk(A),([ye,Ue])=>u(h("]",Ue),([vr,ro])=>u(Nk(ro),([yn,xw])=>u(h(":",xw),([Rw,Cw])=>u(ee(Cw),([Pw,Uw])=>u(lT(Uw),([ww,Nw])=>u(h("}",Nw),([Lw,vw])=>[[r,o,a,m,f,E,ye,vr,yn,Rw,Pw,ww,Lw],vw]))))))))))))),([r,n])=>[yh(r),n]),kk=e=>u(be(e),([r,n])=>[hh(r),n]),Mk=e=>u(u(h("Options",e),([r,n])=>u(h("<",n),([o,i])=>u(ee(i),([a,c])=>u(h(",",c),([m,l])=>u(vT(l),([f,y])=>u(h(">",y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[Th(r),n]),Dk=e=>u(ic(e),([r,n])=>[Eh(r),n]),Gk=e=>u(u(h("true",e),([r,n])=>[r,n],()=>u(h("false",e),([r,n])=>[r,n],()=>[])),([r,n])=>[Ih(r),n]),$k=e=>u(ac(['"',"'"],e),([r,n])=>[r,n]),jk=e=>u(h("null",e),([r,n])=>[_h(r),n]),NT=e=>u(u(ST(e),([r,n])=>u(h(":",n),([o,i])=>u(Tu(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[bh(r),n]),LT=(e,r=[])=>u(u(NT(e),([n,o])=>u(AT(o),([i,a])=>[[n,i],a])),([n,o])=>LT(o,[...r,n]),()=>[r,e]),qk=e=>u(u(LT(e),([r,n])=>u(u(u(NT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Sh(r),n]),vT=e=>u(u(h("{",e),([r,n])=>u(qk(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Oh(r),n]),kT=(e,r=[])=>u(u(Tu(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>kT(o,[...r,n]),()=>[r,e]),Bk=e=>u(u(kT(e),([r,n])=>u(u(u(Tu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Ah(r),n]),Fk=e=>u(u(h("[",e),([r,n])=>u(Bk(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[xh(r),n]),Tu=e=>u(u(Dk(e),([r,n])=>[r,n],()=>u(Gk(e),([r,n])=>[r,n],()=>u($k(e),([r,n])=>[r,n],()=>u(jk(e),([r,n])=>[r,n],()=>u(vT(e),([r,n])=>[r,n],()=>u(Fk(e),([r,n])=>[r,n],()=>[])))))),([r,n])=>[r,n]),Hk=e=>u(h("-?(?:0|[1-9][0-9]*)n",e),([r,n])=>[Rh(r),n]),Kk=e=>u(h(".*",e),([r,n])=>[Ch(r),n]),zk=e=>u(h("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([r,n])=>[Ph(r),n]),Yk=e=>u(h("-?(?:0|[1-9][0-9]*)",e),([r,n])=>[Uh(r),n]),Vk=e=>u(h("(?!)",e),([r,n])=>[wh(r),n]),Qk=e=>u(aT(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([r,n])=>[Nh(r),n]),Wk=e=>u(u(Hk(e),([r,n])=>[r,n],()=>u(Kk(e),([r,n])=>[r,n],()=>u(zk(e),([r,n])=>[r,n],()=>u(Yk(e),([r,n])=>[r,n],()=>u(Vk(e),([r,n])=>[r,n],()=>u(Zk(e),([r,n])=>[r,n],()=>u(Qk(e),([r,n])=>[r,n],()=>[]))))))),([r,n])=>[r,n]),Zk=e=>u(u(h("(",e),([r,n])=>u(Eu(n),([o,i])=>u(h(")",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Lh(r),n]),MT=e=>u(u(u(fu(e),([r,n])=>u(h("|",n),([o,i])=>u(MT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(u(fu(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[]))),([r,n])=>[vh(r),n]),fu=e=>u(u(Wk(e),([r,n])=>u(Eu(n),([o,i])=>[[r,o],i])),([r,n])=>[kh(r),n]),Eu=e=>u(u(MT(e),([r,n])=>[r,n],()=>u(fu(e),([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),DT=e=>u(u(h("^",e),([r,n])=>u(Eu(n),([o,i])=>u(h("$",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Mh(r),n]),GT=(e,r=[])=>u(u(ee(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>GT(o,[...r,n]),()=>[r,e]),Xk=e=>u(u(GT(e),([r,n])=>u(u(u(ee(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Dh(r),n]),$T=e=>u(u(u(h("extends",e),([r,n])=>u(Xk(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Gh(r),n]),Jk=e=>u(u(h("interface",e),([r,n])=>u(be(n),([o,i])=>u(gu(i),([a,c])=>u($T(c),([m,l])=>u(hu(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[$h(r),n]),eM=e=>u(u(h("interface",e),([r,n])=>u(be(n),([o,i])=>u($T(i),([a,c])=>u(hu(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[jh(r),n]),tM=e=>u(u(h("type",e),([r,n])=>u(be(n),([o,i])=>u(gu(i),([a,c])=>u(h("=",c),([m,l])=>u(ee(l),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[qh(r),n]),rM=e=>u(u(h("type",e),([r,n])=>u(be(n),([o,i])=>u(h("=",i),([a,c])=>u(ee(c),([m,l])=>[[r,o,a,m],l])))),([r,n])=>[Bh(r),n]),nM=e=>u(u(u(h("export",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Fh(r),n]),oM=e=>u(u(u(h(";",e),([r,n])=>u(h(`
|
|
34
|
+
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(`
|
|
35
|
+
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]),jT=(e,r=[])=>u(u(Iu(e),([n,o])=>u(oM(o),([i,a])=>[[n,i],a])),([n,o])=>jT(o,[...r,n]),()=>[r,e]),iM=e=>u(u(jT(e),([r,n])=>u(u(u(Iu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Hh(r),n]),Iu=e=>u(u(nM(e),([r,n])=>u(u(Jk(n),([o,i])=>[o,i],()=>u(eM(n),([o,i])=>[o,i],()=>u(tM(n),([o,i])=>[o,i],()=>u(rM(n),([o,i])=>[o,i],()=>[])))),([o,i])=>u(lT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Kh(r),n]),aM=e=>u(u(Iu(e),([r,n])=>u(iM(n),([o,i])=>[[r,o],i])),([r,n])=>[zh(r),n]),qT=e=>u(u(aM(e),([r,n])=>[r,n],()=>u(pk(e),([r,n])=>[r,n],()=>u(ee(e),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]);function BT(e){let r=yu(`\`${e}\``);return s.IsEqual(r.length,2)?r[0]:H()}function Pi(e,r={}){return P("TemplateLiteral",[e],r)}function FT(e){return C({},Pi(e,{}))}function cM(e){let r=BT(e);return FT(r)}function HT(e,r={}){let n=s.IsString(e)?cM(e):FT(e);return g.Update(n,{},r)}function Ce(e){return _(e,"TemplateLiteral")}var L={};vt(L,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>_u,IsExtendsFalse:()=>pM,IsExtendsTrue:()=>zT,IsExtendsTrueLike:()=>Se,IsExtendsUnion:()=>KT});function _u(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function KT(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function x(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function zT(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function F(){return g.Create({"~kind":"ExtendsFalse"},{})}function pM(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Se(e){return KT(e)||zT(e)}function cc(e){let r=DT(e);return s.IsEqual(r.length,2)?r[0]:H()}function uM(e){return!0}function YT(e){let[r,...n]=e;return O(r)?mM(r)?YT(n):!1:!0}function VT(e){return s.IsEqual(e.length,0)?!1:YT(e)}function mM(e){return S(e)?VT(e.anyOf):J(e)?uM(e.const):!1}function pc(e){return VT(e)}function QT(e,r,n=[]){let[o,...i]=e;return s.IsString(o)?QT(i,r,[...n,`${o}${r}`]):n}function lM(e,r){return s.IsEqual(e.length,0)?[`${r}`]:QT(e,r)}function WT(e,r,n=[]){let[o,...i]=r;return O(o)?WT(e,i,[...n,...ZT(e,o)]):n}function ZT(e,r){return S(r)?WT(e,r.anyOf):J(r)?lM(e,r.const):H()}function XT(e,r){let[n,...o]=r;return O(n)?XT(ZT(e,n),o):e}function dM(e){return e.map(r=>Y(r))}function fM(e){let r=XT([],e),n=dM(r);return $(n)}function gM(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&J(e[0])?e[0]:fM(e)}function et(e){let r=cc(e);return pc(r)?gM(r):Et()}function yM(e){return s.IsString(e)||s.IsNumber(e)?Y(e):s.IsNull(e)?Fr():X()}function jt(e){return e.map(n=>yM(n))}function Vi(e){let r=jt(e);return $(r)}function Cn(e){return Vi(e.enum)}function hM(e,r,n,o){let i=ne(e,n,o);return Se(i)?x(g.Assign(g.Assign(e,i.inferred),{[r]:n})):F()}function TM(e,r){return x(e)}function EM(e,r,n){let o=Vi(n);return ne(e,r,o)}function JT(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?JT(a.inferred,r,i):F()})():x(e)}function IM(e,r,n){let o=et(n);return ne(e,r,o)}function eE(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?x(a.inferred):eE(e,r,i)})():F()}function K(e,r,n){return st(n)?TM(e,r):Re(n)?EM(e,r,n.enum):xe(n)?hM(e,n.name,r,n.extends):w(n)?JT(e,r,n.allOf):Ce(n)?IM(e,r,n.pattern):S(n)?eE(e,r,n.anyOf):Tt(n)?x(e):F()}function tE(e,r,n){return xe(n)?K(e,r,n):st(n)?x(e):Tt(n)?x(e):_u(e)}function _M(e,r){let n=_n(e),o=_n(r);return n&&o||!n&&o?!0:!(n&&!o)}function rE(e,r,n,o){return re(o)?_M(r,o)?ne(e,n,o.items):F():K(e,r,o)}function nE(e,r,n){return ot(n)?ne(e,r,n.iteratorItems):K(e,Yt(r),n)}function oE(e,r,n){return St(n)?x(e):K(e,r,n)}function iE(e,r,n){return pt(n)?x(e):K(e,r,n)}function bM(e,r,n,o,i){let a=xe(o)?r:o,c=xe(o)?o:r,m=Me(r),l=Me(o),f=ne(e,a,c);return!m&&l?F():Se(f)?Qi(f.inferred,n,i):F()}function SM(e,r,n,o){let[i,...a]=o;return O(i)?bM(e,r,n,i,a):Me(r)?x(e):F()}function OM(e,r,n){let[o,...i]=r;return O(o)?SM(e,o,i,n):x(e)}function Qi(e,r,n){return OM(e,r,n)}function uc(e,r,n){return At(n)?x(e):ne(e,r,n)}function aE(e,r,n,o){return De(o)?(()=>{let i=Qi(e,r,o.parameters);return Se(i)?uc(i.inferred,n,o.instanceType):F()})():F()}function sE(e,r,n){return ne(e,Cn(r),n)}function cE(e,r,n,o){return Ge(o)?(()=>{let i=Qi(e,r,o.parameters);return Se(i)?uc(i.inferred,n,o.returnType):F()})():F()}function pE(e,r,n){return Be(n)?x(e):Ie(n)?x(e):K(e,r,n)}var Wi="equal",AM="disjoint",Zi="left-inside",Xi="right-inside";function Ji(e,r){let n=[Tt(e)?L.ExtendsFalse():rt({},e,r),Tt(e)?L.ExtendsTrue({}):rt({},r,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?Wi:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?Zi:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?Xi:AM}function xM(e){return S(e)?tr(e.anyOf):[e]}function tr(e){return e.reduce((r,n)=>[...r,...xM(n)],[])}function bu(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function uE(e){let r=bu(e.items);return N(r)}function RM(e,r){return bn(e)?!!bn(r):!1}function CM(e,r){return Me(e)?!!Me(r):!1}function PM(e,r){let n=RM(e,r),o=CM(e,r),i=Pe([e,r]),a=Gs(no(i));return n&&o?ht(yt(a)):n&&!o?ht(a):!n&&o?yt(a):a}function UM(e,r,n){return n in e?n in r?PM(e[n],r[n]):e[n]:n in r?r[n]:X()}function wM(e,r){return[...new Set([...s.Keys(r),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:UM(e,r,i)}),{})}function mE(e){return k(e)?e.properties:V(e)?bu(e.items):H()}function lE(e,r){let n=mE(e),o=mE(r),i=wM(n,o);return N(i)}function dE(e,r){let n=Ji(e,r);return s.IsEqual(n,Zi)?e:s.IsEqual(n,Xi)||s.IsEqual(n,Wi)?r:X()}function fE(e){return k(e)||V(e)}function gE(e){return w(e)?Pe(e.allOf):e}function NM(e,r){let n=gE(e),o=gE(r),i=fE(n),a=fE(o);return i&&a?lE(Yr(n),o):i&&!a?Yr(n):!i&&a?o:dE(Yr(n),o)}function yE(e,r,n=[]){let[o,...i]=r;return s.IsUndefined(o)?n.length===0?[e]:n:yE(e,i,[...n,NM(e,o)])}function hE(e,r,n=[]){let[o,...i]=e;return O(o)?hE(i,r,[...n,...ea([o],r)]):n}function ea(e,r=[]){let[n,...o]=e;return O(n)?S(n)?ea(o,hE(n.anyOf,r)):ea(o,yE(n,r)):r}function Pe(e){let r=ea(e);return Su(r)}function fr(e){return Su(e)}function Yr(e){return w(e)?Pe(e.allOf):S(e)?fr(e.anyOf):e}function Pn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?X():$(e)}function LM(e,r){return r.filter(n=>Ji(e,n)!==Xi)}function vM(e,r){let n=r.some(o=>{let i=Ji(e,o);return s.IsEqual(i,Zi)||s.IsEqual(i,Wi)});return s.IsEqual(n,!1)}function kM(e,r){let n=Yr(e);return st(n)?[n]:vM(n,r)?[...LM(n,r),n]:r}function Ou(e,r=[]){let[n,...o]=e;return O(n)?k(n)?Ou(o,[...r,n]):Ou(o,kM(n,r)):r}function Su(e){let r=Ou(e),n=tr(r);return n.length===0?X():n.length===1?n[0]:$(n)}function MM(e,r,n,o){let i=I(e,r,n);return g.Update(Yr(i),{},o)}function TE(e,r,n,o){return MM(e,r,n,o)}function EE(e,r,n){let o=Pe(r);return ne(e,o,n)}function IE(e,r,n){return it(n)?ne(e,r,n.iteratorItems):K(e,Qt(r),n)}function mc(e,r,n){return r===n?x(e):F()}function DM(e,r,n){return J(n)?mc(e,r,n.const):St(n)?x(e):K(e,Y(r),n)}function GM(e,r,n){return J(n)?mc(e,r,n.const):pt(n)?x(e):K(e,Y(r),n)}function $M(e,r,n){return J(n)?mc(e,r,n.const):Ie(n)?x(e):K(e,Y(r),n)}function jM(e,r,n){return J(n)?mc(e,r,n.const):Ne(n)?x(e):K(e,Y(r),n)}function _E(e,r,n){return s.IsBigInt(r.const)?DM(e,r.const,n):s.IsBoolean(r.const)?GM(e,r.const,n):s.IsNumber(r.const)?$M(e,r.const,n):s.IsString(r.const)?jM(e,r.const,n):H()}function bE(e,r,n){return xe(n)?K(e,r,n):x(e)}function SE(e,r,n){return Wt(n)?x(e):K(e,r,n)}function OE(e,r,n){return Ie(n)?x(e):K(e,r,n)}function qM(e,r,n){return Me(r)?Me(n)?x(e):F():x(e)}function BM(e,r,n){return xe(n)&&lr(n.extends)?F():(()=>{let o=ne(e,r,n);return Se(o)?qM(o.inferred,r,n):F()})()}function FM(e,r){return e.reduce((n,o)=>o in r?Se(r[o])?{...n,...r[o].inferred}:H():H(),{})}function HM(e,r,n){let o={};for(let c of s.Keys(n))o[c]=c in r?BM({},r[c],n[c]):Me(n[c])?xe(n[c])?x(g.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>Se(c)),a=i?FM(s.Keys(o),o):{};return i?x(a):F()}function KM(e,r,n){let o=HM(e,r,n);return Se(o)?x(g.Assign(e,o.inferred)):F()}function zM(e,r,n){return KM(e,r,n)}function AE(e,r,n){return k(n)?zM(e,r,n.properties):K(e,N(r),n)}function xE(e,r,n){return Xe(n)?ne(e,r,n.item):K(e,Xt(r),n)}function RE(e,r,n){return Ne(n)?x(e):K(e,r,n)}function CE(e,r,n){return Zt(n)?x(e):K(e,r,n)}function PE(e,r,n){let o=et(r);return ne(e,o,n)}function Au(e,r){return g.Create({"~kind":"Inferrable"},{name:e,type:r},{})}function ta(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function xu(e){return Hr(e)?xe(e.items)?re(e.items.extends)?Au(e.items.name,e.items.extends.items):Tt(e.items.extends)?Au(e.items.name,e.items.extends):void 0:H():void 0}function lc(e){return xe(e)?Au(e.name,e.extends):void 0}function Ru(e,r,n=[]){let[o,...i]=e;return O(o)?(()=>{let a=ne({},o,r);return Se(a)?Ru(i,r,[...n,o]):void 0})():n}function UE(e,r,n,o){let i=Ru(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:Fe(i)})):F()}function dc(e,r,n,o){let i=Ru(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:$(i)})):F()}function YM(e){return[...e].reverse()}function Cu(e,r){return r?YM(e):e}function VM(e){let r=e.length>0?e[0]:void 0,n=O(r)?xu(r):void 0;return O(n)}function QM(e,r,n,o,i,a){let c=ne(e,n,i);return Se(c)?wE(c.inferred,r,o,a):F()}function WM(e,r,n,o,i){let a=xu(o);return ta(a)?UE(e,a.name,Cu(n,r),a.type):(()=>{let[c,...m]=n;return O(c)?QM(e,r,c,m,o,i):F()})()}function ZM(e,r,n,o){let[i,...a]=o;return O(i)?WM(e,r,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function wE(e,r,n,o){return ZM(e,r,n,o)}function XM(e,r,n){let o=fc(e,{callstack:[]},n),i=VM(o);return wE(e,i,Cu(r,i),Cu(o,i))}function NE(e,r,n){let o=lc(n);return ta(o)?dc(e,o.name,r,o.type):(()=>{let[i,...a]=r;return O(i)?(()=>{let c=ne(e,i,n);return Se(c)?NE(c.inferred,a,n):F()})():x(e)})()}function LE(e,r,n){let o=fc(e,{callstack:[]},r);return V(n)?XM(e,o,n.items):re(n)?NE(e,o,n.items):K(e,Fe(o),n)}function vE(e,r,n){return At(n)?x(e):er(n)?x(e):K(e,r,n)}function kE(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?x(a.inferred):kE(e,r,i)})():F()}function Pu(e,r,n){let[o,...i]=r;return O(o)?(()=>{let a=kE(e,o,n);return Se(a)?Pu(a.inferred,i,n):F()})():x(e)}function ME(e,r,n){let o=lc(n);return ta(o)?dc(e,o.name,r,o.type):S(n)?Pu(e,r,n.anyOf):Pu(e,r,[n])}function DE(e,r,n){return xe(n)?K(e,r,n):st(n)?x(e):Tt(n)?x(e):F()}function GE(e,r,n){return At(n)?x(e):K(e,r,n)}function ne(e,r,n){return st(r)?tE(e,r,n):re(r)?rE(e,r,r.items,n):ot(r)?nE(e,r.iteratorItems,n):St(r)?oE(e,r,n):pt(r)?iE(e,r,n):De(r)?aE(e,r.parameters,r.instanceType,n):Re(r)?sE(e,r,n):Ge(r)?cE(e,r.parameters,r.returnType,n):Be(r)?pE(e,r,n):w(r)?EE(e,r.allOf,n):it(r)?IE(e,r.iteratorItems,n):J(r)?_E(e,r,n):lr(r)?bE(e,r,n):Wt(r)?SE(e,r,n):Ie(r)?OE(e,r,n):k(r)?AE(e,r.properties,n):Xe(r)?xE(e,r.item,n):Ne(r)?RE(e,r,n):Zt(r)?CE(e,r,n):Ce(r)?PE(e,r.pattern,n):V(r)?LE(e,r.items,n):er(r)?vE(e,r,n):S(r)?ME(e,r.anyOf,n):Tt(r)?DE(e,r,n):At(r)?GE(e,r,n):F()}function yo(e,r,n={}){return P("Interface",[e,r],n)}function So(e){return O(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function $E(e,r,n={}){return C({},yo(e,r,n))}function JM(e,r,n){return e.includes(n)?!0:Vr([...e,n],r,r[n])}function jE(e,r,n){let o=Vs(n);return Un(e,r,o)}function Un(e,r,n){let[o,...i]=n;return O(o)?Vr(e,r,o)?!0:Un(e,r,i):!1}function Vr(e,r,n){return pe(n)?JM(e,r,n.$ref):re(n)?Vr(e,r,n.items):ot(n)?Vr(e,r,n.iteratorItems):De(n)?Un(e,r,[...n.parameters,n.instanceType]):Ge(n)?Un(e,r,[...n.parameters,n.returnType]):So(n)?jE(e,r,n.parameters[1]):w(n)?Un(e,r,n.allOf):it(n)?Vr(e,r,n.iteratorItems):k(n)?jE(e,r,n.properties):Xe(n)?Vr(e,r,n.item):S(n)?Un(e,r,n.anyOf):V(n)?Un(e,r,n.items):_e(n)?Vr(e,r,Je(n)):!1}function gc(e,r,n){return Vr(e,r,n)}function e0(e,r){return r.reduce((n,o)=>o in e?gc([o],e,e[o])?[...n,o]:n:H(),[])}function qE(e){let r=$g(e);return e0(e,r)}function t0(e,r,n){return n.includes(r)?n:r in e?Qr(e,e[r],[...n,r]):H()}function BE(e,r,n){let o=Vs(r);return Oo(e,o,n)}function Oo(e,r,n){return r.reduce((o,i)=>Qr(e,i,o),n)}function Qr(e,r,n){return pe(r)?t0(e,r.$ref,n):re(r)?Qr(e,r.items,n):ot(r)?Qr(e,r.iteratorItems,n):De(r)?Oo(e,[...r.parameters,r.instanceType],n):Ge(r)?Oo(e,[...r.parameters,r.returnType],n):So(r)?BE(e,r.parameters[1],n):w(r)?Oo(e,r.allOf,n):it(r)?Qr(e,r.iteratorItems,n):k(r)?BE(e,r.properties,n):Xe(r)?Qr(e,r.item,n):S(r)?Oo(e,r.anyOf,n):V(r)?Oo(e,r.items,n):_e(r)?Qr(e,Je(r),n):n}function FE(e,r,n){return Qr(e,n,[r])}function r0(e){return io()}function n0(e){return s.Keys(e).reduce((r,n)=>({...r,[n]:rr(e[n])}),{})}function ra(e){return e.reduce((r,n)=>[...r,rr(n)],[])}function rr(e){return pe(e)?r0(e.$ref):re(e)?$t(rr(e.items),js(e)):ot(e)?Yt(rr(e.iteratorItems)):De(e)?Gr(ra(e.parameters),rr(e.instanceType)):Ge(e)?$r(ra(e.parameters),rr(e.returnType)):w(e)?Pt(ra(e.allOf)):it(e)?Qt(rr(e.iteratorItems)):k(e)?N(n0(e.properties)):Xe(e)?Xt(rr(e.item)):_e(e)?Ws(lo(e),rr(Je(e))):S(e)?$(ra(e.anyOf)):V(e)?Fe(ra(e.items)):e}function o0(e,r){return r in e?rr(e[r]):We()}function HE(e){return o0(e.$defs,e.$ref)}function i0(e,r,n){let o=xt(e,{callstack:[]},r),i=na({},{callstack:[]},n);return Pe([...o,N(i)])}function a0(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>{let a=e[i],c=So(a)?i0(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function KE(e,r,n){let o=FE(e,r,n),i=a0(e,o);return Vt(i,r)}function zE(e,r){return r in e?pe(e[r])?zE(e,e[r].$ref):e[r]:X()}function nr(e,r){return zE(e,r)}function YE(e){return le(e)?HE(e):e}function rt(e,r,n){let o=YE(r),i=YE(n);return ne(e,o,i)}function s0(e,r,n){if(xe(r)||Ao(r)||L.IsExtendsTrueLike(rt({},r,n)))return;let o={parameter:e,extends:n,received:r};throw new Error("Generic argument does not satify constraint",{cause:o})}function VE(e,r,n,o,i){let a=I(e,r,i);return s0(n,a,o),g.Assign(e,{[n]:a})}function c0(e,r,n,o,i){let a=I(e,r,n.extends),c=I(e,r,n.equals),[m,...l]=i;return O(m)?Uu(VE(e,r,n.name,a,m),r,o,l):Uu(VE(e,r,n.name,a,c),r,o,[])}function Uu(e,r,n,o){let[i,...a]=n;return O(i)?c0(e,r,i,a,o):e}function QE(e,r,n,o){return Uu(e,r,n,o)}function p0(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function WE(e,r,n,o){let i=xt(e,r,o);return Js(n,i)}function u0(e,r,n,o){return WE(e,r,we(n),o)}function m0(e,r,n,o,i,a){let c=xt(e,r,a),m=QE(e,r,o,c),l=I(m,{callstack:[...r.callstack,n]},i);return I(e,r,l)}function yc(e,r,n,o){let[i,a]=gg(e,n,o);return oo(a)?s.IsEqual(p0(r.callstack),i)?u0(e,r,i,o):m0(e,r,i,a.parameters,a.expression,o):WE(e,r,n,o)}function Js(e,r){return g.Create({"~kind":"Call"},{target:e,arguments:r},{})}function ZE(e,r){return yc({},{callstack:[]},e,r)}function Ao(e){return _(e,"Call")}function XE(e){return Xe(e)?XE(e.item):e}function l0(e,r,n,o){let i=I(e,r,n);return g.Update(XE(i),{},o)}function JE(e,r,n,o){return v(e,[n])?l0(e,r,n,o):Yi(n,o)}function eI(e,r){return e(r)}function tI(e,r){return s.IsString(r)?Y(eI(e,r)):Y(r)}function rI(e,r){let n=et(r);return gr(e,n)}function nI(e,r){let n=r.map(o=>gr(e,o));return $(n)}function gr(e,r){return J(r)?tI(e,r.const):Ce(r)?rI(e,r.pattern):S(r)?nI(e,r.anyOf):r}function Ui(e,r={}){return P("Capitalize",[e],r)}function oI(e,r={}){return C({},Ui(e,r))}function wi(e,r={}){return P("Lowercase",[e],r)}function iI(e,r={}){return C({},wi(e,r))}function Ni(e,r={}){return P("Uncapitalize",[e],r)}function aI(e,r={}){return C({},Ni(e,r))}function Li(e,r={}){return P("Uppercase",[e],r)}function sI(e,r={}){return C({},Li(e,r))}var d0=e=>e[0].toUpperCase()+e.slice(1),f0=e=>e.toLowerCase(),g0=e=>e[0].toLowerCase()+e.slice(1),y0=e=>e.toUpperCase();function h0(e,r,n,o){let i=I(e,r,n);return g.Update(gr(d0,i),{},o)}function cI(e,r,n,o){return v(e,[n])?h0(e,r,n,o):Ui(n,o)}function T0(e,r,n,o){let i=I(e,r,n);return g.Update(gr(f0,i),{},o)}function pI(e,r,n,o){return v(e,[n])?T0(e,r,n,o):wi(n,o)}function E0(e,r,n,o){let i=I(e,r,n);return g.Update(gr(g0,i),{},o)}function uI(e,r,n,o){return v(e,[n])?E0(e,r,n,o):Ni(n,o)}function I0(e,r,n,o){let i=I(e,r,n);return g.Update(gr(y0,i),{},o)}function mI(e,r,n,o){return v(e,[n])?I0(e,r,n,o):Li(n,o)}function vi(e,r,n,o,i={}){return P("Conditional",[e,r,n,o],i)}function lI(e,r,n,o,i={}){return C({},vi(e,r,n,o,i))}function _0(e,r,n,o,i,a,c){let m=I(e,r,n),l=I(e,r,o),f=rt(e,m,l);return g.Update(L.IsExtendsUnion(f)?$([I(f.inferred,r,i),I(e,r,a)]):L.IsExtendsTrue(f)?I(f.inferred,r,i):I(e,r,a),{},c)}function dI(e,r,n,o,i,a,c){return v(e,[n,o])?_0(e,r,n,o,i,a,c):vi(n,o,i,a,c)}function ki(e,r={}){return P("ConstructorParameters",[e],r)}function fI(e,r={}){return C({},ki(e,r))}function b0(e){return De(e)?I({},{callstack:[]},Fe(e.parameters)):X()}function S0(e,r,n,o){let i=I(e,r,n);return g.Update(b0(i),{},o)}function gI(e,r,n,o){return v(e,[n])?S0(e,r,n,o):ki(n,o)}function Mi(e,r,n={}){return P("Exclude",[e,r],n)}function yI(e,r,n={}){return C({},Mi(e,r,n))}function hI(e,r){return e.reduce((n,o)=>[...n,...TI(o,r)],[])}function TI(e,r){let n=rt({},e,r);return L.IsExtendsTrueLike(n)?[]:[e]}function O0(e,r){let n=Re(e)?hI(jt(e.enum),r):S(e)?hI(tr(e.anyOf),r):TI(e,r);return fr(n)}function A0(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(O0(a,c),{},i)}function hc(e,r,n,o,i){return v(e,[n,o])?A0(e,r,n,o,i):Mi(n,o,i)}function Di(e,r,n={}){return P("Extract",[e,r],n)}function EI(e,r,n={}){return C({},Di(e,r,n))}function II(e,r){return e.reduce((n,o)=>[...n,..._I(o,r)],[])}function _I(e,r){let n=rt({},e,r);return L.IsExtendsTrueLike(n)?[e]:[]}function x0(e,r){let n=Re(e)?II(jt(e.enum),r):S(e)?II(tr(e.anyOf),r):_I(e,r);return fr(n)}function R0(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(x0(a,c),{},i)}function bI(e,r,n,o,i){return v(e,[n,o])?R0(e,r,n,o,i):Di(n,o,i)}var C0=new RegExp("^(?:0|[1-9][0-9]*)$");function xo(e){let r=`${e}`;return C0.test(r)?parseInt(r):e}function P0(e){return Y(xo(e))}function SI(e){return e.map(r=>OI(r))}function OI(e){return w(e)?Pt(SI(e.allOf)):S(e)?$(SI(e.anyOf)):J(e)?P0(e.const):e}function AI(e,r){let n=OI(r),o=rt({},n,Ut());return L.IsExtendsTrueLike(o)?e:X()}function xI(e,r){let n=nr(e,r);return or(n)}function Tc(e){return e.reduce((r,n)=>[...r,...or(n)],[])}function RI(e){let r=jt(e);return Tc(r)}function CI(e){let r=Pe(e);return or(r)}function PI(e){return[`${e}`]}function UI(e){let r=et(e);return or(r)}function or(e){return le(e)?xI(e.$defs,e.$ref):Re(e)?RI(e.enum):w(e)?CI(e.allOf):J(e)?PI(e.const):Ce(e)?UI(e.pattern):S(e)?Tc(e.anyOf):[]}function Ro(e){return or(e)}function U0(e,r){return r in e?[e[r]]:[]}function w0(e,r){return r.reduce((n,o)=>[...n,...U0(e,o)],[])}function wI(e,r){let n=Ro(r),o=w0(e,n);return fr(o)}function N0(e){return Y(xo(e))}function NI(e){return e.map(r=>wu(r))}function wu(e){return w(e)?Pt(NI(e.allOf)):S(e)?$(NI(e.anyOf)):J(e)?N0(e.const):e}function L0(e,r){return e.reduceRight((n,o,i)=>{let a=rt({},Y(i),r);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function v0(e,r){let n=wu(r),o=L0(e,n);return Pn(o)}function k0(e){return Pn(e)}function LI(e,r){return Ie(r)||Be(r)?k0(e):v0(e,r)}function M0(e){return e.reduce((r,n)=>zs(n)?[...r,Y(n)]:r,[])}function Co(e){let r=M0(e);return $(r)}function ho(e,r,n={}){return P("Index",[e,r],n)}function vI(e,r,n={}){let o=s.IsArray(r)?Co(r):r;return C({},ho(e,o,n))}function kI(e,r){let n=nr(e,r);return qt(n)}function D0(e,r){let n=s.Keys(e).filter(y=>!s.HasPropertyKey(r,y)),o=s.Keys(r).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(r,y)),a=n.reduce((y,E)=>({...y,[E]:e[E]}),{}),c=o.reduce((y,E)=>({...y,[E]:r[E]}),{}),m=i.reduce((y,E)=>({...y,[E]:Pe([e[E],r[E]])}),{}),l=g.Assign(a,c);return g.Assign(l,m)}function MI(e){return e.reduce((r,n)=>D0(r,qt(n)),{})}function DI(e){let r=uE(Fe(e));return qt(r)}function G0(e,r){return s.Keys(e).filter(i=>i in r).reduce((i,a)=>({...i,[a]:fr([e[a],r[a]])}),{})}function GI(e,r){let[n,...o]=e;return O(n)?GI(o,G0(r,qt(n))):r}function $I(e){let[r,...n]=e;return O(r)?GI(n,qt(r)):H()}function qt(e){return le(e)?kI(e.$defs,e.$ref):w(e)?MI(e.allOf):S(e)?$I(e.anyOf):V(e)?DI(e.items):k(e)?e.properties:{}}function Po(e){let r=qt(e);return N(r)}function $0(e){return le(e)||w(e)||S(e)?Po(e):e}function j0(e,r){let n=$0(e);return re(n)?AI(n.items,r):k(n)?wI(n.properties,r):V(n)?LI(n.items,r):X()}function q0(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(j0(a,c),{},i)}function jI(e,r,n,o,i){return v(e,[n,o])?q0(e,r,n,o,i):ho(n,o,i)}function Gi(e,r={}){return P("InstanceType",[e],r)}function qI(e,r={}){return C({},Gi(e,r))}function B0(e){return De(e)?e.instanceType:X()}function F0(e,r,n,o){let i=I(e,r,n);return g.Update(B0(i),{},o)}function BI(e,r,n,o={}){return v(e,[n])?F0(e,r,n,o):Gi(n,o)}function H0(e,r,n,o,i){let a=xt(e,{callstack:[]},n),c=na(e,{callstack:[]},o),m=Pe([...a,N(c)]);return g.Update(m,{},i)}function FI(e,r,n,o,i){return v(e,n)?H0(e,r,n,o,i):yo(n,o,i)}function To(e,r={}){return P("KeyOf",[e],r)}function HI(e,r={}){return C({},To(e,r))}function KI(){return $([Ut(),Et(),po()])}function zI(e){return Ut()}function K0(e){return e.reduce((n,o)=>zs(o)?[...n,Y(xo(o))]:H(),[])}function YI(e){let r=s.Keys(e),n=K0(r);return Pn(n)}function VI(e){return lo(e)}function QI(e){let r=e.map((n,o)=>Y(o));return Pn(r)}function z0(e){return le(e)||w(e)||S(e)?Po(e):e}function Y0(e){let r=z0(e);return st(r)?KI():re(r)?zI(r.items):k(r)?YI(r.properties):_e(r)?VI(r):V(r)?QI(r.items):X()}function V0(e,r,n,o){let i=I(e,r,n);return g.Update(Y0(i),{},o)}function WI(e,r,n,o){return v(e,[n])?V0(e,r,n,o):To(n,o)}function Q0(e){let r=et(e);return Nu(r)}function ZI(e){return e.reduce((r,n)=>[...r,...Nu(n)],[])}function Nu(e){return Re(e)?ZI(jt(e.enum)):co(e)||so(e)?[e]:Ce(e)?Q0(e.pattern):S(e)?ZI(e.anyOf):[]}function XI(e){return Nu(e)}function go(e,r,n,o,i={}){return P("Mapped",[e,r,n,o],i)}function JI(e,r,n,o,i={}){return C({},go(e,r,n,o,i))}function W0(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o}),c=I(a,r,i);return Ce(c)?et(c.pattern):c}function Z0(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o});return I(a,r,i)}function X0(e,r,n,o,i,a){let c=Z0(e,r,n,o,a),m=W0(e,r,n,o,i);return co(m)||so(m)?{[m.const]:c}:{}}function J0(e,r,n,o,i,a){return o.reduce((c,m)=>({...c,...X0(e,r,n,m,i,a)}),{})}function eD(e,r,n,o,i,a){let c=XI(o),m=J0(e,r,n,c,i,a);return N(m)}function tD(e,r,n,o,i,a,c){let m=I(e,r,o);return g.Update(eD(e,r,n,m,i,a),{},c)}function e_(e,r,n,o,i,a,c){return v(e,[o])?tD(e,r,n,o,i,a,c):go(n,o,i,a,c)}function rD(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>({...o,[i]:KE(e,i,e[i])}),{})}function nD(e,r){return s.Keys(e).filter(o=>!r.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function oD(e,r){let n=qE(e),o=rD(e,n),i=nD(e,n),a={...o,...i};return g.Update(a,{},r)}function t_(e,r,n,o){let i=g.Assign(e,n);return oD(i,o)}function $i(e,r={}){return P("NonNullable",[e],r)}function r_(e,r={}){return C({},$i(e,r))}function iD(e){let r=$([Fr(),fo()]);return hc({},{callstack:[]},e,r,{})}function aD(e,r,n,o){let i=I(e,r,n);return g.Update(iD(i),{},o)}function n_(e,r,n,o){return v(e,[n])?aD(e,r,n,o):$i(n,o)}function Ec(e){let r=Po(e);return k(r)?r.properties:H()}function ji(e,r,n={}){return P("Omit",[e,r],n)}function o_(e,r,n={}){let o=s.IsArray(r)?Co(r):r;return C({},ji(e,o,n))}function sD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?o:{...o,[i]:e[i]},{})}function cD(e,r){let n=Ec(e),o=Ro(r),i=sD(n,o);return N(i)}function pD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(cD(a,c),{},i)}function i_(e,r,n,o,i){return v(e,[n,o])?pD(e,r,n,o,i):ji(n,o,i)}function Eo(e,r){return P("Options",[e,r],{})}function Ic(e,r){return C({},Eo(e,r))}function uD(e,r,n,o){let i=I(e,r,n);return g.Update(i,{},o)}function a_(e,r,n,o){return v(e,[n])?uD(e,r,n,o):Eo(n,o)}function qi(e,r={}){return P("Parameters",[e],r)}function s_(e,r={}){return C({},qi(e,r))}function mD(e){return Ge(e)?I({},{callstack:[]},Fe(e.parameters)):X()}function lD(e,r,n,o){let i=I(e,r,n);return g.Update(mD(i),{},o)}function c_(e,r,n,o){return v(e,[n])?lD(e,r,n,o):qi(n,o)}function Bi(e,r={}){return P("Partial",[e],r)}function p_(e,r={}){return C({},Bi(e,r))}function u_(e,r){let n=nr(e,r),o=Wr(n);return Vt(g.Assign(e,{[r]:o}),r)}function m_(e){let r=e.map(n=>Wr(n));return Pe(r)}function l_(e){let r=e.map(n=>Wr(n));return $(r)}function d_(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Ds(e[i])}),{});return N(r)}function Wr(e){return le(e)?u_(e.$defs,e.$ref):w(e)?m_(e.allOf):S(e)?l_(e.anyOf):k(e)?d_(e.properties):N({})}function dD(e,r,n,o){let i=I(e,r,n);return g.Update(Wr(i),{},o)}function f_(e,r,n,o){return v(e,[n])?dD(e,r,n,o):Bi(n,o)}function Fi(e,r,n={}){return P("Pick",[e,r],n)}function g_(e,r,n={}){let o=s.IsArray(r)?Co(r):r;return C({},Fi(e,o,n))}function fD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function gD(e,r){let n=Ec(e),o=Ro(r),i=fD(n,o);return N(i)}function yD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(gD(a,c),{},i)}function y_(e,r,n,o,i){return v(e,[n,o])?yD(e,r,n,o,i):Fi(n,o,i)}function Hi(e,r={}){return P("ReadonlyType",[e],r)}function h_(e,r={}){return C({},Hi(e,r))}function T_(e){return Dr($t(e))}function E_(e,r){let n=nr(e,r),o=Zr(n);return Vt(g.Assign(e,{[r]:o}),r)}function I_(e){let r=e.map(n=>Zr(n));return Pe(r)}function __(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:$s(e[i])}),{});return N(r)}function b_(e){return Dr(Fe(e))}function S_(e){let r=e.map(n=>Zr(n));return $(r)}function Zr(e){return re(e)?T_(e.items):le(e)?E_(e.$defs,e.$ref):w(e)?I_(e.allOf):k(e)?__(e.properties):V(e)?b_(e.items):S(e)?S_(e.anyOf):e}function hD(e,r,n,o){let i=I(e,r,n);return g.Update(Zr(i),{},o)}function O_(e,r,n,o){return v(e,[n])?hD(e,r,n,o):Hi(n,o)}function A_(e){return It(Jt,e)}function x_(e){return N({true:e,false:e})}function R_(e,r){let n=Vi(e);return Xr(n,r)}function C_(e,r){return It(uo,r)}function P_(e,r){let n=Pe(e);return Xr(n,r)}function U_(e,r){return s.IsString(e)||s.IsNumber(e)?N({[e]:r}):s.IsEqual(e,!1)?N({false:r}):s.IsEqual(e,!0)?N({true:r}):N({})}function w_(e,r){return It(mo,r)}function N_(e,r){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?It(e.pattern.toString(),r):It(Jt,r)}function L_(e,r){let n=cc(e);return pc(n)?Xr(et(e),r):It(e,r)}function TD(e){return e.some(r=>Ne(r)||Ie(r)||Be(r))}function ED(e,r){return s.IsEqual(TD(e),!0)?It(Jt,r):void 0}function ID(e,r){return e.reduce((n,o)=>J(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:r}:n,{})}function _D(e,r){let n=ID(e,r);return N(n)}function v_(e,r){let n=tr(e),o=ED(n,r);return O(o)?o:_D(n,r)}function Xr(e,r){return st(e)?A_(r):pt(e)?x_(r):Re(e)?R_(e.enum,r):Be(e)?C_(e,r):w(e)?P_(e.allOf,r):J(e)?U_(e.const,r):Ie(e)?w_(e,r):S(e)?v_(e.anyOf,r):Ne(e)?N_(e,r):Ce(e)?L_(e.pattern,r):N({})}function bD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return g.Update(Xr(a,c),{},i)}function k_(e,r,n,o,i){return v(e,[n])?bD(e,r,n,o,i):Ci(n,o,i)}function M_(e,r,n){return n in e?gc([n],e,e[n])?we(n):I(e,r,e[n]):we(n)}function D_(e,r){let n=nr(e,r),o=Jr(n);return Vt(g.Assign(e,{[r]:o}),r)}function G_(e){let r=e.map(n=>Jr(n));return Pe(r)}function $_(e){let r=e.map(n=>Jr(n));return $(r)}function j_(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:no(e[i])}),{});return N(r)}function Jr(e){return le(e)?D_(e.$defs,e.$ref):w(e)?G_(e.allOf):S(e)?$_(e.anyOf):k(e)?j_(e.properties):N({})}function Ki(e,r={}){return P("Required",[e],r)}function q_(e,r={}){return C({},Ki(e,r))}function SD(e,r,n,o){let i=I(e,r,n);return g.Update(Jr(i),{},o)}function B_(e,r,n,o){return v(e,[n])?SD(e,r,n,o):Ki(n,o)}function zi(e,r={}){return P("ReturnType",[e],r)}function F_(e,r={}){return C({},zi(e,r))}function OD(e){return Ge(e)?e.returnType:X()}function AD(e,r,n,o){let i=I(e,r,n);return g.Update(OD(i),{},o)}function H_(e,r,n,o){return v(e,[n])?AD(e,r,n,o):zi(n,o)}function K_(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function xD(e){return e.join("|")}function RD(e){return e.slice(1,e.length-1)}function CD(e,r,n){return en(r,`${n}${e}`)}function PD(e,r){return en(e,`${r}${Lg}`)}function UD(e,r){return en(e,`${r}${Ks}`)}function wD(e,r){return en(e,`${r}${Ys}`)}function ND(e,r){return vu($([Y("false"),Y("true")]),e,r)}function LD(e,r){return en(e,`${r}${Qs}`)}function vD(e,r,n){return en(r,`${n}${RD(e)}`)}function kD(e,r,n,o=[]){let i=jt(e);return Lu(i,r,n)}function Lu(e,r,n,o=[]){let[i,...a]=e;return O(i)?Lu(a,r,n,[...o,vu(i,[],"")]):en(r,`${n}(${xD(o)})`)}function vu(e,r,n){return Re(e)?kD(e.enum,r,n):Be(e)?UD(r,n):J(e)?CD(e.const,r,n):St(e)?PD(r,n):pt(e)?ND(r,n):Ie(e)?wD(r,n):Ne(e)?LD(r,n):Ce(e)?vD(e.pattern,r,n):S(e)?Lu(e.anyOf,r,n):dg}function en(e,r){let[n,...o]=e;return O(n)?vu(n,o,r):r}function MD(e){return`^${en(e,"")}$`}function z_(e){let r=MD(e);return K_(r)}function DD(e,r,n,o){let i=xt(e,r,n);return g.Update(z_(i),{},o)}function Y_(e,r,n,o){return v(e,n)?DD(e,r,n,o):Pi(n,o)}function GD(e){return Hr(e)?V(e.items)?ku(e.items.items):xe(e.items)?[e]:pe(e.items)?[e]:[X()]:[e]}function ku(e){return e.reduce((n,o)=>[...n,...GD(o)],[])}function $D(e,r){return r in e}function jD(e,r){return w(r)?v(e,r.allOf):S(r)?v(e,r.anyOf):pe(r)?$D(e,r.$ref):!0}function v(e,r){let[n,...o]=r;return O(n)?jD(e,n)?v(e,o):!1:!0}function oa(e,r,n){return sg(e)?oa(e.type,"remove",n):ng(e)?oa(e.type,r,"remove"):ig(e)?oa(e.type,"add",n):tg(e)?oa(e.type,r,"add"):[e,r,n]}function qD(e,r){return s.IsEqual(e,"remove")?Gs(r):s.IsEqual(e,"add")?ht(r):r}function BD(e,r){return s.IsEqual(e,"remove")?no(r):s.IsEqual(e,"add")?yt(r):r}function na(e,r,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:I(e,r,n[i])}),{})}function fc(e,r,n){let o=xt(e,r,n);return ku(o)}function xt(e,r,n){return n.map(o=>I(e,r,o))}function FD(e,r,n,o,i){return s.IsEqual(n,"Awaited")?JE(e,r,o[0],i):s.IsEqual(n,"Capitalize")?cI(e,r,o[0],i):s.IsEqual(n,"Conditional")?dI(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?gI(e,r,o[0],i):s.IsEqual(n,"Evaluate")?TE(e,r,o[0],i):s.IsEqual(n,"Exclude")?hc(e,r,o[0],o[1],i):s.IsEqual(n,"Extract")?bI(e,r,o[0],o[1],i):s.IsEqual(n,"Index")?jI(e,r,o[0],o[1],i):s.IsEqual(n,"InstanceType")?BI(e,r,o[0],i):s.IsEqual(n,"Interface")?FI(e,r,o[0],o[1],i):s.IsEqual(n,"KeyOf")?WI(e,r,o[0],i):s.IsEqual(n,"Lowercase")?pI(e,r,o[0],i):s.IsEqual(n,"Mapped")?e_(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?t_(e,r,o[0],i):s.IsEqual(n,"NonNullable")?n_(e,r,o[0],i):s.IsEqual(n,"Pick")?y_(e,r,o[0],o[1],i):s.IsEqual(n,"Options")?a_(e,r,o[0],o[1]):s.IsEqual(n,"Parameters")?c_(e,r,o[0],i):s.IsEqual(n,"Partial")?f_(e,r,o[0],i):s.IsEqual(n,"Omit")?i_(e,r,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?O_(e,r,o[0],i):s.IsEqual(n,"Record")?k_(e,r,o[0],o[1],i):s.IsEqual(n,"Required")?B_(e,r,o[0],i):s.IsEqual(n,"ReturnType")?H_(e,r,o[0],i):s.IsEqual(n,"TemplateLiteral")?Y_(e,r,o[0],i):s.IsEqual(n,"Uncapitalize")?uI(e,r,o[0],i):s.IsEqual(n,"Uppercase")?mI(e,r,o[0],i):P(n,o,i)}function I(e,r,n){let o=_n(n),i=oa(n,bn(n)?"add":"none",Me(n)?"add":"none"),a=Ct(i[0])?i[0].Clone():i[0],c=pe(a)?M_(e,r,a.$ref):re(a)?$t(I(e,r,a.items),js(a)):ot(a)?Yt(I(e,r,a.iteratorItems),pg(a)):Ao(a)?yc(e,r,a.target,a.arguments):De(a)?Gr(xt(e,r,a.parameters),I(e,r,a.instanceType),mg(a)):cg(a)?FD(e,r,a.action,a.parameters,a.options):Ge(a)?$r(xt(e,r,a.parameters),I(e,r,a.returnType),lg(a)):w(a)?Pt(xt(e,r,a.allOf),Eg(a)):it(a)?Qt(I(e,r,a.iteratorItems),kg(a)):k(a)?N(na(e,r,a.properties),jg(a)):Xe(a)?Xt(I(e,r,a.item),Bg(a)):_e(a)?Fg(Ot(a),I(e,r,Je(a))):Hr(a)?xn(I(e,r,a.items)):V(a)?Fe(fc(e,r,a.items),Kg(a)):S(a)?$(xt(e,r,a.anyOf),zg(a)):a,m=o?Dr(c):c;return qD(i[1],BD(i[2],m))}function C(e,r){return I(e,{callstack:[]},r)}function Yi(e,r={}){return P("Awaited",[e],r)}function V_(e,r={}){return C({},Yi(e,r))}function su(e,r={}){return P("Evaluate",[e],r)}function Bt(e,r={}){return C({},su(e,r))}function cu(e,r={}){return P("Module",[e],r)}function Q_(e,r={}){return C({},cu(e,r))}function W_(...e){let[r,n,o]=ae.Match(e,{2:(c,m)=>s.IsString(c)?[{},c,m]:[c,m,{}],3:(c,m,l)=>[c,m,l],1:c=>[{},c,{}]}),i=qT(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(r,{callstack:[]},i[0]):X();return g.Update(a,{},o)}var t={};vt(t,{Any:()=>io,Array:()=>$t,AsyncIterator:()=>Yt,Awaited:()=>V_,Base:()=>qs,BigInt:()=>xi,Boolean:()=>Hs,Call:()=>ZE,Capitalize:()=>oI,Codec:()=>Bs,Conditional:()=>lI,Constructor:()=>Gr,ConstructorParameters:()=>fI,Cyclic:()=>Vt,Decode:()=>Ug,DecodeBuilder:()=>Ai,Encode:()=>wg,EncodeBuilder:()=>Oi,Enum:()=>Tg,Evaluate:()=>Bt,Exclude:()=>yI,Extends:()=>rt,ExtendsResult:()=>L,Extract:()=>EI,Function:()=>$r,Generic:()=>jr,Identifier:()=>Ri,Immutable:()=>Dr,Index:()=>vI,Infer:()=>Si,InstanceType:()=>qI,Instantiate:()=>C,Integer:()=>On,Interface:()=>$E,Intersect:()=>Pt,IsAny:()=>st,IsArray:()=>re,IsAsyncIterator:()=>ot,IsBase:()=>Ct,IsBigInt:()=>St,IsBoolean:()=>pt,IsCall:()=>Ao,IsCodec:()=>Sn,IsConstructor:()=>De,IsCyclic:()=>le,IsEnum:()=>Re,IsFunction:()=>Ge,IsGeneric:()=>oo,IsIdentifier:()=>vg,IsImmutable:()=>_n,IsInfer:()=>xe,IsInteger:()=>Be,IsIntersect:()=>w,IsIterator:()=>it,IsKind:()=>_,IsLiteral:()=>J,IsNever:()=>lr,IsNull:()=>Wt,IsNumber:()=>Ie,IsObject:()=>k,IsOptional:()=>Me,IsParameter:()=>qg,IsPromise:()=>Xe,IsReadonly:()=>bn,IsRecord:()=>_e,IsRef:()=>pe,IsRefine:()=>Fs,IsRest:()=>Hr,IsSchema:()=>O,IsString:()=>Ne,IsSymbol:()=>Zt,IsTemplateLiteral:()=>Ce,IsThis:()=>Hg,IsTuple:()=>V,IsUndefined:()=>er,IsUnion:()=>S,IsUnknown:()=>Tt,IsUnsafe:()=>Vg,IsVoid:()=>At,Iterator:()=>Qt,KeyOf:()=>HI,Literal:()=>Y,Lowercase:()=>iI,Mapped:()=>JI,Module:()=>Q_,Never:()=>X,NonNullable:()=>r_,Null:()=>Fr,Number:()=>Ut,Object:()=>N,Omit:()=>o_,Optional:()=>Ds,Options:()=>Ic,Parameter:()=>An,Parameters:()=>s_,Partial:()=>p_,Pick:()=>g_,Promise:()=>Xt,Readonly:()=>$s,ReadonlyType:()=>h_,Record:()=>Ws,RecordKey:()=>lo,RecordKeyAsPattern:()=>Ot,RecordValue:()=>Je,Ref:()=>we,Refine:()=>Ng,Required:()=>q_,Rest:()=>xn,ReturnType:()=>F_,Script:()=>W_,String:()=>Et,Symbol:()=>po,TemplateLiteral:()=>HT,This:()=>Zs,Tuple:()=>Fe,Uncapitalize:()=>aI,Undefined:()=>fo,Union:()=>$,Unknown:()=>We,Unsafe:()=>Yg,Uppercase:()=>sI,Void:()=>Xs});var Z_="lowercase-email",Mu="iana-timezone",Du="simple-time",Gu="simple-date-time";var HD=(e,r)=>RegExp(`^${e.source}(${r.source}${e.source})*$`),KD=/[a-zA-Z0-9-_]+/,zD=/\./,rEe=HD(KD,zD);var X_="lowercase-domain";var Uo="kebab-case";var J_="camel-case";var YD=new Set;function b(e,r,n={}){let o=r.map(i=>{let a=i;return a.$id?(YD.add(i),t.Ref(a.$id)):i});return t.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function je(e,r){return t.Object({values:t.Array(e,{maxItems:r.maxItems,description:"Values compared by this filter. When `exclude` is omitted or false, rows matching any value are kept; when `exclude` is true, matching rows are removed."}),exclude:t.Optional(t.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:r.description})}var Q={limit:t.Optional(t.Integer({minimum:1,maximum:1e3,description:"Maximum number of items to return in this page. Valid values are 1 through 1000."})),offset:t.Optional(t.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages. If `limit` is provided without `offset`, the offset defaults to 0."}))};var VD=t.Object({totalCount:t.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:t.Integer({description:"Total number of pages available for the requested `limit`."})}),sEe=t.Object({pagination:VD},{$id:"ResponseMetadata"});function T(e={}){return t.Unsafe({...e,type:"string"})}var wo=250;function p({allowEmpty:e=!0,type:r="short",description:n,default:o}={}){let i=e?0:1,a={...n===void 0?{}:{description:n},...o===void 0?{}:{default:o}};switch(r){case"camel-case":return t.String({format:J_,minLength:i,maxLength:wo,...a});case"kebab-case":return t.String({format:Uo,minLength:i,maxLength:wo,...a});case"email":return t.String({format:Z_,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return t.String({format:X_,minLength:i,maxLength:wo,...a});case"tsuga-query":return t.String({format:"tsuga-query",minLength:i,maxLength:1e4,...a});case"tags-query":return t.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...a});case"date-time":return t.String({format:"date-time",...a});case"uri":return t.String({format:"uri",...a});case"user-password":return t.String({format:"user-password",minLength:12,maxLength:wo,...a});case"long":return t.String({minLength:i,maxLength:5e4,...a});case"short":return t.String({minLength:i,maxLength:wo,...a});case"tsuga-formula":return t.String({format:"tsuga-formula",minLength:i,maxLength:wo,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...a});case"time":return t.String({format:"time",...a});case"readonly-sql-query":return t.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...a});default:Qe(r)}}var ia=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],_c=t.Array(t.Enum(ia,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var $u=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],EEe=t.Enum($u),QD=["CLUSTER_AGGREGATION_STRUCTURE"],IEe=t.Object({code:t.Enum($u),message:t.String()}),eb=[...$u,...QD,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],tb=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var WD=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],ZD=[...eb,...tb,...WD],XD=t.Object({assetId:t.Optional(t.String({description:"Identifier of the asset that violated the policy. Set from the existing asset for update and bulk requests. Omitted on create requests before the asset exists."})),assetName:t.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:t.Enum(ia,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:t.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:t.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:t.String({description:"Human-readable reason this policy failed for the asset. Generated by Tsuga\u2019s tag-policy validator. Returned for every violation."})}),rb=b("type",[t.Object({type:t.Literal("tag_policy_violation",{description:"Discriminator identifying tag-policy validation details. Set by Tsuga to `tag_policy_violation`. Returned when the error code is `TAG_POLICY_VALIDATION_ERROR`."}),violations:t.Array(XD,{description:"Tag-policy violations that caused the request to fail. Built from active policies applicable to the submitted asset type and owner team. Returned on tag-policy validation errors; can contain multiple policies and multiple assets for bulk requests."})},{$id:"TagPolicyViolationDetails"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data. Returned on tag-policy validation errors; omitted for other client errors."}),_Ee=t.Object({code:t.Optional(t.Enum(ZD,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(rb)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),bEe=t.Object({code:t.Optional(t.Enum(eb,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(rb)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),SEe=t.Object({code:t.Optional(t.Enum(tb,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),OEe=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),AEe=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});function d({body:e,description:r,method:n,operationId:o,params:i,tags:a,query:c,paginated:m,response:l,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,A=>E[A.slice(1)]),method:n,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...r===void 0?{}:{description:r},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}:{method:n,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...r===void 0?{}:{description:r},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}}function nb(e,r){if(!r||typeof r!="object")return e;let n=new URLSearchParams;return Object.entries(r).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&n.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&n.append(o,String(i))}),`${e}?${n.toString()}`}var R=t.Object({success:t.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",example:{success:!0}});var ju="tsuga-cli",wn="/v0/oauth",ob=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${wn}/authorize`,method:"GET",query:t.Partial(t.Object({response_type:t.String({description:"Must be `code`"}),client_id:t.String({description:"First-party client id or CIMD document URL"}),redirect_uri:t.String({description:"Client redirect URI"}),code_challenge:t.String({description:"PKCE code challenge"}),code_challenge_method:t.String({description:"Must be `S256`"}),state:t.String({description:"Opaque client state, echoed back"}),resource:t.String({description:"RFC 8707 resource indicator"})})),response:t.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),ib=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${wn}/token`,method:"POST",body:t.Partial(t.Object({grant_type:t.String({description:"`authorization_code` or `refresh_token`"}),code:t.String({description:"Authorization code being exchanged"}),code_verifier:t.String({description:"PKCE code verifier"}),redirect_uri:t.String({description:"Must match the redirect URI used on /authorize"}),client_id:t.String({description:"Client id, when sent by the client"}),refresh_token:t.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:t.Object({access_token:t.String(),token_type:t.Literal("Bearer"),expires_in:t.Number({description:"Access token lifetime in seconds"}),refresh_token:t.String()})}),qEe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${wn}/authorization-request`,method:"GET",query:t.Object({handle:t.String()}),response:t.Object({clientId:t.String(),clientName:t.String(),redirectUri:t.String()})}),BEe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${wn}/approve`,method:"POST",body:t.Object({handle:t.String({description:"The signed authorization request handle"}),approve:t.Boolean()}),response:t.Object({redirectTo:t.String({description:"The client's redirect URI carrying either the code or the denial"})})}),FEe=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${wn}/introspect`,method:"POST",body:t.Object({token:t.String()}),response:t.Object({active:t.Boolean(),userId:t.Optional(t.String()),orgId:t.Optional(t.String())})}),JD=["pending","active","revoked"],eG=t.Object({id:t.String(),createdAt:T(),clientId:t.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:t.String({description:"Display name derived from the client identity"}),userId:t.String(),status:t.Enum(JD),lastUsedAt:t.Optional(T())}),HEe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${wn}/grants`,method:"GET",query:t.Object({allUsers:t.Optional(t.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:t.Array(eG)}),KEe=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${wn}/grants/:id`,method:"DELETE",params:t.Object({id:t.String()}),response:R});function ab(e,r){let n=new URL(ob.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:ju,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),n.href}function tG(e){if(!e)return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}async function rG(e,r){let n=await fetch(new URL(ib.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(r).toString()}),o=await n.text(),i=tG(o);if(n.status!==200){let a=i.error??`HTTP ${n.status}`;throw new Error(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`)}if(!i.access_token||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,expiresAt:new Date(Date.now()+i.expires_in*Hp)}}async function sb(e,r){return rG(e,{grant_type:"authorization_code",client_id:ju,code:r.code,code_verifier:r.verifier,redirect_uri:r.redirectUri})}var tn=require("node:fs"),cb=require("node:os"),qu=require("node:path");var pb=(0,qu.join)((0,cb.homedir)(),".config","tsuga"),aa=(0,qu.join)(pb,"config.json"),nG="https://api.tsuga.com";function ub(e){return Uf(e.credential)}function sa(){if(!(0,tn.existsSync)(aa))return{};try{return JSON.parse((0,tn.readFileSync)(aa,"utf-8"))}catch{throw new Error(`Config file corrupted: ${aa}
|
|
36
|
+
Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function No(){try{return sa()}catch{return{}}}function Lo(e){(0,tn.mkdirSync)(pb,{recursive:!0,mode:448}),(0,tn.writeFileSync)(aa,`${JSON.stringify(e,null,2)}
|
|
37
|
+
`,{mode:384})}function Bu(e){return e?.trim()||process.env.TSUGA_API_URL?.trim()||nG}function vo(e){let r=sa(),n=Bu(e.apiUrl),o=Pf({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:r.operationApiKey,userAuth:r.userAuth}),i=r.defaults??{},a=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||i.cluster?.trim()||void 0;return{apiUrl:n,credential:o,clusterId:a,defaults:i}}function oG(e){Lo({...No(),...e})}function mb(){return sa().userAuth}function lb(e){let{operationApiKey:r,...n}=No();Lo({...n,userAuth:e})}function db(e){let{userAuth:r,...n}=No();Lo({...n,operationApiKey:e})}function fb(){let{userAuth:e,...r}=No();Lo(r)}function ca(){return aa}var gb={from:"-30m",to:"now",query:"*","max-results":"100"};function yr(e){return(sa().defaults??{})[e]??gb[e]}function yb(e,r){let n=No();Lo({...n,defaults:{...n.defaults??{},[e]:r}})}function hb(){let{defaults:e,...r}=No();Lo(r)}function Tb(e,r){let n=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let a=o.kind;switch(a){case"operation-api-key":n.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":n.push(`User session: ${Ei(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Qe(a)}}else n.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <operation-api-key>`.");n.push(`Config: ${r}`),n.push(""),n.push("Defaults (custom overrides marked with *):");let i={...gb,...e.defaults};for(let[a,c]of Object.entries(i)){let m=a in e.defaults?" *":"";n.push(` ${a}: ${c}${m}`)}return`${n.join(`
|
|
38
38
|
`)}
|
|
39
|
-
`}function QI(){return ji().lastUpdateCheck}function WI(e){o0({lastUpdateCheck:e})}async function i0(){let e=rm(),{verifier:t,challenge:n}=ad(),o=(0,ZI.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await Ed({state:o,buildAuthorizeUrl:u=>vI(e,{redirectUri:u,challenge:n,state:o})}),c=await DI(e,{code:i,verifier:t,redirectUri:a});FI(nd(c)),q(`Logged in. Session token ${Jo(c.accessToken)} saved to ${qi()}`)}function a0(){let e=qI();if(!e){process.stderr.write("No user session. Run `tsuga auth login`.\n"),process.exitCode=1;return}if(Qa({kind:"user-session",userAuth:e},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}q(e.accessToken)}function s0(){let{credential:e}=bo({});if(!e){q("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":q(`Logged in as a user (token ${Jo(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":q("Authenticated with an operation API key.");return;default:Ze(e)}}function c0(){HI(),q("Local user session cleared.")}function XI(e){let t=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");t.action(()=>t.help()),t.command("login").description("Log in as a user with a browser authorization flow and save the session").action(i0),t.command("logout").description("Clear the saved user session").action(c0),t.command("token").description("Print the saved user access token to stdout").action(a0),t.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(n=>{BI(n),q(`Operation API key saved to ${qi()}`)}),t.command("status").description("Show the current authentication method").action(s0)}var p0=["asset-change","cluster-integration-config","explorer-saved-view","inventory","saml-config","sensitive-data-scanner-rule","service","host","database","team-remap-config","user-self","oauth-grant","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],m0=["investigation","ingestion-api-key","operation-api-key","rum-public-token","audit-log","dashboard","dashboard-folder","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],u0=["log","metric","trace","rum"],l0=[...m0,...u0],nge=[...p0,...l0];var Ks=["admin","public_editor","public_viewer","teams_only"],Oo=["admin","editor","viewer"];var Tn="/v0/team-membership",nm=r.Object({id:r.String({description:"Unique identifier of this team membership. Generated by Tsuga."}),userId:r.String({description:"User ID that belongs to the team."}),teamId:r.String({description:"Team ID that contains the user."}),roleKey:r.Enum(Oo,{description:"Role granted to the user inside this team."})}),JI=r.Object({userId:m({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:m({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:r.Enum(Oo,{description:"Team role to assign to the user."})}),d0=r.Object({userId:m({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:m({allowEmpty:!1,description:"Team ID to remove the user from."})}),f0=r.Optional(r.Object({userId:r.Optional(m({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:r.Optional(m({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),oge=d({tags:["access-control"],url:Tn,method:"GET",query:f0,response:r.Array(nm)}),ige=d({tags:["access-control"],url:Tn,method:"POST",body:JI,response:nm}),age=d({tags:["access-control"],url:Tn,method:"PUT",body:JI,response:nm}),sge=d({tags:["access-control"],url:Tn,method:"DELETE",body:d0,response:L}),Hs=500,g0=r.Object({teamId:m({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:r.Array(r.Object({userId:r.Optional(m({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:r.Optional(m({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:r.Enum(Oo,{description:"Team role to assign when the user is added."})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Hs})}),y0=r.Object({results:r.Array(r.Object({userId:r.String({description:"User ID resolved for this bulk add result."}),status:r.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."})}))}),cge=d({tags:["access-control"],url:`${Tn}/bulk-add`,method:"POST",body:g0,response:y0}),pge=d({tags:["access-control"],url:`${Tn}/bulk-update-user-roles`,method:"PUT",body:r.Object({userIds:r.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Hs}),teamId:m({allowEmpty:!1}),role:r.Enum(Oo)}),response:r.Object({})}),h0=r.Object({teamId:m({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:r.Optional(r.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Hs,description:"User IDs to remove from the team."})),userEmails:r.Optional(r.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Hs,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),E0=r.Object({results:r.Array(r.Object({userId:r.String({description:"User ID resolved for this bulk remove result."}),status:r.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."})}))}),mge=d({tags:["access-control"],url:`${Tn}/bulk-remove`,method:"DELETE",body:h0,response:E0});var zs="/v0/admin",qe=`${zs}/clusters`,t_=r.Object({helmParameters:r.Record(r.String(),r.Unsafe({type:["number","boolean","null","string"]})),helmVersion:r.String()}),e_=r.Record(r.String(),t_),am=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],sm=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],cm=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],r_=["aws","gcp","azure"],Fi=["xs","s","m","l"],pm=["1.0"],T0={id:r.String(),name:r.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:r.String(),deployerEndpoint:r.String(),targetConfiguration:e_,appliedConfiguration:r.Optional(e_),automaticallyDeployLatestVersion:r.Boolean(),automatedDeploymentDisabledBy:r.Optional(r.String()),automatedDeploymentDisabledReason:r.Optional(r.String()),automatedDeploymentDisabledAt:r.Optional(T()),soakTimeMin:r.Optional(r.Number()),clusterSize:r.Optional(r.Enum(Fi))},om={...T0,orgId:r.String(),orgName:r.String()},hge=d({tags:["admin"],method:"GET",url:qe,query:r.Object({orgId:r.Optional(m())}),response:r.Array(A("clusterType",[r.Object({...om,clusterType:r.Literal("aws"),clusterAccountId:r.String(),clusterBuilderRoleVersion:r.Optional(r.Enum(pm)),clusterRegion:r.Enum(am)}),r.Object({...om,clusterType:r.Literal("gcp"),clusterAccountId:r.String(),clusterRegion:r.Enum(sm)}),r.Object({...om,clusterType:r.Literal("azure"),clusterTenantId:r.String(),clusterSubscriptionId:r.String(),clusterRegion:r.Enum(cm)})]))}),Ege=d({tags:["admin"],method:"PUT",url:`${qe}/create`,body:A("clusterType",[r.Object({clusterType:r.Literal("aws"),orgId:m(),name:m(),clusterSize:r.Enum(Fi),clusterAccountId:r.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:r.Enum(pm),clusterRegion:r.Enum(am)}),r.Object({clusterType:r.Literal("gcp"),orgId:m(),name:m(),clusterSize:r.Enum(Fi),clusterAccountId:m(),clusterRegion:r.Enum(sm)}),r.Object({clusterType:r.Literal("azure"),orgId:m(),name:m(),clusterSize:r.Enum(Fi),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:r.Enum(cm)})]),response:r.Object({id:r.String(),bridgeEndpoint:r.String(),deployerEndpoint:r.String()})}),Tge=d({tags:["admin"],method:"DELETE",url:`${qe}/:id`,params:r.Object({id:m()}),body:r.Object({orgId:m()}),response:L}),Ige=d({tags:["admin"],method:"PUT",url:`${qe}/add-inbounder-key`,body:r.Object({orgId:m(),clusterId:m()}),response:r.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:r.String()})}),_ge=d({tags:["admin"],method:"PUT",url:`${qe}/replace-all-inbounder-keys`,body:r.Object({orgId:m(),clusterId:m()}),response:r.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:r.String()})}),bge=d({tags:["admin"],method:"PUT",url:`${qe}/replace-inbounder-key`,body:r.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:r.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:r.String()})}),Oge=d({tags:["admin"],method:"PUT",url:`${qe}/delete-inbounder-key`,body:r.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:r.Object({orgId:m(),clusterId:m(),isKeyDeleted:r.Boolean()})}),Age=d({tags:["admin"],method:"PUT",url:`${qe}/rotate-deployer-key`,body:r.Object({orgId:m(),clusterId:m(),newKey:m()}),response:r.Object({orgId:m(),clusterId:m(),isKeyUpdated:r.Boolean()})}),Sge=d({tags:["admin"],method:"PUT",url:`${qe}/rotate-bridge-key`,body:r.Object({orgId:m(),clusterId:m(),newKey:m()}),response:r.Object({orgId:m(),clusterId:m(),isKeyUpdated:r.Boolean()})}),im={central:r.String(),ngrokBridgeDomain:r.String(),ngrokDeployerDomain:r.String(),clusterCertificateExpiresAt:T(),clusterName:r.String(),clusterSize:r.Optional(r.Enum(Fi)),secretBridgeAuthenticationKey:r.String(),secretDeployerAuthenticationKey:r.String(),secretOutbounderAuthenticationKey:r.String(),slackChannelEmail:r.String(),customerTier:r.String()},xge=d({tags:["admin"],method:"POST",url:`${qe}/:id`,body:r.Object({orgId:m()}),params:r.Object({id:m()}),response:A("clusterType",[r.Object({...im,clusterType:r.Literal("aws"),clusterAccountId:r.String(),clusterBuilderRoleVersion:r.Optional(r.Enum(pm)),clusterRegion:r.Enum(am)}),r.Object({...im,clusterType:r.Literal("gcp"),clusterAccountId:r.String(),clusterRegion:r.Enum(sm)}),r.Object({...im,clusterType:r.Literal("azure"),clusterTenantId:r.String(),clusterSubscriptionId:r.String(),clusterRegion:r.Enum(cm)})])}),Rge=d({tags:["admin"],method:"POST",url:`${qe}/configuration`,body:r.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:t_}),response:r.Object({status:r.String()})}),Cge=d({tags:["admin"],method:"POST",url:`${qe}/automation`,body:r.Object({id:m(),orgId:m(),enableAutomatedDeployment:r.Boolean(),disabledReason:r.Optional(m())}),response:r.Object({status:r.String()})}),Pge=d({tags:["admin"],method:"POST",url:`${qe}/soak-time`,body:r.Object({id:m(),orgId:m(),soakTimeMin:r.Optional(r.Number())}),response:r.Object({status:r.String()})}),Uge=d({tags:["admin"],method:"POST",url:`${qe}/deploy`,body:r.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:r.Object({id:r.String()})}),I0=A("type",[r.Object({type:r.Literal("pending")}),r.Object({type:r.Literal("running")}),r.Object({type:r.Literal("cancelled")}),r.Object({type:r.Literal("timed_out")}),r.Object({type:r.Literal("success"),stateValue:r.Object({message:r.String()})}),r.Object({type:r.Literal("failure"),stateValue:r.Object({message:r.String()})})]),Nge=d({tags:["admin"],method:"GET",url:`${qe}/deploy`,query:r.Object({orgId:r.Optional(m()),clusterId:r.Optional(m())}),response:r.Array(r.Object({id:r.String(),orgId:r.String(),orgName:r.String(),clusterId:r.String(),clusterName:r.String(),fromVersion:r.Optional(r.String()),toVersion:r.String(),state:I0,updatedAt:T(),createdAt:T(),installationName:r.String(),chartName:r.String(),isAutomated:r.Boolean(),createdBy:r.Optional(r.String()),createdByName:r.Optional(r.String()),createdByEmail:r.Optional(r.String())}))}),_0=r.Object({installations:r.Array(r.Object({installationName:r.String(),parameters:r.Record(r.String(),r.Union([r.Number(),r.Boolean(),r.Null(),r.String()])),version:r.Union([r.String(),r.Null()]),resources:r.Array(r.Object({id:r.Object({kind:r.String(),name:r.String()}),status:r.String(),health:r.String(),rawDetails:r.Optional(r.Any()),liveManifest:r.Optional(r.String()),targetManifest:r.Optional(r.String())})),deployedAt:r.Optional(r.String()),syncStatus:r.Optional(r.String()),healthStatus:r.Optional(r.String())}))}),kge=d({tags:["admin"],method:"POST",url:`${qe}/status`,body:r.Object({orgId:r.Optional(m()),clusterId:r.Optional(m())}),response:r.Array(r.Object({orgId:r.String(),clusterId:r.String(),status:_0}))}),wge=d({tags:["admin"],method:"POST",url:`${qe}/argocd-cert-info`,body:r.Object({orgId:m(),clusterId:m()}),response:r.Object({certificateExpiresAt:r.String()})}),b0=r.Object({kind:r.String(),name:r.String()}),O0=r.Object({id:b0,liveManifest:r.Optional(r.String()),targetManifest:r.Optional(r.String())}),Lge=d({tags:["admin"],method:"POST",url:`${qe}/resource-details`,body:r.Object({orgId:m(),clusterId:m(),installationName:m()}),response:r.Object({resources:r.Array(O0)})}),Mge=d({tags:["admin"],method:"GET",url:`${qe}/versions`,query:r.Object({chartName:r.Optional(m())}),response:r.Array(r.Object({id:r.String(),chartName:r.String(),locator:r.String(),version:r.String(),repositoryArn:r.String(),type:r.Optional(r.String()),commitHash:r.Optional(r.String()),lastPulledAt:r.Optional(T()),pushedAt:r.Optional(T())}))});var A0=r.Object({id:r.Object({name:r.String(),kind:r.String()}),previewManifest:r.Optional(r.String())}),vge=d({tags:["admin"],method:"POST",url:`${qe}/versions/render`,body:r.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:r.Array(A0)}),lr=`${zs}/orgs`,Dge=d({tags:["admin"],url:lr,method:"GET",query:r.Object({onlyDeleted:r.Optional(r.Boolean())}),response:r.Array(r.Object({id:r.String(),name:r.String(),allowedDomains:r.Array(r.String()),createdAt:T(),updatedAt:T()}))}),$ge=d({tags:["admin"],url:lr,method:"POST",body:r.Object({emailDomains:r.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:r.Object({id:r.String(),name:r.String()})}),Gge=d({tags:["admin"],url:`${lr}/:id`,method:"PUT",params:r.Object({id:m()}),body:r.Object({allowedDomains:r.Optional(r.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:r.Object({id:r.String(),name:r.String(),allowedDomains:r.Array(r.String())})}),jge=d({tags:["admin"],url:`${lr}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),qge=d({tags:["admin"],url:`${lr}/:id/restore`,method:"POST",params:r.Object({id:m()}),response:r.Object({success:r.Boolean()})}),Fge=d({tags:["admin"],url:`${lr}/:id/permanent-delete`,method:"DELETE",params:r.Object({id:m()}),response:r.Object({success:r.Boolean(),hasDeletedSecret:r.Boolean(),hasDeletedTenantDb:r.Boolean(),hasDeletedOrgRow:r.Boolean()})}),Bge=d({tags:["admin"],url:`${lr}/synchronize-sds-rules`,method:"POST",response:r.Object({errorOrgs:r.Optional(r.Array(r.Object({id:r.String(),name:r.String()}))),synchronizedOrgsCount:r.Number()})}),S0=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],x0=r.Enum(S0),Hge=d({tags:["admin"],url:`${lr}/refresh-assets`,method:"POST",body:r.Object({assetTypes:r.Array(x0,{minItems:1}),orgId:r.Optional(m({allowEmpty:!1}))}),response:r.Array(r.Object({orgId:r.String(),orgName:r.String(),results:r.Record(r.String(),r.Object({success:r.Boolean()}))}))}),Kge=d({tags:["admin"],url:`${lr}/sudo`,method:"POST",body:r.Object({orgId:m()}),response:r.Object({sudoToken:r.String()})}),R0=`${zs}/users`,zge=d({tags:["admin"],url:`${R0}/invite`,method:"POST",body:r.Object({email:m({type:"email"}),orgId:m(),userRole:r.Enum(Ks)}),response:r.Array(r.Object({inviteId:r.String(),email:r.String(),result:r.Union([r.Literal("success"),r.Literal("email-failed")])}))});var Vge=d({tags:["admin"],url:`${zs}/billing-data`,method:"GET",query:r.Object({orgId:m(),maxDaysFetched:r.Optional(r.Number({minimum:1,maximum:365}))}),response:r.Object({dataPoints:r.Array(r.Object({date:r.String(),telemetryKind:r.Union([r.Literal("logs"),r.Literal("metrics"),r.Literal("rum"),r.Literal("traces")]),totalBytes:r.Number(),clusterId:r.String(),apiKeyId:r.String(),apiKeyName:r.String(),teamName:r.String()})),availableFilters:r.Object({clusters:r.Array(r.Object({id:r.String(),name:r.String()})),apiKeys:r.Array(r.Object({id:r.String(),name:r.String()})),teamNames:r.Array(r.String())})})});var n_=r.Object({id:r.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:r.String({description:"Internal name of the Tsuga cluster"}),friendlyName:r.Optional(r.String({description:"Human-readable display name set by an operator"})),clusterType:r.Enum(r_,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:r.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),C0={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(n_,{examples:[C0]});var o_=d({description:"Lists Tsuga clusters available to the organization. Use cluster IDs to scope telemetry, service, inventory, and quality-report queries in multi-cluster organizations.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:r.Array(n_)});function i_(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(o_);oe(o)})}function s_(e,t,n,o){let i=e.commands.map(c=>c.name()).filter(c=>!c.startsWith("__")),a=e.options.map(c=>c.long).filter(c=>!!c);for(let c of e.options)(c.required||c.optional)&&(c.long&&o.add(c.long),c.short&&o.add(c.short));n.set(t.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||s_(c,[...t,c.name()],n,o)}function P0(e){let t=new Map,n=new Set;return s_(e,[],t,n),{rows:[...t].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function a_(e){return e.map(({key:t,cmds:n,flags:o})=>` ${JSON.stringify(t)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
40
|
-
`)}function
|
|
39
|
+
`}function Eb(){return sa().lastUpdateCheck}function Ib(e){oG({lastUpdateCheck:e})}async function iG(){let e=Bu(),{verifier:r,challenge:n}=wf(),o=(0,_b.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await Bf({state:o,buildAuthorizeUrl:m=>ab(e,{redirectUri:m,challenge:n,state:o})}),c=await sb(e,{code:i,verifier:r,redirectUri:a});lb(Cf(c)),B(`Logged in. Session token ${Ei(c.accessToken)} saved to ${ca()}`)}function aG(){let e=mb();if(!e){process.stderr.write("No user session. Run `tsuga auth login`.\n"),process.exitCode=1;return}if(Rs({kind:"user-session",userAuth:e},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}B(e.accessToken)}function sG(){let{credential:e}=vo({});if(!e){B("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":B(`Logged in as a user (token ${Ei(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":B("Authenticated with an operation API key.");return;default:Qe(e)}}function cG(){fb(),B("Local user session cleared.")}function bb(e){let r=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");r.action(()=>r.help()),r.command("login").description("Log in as a user with a browser authorization flow and save the session").action(iG),r.command("logout").description("Clear the saved user session").action(cG),r.command("token").description("Print the saved user access token to stdout").action(aG),r.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(n=>{db(n),B(`Operation API key saved to ${ca()}`)}),r.command("status").description("Show the current authentication method").action(sG)}var pG=["allowed-domains","cluster-integration-config","custom-usage-tag","database","databricks-connection","explorer-saved-view","host","inventory","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],uG=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard","ingestion-api-key","investigation","log-route","metric-route","monitor","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","slo","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],mG=["log","metric","trace","rum"],lG=[...uG,...mG],mIe=[...pG,...lG];var Sc=["admin","public_editor","public_viewer","teams_only"],ko=["admin","editor","viewer"];var Nn="/v0/team-membership",Fu="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.",Hu=t.Object({id:t.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:t.String({description:"User ID that belongs to the team."}),teamId:t.String({description:"Team ID that contains the user."}),roleKey:t.Enum(ko,{description:Fu})}),Sb=t.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:t.Enum(ko,{description:Fu})}),dG=t.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),fG=t.Optional(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),lIe=d({tags:["access-control"],url:Nn,method:"GET",query:fG,response:t.Array(Hu)}),dIe=d({tags:["access-control"],url:Nn,method:"POST",body:Sb,response:Hu}),fIe=d({tags:["access-control"],url:Nn,method:"PUT",body:Sb,response:Hu}),gIe=d({tags:["access-control"],url:Nn,method:"DELETE",body:dG,response:R}),bc=500,Ob=t.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:t.Array(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:t.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:t.Enum(ko,{description:Fu})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:bc,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 up to 500 users to add by ID or email, with a role for each user."}),gG={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(Ob,{examples:[gG]});var Ab=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),yG={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(Ab,{examples:[yG]});var yIe=d({tags:["access-control"],url:`${Nn}/bulk-add`,method:"POST",body:Ob,response:Ab}),hIe=d({tags:["access-control"],url:`${Nn}/bulk-update-user-roles`,method:"PUT",body:t.Object({userIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:bc}),teamId:p({allowEmpty:!1}),role:t.Enum(ko)}),response:t.Object({})}),xb=t.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:t.Optional(t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:bc,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:t.Optional(t.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:bc,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."}),hG={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(xb,{examples:[hG]});var Rb=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),TG={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(Rb,{examples:[TG]});var TIe=d({tags:["access-control"],url:`${Nn}/bulk-remove`,method:"DELETE",body:xb,response:Rb});var Oc="/v0/admin",Le=`${Oc}/clusters`,Pb=t.Object({helmParameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),helmVersion:t.String()}),Cb=t.Record(t.String(),Pb),Yu=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],Vu=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],Qu=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],Ub=["aws","gcp","azure"],pa=["xs","s","m","l"],Wu=["1.0"],EG=["tsuga-cluster","tsuga-telemetry","tsuga-deployer","tsuga-events"],Ac=t.Enum(EG,{description:"Helm installation name identifying a chart component on the cluster."}),IG={id:t.String(),name:t.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:t.String(),deployerEndpoint:t.String(),targetConfiguration:Cb,appliedConfiguration:t.Optional(Cb),automaticallyDeployLatestVersion:t.Boolean(),automatedDeploymentDisabledBy:t.Optional(t.String()),automatedDeploymentDisabledReason:t.Optional(t.String()),automatedDeploymentDisabledAt:t.Optional(T()),soakTimeMin:t.Optional(t.Number()),clusterSize:t.Optional(t.Enum(pa)),gitSyncByInstallation:t.Record(Ac,t.Boolean(),{description:"Per-installation git-sync state, keyed by installationName."})},Ku={...IG,orgId:t.String(),orgName:t.String()},AIe=d({tags:["admin"],method:"GET",url:Le,query:t.Object({orgId:t.Optional(p())}),response:t.Array(b("clusterType",[t.Object({...Ku,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(Wu)),clusterRegion:t.Enum(Yu)}),t.Object({...Ku,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(Vu)}),t.Object({...Ku,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(Qu)})]))}),xIe=d({tags:["admin"],method:"PUT",url:`${Le}/create`,body:b("clusterType",[t.Object({clusterType:t.Literal("aws"),orgId:p(),name:p(),clusterSize:t.Enum(pa),clusterAccountId:t.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:t.Enum(Wu),clusterRegion:t.Enum(Yu)}),t.Object({clusterType:t.Literal("gcp"),orgId:p(),name:p(),clusterSize:t.Enum(pa),clusterAccountId:p(),clusterRegion:t.Enum(Vu)}),t.Object({clusterType:t.Literal("azure"),orgId:p(),name:p(),clusterSize:t.Enum(pa),clusterTenantId:p(),clusterSubscriptionId:p(),clusterRegion:t.Enum(Qu)})]),response:t.Object({id:t.String(),bridgeEndpoint:t.String(),deployerEndpoint:t.String()})}),RIe=d({tags:["admin"],method:"DELETE",url:`${Le}/:id`,params:t.Object({id:p()}),body:t.Object({orgId:p()}),response:R}),CIe=d({tags:["admin"],method:"PUT",url:`${Le}/add-inbounder-key`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),PIe=d({tags:["admin"],method:"PUT",url:`${Le}/replace-all-inbounder-keys`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),UIe=d({tags:["admin"],method:"PUT",url:`${Le}/replace-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToReplace:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),wIe=d({tags:["admin"],method:"PUT",url:`${Le}/delete-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToDelete:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyDeleted:t.Boolean()})}),NIe=d({tags:["admin"],method:"PUT",url:`${Le}/rotate-deployer-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),LIe=d({tags:["admin"],method:"PUT",url:`${Le}/rotate-bridge-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),zu={central:t.String(),ngrokBridgeDomain:t.String(),ngrokDeployerDomain:t.String(),clusterCertificateExpiresAt:T(),clusterName:t.String(),clusterSize:t.Optional(t.Enum(pa)),secretBridgeAuthenticationKey:t.String(),secretDeployerAuthenticationKey:t.String(),secretOutbounderAuthenticationKey:t.String(),slackChannelEmail:t.String(),customerTier:t.String()},vIe=d({tags:["admin"],method:"POST",url:`${Le}/:id`,body:t.Object({orgId:p()}),params:t.Object({id:p()}),response:b("clusterType",[t.Object({...zu,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(Wu)),clusterRegion:t.Enum(Yu)}),t.Object({...zu,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(Vu)}),t.Object({...zu,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(Qu)})])}),kIe=d({tags:["admin"],method:"POST",url:`${Le}/configuration`,body:t.Object({id:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Ac,targetConfiguration:Pb,gitSyncEnabled:t.Boolean({description:"Persisted on upgrade: whether this chart's values are synced from git."})}),response:t.Object({status:t.String()})}),MIe=d({tags:["admin"],method:"GET",url:`${Le}/git-values`,query:t.Object({orgId:p({allowEmpty:!1}),clusterId:p({allowEmpty:!1}),installationName:Ac}),response:t.Object({valuesYaml:t.Optional(t.String({description:"Merged git values rendered as YAML. Absent when the cluster/chart has no resolvable values in the repository mirror."})),sha:t.Optional(t.String({description:"Abbreviated commit SHA of the mirrored repository. Absent if not yet successfully fetched (or sync disabled)."}))})}),DIe=d({tags:["admin"],method:"POST",url:`${Le}/git-sync`,body:t.Object({clusterId:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Ac,gitSyncEnabled:t.Boolean({description:"Whether this chart syncs its Helm values from git."})}),response:t.Object({status:t.String()})}),GIe=d({tags:["admin"],method:"POST",url:`${Le}/automation`,body:t.Object({id:p(),orgId:p(),enableAutomatedDeployment:t.Boolean(),disabledReason:t.Optional(p())}),response:t.Object({status:t.String()})}),$Ie=d({tags:["admin"],method:"POST",url:`${Le}/soak-time`,body:t.Object({id:p(),orgId:p(),soakTimeMin:t.Optional(t.Number())}),response:t.Object({status:t.String()})}),jIe=d({tags:["admin"],method:"POST",url:`${Le}/deploy`,body:t.Object({orgId:p(),clusterId:p(),chartName:p(),toVersion:p()}),response:t.Object({id:t.String()})}),_G=b("type",[t.Object({type:t.Literal("pending")}),t.Object({type:t.Literal("running")}),t.Object({type:t.Literal("cancelled")}),t.Object({type:t.Literal("timed_out")}),t.Object({type:t.Literal("success"),stateValue:t.Object({message:t.String()})}),t.Object({type:t.Literal("failure"),stateValue:t.Object({message:t.String()})})]),qIe=d({tags:["admin"],method:"GET",url:`${Le}/deploy`,query:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),orgId:t.String(),orgName:t.String(),clusterId:t.String(),clusterName:t.String(),fromVersion:t.Optional(t.String()),toVersion:t.String(),state:_G,updatedAt:T(),createdAt:T(),installationName:t.String(),chartName:t.String(),isAutomated:t.Boolean(),createdBy:t.Optional(t.String()),createdByName:t.Optional(t.String()),createdByEmail:t.Optional(t.String())}))}),bG=t.Object({installations:t.Array(t.Object({installationName:t.String(),parameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),version:t.Union([t.String(),t.Null()]),resources:t.Array(t.Object({id:t.Object({kind:t.String(),name:t.String()}),status:t.String(),health:t.String(),rawDetails:t.Optional(t.Any()),liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())})),deployedAt:t.Optional(t.String()),syncStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String())}))}),BIe=d({tags:["admin"],method:"POST",url:`${Le}/status`,body:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({orgId:t.String(),clusterId:t.String(),status:bG}))}),FIe=d({tags:["admin"],method:"POST",url:`${Le}/argocd-cert-info`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({certificateExpiresAt:t.String()})}),SG=t.Object({kind:t.String(),name:t.String()}),OG=t.Object({id:SG,liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())}),HIe=d({tags:["admin"],method:"POST",url:`${Le}/resource-details`,body:t.Object({orgId:p(),clusterId:p(),installationName:p()}),response:t.Object({resources:t.Array(OG)})}),KIe=d({tags:["admin"],method:"GET",url:`${Le}/versions`,query:t.Object({chartName:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),chartName:t.String(),locator:t.String(),version:t.String(),repositoryArn:t.String(),type:t.Optional(t.String()),commitHash:t.Optional(t.String()),lastPulledAt:t.Optional(T()),pushedAt:t.Optional(T())}))});var AG=t.Object({id:t.Object({name:t.String(),kind:t.String()}),previewManifest:t.Optional(t.String())}),zIe=d({tags:["admin"],method:"POST",url:`${Le}/versions/render`,body:t.Object({chartName:p(),version:p(),values:p({type:"long"}),installationName:p(),namespace:p()}),response:t.Array(AG)}),hr=`${Oc}/orgs`,YIe=d({tags:["admin"],url:hr,method:"GET",query:t.Object({onlyDeleted:t.Optional(t.Boolean())}),response:t.Array(t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String()),createdAt:T(),updatedAt:T()}))}),VIe=d({tags:["admin"],url:hr,method:"POST",body:t.Object({emailDomains:t.Array(p({type:"lowercase-domain"}),{maxItems:20}),name:p()}),response:t.Object({id:t.String(),name:t.String()})}),QIe=d({tags:["admin"],url:`${hr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Object({allowedDomains:t.Optional(t.Array(p({type:"lowercase-domain"}),{maxItems:20}))}),response:t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String())})}),WIe=d({tags:["admin"],url:`${hr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ZIe=d({tags:["admin"],url:`${hr}/:id/restore`,method:"POST",params:t.Object({id:p()}),response:t.Object({success:t.Boolean()})}),XIe=d({tags:["admin"],url:`${hr}/:id/permanent-delete`,method:"DELETE",params:t.Object({id:p()}),response:t.Object({success:t.Boolean(),hasDeletedSecret:t.Boolean(),hasDeletedTenantDb:t.Boolean(),hasDeletedOrgRow:t.Boolean()})}),JIe=d({tags:["admin"],url:`${hr}/synchronize-sds-rules`,method:"POST",response:t.Object({errorOrgs:t.Optional(t.Array(t.Object({id:t.String(),name:t.String()}))),synchronizedOrgsCount:t.Number()})}),xG=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],RG=t.Enum(xG),e_e=d({tags:["admin"],url:`${hr}/refresh-assets`,method:"POST",body:t.Object({assetTypes:t.Array(RG,{minItems:1}),orgId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.Object({orgId:t.String(),orgName:t.String(),results:t.Record(t.String(),t.Object({success:t.Boolean()}))}))}),t_e=d({tags:["admin"],url:`${hr}/sudo`,method:"POST",body:t.Object({orgId:p()}),response:t.Object({sudoToken:t.String()})}),CG=`${Oc}/users`,r_e=d({tags:["admin"],url:`${CG}/invite`,method:"POST",body:t.Object({email:p({type:"email"}),orgId:p(),userRole:t.Enum(Sc)}),response:t.Array(t.Object({inviteId:t.String(),email:t.String(),result:t.Union([t.Literal("success"),t.Literal("email-failed")])}))});var n_e=d({tags:["admin"],url:`${Oc}/billing-data`,method:"GET",query:t.Object({orgId:p(),maxDaysFetched:t.Optional(t.Number({minimum:1,maximum:365}))}),response:t.Object({dataPoints:t.Array(t.Object({date:t.String(),telemetryKind:t.Union([t.Literal("logs"),t.Literal("metrics"),t.Literal("rum"),t.Literal("traces")]),totalBytes:t.Number(),clusterId:t.String(),apiKeyId:t.String(),apiKeyName:t.String(),teamName:t.String()})),availableFilters:t.Object({clusters:t.Array(t.Object({id:t.String(),name:t.String()})),apiKeys:t.Array(t.Object({id:t.String(),name:t.String()})),teamNames:t.Array(t.String())})})});var wb=t.Object({id:t.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:t.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:t.Optional(t.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:t.Enum(Ub,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:t.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`."}),PG={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(wb,{examples:[PG]});var Nb=d({description:"Lists Tsuga clusters available to the organization. Use cluster IDs with public API requests that accept `clusterId`, such as telemetry, service, Kubernetes Explorer, and quality-report requests.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:t.Array(wb)});function Lb(e,r){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await r()(Nb);W(o)})}function kb(e,r,n,o){let i=e.commands.map(c=>c.name()).filter(c=>!c.startsWith("__")),a=e.options.map(c=>c.long).filter(c=>!!c);for(let c of e.options)(c.required||c.optional)&&(c.long&&o.add(c.long),c.short&&o.add(c.short));n.set(r.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||kb(c,[...r,c.name()],n,o)}function UG(e){let r=new Map,n=new Set;return kb(e,[],r,n),{rows:[...r].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function vb(e){return e.map(({key:r,cmds:n,flags:o})=>` ${JSON.stringify(r)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
40
|
+
`)}function wG(e,r){return`_tsuga_complete() {
|
|
41
41
|
local cur key cmds flags words i word prev
|
|
42
|
-
local valueflags="${
|
|
42
|
+
local valueflags="${r}"
|
|
43
43
|
local -a path
|
|
44
44
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
45
45
|
prev=""
|
|
@@ -58,10 +58,10 @@ ${e}
|
|
|
58
58
|
COMPREPLY=( $(compgen -W "$words" -- "$cur") )
|
|
59
59
|
}
|
|
60
60
|
complete -F _tsuga_complete tsuga
|
|
61
|
-
`}function
|
|
61
|
+
`}function NG(e,r){return`#compdef tsuga
|
|
62
62
|
_tsuga_complete() {
|
|
63
63
|
local cur key cmds flags out i word prev
|
|
64
|
-
local valueflags="${
|
|
64
|
+
local valueflags="${r}"
|
|
65
65
|
local -a path
|
|
66
66
|
cur="\${words[CURRENT]}"
|
|
67
67
|
prev=""
|
|
@@ -80,12 +80,12 @@ ${e}
|
|
|
80
80
|
compadd -- \${=out}
|
|
81
81
|
}
|
|
82
82
|
compdef _tsuga_complete tsuga
|
|
83
|
-
`}function
|
|
84
|
-
set cmds ${
|
|
85
|
-
set flags ${
|
|
86
|
-
`)}function
|
|
83
|
+
`}function Zu(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function LG(e){return e.map(({key:r,cmds:n,flags:o})=>` case ${Zu(r)}
|
|
84
|
+
set cmds ${Zu(n)}
|
|
85
|
+
set flags ${Zu(o)}`).join(`
|
|
86
|
+
`)}function vG(e,r){return`# Update with: tsuga completion fish > ~/.config/fish/completions/tsuga.fish
|
|
87
87
|
function __tsuga_complete
|
|
88
|
-
set -l valueflags -- ${
|
|
88
|
+
set -l valueflags -- ${r}
|
|
89
89
|
set -l tokens (commandline -xpc)
|
|
90
90
|
set -l cur (commandline -ct)
|
|
91
91
|
set -l path
|
|
@@ -118,50 +118,50 @@ ${e}
|
|
|
118
118
|
end
|
|
119
119
|
end
|
|
120
120
|
complete -c tsuga -f -a '(__tsuga_complete)'
|
|
121
|
-
`}function
|
|
121
|
+
`}function Mb(e){e.command("completion <shell>").description("Print a shell completion script (bash, zsh, or fish)").addHelpText("after",`
|
|
122
122
|
Usage:
|
|
123
123
|
bash: eval "$(tsuga completion bash)" # add to ~/.bashrc
|
|
124
124
|
zsh: eval "$(tsuga completion zsh)" # add to ~/.zshrc
|
|
125
|
-
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(
|
|
126
|
-
...`};Object.assign(u_,{examples:[L0]});var l_=r.Object({kind:r.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:r.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:r.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:r.Optional(r.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:r.Optional(r.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:r.Optional(r.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:r.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:r.String({description:"Short snippet of matching content"}),link:r.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`."})},{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),M0={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://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(l_,{examples:[M0]});var d_=d({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:m_,method:"GET",query:r.Object({path:m({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:u_}),f_=d({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results.",operationId:"searchDocs",tags:["public","docs"],url:`${m_}/search`,method:"GET",query:r.Object({query:m({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:r.Array(l_)});function g_(e,t){let n=e.command("docs").description("Browse and search documentation");n.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(d_,{query:{path:o}});oe(i)}),n.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(f_,{query:{query:o}});oe(i)})}var h_=1456444800,E_=4927737600,v0=h_*1e3,D0=E_*1e3,Vs=1704067200,um=Vs*1e3,T_={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Vs,to:Vs}]},I_={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:um,to:um}]},Ys=e=>r.Integer({description:e,examples:[Vs],minimum:h_,maximum:E_,format:"int64"}),y_=e=>r.Integer({description:e,examples:[um],minimum:v0,maximum:D0,format:"int64"}),_t=r.Object({from:r.Optional(Ys("Start of the query window as a Unix timestamp in seconds")),to:r.Optional(Ys("End of the query window as a Unix timestamp in seconds"))},T_),bt=r.Object({from:Ys("Start of the query window as a Unix timestamp in seconds"),to:Ys("End of the query window as a Unix timestamp in seconds")},T_),Eye=r.Object({from:r.Integer({description:"Start of the query window as a Unix timestamp in milliseconds"}),to:r.Integer({description:"End of the query window as a Unix timestamp in milliseconds"})},I_),__=r.Object({from:y_("Start of the query window as a Unix timestamp in milliseconds"),to:y_("End of the query window as a Unix timestamp in milliseconds")},I_);var b_=r.Object({type:r.Literal("number"),number:r.String()}),$0=r.Object({type:r.Literal("string"),string:r.String()}),G0=r.Object({type:r.Literal("timestamp"),timestamp:r.String()}),lm=A("type",[b_,$0,G0]),j0=r.Object({by:r.Record(r.String(),lm),computed:r.Record(r.String(),b_)}),q0=r.Object({type:r.Literal("buckets"),buckets:r.Array(j0)}),F0=r.Object({type:r.Literal("distribution"),bounds:r.Array(r.Number()),buckets:r.Array(r.Object({timestamp:r.Number(),counts:r.Array(r.Number())})),percentiles:r.Optional(r.Array(r.Number()))}),O_=A("type",[q0,F0]);var B0="/v0/aggregation",H0=r.Union([r.Literal("a"),r.Literal("d"),r.Literal("q"),r.Literal("w"),r.Literal("t")]),K0=r.Object({parallelism:r.Number(),engine:H0,recordBatchCache:r.Optional(r.Boolean()),includeNullGroups:r.Optional(r.Boolean()),restartAwareGaugeSum:r.Optional(r.Boolean())}),Lt=["logs","metrics","traces"],z0={logs:"Logs",metrics:"Metrics",traces:"Traces"},V0=[...Lt,"connections","log-patterns"],wye={...z0,connections:"Connections","log-patterns":"Log Patterns"},Lye=r.Enum(V0,{description:"Data source being queried"}),bn=r.Enum(Lt,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),In=r.String({description:"Attribute containing the values to aggregate"}),_n=m({description:"Attribute containing the values to aggregate"}),Y0=A("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(In)},{$id:"AggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:In},{$id:"AggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:In},{$id:"AggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:In},{$id:"AggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:In},{$id:"AggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:In},{$id:"AggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:In,percentile:r.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),Q0=A("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(_n)},{$id:"InputAggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:_n},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:_n},{$id:"InputAggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:_n},{$id:"InputAggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:_n},{$id:"InputAggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:_n},{$id:"InputAggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:_n,percentile:r.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),x_=r.Object({type:r.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),R_=r.Object({type:r.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),C_=r.Object({type:r.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),P_=r.Object({type:r.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),U_=r.Object({type:r.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"}),N_=r.Object({type:r.Literal("power",{description:"Raises values to a specified power"}),exponent:r.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),k_=r.Object({type:r.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),w_=r.Object({type:r.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),W0=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:r.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),Z0=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),X0=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),J0=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),ev=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),tv=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),rv=A("type",[x_,R_,C_,P_,U_,W0,X0,N_,k_,w_,ev],{title:"Function"}),nv=A("type",[x_,R_,C_,P_,U_,Z0,J0,N_,k_,w_,tv],{title:"InputFunction"});var A_=r.Object({min:r.Number({description:"Lower bound of the distribution range."}),max:r.Number({description:"Upper bound of the distribution range."})}),ov=["linear","log"],Qs=r.Enum(ov),S_=r.Integer({minimum:1}),iv=A("type",[r.Object({type:r.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),r.Object({type:r.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),r.Object({type:r.Literal("histogram"),by:r.Optional(m()),bucketCount:r.Optional(S_),bounds:r.Optional(A_),boundsScale:r.Optional(Qs),percentiles:r.Optional(r.Array(r.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),r.Object({type:r.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:r.Optional(m()),bucketCount:r.Optional(S_),bounds:r.Optional(A_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),dm=15,av=["zero","null"],sv=r.Enum(av,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),L_=r.Object({mode:r.Object({type:sv},{description:"How missing aggregation points should be filled."})}),M_={aggregate:Y0,functions:r.Optional(r.Array(rv,{description:"Post-processing functions applied to aggregation results"})),fill:r.Optional(L_)},v_={aggregate:Q0,functions:r.Optional(r.Array(nv,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:r.Optional(L_)},cv={description:"Aggregations that may be combined together in the same query"},D_={maxItems:dm,description:"Aggregations that may be combined together in the same query"},$_=r.Array(r.Object({...M_,filter:r.Optional(r.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),cv),Bi=r.Array(r.Object({...v_,filter:r.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),D_),Ao=r.Array(r.Object({...M_,filter:r.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),So=r.Array(r.Object({...v_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),D_);var G_=r.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Hi=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),pv=r.Object({fields:r.Array(r.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:r.Number({description:"Maximum number of groups returned for this grouping level."})},{title:"AggregationGroupBy"}),mv=r.Object({fields:r.Array(m(),{maxItems:1,description:"Telemetry attribute name used to group aggregation results."}),limit:r.Number({description:"Maximum number of groups returned for this grouping level."})},{title:"AggregationGroupBy"}),j_=7;var fm=r.Array(pv,{description:"Fields used to group the results"}),xo=r.Array(mv,{maxItems:j_,description:"Fields used to group the results"}),uv=[...Lt,"rum"],Mye=d({tags:["aggregation"],url:`${B0}/multi-query`,method:"POST",body:r.Object({timeRange:__,queries:Bi,groupBy:r.Optional(xo),returnType:iv,dataSource:r.Enum(uv,{description:"Data source being queried for this aggregation"}),formula:Hi,executionOptions:K0,triggeredBy:r.Optional(r.Literal("refresh")),shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(m({allowEmpty:!1}))}),response:O_});var q_=`/${"v1"}/aggregation`,F_=r.Object({id:r.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:r.Record(r.String(),r.Union([r.String(),r.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),lv={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},B_=r.Object({results:r.Array(r.Object({...F_.properties,value:r.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."});Object.assign(B_,{examples:[lv]});var dv={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},Ws=r.Object({series:r.Array(r.Object({...F_.properties,points:r.Array(r.Object({timestamp:r.Integer({description:"Timestamp in milliseconds"}),value:r.Number({description:"Aggregated value at this timestamp"})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"Time series data per query or formula and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."});Object.assign(Ws,{examples:[dv]});var H_={timeRange:bt,queries:r.Array(r.Omit(Bi.items,["fill"],{title:"AggregationQuery"}),{maxItems:dm,description:'Aggregations that may be combined together in the same query. 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:r.Optional(xo),dataSource:bn,formula:r.Optional(Hi)},K_=r.Object({clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),fv=r.Object(H_,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula."}),z_=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${q_}/multi-query/scalar`,method:"POST",body:fv,query:K_,response:B_}),gv=r.Object({...H_,aggregationWindow:m({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula."}),V_=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${q_}/multi-query/timeseries`,method:"POST",body:gv,query:K_,response:Ws});var yv=`/${"v1"}/promql`,hv=r.Object({query:m({allowEmpty:!1,type:"long",description:"PromQL query string to evaluate against Tsuga metric data."}),timeRange:bt,step:m({allowEmpty:!1,description:"Query resolution step, such as `15s` or `1m`."})},{description:"Experimental PromQL query request."}),Ev=r.Object({clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),Y_=d({description:"Runs an experimental PromQL query over metric data and returns timeseries results. Use this only when you need PromQL-compatible metric queries; response shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:yv,method:"POST",body:hv,query:Ev,response:Ws});var Q_=Fl(require("node:fs"));function Ro(e){if(e.file){let t=Q_.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function Tv(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function gm(e){return s.HasPropertyKey(e,"~guard")&&Tv(e["~guard"])}function ym(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function dr(e){return s.IsObject(e)&&!s.IsArray(e)}function Zs(e){return s.IsBoolean(e)}function $(e){return dr(e)||Zs(e)}function hm(e){return s.HasPropertyKey(e,"additionalItems")&&$(e.additionalItems)}function fr(e){return s.HasPropertyKey(e,"additionalProperties")&&$(e.additionalProperties)}function Em(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>$(t))}function Ki(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Tm(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>$(t))}function Im(e){return s.HasPropertyKey(e,"const")}function On(e){return s.HasPropertyKey(e,"contains")&&$(e.contains)}function Ut(e){return s.HasPropertyKey(e,"default")}function _m(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>$(t)||s.IsArray(t)&&t.every(n=>s.IsString(n)))}function bm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(n=>s.IsString(n)))}function Om(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>$(t))}function Am(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function Sm(e){return s.HasPropertyKey(e,"else")&&$(e.else)}function xm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Rm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function gr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function zi(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function An(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Cm(e){return s.HasPropertyKey(e,"if")&&$(e.if)}function Co(e){return s.HasPropertyKey(e,"items")&&($(e.items)||s.IsArray(e.items)&&e.items.every(t=>$(t)))}function Pm(e){return Co(e)&&s.IsArray(e.items)}function Um(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Nm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Xs(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function km(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function wm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function yr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Sn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Po(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Vi(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function Yi(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Lm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function Mm(e){return s.HasPropertyKey(e,"not")&&$(e.not)}function vm(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>$(t))}function Qi(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Wi(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>$(t))}function Uo(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>$(t))}function Zi(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>$(t))}function Dm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||$(e.propertyNames))}function Iv(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Js(e){return Iv(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function $m(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function Gm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function xn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function jm(e){return s.HasPropertyKey(e,"then")&&$(e.then)}function qm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function No(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function ec(e){return s.HasPropertyKey(e,"unevaluatedItems")&&$(e.unevaluatedItems)}function tc(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&$(e.unevaluatedProperties)}var ct=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let n of t)n.indices.forEach(o=>this.indices.add(o)),n.keys.forEach(o=>this.keys.add(o));return!0}},Xi=class extends ct{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},Fe=class extends Xi{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var _v="external_",bv=0,_Ie={identifier:`${_v}${bv}`,variables:[]};function W_(e,t,n,o){return n["~guard"].check(o)}function Z_(e,t,n,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:n,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function X_(e,t,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function J_(e,t,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,u)=>c.refine(a)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:u,message:c.message}}))}function eb(e){return Co(e)&&s.IsArray(e.items)}function tb(e,t,n,o){return eb(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||D(e,t,n.additionalItems,a)&&t.AddIndex(c)):!0}function rb(e,t,n,o,i,a){return eb(i)?a.every((u,l)=>{let f=`${n}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||Q(e,t,f,y,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Ov(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function nb(e){let t=[];return Wi(e)&&t.push(...s.Keys(e.patternProperties)),Zi(e)&&t.push(...s.Keys(e.properties).map(Ov)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function ob(e,t,n,o){let i=new RegExp(nb(n));return s.Every(s.Keys(o),0,(c,u)=>i.test(c)||D(e,t,n.additionalProperties,o[c])&&t.AddKey(c))}function ib(e,t,n,o,i,a){let c=new RegExp(nb(i)),u=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let E=`${n}/additionalProperties`,S=`${o}/${f}`,ge=new Fe,Pe=c.test(f)||Q(e,ge,E,S,i.additionalProperties,a[f])&&t.AddKey(f);return Pe||u.push(f),Pe})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:u}})}function ab(e,t,n,o){let i=n.allOf.reduce((a,c)=>{let u=new ct;return D(e,u,c,o)?[...a,u]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&t.Merge(i)}function sb(e,t,n,o,i,a){let c=[],u=i.allOf.reduce((f,y,E)=>{let S=`${n}/allOf/${E}`,ge=new Fe,Pe=Q(e,ge,S,o,y,a);return Pe||c.push(ge),Pe?[...f,ge]:f},[]),l=s.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function cb(e,t,n,o){let i=n.anyOf.reduce((a,c,u)=>{let l=new ct;return D(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function pb(e,t,n,o,i,a){let c=[],u=i.anyOf.reduce((f,y,E)=>{let S=new Fe,ge=`${n}/anyOf/${E}`,Pe=Q(e,S,ge,o,y,a);return Pe||c.push(S),Pe?[...f,S]:f},[]),l=s.IsGreaterThan(u.length,0)&&t.Merge(u);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Bm(e,t,n,o){return n}function mb(e,t,n,o,i,a){return Bm(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function Hm(e,t,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function ub(e,t,n,o,i,a){return Hm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function Av(e){return!(Sn(e)&&s.IsEqual(e.minContains,0))}function Km(e,t,n,o){return Av(n)?!s.IsEqual(o.length,0)&&o.some(i=>D(e,t,n.contains,i)):!0}function lb(e,t,n,o,i,a){return Km(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function db(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,u])=>!s.HasPropertyKey(o,c)||(s.IsArray(u)?u.every(l=>s.HasPropertyKey(o,l)):D(e,t,u,o)));return i||a}function fb(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${n}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})):Q(e,t,y,o,f,a))});return c||u}function gb(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,u])=>!s.HasPropertyKey(o,c)||u.every(l=>s.HasPropertyKey(o,l)));return i||a}function yb(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})));return c||u}function hb(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,u])=>!s.HasPropertyKey(o,c)||D(e,t,u,o));return i||a}function Eb(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${n}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||Q(e,t,y,o,f,a)});return c||u}function zm(e,t,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function Tb(e,t,n,o,i,a){return zm(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Vm(e,t,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function Ib(e,t,n,o,i,a){return Vm(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Ym(e,t,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function _b(e,t,n,o,i,a){return Ym(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var wo={};kt(wo,{Clear:()=>Ob,Entries:()=>Bv,Get:()=>zv,Has:()=>Kv,IsDate:()=>Ji,IsDateTime:()=>Qm,IsDuration:()=>Wm,IsEmail:()=>Zm,IsHostname:()=>Xm,IsIPv4:()=>ru,IsIPv6:()=>nu,IsIdnEmail:()=>Jm,IsIdnHostname:()=>tu,IsIri:()=>iu,IsIriReference:()=>ou,IsJsonPointer:()=>su,IsJsonPointerUriFragment:()=>au,IsRegex:()=>cu,IsRelativeJsonPointer:()=>pu,IsTime:()=>ea,IsUri:()=>lu,IsUriReference:()=>mu,IsUriTemplate:()=>uu,IsUrl:()=>du,IsUuid:()=>fu,Reset:()=>Ab,Set:()=>Hv,Test:()=>Vv});var Sv=[0,31,28,31,30,31,30,31,31,30,31,30,31],xv=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Rv(e){return e%4===0&&(e%100!==0||e%400===0)}function Ji(e){let t=xv.exec(e);if(!t)return!1;let n=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&Rv(n)?29:Sv[o])}var Cv=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function ea(e,t=!0){let n=Cv.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,u=+(n[5]||0),l=+(n[6]||0);if(u>23||l>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*c,y=o-u*c-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Qm(e,t=!0){let n=e.split(/T/i);return n.length===2&&Ji(n[0])&&ea(n[1],t)}var Pv=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Wm(e){return Pv.test(e)}var Uv=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function Zm(e){return Uv.test(e)}var Nv=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;function Xm(e){return Nv.test(e)}var kv=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Jm(e){return kv.test(e)}function eu(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function tu(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,n=e.normalize("NFC").replace(t,".");if(n.length>253)return!1;let o=n.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),E=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(E))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!eu(y))return!1}else{let y=i.charAt(l-1),E=i.charAt(l+1);if(!eu(y)||!eu(E))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let c=!1,u=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(u=!0)}if(c&&u)return!1}return!0}var wv=/^(?:(?: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 ru(e){return wv.test(e)}var Lv=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function nu(e){return Lv.test(e)}function bb(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function ou(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?bb(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:bb(e)}function iu(e){try{return new URL(e),!0}catch{return!1}}var Mv=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function au(e){return Mv.test(e)}var vv=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function su(e){return vv.test(e)}function cu(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Dv=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function pu(e){return Dv.test(e)}var $v=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function mu(e){return $v.test(e)}var Gv=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function uu(e){return Gv.test(e)}var jv=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function lu(e){return jv.test(e)}var qv=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function du(e){return qv.test(e)}var Fv=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function fu(e){return Fv.test(e)}var fe=new Map;function Ob(){fe.clear()}function Bv(){return[...fe.entries()]}function Hv(e,t){fe.set(e,t)}function Kv(e){return fe.has(e)}function zv(e){return fe.get(e)}function Vv(e,t){return fe.get(e)?.(t)??!0}function Ab(){Ob(),fe.set("date-time",Qm),fe.set("date",Ji),fe.set("duration",Wm),fe.set("email",Zm),fe.set("hostname",Xm),fe.set("idn-email",Jm),fe.set("idn-hostname",tu),fe.set("ipv4",ru),fe.set("ipv6",nu),fe.set("iri-reference",ou),fe.set("iri",iu),fe.set("json-pointer-uri-fragment",au),fe.set("json-pointer",su),fe.set("regex",cu),fe.set("relative-json-pointer",pu),fe.set("time",ea),fe.set("uri-reference",mu),fe.set("uri-template",uu),fe.set("uri",lu),fe.set("url",du),fe.set("uuid",fu)}Ab();function gu(e,t,n,o){return wo.Test(n.format,o)}function Sb(e,t,n,o,i,a){return gu(e,t,i,a)||t.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function xb(e,t,n,o){let i=jm(n)?n.then:!0,a=Sm(n)?n.else:!0;return D(e,t,n.if,o)?D(e,t,i,o):D(e,t,a,o)}function Rb(e,t,n,o,i,a){let c=jm(i)?i.then:!0,u=Sm(i)?i.else:!0,l=new Fe,f=Q(e,l,`${n}/if`,o,i.if,a)?Q(e,l,`${n}/then`,o,c,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):Q(e,t,`${n}/else`,o,u,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function Yv(e,t,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function Qv(e,t,n,o,i,a){return s.EveryAll(i.items,0,(c,u)=>{let l=`${n}/items/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||Q(e,t,l,f,c,a[u])&&t.AddIndex(u)})}function Wv(e,t,n,o){let i=Uo(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>D(e,t,n.items,a)&&t.AddIndex(c))}function Zv(e,t,n,o,i,a){let c=Uo(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(u,l)=>{let f=`${n}/items`,y=`${o}/${l}`;return Q(e,t,f,y,i.items,u)&&t.AddIndex(l)})}function Cb(e,t,n,o){return Pm(n)?Yv(e,t,n,o):Wv(e,t,n,o)}function Pb(e,t,n,o,i,a){return Pm(i)?Qv(e,t,n,o,i,a):Zv(e,t,n,o,i,a)}function Xv(e){return On(e)}function yu(e,t,n,o){if(!Xv(n))return!0;let i=o.reduce((a,c)=>D(e,t,n.contains,c)?++a:a,0);return s.IsLessEqualThan(i,n.maxContains)}function Ub(e,t,n,o,i,a){let c=Sn(i)?i.minContains:1;return yu(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function hu(e,t,n,o){return s.IsLessEqualThan(o,n.maximum)}function Nb(e,t,n,o,i,a){return hu(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Eu(e,t,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function kb(e,t,n,o,i,a){return Eu(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function Tu(e,t,n,o){return s.IsMaxLength(o,n.maxLength)}function wb(e,t,n,o,i,a){return Tu(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function Iu(e,t,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function Lb(e,t,n,o,i,a){return Iu(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function Jv(e){return On(e)}function _u(e,t,n,o){if(!Jv(n))return!0;let i=o.reduce((a,c)=>D(e,t,n.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,n.minContains)}function Mb(e,t,n,o,i,a){return _u(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function bu(e,t,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function vb(e,t,n,o,i,a){return bu(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Ou(e,t,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function Db(e,t,n,o,i,a){return Ou(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function Au(e,t,n,o){return s.IsMinLength(o,n.minLength)}function $b(e,t,n,o,i,a){return Au(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function Su(e,t,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function Gb(e,t,n,o,i,a){return Su(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function xu(e,t,n,o){return s.IsMultipleOf(o,n.multipleOf)}function jb(e,t,n,o,i,a){return xu(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function Ru(e,t,n,o){let i=new ct;return!D(e,i,n.not,o)&&t.Merge([i])}function qb(e,t,n,o,i,a){return Ru(e,t,i,a)||t.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function Fb(e,t,n,o){let i=n.oneOf.reduce((a,c)=>{let u=new ct;return D(e,u,c,o)?[...a,u]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function Bb(e,t,n,o,i,a){let c=[],u=[],l=i.oneOf.reduce((y,E,S)=>{let ge=new Fe,Pe=`${n}/oneOf/${S}`,Ar=Q(e,ge,Pe,o,E,a);return Ar&&u.push(S),Ar||c.push(ge),Ar?[...y,ge]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(u.length,0)&&c.forEach(y=>y.GetErrors().forEach(E=>t.AddError(E))),f||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:u}})}function Cu(e,t,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function Hb(e,t,n,o,i,a){return Cu(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function Kb(e,t,n,o){return s.Every(s.Entries(n.patternProperties),0,([i,a])=>{let c=new RegExp(i);return s.Every(s.Entries(o),0,([u,l])=>!c.test(u)||D(e,t,a,l)&&t.AddKey(u))})}function zb(e,t,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,u])=>{let l=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([y,E])=>{let S=`${o}/${y}`;return!f.test(y)||Q(e,t,l,S,u,E)&&t.AddKey(y)})})}function Vb(e,t,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function Yb(e,t,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,u)=>{let l=`${n}/prefixItems/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||Q(e,t,l,f,c,a[u])&&t.AddIndex(u)})}function Pu(e,t){return e.includes(t)||xt.Get().exactOptionalPropertyTypes}function Uu(e,t){return s.IsUndefined(e[t])}function Qb(e,t,n,o){let i=xn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,u])=>{let l=!s.HasPropertyKey(o,c)||D(e,t,u,o[c])&&t.AddKey(c);return Pu(i,c)?l:Uu(o,c)||l})}function Wb(e,t,n,o,i,a){let c=xn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${n}/properties/${l}`,E=`${o}/${l}`,S=()=>!s.HasPropertyKey(a,l)||Q(e,t,y,E,f,a[l])&&t.AddKey(l);return Pu(c,l)?S():Uu(a,l)||S()})}function Zb(e,t,n,o){return s.Every(s.Keys(o),0,(i,a)=>D(e,t,n.propertyNames,i))}function Xb(e,t,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,E=`${n}/propertyNames`,S=new Fe,ge=Q(e,S,E,y,i.propertyNames,l);return ge||c.push(l),ge})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function Jb(e,t,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return $(i)&&D(e,t,i,o)}function eO(e,t,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return $(c)&&Q(e,t,"#",o,c,a)}function nO(e,t,n,o){let i=e.Ref(n.$ref)??!1,a=new ct,c=$(i)&&D(e,a,i,o);return c&&t.Merge([a]),c}function oO(e,t,n,o,i,a){let c=e.Ref(i.$ref)??!1,u=new Fe,l=$(c)&&Q(e,u,"#",o,c,a);return l&&t.Merge([u]),l||u.GetErrors().forEach(f=>t.AddError(f)),l}function iO(e,t,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function aO(e,t,n,o,i,a){let c=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||c.push(l),f})||t.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function Nu(e,t,n,o,i){return s.IsEqual(n,"object")?s.IsObjectNotArray(i):s.IsEqual(n,"array")?s.IsArray(i):s.IsEqual(n,"boolean")?s.IsBoolean(i):s.IsEqual(n,"integer")?s.IsInteger(i):s.IsEqual(n,"number")?s.IsNumber(i):s.IsEqual(n,"null")?s.IsNull(i):s.IsEqual(n,"string")?s.IsString(i):s.IsEqual(n,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(n,"bigint")?s.IsBigInt(i):s.IsEqual(n,"constructor")?s.IsConstructor(i):s.IsEqual(n,"function")?s.IsFunction(i):s.IsEqual(n,"iterator")?s.IsIterator(i):s.IsEqual(n,"symbol")?s.IsSymbol(i):s.IsEqual(n,"undefined")?s.IsUndefined(i):s.IsEqual(n,"void")?s.IsUndefined(i):!0}function sO(e,t,n,o,i){return n.some(a=>Nu(e,t,a,o,i))}function cO(e,t,n,o){return s.IsArray(n.type)?sO(e,t,n.type,n,o):Nu(e,t,n.type,n,o)}function pO(e,t,n,o,i,a){return(s.IsArray(i.type)?sO(e,t,i.type,i,a):Nu(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function mO(e,t,n,o){let i=t.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||D(e,t,n.unevaluatedItems,a))&&t.AddIndex(c))}function uO(e,t,n,o,i,a){let c=t.GetIndices(),u=[];return s.EveryAll(a,0,(f,y)=>{let E=new Fe,S=(c.has(y)||Q(e,E,n,o,i.unevaluatedItems,f))&&t.AddIndex(y);return S||u.push(y),S})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:u}})}function lO(e,t,n,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||D(e,t,n.unevaluatedProperties,c)&&t.AddKey(a))}function dO(e,t,n,o,i,a){let c=t.GetKeys(),u=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let E=new Fe,S=c.has(f)||Q(e,E,n,o,i.unevaluatedProperties,y)&&t.AddKey(f);return S||u.push(f),S})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:u}})}function fO(e){return!s.IsEqual(e.uniqueItems,!1)}function gO(e,t,n,o){if(!fO(n))return!0;let i=new Set(o.map(kr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function yO(e,t,n,o,i,a){if(!fO(i))return!0;let c=new Set,u=a.reduce((f,y,E)=>{let S=kr.Hash(y);return c.has(S)?[...f,E]:(c.add(S),f)},[]);return s.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:u}})}function D(e,t,n,o){e.Push(n);let i=Zs(n)?Bm(e,t,n,o):(!qm(n)||cO(e,t,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!xn(n)||iO(e,t,n,o))&&(!fr(n)||ob(e,t,n,o))&&(!_m(n)||db(e,t,n,o))&&(!bm(n)||gb(e,t,n,o))&&(!Om(n)||hb(e,t,n,o))&&(!Wi(n)||Kb(e,t,n,o))&&(!Zi(n)||Qb(e,t,n,o))&&(!Dm(n)||Zb(e,t,n,o))&&(!Yi(n)||Su(e,t,n,o))&&(!wm(n)||Iu(e,t,n,o)))&&(!s.IsArray(o)||(!hm(n)||tb(e,t,n,o))&&(!On(n)||Km(e,t,n,o))&&(!Co(n)||Cb(e,t,n,o))&&(!Nm(n)||yu(e,t,n,o))&&(!Xs(n)||Eu(e,t,n,o))&&(!Sn(n)||_u(e,t,n,o))&&(!Po(n)||Ou(e,t,n,o))&&(!Uo(n)||Vb(e,t,n,o))&&(!No(n)||gO(e,t,n,o)))&&(!s.IsString(o)||(!zi(n)||gu(e,t,n,o))&&(!km(n)||Tu(e,t,n,o))&&(!Vi(n)||Au(e,t,n,o))&&(!Qi(n)||Cu(e,t,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!Rm(n)||Vm(e,t,n,o))&&(!gr(n)||Ym(e,t,n,o))&&(!Um(n)||hu(e,t,n,o))&&(!yr(n)||bu(e,t,n,o))&&(!Lm(n)||xu(e,t,n,o)))&&(!$m(n)||Jb(e,t,n,o))&&(!Gm(n)||nO(e,t,n,o))&&(!gm(n)||W_(e,t,n,o))&&(!Im(n)||Hm(e,t,n,o))&&(!xm(n)||zm(e,t,n,o))&&(!Cm(n)||xb(e,t,n,o))&&(!Mm(n)||Ru(e,t,n,o))&&(!Em(n)||ab(e,t,n,o))&&(!Tm(n)||cb(e,t,n,o))&&(!vm(n)||Fb(e,t,n,o))&&(!ec(n)||!s.IsArray(o)||mO(e,t,n,o))&&(!tc(n)||!s.IsObject(o)||lO(e,t,n,o))&&(!ym(n)||X_(e,t,n,o));return e.Pop(n),i}function Q(e,t,n,o,i,a){e.Push(i);let c=Zs(i)?mb(e,t,n,o,i,a):!!(+(!qm(i)||pO(e,t,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!xn(i)||aO(e,t,n,o,i,a))&+(!fr(i)||ib(e,t,n,o,i,a))&+(!_m(i)||fb(e,t,n,o,i,a))&+(!bm(i)||yb(e,t,n,o,i,a))&+(!Om(i)||Eb(e,t,n,o,i,a))&+(!Wi(i)||zb(e,t,n,o,i,a))&+(!Zi(i)||Wb(e,t,n,o,i,a))&+(!Dm(i)||Xb(e,t,n,o,i,a))&+(!Yi(i)||Gb(e,t,n,o,i,a))&+(!wm(i)||Lb(e,t,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!hm(i)||rb(e,t,n,o,i,a))&+(!On(i)||lb(e,t,n,o,i,a))&+(!Co(i)||Pb(e,t,n,o,i,a))&+(!Nm(i)||Ub(e,t,n,o,i,a))&+(!Xs(i)||kb(e,t,n,o,i,a))&+(!Sn(i)||Mb(e,t,n,o,i,a))&+(!Po(i)||Db(e,t,n,o,i,a))&+(!Uo(i)||Yb(e,t,n,o,i,a))&+(!No(i)||yO(e,t,n,o,i,a))))&+(!s.IsString(a)||!!(+(!zi(i)||Sb(e,t,n,o,i,a))&+(!km(i)||wb(e,t,n,o,i,a))&+(!Vi(i)||$b(e,t,n,o,i,a))&+(!Qi(i)||Hb(e,t,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!Rm(i)||Ib(e,t,n,o,i,a))&+(!gr(i)||_b(e,t,n,o,i,a))&+(!Um(i)||Nb(e,t,n,o,i,a))&+(!yr(i)||vb(e,t,n,o,i,a))&+(!Lm(i)||jb(e,t,n,o,i,a))))&+(!$m(i)||eO(e,t,n,o,i,a))&+(!Gm(i)||oO(e,t,n,o,i,a))&+(!gm(i)||Z_(e,t,n,o,i,a))&+(!Im(i)||ub(e,t,n,o,i,a))&+(!xm(i)||Tb(e,t,n,o,i,a))&+(!Cm(i)||Rb(e,t,n,o,i,a))&+(!Mm(i)||qb(e,t,n,o,i,a))&+(!Em(i)||sb(e,t,n,o,i,a))&+(!Tm(i)||pb(e,t,n,o,i,a))&+(!vm(i)||Bb(e,t,n,o,i,a))&+(!ec(i)||!s.IsArray(a)||uO(e,t,n,o,i,a))&+(!tc(i)||!s.IsObject(a)||dO(e,t,n,o,i,a)))&&(!ym(i)||J_(e,t,n,o,i,a));return e.Pop(i),c}var Cn={};kt(Cn,{Ref:()=>lD});var hr={};kt(hr,{Delete:()=>aD,Get:()=>oD,Has:()=>nD,Indices:()=>ta,Set:()=>iD});function hO(e){if(e.length===0)throw Error("Cannot set root")}function EO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function eD(e){return/^(0|[1-9]\d*)$/.test(e)}function TO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function tD(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function rD(e,t){return s.IsObject(t)?t[e]:void 0}function ku(e,t){return e.reduce((n,o)=>rD(o,n),t)}function ta(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function nD(e,t){let n=e;return ta(t).every(o=>tD(o,n)?(n=n[o],!0):!1)}function oD(e,t){let n=ta(t);return ku(n,e)}function iD(e,t,n){let o=ta(t);hO(o);let[i,a]=TO(o),c=ku(i,e);return EO(c),c[a]=n,e}function aD(e,t){let n=ta(t);hO(n);let[o,i]=TO(n),a=ku(o,e);return EO(a),s.IsArray(a)&&eD(i)?a.splice(+i,1):delete a[i],e}function sD(e,t,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,t.href),i=new URL(n.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?IO(e,t,n):e}function cD(e,t,n){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);if(s.IsEqual(o.href,i.href))return e}function IO(e,t,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?hr.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function pD(e,t,n){if(An(e)){let o=sD(e,t,n);if(!s.IsUndefined(o))return o}if(Ki(e)){let o=cD(e,t,n);if(!s.IsUndefined(o))return o}return IO(e,t,n)}function mD(e,t,n){return e.reduce((o,i)=>{let a=wu(i,t,n);return s.IsUndefined(a)?o:a},void 0)}function uD(e,t,n){return s.Keys(e).reduce((o,i)=>{let a=wu(e[i],t,n);return s.IsUndefined(a)?o:a},void 0)}function wu(e,t,n){if(t=dr(e)&&An(e)?new URL(e.$id,t.href):t,dr(e)){let o=pD(e,t,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return mD(e,t,n);if(s.IsObject(e))return uD(e,t,n)}function lD(e,t){let n=new URL("http://unknown"),o=An(e)?new URL(e.$id,n.href):n,i=new URL(t,o.href);return wu(e,o,i)}var Pn=class{constructor(t,n){this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){dr(t)&&(An(t)&&this.ids.push(t),Ki(t)&&this.anchors.push(t),Js(t)&&this.recursiveAnchors.push(t),Am(t)&&this.dynamicAnchors.push(t))}Pop(t){dr(t)&&(An(t)&&this.ids.pop(),Ki(t)&&this.anchors.pop(),Js(t)&&this.recursiveAnchors.pop(),Am(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?Cn.Ref(this.Base(),t):Cn.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return Js(this.Base())?Cn.Ref(this.recursiveAnchors[0],t):Cn.Ref(this.Base(),t)}};function _O(...e){let[t,n,o]=ie.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),i=new Pn(t,n),a=new ct;return D(i,a,n,o)}function bO(...e){let[t,n,o]=ie.Match(e,{3:(y,E,S)=>[y,E,S],2:(y,E)=>[{},y,E]}),i=xt.Get(),a=of(),c=[],u=new Pn(t,n),l=new Xi(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[Q(u,l,"#","",n,o),c]}function le(...e){let[t,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return _O(t,n,o)}function Vr(...e){let[t,n,o]=ie.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),[i,a]=bO(t,n,o);return a}var Yr=class extends Error{constructor(t,n,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function OO(e,t,n){return s.IsArray(n)?n.map(o=>He(e,t.items,o)):n}function AO(e,t,n){return t.Clean(n)}function SO(e,t,n){return He({...e,...t.$defs},Ue(t.$ref),n)}function fD(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=qt(e);return M(n)?Fs(n,t):n}function xO(e,t,n){let o=fD(t);return He(e,o,n)}function rc(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function RO(e,t,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=rc(t);for(let i of s.Keys(n)){if(s.HasPropertyKey(t.properties,i)){n[i]=He(e,t.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&le(e,o,n[i])){n[i]=He(e,o,n[i]);continue}delete n[i]}return n}function CO(e,t,n){if(!s.IsObject(n))return n;let o=rc(t),[i,a]=[new RegExp(Et(t)),Ye(t)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=He(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&le(e,o,n[c])){n[c]=He(e,o,n[c]);continue}delete n[c]}return n}function PO(e,t,n){return s.HasPropertyKey(e,t.$ref)?He(e,e[t.$ref],n):n}function UO(e,t,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,t.items.length);for(let i=0;i<o;i++)n[i]=He(e,t.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function gD(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=de(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=de(e[n]);return t}function yD(e){return s.IsClassInstance(e)?e:gD(e)}function hD(e){return e.map(t=>de(t))}function ED(e){return e.slice()}function TD(e){return new Map(de([...e.entries()]))}function ID(e){return new Set(de([...e.values()]))}function de(e){return nt.IsTypeArray(e)?ED(e):nt.IsMap(e)?TD(e):nt.IsSet(e)?ID(e):s.IsArray(e)?hD(e):s.IsObject(e)?yD(e):e}function NO(e,t,n){for(let o of t.anyOf){let i=He(e,o,de(n));if(le(e,o,i))return i}return n}function He(e,t,n){return ee(t)?OO(e,t,n):Rt(t)?AO(e,t,n):ue(t)?SO(e,t,n):U(t)?xO(e,t,n):M(t)?RO(e,t,n):Ie(t)?CO(e,t,n):pe(t)?PO(e,t,n):Y(t)?UO(e,t,n):b(t)?NO(e,t,n):n}function Nn(...e){let[t,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return He(t,n,o)}function kO(e,t,n){return s.IsArray(n)?n.map(o=>ke(e,t.items,o)):n}function wO(e,t,n){return t.Convert(n)}var ne={};kt(ne,{Fail:()=>kn,IsOk:()=>Mu,Ok:()=>P,TryBigInt:()=>vu,TryBoolean:()=>GD,TryNull:()=>zD,TryNumber:()=>t$,TryString:()=>c$,TryUndefined:()=>g$});function Mu(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function P(e){return{value:e}}function kn(){}function _D(e){return P(e)}function bD(e){return s.IsEqual(e,!0)?P(BigInt(1)):P(BigInt(0))}function OD(e){return P(BigInt(Math.trunc(e)))}function AD(e){return P(BigInt(0))}var SD=/^-?(0|[1-9]\d*)n$/,xD=/^-?(0|[1-9]\d*)\.\d+$/,RD=/^-?(0|[1-9]\d*)$/;function CD(e){return SD.test(e)}function PD(e){return xD.test(e)}function UD(e){return RD.test(e)}function ND(e){let t=e.toLowerCase();return CD(e)?P(BigInt(e.slice(0,e.length-1))):PD(e)?P(BigInt(e.split(".")[0])):UD(e)?P(BigInt(e)):s.IsEqual(t,"false")?P(BigInt(0)):s.IsEqual(t,"true")?P(BigInt(1)):void 0}function kD(e){return P(BigInt(0))}function vu(e){return s.IsBigInt(e)?_D(e):s.IsBoolean(e)?bD(e):s.IsNumber(e)?OD(e):s.IsNull(e)?AD(e):s.IsString(e)?ND(e):s.IsUndefined(e)?kD(e):void 0}function wD(e){return s.IsEqual(e,BigInt(0))?P(!1):s.IsEqual(e,BigInt(1))?P(!0):void 0}function LD(e){return P(e)}function MD(e){return s.IsEqual(e,0)?P(!1):s.IsEqual(e,1)?P(!0):void 0}function vD(e){return P(!1)}function DD(e){return s.IsEqual(e.toLowerCase(),"false")?P(!1):s.IsEqual(e.toLowerCase(),"true")?P(!0):s.IsEqual(e,"0")?P(!1):s.IsEqual(e,"1")?P(!0):void 0}function $D(e){return P(!1)}function GD(e){return s.IsBigInt(e)?wD(e):s.IsBoolean(e)?LD(e):s.IsNumber(e)?MD(e):s.IsNull(e)?vD(e):s.IsString(e)?DD(e):s.IsUndefined(e)?$D(e):void 0}function jD(e){return s.IsEqual(e,BigInt(0))?P(null):void 0}function qD(e){return s.IsEqual(e,!1)?P(null):void 0}function FD(e){return s.IsEqual(e,0)?P(null):void 0}function BD(e){return P(null)}function HD(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(null):void 0}function KD(e){return P(null)}function zD(e){return s.IsBigInt(e)?jD(e):s.IsBoolean(e)?qD(e):s.IsNumber(e)?FD(e):s.IsNull(e)?BD(e):s.IsString(e)?HD(e):s.IsUndefined(e)?KD(e):void 0}var VD=BigInt(Number.MAX_SAFE_INTEGER),YD=BigInt(Number.MIN_SAFE_INTEGER);function QD(e){return e<=VD&&e>=YD}function LO(e){return QD(e)?P(Number(e)):void 0}function WD(e){return e?P(1):P(0)}function ZD(e){return P(e)}function XD(e){return P(0)}function JD(e){let t=+e;if(s.IsNumber(t))return P(t);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return P(0);if(s.IsEqual(n,"true"))return P(1);let o=vu(e);return Mu(o)?LO(o.value):void 0}function e$(e){return P(0)}function t$(e){return s.IsBigInt(e)?LO(e):s.IsBoolean(e)?WD(e):s.IsNumber(e)?ZD(e):s.IsNull(e)?XD(e):s.IsString(e)?JD(e):s.IsUndefined(e)?e$(e):void 0}function r$(e){return P(e.toString())}function n$(e){return P(e.toString())}function o$(e){return P(e.toString())}function i$(e){return P("null")}function a$(e){return P(e)}function s$(e){return P("")}function c$(e){return s.IsBigInt(e)?r$(e):s.IsBoolean(e)?n$(e):s.IsNumber(e)?o$(e):s.IsNull(e)?i$(e):s.IsString(e)?a$(e):s.IsUndefined(e)?s$(e):void 0}function p$(e){return s.IsEqual(e,BigInt(0))?P(void 0):void 0}function m$(e){return s.IsEqual(e,!1)?P(void 0):void 0}function u$(e){return s.IsEqual(e,0)?P(void 0):void 0}function l$(e){return P(void 0)}function d$(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(void 0):void 0}function f$(e){return P(void 0)}function g$(e){return s.IsBigInt(e)?p$(e):s.IsBoolean(e)?m$(e):s.IsNumber(e)?u$(e):s.IsNull(e)?l$(e):s.IsString(e)?d$(e):s.IsUndefined(e)?f$(e):void 0}function MO(e,t,n){if(s.IsBigInt(n))return n;let o=ne.TryBigInt(n);return ne.IsOk(o)?o.value:n}function vO(e,t,n){if(s.IsBoolean(n))return n;let o=ne.TryBoolean(n);return ne.IsOk(o)?o.value:n}function DO(e,t,n){return ke({...e,...t.$defs},Ue(t.$ref),n)}function nc(e,t,n){if(t.anyOf.some(c=>le(e,c,n)))return n;let a=t.anyOf.map(c=>ke(e,c,de(n))).find(c=>le(e,t,c));return s.IsUndefined(a)?n:a}function $O(e,t,n){let o=gn(t);return nc(e,o,n)}function GO(e,t,n){if(s.IsInteger(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?Math.trunc(o.value):n}function jO(e,t,n){let o=qt(t);return ke(e,o,n)}function y$(e,t,n){let o=ne.TryBigInt(n);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function h$(e,t,n){let o=ne.TryBoolean(n);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function E$(e,t,n){let o=ne.TryNumber(n);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function T$(e,t,n){let o=ne.TryString(n);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function qO(e,t,n){return s.IsEqual(t.const,n)?n:df(t)?y$(e,t,n):ff(t)?h$(e,t,n):Zn(t)?E$(e,t,n):Xn(t)?T$(e,t,n):B()}function FO(e,t,n){if(s.IsNull(n))return n;let o=ne.TryNull(n);return ne.IsOk(o)?o.value:n}function BO(e,t,n){if(s.IsNumber(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?o.value:n}function oc(e,t,n,o){let i=s.Keys(o);for(let[a,c]of t)for(let u of i)a.test(u)||(o[u]=ke(e,n,o[u]));return o}function ra(e,t,n){return we(e)&&s.IsUndefined(n[t])}function I$(e,t,n){let o=s.EntriesRegExp(t.properties),i=s.Keys(n);for(let[a,c]of o)for(let u of i)!a.test(u)||ra(c,u,n)||(n[u]=ke(e,c,n[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?oc(e,o,t.additionalProperties,n):n}function HO(e,t,n){return s.IsObjectNotArray(n)?I$(e,t,n):n}function _$(e,t,n){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let u of i)a.test(u)&&(n[u]=ke(e,c,n[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?oc(e,o,t.additionalProperties,n):n}function KO(e,t,n){return s.IsObjectNotArray(n)?_$(e,t,n):n}function zO(e,t,n){return s.HasPropertyKey(e,t.$ref)?ke(e,e[t.$ref],n):n}function VO(e,t,n){if(s.IsString(n))return n;let o=ne.TryString(n);return ne.IsOk(o)?o.value:n}function YO(e,t,n){let o=Qe(t.pattern);return ke(e,o,n)}function QO(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(t.items.length,n.length);o++)n[o]=ke(e,t.items[o],n[o]);return n}function WO(e,t,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?o.value:n}function ZO(e,t,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?void 0:n}function ke(e,t,n){return ee(t)?kO(e,t,n):Rt(t)?wO(e,t,n):ht(t)?MO(e,t,n):at(t)?vO(e,t,n):ue(t)?DO(e,t,n):xe(t)?$O(e,t,n):Ge(t)?GO(e,t,n):U(t)?jO(e,t,n):Z(t)?qO(e,t,n):zt(t)?FO(e,t,n):Te(t)?BO(e,t,n):M(t)?HO(e,t,n):Ie(t)?KO(e,t,n):pe(t)?zO(e,t,n):Ne(t)?VO(e,t,n):Re(t)?YO(e,t,n):Y(t)?QO(e,t,n):Wt(t)?WO(e,t,n):b(t)?nc(e,t,n):Tt(t)?ZO(e,t,n):n}function Qr(...e){let[t,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return ke(t,n,o)}function XO(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=De(e,t.items,n[o]);return n}function JO(e,t,n){return t.Default(n)}function eA(e,t,n){return De({...e,...t.$defs},Ue(t.$ref),n)}function tA(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():de(e.default):t}function rA(e,t,n){let o=qt(t);return De(e,o,n)}function nA(e,t,n){if(!s.IsObject(n))return n;let o=s.Keys(t.properties);for(let i of o){let a=De(e,t.properties[i],n[i]);s.IsUndefined(a)&&(we(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(n[i]=De(e,t.properties[i],n[i]))}if(!fr(t)||s.IsBoolean(t.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=De(e,t.additionalProperties,n[i]));return n}function oA(e,t,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(Et(t)),Ye(t)];for(let a of s.Keys(n))o.test(a)&&Ut(i)&&(n[a]=De(e,i,n[a]));if(!fr(t))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=De(e,t.additionalProperties,n[a]));return n}function iA(e,t,n){return s.HasPropertyKey(e,t.$ref)?De(e,e[t.$ref],n):n}function aA(e,t,n){if(!s.IsArray(n))return n;let[o,i]=[t.items,Math.max(t.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=De(e,o[a],n[a]));return n}function sA(e,t,n){for(let o of t.anyOf){let i=De(e,o,de(n));if(le(e,o,i))return i}return n}function De(e,t,n){let o=Ut(t)?tA(t,n):n;return ee(t)?XO(e,t,o):Rt(t)?JO(e,t,o):ue(t)?eA(e,t,o):U(t)?rA(e,t,o):M(t)?nA(e,t,o):Ie(t)?oA(e,t,o):pe(t)?iA(e,t,o):Y(t)?aA(e,t,o):b(t)?sA(e,t,o):o}function wn(...e){let[t,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return De(t,n,o)}function Lo(e){return(...t)=>{let[n,o,i]=ie.Match(t,{3:(a,c,u)=>[a,c,u],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function b$(e,t,n){return t["~codec"].decode(n)}function O$(e,t,n){return t["~codec"].encode(n)}function Oe(e,t,n,o){return mn(n)?s.IsEqual(e,"Decode")?b$(t,n,o):O$(t,n,o):o}function A$(e,t,n,o){if(!s.IsArray(o))return B();for(let i=0;i<o.length;i++)o[i]=ye(e,t,n.items,o[i]);return Oe(e,t,n,o)}function S$(e,t,n,o){let i=Oe(e,t,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=ye(e,t,n.items,i[a]);return i}function cA(e,t,n,o){return s.IsEqual(e,"Decode")?A$(e,t,n,o):S$(e,t,n,o)}function pA(e,t,n,o){return o=ye(e,{...t,...n.$defs},Ue(n.$ref),o),Oe(e,t,n,o)}function x$(e,t,n,o){for(let i of n.allOf)o=ye(e,t,i,o);return Oe(e,t,n,o)}function R$(e,t,n,o){let i=Oe(e,t,n,o);for(let a of n.allOf)i=ye(e,t,a,i);return i}function mA(e,t,n,o){return s.IsEqual(e,"Decode")?x$(e,t,n,o):R$(e,t,n,o)}function C$(e,t,n,o){if(!s.IsObjectNotArray(o))return B();for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||ra(n.properties[i],i,o)||(o[i]=ye(e,t,n.properties[i],o[i]));return Oe(e,t,n,o)}function P$(e,t,n,o){let i=Oe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||ra(n.properties[a],a,i)||(i[a]=ye(e,t,n.properties[a],i[a]));return i}function uA(e,t,n,o){return s.IsEqual(e,"Decode")?C$(e,t,n,o):P$(e,t,n,o)}function U$(e,t,n,o){if(!s.IsObjectNotArray(o))return B();let i=new RegExp(Et(n));for(let a of s.Keys(o))i.test(a)||B(),o[a]=ye(e,t,Ye(n),o[a]);return Oe(e,t,n,o)}function N$(e,t,n,o){let i=Oe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(Et(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=ye(e,t,Ye(n),i[c]));return i}function lA(e,t,n,o){return s.IsEqual(e,"Decode")?U$(e,t,n,o):N$(e,t,n,o)}function dA(e,t,n,o){return o=s.HasPropertyKey(t,n.$ref)?ye(e,t,t[n.$ref],o):o,Oe(e,t,n,o)}function k$(e,t,n,o){if(!s.IsArray(o))return B();for(let i=0;i<Math.min(n.items.length,o.length);i++)o[i]=ye(e,t,n.items[i],o[i]);return Oe(e,t,n,o)}function w$(e,t,n,o){let i=Oe(e,t,n,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(n.items.length,i.length);a++)i[a]=ye(e,t,n.items[a],i[a]);return i}function fA(e,t,n,o){return s.IsEqual(e,"Decode")?k$(e,t,n,o):w$(e,t,n,o)}function L$(e,t,n,o){for(let i of n.anyOf){if(!le(t,i,o))continue;let a=ye(e,t,i,o);return Oe(e,t,n,a)}return B()}function M$(e,t,n,o){let i=Oe(e,t,n,o);for(let a of n.anyOf){let c=ye(e,t,a,de(i));if(le(t,a,c))return c}return i}function gA(e,t,n,o){return s.IsEqual(e,"Decode")?L$(e,t,n,o):M$(e,t,n,o)}function ye(e,t,n,o){return ee(n)?cA(e,t,n,o):ue(n)?pA(e,t,n,o):U(n)?mA(e,t,n,o):M(n)?uA(e,t,n,o):Ie(n)?lA(e,t,n,o):pe(n)?dA(e,t,n,o):Y(n)?fA(e,t,n,o):b(n)?gA(e,t,n,o):Oe(e,t,n,o)}var Du=class extends Yr{constructor(t,n){super("Decode",t,n)}};function v$(e,t,n){if(!le(e,t,n))throw new Du(n,Vr(e,t,n));return n}function D$(e,t,n){return ye("Decode",e,t,n)}var Uwe=Lo([(e,t,n)=>de(n),(e,t,n)=>wn(e,t,n),(e,t,n)=>Qr(e,t,n),(e,t,n)=>Nn(e,t,n),(e,t,n)=>v$(e,t,n),(e,t,n)=>D$(e,t,n)]);var $u=class extends Yr{constructor(t,n){super("Encode",t,n)}};function $$(e,t,n){if(!le(e,t,n))throw new $u(n,Vr(e,t,n));return n}function G$(e,t,n){return ye("Encode",e,t,n)}var Fwe=Lo([(e,t,n)=>de(n),(e,t,n)=>G$(e,t,n),(e,t,n)=>wn(e,t,n),(e,t,n)=>Qr(e,t,n),(e,t,n)=>Nn(e,t,n),(e,t,n)=>$$(e,t,n)]);var Mt=class extends Error{constructor(t,n){super(n),this.type=t}};function yA(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?de(t.default):t.default}function hA(e,t){if(No(t)&&!Ut(t))throw new Mt(t,"Arrays with uniqueItems constraints must specify a default annotation");let n=Po(t)?t.minItems:0;return Array.from({length:n},()=>he(e,t.items))}async function*j$(){}function EA(e,t){return j$()}function TA(e,t){return t.Create()}function IA(e,t){return gr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):yr(t)?BigInt(t.minimum):BigInt(0)}function _A(e,t){return!1}function bA(e,t){let n=he(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function OA(e,t){return he({...e,...t.$defs},Ue(t.$ref))}function AA(e,t){return he(e,gn(t))}function SA(e,t){let n=he(e,t.returnType);return()=>n}function xA(e,t){return gr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:yr(t)?t.minimum:0}function RA(e,t){return he(e,qt(t))}function*q$(){}function CA(e,t){return q$()}function PA(e,t){return t.const}function UA(e,t){throw new Mt(t,"Cannot create TNever types")}function NA(e,t){return null}function kA(e,t){return gr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:yr(t)?t.minimum:0}function wA(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:he(e,t.properties[i])}),{})}function LA(e,t){return Promise.resolve(he(e,t.item))}function MA(e,t){if(Yi(t)&&!Ut(t))throw new Mt(t,"Record with the minProperties constraint must have a default annotation");return{}}function vA(e,t){return s.HasPropertyKey(e,t.$ref)?he(e,e[t.$ref]):(()=>{throw new Mt(t,"Unable to deref Ref")})()}function DA(e,t){if((Qi(t)||zi(t))&&!Ut(t))throw Error("Strings with format or pattern constraints must specify default");let o=Vi(t)?t.minLength:0;return"".padEnd(o)}function $A(e,t){return Symbol()}function GA(e,t){let n=Qe(t.pattern);if(Ne(n))throw new Mt(t,"Unable to create TemplateLiteral due to infinite type expansion");return he(e,n)}function jA(e,t){return Array.from({length:t.minItems},(n,o)=>he(e,t.items[o]))}function qA(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return he(e,t.anyOf[0])}function he(e,t){return Ut(t)?yA(e,t):ee(t)?hA(e,t):et(t)?EA(e,t):Rt(t)?TA(e,t):ht(t)?IA(e,t):at(t)?_A(e,t):Le(t)?bA(e,t):ue(t)?OA(e,t):xe(t)?AA(e,t):Me(t)?SA(e,t):Ge(t)?xA(e,t):U(t)?RA(e,t):tt(t)?CA(e,t):Z(t)?PA(e,t):ar(t)?UA(e,t):zt(t)?NA(e,t):Te(t)?kA(e,t):M(t)?wA(e,t):Ve(t)?LA(e,t):Ie(t)?MA(e,t):pe(t)?vA(e,t):Ne(t)?DA(e,t):Vt(t)?$A(e,t):Re(t)?GA(e,t):Y(t)?jA(e,t):Wt(t)?void 0:b(t)?qA(e,t):Tt(t)?void 0:void 0}function tr(...e){let[t,n]=ie.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return he(t,n)}var Gu=class extends Yr{constructor(t,n){super("Parse",t,n)}};function F$(e,t,n){if(!le(e,t,n))throw new Gu(n,Vr(e,t,n));return n}var V0e=Lo([(e,t,n)=>de(n),(e,t,n)=>wn(e,t,n),(e,t,n)=>Qr(e,t,n),(e,t,n)=>Nn(e,t,n),(e,t,n)=>F$(e,t,n)]);var H$=N({type:V("insert"),path:ft(),value:Ke()}),K$=Object({type:V("update"),path:ft(),value:Ke()}),z$=N({type:V("delete"),path:ft()}),eve=G([H$,K$,z$]);function Mo(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:tr(t)}function na(e,t,n,o,i){e.command(t).description(n).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){oe(Mo(o));return}let c=Ro(a),u=await i()(o,{body:c});oe(u)})}function HA(e,t){let n=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");na(n,"promql","Run a PromQL query (experimental)",Y_,t)}var W$=`/${"v1"}/feedback`,Z$=r.Object({id:r.String({description:"Identifier of the recorded feedback (matches the API request ID)."})},{$id:"Feedback",description:"A recorded piece of feedback"}),X$=r.Object({content:m({allowEmpty:!1,type:"long",description:"The feedback message."})}),KA=d({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:["feedback"],url:W$,method:"POST",body:X$,response:Z$});function zA(e,t){e.command("feedback <message...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async n=>{let o=await t()(KA,{body:{content:n.join(" ")}});oe(o)})}var J$={investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","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"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"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:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{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:{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"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{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"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{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-members":{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:[]}},eG={investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{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"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-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"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{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:[]}},tG={user:J$,team:eG};function qu(e){return VA(e,"team")}function Fu(e){return VA(e,"user")}function VA(e,t){let n=[],o=tG[t];for(let[i,a]of Object.entries(o))for(let[c,u]of Object.entries(a))u.includes(e)&&n.push({actionType:c,resourceType:i});return n}var X$e={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Fu("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:Fu("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Fu("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},J$e={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:qu("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:qu("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:qu("viewer"),roleKey:"viewer"}};var Bu=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Hu=["light","dark"];var rG={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)"}},YA=["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 iGe=rG.light.red.background;var QA=[{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:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{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-----
|
|
125
|
+
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(r=>{let{rows:n,valueFlags:o}=UG(e);if(r==="bash")B(wG(vb(n),o));else if(r==="zsh")B(NG(vb(n),o));else if(r==="fish")B(vG(LG(n),o));else throw new Error(`Unsupported shell "${r}". Supported: bash, zsh, fish.`)})}function Db(e){let r=e.command("config").description("Show or manage configuration");r.action(()=>{let n=e.opts(),o=vo({operationApiKey:n.operationApiKey,clusterId:n.cluster});B(Tb(o,ca()).trimEnd())}),r.command("set").description("Set a configuration value").command("default <key> <value>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((n,o)=>{yb(n,o),B(`Default set: ${n} = ${o}`)}),r.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{hb(),B("Custom defaults cleared")})}var Gb=`/${"v1"}/docs`,$b=t.Object({path:t.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:t.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:t.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),kG={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
126
|
+
...`};Object.assign($b,{examples:[kG]});var jb=t.Object({kind:t.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:t.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:t.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:t.Optional(t.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:t.Optional(t.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:t.Optional(t.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:t.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:t.String({description:"Short snippet of matching content"}),link:t.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`."})},{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),MG={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://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(jb,{examples:[MG]});var qb=d({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:Gb,method:"GET",query:t.Object({path:p({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:$b}),Bb=d({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${Gb}/search`,method:"GET",query:t.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:t.Array(jb)});function Fb(e,r){let n=e.command("docs").description("Browse and search documentation");n.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await r()(qb,{query:{path:o}});W(i)}),n.command("search <query>").description("Search documentation pages").action(async o=>{let i=await r()(Bb,{query:{query:o}});W(i)})}var Hb=t.Object({type:t.Literal("number"),number:t.String()}),DG=t.Object({type:t.Literal("string"),string:t.String()}),GG=t.Object({type:t.Literal("timestamp"),timestamp:t.String()}),ua=b("type",[Hb,DG,GG]),$G=t.Object({by:t.Record(t.String(),ua),computed:t.Record(t.String(),Hb)}),jG=t.Object({type:t.Literal("buckets"),buckets:t.Array($G)}),qG=t.Object({type:t.Literal("distribution"),bounds:t.Array(t.Number()),buckets:t.Array(t.Object({timestamp:t.Number(),counts:t.Array(t.Number())})),percentiles:t.Optional(t.Array(t.Number()))}),xc=b("type",[jG,qG]);var BG=["all","owning-team-and-public","owning-team-only"],rn=t.Enum(BG,{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 zb=1456444800,Yb=4927737600,FG=zb*1e3,HG=Yb*1e3,Rc=1704067200,Xu=Rc*1e3,Vb={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Rc,to:Rc}]},KG={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:Xu,to:Xu}]},Cc=e=>t.Integer({description:e,examples:[Rc],minimum:zb,maximum:Yb,format:"int64"}),Kb=e=>t.Integer({description:e,examples:[Xu],minimum:FG,maximum:HG,format:"int64"}),He=t.Object({from:t.Optional(Cc("Start of the query window as a Unix timestamp in seconds")),to:t.Optional(Cc("End of the query window as a Unix timestamp in seconds"))},Vb),ut=t.Object({from:Cc("Start of the query window as a Unix timestamp in seconds"),to:Cc("End of the query window as a Unix timestamp in seconds")},Vb),Pc=t.Object({from:Kb("Start of the query window as a Unix timestamp in milliseconds"),to:Kb("End of the query window as a Unix timestamp in milliseconds")},KG);var VG="/v0/aggregation",QG=t.Union([t.Literal("a"),t.Literal("d"),t.Literal("q"),t.Literal("w"),t.Literal("t")]),em=t.Object({parallelism:t.Number(),engine:QG,recordBatchCache:t.Optional(t.Boolean()),includeNullGroups:t.Optional(t.Boolean()),restartAwareGaugeSum:t.Optional(t.Boolean())}),tm=["logs","metrics","traces"];var Zb={logs:"Logs",metrics:"Metrics",traces:"Traces"},WG=[...tm,"connections","log-patterns","rum"];var F_e={...Zb,connections:"Connections","log-patterns":"Log Patterns",rum:"RUM events"},ir=[...tm,"rum"];var H_e={...Zb,rum:"RUM events"};var K_e=t.Enum(WG,{description:"Data source being queried"}),ar=t.Enum(tm,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Uc=t.Enum(ir,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Ln=t.String({description:"Attribute containing the values to aggregate"}),vn=p({description:"Attribute containing the values to aggregate"}),ZG=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(Ln)},{$id:"AggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Ln},{$id:"AggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:Ln},{$id:"AggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:Ln},{$id:"AggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:Ln},{$id:"AggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:Ln},{$id:"AggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Ln,percentile:t.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$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`."}),XG=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(vn)},{$id:"InputAggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:vn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:vn},{$id:"InputAggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:vn},{$id:"InputAggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:vn},{$id:"InputAggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:vn},{$id:"InputAggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:vn,percentile:t.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$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`."}),Xb=t.Object({type:t.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),Jb=t.Object({type:t.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),eS=t.Object({type:t.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),tS=t.Object({type:t.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),rS=t.Object({type:t.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"}),nS=t.Object({type:t.Literal("power",{description:"Raises values to a specified power"}),exponent:t.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),oS=t.Object({type:t.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),iS=t.Object({type:t.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),JG=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:t.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),e$=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:p({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),t$=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),r$=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),n$=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),o$=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),i$=b("type",[Xb,Jb,eS,tS,rS,JG,t$,nS,oS,iS,n$],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),a$=b("type",[Xb,Jb,eS,tS,rS,e$,r$,nS,oS,iS,o$],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var Qb=t.Object({min:t.Number({description:"Lower bound of the distribution range."}),max:t.Number({description:"Upper bound of the distribution range."})}),s$=["linear","log"],wc=t.Enum(s$),Wb=t.Integer({minimum:1}),c$=b("type",[t.Object({type:t.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),t.Object({type:t.Literal("timeseries"),aggregationWindow:p({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),t.Object({type:t.Literal("histogram"),by:t.Optional(p()),bucketCount:t.Optional(Wb),bounds:t.Optional(Qb),boundsScale:t.Optional(wc),percentiles:t.Optional(t.Array(t.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),t.Object({type:t.Literal("heatmap"),aggregationWindow:p({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:t.Optional(p()),bucketCount:t.Optional(Wb),bounds:t.Optional(Qb)},{title:"Heatmap",description:"Returns a distribution per time window"})]),ma=15,p$=["zero","null"],u$=t.Enum(p$,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),aS=t.Object({mode:t.Object({type:u$},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),sS={aggregate:ZG,functions:t.Optional(t.Array(i$,{description:"Post-processing functions applied to aggregation results"})),fill:t.Optional(aS)},cS={aggregate:XG,functions:t.Optional(t.Array(a$,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted. Limited to 10 items."})),fill:t.Optional(aS)},m$={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."},pS={maxItems:ma,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. Limited to ${ma} items. 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").`},uS=t.Array(t.Object({...sS,filter:t.Optional(t.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),m$),la=t.Array(t.Object({...cS,filter:t.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),pS),Tr=t.Array(t.Object({...sS,filter:t.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),Er=t.Array(t.Object({...cS,filter:p({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"}),{...pS,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var Nc=t.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),kn=p({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."}),l$=t.Object({fields:t.Array(t.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),d$=t.Object({fields:t.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),Ju=7;var Mo=t.Array(l$,{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."}),Ir=t.Array(d$,{maxItems:Ju,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. Limited to ${Ju} levels.`});var z_e=d({tags:["aggregation"],url:`${VG}/multi-query`,method:"POST",body:t.Object({timeRange:Pc,queries:la,groupBy:t.Optional(Ir),returnType:c$,dataSource:Uc,formula:kn,executionOptions:em,triggeredBy:t.Optional(t.Literal("refresh")),shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1})),viewAs:t.Optional(t.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:rn}))}),response:xc});var f$=t.Union([t.Literal("scalar"),t.Literal("timeseries")]),g$="/v0/promql",Lc=t.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Pc,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:t.Optional(f$),executionOptions:em,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),y$={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(Lc,{examples:[y$]});var ebe=d({tags:["promql"],url:g$,method:"POST",body:Lc,response:xc});var mS=`/${"v1"}/aggregation`,lS=t.Object({id:t.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:t.Record(t.String(),t.Union([t.String(),t.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),dS=t.Object({results:t.Array(t.Object({...lS.properties,value:t.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."}),h$={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(dS,{examples:[h$]});var vc=t.Object({series:t.Array(t.Object({...lS.properties,points:t.Array(t.Object({timestamp:t.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:t.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."}),T$={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(vc,{examples:[T$]});var E$=t.Omit(la.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),I$=t.Optional(Ir),fS={timeRange:ut,queries:t.Array(E$,{maxItems:ma,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. Limited to ${ma} items. 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:I$,dataSource:ar,formula:t.Optional(kn)},gS=t.Object({clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),yS=t.Object(fS,{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."}),_$={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(yS,{examples:[_$]});var hS=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${mS}/multi-query/scalar`,method:"POST",body:yS,query:gS,response:dS}),TS=t.Object({...fS,aggregationWindow:p({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{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."}),b$={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(TS,{examples:[b$]});var ES=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${mS}/multi-query/timeseries`,method:"POST",body:TS,query:gS,response:vc});var S$=`/${"v1"}/promql`,O$=t.Object({...t.Pick(Lc,["query","step"]).properties,timeRange:ut},{description:"PromQL range-query request. The client supplies query, timeRange, and step. 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"}]}),A$=t.Object({clusterId:t.Optional(p({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."}))}),IS=d({description:"Runs an experimental PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:S$,method:"POST",body:O$,query:A$,response:vc});var _S=df(require("node:fs"));function Do(e){if(e.file){let r=_S.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(r)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function x$(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function rm(e){return s.HasPropertyKey(e,"~guard")&&x$(e["~guard"])}function nm(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,r=>s.IsObject(r)&&s.HasPropertyKey(r,"refine")&&s.HasPropertyKey(r,"message")&&s.IsFunction(r.refine)&&s.IsString(r.message))}function _r(e){return s.IsObject(e)&&!s.IsArray(e)}function kc(e){return s.IsBoolean(e)}function G(e){return _r(e)||kc(e)}function om(e){return s.HasPropertyKey(e,"additionalItems")&&G(e.additionalItems)}function br(e){return s.HasPropertyKey(e,"additionalProperties")&&G(e.additionalProperties)}function im(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(r=>G(r))}function da(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function am(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(r=>G(r))}function sm(e){return s.HasPropertyKey(e,"const")}function Mn(e){return s.HasPropertyKey(e,"contains")&&G(e.contains)}function wt(e){return s.HasPropertyKey(e,"default")}function cm(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(r=>G(r)||s.IsArray(r)&&r.every(n=>s.IsString(n)))}function pm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(r=>s.IsArray(r)&&r.every(n=>s.IsString(n)))}function um(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(r=>G(r))}function mm(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function lm(e){return s.HasPropertyKey(e,"else")&&G(e.else)}function dm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function fm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Sr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function fa(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function Dn(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function gm(e){return s.HasPropertyKey(e,"if")&&G(e.if)}function Go(e){return s.HasPropertyKey(e,"items")&&(G(e.items)||s.IsArray(e.items)&&e.items.every(r=>G(r)))}function ym(e){return Go(e)&&s.IsArray(e.items)}function hm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Tm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Mc(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Em(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Im(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Or(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Gn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function $o(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function ga(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ya(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function _m(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function bm(e){return s.HasPropertyKey(e,"not")&&G(e.not)}function Sm(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(r=>G(r))}function ha(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ta(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(r=>G(r))}function jo(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(r=>G(r))}function Ea(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(r=>G(r))}function Om(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||G(e.propertyNames))}function R$(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Dc(e){return R$(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Am(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function xm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function $n(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(r=>s.IsString(r))}function Rm(e){return s.HasPropertyKey(e,"then")&&G(e.then)}function Cm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(r=>s.IsString(r)))}function qo(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Gc(e){return s.HasPropertyKey(e,"unevaluatedItems")&&G(e.unevaluatedItems)}function $c(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&G(e.unevaluatedProperties)}var lt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(r){return this.indices.add(r),!0}AddKey(r){return this.keys.add(r),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(r){for(let n of r)n.indices.forEach(o=>this.indices.add(o)),n.keys.forEach(o=>this.keys.add(o));return!0}},Ia=class extends lt{constructor(r){super(),this.callback=r}AddError(r){return this.callback(r),!1}},Ke=class extends Ia{constructor(){super(r=>this.errors.push(r)),this.errors=[]}AddError(r){return this.errors.push(r),!1}GetErrors(){return this.errors}};var C$="external_",P$=0,qAe={identifier:`${C$}${P$}`,variables:[]};function bS(e,r,n,o){return n["~guard"].check(o)}function SS(e,r,n,o,i,a){return i["~guard"].check(a)||r.AddError({keyword:"~guard",schemaPath:n,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function OS(e,r,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function AS(e,r,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,m)=>c.refine(a)||r.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:m,message:c.message}}))}function xS(e){return Go(e)&&s.IsArray(e.items)}function RS(e,r,n,o){return xS(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||D(e,r,n.additionalItems,a)&&r.AddIndex(c)):!0}function CS(e,r,n,o,i,a){return xS(i)?a.every((m,l)=>{let f=`${n}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||Z(e,r,f,y,i.additionalItems,m)&&r.AddIndex(l)}):!0}function U$(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function PS(e){let r=[];return Ta(e)&&r.push(...s.Keys(e.patternProperties)),Ea(e)&&r.push(...s.Keys(e.properties).map(U$)),s.IsEqual(r.length,0)?"(?!)":`(${r.join("|")})`}function US(e,r,n,o){let i=new RegExp(PS(n));return s.Every(s.Keys(o),0,(c,m)=>i.test(c)||D(e,r,n.additionalProperties,o[c])&&r.AddKey(c))}function wS(e,r,n,o,i,a){let c=new RegExp(PS(i)),m=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let E=`${n}/additionalProperties`,A=`${o}/${f}`,ye=new Ke,Ue=c.test(f)||Z(e,ye,E,A,i.additionalProperties,a[f])&&r.AddKey(f);return Ue||m.push(f),Ue})||r.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:m}})}function NS(e,r,n,o){let i=n.allOf.reduce((a,c)=>{let m=new lt;return D(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&r.Merge(i)}function LS(e,r,n,o,i,a){let c=[],m=i.allOf.reduce((f,y,E)=>{let A=`${n}/allOf/${E}`,ye=new Ke,Ue=Z(e,ye,A,o,y,a);return Ue||c.push(ye),Ue?[...f,ye]:f},[]),l=s.IsEqual(m.length,i.allOf.length)&&r.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),l}function vS(e,r,n,o){let i=n.anyOf.reduce((a,c,m)=>{let l=new lt;return D(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&r.Merge(i)}function kS(e,r,n,o,i,a){let c=[],m=i.anyOf.reduce((f,y,E)=>{let A=new Ke,ye=`${n}/anyOf/${E}`,Ue=Z(e,A,ye,o,y,a);return Ue||c.push(A),Ue?[...f,A]:f},[]),l=s.IsGreaterThan(m.length,0)&&r.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),l||r.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Um(e,r,n,o){return n}function MS(e,r,n,o,i,a){return Um(e,r,i,a)||r.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function wm(e,r,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function DS(e,r,n,o,i,a){return wm(e,r,i,a)||r.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function w$(e){return!(Gn(e)&&s.IsEqual(e.minContains,0))}function Nm(e,r,n,o){return w$(n)?!s.IsEqual(o.length,0)&&o.some(i=>D(e,r,n.contains,i)):!0}function GS(e,r,n,o,i,a){return Nm(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function $S(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,m])=>!s.HasPropertyKey(o,c)||(s.IsArray(m)?m.every(l=>s.HasPropertyKey(o,l)):D(e,r,m,o)));return i||a}function jS(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${n}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||r.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})):Z(e,r,y,o,f,a))});return c||m}function qS(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,m])=>!s.HasPropertyKey(o,c)||m.every(l=>s.HasPropertyKey(o,l)));return i||a}function BS(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||r.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})));return c||m}function FS(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,m])=>!s.HasPropertyKey(o,c)||D(e,r,m,o));return i||a}function HS(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${n}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||Z(e,r,y,o,f,a)});return c||m}function Lm(e,r,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function KS(e,r,n,o,i,a){return Lm(e,r,i,a)||r.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function vm(e,r,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function zS(e,r,n,o,i,a){return vm(e,r,i,a)||r.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function km(e,r,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function YS(e,r,n,o,i,a){return km(e,r,i,a)||r.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Fo={};vt(Fo,{Clear:()=>QS,Entries:()=>W$,Get:()=>J$,Has:()=>X$,IsDate:()=>_a,IsDateTime:()=>Mm,IsDuration:()=>Dm,IsEmail:()=>Gm,IsHostname:()=>$m,IsIPv4:()=>Fm,IsIPv6:()=>Hm,IsIdnEmail:()=>jm,IsIdnHostname:()=>Bm,IsIri:()=>zm,IsIriReference:()=>Km,IsJsonPointer:()=>Vm,IsJsonPointerUriFragment:()=>Ym,IsRegex:()=>Qm,IsRelativeJsonPointer:()=>Wm,IsTime:()=>ba,IsUri:()=>Jm,IsUriReference:()=>Zm,IsUriTemplate:()=>Xm,IsUrl:()=>el,IsUuid:()=>tl,Reset:()=>WS,Set:()=>Z$,Test:()=>e1});var N$=[0,31,28,31,30,31,30,31,31,30,31,30,31],L$=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function v$(e){return e%4===0&&(e%100!==0||e%400===0)}function _a(e){let r=L$.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&v$(n)?29:N$[o])}var k$=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function ba(e,r=!0){let n=k$.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,m=+(n[5]||0),l=+(n[6]||0);if(m>23||l>59||r&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*c,y=o-m*c-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Mm(e,r=!0){let n=e.split(/T/i);return n.length===2&&_a(n[0])&&ba(n[1],r)}var M$=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Dm(e){return M$.test(e)}var D$=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function Gm(e){return D$.test(e)}var G$=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;function $m(e){return G$.test(e)}var $$=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function jm(e){return $$.test(e)}function qm(e){let r=e.codePointAt(0);return r===void 0?!1:r>=12352&&r<=12447||r>=12448&&r<=12543&&r!==12539||r>=19968&&r<=40959}function Bm(e){if(e.length===0||e.includes(" "))return!1;let r=/[\u002E\u3002\uFF0E\uFF61]/g,n=e.normalize("NFC").replace(r,".");if(n.length>253)return!1;let o=n.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),E=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(E))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!qm(y))return!1}else{let y=i.charAt(l-1),E=i.charAt(l+1);if(!qm(y)||!qm(E))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let c=!1,m=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(m=!0)}if(c&&m)return!1}return!0}var j$=/^(?:(?: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 Fm(e){return j$.test(e)}var q$=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function Hm(e){return q$.test(e)}function VS(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Km(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let r=e.indexOf(":");return r>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,r))?VS(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&r===-1?!1:VS(e)}function zm(e){try{return new URL(e),!0}catch{return!1}}var B$=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Ym(e){return B$.test(e)}var F$=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function Vm(e){return F$.test(e)}function Qm(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var H$=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Wm(e){return H$.test(e)}var K$=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Zm(e){return K$.test(e)}var z$=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function Xm(e){return z$.test(e)}var Y$=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Jm(e){return Y$.test(e)}var V$=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function el(e){return V$.test(e)}var Q$=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function tl(e){return Q$.test(e)}var ge=new Map;function QS(){ge.clear()}function W$(){return[...ge.entries()]}function Z$(e,r){ge.set(e,r)}function X$(e){return ge.has(e)}function J$(e){return ge.get(e)}function e1(e,r){return ge.get(e)?.(r)??!0}function WS(){QS(),ge.set("date-time",Mm),ge.set("date",_a),ge.set("duration",Dm),ge.set("email",Gm),ge.set("hostname",$m),ge.set("idn-email",jm),ge.set("idn-hostname",Bm),ge.set("ipv4",Fm),ge.set("ipv6",Hm),ge.set("iri-reference",Km),ge.set("iri",zm),ge.set("json-pointer-uri-fragment",Ym),ge.set("json-pointer",Vm),ge.set("regex",Qm),ge.set("relative-json-pointer",Wm),ge.set("time",ba),ge.set("uri-reference",Zm),ge.set("uri-template",Xm),ge.set("uri",Jm),ge.set("url",el),ge.set("uuid",tl)}WS();function rl(e,r,n,o){return Fo.Test(n.format,o)}function ZS(e,r,n,o,i,a){return rl(e,r,i,a)||r.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function XS(e,r,n,o){let i=Rm(n)?n.then:!0,a=lm(n)?n.else:!0;return D(e,r,n.if,o)?D(e,r,i,o):D(e,r,a,o)}function JS(e,r,n,o,i,a){let c=Rm(i)?i.then:!0,m=lm(i)?i.else:!0,l=new Ke,f=Z(e,l,`${n}/if`,o,i.if,a)?Z(e,l,`${n}/then`,o,c,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):Z(e,r,`${n}/else`,o,m,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&r.Merge([l]),f}function t1(e,r,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,r,i,o[a])&&r.AddIndex(a))}function r1(e,r,n,o,i,a){return s.EveryAll(i.items,0,(c,m)=>{let l=`${n}/items/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||Z(e,r,l,f,c,a[m])&&r.AddIndex(m)})}function n1(e,r,n,o){let i=jo(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>D(e,r,n.items,a)&&r.AddIndex(c))}function o1(e,r,n,o,i,a){let c=jo(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(m,l)=>{let f=`${n}/items`,y=`${o}/${l}`;return Z(e,r,f,y,i.items,m)&&r.AddIndex(l)})}function eO(e,r,n,o){return ym(n)?t1(e,r,n,o):n1(e,r,n,o)}function tO(e,r,n,o,i,a){return ym(i)?r1(e,r,n,o,i,a):o1(e,r,n,o,i,a)}function i1(e){return Mn(e)}function nl(e,r,n,o){if(!i1(n))return!0;let i=o.reduce((a,c)=>D(e,r,n.contains,c)?++a:a,0);return s.IsLessEqualThan(i,n.maxContains)}function rO(e,r,n,o,i,a){let c=Gn(i)?i.minContains:1;return nl(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function ol(e,r,n,o){return s.IsLessEqualThan(o,n.maximum)}function nO(e,r,n,o,i,a){return ol(e,r,i,a)||r.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function il(e,r,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function oO(e,r,n,o,i,a){return il(e,r,i,a)||r.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function al(e,r,n,o){return s.IsMaxLength(o,n.maxLength)}function iO(e,r,n,o,i,a){return al(e,r,i,a)||r.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function sl(e,r,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function aO(e,r,n,o,i,a){return sl(e,r,i,a)||r.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function a1(e){return Mn(e)}function cl(e,r,n,o){if(!a1(n))return!0;let i=o.reduce((a,c)=>D(e,r,n.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,n.minContains)}function sO(e,r,n,o,i,a){return cl(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function pl(e,r,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function cO(e,r,n,o,i,a){return pl(e,r,i,a)||r.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function ul(e,r,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function pO(e,r,n,o,i,a){return ul(e,r,i,a)||r.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function ml(e,r,n,o){return s.IsMinLength(o,n.minLength)}function uO(e,r,n,o,i,a){return ml(e,r,i,a)||r.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function ll(e,r,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function mO(e,r,n,o,i,a){return ll(e,r,i,a)||r.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function dl(e,r,n,o){return s.IsMultipleOf(o,n.multipleOf)}function lO(e,r,n,o,i,a){return dl(e,r,i,a)||r.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function fl(e,r,n,o){let i=new lt;return!D(e,i,n.not,o)&&r.Merge([i])}function dO(e,r,n,o,i,a){return fl(e,r,i,a)||r.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function fO(e,r,n,o){let i=n.oneOf.reduce((a,c)=>{let m=new lt;return D(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,1)&&r.Merge(i)}function gO(e,r,n,o,i,a){let c=[],m=[],l=i.oneOf.reduce((y,E,A)=>{let ye=new Ke,Ue=`${n}/oneOf/${A}`,vr=Z(e,ye,Ue,o,E,a);return vr&&m.push(A),vr||c.push(ye),vr?[...y,ye]:y},[]),f=s.IsEqual(l.length,1)&&r.Merge(l);return!f&&s.IsEqual(m.length,0)&&c.forEach(y=>y.GetErrors().forEach(E=>r.AddError(E))),f||r.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:m}})}function gl(e,r,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function yO(e,r,n,o,i,a){return gl(e,r,i,a)||r.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function hO(e,r,n,o){return s.Every(s.Entries(n.patternProperties),0,([i,a])=>{let c=new RegExp(i);return s.Every(s.Entries(o),0,([m,l])=>!c.test(m)||D(e,r,a,l)&&r.AddKey(m))})}function TO(e,r,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,m])=>{let l=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([y,E])=>{let A=`${o}/${y}`;return!f.test(y)||Z(e,r,l,A,m,E)&&r.AddKey(y)})})}function EO(e,r,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,r,i,o[a])&&r.AddIndex(a))}function IO(e,r,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,m)=>{let l=`${n}/prefixItems/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||Z(e,r,l,f,c,a[m])&&r.AddIndex(m)})}function yl(e,r){return e.includes(r)||Rt.Get().exactOptionalPropertyTypes}function hl(e,r){return s.IsUndefined(e[r])}function _O(e,r,n,o){let i=$n(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,m])=>{let l=!s.HasPropertyKey(o,c)||D(e,r,m,o[c])&&r.AddKey(c);return yl(i,c)?l:hl(o,c)||l})}function bO(e,r,n,o,i,a){let c=$n(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${n}/properties/${l}`,E=`${o}/${l}`,A=()=>!s.HasPropertyKey(a,l)||Z(e,r,y,E,f,a[l])&&r.AddKey(l);return yl(c,l)?A():hl(a,l)||A()})}function SO(e,r,n,o){return s.Every(s.Keys(o),0,(i,a)=>D(e,r,n.propertyNames,i))}function OO(e,r,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,E=`${n}/propertyNames`,A=new Ke,ye=Z(e,A,E,y,i.propertyNames,l);return ye||c.push(l),ye})||r.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function AO(e,r,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return G(i)&&D(e,r,i,o)}function xO(e,r,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return G(c)&&Z(e,r,"#",o,c,a)}function PO(e,r,n,o){let i=e.Ref(n.$ref)??!1,a=new lt,c=G(i)&&D(e,a,i,o);return c&&r.Merge([a]),c}function UO(e,r,n,o,i,a){let c=e.Ref(i.$ref)??!1,m=new Ke,l=G(c)&&Z(e,m,"#",o,c,a);return l&&r.Merge([m]),l||m.GetErrors().forEach(f=>r.AddError(f)),l}function wO(e,r,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function NO(e,r,n,o,i,a){let c=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||c.push(l),f})||r.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function Tl(e,r,n,o,i){return s.IsEqual(n,"object")?s.IsObjectNotArray(i):s.IsEqual(n,"array")?s.IsArray(i):s.IsEqual(n,"boolean")?s.IsBoolean(i):s.IsEqual(n,"integer")?s.IsInteger(i):s.IsEqual(n,"number")?s.IsNumber(i):s.IsEqual(n,"null")?s.IsNull(i):s.IsEqual(n,"string")?s.IsString(i):s.IsEqual(n,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(n,"bigint")?s.IsBigInt(i):s.IsEqual(n,"constructor")?s.IsConstructor(i):s.IsEqual(n,"function")?s.IsFunction(i):s.IsEqual(n,"iterator")?s.IsIterator(i):s.IsEqual(n,"symbol")?s.IsSymbol(i):s.IsEqual(n,"undefined")?s.IsUndefined(i):s.IsEqual(n,"void")?s.IsUndefined(i):!0}function LO(e,r,n,o,i){return n.some(a=>Tl(e,r,a,o,i))}function vO(e,r,n,o){return s.IsArray(n.type)?LO(e,r,n.type,n,o):Tl(e,r,n.type,n,o)}function kO(e,r,n,o,i,a){return(s.IsArray(i.type)?LO(e,r,i.type,i,a):Tl(e,r,i.type,i,a))||r.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function MO(e,r,n,o){let i=r.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||D(e,r,n.unevaluatedItems,a))&&r.AddIndex(c))}function DO(e,r,n,o,i,a){let c=r.GetIndices(),m=[];return s.EveryAll(a,0,(f,y)=>{let E=new Ke,A=(c.has(y)||Z(e,E,n,o,i.unevaluatedItems,f))&&r.AddIndex(y);return A||m.push(y),A})||r.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:m}})}function GO(e,r,n,o){let i=r.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||D(e,r,n.unevaluatedProperties,c)&&r.AddKey(a))}function $O(e,r,n,o,i,a){let c=r.GetKeys(),m=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let E=new Ke,A=c.has(f)||Z(e,E,n,o,i.unevaluatedProperties,y)&&r.AddKey(f);return A||m.push(f),A})||r.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:m}})}function jO(e){return!s.IsEqual(e.uniqueItems,!1)}function qO(e,r,n,o){if(!jO(n))return!0;let i=new Set(o.map(Br.Hash)).size,a=o.length;return s.IsEqual(i,a)}function BO(e,r,n,o,i,a){if(!jO(i))return!0;let c=new Set,m=a.reduce((f,y,E)=>{let A=Br.Hash(y);return c.has(A)?[...f,E]:(c.add(A),f)},[]);return s.IsEqual(m.length,0)||r.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:m}})}function D(e,r,n,o){e.Push(n);let i=kc(n)?Um(e,r,n,o):(!Cm(n)||vO(e,r,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!$n(n)||wO(e,r,n,o))&&(!br(n)||US(e,r,n,o))&&(!cm(n)||$S(e,r,n,o))&&(!pm(n)||qS(e,r,n,o))&&(!um(n)||FS(e,r,n,o))&&(!Ta(n)||hO(e,r,n,o))&&(!Ea(n)||_O(e,r,n,o))&&(!Om(n)||SO(e,r,n,o))&&(!ya(n)||ll(e,r,n,o))&&(!Im(n)||sl(e,r,n,o)))&&(!s.IsArray(o)||(!om(n)||RS(e,r,n,o))&&(!Mn(n)||Nm(e,r,n,o))&&(!Go(n)||eO(e,r,n,o))&&(!Tm(n)||nl(e,r,n,o))&&(!Mc(n)||il(e,r,n,o))&&(!Gn(n)||cl(e,r,n,o))&&(!$o(n)||ul(e,r,n,o))&&(!jo(n)||EO(e,r,n,o))&&(!qo(n)||qO(e,r,n,o)))&&(!s.IsString(o)||(!fa(n)||rl(e,r,n,o))&&(!Em(n)||al(e,r,n,o))&&(!ga(n)||ml(e,r,n,o))&&(!ha(n)||gl(e,r,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!fm(n)||vm(e,r,n,o))&&(!Sr(n)||km(e,r,n,o))&&(!hm(n)||ol(e,r,n,o))&&(!Or(n)||pl(e,r,n,o))&&(!_m(n)||dl(e,r,n,o)))&&(!Am(n)||AO(e,r,n,o))&&(!xm(n)||PO(e,r,n,o))&&(!rm(n)||bS(e,r,n,o))&&(!sm(n)||wm(e,r,n,o))&&(!dm(n)||Lm(e,r,n,o))&&(!gm(n)||XS(e,r,n,o))&&(!bm(n)||fl(e,r,n,o))&&(!im(n)||NS(e,r,n,o))&&(!am(n)||vS(e,r,n,o))&&(!Sm(n)||fO(e,r,n,o))&&(!Gc(n)||!s.IsArray(o)||MO(e,r,n,o))&&(!$c(n)||!s.IsObject(o)||GO(e,r,n,o))&&(!nm(n)||OS(e,r,n,o));return e.Pop(n),i}function Z(e,r,n,o,i,a){e.Push(i);let c=kc(i)?MS(e,r,n,o,i,a):!!(+(!Cm(i)||kO(e,r,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!$n(i)||NO(e,r,n,o,i,a))&+(!br(i)||wS(e,r,n,o,i,a))&+(!cm(i)||jS(e,r,n,o,i,a))&+(!pm(i)||BS(e,r,n,o,i,a))&+(!um(i)||HS(e,r,n,o,i,a))&+(!Ta(i)||TO(e,r,n,o,i,a))&+(!Ea(i)||bO(e,r,n,o,i,a))&+(!Om(i)||OO(e,r,n,o,i,a))&+(!ya(i)||mO(e,r,n,o,i,a))&+(!Im(i)||aO(e,r,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!om(i)||CS(e,r,n,o,i,a))&+(!Mn(i)||GS(e,r,n,o,i,a))&+(!Go(i)||tO(e,r,n,o,i,a))&+(!Tm(i)||rO(e,r,n,o,i,a))&+(!Mc(i)||oO(e,r,n,o,i,a))&+(!Gn(i)||sO(e,r,n,o,i,a))&+(!$o(i)||pO(e,r,n,o,i,a))&+(!jo(i)||IO(e,r,n,o,i,a))&+(!qo(i)||BO(e,r,n,o,i,a))))&+(!s.IsString(a)||!!(+(!fa(i)||ZS(e,r,n,o,i,a))&+(!Em(i)||iO(e,r,n,o,i,a))&+(!ga(i)||uO(e,r,n,o,i,a))&+(!ha(i)||yO(e,r,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!fm(i)||zS(e,r,n,o,i,a))&+(!Sr(i)||YS(e,r,n,o,i,a))&+(!hm(i)||nO(e,r,n,o,i,a))&+(!Or(i)||cO(e,r,n,o,i,a))&+(!_m(i)||lO(e,r,n,o,i,a))))&+(!Am(i)||xO(e,r,n,o,i,a))&+(!xm(i)||UO(e,r,n,o,i,a))&+(!rm(i)||SS(e,r,n,o,i,a))&+(!sm(i)||DS(e,r,n,o,i,a))&+(!dm(i)||KS(e,r,n,o,i,a))&+(!gm(i)||JS(e,r,n,o,i,a))&+(!bm(i)||dO(e,r,n,o,i,a))&+(!im(i)||LS(e,r,n,o,i,a))&+(!am(i)||kS(e,r,n,o,i,a))&+(!Sm(i)||gO(e,r,n,o,i,a))&+(!Gc(i)||!s.IsArray(a)||DO(e,r,n,o,i,a))&+(!$c(i)||!s.IsObject(a)||$O(e,r,n,o,i,a)))&&(!nm(i)||AS(e,r,n,o,i,a));return e.Pop(i),c}var qn={};vt(qn,{Ref:()=>E1});var Ar={};vt(Ar,{Delete:()=>d1,Get:()=>m1,Has:()=>u1,Indices:()=>Sa,Set:()=>l1});function FO(e){if(e.length===0)throw Error("Cannot set root")}function HO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function s1(e){return/^(0|[1-9]\d*)$/.test(e)}function KO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function c1(e,r){return s.IsObject(r)&&s.HasPropertyKey(r,e)}function p1(e,r){return s.IsObject(r)?r[e]:void 0}function El(e,r){return e.reduce((n,o)=>p1(o,n),r)}function Sa(e){if(s.IsEqual(e.length,0))return[];let r=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return r.length>0&&r[0]===""?r.slice(1):r}function u1(e,r){let n=e;return Sa(r).every(o=>c1(o,n)?(n=n[o],!0):!1)}function m1(e,r){let n=Sa(r);return El(n,e)}function l1(e,r,n){let o=Sa(r);FO(o);let[i,a]=KO(o),c=El(i,e);return HO(c),c[a]=n,e}function d1(e,r){let n=Sa(r);FO(n);let[o,i]=KO(n),a=El(o,e);return HO(a),s.IsArray(a)&&s1(i)?a.splice(+i,1):delete a[i],e}function f1(e,r,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?zO(e,r,n):e}function g1(e,r,n){let o=new URL(`#${e.$anchor}`,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.href,i.href))return e}function zO(e,r,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?Ar.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function y1(e,r,n){if(Dn(e)){let o=f1(e,r,n);if(!s.IsUndefined(o))return o}if(da(e)){let o=g1(e,r,n);if(!s.IsUndefined(o))return o}return zO(e,r,n)}function h1(e,r,n){return e.reduce((o,i)=>{let a=Il(i,r,n);return s.IsUndefined(a)?o:a},void 0)}function T1(e,r,n){return s.Keys(e).reduce((o,i)=>{let a=Il(e[i],r,n);return s.IsUndefined(a)?o:a},void 0)}function Il(e,r,n){if(r=_r(e)&&Dn(e)?new URL(e.$id,r.href):r,_r(e)){let o=y1(e,r,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return h1(e,r,n);if(s.IsObject(e))return T1(e,r,n)}function E1(e,r){let n=new URL("http://unknown"),o=Dn(e)?new URL(e.$id,n.href):n,i=new URL(r,o.href);return Il(e,o,i)}var Bn=class{constructor(r,n){this.context=r,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((r,n)=>new URL(n.$id,r),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(r){_r(r)&&(Dn(r)&&this.ids.push(r),da(r)&&this.anchors.push(r),Dc(r)&&this.recursiveAnchors.push(r),mm(r)&&this.dynamicAnchors.push(r))}Pop(r){_r(r)&&(Dn(r)&&this.ids.pop(),da(r)&&this.anchors.pop(),Dc(r)&&this.recursiveAnchors.pop(),mm(r)&&this.dynamicAnchors.pop())}FromContext(r){return s.HasPropertyKey(this.context,r)?this.context[r]:void 0}FromRef(r){return r.startsWith("#")?qn.Ref(this.Base(),r):qn.Ref(this.schema,r)}Ref(r){return this.FromContext(r)??this.FromRef(r)}RecursiveRef(r){return Dc(this.Base())?qn.Ref(this.recursiveAnchors[0],r):qn.Ref(this.Base(),r)}};function YO(...e){let[r,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),i=new Bn(r,n),a=new lt;return D(i,a,n,o)}function VO(...e){let[r,n,o]=ae.Match(e,{3:(y,E,A)=>[y,E,A],2:(y,E)=>[{},y,E]}),i=Rt.Get(),a=Cg(),c=[],m=new Bn(r,n),l=new Ia(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[Z(m,l,"#","",n,o),c]}function de(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return YO(r,n,o)}function on(...e){let[r,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),[i,a]=VO(r,n,o);return a}var an=class extends Error{constructor(r,n,o){super(r),Object.defineProperty(this,"cause",{value:{source:r,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function QO(e,r,n){return s.IsArray(n)?n.map(o=>Ye(e,r.items,o)):n}function WO(e,r,n){return r.Clean(n)}function ZO(e,r,n){return Ye({...e,...r.$defs},we(r.$ref),n)}function _1(e){let r=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Bt(e);return k(n)?Ic(n,r):n}function XO(e,r,n){let o=_1(r);return Ye(e,o,n)}function jc(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function JO(e,r,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=jc(r);for(let i of s.Keys(n)){if(s.HasPropertyKey(r.properties,i)){n[i]=Ye(e,r.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[i])){n[i]=Ye(e,o,n[i]);continue}delete n[i]}return n}function eA(e,r,n){if(!s.IsObject(n))return n;let o=jc(r),[i,a]=[new RegExp(Ot(r)),Je(r)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=Ye(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[c])){n[c]=Ye(e,o,n[c]);continue}delete n[c]}return n}function tA(e,r,n){return s.HasPropertyKey(e,r.$ref)?Ye(e,e[r.$ref],n):n}function rA(e,r,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,r.items.length);for(let i=0;i<o;i++)n[i]=Ye(e,r.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function b1(e){let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=fe(e[n]);for(let n of Object.getOwnPropertySymbols(e))r[n]=fe(e[n]);return r}function S1(e){return s.IsClassInstance(e)?e:b1(e)}function O1(e){return e.map(r=>fe(r))}function A1(e){return e.slice()}function x1(e){return new Map(fe([...e.entries()]))}function R1(e){return new Set(fe([...e.values()]))}function fe(e){return at.IsTypeArray(e)?A1(e):at.IsMap(e)?x1(e):at.IsSet(e)?R1(e):s.IsArray(e)?O1(e):s.IsObject(e)?S1(e):e}function nA(e,r,n){for(let o of r.anyOf){let i=Ye(e,o,fe(n));if(de(e,o,i))return i}return n}function Ye(e,r,n){return re(r)?QO(e,r,n):Ct(r)?WO(e,r,n):le(r)?ZO(e,r,n):w(r)?XO(e,r,n):k(r)?JO(e,r,n):_e(r)?eA(e,r,n):pe(r)?tA(e,r,n):V(r)?rA(e,r,n):S(r)?nA(e,r,n):n}function Hn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ye(r,n,o)}function oA(e,r,n){return s.IsArray(n)?n.map(o=>ve(e,r.items,o)):n}function iA(e,r,n){return r.Convert(n)}var oe={};vt(oe,{Fail:()=>Kn,IsOk:()=>bl,Ok:()=>U,TryBigInt:()=>Sl,TryBoolean:()=>z1,TryNull:()=>J1,TryNumber:()=>cj,TryString:()=>gj,TryUndefined:()=>bj});function bl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function Kn(){}function C1(e){return U(e)}function P1(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function U1(e){return U(BigInt(Math.trunc(e)))}function w1(e){return U(BigInt(0))}var N1=/^-?(0|[1-9]\d*)n$/,L1=/^-?(0|[1-9]\d*)\.\d+$/,v1=/^-?(0|[1-9]\d*)$/;function k1(e){return N1.test(e)}function M1(e){return L1.test(e)}function D1(e){return v1.test(e)}function G1(e){let r=e.toLowerCase();return k1(e)?U(BigInt(e.slice(0,e.length-1))):M1(e)?U(BigInt(e.split(".")[0])):D1(e)?U(BigInt(e)):s.IsEqual(r,"false")?U(BigInt(0)):s.IsEqual(r,"true")?U(BigInt(1)):void 0}function $1(e){return U(BigInt(0))}function Sl(e){return s.IsBigInt(e)?C1(e):s.IsBoolean(e)?P1(e):s.IsNumber(e)?U1(e):s.IsNull(e)?w1(e):s.IsString(e)?G1(e):s.IsUndefined(e)?$1(e):void 0}function j1(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function q1(e){return U(e)}function B1(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function F1(e){return U(!1)}function H1(e){return s.IsEqual(e.toLowerCase(),"false")?U(!1):s.IsEqual(e.toLowerCase(),"true")?U(!0):s.IsEqual(e,"0")?U(!1):s.IsEqual(e,"1")?U(!0):void 0}function K1(e){return U(!1)}function z1(e){return s.IsBigInt(e)?j1(e):s.IsBoolean(e)?q1(e):s.IsNumber(e)?B1(e):s.IsNull(e)?F1(e):s.IsString(e)?H1(e):s.IsUndefined(e)?K1(e):void 0}function Y1(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function V1(e){return s.IsEqual(e,!1)?U(null):void 0}function Q1(e){return s.IsEqual(e,0)?U(null):void 0}function W1(e){return U(null)}function Z1(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(null):void 0}function X1(e){return U(null)}function J1(e){return s.IsBigInt(e)?Y1(e):s.IsBoolean(e)?V1(e):s.IsNumber(e)?Q1(e):s.IsNull(e)?W1(e):s.IsString(e)?Z1(e):s.IsUndefined(e)?X1(e):void 0}var ej=BigInt(Number.MAX_SAFE_INTEGER),tj=BigInt(Number.MIN_SAFE_INTEGER);function rj(e){return e<=ej&&e>=tj}function aA(e){return rj(e)?U(Number(e)):void 0}function nj(e){return e?U(1):U(0)}function oj(e){return U(e)}function ij(e){return U(0)}function aj(e){let r=+e;if(s.IsNumber(r))return U(r);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return U(0);if(s.IsEqual(n,"true"))return U(1);let o=Sl(e);return bl(o)?aA(o.value):void 0}function sj(e){return U(0)}function cj(e){return s.IsBigInt(e)?aA(e):s.IsBoolean(e)?nj(e):s.IsNumber(e)?oj(e):s.IsNull(e)?ij(e):s.IsString(e)?aj(e):s.IsUndefined(e)?sj(e):void 0}function pj(e){return U(e.toString())}function uj(e){return U(e.toString())}function mj(e){return U(e.toString())}function lj(e){return U("null")}function dj(e){return U(e)}function fj(e){return U("")}function gj(e){return s.IsBigInt(e)?pj(e):s.IsBoolean(e)?uj(e):s.IsNumber(e)?mj(e):s.IsNull(e)?lj(e):s.IsString(e)?dj(e):s.IsUndefined(e)?fj(e):void 0}function yj(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function hj(e){return s.IsEqual(e,!1)?U(void 0):void 0}function Tj(e){return s.IsEqual(e,0)?U(void 0):void 0}function Ej(e){return U(void 0)}function Ij(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(void 0):void 0}function _j(e){return U(void 0)}function bj(e){return s.IsBigInt(e)?yj(e):s.IsBoolean(e)?hj(e):s.IsNumber(e)?Tj(e):s.IsNull(e)?Ej(e):s.IsString(e)?Ij(e):s.IsUndefined(e)?_j(e):void 0}function sA(e,r,n){if(s.IsBigInt(n))return n;let o=oe.TryBigInt(n);return oe.IsOk(o)?o.value:n}function cA(e,r,n){if(s.IsBoolean(n))return n;let o=oe.TryBoolean(n);return oe.IsOk(o)?o.value:n}function pA(e,r,n){return ve({...e,...r.$defs},we(r.$ref),n)}function qc(e,r,n){if(r.anyOf.some(c=>de(e,c,n)))return n;let a=r.anyOf.map(c=>ve(e,c,fe(n))).find(c=>de(e,r,c));return s.IsUndefined(a)?n:a}function uA(e,r,n){let o=Cn(r);return qc(e,o,n)}function mA(e,r,n){if(s.IsInteger(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?Math.trunc(o.value):n}function lA(e,r,n){let o=Bt(r);return ve(e,o,n)}function Sj(e,r,n){let o=oe.TryBigInt(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function Oj(e,r,n){let o=oe.TryBoolean(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function Aj(e,r,n){let o=oe.TryNumber(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function xj(e,r,n){let o=oe.TryString(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function dA(e,r,n){return s.IsEqual(r.const,n)?n:Mg(r)?Sj(e,r,n):Dg(r)?Oj(e,r,n):so(r)?Aj(e,r,n):co(r)?xj(e,r,n):H()}function fA(e,r,n){if(s.IsNull(n))return n;let o=oe.TryNull(n);return oe.IsOk(o)?o.value:n}function gA(e,r,n){if(s.IsNumber(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?o.value:n}function Bc(e,r,n,o){let i=s.Keys(o);for(let[a,c]of r)for(let m of i)a.test(m)||(o[m]=ve(e,n,o[m]));return o}function Oa(e,r,n){return Me(e)&&s.IsUndefined(n[r])}function Rj(e,r,n){let o=s.EntriesRegExp(r.properties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)!a.test(m)||Oa(c,m,n)||(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?Bc(e,o,r.additionalProperties,n):n}function yA(e,r,n){return s.IsObjectNotArray(n)?Rj(e,r,n):n}function Cj(e,r,n){let o=s.EntriesRegExp(r.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)a.test(m)&&(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?Bc(e,o,r.additionalProperties,n):n}function hA(e,r,n){return s.IsObjectNotArray(n)?Cj(e,r,n):n}function TA(e,r,n){return s.HasPropertyKey(e,r.$ref)?ve(e,e[r.$ref],n):n}function EA(e,r,n){if(s.IsString(n))return n;let o=oe.TryString(n);return oe.IsOk(o)?o.value:n}function IA(e,r,n){let o=et(r.pattern);return ve(e,o,n)}function _A(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(r.items.length,n.length);o++)n[o]=ve(e,r.items[o],n[o]);return n}function bA(e,r,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?o.value:n}function SA(e,r,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?void 0:n}function ve(e,r,n){return re(r)?oA(e,r,n):Ct(r)?iA(e,r,n):St(r)?sA(e,r,n):pt(r)?cA(e,r,n):le(r)?pA(e,r,n):Re(r)?uA(e,r,n):Be(r)?mA(e,r,n):w(r)?lA(e,r,n):J(r)?dA(e,r,n):Wt(r)?fA(e,r,n):Ie(r)?gA(e,r,n):k(r)?yA(e,r,n):_e(r)?hA(e,r,n):pe(r)?TA(e,r,n):Ne(r)?EA(e,r,n):Ce(r)?IA(e,r,n):V(r)?_A(e,r,n):er(r)?bA(e,r,n):S(r)?qc(e,r,n):At(r)?SA(e,r,n):n}function sn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return ve(r,n,o)}function OA(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=qe(e,r.items,n[o]);return n}function AA(e,r,n){return r.Default(n)}function xA(e,r,n){return qe({...e,...r.$defs},we(r.$ref),n)}function RA(e,r){return s.IsUndefined(r)?s.IsFunction(e.default)?e.default():fe(e.default):r}function CA(e,r,n){let o=Bt(r);return qe(e,o,n)}function PA(e,r,n){if(!s.IsObject(n))return n;let o=s.Keys(r.properties);for(let i of o){let a=qe(e,r.properties[i],n[i]);s.IsUndefined(a)&&(Me(r.properties[i])||!s.HasPropertyKey(r.properties[i],"default"))||(n[i]=qe(e,r.properties[i],n[i]))}if(!br(r)||s.IsBoolean(r.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=qe(e,r.additionalProperties,n[i]));return n}function UA(e,r,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(Ot(r)),Je(r)];for(let a of s.Keys(n))o.test(a)&&wt(i)&&(n[a]=qe(e,i,n[a]));if(!br(r))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=qe(e,r.additionalProperties,n[a]));return n}function wA(e,r,n){return s.HasPropertyKey(e,r.$ref)?qe(e,e[r.$ref],n):n}function NA(e,r,n){if(!s.IsArray(n))return n;let[o,i]=[r.items,Math.max(r.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=qe(e,o[a],n[a]));return n}function LA(e,r,n){for(let o of r.anyOf){let i=qe(e,o,fe(n));if(de(e,o,i))return i}return n}function qe(e,r,n){let o=wt(r)?RA(r,n):n;return re(r)?OA(e,r,o):Ct(r)?AA(e,r,o):le(r)?xA(e,r,o):w(r)?CA(e,r,o):k(r)?PA(e,r,o):_e(r)?UA(e,r,o):pe(r)?wA(e,r,o):V(r)?NA(e,r,o):S(r)?LA(e,r,o):o}function zn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return qe(r,n,o)}function Ho(e){return(...r)=>{let[n,o,i]=ae.Match(r,{3:(a,c,m)=>[a,c,m],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function Pj(e,r,n){return r["~codec"].decode(n)}function Uj(e,r,n){return r["~codec"].encode(n)}function Oe(e,r,n,o){return Sn(n)?s.IsEqual(e,"Decode")?Pj(r,n,o):Uj(r,n,o):o}function wj(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=he(e,r,n.items,o[i]);return Oe(e,r,n,o)}function Nj(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=he(e,r,n.items,i[a]);return i}function vA(e,r,n,o){return s.IsEqual(e,"Decode")?wj(e,r,n,o):Nj(e,r,n,o)}function kA(e,r,n,o){return o=he(e,{...r,...n.$defs},we(n.$ref),o),Oe(e,r,n,o)}function Lj(e,r,n,o){for(let i of n.allOf)o=he(e,r,i,o);return Oe(e,r,n,o)}function vj(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.allOf)i=he(e,r,a,i);return i}function MA(e,r,n,o){return s.IsEqual(e,"Decode")?Lj(e,r,n,o):vj(e,r,n,o)}function kj(e,r,n,o){if(!s.IsObjectNotArray(o))return H();for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||Oa(n.properties[i],i,o)||(o[i]=he(e,r,n.properties[i],o[i]));return Oe(e,r,n,o)}function Mj(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||Oa(n.properties[a],a,i)||(i[a]=he(e,r,n.properties[a],i[a]));return i}function DA(e,r,n,o){return s.IsEqual(e,"Decode")?kj(e,r,n,o):Mj(e,r,n,o)}function Dj(e,r,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(Ot(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=he(e,r,Je(n),o[a]);return Oe(e,r,n,o)}function Gj(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(Ot(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=he(e,r,Je(n),i[c]));return i}function GA(e,r,n,o){return s.IsEqual(e,"Decode")?Dj(e,r,n,o):Gj(e,r,n,o)}function $A(e,r,n,o){return o=s.HasPropertyKey(r,n.$ref)?he(e,r,r[n.$ref],o):o,Oe(e,r,n,o)}function $j(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<Math.min(n.items.length,o.length);i++)o[i]=he(e,r,n.items[i],o[i]);return Oe(e,r,n,o)}function jj(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(n.items.length,i.length);a++)i[a]=he(e,r,n.items[a],i[a]);return i}function jA(e,r,n,o){return s.IsEqual(e,"Decode")?$j(e,r,n,o):jj(e,r,n,o)}function qj(e,r,n,o){for(let i of n.anyOf){if(!de(r,i,o))continue;let a=he(e,r,i,o);return Oe(e,r,n,a)}return H()}function Bj(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.anyOf){let c=he(e,r,a,fe(i));if(de(r,a,c))return c}return i}function qA(e,r,n,o){return s.IsEqual(e,"Decode")?qj(e,r,n,o):Bj(e,r,n,o)}function he(e,r,n,o){return re(n)?vA(e,r,n,o):le(n)?kA(e,r,n,o):w(n)?MA(e,r,n,o):k(n)?DA(e,r,n,o):_e(n)?GA(e,r,n,o):pe(n)?$A(e,r,n,o):V(n)?jA(e,r,n,o):S(n)?qA(e,r,n,o):Oe(e,r,n,o)}var Ol=class extends an{constructor(r,n){super("Decode",r,n)}};function Fj(e,r,n){if(!de(e,r,n))throw new Ol(n,on(e,r,n));return n}function Hj(e,r,n){return he("Decode",e,r,n)}var WDe=Ho([(e,r,n)=>fe(n),(e,r,n)=>zn(e,r,n),(e,r,n)=>sn(e,r,n),(e,r,n)=>Hn(e,r,n),(e,r,n)=>Fj(e,r,n),(e,r,n)=>Hj(e,r,n)]);var Al=class extends an{constructor(r,n){super("Encode",r,n)}};function Kj(e,r,n){if(!de(e,r,n))throw new Al(n,on(e,r,n));return n}function zj(e,r,n){return he("Encode",e,r,n)}var cGe=Ho([(e,r,n)=>fe(n),(e,r,n)=>zj(e,r,n),(e,r,n)=>zn(e,r,n),(e,r,n)=>sn(e,r,n),(e,r,n)=>Hn(e,r,n),(e,r,n)=>Kj(e,r,n)]);var Mt=class extends Error{constructor(r,n){super(n),this.type=r}};function BA(e,r){return s.IsFunction(r.default)?r.default(r):s.IsObject(r.default)?fe(r.default):r.default}function FA(e,r){if(qo(r)&&!wt(r))throw new Mt(r,"Arrays with uniqueItems constraints must specify a default annotation");let n=$o(r)?r.minItems:0;return Array.from({length:n},()=>Te(e,r.items))}async function*Yj(){}function HA(e,r){return Yj()}function KA(e,r){return r.Create()}function zA(e,r){return Sr(r)?BigInt(r.exclusiveMinimum)+BigInt(1):Or(r)?BigInt(r.minimum):BigInt(0)}function YA(e,r){return!1}function VA(e,r){let n=Te(e,r.instanceType);return class{constructor(){Object.assign(this,n)}}}function QA(e,r){return Te({...e,...r.$defs},we(r.$ref))}function WA(e,r){return Te(e,Cn(r))}function ZA(e,r){let n=Te(e,r.returnType);return()=>n}function XA(e,r){return Sr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Or(r)?r.minimum:0}function JA(e,r){return Te(e,Bt(r))}function*Vj(){}function ex(e,r){return Vj()}function tx(e,r){return r.const}function rx(e,r){throw new Mt(r,"Cannot create TNever types")}function nx(e,r){return null}function ox(e,r){return Sr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Or(r)?r.minimum:0}function ix(e,r){return(s.IsUndefined(r.required)?[]:r.required).reduce((o,i)=>({...o,[i]:Te(e,r.properties[i])}),{})}function ax(e,r){return Promise.resolve(Te(e,r.item))}function sx(e,r){if(ya(r)&&!wt(r))throw new Mt(r,"Record with the minProperties constraint must have a default annotation");return{}}function cx(e,r){return s.HasPropertyKey(e,r.$ref)?Te(e,e[r.$ref]):(()=>{throw new Mt(r,"Unable to deref Ref")})()}function px(e,r){if((ha(r)||fa(r))&&!wt(r))throw Error("Strings with format or pattern constraints must specify default");let o=ga(r)?r.minLength:0;return"".padEnd(o)}function ux(e,r){return Symbol()}function mx(e,r){let n=et(r.pattern);if(Ne(n))throw new Mt(r,"Unable to create TemplateLiteral due to infinite type expansion");return Te(e,n)}function lx(e,r){return Array.from({length:r.minItems},(n,o)=>Te(e,r.items[o]))}function dx(e,r){if(s.IsEqual(r.anyOf.length,0))throw Error("Unable to create Union with no variants");return Te(e,r.anyOf[0])}function Te(e,r){return wt(r)?BA(e,r):re(r)?FA(e,r):ot(r)?HA(e,r):Ct(r)?KA(e,r):St(r)?zA(e,r):pt(r)?YA(e,r):De(r)?VA(e,r):le(r)?QA(e,r):Re(r)?WA(e,r):Ge(r)?ZA(e,r):Be(r)?XA(e,r):w(r)?JA(e,r):it(r)?ex(e,r):J(r)?tx(e,r):lr(r)?rx(e,r):Wt(r)?nx(e,r):Ie(r)?ox(e,r):k(r)?ix(e,r):Xe(r)?ax(e,r):_e(r)?sx(e,r):pe(r)?cx(e,r):Ne(r)?px(e,r):Zt(r)?ux(e,r):Ce(r)?mx(e,r):V(r)?lx(e,r):er(r)?void 0:S(r)?dx(e,r):At(r)?void 0:void 0}function sr(...e){let[r,n]=ae.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Te(r,n)}var xl=class extends an{constructor(r,n){super("Parse",r,n)}};function Qj(e,r,n){if(!de(e,r,n))throw new xl(n,on(e,r,n));return n}var dje=Ho([(e,r,n)=>fe(n),(e,r,n)=>zn(e,r,n),(e,r,n)=>sn(e,r,n),(e,r,n)=>Hn(e,r,n),(e,r,n)=>Qj(e,r,n)]);var Zj=N({type:Y("insert"),path:Et(),value:We()}),Xj=Object({type:Y("update"),path:Et(),value:We()}),Jj=N({type:Y("delete"),path:Et()}),Ije=$([Zj,Xj,Jj]);function Ko(e){if(!e.body)throw new Error("This command does not accept a request body");let r=e.body;return r.examples?.length?r.examples[0]:sr(r)}function Aa(e,r,n,o,i){e.command(r).description(n).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){W(Ko(o));return}let c=Do(a),m=await i()(o,{body:c});W(m)})}function yx(e,r){let n=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Aa(n,"promql","Run a PromQL query (experimental)",IS,r)}var nq=`/${"v1"}/feedback`,hx=t.Object({id:t.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),oq={id:"request-123-abc"};Object.assign(hx,{examples:[oq]});var Tx=t.Object({content:p({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."})}),iq={content:"The traces command times out for large services."};Object.assign(Tx,{examples:[iq]});var Ex=d({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:nq,method:"POST",body:Tx,response:hx});function Ix(e,r){e.command("feedback <message...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async n=>{let o=await r()(Ex,{body:{content:n.join(" ")}});W(o)})}var aq={investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","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"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"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:["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"]},"dashboard-report":{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"]},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"]},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"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{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"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{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-members":{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:[]}},sq={investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"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"]},"audit-log":{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:[]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{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"]},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:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{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"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{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:[]}},cq={user:aq,team:sq};function Cl(e){return _x(e,"team")}function Pl(e){return _x(e,"user")}function _x(e,r){let n=[],o=cq[r];for(let[i,a]of Object.entries(o))for(let[c,m]of Object.entries(a))m.includes(e)&&n.push({actionType:c,resourceType:i});return n}var TFe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Pl("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:Pl("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Pl("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},EFe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Cl("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Cl("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Cl("viewer"),roleKey:"viewer"}};var Ul=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],wl=["light","dark"];var pq={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)"}},bx=["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 AFe=pq.light.red.background;var Sx=[{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:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{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-----
|
|
127
127
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
128
128
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
129
|
-
-----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}"}],nG=QA.map(e=>e.key),dGe=new Set(nG),fGe=QA.map(e=>e.key);function WA(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var ZA=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","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"],XA=["alert_queries","alert_thresholds","alert_values"],oG=[...ZA,...XA],JA=["alert_event_name","alert_message"],qGe=[...oG,...JA],FGe=new Set([...ZA,...JA]),BGe=new Set(XA);var iG="^\\S(.*\\S)?$",eS=128,tS=256,aG=r.Object({key:r.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:r.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),sG=r.Object({key:r.String({maxLength:eS,description:`Tag key to attach to the resource. Maximum length is ${eS} characters.`}),value:r.String({maxLength:tS,pattern:iG,description:`Tag value to attach to the resource. Maximum length is ${tS} characters and leading or trailing whitespace is rejected.`})},{title:"Tag"}),Ln=r.Array(aG,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Mn=r.Array(sG,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Up to 50 tags are accepted and tag policies may require specific keys or values."}),We=r.Optional(Ln),rt=r.Optional(Mn);var Wr="/v0/teams",ac=["public","private"],ic={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},cG=r.Enum([ic.NAME,ic.CREATED_AT,ic.MEMBER_COUNT,ic.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),nS=r.Object({color:r.Enum(Bu,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:r.Enum(Hu,{description:"Avatar rendering mode selected for the team."}),iconName:r.Enum(YA,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Ku=r.Object({color:r.Enum(Bu),mode:r.Enum(Hu)}),pG=100,rS=250,vo=r.Object({id:r.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:r.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:r.Optional(r.String({description:"Optional team description supplied by a user."})),visibility:r.Enum(ac,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:We,createdAt:T({description:"Timestamp when Tsuga created the team."}),updatedAt:T({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:r.Optional(r.Number({description:"Number of members currently in the team"})),avatar:r.Optional(nS)}),sc=r.Object({name:r.String({minLength:1,maxLength:pG,description:"Name to assign to the team"}),description:r.Optional(r.String({maxLength:rS,description:`Optional team description. Maximum length is ${rS} characters.`})),visibility:r.Enum(ac,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:rt,avatar:r.Optional(nS)}),mG=r.Object({id:r.String(),name:r.String(),email:r.String(),role:r.Enum(Oo),joinedTeamAt:T(),orgRole:r.Enum(Ks),avatar:r.Optional(Ku)}),N1e=d({tags:["teams"],url:Wr,method:"GET",paginated:!0,response:r.Array(vo),query:r.Object({...te,includeMemberCount:r.Optional(r.Boolean()),searchQuery:r.Optional(m({description:"Substring matched against team names and descriptions."})),visibility:r.Optional(r.Enum(ac,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:r.Optional(r.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:r.Optional(cG),sortDirection:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),k1e=d({tags:["teams"],url:`${Wr}/:id`,method:"GET",params:r.Object({id:m()}),response:vo}),w1e=d({tags:["teams"],url:`${Wr}/:id/members`,method:"GET",params:r.Object({id:m()}),response:r.Array(mG)}),L1e=d({tags:["teams"],url:`${Wr}/:id/assets`,method:"GET",params:r.Object({id:m()}),response:r.Object({apiKeyCount:r.Number(),logRouteCount:r.Number(),monitorCount:r.Number(),notificationRuleCount:r.Number(),dashboardCount:r.Number()})}),M1e=d({tags:["teams"],url:Wr,method:"POST",body:sc,response:vo}),v1e=d({tags:["teams"],url:`${Wr}/:id`,method:"PUT",params:r.Object({id:m()}),body:sc,response:vo}),D1e=d({tags:["teams"],url:`${Wr}/bulk-update`,method:"POST",body:r.Object({teamIds:r.Array(m(),{maxItems:100}),config:r.Object({visibility:r.Enum(ac)})}),response:r.Object({})}),$1e=d({tags:["teams"],url:`${Wr}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L});var uG=r.Enum(["terraform-provider","web-frontend","mcp-server","cli"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),Ee=A("type",[r.Object({type:r.Literal("user",{description:"The resource was created or updated by a user."}),id:r.String({description:"Unique identifier of the user actor."}),name:r.String({description:"Display name of the user actor at the time of response."}),avatar:r.Optional(Ku)}),r.Object({type:r.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:r.String({description:"Unique identifier of the operation API key actor."}),name:r.String({description:"Display name of the operation API key actor."}),source:r.Optional(uG)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var lG=["all","owning-team-and-public","owning-team-only"],zu=r.Enum(lG,{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 At="/v0/monitors",Do=["alert","resolve","keep_last_status","consider_zero"],cc=["alert","resolve","keep_last_status"];var iS=["no_aggregation","all","any","each","proportion"],aS=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var dG=r.Object({formula:r.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(aS,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison."})}),fG=r.Object({formula:m({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(aS,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison."})}),Vu=r.Array(dG),Yu=r.Array(fG),sS=r.Object({formula:r.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior."})}),cS=r.Object({formula:m({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior."})}),Ot=[1,2,3,4,5];var oa={timeframe:r.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:r.Array(r.Object({fields:r.Array(r.String(),{description:"Fields used by the monitor group by."}),limit:r.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:r.Optional(r.Enum(iS,{description:"How grouped results are combined into alert state: no aggregation, all groups, any group, each group, or a matching proportion."})),proportionAlertThreshold:r.Optional(r.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},ia={timeframe:r.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:r.Array(r.Object({fields:r.Array(m(),{description:"Fields used by the monitor group by."}),limit:r.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:r.Optional(r.Enum(iS,{description:"How grouped results are combined into alert state: no aggregation, all groups, any group, each group, or a matching proportion."})),proportionAlertThreshold:r.Optional(r.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`. Valid values are 1 through 99."}))},pS=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Vu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...oa,queries:Ao},{$id:"MonitorConfigurationMetric"}),mS=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Yu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ia,queries:So},{$id:"InputMonitorConfigurationMetric"}),uS=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Vu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...oa,queries:Ao},{$id:"MonitorConfigurationLog"}),lS=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Yu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ia,queries:So},{$id:"InputMonitorConfigurationLog"}),dS=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Vu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...oa,queries:Ao},{$id:"MonitorConfigurationTrace"}),gG=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Yu,noDataBehavior:r.Enum(Do,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ia,queries:So},{$id:"InputMonitorConfigurationTrace"}),fS=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:sS,noDataBehavior:r.Enum(cc,{description:"How the anomaly monitor updates state when no data is returned."}),...oa,queries:Ao},{$id:"MonitorConfigurationAnomalyLog"}),gS=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:cS,noDataBehavior:r.Enum(cc,{description:"How the anomaly monitor updates state when no data is returned."}),...ia,queries:So},{$id:"InputMonitorConfigurationAnomalyLog"}),yS=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:sS,noDataBehavior:r.Enum(cc,{description:"How the anomaly monitor updates state when no data is returned."}),...oa,queries:Ao},{$id:"MonitorConfigurationAnomalyMetric"}),hS=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:cS,noDataBehavior:r.Enum(cc,{description:"How the anomaly monitor updates state when no data is returned."}),...ia,queries:So},{$id:"InputMonitorConfigurationAnomalyMetric"}),ES=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:r.Optional(r.Array(r.String(),{description:"Cloud account IDs included in certificate checks."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),yG=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:r.Optional(r.Array(r.String(),{minItems:1,description:"Cloud account IDs included in certificate checks."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),TS=r.Object({type:r.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns."}),aggregationAlertLogic:r.Literal("each"),noDataBehavior:r.Literal("keep_last_status"),filter:r.Object({teamIds:r.Array(r.String(),{description:"Team IDs included in new error pattern detection."}),env:r.String({description:"Environment included in new error pattern detection."}),service:r.Optional(r.String({description:"Optional service name included in new error pattern detection."}))})},{$id:"MonitorConfigurationLogErrorPattern"}),hG=A("type",[pS,uS,dS,fS,yS,TS,ES]),EG=A("type",[mS,lS,gG,gS,hS,TS,yG]);var Tr=r.Object({id:r.String({description:"Unique identifier of the monitor. Generated by Tsuga."}),name:r.String({description:"Display name of the monitor and alert source."}),owner:r.String({description:"Team ID that owns and manages the monitor."}),message:r.Optional(r.String({description:"Message to be displayed if a notification is triggered"})),tags:We,configuration:hG,priority:r.Enum(Ot,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:zu,dashboardId:r.Optional(r.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:r.Optional(T({description:"Timestamp until which the monitor is snoozed."})),creator:r.Optional(Ee),updater:r.Optional(Ee),createdAt:T({description:"Timestamp when Tsuga created the monitor."}),updatedAt:T({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:r.Array(r.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),TG=A("type",[pS,uS,dS,fS,yS,ES]),rje=r.Object({...Tr.properties,configuration:TG},{title:"Monitor"}),nje=r.Object({...Tr.properties,configuration:A("type",[mS,lS,gS,hS])},{title:"Monitor"}),aa=r.Object({name:m({description:"Display name of the monitor and alert source."}),message:r.Optional(m({type:"long",description:"Optional message included when notifications are sent."})),tags:rt,configuration:EG,priority:r.Enum(Ot,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:r.Optional(m({description:"Optional dashboard ID related to this monitor."})),pauseUntil:r.Optional(m({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:zu,clusterIds:r.Optional(r.Array(m({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),oS=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Zr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var IS=r.Object({owners:mr(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:m({allowEmpty:!1}),exclude:r.Optional(r.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:mr(Mn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:mr(r.Enum(Ot),{description:"Restrict results to monitors with one of these priorities",maxItems:Ot.length}),types:mr(r.Enum(oS),{description:"Restrict results to monitors with these types",maxItems:oS.length}),activity:r.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:mr(m({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"}),Qu=r.Partial(r.Object({...te,filters:r.Partial(IS),sort:r.Object({by:r.Enum([Zr.PRIORITY,Zr.TYPE,Zr.NAME,Zr.OWNER,Zr.TAGS,Zr.CLUSTER_IDS,Zr.PAUSE_UNTIL,Zr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),oje=d({tags:["monitors"],url:`${At}/query`,method:"POST",paginated:!0,response:r.Array(Tr),body:Qu}),ije=d({tags:["monitors"],url:`${At}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(IS,["tags"])))}),response:Ln}),aje=d({tags:["monitors"],url:`${At}/:id`,method:"GET",params:r.Object({id:m()}),response:Tr}),sje=d({tags:["monitors"],url:At,method:"POST",body:aa,response:Tr}),cje=d({tags:["monitors"],url:`${At}/:id`,method:"PUT",params:r.Object({id:m()}),body:aa,response:Tr}),pje=d({tags:["monitors"],url:`${At}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),mje=d({tags:["monitors"],url:`${At}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(m())}),response:r.Object({})}),uje=d({tags:["monitors"],url:`${At}/bulk-update`,method:"PUT",body:r.Object({monitorIds:r.Array(m()),owner:m({allowEmpty:!1})}),response:r.Object({})}),lje=d({tags:["monitors"],url:`${At}/:id/snooze`,method:"POST",params:r.Object({id:m()}),body:r.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:Tr}),IG=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],vn=r.Enum(IG),_G=A("type",[r.Object({type:r.Literal("each"),subStates:r.Record(r.String(),r.Object({stateValue:r.Union([vn,r.Null()]),lastChangedAt:T()}))}),r.Object({type:r.Literal("no_aggregation"),stateValue:r.Optional(vn)}),r.Object({type:r.Literal("any"),stateValue:r.Optional(vn)}),r.Object({type:r.Literal("all"),stateValue:r.Optional(vn)}),r.Object({type:r.Literal("proportion"),stateValue:r.Optional(vn)})]),bG=r.Object({monitorId:r.String(),currentState:_G,lastChangedAt:r.Optional(T())}),dje=d({tags:["monitors"],url:`${At}/states/:id`,method:"GET",params:r.Object({id:m()}),response:bG}),fje=d({tags:["monitors"],url:`${At}/:id/transitions`,method:"GET",params:r.Object({id:m()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Array(r.Object({id:r.String(),createdAt:T(),fromState:r.Optional(vn),toState:r.Optional(vn),dimension:r.Optional(r.String())}))}),OG=["unprocessed","processed","failed-to-process"],gje=d({tags:["monitors"],url:`${At}/:id/results`,method:"GET",params:r.Object({id:m()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Object({isTruncated:r.Boolean(),results:r.Array(r.Object({id:r.String(),evaluationAt:T(),formulaResult:r.Object({groups:r.Array(r.Object({groupKey:r.Record(r.String(),lm),results:r.Array(r.Union([r.Number(),r.Null()])),conditionMet:r.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:r.Enum(OG)}))})});var j="context";var _S="trace_id",hje=`${j}.team`,Eje=`${j}.env`,Tje=`${j}.api_key_id`,pc=`${j}.service.name`,Ije=`${j}.service.version`,_je=`${j}.span.kind`,bje=`${j}.status.code`,bS=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var sa=`${j}.host.name`,AG=`${j}.instance`,SG=`${j}.instanceid`,xG=`${j}.instance_name`,Oje=`${j}.telemetry.sdk.language`,Aje=`${j}.process.runtime.name`,Sje=`${j}.scope.name`,xje=`${j}.cloud.provider`,Rje=`${j}.cloud.platform`,Cje=`${j}.aws.ecs.task.arn`,Pje=`${j}.k8s.cluster.name`,Uje=`${j}.k8s.cluster.uid`,Nje=`${j}.k8s.namespace.name`,kje=`${j}.k8s.pod.name`,wje=`${j}.k8s.pod.uid`,Lje=`${j}.k8s.container.name`,Mje=`${j}.k8s.node.name`,vje=`${j}.k8s.node.uid`,Dje=`${j}.k8s.deployment.name`,$je=`${j}.k8s.deployment.uid`,Gje=`${j}.k8s.replicaset.name`,jje=`${j}.k8s.replicaset.uid`,qje=`${j}.k8s.statefulset.name`,Fje=`${j}.k8s.statefulset.uid`,Bje=`${j}.k8s.daemonset.name`,Hje=`${j}.k8s.daemonset.uid`,Kje=`${j}.k8s.job.name`,zje=`${j}.k8s.job.uid`,Vje=`${j}.k8s.cronjob.name`,Yje=`${j}.k8s.cronjob.uid`;var RG="db.system.name",CG="db.system",PG="db.namespace",UG="db.name";var Qje=`span_attributes.${PG}`,Wje=`span_attributes.${UG}`,Zje=`span_attributes.${RG}`,Xje=`span_attributes.${CG}`;var Jje={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${j}.tag_policy_id`,dataSource:`${j}.data_source`}};var eqe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${j}.batch_kind`,batchKindMetricsFilter:`${j}.batch_kind:metrics`,sourceApiKeyId:`${j}.source_api_key_id`,sourceEnv:`${j}.source_env`,sourceTeam:`${j}.source_team`}},OS="__tsuga_metadata__",tqe=`${OS}.signature`,rqe=`${OS}.routes`;var rr="/v0/service-catalog";var SS=r.Object({team:r.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this team was observed for the service."})}),NG=r.Object({ingestionApiKey:r.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this ingestion key was observed for the service."})}),xS=r.Object({version:r.String({description:"Service version value observed in telemetry."}),firstSeenAt:T({description:"First time this version was observed for the service."}),lastSeenAt:T({description:"Most recent time this version was observed for the service."}),faulty:r.Optional(r.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."}))}),kG=r.Object({language:r.String({description:"Programming language observed for this service."}),lastSeenAt:T({description:"Most recent time this language was observed."})}),wG=r.Object({runtime:r.String({description:"Runtime observed for this service."}),lastSeenAt:T({description:"Most recent time this runtime was observed."})}),AS=r.Object({protocol:r.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),LG=r.Object({framework:r.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),MG=r.Object({platform:r.String({description:"Observed cloud platform"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),vG=r.Object({provider:r.String({description:"Observed cloud provider"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),ca=r.Object({id:r.String({description:"Unique identifier of this service catalog entry. Use it with service detail and graph endpoints."}),serviceName:r.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:r.Optional(r.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:r.Optional(r.String({description:"Environment value observed for this service."})),teams:r.Array(SS),ingestionApiKeys:r.Array(NG),versions:r.Array(xS),languages:r.Array(kG),runtimes:r.Array(wG),serverProtocols:r.Array(AS,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:r.Array(AS,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:r.Array(LG,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:r.Array(MG,{description:"Cloud platforms this service is running on"}),cloudProviders:r.Array(vG,{description:"Cloud providers this service is running on"}),lastSeenAt:T({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:T({description:"First time Tsuga observed telemetry for this service."}),sources:r.Array(r.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:r.Optional(r.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:r.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:r.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:r.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:r.Number({description:"Number of error traces observed for this service in the last 24 hours."}),createdAt:T({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:T({description:"Timestamp when Tsuga last updated this service catalog entry."})}),mqe=d({tags:["service-catalog"],query:r.Object({...te,clusterId:r.Optional(m())}),method:"GET",paginated:!0,url:`${rr}/services`,response:r.Array(ca)}),DG=r.Object({spanKind:r.Enum(bS),count:r.Number()}),RS=r.Object({...ca.properties,spanKindCounts:r.Array(DG),envs:r.Object({primaryEnv:r.String(),allEnvs:r.Array(r.String())})}),uqe=d({tags:["service-catalog"],query:r.Object({...te,clusterId:r.Optional(m()),env:r.Optional(m())}),method:"GET",paginated:!0,url:`${rr}/v2/services`,response:r.Array(RS)}),lqe=d({tags:["service-catalog"],query:r.Object({serviceName:m({allowEmpty:!1}),serviceNamespace:r.Optional(m({allowEmpty:!1})),env:m({allowEmpty:!1}),clusterId:r.Optional(m())}),method:"GET",url:`${rr}/v2/service`,response:RS}),dqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/services/:serviceId`,params:r.Object({serviceId:m()}),response:ca}),$G=r.Object({id:r.String(),endpointName:r.String(),serviceName:r.String(),serviceNamespace:r.Optional(r.String()),env:r.Optional(r.String()),teams:r.Array(SS),versions:r.Array(xS),lastSeenAt:T(),firstSeenAt:T(),sources:r.Array(r.String()),additionalUserFields:r.Optional(r.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),fqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/endpoints`,response:r.Array($G)}),GG=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var CS=r.Object({id:r.String(),hostName:r.String(),env:r.Optional(r.String()),cpuUtilizationAverage:r.Number(),hostType:r.Enum(GG),teams:r.Array(r.String()),tags:r.Array(r.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:r.String()}),gqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/hosts`,response:r.Array(CS)}),yqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/hosts/:hostId`,params:r.Object({hostId:m()}),response:CS}),jG=["http","db","rpc","messaging","genai","object_store"],PS={name:r.String({description:"Service or inferred dependency name shown in the graph."}),env:r.Optional(r.String({description:"Environment observed from spans."}))},Wu=r.Object({...PS,nodeType:r.Literal("observed",{description:"Observed service node that corresponds to a service catalog entry."}),id:r.Union([r.String(),r.Null()],{description:"Service ID from catalog, null if ambiguous (multiple namespaces match)"}),namespace:r.Union([r.String(),r.Null()],{description:"Service namespace from catalog, null if ambiguous"}),errorRate:r.Optional(r.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."})),entryErrorRequestCount:r.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:r.Number({description:"Number of entry requests observed on this service, counted 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."})}),Zu=r.Object({...PS,nodeType:r.Literal("inferred",{description:"Dependency node inferred from spans but not resolved to a service catalog entry."}),serviceType:r.Enum(jG,{description:"Inferred service type, e.g. http, db, rpc"}),endpoint:r.Optional(r.String({description:"Inferred service endpoint address"})),resourceName:r.Optional(r.String({description:"Inferred resource name, e.g. table or queue name"}))}),qG=A("nodeType",[Wu,Zu]),Xu=r.Object({from:r.Object({env:r.Optional(r.String({description:"Environment of the source node"})),name:r.String({description:"Name of the source node"})},{description:"Reference to the source node"}),to:r.Object({env:r.Optional(r.String({description:"Environment of the target node"})),name:r.String({description:"Name of the target node"})},{description:"Reference to the target node"}),count:r.Number({description:"Number of cross-service transitions observed"}),errorRate:r.Optional(r.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."})),errorCount:r.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:r.Number({description:"Number of client spans observed on this edge"})}),hqe=d({tags:["service-catalog"],url:`${rr}/services/:serviceId/graph`,method:"GET",params:r.Object({serviceId:m()}),query:r.Object({..._t.properties,query:r.Optional(m({type:"tsuga-query"}))}),response:r.Object({clusterId:r.String(),nodes:r.Array(qG),edges:r.Array(Xu)})}),FG=r.Object({monitors:r.Array(r.Object({id:r.String({description:"Identifier of the monitor"}),name:r.String({description:"Display name of the monitor"}),owner:r.String({description:"Team ID that owns the monitor"}),priority:r.Enum(Ot,{description:"Priority of the monitor"})})),slos:r.Array(r.Object({id:r.String({description:"Identifier of the SLO"}),name:r.String({description:"Display name of the SLO"}),owner:r.String({description:"Team ID that owns the SLO"})}))}),Eqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/services/:serviceId/related-resources`,params:r.Object({serviceId:m()}),response:FG}),Tqe=d({tags:["service-catalog"],method:"GET",url:`${rr}/services/by-api-keys`,response:r.Record(r.String(),r.Array(r.Object({serviceName:r.String(),serviceNamespace:r.Optional(r.String())})))});var Ju=`/${"v1"}/services`,el=r.Pick(ca,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),BG={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",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",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(el,{examples:[BG]});var US=d({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:Ju,method:"GET",paginated:!0,query:r.Object({...te,clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},{description:"Service list query. Use pagination and optional cluster scope."}),response:r.Array(el)}),NS=d({description:"Retrieves one telemetry-inferred service by service ID. Use this to inspect observed metadata and recent activity for a service.",operationId:"getService",tags:["services"],url:`${Ju}/:serviceId`,method:"GET",params:r.Object({serviceId:m({allowEmpty:!1,description:"Identifier of the service catalog entry to retrieve. Use the `id` returned by service list responses."})}),response:el}),HG=r.Pick(Wu,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Observed service node that corresponds to a service catalog entry."}),KG=r.Pick(Zu,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node inferred from spans but not resolved to a service catalog entry."}),zG=A("nodeType",[HG,KG]),VG=r.Pick(Xu,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge between two service graph nodes."}),kS=d({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${Ju}/:serviceId/graph`,method:"GET",params:r.Object({serviceId:m({allowEmpty:!1,description:"Identifier of the service catalog entry to use as the graph root. Use the `id` returned by service list or get responses."})}),query:r.Object({..._t.properties,query:r.Optional(m({type:"tsuga-query",description:"Optional Tsuga query used to filter spans considered for the graph."}))},{description:"Service graph query. Use time range and optional span query filters."}),response:r.Object({clusterId:r.String({description:"Cluster ID the graph was built from"}),nodes:r.Array(zG),edges:r.Array(VG)})});function wS(e,t){let n=t??ur(e);return n===void 0?void 0:Xa(n)}function tl(e){let t=ur(e);return t===void 0?"":` (default: ${t})`}function LS(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${tl("from")}`).option("--to <timestamp>",`End of time range${tl("to")}`).option("--query <query>",`Search query${tl("query")}`).action(async(o,i)=>{let a={},c=wS("from",i.from),u=wS("to",i.to);c!==void 0&&(a.from=c),u!==void 0&&(a.to=u),i.query!==void 0&&(a.query=i.query);let l=await t()(kS,{params:{serviceId:o},query:a});oe(l)})}var MS=require("node:child_process"),vS=require("node:fs"),DS=require("node:os"),lc=require("node:path");var Dn=require("node:fs");function pa(e,t){let n=`${e}.tmp.${process.pid}`;(0,Dn.writeFileSync)(n,t),(0,Dn.renameSync)(n,e)}function ma(e){try{return(0,Dn.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function ua(e,t){if(t===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,Dn.writeFileSync)(n,t),n}function $n(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var rl="tsuga-dev/agent-plugins",mc="tsuga";function uc(e,t){q(` $ ${e} ${t.join(" ")}`);try{(0,MS.execFileSync)(e,t,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${t.join(" ")} exited ${o}`,{cause:n})}}function YG(e,t){q("Claude Code \u2192 installing Tsuga plugin"),uc("claude",["plugin","marketplace","add",rl]),uc("claude",["plugin","install",`tsuga@${mc}`]),t.autoUpdate&&QG(e)}function QG(e){let t=(0,lc.join)(e,".claude","settings.json");q(`Claude Code \u2192 ${t} (autoUpdate)`),(0,vS.mkdirSync)((0,lc.dirname)(t),{recursive:!0});let n=ma(t),o=JSON.parse(n??"{}");if(!$n(o))throw new Error(`${t} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!$n(i))throw new Error(`${t} "extraKnownMarketplaces" must be a JSON object`);let a=i[mc],c=$n(a)?a:{};o.extraKnownMarketplaces={...i,[mc]:{source:{source:"github",repo:rl},...c,autoUpdate:!0}};let u=ua(t,n);pa(t,`${JSON.stringify(o,null,2)}
|
|
130
|
-
`),q(u===void 0?" created":` patched (backup: ${u})`)}function WG(){q("Codex \u2192 installing Tsuga plugin"),uc("codex",["plugin","marketplace","add",rl]),uc("codex",["plugin","add",`tsuga@${mc}`])}function $S(e){let t=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");t.command("claude-code").description("Install the Tsuga plugin into Claude Code").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{YG((0,DS.homedir)(),n),q("Restart your claude session to load the new plugins.")}),t.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{WG(),q("Restart your codex session to load the new plugins.")})}var Ir="/v0/dashboards",jS=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],ZG=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],Vqe=[...ZG,"note"];var XG=["ns","us","ms","s","m","h","days"];var JG=["B","KB","MB","GB","TB","PB"];var e1=20;var qS=r.Object({type:r.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),FS=r.Object({type:r.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:r.Enum(XG,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),BS=r.Object({type:r.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:r.Enum(JG,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),HS=r.Object({type:r.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),KS=r.Object({type:r.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),zS=r.Object({type:r.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),t1=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),r1=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit",maxLength:e1})},{$id:"InputDataNormalizerCustom",title:"Custom"}),pt=A("type",[FS,BS,HS,KS,zS,qS,t1],{title:"Normalizer"}),mt=A("type",[FS,BS,HS,KS,zS,qS,r1],{title:"Normalizer"}),VS=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(pt)},{title:"WidgetListColumn"}),YS=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(mt)},{title:"WidgetListColumn"}),$o=["background","no-background"],n1=["table","legend-only","no-legend"];var o1=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],QS=["alert","warning","success"],nr=r.Object({operator:r.Enum(o1,{description:"Comparator used to evaluate the metric value"}),value:r.Number({description:"Threshold value used when evaluating the operator"}),color:r.Enum(QS,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),i1=r.Object({value:r.Number({description:"Y-axis value where the threshold marker is placed"}),level:r.Enum(QS,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),a1=["sec","min","hour","day"],Jr=r.Object({time:r.Number({description:"Number of units that make up each bar bucket"}),metric:r.Enum(a1,{description:"Unit used to measure the bucket width"})});var Xr=r.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),s1=r.Object({formula:r.Optional(r.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),r.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>".'})))}),c1=r.Object({formula:r.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),m({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>".'})))}),fc={source:bn,queries:$_,formula:r.Optional(G_),aliases:r.Optional(s1),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},gc={source:bn,queries:Bi,formula:r.Optional(Hi),aliases:r.Optional(c1),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Go={...fc,groupBy:r.Optional(fm)},jo={...gc,groupBy:r.Optional(xo)},Ae=r.Enum(n1,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),me=r.Optional(r.Number({description:"Number of decimal places to display in the value"})),vt=r.Optional(r.Array(i1,{description:"Threshold markers displayed on the chart"})),p1=r.Object({name:r.String({description:"Display name of the table column"}),...fc,source:bn,normalizer:r.Optional(pt),precision:me},{title:"TableColumn"}),m1=r.Object({name:m({description:"Display name of the table column"}),...gc,source:bn,normalizer:r.Optional(mt),precision:me},{title:"TableColumn"}),u1=r.Array(r.Object({id:r.String({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),l1=r.Array(r.Object({id:m({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),WS=["horizontal","vertical"],d1=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:r.String({description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(VS,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list cell content wraps instead of being truncated with an ellipsis"}))},{$id:"GraphVisualizationList",title:"List"}),f1=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(YS,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list cell content wraps instead of being truncated with an ellipsis"}))},{$id:"InputGraphVisualizationList",title:"List"}),dc=A("type",[r.Object({type:r.Literal("auto")}),r.Object({type:r.Literal("number"),value:r.Number()})]),qo=r.Object({min:dc,max:dc,scale:A("type",[r.Object({type:r.Literal("pow"),exponent:r.Number()}),r.Object({type:r.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:r.Boolean()}),Fo=r.Object({min:dc,max:dc,scale:A("type",[r.Object({type:r.Literal("pow"),exponent:r.Number({minimum:0})}),r.Object({type:r.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:r.Boolean()}),g1=r.Array(r.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),y1=r.Array(r.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 h1=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(qo)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),E1=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(Fo)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),T1=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),query:r.String({description:"The read-only SQL query to execute against the connection."}),listColumns:r.Optional(r.Array(VS,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list cell content wraps instead of being truncated with an ellipsis"}))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),I1=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:r.Optional(r.Array(YS,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list cell content wraps instead of being truncated with an ellipsis"}))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),_1=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),b1=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),O1=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Ae)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),A1=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),S1=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(qo)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),x1=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(Fo)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),R1=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(pt),legendMode:r.Optional(Ae)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),C1=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(mt),legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),P1=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:r.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(WS,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),U1=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(WS,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),la=r.Array(r.String({description:"PromQL metrics-based aggregation query"})),da=r.Array(m({allowEmpty:!1,type:"long",description:"PromQL metrics-based aggregation query"}),{minItems:1}),N1=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:la,timeBucket:r.Optional(Jr),normalizer:r.Optional(pt),precision:me,legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(qo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),k1=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:da,timeBucket:r.Optional(Jr),normalizer:r.Optional(mt),precision:me,legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(Fo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),w1=r.Object({type:r.Literal("query-value-promql",{description:"Displays a PromQL metrics query-based aggregation as a single value"}),queries:la,backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(pt),legendMode:r.Optional(Ae)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),L1=r.Object({type:r.Literal("query-value-promql",{description:"Displays a PromQL metrics query-based aggregation as a single value"}),queries:da,backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(mt),legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),M1=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:la,normalizer:r.Optional(pt),precision:me,conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),v1=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:da,normalizer:r.Optional(mt),precision:me,conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),D1=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:la,normalizer:r.Optional(pt),precision:me,legendMode:r.Optional(Ae)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),$1=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:da,normalizer:r.Optional(mt),precision:me,legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),G1=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:la,timeBucket:r.Optional(Jr),precision:me,normalizer:r.Optional(pt),thresholds:vt,legendMode:r.Optional(Ae),yAxisSettings:r.Optional(qo)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),j1=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:da,timeBucket:r.Optional(Jr),precision:me,normalizer:r.Optional(mt),thresholds:vt,legendMode:r.Optional(Ae),yAxisSettings:r.Optional(Fo)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),q1=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Go,timeBucket:r.Optional(Jr),normalizer:r.Optional(pt),precision:me,legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(qo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),F1=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...jo,timeBucket:r.Optional(Jr),normalizer:r.Optional(mt),precision:me,legendMode:r.Optional(Ae),thresholds:vt,yAxisSettings:r.Optional(Fo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),B1=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Go,normalizer:r.Optional(pt),precision:me,conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),H1=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...jo,normalizer:r.Optional(mt),precision:me,conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),K1=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Go,normalizer:r.Optional(pt),precision:me,legendMode:r.Optional(Ae)},{$id:"GraphVisualizationPie",title:"Pie"}),z1=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...jo,normalizer:r.Optional(mt),precision:me,legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationPie",title:"Pie"}),V1=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...fc,backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(pt),legendMode:r.Optional(Ae)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),Y1=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...gc,backgroundMode:r.Optional(r.Enum($o,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(nr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(mt),legendMode:r.Optional(Ae)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),Q1=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Go,timeBucket:r.Optional(Jr),precision:me,normalizer:r.Optional(pt),thresholds:vt,legendMode:r.Optional(Ae),yAxisSettings:r.Optional(qo)},{$id:"GraphVisualizationBar",title:"Bar"}),W1=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...jo,timeBucket:r.Optional(Jr),precision:me,normalizer:r.Optional(mt),thresholds:vt,legendMode:r.Optional(Ae),yAxisSettings:r.Optional(Fo)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Z1=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Go,precision:me,normalizer:r.Optional(pt),percentileMarkers:r.Optional(g1),boundsScale:r.Optional(Qs)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),X1=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...jo,precision:me,normalizer:r.Optional(mt),percentileMarkers:r.Optional(y1),boundsScale:r.Optional(Qs)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),ZS=["red","pink","violet","blue","cyan","green","yellow","orange"],XS=r.Enum(ZS,{description:"Color palette used to render the heatmap intensity gradient"}),J1=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Go,precision:me,normalizer:r.Optional(pt),palette:r.Optional(XS)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),ej=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...jo,precision:me,normalizer:r.Optional(mt),palette:r.Optional(XS)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),JS=r.Object({from:r.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:r.Enum(ZS,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold"}),tj=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...fc,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(JS,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:r.Optional(pt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),rj=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...gc,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(JS,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:r.Optional(mt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),nj=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(p1,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(fm),defaultSorting:r.Optional(u1),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"})))},{$id:"GraphVisualizationTable",title:"Table"}),oj=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(m1,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(xo),defaultSorting:r.Optional(l1),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"})))},{$id:"InputGraphVisualizationTable",title:"Table"}),ij=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(r.String({description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(jS,{description:"Background color used to render the note"})),noteAlign:r.Optional(Xr),noteJustifyContent:r.Optional(Xr)},{$id:"GraphVisualizationNote",title:"Note"}),aj=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(jS,{description:"Background color used to render the note"})),noteAlign:r.Optional(Xr),noteJustifyContent:r.Optional(Xr)},{$id:"InputGraphVisualizationNote",title:"Note"}),sj=A("type",[h1,T1,_1,O1,S1,R1,N1,w1,M1,D1,G1,q1,B1,K1,V1,tj,Q1,Z1,J1,nj,d1,ij,P1],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),cj=A("type",[E1,I1,b1,A1,x1,C1,k1,L1,v1,$1,j1,F1,H1,z1,Y1,rj,W1,X1,ej,oj,f1,aj,U1],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),yc=r.Object({id:r.String({description:"Unique identifier of the graph widget inside the dashboard."}),name:r.Optional(r.String({description:"Display name of the graph widget."})),description:r.Optional(r.String({description:"Optional text shown with the graph widget."})),descriptionAlign:r.Optional(Xr),descriptionJustifyContent:r.Optional(Xr),visualization:sj,layout:r.Optional(r.Object({x:r.Number({description:"Horizontal grid position of the widget"}),y:r.Number({description:"Vertical grid position of the widget"}),w:r.Number({description:"Width of the widget in grid units"}),h:r.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),hc=r.Object({id:m({description:"Unique identifier of the graph widget inside the dashboard."}),name:r.Optional(m({description:"Display name of the graph widget."})),description:r.Optional(r.String({minLength:1,maxLength:800,description:"Optional text shown with the graph widget. Maximum length is 800 characters."})),descriptionAlign:r.Optional(Xr),descriptionJustifyContent:r.Optional(Xr),visualization:cj,layout:r.Optional(r.Object({x:r.Number({description:"Horizontal grid position of the widget"}),y:r.Number({description:"Vertical grid position of the widget"}),w:r.Number({description:"Width of the widget in grid units"}),h:r.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),GS=10,pj=r.Array(r.Object({key:r.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(r.String({description:"Allowed value for this dashboard-wide filter."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),mj=r.Array(r.Object({key:m({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(m({description:"Allowed value for this dashboard-wide filter."}))}),{maxItems:GS,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${GS} filters are allowed.`}),Bo=r.Object({id:r.String({description:"Unique identifier of the dashboard. Generated by Tsuga."}),name:r.String({description:"Display name of the dashboard."}),owner:r.String({description:"Team ID that owns and manages the dashboard."}),graphs:r.Array(yc,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(pj),createdAt:T({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:T({description:"Timestamp when Tsuga last updated the dashboard."}),creator:r.Optional(Ee),updater:r.Optional(Ee),tags:We,timePreset:r.Optional(r.Enum(sp,{description:"Relative time preset used when opening the dashboard."})),folderId:r.Optional(r.String({description:"Identifier of the folder containing this dashboard, if any"}))}),Ec=r.Object({name:m({description:"Display name of the dashboard."}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard."}),graphs:r.Array(hc,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(mj),tags:rt,timePreset:r.Optional(r.Enum(sp,{description:"Relative time preset used when opening the dashboard."})),folderId:r.Optional(r.Union([r.Null(),m({allowEmpty:!1})],{description:"Identifier of the folder to place this dashboard in. Pass null to leave it outside a folder."}))}),Ft={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},ex=[Ft.OWNER,Ft.TAGS,Ft.WIDGET_COUNT,Ft.UPDATED_AT,Ft.NAME],Tc=r.Partial(r.Object({owners:mr(m({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:m({allowEmpty:!1,description:"Substring to match against dashboard names."}),exclude:r.Optional(r.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Substring matched against the dashboard name"}),tags:mr(Mn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:m({allowEmpty:!1,description:"Restrict results to dashboards contained in this folder"})},{description:"Optional filters applied to narrow the returned dashboards"})),uj=r.Partial(r.Object({...te,filters:Tc,sort:r.Object({by:r.Enum([Ft.IS_FAVORITE,Ft.OWNER,Ft.TAGS,Ft.WIDGET_COUNT,Ft.UPDATED_AT,Ft.NAME],{description:"Field to sort the returned dashboards by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),Yqe=d({tags:["dashboards"],url:`${Ir}/query`,method:"POST",paginated:!0,response:r.Array(Bo),body:uj}),Qqe=d({tags:["dashboards"],url:`${Ir}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Tc,["tags"]))}),response:Ln}),Wqe=d({tags:["dashboards"],url:`${Ir}/:id`,method:"GET",params:r.Object({id:m()}),response:Bo}),Zqe=d({tags:["dashboards"],url:Ir,method:"POST",body:Ec,response:Bo}),Xqe=d({tags:["dashboards"],url:`${Ir}/:id`,method:"PUT",params:r.Object({id:m()}),body:r.Partial(Ec),response:Bo}),Jqe=d({tags:["dashboards"],url:`${Ir}/bulk-update`,method:"PUT",body:r.Object({dashboardIds:r.Array(m()),owner:m({allowEmpty:!1})}),response:r.Object({})}),eFe=d({tags:["dashboards"],url:`${Ir}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),tFe=d({tags:["dashboards"],url:`${Ir}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:r.Omit(hc,["id"]),response:yc}),rFe=d({tags:["dashboards"],url:`${Ir}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(m())}),response:r.Object({})});var Ho=`/${"v1"}/dashboards`,fa=r.Pick(Bo,["id","name","owner","graphs","filters","tags","timePreset","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)."}),lj={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",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"};Object.assign(fa,{examples:[lj]});var tx=r.Partial(r.Object({...te,filters:Tc,sort:r.Object({by:r.Enum([...ex],{description:"Field to sort the returned dashboards by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})}),{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),dj={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(tx,{examples:[dj]});var rx=d({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${Ho}/query`,method:"POST",paginated:!0,body:tx,response:r.Array(fa)}),nx=d({description:"Retrieves one dashboard by ID when the authenticated operation key can read it. Use this before updating or cloning a dashboard definition.",operationId:"getDashboard",tags:["dashboards"],url:`${Ho}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:fa}),nl=r.Pick(Ec,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),fj={name:"API Performance Overview",owner:"abc-123-def",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",folderId:null};Object.assign(nl,{examples:[fj]});var ox=d({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:Ho,method:"POST",body:nl,response:fa}),ix=d({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${Ho}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:r.Partial(nl),response:fa}),gj=r.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),ax=d({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${Ho}/:id`,method:"DELETE",params:gj,response:L}),mFe=d({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Ho}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:m({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:r.Omit(hc,["id"]),response:yc});var sx=100,cx=3,Ko=r.Object({id:r.String({description:"Unique identifier of the ingestion API key. Generated by Tsuga."}),name:r.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:r.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:r.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Ln,teamOverrideFields:r.Optional(r.Array(r.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:T({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:T({description:"Timestamp when Tsuga created the key."}),creator:r.Optional(Ee),updater:r.Optional(Ee),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),ga=r.Object({name:r.String({format:Bs,minLength:1,maxLength:sx,description:`Kebab-case name for the ingestion API key. Maximum length is ${sx} characters.`}),owner:m({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Mn,teamOverrideFields:r.Union([r.Array(m({allowEmpty:!1}),{minItems:1,maxItems:cx,description:`Telemetry attribute names used to override ownership for data sent with this key. Up to ${cx} fields are allowed.`}),r.Null({description:"Clear any existing team override fields."})])}),ya="/v0/ingestion-api-keys",TFe=d({tags:["ingestion-api-keys"],url:ya,method:"POST",body:ga,response:r.Intersect([Ko,r.Object({key:r.String()})])}),IFe=d({tags:["ingestion-api-keys"],url:ya,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(Ko)}),_Fe=d({tags:["ingestion-api-keys"],url:`${ya}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1})}),response:Ko}),bFe=d({tags:["ingestion-api-keys"],url:`${ya}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1})}),body:ga,response:Ko}),OFe=d({tags:["ingestion-api-keys"],url:`${ya}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1})}),response:L});var ha=`/${"v1"}/ingestion-api-keys`,Ea=r.Pick(Ko,["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)."}),px={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Ea,{examples:[px]});var mx=r.Pick(ga,["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."}),ux=r.Pick(ga,["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."}),lx={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(mx,{examples:[lx]});Object.assign(ux,{examples:[lx]});var yj={...px,key:"tsuga_in:v1:abc123xyx7Qm"},dx=d({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:ha,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(Ea)}),NFe=d({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:`${ha}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Ea}),hj=r.Intersect([r.Pick(Ea,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),r.Object({key:r.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:yj}),fx=d({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:ha,method:"POST",body:mx,response:hj}),gx=d({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:`${ha}/:id`,method:"PUT",params:r.Object({id:m({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:ux,response:Ea}),yx=d({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:`${ha}/:id`,method:"DELETE",params:r.Object({id:m({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:L});var Ej={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"]}},[MFe,vFe,DFe]=Tj(Ej);function Tj(e){let t=[],n=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let c=e[a];for(let u in c){n.push(u);let l=c[u];Array.isArray(l)&&o.push(...l)}}return[ol(t),ol(n),ol(o)]}function ol(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var il=r.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),Ij=r.Object({versioningStatus:r.Optional(r.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),_j=r.Object({domainName:r.Optional(r.String()),origins:r.Optional(r.Array(r.String()))}),bj=r.Object({allocatedStorageGib:r.Optional(r.Number()),encryptedAtRest:r.Optional(r.Boolean()),engine:r.Optional(r.String()),dynamoDbItemCount:r.Optional(r.Number()),dynamoDbActualSizeGib:r.Optional(r.Number())}),Oj=r.Object({version:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnets:r.Optional(r.Array(r.String()))}),Aj=r.Object({artifactRegistryFormat:r.Optional(r.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:r.Optional(r.String()),tagMutability:r.Optional(r.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:r.Optional(r.Boolean()),encryptionType:r.Optional(r.String())}),Sj=r.Object({status:r.Optional(r.String()),activeServices:r.Optional(r.Number()),pendingTasks:r.Optional(r.Number()),runningTasks:r.Optional(r.Number()),registeredContainerInstances:r.Optional(r.Number()),capacityProviders:r.Optional(r.Array(r.String()))}),xj=r.Object({status:r.Optional(r.String()),desiredStatus:r.Optional(r.String()),healthStatus:r.Optional(r.String()),availabilityZone:r.Optional(r.String()),startedAt:r.Optional(T())}),Rj=r.Object({isEncrypted:r.Optional(r.Boolean()),ownerId:r.Optional(r.String()),state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","updating"]))}),Cj=r.Object({type:r.Optional(r.String()),osType:r.Optional(r.String()),subnetIds:r.Optional(r.Array(r.String())),nbContainers:r.Optional(r.Number())}),Pj=r.Object({digest:r.String(),imageTags:r.Array(r.String()),imageSizeBytes:r.Optional(r.Number()),imagePushedAt:r.Optional(T()),mediaType:r.Optional(r.String()),repositoryName:r.String(),repositoryId:r.Optional(r.String()),scanStatus:r.Optional(r.String())}),Uj=r.Object({url:r.Optional(r.String()),maxMessageSizeBytes:r.Optional(r.Number()),messageRetentionHours:r.Optional(r.Number())}),Nj=r.Object({runtime:r.Optional(r.String()),memoryAllocationMib:r.Optional(r.Number()),timeoutMs:r.Optional(r.Number()),codeSha256:r.Optional(r.String())}),kj=r.Object({kind:r.Optional(r.String())}),wj=r.Object({instanceId:r.String(),architecture:r.Optional(r.String()),instanceType:r.Optional(r.String()),operatingSystem:r.Optional(r.String()),memoryMib:r.Optional(r.Number()),vCpus:r.Optional(r.Number()),vpcId:r.Optional(r.String()),k8sClusterId:r.Optional(r.String())}),Lj=r.Object({id:r.Optional(r.String()),ipCidrBlocks:r.Array(r.String())}),Mj=r.Object({protocol:r.Optional(il),port:r.Optional(r.Number()),instanceProtocol:r.Optional(il),instancePort:r.Optional(r.Number())}),vj=r.Object({protocol:r.Optional(r.String()),ports:r.Optional(r.Array(r.String())),portRange:r.Optional(r.String()),allPorts:r.Optional(r.Boolean())}),Dj=r.Object({name:r.String(),ip:r.Optional(r.String()),type:r.Enum(["public","private"])}),$j=r.Object({type:r.String(),name:r.String()}),Gj=r.Object({frontendIp:r.Optional(Dj),backendIpPools:r.Array($j)}),jj=r.Object({targetId:r.String(),targetPort:r.Optional(r.Number()),targetType:r.Optional(r.Enum(["instance","ip","lambda","alb"])),healthState:r.Optional(r.String()),healthReason:r.Optional(r.String()),healthDescription:r.Optional(r.String()),availabilityZone:r.Optional(r.String())}),qj=r.Object({protocol:r.Optional(il),port:r.Optional(r.Number()),type:r.Optional(r.Enum(["alb","lambda","instance","ip"])),name:r.Optional(r.String()),targetGroupArn:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),healthCheckProtocol:r.Optional(r.String()),healthCheckPort:r.Optional(r.String()),healthCheckPath:r.Optional(r.String()),healthCheckIntervalSeconds:r.Optional(r.Number()),healthCheckTimeoutSeconds:r.Optional(r.Number()),healthyThresholdCount:r.Optional(r.Number()),unhealthyThresholdCount:r.Optional(r.Number()),targets:r.Optional(r.Array(jj)),targetCount:r.Optional(r.Number()),healthyTargetCount:r.Optional(r.Number()),loadBalancerArns:r.Optional(r.Array(r.String()))}),Fj=r.Object({first:r.Optional(r.String()),last:r.Optional(r.String()),scope:r.Optional(r.Number())}),Bj=r.Object({type:r.Optional(r.String()),name:r.Optional(r.String()),alwaysServe:r.Optional(r.Boolean()),subnets:r.Optional(r.Array(r.Union([r.Number(),Fj]))),target:r.Optional(r.String()),weight:r.Optional(r.Number()),priority:r.Optional(r.Number()),status:r.Optional(r.String())}),Hj=r.Object({instanceId:r.Optional(r.String()),state:r.Optional(r.String()),reasonCode:r.Optional(r.String()),description:r.Optional(r.String())}),Kj=r.Object({loadBalancerType:r.Optional(r.String()),dnsName:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnetIds:r.Array(r.String()),scheme:r.Optional(r.String()),listeners:r.Optional(r.Union([r.Array(Mj),r.Array(vj)])),targets:r.Optional(r.Union([r.Array(r.String()),r.Array(Hj),r.Array(Bj)])),azureLoadBalancingRules:r.Optional(r.Array(Gj))}),zj=r.Object({domainName:r.Optional(r.String()),expiresAt:r.Optional(T()),inUseBy:r.Optional(r.Array(r.String())),renewalEligibility:r.Optional(r.String()),revokedAt:r.Optional(T()),status:r.Optional(r.String()),type:r.Optional(r.String())}),Vj=r.Object({state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:r.Optional(r.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),Yj=r.Object({osType:r.Optional(r.Enum(["Windows","Linux"]))}),Qj=r.Object({state:r.Optional(r.String()),volumeType:r.Optional(r.String())}),Wj=r.Intersect([r.Object({isEncrypted:r.Optional(r.Boolean()),sizeGib:r.Optional(r.Number())}),r.Union([Vj,Qj,Yj])]),Zj=r.Object({instanceCount:r.Optional(r.Number()),hostnames:r.Optional(r.Array(r.String())),runtime:r.Optional(r.String())}),Ic=r.Union([r.Object({category:r.Literal("application"),resourceType:r.Literal("webService"),attributes:r.Optional(Zj)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("bucket"),attributes:r.Optional(Ij)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("messagingService"),attributes:r.Optional(Uj)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("fileSystem"),attributes:r.Optional(Rj)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("contentDeliveryNetwork"),attributes:r.Optional(_j)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("database"),attributes:r.Optional(bj)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("storageAccount"),attributes:r.Optional(kj)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("volume"),attributes:r.Optional(Wj)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("virtualMachine"),attributes:r.Optional(wj)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("serverless"),attributes:r.Optional(Nj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("kubernetesCluster"),attributes:r.Optional(Oj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerRepository"),attributes:r.Optional(Aj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerCluster"),attributes:r.Optional(Sj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerServiceTask"),attributes:r.Optional(xj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerService"),attributes:r.Optional(Cj)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerImage"),attributes:r.Optional(Pj)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("virtualNetwork"),attributes:r.Optional(Lj)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("loadBalancer"),attributes:Kj}),r.Object({category:r.Literal("network"),resourceType:r.Literal("targetGroup"),attributes:r.Optional(qj)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("certificate"),attributes:r.Optional(zj)})]);var Ta="/v0/inventory",al=["aws","gcp","azure"],hx=["scan_in_progress","success","failure"],sl=r.Object({id:r.String({description:"Identifier of the inventory resource"}),cloudPlatform:r.Enum(al,{description:"Cloud platform that hosts this resource"}),cloudAccount:r.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:r.Optional(r.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:r.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:r.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:r.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:r.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:r.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:We,nativeAttributes:r.Optional(r.Unsafe({type:"object",additionalProperties:!0})),covered:r.Optional(r.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),KFe=d({tags:["inventory"],method:"GET",url:`${Ta}/resources`,paginated:!0,query:r.Object(te),response:r.Array(r.Intersect([sl,Ic]))}),Xj=A("type",[r.Object({type:r.Literal("aws"),accountId:r.String(),externalId:r.String(),roleArn:r.String()}),r.Object({type:r.Literal("gcp"),projectId:r.String(),serviceAccountId:r.String(),workloadIdentityProvider:r.String()}),r.Object({type:r.Literal("azure"),clientId:r.String(),subscriptionId:r.String(),tenantId:r.String()})]),Jj=r.Object({type:r.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),eq=r.Object({type:r.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),tq=r.Object({type:r.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),Ex=A("type",[Jj,eq,tq]),_c=r.Object({id:r.String(),cloudType:r.Enum(al),cloudAccountId:r.String(),accountFriendlyName:r.Optional(r.String()),organizationId:r.Optional(r.String()),connectionSettings:Xj,createdBy:r.Optional(r.String()),createdAt:T(),lastScanStartedAt:r.Optional(T()),lastScanFinishedAt:r.Optional(T()),lastScanStatus:r.Optional(r.Enum(hx))}),rq=r.Object({cloudType:r.Enum(al),cloudAccountId:m(),accountFriendlyName:r.Optional(m()),organizationId:r.Optional(m()),connectionSettings:Ex,lastScanStatus:r.Optional(r.Enum(hx))}),Gn=`${Ta}/cloud-accounts`,zFe=d({tags:["inventory"],url:Gn,method:"GET",response:r.Array(_c)}),VFe=d({tags:["inventory"],url:`${Gn}/:id`,method:"GET",params:r.Object({id:m()}),response:_c}),YFe=d({tags:["inventory"],url:Gn,method:"POST",body:rq,response:_c}),QFe=d({tags:["inventory"],url:`${Gn}/:id`,method:"PUT",params:r.Object({id:m()}),body:r.Object({accountFriendlyName:m()}),response:_c}),WFe=d({tags:["inventory"],url:`${Gn}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),ZFe=d({tags:["inventory"],url:`${Ta}/trigger-scan`,method:"POST",body:r.Object({}),response:r.Object({success:r.Literal(!0)})}),XFe=d({tags:["inventory"],url:`${Gn}/azure/onboarding`,method:"POST",body:r.Object({tenantId:m()}),response:r.Object({subjectId:r.String(),audience:r.String()})}),JFe=d({tags:["inventory"],method:"POST",url:`${Gn}/validate/:type`,params:r.Object({type:m()}),body:r.Object({data:Ex,id:r.Optional(m())}),response:r.Object({areAccountSettingsValid:r.Boolean(),message:r.Optional(r.String())})}),Tx=`${Ta}/settings`,eBe=d({tags:["inventory"],url:Tx,method:"GET",response:r.Object({settings:r.Optional(r.Object({id:r.String(),infrastructureIdentifiers:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))}))})}),nq=50,tBe=d({tags:["inventory"],url:Tx,method:"POST",body:r.Object({infrastructureIdentifiers:r.Array(r.Object({name:m({allowEmpty:!1}),value:r.Optional(m({allowEmpty:!1}))}),{maxItems:nq})}),response:r.Object({})}),rBe=d({tags:["inventory"],url:`${Ta}/iac-tags-proposal`,method:"GET",response:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))});var oq=`/${"v1"}/inventory`,iq=r.Omit(sl,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Ix=r.Intersect([iq,Ic],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with category, resource type, and category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),aq={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(Ix,{examples:[aq]});var _x=d({description:"Lists cloud resources discovered by inventory scans. Use this endpoint to build infrastructure inventories across connected cloud accounts. Pagination fields limit the returned page.",operationId:"listInventoryResources",tags:["inventory"],url:`${oq}/resources`,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(Ix)});var Ia="/v0/investigations",sq=["dashboard","monitor","service","slo","log-route"],cq=r.Object({type:r.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:r.String({description:"Identifier of the linked asset"})}),pq=r.Object({type:r.Enum(sq,{description:"Kind of linked asset"}),id:m({allowEmpty:!1,description:"Identifier of the linked asset"})}),_r=r.Object({id:r.String({description:"Identifier of the investigation"}),name:r.String({description:"Human readable name shown for the investigation"}),contentMd:r.Optional(r.String({description:"Markdown content capturing the investigation notes and findings"})),tags:We,owner:r.String({description:"Team ID owning the investigation"}),env:r.Optional(r.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:r.Array(cq,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:r.Optional(Ee),updater:r.Optional(Ee),createdAt:T(),updatedAt:T()},{title:"Investigation"}),_a=r.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the investigation"}),contentMd:r.Optional(m({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:rt,owner:m({allowEmpty:!1,description:"Team ID owning the investigation"}),env:r.Optional(m({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:r.Optional(r.Array(pq,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),hBe=d({tags:["investigations"],url:Ia,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(_r)}),EBe=d({tags:["investigations"],url:`${Ia}/:id`,params:r.Object({id:m()}),method:"GET",response:_r}),TBe=d({tags:["investigations"],url:Ia,method:"POST",body:_a,response:_r}),IBe=d({tags:["investigations"],url:`${Ia}/:id`,method:"PUT",body:_a,params:r.Object({id:m()}),response:_r}),_Be=d({tags:["investigations"],url:`${Ia}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L});var ba=`/${"v1"}/investigations`,bx=d({description:"Retrieve all investigations",tags:["private"],url:ba,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(_r)}),Ox=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${ba}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1})}),response:_r}),Ax=d({description:"Create a new investigation",tags:["private"],url:ba,method:"POST",body:_a,response:_r}),Sx=d({description:"Update an investigation by its id",tags:["private"],url:`${ba}/:id`,method:"PUT",body:_a,params:r.Object({id:m({allowEmpty:!1})}),response:_r}),xx=d({description:"Delete an investigation by its id",tags:["private"],url:`${ba}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1})}),response:L});var Oa=`/${"v1"}/monitors`,Aa=r.Pick(Tr,["id","name","message","tags","configuration","priority","owner","dashboardId","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)."}),mq={id:"123-456-abc",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,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},uq={id:"456-789-def",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:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Aa,{examples:[mq,uq]});var Rx=r.Pick(Qu,["filters","sort","limit","offset"],{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),lq={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Rx,{examples:[lq]});var Cx=d({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${Oa}/query`,method:"POST",paginated:!0,body:Rx,response:r.Array(Aa)}),Px=d({description:"Retrieves one monitor definition by ID when the authenticated operation key can read it. Use this before updating, duplicating, or auditing a monitor.",operationId:"getMonitor",tags:["monitors"],url:`${Oa}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Aa}),Ux=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],Nx=r.Pick(aa,Ux,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),kx=r.Pick(aa,Ux,{$id:"UpdateMonitorRequest",description:"Monitor update request. Send the full monitor definition, including ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),wx={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,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Lx={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:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Nx,{examples:[wx,Lx]});Object.assign(kx,{examples:[wx,Lx]});var Mx=d({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, or new error patterns depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:Oa,method:"POST",body:Nx,response:Aa}),vx=d({description:"Replaces an existing monitor definition by ID. Send the full monitor input shape, including configuration, ownership, permissions, and cluster scope.",operationId:"updateMonitor",tags:["monitors"],url:`${Oa}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:kx,response:Aa}),dq=r.Object({id:m({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),Dx=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${Oa}/:id`,method:"DELETE",params:dq,response:L});var Sa="/v0/notifications",qn=`${Sa}/rules`,$x=`${Sa}/slack/setup`,bc=`${Sa}/integrations`,jn=["triggered","resolved","no-data"],fq=["sent","stale","pending","rate-limited","failed","silenced"],gq=r.Optional(r.Object({maxMessages:r.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:r.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),yq=r.Optional(r.Object({maxMessages:r.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:r.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),hq=r.Optional(r.Object({mode:r.Literal("each"),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:r.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Eq=r.Optional(r.Object({mode:r.Literal("each"),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:r.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Tq=r.Object({id:r.String({description:"Identifier of the notification target"}),rateLimit:gq,renotifyConfig:hq,config:A("type",[r.Object({type:r.Literal("slack"),channel:r.String({description:"Slack channel ID that receives the notification"}),integrationId:r.String({description:"Slack workspace ID that receives the notification"}),integrationName:r.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),r.Object({type:r.Literal("incident-io"),integrationId:r.String({description:"Identifier of the incident.io integration to use"}),integrationName:r.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),r.Object({type:r.Literal("email"),addresses:r.Array(r.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),r.Object({type:r.Literal("grafana-irm"),integrationId:r.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:r.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),r.Object({type:r.Literal("pagerduty"),integrationId:r.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:r.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),r.Object({type:r.Literal("microsoft-teams"),integrationId:r.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:r.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),r.Object({type:r.Literal("webhook"),integrationId:r.String({description:"Identifier of the webhook integration to use"}),integrationName:r.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),r.Object({type:r.Literal("servicenow"),integrationId:r.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:r.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),r.Object({type:r.Literal("google-chat"),integrationId:r.String({description:"Identifier of the Google Chat integration to use"}),integrationName:r.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),r.Object({type:r.Literal("squadcast"),integrationId:r.String({description:"Identifier of the Squadcast integration to use"}),integrationName:r.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),Iq=r.Object({id:m({description:"Identifier of the notification target"}),rateLimit:yq,config:A("type",[r.Object({type:r.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),r.Object({type:r.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),r.Object({type:r.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),r.Object({type:r.Literal("email"),addresses:r.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),r.Object({type:r.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),r.Object({type:r.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),r.Object({type:r.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),r.Object({type:r.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),r.Object({type:r.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),r.Object({type:r.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:Eq}),cl=A("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with specific teams."}),teams:r.Array(r.String(),{description:"Team IDs to select"})}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for all teams."})}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for public teams."})})]),pl=A("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with specific teams."}),teams:r.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for all teams."})}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for public teams."})})]),zo=r.Object({id:r.String({description:"Unique identifier of the notification rule. Generated by Tsuga."}),name:r.String({description:"Display name of the notification rule."}),queryString:r.Optional(r.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:cl,prioritiesFilter:r.Array(r.Enum(Ot),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:r.Array(r.Enum(jn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:r.Array(r.String(),{description:"Cluster IDs that can trigger a notification"}),owner:r.String({description:"Team ID that owns and manages the rule."}),createdAt:T({description:"Timestamp when Tsuga created the rule."}),updatedAt:T({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:We,targets:r.Array(Tq,{description:"Notification targets that can receive notifications when the rule matches"}),creator:r.Optional(Ee),updater:r.Optional(Ee)}),xa=r.Object({name:m({description:"Display name of the notification rule."}),queryString:r.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:pl,prioritiesFilter:r.Array(r.Enum(Ot),{maxItems:Ot.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:r.Array(r.Enum(jn),{maxItems:jn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:r.Optional(r.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:rt,isActive:r.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:r.Array(Iq,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),HBe=d({tags:["notification-rules"],url:qn,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(zo)}),KBe=d({tags:["notification-rules"],url:`${qn}/:id`,params:r.Object({id:m()}),method:"GET",response:zo}),zBe=d({tags:["notification-rules"],url:qn,method:"POST",body:xa,response:zo}),VBe=d({tags:["notification-rules"],url:`${qn}/:id`,method:"PUT",params:r.Object({id:m()}),body:xa,response:zo}),YBe=d({tags:["notification-rules"],url:`${qn}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),QBe=d({tags:["notification-integrations"],url:`${$x}/start`,method:"POST",response:r.Object({redirectUrl:r.String()})}),_q=r.Object({id:r.String(),name:r.String(),type:r.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:r.Number(),creator:r.Optional(Ee)}),WBe=d({tags:["notification-integrations"],url:`${qn}/integrations`,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(_q)}),ZBe=d({tags:["notification-integrations"],url:`${$x}/callback`,method:"GET",query:r.Object({code:m()}),response:r.Object({success:r.Boolean()})}),ml=["POST","PUT"],bq=r.Record(r.String(),r.String()),Oq=r.Record(r.String(),r.Unknown()),Aq=r.Record(r.String(),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))])),Sq=A("type",[r.Object({type:r.Literal("json"),value:Oq}),r.Object({type:r.Literal("form"),value:Aq})]),xq=r.Object({ok:r.String(),alert:r.String()}),ul=r.Object({id:r.String(),name:r.String(),setting:A("type",[r.Object({type:r.Literal("incident-io"),alertSourceConfigId:r.String(),tokenLastChars:r.String()}),r.Object({type:r.Literal("grafana-irm"),urlLastChars:r.String()}),r.Object({type:r.Literal("pagerduty"),integrationKeyLastChars:r.String()}),r.Object({type:r.Literal("microsoft-teams"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("webhook"),urlLastChars:r.String(),method:r.Enum(ml),authentication:A("type",[r.Object({type:r.Literal("bearer"),tokenLastChars:r.String()}),r.Object({type:r.Literal("basic"),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("custom-header"),key:r.String(),valueLastChars:r.String()}),r.Object({type:r.Literal("none")})]),customHeaders:r.Optional(bq),payloadTemplate:Sq,eventNameMapping:r.Optional(xq)}),r.Object({type:r.Literal("servicenow"),instanceName:r.String(),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("google-chat"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("squadcast"),webhookUrlLastChars:r.String()})]),tags:We}),Rq=r.Object({type:r.Literal("webhook"),url:m({type:"uri"}),method:r.Enum(ml),authentication:A("type",[r.Object({type:r.Literal("bearer"),token:m({allowEmpty:!1})}),r.Object({type:r.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),r.Object({type:r.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),r.Object({type:r.Literal("none")})]),customHeaders:r.Record(m({allowEmpty:!1}),m()),payloadTemplate:A("type",[r.Object({type:r.Literal("json"),value:r.Record(m({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(m({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})]),eventNameMapping:r.Optional(r.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),Gx=r.Object({type:r.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),jx=r.Object({type:r.Literal("grafana-irm"),url:m({type:"uri"})}),qx=r.Object({type:r.Literal("pagerduty"),integrationKey:m()}),Fx=r.Object({type:r.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),Cq=r.Object({type:r.Literal("servicenow"),instanceName:m({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:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),Pq=r.Object({type:r.Literal("google-chat"),webhookUrl:m({type:"uri"})}),Uq=r.Object({type:r.Literal("squadcast"),webhookUrl:m({type:"uri"})}),Nq=r.Object({name:m(),setting:A("type",[Gx,jx,qx,Fx,Rq,Cq,Pq,Uq]),tags:rt}),kq=r.Object({type:r.Literal("webhook"),url:r.Optional(m({type:"uri"})),method:r.Optional(r.Enum(ml)),authentication:r.Optional(A("type",[r.Object({type:r.Literal("bearer"),token:r.Optional(m({allowEmpty:!1}))}),r.Object({type:r.Literal("basic"),username:r.Optional(m({allowEmpty:!1})),password:r.Optional(m({allowEmpty:!1}))}),r.Object({type:r.Literal("custom-header"),key:r.Optional(m({allowEmpty:!1})),value:r.Optional(m({allowEmpty:!1}))}),r.Object({type:r.Literal("none")})])),customHeaders:r.Optional(r.Record(m({allowEmpty:!1}),m())),payloadTemplate:r.Optional(A("type",[r.Object({type:r.Literal("json"),value:r.Record(m({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(m({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})])),eventNameMapping:r.Optional(r.Object({ok:r.Optional(m({allowEmpty:!1})),alert:r.Optional(m({allowEmpty:!1}))}))}),wq=r.Object({type:r.Literal("servicenow"),instanceName:r.Optional(m({allowEmpty:!1})),username:r.Optional(m({allowEmpty:!1})),password:r.Optional(m({allowEmpty:!1}))}),Lq=r.Object({type:r.Literal("google-chat"),webhookUrl:m({type:"uri"})}),Mq=r.Object({type:r.Literal("squadcast"),webhookUrl:m({type:"uri"})}),vq=r.Object({name:r.Optional(m()),setting:r.Optional(A("type",[Gx,jx,qx,Fx,kq,wq,Lq,Mq]))}),XBe=d({tags:["notification-integrations"],url:bc,method:"POST",body:Nq,response:ul}),JBe=d({tags:["notification-integrations"],url:`${bc}/:id`,method:"GET",params:r.Object({id:m()}),response:ul}),eHe=d({tags:["notification-integrations"],url:`${bc}/:id`,method:"PUT",params:r.Object({id:m()}),body:vq,response:ul}),tHe=d({tags:["notification-integrations"],url:`${bc}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),rHe=d({tags:["notification-rules"],url:`${At}/:id/notifications`,method:"GET",params:r.Object({id:m()}),query:r.Optional(r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number())})),response:r.Object({notifications:r.Array(r.Object({id:r.String(),monitorId:r.String(),monitorResultId:r.String(),ruleId:r.Optional(r.String()),targetId:r.Optional(r.String()),status:r.Enum(fq),tryCount:r.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:r.Optional(T())})),isTruncated:r.Boolean()})}),Dq=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],nHe=d({tags:["notification-rules"],url:`${qn}/test`,method:"POST",body:r.Object({notificationRule:xa,targetIds:r.Optional(r.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:r.Union([r.Object({success:r.Literal(!1),overallMessage:r.String({description:"Message when there is an overall error"})}),r.Object({success:r.Boolean(),results:r.Array(r.Object({targetId:r.String({description:"The ID of the target that was tested"}),targetType:r.Enum(Dq,{description:"The type of the target (e.g., slack, webhook)"}),status:r.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:r.Optional(r.String({description:"Message if the notification failed for this specific target"}))}))})])});var Ra=`/${"v1"}/notification-rules`,Ca=r.Pick(zo,["id","name","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)."}),$q={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Ca,{examples:[$q]});var Bx=d({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:Ra,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(Ca)}),Hx=d({description:"Retrieves one notification rule by ID when the authenticated operation key can read it. Use this before updating routing or target configuration.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ra}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:Ca}),ll=r.Pick(xa,["name","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."}),Gq={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(ll,{examples:[Gq]});var Kx=d({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:Ra,method:"POST",body:ll,response:Ca}),zx=d({description:"Replaces an existing notification rule by ID. Send the full rule input shape, including filters, owner, active state, tags, and targets.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Ra}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:ll,response:Ca}),jq=r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),Vx=d({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:`${Ra}/:id`,method:"DELETE",params:jq,response:L});var Vo=`${Sa}/silences`,Yx=r.Union([r.Literal("monday"),r.Literal("tuesday"),r.Literal("wednesday"),r.Literal("thursday"),r.Literal("friday"),r.Literal("saturday"),r.Literal("sunday")]),qq=r.Partial(r.Record(Yx,r.Array(r.Object({startTime:r.String({format:Xp,description:"Start time for the silence window on this day."}),endTime:r.String({format:Xp,description:"End time for the silence window on this day."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Fq=r.Partial(r.Record(Yx,r.Array(r.Object({startTime:r.String({description:"Start time for the silence window on this day."}),endTime:r.String({description:"End time for the silence window on this day."})},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Oc='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Qx="One-time silence schedule with specific start and end times",Wx="Recurring weekly silence schedule",Bq=A("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({format:Jp,description:"Start date and time for the one-time silence."}),endTime:r.String({format:Jp,description:"End date and time for the one-time silence."}),timeZone:r.Optional(r.String({format:Zp,description:Oc}))},{$id:"InputSilenceScheduleOneTime",description:Qx}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:qq,timeZone:r.Optional(r.String({format:Zp,description:Oc}))},{$id:"InputSilenceScheduleRecurring",description:Wx})],{description:"Schedule defining when the silence is active"}),Hq=A("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({description:"Start date and time for the one-time silence."}),endTime:r.String({description:"End date and time for the one-time silence."}),timeZone:r.Optional(r.String({description:Oc}))},{$id:"OutputSilenceScheduleOneTime",description:Qx}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:Fq,timeZone:r.Optional(r.String({description:Oc}))},{$id:"OutputSilenceScheduleRecurring",description:Wx})],{description:"Schedule defining when the silence is active"}),Ac=r.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,type:"long",description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:rt,isActive:r.Boolean({description:"Whether the silence is currently enabled"}),schedule:Bq,notificationRuleIds:r.Optional(r.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:r.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:pl,prioritiesFilter:r.Array(r.Enum(Ot),{maxItems:Ot.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:r.Array(r.Enum(jn),{maxItems:jn.length,description:"Transition types to filter which alerts this silence applies to"})}),Yo=r.Object({id:r.String({description:"Unique identifier of the silence"}),name:r.String({description:"Display name of the silence"}),reason:r.String({description:"Reason for the silence"}),owner:r.String({description:"Team ID that owns and manages the silence"}),tags:We,isActive:r.Boolean({description:"Whether the silence is currently enabled"}),schedule:Hq,notificationRuleIds:r.Optional(r.Array(r.String(),{description:"Notification rule IDs this silence applies to"})),queryString:r.Optional(r.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:cl,prioritiesFilter:r.Array(r.Enum(Ot),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:r.Array(r.Enum(jn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:r.Optional(Ee),updater:r.Optional(Ee)}),_He=d({tags:["notification-silences"],url:Vo,method:"GET",response:r.Array(Yo)}),bHe=d({tags:["notification-silences"],url:`${Vo}/:id`,params:r.Object({id:m()}),method:"GET",response:Yo}),OHe=d({tags:["notification-silences"],url:Vo,method:"POST",body:Ac,response:Yo}),AHe=d({tags:["notification-silences"],url:`${Vo}/:id`,method:"PUT",params:r.Object({id:m()}),body:Ac,response:Yo}),SHe=d({tags:["notification-silences"],url:`${Vo}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),xHe=d({tags:["notification-silences"],url:`${Vo}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(m())}),response:r.Object({})});var Pa=`/${"v1"}/notification-silences`,Sc=r.Pick(Yo,["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)."}),Zx=d({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:Pa,method:"GET",response:r.Array(Sc)}),Xx=d({description:"Retrieves one notification silence by ID when the authenticated operation key can read it. Use this before updating a mute schedule or filter.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${Pa}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:Sc}),Jx=r.Pick(Ac,["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."}),eR=d({description:"Creates a notification silence. Matching notifications are suppressed during the configured schedule; monitor evaluation is not paused.",operationId:"createNotificationSilence",tags:["notification-silences"],url:Pa,method:"POST",body:Jx,response:Sc}),tR=d({description:"Replaces an existing notification silence by ID. Send the full silence input shape, including schedule, filters, owner, active state, and tags.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${Pa}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Jx,response:Sc}),Kq=r.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),rR=d({description:"Deletes a notification silence by ID. Matching notifications are no longer suppressed by this silence.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${Pa}/:id`,method:"DELETE",params:Kq,response:L});var zq={critical:3,important:2,normal:1},se=e=>({label:e,weight:zq[e]}),Vq={"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:"log",category:"routing",impact:se("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:"log",category:"routing",impact:se("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:"resource",category:"routing",impact:se("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"service-name-present":{key:"service-name-present",title:`${pc} present`,summary:`Logs and spans must populate ${pc} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"hygiene",impact:se("critical"),recommendation:`Populate ${pc} 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:"integrity",impact:se("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:"consistency",impact:se("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:`${sa} presence`,summary:`Logs and spans must populate ${sa} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"hygiene",impact:se("important"),recommendation:`Populate ${sa} 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:"consistency",impact:se("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"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:"redundancy",impact:se("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:"cost",impact:se("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:"hygiene",impact:se("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:"integrity",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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:"integrity",impact:se("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 ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"cost",impact:se("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows 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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"integrity",impact:se("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:"hygiene",impact:se("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 k8sattributes 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:"hygiene",impact:se("important"),recommendation:"Enable the OpenTelemetry Collector k8sclusterreceiver (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:"hygiene",impact:se("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."},"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:"consistency",impact:se("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:"resource",category:"hygiene",impact:se("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:"resource",category:"hygiene",impact:se("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 ${_S} 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:"integrity",impact:se("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"},"db-server-metrics-collected":{key:"db-server-metrics-collected",title:"Database server metrics collected",summary:"Every database technology seen in client spans should have its OpenTelemetry server-metrics receiver configured.",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:"hygiene",impact:se("important"),recommendation:"Configure the matching OpenTelemetry server-metrics receiver for each detected database technology (for example postgresqlreceiver, mysqlreceiver, mongodbreceiver, redisreceiver).",scope:"global"}},nR=Object.values(Vq);var oR=["passed","failed","ignored"],Yq=r.Enum(oR),fl=["unrouted-logs","no-over-routed-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","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","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation","db-server-metrics-collected"],Qq=r.Enum(fl),Wq=["log","metric","resource","span"],Zq=["team","global"],gl=r.Object({key:r.Enum(fl),title:r.String(),summary:r.String(),rationale:r.String(),objectType:r.Enum(Wq),category:r.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:r.Object({label:r.Enum(["critical","important","normal"]),weight:r.Number()}),recommendation:r.String(),scope:r.Optional(r.Enum(Zq))}),iR=r.Object({type:r.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:r.String({description:"Human-readable summary of the example"}),link:r.Object({to:r.String({description:"In-app route the example deep-links to"}),search:r.Optional(r.Unknown({description:"Search-query payload for the deep link"})),params:r.Optional(r.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),dl=r.Intersect([gl,r.Object({status:Yq,normalizedScore:r.Number(),details:r.Optional(r.Record(r.String(),r.Unknown())),recommendation:r.Optional(r.String()),examples:r.Optional(r.Array(iR))})]),Xq=r.Object({generatedAt:r.String(),overallScore:r.Optional(r.Number()),rules:r.Array(gl),teamResults:r.Array(r.Object({teamId:r.String(),teamName:r.String(),teamWeight:r.Number(),score:r.Number(),weightedScore:r.Number(),totalWeight:r.Number(),ruleResults:r.Array(dl)})),globalResults:r.Optional(r.Object({score:r.Optional(r.Number()),ruleResults:r.Array(dl)}))}),yl=r.Object({id:r.String({description:"Quality report row id"}),reportId:r.String({description:"Identifier shared by every row from the same generation for a given owner (team or cluster)"}),ruleId:r.Enum(fl,{description:"Rule key evaluated in this row"}),owner:r.Optional(r.String({description:"Team id this row applies to; absent for global rules"})),status:r.Enum(oR,{description:"Outcome of evaluating the rule for this owner"}),score:r.Number({description:"Score in [0, 1] for this rule on this owner"}),weight:r.Number({description:"Rule impact weight captured at generation time"}),reportOverallScore:r.Number({description:"Aggregated score across this owner\u2019s rule rows in the same generation"}),reportTotalWeight:r.Number({description:"Sum of weights of this owner\u2019s applicable rule rows in the same generation"}),recommendation:r.Optional(r.String({description:"Owner-specific recommendation; falls back to the rule\u2019s default if absent"})),examples:r.Optional(r.Array(iR,{description:"Concrete assets supporting this evaluation; absent for global rules unless the caller is an admin"})),createdAt:r.String({description:"ISO timestamp the row was generated at"})}),qHe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Xq}),FHe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:r.Object({clusterId:r.Optional(m({allowEmpty:!1})),team:r.Optional(m({allowEmpty:!1}))}),response:r.Array(yl,{description:"Latest persisted rule evaluation rows for the cluster"})}),BHe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:r.Object({ruleKey:Qq,teamId:m(),lookbackMinutes:r.Optional(r.Integer({minimum:1,maximum:60})),clusterId:r.Optional(m({allowEmpty:!1}))}),response:r.Object({rule:gl,result:dl,teamId:r.String(),teamName:r.String()})}),HHe=new Map(nR.map(e=>[e.key,e]));var Jq=`/${"v1"}/quality-reports`,aR=r.Object(yl.properties,{$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)."}),eF={id:"r_01J9X3Z4VYABCDEF",reportId:"b_01J9X3Z4VYABCDEF",ruleId:"team-has-route",owner:"t_01J9X3Z4VYABCDEF",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(aR,{examples:[eF]});var tF=r.Object({clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Required when the org has more than one cluster."})),team:r.Optional(m({allowEmpty:!1,description:"Name of the team to scope the report to. When set, only this team's rule rows are returned and cluster-wide global rows are omitted."}))},{description:"Latest quality report lookup query."}),sR=d({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${Jq}/latest`,method:"GET",query:tF,response:r.Array(aR)});var Ua="/v0/admin-center";var or=`${Ua}/retention-policies`,cR=3650,rF=r.Integer({description:"Number of days Tsuga retains matching telemetry."}),pR=r.Integer({minimum:1,maximum:cR,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${cR}.`}),br=r.Object({id:r.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:r.Optional(r.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:r.Optional(r.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:r.Enum(Lt,{description:"Telemetry signal retained by this policy: logs, metrics, or traces."}),durationDays:rF,isEnabled:r.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:T({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the retention policy."})}),xc=r.Object({env:r.Optional(m({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:r.Optional(m({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:r.Enum(Lt,{description:"Telemetry signal retained by this policy: logs, metrics, or traces."}),durationDays:pR,isEnabled:r.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),mR=r.Array(r.Object({env:m(),dataSource:r.Enum(Lt),durationDays:r.Union([pR,r.Null()]),isEnabled:r.Boolean()})),uR=r.Object({inserted:r.Array(br),updated:r.Array(br),deleted:r.Array(br)}),i2e=d({tags:["retention-policies"],url:or,method:"POST",body:xc,response:br}),a2e=d({tags:["retention-policies"],url:or,method:"GET",response:r.Array(br)}),s2e=d({tags:["retention-policies"],url:`${or}/:id`,method:"GET",params:r.Object({id:m()}),response:br}),c2e=d({tags:["retention-policies"],url:`${or}/:id`,method:"PUT",params:r.Object({id:m()}),body:xc,response:br}),p2e=d({tags:["retention-policies"],url:`${or}/bulk-update`,method:"POST",body:mR,response:uR}),m2e=d({tags:["retention-policies"],url:`${or}/bulk-update-for-team`,method:"POST",body:r.Object({teamId:m(),policies:mR}),response:uR}),u2e=d({tags:["retention-policies"],url:`${or}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),Na=["past-24-hours","past-7-days","past-30-days"],l2e=d({tags:["retention-policies"],url:`${or}/requested-history-percentile/:teamId`,method:"POST",params:r.Object({teamId:m()}),body:r.Object({percentile:r.Number({minimum:0,maximum:1}),observationWindow:r.Enum(Na),dataSource:r.Enum(Lt)}),response:r.Object({percentile:r.Number(),observationWindow:r.Enum(Na),dataSource:r.Enum(Lt),teamId:r.String(),requestedHistoryDays:r.Number()})}),nF=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var oF=r.Array(r.Object({bucket:r.Enum(nF),count:r.Number()})),d2e=d({tags:["retention-policies"],url:`${or}/requested-history-histogram/:teamId`,method:"POST",params:r.Object({teamId:m()}),body:r.Object({observationWindow:r.Enum(Na),dataSource:r.Enum(Lt)}),response:r.Object({observationWindow:r.Enum(Na),dataSource:r.Enum(Lt),teamId:r.String(),histogram:oF})}),f2e=d({tags:["retention-policies"],url:`${or}/top-teams-with-retention-surplus`,method:"POST",body:r.Object({dataSource:r.Enum(Lt),observationWindow:r.Enum(Na),percentile:r.Number({minimum:0,maximum:1}),topN:r.Optional(r.Number({minimum:1,maximum:20}))}),response:r.Array(r.Object({teamId:r.String(),retentionSurplusDays:r.Number()}))});var ka=`/${"v1"}/retention-policies`,wa=r.Pick(br,["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)."}),iF={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(wa,{examples:[iF]});var lR=d({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:ka,method:"GET",response:r.Array(wa)}),dR=d({description:"Retrieves one retention policy by ID when the authenticated operation key can read it. Use this before updating duration or enabled state.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${ka}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:wa}),hl=r.Pick(xc,["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."}),aF={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(hl,{examples:[aF]});var fR=d({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:ka,method:"POST",body:hl,response:wa}),gR=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${ka}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:hl,response:wa}),yR=d({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:`${ka}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:L});var sF=15,Rc={id:r.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:r.Optional(r.String({description:"Optional user-provided processor note."})),tags:We,updatedAt:r.Optional(T({description:"Timestamp when Tsuga last updated the processor."}))},Cc={id:m({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:r.Optional(m({type:"long",description:"Optional processor note."})),tags:rt,updatedAt:r.Optional(T())},cF={...Rc,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},pF={...Cc,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},mF=A("subtype",[r.Object({targetAttribute:r.String({description:"Attribute that will receive the formatted value"}),formatString:r.String({description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:r.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Whether missing referenced attributes render as empty strings."}))},{$id:"ProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the computed value"}),formula:r.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:r.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:r.Optional(r.Boolean({description:"Whether missing referenced attributes evaluate as zero."}))},{$id:"ProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:r.String({description:"Query that selects the logs assigned to this category"}),value:r.String({description:"Category value assigned when the query matches"})}),{description:"Conditions evaluated in order to determine the category value"}),defaultValue:r.Optional(r.String({description:"Category value used when no condition matches"})),subtype:r.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})]),uF=A("subtype",[r.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("format-string"),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to render as empty strings."}))},{$id:"InputProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("math-formula"),replaceMissingBy0:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:m({allowEmpty:!1,type:"tsuga-query",description:"Query that selects the logs assigned to this category"}),value:m({allowEmpty:!1,description:"Category value assigned when the query matches"})}),{minItems:1,maxItems:sF,description:"Conditions evaluated in order to determine the category value"}),defaultValue:r.Optional(m({description:"Category value used when no condition matches"})),subtype:r.Literal("category")},{$id:"InputProcessorParamsCreatorCategory"})]),lF=r.Object({...cF,params:mF}),dF=r.Object({...pF,params:uF}),fF={...Rc,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},gF={...Cc,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},yF=A("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:r.String({description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:r.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})]),hF=A("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:r.Optional(r.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({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:r.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),r.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),r.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),EF=r.Object({...gF,params:hF}),TF=r.Object({...fF,params:yF}),IF={...Rc,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},_F={...Cc,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},bF=5,OF=A("subtype",[r.Object({attributeName:r.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(r.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:r.Optional(r.Array(r.String(),{description:"Example log lines for validation"})),subtype:r.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the URL to parse"}),subtype:r.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:r.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:r.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:r.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:r.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),AF=A("subtype",[r.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:r.Optional(r.Array(m({type:"long"}),{maxItems:bF,description:"Example log lines for validation"})),subtype:r.Literal("grok")}),r.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:r.Literal("url")}),r.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent")}),r.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:r.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),SF=r.Object({...IF,params:OF}),xF=r.Object({..._F,params:AF}),RF=11,hR=r.Cyclic({OutputProcessor:r.Union([TF,SF,lF,r.Object({...Rc,params:r.Object({items:r.Array(r.Object({query:r.String({description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),ER=r.Cyclic({InputProcessor:r.Union([EF,xF,dF,r.Object({...Cc,params:r.Object({items:r.Array(r.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:RF,description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var CF="/v0/logs",en=`${CF}/routes`,Fn=r.Object({id:r.String({description:"Unique identifier of the log route. Generated by Tsuga."}),name:r.String({description:"Human-readable route name shown in Tsuga."}),description:r.Optional(r.String({description:"Optional user-provided route description."})),isEnabled:r.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:r.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:r.Number({description:"Route evaluation order. Enabled routes are checked from lower rank to higher rank during ingestion."}),tags:We,owner:r.String({description:"Team ID that owns and manages the route."}),processors:r.Array(hR,{description:"Ordered processors applied to logs that match the route"}),creator:r.Optional(Ee),updater:r.Optional(Ee),updatedAt:T({description:"Timestamp when Tsuga last updated the route."}),createdAt:T({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Route"}),La=r.Object({name:m({allowEmpty:!1,description:"Human-readable route name shown in Tsuga."}),description:r.Optional(m({type:"long",description:"Optional route description."})),isEnabled:r.Boolean({description:"Set to true for the route to process newly ingested matching logs. Set to false to save it without running it."}),query:m({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),tags:rt,owner:m({allowEmpty:!1,description:"Team ID that will own and manage the route."}),processors:r.Array(ER,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),M2e=d({tags:["routes"],url:en,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(Fn)}),v2e=d({tags:["routes"],url:`${en}/:id`,params:r.Object({id:m()}),method:"GET",response:Fn}),D2e=d({tags:["routes"],url:en,method:"POST",body:La,response:Fn}),$2e=d({tags:["routes"],url:`${en}/:id`,method:"PUT",body:La,params:r.Object({id:m()}),response:Fn}),G2e=d({tags:["routes"],url:`${en}/:id/clone`,method:"POST",params:r.Object({id:m()}),body:La,response:Fn}),j2e=d({tags:["routes"],url:`${en}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),q2e=d({tags:["routes"],url:`${en}/:id/modify-ranking`,method:"PUT",params:r.Object({id:m()}),body:r.Object({rank:r.Number()}),response:r.Object({})}),F2e=d({tags:["routes"],url:`${en}/:id/enable`,method:"PUT",params:r.Object({id:m()}),body:r.Object({enable:r.Boolean()}),response:r.Object({})});var Ma=`/${"v1"}/routes`,va=r.Pick(Fn,["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)."}),PF={id:"123-456-abc",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:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(va,{examples:[PF]});var TR=d({description:"Lists log routes visible to the authenticated operation key. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:Ma,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(va)}),IR=d({description:"Retrieves one log route by ID when the authenticated operation key can read it. Use this before updating processors or route metadata.",operationId:"getRoute",tags:["routes"],url:`${Ma}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:va}),El=r.Pick(La,["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."}),UF={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:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(El,{examples:[UF]});var _R=d({description:"Creates a log route. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:Ma,method:"POST",body:El,response:va}),bR=d({description:"Replaces an existing log route by ID. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${Ma}/:id`,method:"PUT",body:El,params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:va}),OR=d({description:"Deletes a log route by ID. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${Ma}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:L});var Bn=`${Ua}/tag-policies`;var AR=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],NF=["logs","metrics","traces"],Tl=r.Array(r.Enum(AR,{description:"Tsuga-managed asset type covered by an asset tag policy."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."}),Il=r.Array(r.Enum(NF,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),kF=r.Union([Tl,Il]),wF=r.Object({teamIds:r.Array(r.String(),{description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})}),LF=A("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:Il,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Tl})]),MF=A("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:Il,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Tl})]),Qo=r.Object({id:r.String({description:"Unique identifier of the tag policy. Generated by Tsuga."}),name:r.String({description:"Human-readable tag policy name."}),description:r.Optional(r.String({description:"Optional user-provided policy description."})),isActive:r.Boolean({description:"Whether Tsuga currently evaluates this policy."}),tagKey:r.String({description:"Tag key enforced by this policy."}),allowedTagValues:r.Array(r.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:r.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists."}),teamScope:r.Optional(wF),configuration:LF,creator:r.Optional(Ee),updater:r.Optional(Ee),owner:r.Optional(r.String({description:"Team ID that owns and manages the policy."})),createdAt:T({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var Da=r.Object({name:m({description:"Human-readable tag policy name."}),description:r.Optional(m({description:"Optional policy description."})),isActive:r.Boolean({description:"Set to true for Tsuga to evaluate this policy."}),tagKey:m({allowEmpty:!1,description:"Tag key enforced by this policy."}),allowedTagValues:r.Array(m({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists."}),isRequired:r.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists."}),teamScope:r.Optional(r.Object({teamIds:r.Array(m(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})})),configuration:MF,owner:m({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),nKe=d({tags:["tag-policies"],url:Bn,method:"GET",query:r.Object({teamIds:r.Optional(r.Array(m(),{maxItems:100})),assetTypes:r.Optional(kF),searchQuery:r.Optional(m())}),response:r.Array(Qo)}),oKe=d({tags:["tag-policies"],url:`${Bn}/:id`,method:"GET",params:r.Object({id:m()}),response:Qo}),iKe=d({tags:["tag-policies"],url:Bn,method:"POST",body:Da,response:Qo}),aKe=d({tags:["tag-policies"],url:`${Bn}/:id`,method:"PUT",params:r.Object({id:m()}),body:Da,response:Qo}),sKe=d({tags:["tag-policies"],url:`${Bn}/:id`,method:"DELETE",params:r.Object({id:m()}),response:L}),cKe=d({tags:["tag-policies"],url:`${Ua}/applicable-tag-rules`,method:"GET",query:r.Object({assetType:r.Enum(AR),teamId:m()}),response:r.Array(r.Object({tagKey:r.String(),allowedTagValues:r.Array(r.String()),isRequired:r.Boolean()}))}),SR=r.Object({total:r.Number(),totalNonCompliant:r.Number(),idsNonCompliant:r.Array(r.String())}),xR=r.Union([r.Literal("ingestion-api-key"),r.Literal("operation-api-key"),r.Literal("rum-public-token"),r.Literal("dashboard"),r.Literal("log-route"),r.Literal("monitor"),r.Literal("notification-rule"),r.Literal("notification-silence"),r.Literal("slo")]),vF=r.Object({total:r.Number(),totalNonCompliant:r.Number(),byAssetType:r.Record(xR,SR)}),DF=r.Omit(SR,["total"]),$F=r.Object({totalNonCompliant:r.Number(),byAssetType:r.Record(xR,DF)}),RR=r.Object({totals:vF,byTeam:r.Record(r.String(),$F)}),pKe=d({tags:["tag-policies"],url:`${Bn}/:id/stats`,method:"GET",params:r.Object({id:m()}),response:RR}),mKe=d({tags:["tag-policies"],url:`${Bn}/new-policy-stats`,method:"POST",body:Da,response:RR});var $a=`/${"v1"}/tag-policies`,Pc=r.Pick(Qo,["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)."}),CR=r.Pick(Da,["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."}),PR=d({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:$a,method:"GET",response:r.Array(Pc)}),UR=d({description:"Retrieves one tag policy by ID when the authenticated operation key can read it. Use this before updating policy scope or enforcement settings.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${$a}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:Pc}),NR=d({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:$a,method:"POST",body:CR,response:Pc}),kR=d({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${$a}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:CR,response:Pc}),wR=d({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${$a}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:L});var Ga=`/${"v1"}/teams`,ja=r.Pick(vo,["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)."}),GF={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ja,{examples:[GF]});var LR=d({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:Ga,method:"GET",paginated:!0,query:r.Object(te),response:r.Array(ja)}),MR=d({description:"Retrieves one team by ID when the authenticated operation key can read it. Use this to resolve ownership metadata before creating or updating team-owned resources.",operationId:"getTeam",tags:["teams"],url:`${Ga}/:id`,method:"GET",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:ja}),_l=r.Pick(sc,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),jF={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(_l,{examples:[jF]});var vR=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:Ga,method:"POST",body:_l,response:ja}),DR=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${Ga}/:id`,method:"PUT",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:_l,response:ja}),$R=d({description:"Deletes a team by ID. Use only after moving or deleting resources and memberships that depend on the team.",operationId:"deleteTeam",tags:["teams"],url:`${Ga}/:id`,method:"DELETE",params:r.Object({id:m({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:L});function bl(e){let t=e.params;if(t?.properties){let n=Object.keys(t.properties);if(n.length===1&&n[0])return n[0]}return"id"}function GR(e,t,n){let o=e.command(t.commandName).description(t.description),i=WA(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let c of t.listOptions)a.option(c.flag,c.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async c=>{if(c.generateSkeleton){oe(Mo(t.endpoints.list));return}let u=await n()(t.endpoints.list,{body:c.data?Ro({data:c.data}):{}});oe(u)}):a.action(async c=>{let u={};if(t.listOptions)for(let f of t.listOptions){let y=c[f.queryParam];y!==void 0&&(u[f.queryParam]=y)}let l=await n()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);oe(l)}),t.endpoints.get){let c=t.endpoints.get,u=bl(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[u]:l}});oe(f)})}if(t.endpoints.create){let c=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){oe(Mo(c));return}let l=Ro(u),f=await n()(c,{body:l});oe(f)})}if(t.endpoints.update){let c=t.endpoints.update,u=bl(c);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,f)=>{if(f.generateSkeleton){oe(Mo(c));return}let y=Ro(f),E=await n()(c,{params:{[u]:l},body:y});oe(E)})}if(t.endpoints.delete){let c=t.endpoints.delete,u=bl(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[u]:l}});oe(f)})}}var qF=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:_x}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:rx,get:nx,create:ox,update:ix,delete:ax},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:dx,create:fx,update:gx,delete:yx}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:bx,get:Ox,create:Ax,update:Sx,delete:xx}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:Cx,get:Px,create:Mx,update:vx,delete:Dx},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:Bx,get:Hx,create:Kx,update:zx,delete:Vx}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Zx,get:Xx,create:eR,update:tR,delete:rR}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster (pass --cluster <id> when the org has more than one cluster)",endpoints:{list:sR},listOptions:[{flag:"--team <name>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:lR,get:dR,create:fR,update:gR,delete:yR}},{commandName:"routes",description:"Manage routes",endpoints:{list:TR,get:IR,create:_R,update:bR,delete:OR}},{commandName:"services",description:"Manage services",endpoints:{list:US,get:NS}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:PR,get:UR,create:NR,update:kR,delete:wR}},{commandName:"teams",description:"Manage teams",endpoints:{list:LR,get:MR,create:vR,update:DR,delete:$R}}];function jR(e,t){for(let n of qF)GR(e,n,t)}var qR=require("node:child_process");var Uc="@tsuga/cli@latest";function FF(){q(`Updating ${Uc}`),q(` $ npm install -g ${Uc}`);try{(0,qR.execFileSync)("npm",["install","-g",Uc],{stdio:["ignore","inherit","inherit"]})}catch(e){let t=e.status??1;throw new Error(`npm install -g ${Uc} exited ${t}`,{cause:e})}q("Updated. Run `tsuga --version` to confirm the new version.")}function FR(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{FF()})}var Pl=require("node:fs"),Cl=require("node:os"),Zo=require("node:path");function BF(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function HF(e,t,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let c=t-1;c<=t+1;c++){let u=o[c-1];u&&(i+=c.toString().padEnd(a," "),i+=": ",i+=u,i+=`
|
|
131
|
-
`,c===
|
|
132
|
-
`))}return i}var z=class extends Error{line;column;codeblock;constructor(
|
|
129
|
+
-----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}"}],uq=Sx.map(e=>e.key);var LFe=new Set(uq),vFe=Sx.map(e=>e.key);var q="context";var Ox="trace_id",HFe=`${q}.team`,KFe=`${q}.env`,zFe=`${q}.api_key_id`,Fc=`${q}.service.name`,YFe=`${q}.service.version`,VFe=`${q}.span.kind`,QFe=`${q}.status.code`,Ax=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var xa=`${q}.host.name`,mq=`${q}.instance`,lq=`${q}.instanceid`,dq=`${q}.instance_name`,WFe=`${q}.telemetry.sdk.language`,ZFe=`${q}.process.runtime.name`,XFe=`${q}.scope.name`,JFe=`${q}.cloud.provider`,eHe=`${q}.cloud.platform`,tHe=`${q}.aws.ecs.task.arn`,rHe=`${q}.k8s.cluster.name`,nHe=`${q}.k8s.cluster.uid`,oHe=`${q}.k8s.namespace.name`,fq=`${q}.k8s.pod.name`,iHe=`${q}.k8s.pod.uid`,aHe=`${q}.k8s.container.name`,sHe=`${q}.k8s.node.name`,cHe=`${q}.k8s.node.uid`,gq=`${q}.k8s.deployment.name`,pHe=`${q}.k8s.deployment.uid`,yq=`${q}.k8s.replicaset.name`,uHe=`${q}.k8s.replicaset.uid`,hq=`${q}.k8s.statefulset.name`,mHe=`${q}.k8s.statefulset.uid`,Tq=`${q}.k8s.daemonset.name`,lHe=`${q}.k8s.daemonset.uid`,dHe=`${q}.k8s.job.name`,fHe=`${q}.k8s.job.uid`,gHe=`${q}.k8s.cronjob.name`,yHe=`${q}.k8s.cronjob.uid`;var Eq="db.system.name",Iq="db.system",_q="db.namespace",bq="db.name";var hHe=`span_attributes.${_q}`,THe=`span_attributes.${bq}`,EHe=`span_attributes.${Eq}`,IHe=`span_attributes.${Iq}`;var _He={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${q}.tag_policy_id`,dataSource:`${q}.data_source`}};var bHe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${q}.batch_kind`,batchKindMetricsFilter:`${q}.batch_kind:metrics`,sourceApiKeyId:`${q}.source_api_key_id`,sourceEnv:`${q}.source_env`,sourceTeam:`${q}.source_team`}};var Nl="__tsuga_metadata__",SHe=`${Nl}.signature`,OHe=`${Nl}.routes`,AHe=`${Nl}.trace_id_bucket`;function xx(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var Rx=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","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"],Cx=["alert_queries","alert_thresholds","alert_values"],Sq=[...Rx,...Cx],Px=["alert_event_name","alert_message"],JHe=[...Sq,...Px],e2e=new Set([...Rx,...Px]),t2e=new Set(Cx);var Oq="^\\S(.*\\S)?$",Ux=128,wx=256,Aq=t.Object({key:t.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:t.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),xq=t.Object({key:t.String({maxLength:Ux,description:`Tag key to attach to the resource. Maximum length is ${Ux} characters.`}),value:t.String({maxLength:wx,pattern:Oq,description:`Tag value to attach to the resource. Maximum length is ${wx} characters and leading or trailing whitespace is rejected.`})},{title:"Tag"}),Ft=t.Array(Aq,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Ht=t.Array(xq,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Up to 50 tags are accepted and tag policies may require specific keys or values."}),ke=t.Optional(Ft),Ve=t.Optional(Ht);var cn="/v0/teams",Kc=["public","private"],Hc={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},Rq=t.Enum([Hc.NAME,Hc.CREATED_AT,Hc.MEMBER_COUNT,Hc.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),vx=t.Object({color:t.Enum(Ul,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:t.Enum(wl,{description:"Avatar rendering mode selected for the team."}),iconName:t.Enum(bx,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Ll=t.Object({color:t.Enum(Ul),mode:t.Enum(wl)}),Nx=100,Lx=250,zo=t.Object({id:t.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:t.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:t.Optional(t.String({description:"Optional team description supplied by a user."})),visibility:t.Enum(Kc,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:ke,createdAt:T({description:"Timestamp when Tsuga created the team."}),updatedAt:T({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:t.Optional(t.Number({description:"Number of members currently in the team"})),avatar:t.Optional(vx)}),zc=t.Object({name:t.String({minLength:1,maxLength:Nx,format:Uo,description:`Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization. Maximum length is ${Nx} characters.`}),description:t.Optional(t.String({maxLength:Lx,description:`Optional team description. Maximum length is ${Lx} characters.`})),visibility:t.Enum(Kc,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Ve,avatar:t.Optional(vx)}),Cq=t.Object({id:t.String(),name:t.String(),email:t.String(),role:t.Enum(ko),joinedTeamAt:T(),orgRole:t.Enum(Sc),avatar:t.Optional(Ll)}),Q2e=d({tags:["teams"],url:cn,method:"GET",paginated:!0,response:t.Array(zo),query:t.Object({...Q,includeMemberCount:t.Optional(t.Boolean()),searchQuery:t.Optional(p({description:"Substring matched against team names and descriptions."})),visibility:t.Optional(t.Enum(Kc,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:t.Optional(t.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:t.Optional(Rq),sortDirection:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),W2e=d({tags:["teams"],url:`${cn}/:id`,method:"GET",params:t.Object({id:p()}),response:zo}),Z2e=d({tags:["teams"],url:`${cn}/:id/members`,method:"GET",params:t.Object({id:p()}),response:t.Array(Cq)}),X2e=d({tags:["teams"],url:`${cn}/:id/assets`,method:"GET",params:t.Object({id:p()}),response:t.Object({apiKeyCount:t.Number(),logRouteCount:t.Number(),monitorCount:t.Number(),notificationRuleCount:t.Number(),dashboardCount:t.Number()})}),J2e=d({tags:["teams"],url:cn,method:"POST",body:zc,response:zo}),eKe=d({tags:["teams"],url:`${cn}/:id`,method:"PUT",params:t.Object({id:p()}),body:zc,response:zo}),tKe=d({tags:["teams"],url:`${cn}/bulk-update`,method:"POST",body:t.Object({teamIds:t.Array(p(),{maxItems:100}),config:t.Object({visibility:t.Enum(Kc)})}),response:t.Object({})}),rKe=d({tags:["teams"],url:`${cn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var Pq=t.Enum(["terraform-provider","web-frontend","mcp-server","cli"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),ue=b("type",[t.Object({type:t.Literal("user",{description:"The resource was created or updated by a user."}),id:t.String({description:"Unique identifier of the user actor."}),name:t.String({description:"Display name of the user actor at the time of response."}),avatar:t.Optional(Ll)}),t.Object({type:t.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:t.String({description:"Unique identifier of the operation API key actor."}),name:t.String({description:"Display name of the operation API key actor."}),source:t.Optional(Pq)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var bt="/v0/monitors",Yo=["alert","resolve","keep_last_status","consider_zero"],Vo=["alert","resolve","keep_last_status"];var Mx=["no_aggregation","all","any","each","proportion"],Dx=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var Uq=t.Object({formula:t.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(Dx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),wq=t.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(Dx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),Nq=5,vl=t.Array(Uq,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),kl=t.Array(wq,{minItems:1,maxItems:Nq,description:"Threshold conditions evaluated against query and formula results. Provide at least one condition and no more than five conditions."}),Ml=t.Object({formula:t.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.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."})}),Dl=t.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.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."})}),dt=[1,2,3,4,5];var Yc={timeframe:t.Number({description:"Lookback window, in minutes, that each monitor evaluation aggregates over."}),groupByFields:t.Array(t.Object({fields:t.Array(t.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:t.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:t.Optional(t.Enum(Mx,{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:t.Optional(t.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Vc={timeframe:t.Number({description:"Lookback window, in minutes, that each monitor evaluation aggregates over."}),groupByFields:t.Array(t.Object({fields:t.Array(p(),{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:t.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:t.Optional(t.Enum(Mx,{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`. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:t.Optional(t.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`. Valid values are 1 through 99."}))},Gl={...Yc,timeframe:t.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Valid input is 5 through 1440 minutes."})},$l={...Vc,timeframe:t.Number({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Valid input is 5 through 1440 minutes."})},Gx=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:vl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Yc,queries:Tr},{$id:"MonitorConfigurationMetric"}),$x=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:kl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Vc,queries:Er},{$id:"InputMonitorConfigurationMetric"}),jx=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:vl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Yc,queries:Tr},{$id:"MonitorConfigurationLog"}),qx=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:kl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Vc,queries:Er},{$id:"InputMonitorConfigurationLog"}),Bx=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:vl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Yc,queries:Tr},{$id:"MonitorConfigurationTrace"}),Lq=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:kl,noDataBehavior:t.Enum(Yo,{description:"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."}),...Vc,queries:Er},{$id:"InputMonitorConfigurationTrace"}),Fx=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Ml,noDataBehavior:t.Enum(Vo,{description:"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."}),...Gl,queries:Tr},{$id:"MonitorConfigurationAnomalyLog"}),Hx=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Dl,noDataBehavior:t.Enum(Vo,{description:"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."}),...$l,queries:Er},{$id:"InputMonitorConfigurationAnomalyLog"}),Kx=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Ml,noDataBehavior:t.Enum(Vo,{description:"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."}),...Gl,queries:Tr},{$id:"MonitorConfigurationAnomalyMetric"}),zx=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Dl,noDataBehavior:t.Enum(Vo,{description:"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."}),...$l,queries:Er},{$id:"InputMonitorConfigurationAnomalyMetric"}),Yx=t.Object({type:t.Literal("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."}),condition:Ml,noDataBehavior:t.Enum(Vo,{description:"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."}),...Gl,queries:Tr},{$id:"MonitorConfigurationAnomalyTrace"}),vq=t.Object({type:t.Literal("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."}),condition:Dl,noDataBehavior:t.Enum(Vo,{description:"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."}),...$l,queries:Er},{$id:"InputMonitorConfigurationAnomalyTrace"}),Vx=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:t.Optional(t.Array(t.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),kq=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:t.Optional(t.Array(t.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),Mq=t.Object({type:t.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(t.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:t.String({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(t.String({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPattern"}),Dq=t.Object({type:t.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(p(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:p({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(p({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPattern"}),Gq=b("type",[Gx,jx,Bx,Fx,Kx,Mq,Yx,Vx],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),$q=b("type",[$x,qx,Lq,Hx,zx,vq,Dq,kq],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Rr=t.Object({id:t.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:t.String({description:"Display name of the monitor and alert source."}),owner:t.String({description:"Team ID that owns and manages the monitor."}),message:t.Optional(t.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:ke,configuration:Gq,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:rn,dashboardId:t.Optional(t.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),pauseUntil:t.Optional(T({description:"Timestamp until which the monitor is snoozed."})),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:T({description:"Timestamp when Tsuga created the monitor."}),updatedAt:T({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:t.Array(t.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),jq=b("type",[Gx,jx,Bx,Fx,Kx,Yx,Vx]),bKe=t.Object({...Rr.properties,configuration:jq},{title:"Monitor"}),SKe=t.Object({...Rr.properties,configuration:b("type",[$x,qx,Hx,zx])},{title:"Monitor"}),Ra=t.Object({name:p({description:"Display name of the monitor and alert source."}),message:t.Optional(p({type:"long",description:"Message included in notifications triggered by this monitor. Optional on create. On update, omitting it keeps the existing message."})),tags:Ve,configuration:$q,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:t.Optional(t.Union([t.Null(),p({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."})),pauseUntil:t.Optional(p({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:rn,clusterIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),kx=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],pn={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var jl=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),exclude:t.Optional(t.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Search query filter for monitors."}),tags:je(Ht.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:je(t.Enum(dt),{description:"Restrict results to monitors with one of these priorities",maxItems:dt.length}),types:je(t.Enum(kx),{description:"Restrict results to monitors with these types",maxItems:kx.length}),activity:t.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:je(p({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"}),ql=t.Partial(t.Object({...Q,filters:t.Partial(jl),sort:t.Object({by:t.Enum([pn.PRIORITY,pn.TYPE,pn.NAME,pn.OWNER,pn.TAGS,pn.CLUSTER_IDS,pn.PAUSE_UNTIL,pn.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:t.Enum(["asc","desc"],{description:"Sort direction. For `priority`, `desc` returns priority 1 first and `asc` returns priority 5 first."})},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),OKe=d({tags:["monitors"],url:`${bt}/query`,method:"POST",paginated:!0,response:t.Array(Rr),body:ql}),AKe=d({tags:["monitors"],url:`${bt}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(jl,["tags"])))}),response:Ft}),xKe=d({tags:["monitors"],url:`${bt}/counts/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(jl,["activity"])))}),response:t.Object({all:t.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:t.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:t.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),RKe=d({tags:["monitors"],url:`${bt}/:id`,method:"GET",params:t.Object({id:p()}),response:Rr}),CKe=d({tags:["monitors"],url:bt,method:"POST",body:Ra,response:Rr}),PKe=d({tags:["monitors"],url:`${bt}/:id`,method:"PUT",params:t.Object({id:p()}),body:Ra,response:Rr}),UKe=d({tags:["monitors"],url:`${bt}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),wKe=d({tags:["monitors"],url:`${bt}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),NKe=d({tags:["monitors"],url:`${bt}/bulk-update`,method:"PUT",body:t.Object({monitorIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})}),LKe=d({tags:["monitors"],url:`${bt}/:id/snooze`,method:"POST",params:t.Object({id:p()}),body:t.Object({pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:Rr}),qq=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],Bq=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],Fq=[...qq,...Bq],Yn=t.Enum(Fq),Hq=b("type",[t.Object({type:t.Literal("each"),subStates:t.Record(t.String(),t.Object({stateValue:t.Union([Yn,t.Null()]),lastChangedAt:T()}))}),t.Object({type:t.Literal("no_aggregation"),stateValue:t.Optional(Yn)}),t.Object({type:t.Literal("any"),stateValue:t.Optional(Yn)}),t.Object({type:t.Literal("all"),stateValue:t.Optional(Yn)}),t.Object({type:t.Literal("proportion"),stateValue:t.Optional(Yn)})]),Kq=t.Object({monitorId:t.String(),currentState:Hq,lastChangedAt:t.Optional(T())}),vKe=d({tags:["monitors"],url:`${bt}/states/:id`,method:"GET",params:t.Object({id:p()}),response:Kq}),kKe=d({tags:["monitors"],url:`${bt}/:id/transitions`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Array(t.Object({id:t.String(),createdAt:T(),fromState:t.Optional(Yn),toState:t.Optional(Yn),dimension:t.Optional(t.String())}))}),zq=["unprocessed","processed","failed-to-process"],MKe=d({tags:["monitors"],url:`${bt}/:id/results`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Object({isTruncated:t.Boolean(),results:t.Array(t.Object({id:t.String(),evaluationAt:T(),formulaResult:t.Object({groups:t.Array(t.Object({groupKey:t.Record(t.String(),ua),results:t.Array(t.Union([t.Number(),t.Null()])),conditionMet:t.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:t.Enum(zq)}))})});var Cr="/v0/slos",Yq=[7,30,90],Vq=["good","bad"],Xx=t.Enum(Vq,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),Qq=["good","bad","ignore"],Jx=t.Enum(Qq,{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)"}),Qx=30,Wx=1440,eR=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],Wq=["healthy","breached","no_data"],Qc=t.Enum(Wq,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Zx={sli:t.Optional(t.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:t.Optional(t.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:Qc},Zq=t.Object({overall:t.Object(Zx,{description:"Latest overall evaluation for the cluster"}),perGroup:t.Array(t.Object({groupKey:t.Record(t.String(),ua,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...Zx}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),tR=t.Record(t.String(),Zq,{description:"Latest evaluation results keyed by cluster ID."}),Bl=t.Object({queries:Tr,formula:Nc},{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."}),Fl=t.Object({queries:Er,formula:kn},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Set by the caller on create or update; formulas reference queries as q1, q2, and so on."}),Xq=t.Object({type:t.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:t.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"}),Jq=t.Object({type:t.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:t.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 eB=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),tB=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),rB=b("type",[Xq,eB],{description:"Alert trigger configuration: burn-rate or threshold"}),rR=b("type",[Jq,tB],{description:"Alert trigger configuration: burn-rate or threshold"}),Hl=t.Enum(dt,{description:"Alert priority (1 is highest, 5 is lowest)"}),Kl=t.Object({id:t.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:t.String({description:"Parent SLO ID for this alert."}),priority:Hl,configuration:rB,createdAt:T({description:"Timestamp when Tsuga created the alert."}),updatedAt:T({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),nB=t.Object({priority:Hl,configuration:rR}),oB=t.Object({id:t.Optional(p({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:Hl,configuration:rR}),iB=b("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:ar,goodQuery:Bl,totalQuery:Bl,groupByFields:t.Optional(Mo),noDataBehavior:Xx},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:ar,query:Bl,sliceSizeMinutes:t.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:t.Object({operator:t.Enum(eR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(Mo),noDataBehavior:Jx},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Set by the caller on create or update and returned on read and list responses. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),aB=b("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:ar,goodQuery:Fl,totalQuery:Fl,groupByFields:t.Optional(Ir),noDataBehavior:Xx},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:ar,query:Fl,sliceSizeMinutes:t.Integer({minimum:Qx,maximum:Wx,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${Qx} through ${Wx}.`}),threshold:t.Object({operator:t.Enum(eR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(Ir),noDataBehavior:Jx},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Set by the caller on create or update. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),sB=t.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),nR=t.Enum(Yq,{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."}),cB=t.Array(t.String(),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),pB=t.Array(p({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),Qo=t.Object({id:t.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:t.String({description:"Display name of the SLO, set by the caller."}),description:t.Optional(t.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:ke,configuration:iB,target:t.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:nR,owner:t.String({description:"Team ID that owns the SLO"}),permissions:rn,clusterIds:cB,creator:t.Optional(ue),updater:t.Optional(ue),alerts:t.Array(Kl,{description:"Alerts attached to this SLO"}),createdAt:T({description:"Timestamp when Tsuga created the SLO."}),updatedAt:T({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),uB=t.Object({...Qo.properties,results:tR},{title:"SloWithResults"}),Wc=t.Object({name:p({allowEmpty:!1,description:"Display name of the SLO, set by the caller"}),description:t.Optional(p({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Ve,configuration:aB,target:sB,timeframeDays:nR,owner:p({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:rn,clusterIds:t.Optional(pB),alerts:t.Array(nB,{description:"Alerts to create on this SLO. Send an empty array for none."})}),zl=t.Object({...t.Omit(Wc,["alerts"]).properties,alerts:t.Array(oB,{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."})}),oR=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against the SLO name or SLO ID. Set by the caller in SLO query requests."}),exclude:t.Optional(t.Boolean({description:"If true, exclude SLOs matching this value instead of including them"}))},{description:"Text filter for SLO names or IDs. Set by the caller in SLO query requests. Optional; `exclude: true` removes matching SLOs."}),tags:je(Ht.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:je(p({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:je(Qc,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),Yl=t.Partial(t.Object({...Q,filters:t.Partial(oR),sort:t.Object({by:t.Enum(["name","owner","tags","updatedAt","sli","errorBudget","status"],{description:"Field to sort by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned SLOs"})})),VKe=d({tags:["slos"],url:`${Cr}/query`,method:"POST",paginated:!0,response:t.Array(uB),body:Yl}),QKe=d({tags:["slos"],url:`${Cr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(oR,["tags","statuses"])))}),response:Ft}),WKe=d({tags:["slos"],url:`${Cr}/:id`,method:"GET",params:t.Object({id:p()}),response:Qo}),ZKe=d({tags:["slos"],url:`${Cr}/:id/results`,method:"GET",params:t.Object({id:p()}),response:tR}),XKe=d({tags:["slos"],url:Cr,method:"POST",body:Wc,response:Qo}),JKe=d({tags:["slos"],url:`${Cr}/:id`,method:"PUT",params:t.Object({id:p()}),body:zl,response:Qo}),eze=d({tags:["slos"],url:`${Cr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),tze=d({tags:["slos"],url:`${Cr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),rze=d({tags:["slos"],url:`${Cr}/bulk-update`,method:"PUT",body:t.Object({sloIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})});var Wo="/v0/notifications",Qn=`${Wo}/rules`,iR=`${Wo}/slack/setup`,Ca=`${Wo}/integrations`,Vn=["triggered","resolved","no-data"],mB=["sent","stale","pending","rate-limited","failed","silenced"],lB=t.Optional(t.Object({maxMessages:t.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:t.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."})),Vl=t.Object({maxMessages:t.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:t.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."}),dB=t.Optional(Vl),fB=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),gB=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),Pa=t.Object({id:t.String({description:"Identifier of the notification target within this rule. Set by the rule author and used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:lB,renotifyConfig:fB,config:b("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:t.String({description:"Slack channel ID that receives the notification"}),integrationId:t.String({description:"Slack workspace ID that receives the notification"}),integrationName:t.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:t.String({description:"Identifier of the incident.io integration to use"}),integrationName:t.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(t.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:t.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:t.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:t.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:t.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:t.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:t.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:t.String({description:"Identifier of the webhook integration to use"}),integrationName:t.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:t.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:t.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:t.String({description:"Identifier of the Google Chat integration to use"}),integrationName:t.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:t.String({description:"Identifier of the Squadcast integration to use"}),integrationName:t.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:t.String({description:"Identifier of the Jira integration to use"}),integrationName:t.String({description:"Human readable name of the Jira integration"}),projectKey:t.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:t.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'})},{$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`."})}),Zo=t.Object({id:p({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:dB,config:b("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:p({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:p({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:p({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:p({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'})},{$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)."}),renotifyConfig:gB}),Ql=b("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(t.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),Wl=b("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),Xo=t.Object({id:t.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:t.String({description:"Display name of the notification rule."}),queryString:t.Optional(t.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:Ql,prioritiesFilter:t.Array(t.Enum(dt),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Vn),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Array(t.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:t.String({description:"Team ID that owns and manages the rule."}),createdAt:T({description:"Timestamp when Tsuga created the rule."}),updatedAt:T({description:"Timestamp when Tsuga last updated the rule."}),isActive:t.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:ke,targets:t.Array(Pa,{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:t.Optional(ue),updater:t.Optional(ue)}),Ua=t.Object({name:p({description:"Display name of the notification rule."}),queryString:t.Optional(p({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:Wl,prioritiesFilter:t.Array(t.Enum(dt),{maxItems:dt.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Vn),{maxItems:Vn.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Ve,isActive:t.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:t.Array(Zo,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. At least one target is required. This list replaces the existing targets on update."})}),Zc=t.Object({id:t.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:t.String({description:"Display name of the adaptive notification rule."}),owner:t.String({description:"Team ID that owns and manages the rule."}),createdAt:T({description:"Timestamp when Tsuga created the rule."}),updatedAt:T({description:"Timestamp when Tsuga last updated the rule."}),isActive:t.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),tags:ke,monitorIds:t.Array(t.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:Pa,creator:t.Optional(ue),updater:t.Optional(ue)}),aR=t.Object({name:p({description:"Display name of the adaptive notification rule."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Ve,isActive:t.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),monitorIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible."}),fallbackTarget:Zo}),mze=d({tags:["notification-rules"],url:Qn,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Xo)}),lze=d({tags:["notification-rules"],url:`${Qn}/:id`,params:t.Object({id:p()}),method:"GET",response:Xo}),dze=d({tags:["notification-rules"],url:Qn,method:"POST",body:Ua,response:Xo}),fze=d({tags:["notification-rules"],url:`${Qn}/:id`,method:"PUT",params:t.Object({id:p()}),body:Ua,response:Xo}),gze=d({tags:["notification-rules"],url:`${Qn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),wa=`${Wo}/adaptive-rules`,yze=d({tags:["notification-rules"],url:wa,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Zc)}),hze=d({tags:["notification-rules"],url:`${wa}/:id`,params:t.Object({id:p()}),method:"GET",response:Zc}),Tze=d({tags:["notification-rules"],url:wa,method:"POST",body:aR,response:Zc}),Eze=d({tags:["notification-rules"],url:`${wa}/:id`,method:"PUT",params:t.Object({id:p()}),body:aR,response:Zc}),Ize=d({tags:["notification-rules"],url:`${wa}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),_ze=d({tags:["notification-integrations"],url:`${iR}/start`,method:"POST",response:t.Object({redirectUrl:t.String()})}),yB=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],hB=t.Object({id:t.String(),name:t.String(),type:t.Enum(yB),createdAt:T(),ruleCount:t.Number(),creator:t.Optional(ue)}),bze=d({tags:["notification-integrations"],url:`${Qn}/integrations`,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(hB)}),Sze=d({tags:["notification-integrations"],url:`${iR}/callback`,method:"GET",query:t.Object({code:p()}),response:t.Object({success:t.Boolean()})}),Zl=["POST","PUT"],TB=t.Record(t.String(),t.String()),EB=t.Record(t.String(),t.Unknown()),IB=t.Record(t.String(),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))])),_B=b("type",[t.Object({type:t.Literal("json"),value:EB}),t.Object({type:t.Literal("form"),value:IB})]),bB=t.Object({ok:t.String(),alert:t.String()}),Xl=t.Object({id:t.String(),name:t.String(),setting:b("type",[t.Object({type:t.Literal("incident-io"),alertSourceConfigId:t.String(),tokenLastChars:t.String()}),t.Object({type:t.Literal("grafana-irm"),urlLastChars:t.String()}),t.Object({type:t.Literal("pagerduty"),integrationKeyLastChars:t.String()}),t.Object({type:t.Literal("microsoft-teams"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("webhook"),urlLastChars:t.String(),method:t.Enum(Zl),authentication:b("type",[t.Object({type:t.Literal("bearer"),tokenLastChars:t.String()}),t.Object({type:t.Literal("basic"),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("custom-header"),key:t.String(),valueLastChars:t.String()}),t.Object({type:t.Literal("none")})]),customHeaders:t.Optional(TB),payloadTemplate:_B,eventNameMapping:t.Optional(bB)}),t.Object({type:t.Literal("servicenow"),instanceName:t.String(),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("google-chat"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("squadcast"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("jira"),siteUrl:t.String(),email:t.String(),apiTokenLastChars:t.String()})]),tags:ke}),SB=t.Object({type:t.Literal("webhook"),url:p({type:"uri"}),method:t.Enum(Zl),authentication:b("type",[t.Object({type:t.Literal("bearer"),token:p({allowEmpty:!1})}),t.Object({type:t.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),t.Object({type:t.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),t.Object({type:t.Literal("none")})]),customHeaders:t.Record(p({allowEmpty:!1}),p()),payloadTemplate:b("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})]),eventNameMapping:t.Optional(t.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),sR=t.Object({type:t.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),cR=t.Object({type:t.Literal("grafana-irm"),url:p({type:"uri"})}),pR=t.Object({type:t.Literal("pagerduty"),integrationKey:p()}),uR=t.Object({type:t.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),OB=t.Object({type:t.Literal("servicenow"),instanceName:p({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:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),AB=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),xB=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),RB=t.Object({type:t.Literal("jira"),siteUrl:p({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:p({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:p({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),CB=t.Object({name:p(),setting:b("type",[sR,cR,pR,uR,SB,OB,AB,xB,RB]),tags:Ve}),PB=t.Object({type:t.Literal("webhook"),url:t.Optional(p({type:"uri"})),method:t.Optional(t.Enum(Zl)),authentication:t.Optional(b("type",[t.Object({type:t.Literal("bearer"),token:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("basic"),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("custom-header"),key:t.Optional(p({allowEmpty:!1})),value:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("none")})])),customHeaders:t.Optional(t.Record(p({allowEmpty:!1}),p())),payloadTemplate:t.Optional(b("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})])),eventNameMapping:t.Optional(t.Object({ok:t.Optional(p({allowEmpty:!1})),alert:t.Optional(p({allowEmpty:!1}))}))}),UB=t.Object({type:t.Literal("servicenow"),instanceName:t.Optional(p({allowEmpty:!1})),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),wB=t.Object({type:t.Literal("jira"),siteUrl:t.Optional(p({type:"uri",allowEmpty:!1})),email:t.Optional(p({allowEmpty:!1})),apiToken:t.Optional(p({allowEmpty:!1}))}),NB=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),LB=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),vB=t.Object({name:t.Optional(p()),setting:t.Optional(b("type",[sR,cR,pR,uR,PB,UB,NB,LB,wB]))}),Oze=d({tags:["notification-integrations"],url:Ca,method:"POST",body:CB,response:Xl}),Aze=d({tags:["notification-integrations"],url:`${Ca}/:id`,method:"GET",params:t.Object({id:p()}),response:Xl}),xze=d({tags:["notification-integrations"],url:`${Ca}/:id`,method:"PUT",params:t.Object({id:p()}),body:vB,response:Xl}),Rze=d({tags:["notification-integrations"],url:`${Ca}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),kB=b("status",[t.Object({status:t.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:t.Array(t.Object({key:t.String({description:'Jira project key, like "OPS".'}),name:t.String({description:"Human readable Jira project name."}),issueTypes:t.Array(t.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:t.Array(t.String(),{description:"Status names an issue in this project can be transitioned to."})}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),t.Object({status:t.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:t.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."}),Cze=d({tags:["notification-integrations"],url:`${Ca}/:id/jira-metadata`,method:"GET",params:t.Object({id:p()}),response:kB}),Pze=d({tags:["notification-rules"],url:`${bt}/:id/notifications`,method:"GET",params:t.Object({id:p()}),query:t.Optional(t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number())})),response:t.Object({notifications:t.Array(t.Object({id:t.String(),monitorId:t.String(),monitorResultId:t.String(),ruleId:t.Optional(t.String()),targetId:t.Optional(t.String()),status:t.Enum(mB),tryCount:t.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:t.Optional(T())})),isTruncated:t.Boolean()})}),MB=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Uze=d({tags:["notification-rules"],url:`${Qn}/test`,method:"POST",body:t.Object({notificationRule:Ua,targetIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:t.Union([t.Object({success:t.Literal(!1),overallMessage:t.String({description:"Message when there is an overall error"})}),t.Object({success:t.Boolean(),results:t.Array(t.Object({targetId:t.String({description:"The ID of the target that was tested"}),targetType:t.Enum(MB,{description:"The type of the target (e.g., slack, webhook)"}),status:t.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:t.Optional(t.String({description:"Message if the notification failed for this specific target"}))}))})])});var Nt="/v0/service-catalog";var DB=t.Object({team:t.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this team was observed for the service."})}),GB=t.Object({ingestionApiKey:t.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this ingestion key was observed for the service."})}),$B=t.Object({version:t.String({description:"Service version value observed in telemetry."}),firstSeenAt:T({description:"First time this version was observed for the service."}),lastSeenAt:T({description:"Most recent time this version was observed for the service."}),faulty:t.Optional(t.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),detectionTriggered:t.Optional(t.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."}))}),jB=t.Object({language:t.String({description:"Programming language observed for this service."}),lastSeenAt:T({description:"Most recent time this language was observed."})}),qB=t.Object({runtime:t.String({description:"Runtime observed for this service."}),lastSeenAt:T({description:"Most recent time this runtime was observed."})}),mR=t.Object({protocol:t.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),BB=t.Object({framework:t.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),FB=t.Object({platform:t.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),HB=t.Object({provider:t.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),Na=t.Object({id:t.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:t.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:t.Optional(t.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:t.Optional(t.String({description:"Environment value observed for this service."})),teams:t.Array(DB,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:t.Array(GB,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:t.Array($B,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:t.Array(jB,{description:"Programming languages observed for this service."}),runtimes:t.Array(qB,{description:"Runtime values observed for this service."}),serverProtocols:t.Array(mR,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:t.Array(mR,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:t.Array(BB,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:t.Array(FB,{description:"Cloud platforms this service is running on"}),cloudProviders:t.Array(HB,{description:"Cloud providers this service is running on"}),lastSeenAt:T({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:T({description:"First time Tsuga observed telemetry for this service."}),sources:t.Array(t.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:t.Optional(t.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:t.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:t.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:t.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:t.Number({description:"Number of error traces observed for this service in the last 24 hours."}),createdAt:T({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:T({description:"Timestamp when Tsuga last updated this service catalog entry."})}),qze=d({tags:["service-catalog"],query:t.Object({...Q,clusterId:t.Optional(p())}),method:"GET",paginated:!0,url:`${Nt}/services`,response:t.Array(Na)}),KB=t.Object({spanKind:t.Enum(Ax),count:t.Number()}),lR=t.Object({...Na.properties,spanKindCounts:t.Array(KB),envs:t.Object({primaryEnv:t.String(),allEnvs:t.Array(t.String())})}),Bze=d({tags:["service-catalog"],query:t.Object({...Q,clusterId:t.Optional(p()),env:t.Optional(p())}),method:"GET",paginated:!0,url:`${Nt}/v2/services`,response:t.Array(lR)}),Fze=d({tags:["service-catalog"],query:t.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:t.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:t.Optional(p())}),method:"GET",url:`${Nt}/v2/service`,response:lR}),Hze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId`,params:t.Object({serviceId:p()}),response:Na}),Jl=t.Object({id:t.String({description:"Tsuga-generated identifier of this service target, unique across all services. Used with delivery state such as rate limiting and re-notification."}),serviceId:t.String({description:"Identifier of the service catalog entry this target is attached to."}),config:Pa.properties.config,rateLimit:Pa.properties.rateLimit,createdAt:T({description:"Timestamp when user created this service target."}),updatedAt:T({description:"Timestamp when user last updated this service target."})}),zB=t.Object({config:Zo.properties.config,rateLimit:Zo.properties.rateLimit}),YB=t.Object({config:Zo.properties.config,rateLimit:t.Union([Vl,t.Null()])}),Kze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),response:t.Array(Jl)}),zze=d({tags:["service-catalog"],method:"POST",url:`${Nt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),body:zB,response:Jl}),Yze=d({tags:["service-catalog"],method:"PUT",url:`${Nt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),body:YB,response:Jl}),Vze=d({tags:["service-catalog"],method:"DELETE",url:`${Nt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),response:R}),VB=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var dR=t.Object({id:t.String(),hostName:t.String(),env:t.Optional(t.String()),cpuUtilizationAverage:t.Number(),hostType:t.Enum(VB),teams:t.Array(t.String()),tags:t.Array(t.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:t.String()}),Qze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/hosts`,response:t.Array(dR)}),Wze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/hosts/:hostId`,params:t.Object({hostId:p()}),response:dR}),QB=["http","db","rpc","messaging","genai","object_store"],fR={name:t.String({description:"Service or inferred dependency name shown in the graph."}),env:t.Optional(t.String({description:"Environment observed from spans."}))},ed=t.Object({...fR,nodeType:t.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:t.Union([t.String(),t.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:t.Union([t.String(),t.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:t.Optional(t.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."})),entryErrorRequestCount:t.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:t.Number({description:"Number of entry requests observed on this service, counted 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."})}),td=t.Object({...fR,nodeType:t.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a dependency detected from client-span attributes (e.g. a database, queue, or external HTTP call) that could not be matched to a service catalog entry."}),serviceType:t.Enum(QB,{description:"Inferred dependency type from span metadata, such as http, db, rpc, messaging, genai, or object_store."}),endpoint:t.Optional(t.String({description:"Inferred service endpoint address"})),resourceName:t.Optional(t.String({description:"Inferred resource name, e.g. table or queue name"}))}),WB=b("nodeType",[ed,td]),rd=t.Object({from:t.Object({env:t.Optional(t.String({description:"Environment of the source node"})),name:t.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:t.Object({env:t.Optional(t.String({description:"Environment of the target node"})),name:t.String({description:"Name of the target node"})},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:t.Number({description:"Number of cross-service transitions observed on this directed edge in the graph query window."}),errorRate:t.Optional(t.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."})),errorCount:t.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:t.Number({description:"Number of client spans observed on this edge"})},{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."}),Zze=d({tags:["service-catalog"],url:`${Nt}/services/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p()}),query:t.Object({...He.properties,query:t.Optional(p({type:"tsuga-query"}))}),response:t.Object({clusterId:t.String(),nodes:t.Array(WB),edges:t.Array(rd)})}),ZB=t.Object({monitors:t.Array(t.Object({id:t.String({description:"Identifier of the monitor"}),name:t.String({description:"Display name of the monitor"}),owner:t.String({description:"Team ID that owns the monitor"}),priority:t.Enum(dt,{description:"Priority of the monitor"})})),slos:t.Array(t.Object({id:t.String({description:"Identifier of the SLO"}),name:t.String({description:"Display name of the SLO"}),owner:t.String({description:"Team ID that owns the SLO"}),statusCount:t.Partial(t.Record(Qc,t.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"})}))}),Xze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId/related-resources`,params:t.Object({serviceId:p()}),response:ZB}),Jze=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/by-api-keys`,response:t.Record(t.String(),t.Array(t.Object({serviceName:t.String(),serviceNamespace:t.Optional(t.String())})))});var nd=`/${"v1"}/services`,od=t.Pick(Na,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),XB={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",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",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(od,{examples:[XB]});var gR=d({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:nd,method:"GET",paginated:!0,query:t.Object({...Q,clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."}))},{description:"Service list query. Use pagination and optional cluster scope."}),response:t.Array(od)}),yR=d({description:"Retrieves one telemetry-inferred service by service ID. Use this to inspect observed metadata and recent activity for a service.",operationId:"getService",tags:["services"],url:`${nd}/:serviceId`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:od}),JB=t.Pick(ed,["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."}),eF=t.Pick(td,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a database, queue, or external HTTP call) that could not be matched to a service catalog entry."}),tF=b("nodeType",[JB,eF]),rF=t.Pick(rd,["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."}),nF=t.Optional(t.Integer({...He.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."})),oF=t.Optional(t.Integer({...He.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."})),iF=p({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."}),hR=d({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Provide an explicit time range for deterministic results. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${nd}/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:t.Object({from:nF,to:oF,query:t.Optional(iF)},{description:"Service graph query. Use time range and optional span query filters."}),response:t.Object({clusterId:t.String({description:"Cluster ID the graph was built from"}),nodes:t.Array(tF,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:t.Array(rF,{description:"Directed dependency edges between graph nodes."})})});function TR(e,r){let n=r??yr(e);return n===void 0?void 0:Us(n)}function id(e){let r=yr(e);return r===void 0?"":` (default: ${r})`}function ER(e,r){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${id("from")}`).option("--to <timestamp>",`End of time range${id("to")}`).option("--query <query>",`Search query${id("query")}`).action(async(o,i)=>{let a={},c=TR("from",i.from),m=TR("to",i.to);c!==void 0&&(a.from=c),m!==void 0&&(a.to=m),i.query!==void 0&&(a.query=i.query);let l=await r()(hR,{params:{serviceId:o},query:a});W(l)})}var IR=require("node:child_process"),_R=require("node:fs"),bR=require("node:os"),ep=require("node:path");var Wn=require("node:fs");function La(e,r){let n=`${e}.tmp.${process.pid}`;(0,Wn.writeFileSync)(n,r),(0,Wn.renameSync)(n,e)}function va(e){try{return(0,Wn.readFileSync)(e,"utf8")}catch(r){if(r.code==="ENOENT")return;throw r}}function ka(e,r){if(r===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,Wn.writeFileSync)(n,r),n}function Zn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ad="tsuga-dev/agent-plugins",Xc="tsuga";function Jc(e,r){B(` $ ${e} ${r.join(" ")}`);try{(0,IR.execFileSync)(e,r,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${r.join(" ")} exited ${o}`,{cause:n})}}function aF(e,r){B("Claude Code \u2192 installing Tsuga plugin"),Jc("claude",["plugin","marketplace","add",ad]),Jc("claude",["plugin","install",`tsuga@${Xc}`]),r.autoUpdate&&sF(e)}function sF(e){let r=(0,ep.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${r} (autoUpdate)`),(0,_R.mkdirSync)((0,ep.dirname)(r),{recursive:!0});let n=va(r),o=JSON.parse(n??"{}");if(!Zn(o))throw new Error(`${r} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!Zn(i))throw new Error(`${r} "extraKnownMarketplaces" must be a JSON object`);let a=i[Xc],c=Zn(a)?a:{};o.extraKnownMarketplaces={...i,[Xc]:{source:{source:"github",repo:ad},...c,autoUpdate:!0}};let m=ka(r,n);La(r,`${JSON.stringify(o,null,2)}
|
|
130
|
+
`),B(m===void 0?" created":` patched (backup: ${m})`)}function cF(){B("Codex \u2192 installing Tsuga plugin"),Jc("codex",["plugin","marketplace","add",ad]),Jc("codex",["plugin","add",`tsuga@${Xc}`])}function SR(e){let r=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");r.command("claude-code").description("Install the Tsuga plugin into Claude Code").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{aF((0,bR.homedir)(),n),B("Restart your claude session to load the new plugins.")}),r.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{cF(),B("Restart your codex session to load the new plugins.")})}var Kt="/v0/kubernetes-explorer",pF="^[a-z0-9.-]+$",uF="^[A-Za-z0-9._-]+$",OR=256,AR=t.Optional(p({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 cr=e=>t.Optional(t.Array(p({allowEmpty:!1}),{description:e})),xR={clusterId:AR,search:t.Optional(t.String({pattern:pF,minLength:1,maxLength:OR,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."}))},RR={clusterId:AR,search:t.Optional(t.String({pattern:uF,minLength:1,maxLength:OR,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."}))},CR=t.Object(xR),PR=t.Object(RR),Ma={...xR,includeInternalNamespaces:t.Optional(t.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded."})),clusters:cr("Restrict results to these Kubernetes cluster names."),namespaces:cr("Restrict results to these namespaces."),teams:cr("Restrict results to these team names."),envs:cr("Restrict results to these environments."),...Q},UR=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],mF={...Ma,nodes:cr("Restrict results to pods scheduled on these nodes."),deployments:cr("Restrict results to pods owned by these Deployments."),statefulsets:cr("Restrict results to pods owned by these StatefulSets."),daemonsets:cr("Restrict results to pods owned by these DaemonSets."),podStatus:t.Optional(t.Array(t.Enum(UR),{description:"Restrict results to pods whose resolved status matches any of these values. Includes 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."}))},Jo=t.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),lF=["deployment","statefulset","daemonset"],wR=t.Object({kind:t.Enum(lF,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:t.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})}),NR=t.Object({podName:t.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:t.Optional(t.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:t.Enum(UR,{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:t.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:t.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:t.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:t.Optional(T({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),sd=t.Object({...NR.properties,workload:t.Optional(wR),cpuUsageMilli:t.Optional(t.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:t.Optional(t.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:t.Optional(t.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),cpuUtilization:t.Optional(t.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:t.Optional(t.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."}))}),dF=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUtilization","memoryUtilization","createdAt"],I9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/pods`,query:t.Object({...mF,sortBy:t.Optional(t.Enum(dF,{description:"Field to sort pods by."})),sortDirection:t.Optional(Jo)}),paginated:!0,response:t.Array(sd)}),cd=t.Object({cluster:t.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:t.Optional(t.Array(t.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:t.Optional(t.Array(t.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:t.Optional(t.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:t.Optional(t.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:t.Optional(t.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:t.Optional(t.Object({Pending:t.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:t.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:t.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:t.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:t.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."}))}),fF=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],_9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/clusters`,query:t.Object({...RR,teams:cr("Restrict to clusters that host workloads from these team names."),envs:cr("Restrict to clusters that host workloads in these environments."),sortBy:t.Optional(t.Enum(fF,{description:"Field to sort clusters by."})),sortDirection:t.Optional(Jo),...Q}),paginated:!0,response:t.Array(cd)}),pd=t.Object({namespace:t.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:t.Optional(t.Array(t.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:t.Optional(t.Array(t.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.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"],b9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/namespaces`,query:t.Object({...Ma,sortBy:t.Optional(t.Enum(gF,{description:"Field to sort namespaces by."})),sortDirection:t.Optional(Jo)}),paginated:!0,response:t.Array(pd)}),ud=t.Object({deployment:t.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),yF=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],S9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/deployments`,query:t.Object({...Ma,sortBy:t.Optional(t.Enum(yF,{description:"Field to sort deployments by."})),sortDirection:t.Optional(Jo)}),paginated:!0,response:t.Array(ud)}),md=t.Object({statefulSet:t.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready StatefulSet replicas from StatefulSet status telemetry. Present when StatefulSet status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the StatefulSet. Present when StatefulSet spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),hF=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],O9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/statefulsets`,query:t.Object({...Ma,sortBy:t.Optional(t.Enum(hF,{description:"Field to sort StatefulSets by."})),sortDirection:t.Optional(Jo)}),paginated:!0,response:t.Array(md)}),ld=t.Object({daemonSet:t.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:t.Optional(t.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:t.Optional(t.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),TF=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],A9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/daemonsets`,query:t.Object({...Ma,sortBy:t.Optional(t.Enum(TF,{description:"Field to sort DaemonSets by."})),sortDirection:t.Optional(Jo)}),paginated:!0,response:t.Array(ld)}),dd=t.Object({overview:t.Object({...NR.properties,workload:t.Optional(wR)}),healthMetrics:t.Object({cpu:t.Object({usage:t.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:t.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:t.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})}),memory:t.Object({usage:t.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:t.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:t.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})})}),searchFilters:t.Object({logs:t.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:t.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})})}),LR=t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),x9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/pod-details`,query:LR,response:dd}),fd=t.Object({configuration:t.Optional(t.Object({spec:t.Record(t.String(),t.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:T({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})})),labels:t.Record(t.String(),t.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:t.Record(t.String(),t.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:t.Optional(T({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),R9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/pod-manifest`,query:LR,response:fd}),gd=t.Object({podName:t.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:t.Optional(t.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.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."}),yd=t.Object({overview:t.Object({deploymentName:t.String({description:"Kubernetes Deployment name for this detail response."}),namespace:t.Optional(t.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:t.Optional(t.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:t.Optional(t.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:t.Optional(T({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:t.Array(gd,{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:t.Array(t.Object({replicaSetName:t.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:t.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:t.Optional(T({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),observedGeneration:t.Optional(t.Integer({description:"Latest generation observed for the ReplicaSet revision. Present when generation telemetry is observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready replicas for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),replicas:t.Optional(t.Integer({description:"Total replica count for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),logsSearchFilter:t.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."})}),C9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/deployment-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:yd}),EF=t.Object({overview:t.Object({statefulSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyReplicas:t.Optional(t.Integer()),desiredReplicas:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array(gd,{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:t.Array(t.Object({revisionName:t.String(),firstSeen:t.Optional(T())}))}),P9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/statefulset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:EF}),IF=t.Object({overview:t.Object({daemonSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyNodes:t.Optional(t.Integer()),desiredNodes:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array(gd,{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:t.Array(t.Object({observedGeneration:t.Integer(),firstSeen:t.Optional(T())}))}),U9e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Kt}/daemonset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:IF});var Pr=`/${"v1"}/kubernetes-explorer`,vR=t.Pick(sd,["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."}),_F={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(vR,{examples:[_F]});var kR=t.Pick(cd,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),bF={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(kR,{examples:[bF]});var MR=t.Pick(pd,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),SF={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(MR,{examples:[SF]});var DR=t.Pick(ud,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),OF={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(DR,{examples:[OF]});var GR=t.Pick(md,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),AF={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(GR,{examples:[AF]});var $R=t.Pick(ld,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),xF={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($R,{examples:[xF]});var jR=t.Pick(dd,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),RF={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.usage",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(jR,{examples:[RF]});var qR=t.Pick(fd,["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."}),CF={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(qR,{examples:[CF]});var BR=t.Pick(yd,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),PF={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",observedGeneration:7,readyReplicas:3,replicas:3,logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(BR,{examples:[PF]});var FR=t.Object({clusterId:t.Optional(p({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."}))}),Da=t.Pick(CR,["clusterId","search"]),UF=t.Pick(PR,["clusterId","search"]),HR=d({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/pods`,query:Da,response:t.Array(vR)}),KR=d({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/clusters`,query:UF,response:t.Array(kR)}),zR=d({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/namespaces`,query:Da,response:t.Array(MR)}),YR=d({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/deployments`,query:Da,response:t.Array(DR)}),VR=d({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/statefulsets`,query:Da,response:t.Array(GR)}),QR=d({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/daemonsets`,query:Da,response:t.Array($R)}),WR=t.Object({...FR.properties,k8sCluster:p({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:p({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:p({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."})}),ZR=d({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/pod-details`,query:WR,response:jR}),XR=d({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/pod-manifest`,query:WR,response:qR}),JR=d({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Pr}/deployment-details`,query:t.Object({...FR.properties,k8sCluster:p({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:p({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:p({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:BR});var wF="clusterId";function eC(e,r,n){let o=r.query.properties??{},i=Object.keys(o).filter(a=>a!==wF);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),m=o[a]?.description??"";n?e.requiredOption(`--${c} <value>`,m):e.option(`--${c} <value>`,m)}return i}function ei(e,r,n,o){let i=e.command(r).description(n.description??`List Kubernetes ${r}`),a=eC(i,n,!1);i.action(async c=>{let m={};for(let l of a)c[l]!==void 0&&(m[l]=c[l]);W(Object.keys(m).length>0?await o()(n,{query:m}):await o()(n))})}function hd(e,r,n,o){let i=e.command(r).description(n.description??`Get Kubernetes ${r}`),a=eC(i,n,!0);i.action(async c=>{let m={};for(let l of a)m[l]=c[l];W(await o()(n,{query:m}))})}function tC(e,r){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");ei(n,"pods",HR,r),ei(n,"clusters",KR,r),ei(n,"namespaces",zR,r),ei(n,"deployments",YR,r),ei(n,"statefulsets",VR,r),ei(n,"daemonsets",QR,r),hd(n,"pod-details",ZR,r),hd(n,"pod-manifest",XR,r),hd(n,"deployment-details",JR,r)}var Ur="/v0/dashboards",nC=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],NF=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],Z9e=[...NF,"note"];var LF=["ns","us","ms","s","m","h","days"];var vF=["B","KB","MB","GB","TB","PB"];var kF=20;var oC=t.Object({type:t.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),iC=t.Object({type:t.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:t.Enum(LF,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),aC=t.Object({type:t.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:t.Enum(vF,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),sC=t.Object({type:t.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),cC=t.Object({type:t.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),pC=t.Object({type:t.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),uC=t.Object({type:t.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"}),MF=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),DF=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit",maxLength:kF})},{$id:"InputDataNormalizerCustom",title:"Custom"}),ft=b("type",[iC,aC,sC,cC,pC,oC,uC,MF],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns. Set by the dashboard author and returned when configured."}),gt=b("type",[iC,aC,sC,cC,pC,oC,uC,DF],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns. Set by the dashboard author. Optional; custom unit labels are limited to 20 characters."}),mC=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(ft)},{title:"WidgetListColumn"}),lC=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(gt)},{title:"WidgetListColumn"}),ti=["background","no-background"],GF=["table","legend-only","no-legend"];var $F=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],dC=["alert","warning","success"],pr=t.Object({operator:t.Enum($F,{description:"Comparator used to evaluate the metric value"}),value:t.Number({description:"Threshold value used when evaluating the operator"}),color:t.Enum(dC,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),jF=t.Object({value:t.Number({description:"Y-axis value where the threshold marker is placed"}),level:t.Enum(dC,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),qF=["sec","min","hour","day"],mn=t.Object({time:t.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:t.Enum(qF,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Set by the dashboard author. Optional; when present, `time` and `metric` together define the bucket width."});var un=t.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),ri=t.Object({formula:t.Optional(t.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),t.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>".'})))}),ni=t.Object({formula:t.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),p({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>".'})))}),rp={source:Uc,queries:uS,formula:t.Optional(Nc),aliases:t.Optional(ri),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},np={source:Uc,queries:la,formula:t.Optional(kn),aliases:t.Optional(ni),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},oi={...rp,groupBy:t.Optional(Mo)},ii={...np,groupBy:t.Optional(Ir)},Ae=t.Enum(GF,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),me=t.Optional(t.Number({description:"Number of decimal places to display in the value"})),Dt=t.Optional(t.Array(jF,{description:"Threshold markers displayed on the chart"})),BF=t.Object({name:t.String({description:"Display name of the table column"}),...rp,source:ar,normalizer:t.Optional(ft),precision:me},{title:"TableColumn"}),FF=t.Object({name:p({description:"Display name of the table column"}),...np,source:ar,normalizer:t.Optional(gt),precision:me},{title:"TableColumn"}),HF=t.Array(t.Object({id:t.String({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),KF=t.Array(t.Object({id:p({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),fC=["horizontal","vertical"],zF=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:t.String({description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array(mC,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}))),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for list widgets. Optional on create or update and returned when configured."}))},{$id:"GraphVisualizationList",title:"List"}),YF=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array(lC,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}))),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for list widgets. Optional on create or update; omit or set false to use truncated cells."}))},{$id:"InputGraphVisualizationList",title:"List"}),tp=b("type",[t.Object({type:t.Literal("auto",{description:"Automatically choose this axis bound"})}),t.Object({type:t.Literal("number",{description:"Use a fixed numeric axis bound"}),value:t.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),ai=t.Object({min:tp,max:tp,scale:b("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Set by the dashboard author and returned when configured."}),si=t.Object({min:tp,max:tp,scale:b("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({minimum:0,description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Set by the dashboard author. Optional on create or update and returned when configured."}),VF=t.Array(t.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),QF=t.Array(t.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 WF=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(ai)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),ZF=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(si)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),XF=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),query:t.String({description:"The read-only SQL query to execute against the connection."}),listColumns:t.Optional(t.Array(mC,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}))),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for connection list widgets. Optional on create or update and returned when configured."}))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),JF=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:t.Optional(t.Array(lC,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}))),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for connection list widgets. Optional on create or update; omit or set false to use truncated cells."}))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),eH=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),tH=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),rH=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),nH=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),oH=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(ai)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),iH=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(si)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),aH=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(ft),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),sH=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),cH=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:t.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(fC,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),pH=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:p({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(fC,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Ga=t.Array(t.String({description:"Raw PromQL expression for this widget. Set by the dashboard author and returned as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),$a=t.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget. Set by the dashboard author."}),{minItems:1,description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),uH=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ga,aliases:t.Optional(ri),timeBucket:t.Optional(mn),normalizer:t.Optional(ft),precision:me,legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(ai),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),mH=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:$a,aliases:t.Optional(ni),timeBucket:t.Optional(mn),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(si),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),lH=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ga,aliases:t.Optional(ri),backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(ft),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),dH=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:$a,aliases:t.Optional(ni),backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),fH=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ga,aliases:t.Optional(ri),normalizer:t.Optional(ft),precision:me,conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),gH=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:$a,aliases:t.Optional(ni),normalizer:t.Optional(gt),precision:me,conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),yH=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ga,aliases:t.Optional(ri),normalizer:t.Optional(ft),precision:me,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),hH=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:$a,aliases:t.Optional(ni),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),TH=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ga,aliases:t.Optional(ri),timeBucket:t.Optional(mn),precision:me,normalizer:t.Optional(ft),thresholds:Dt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(ai)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),EH=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:$a,aliases:t.Optional(ni),timeBucket:t.Optional(mn),precision:me,normalizer:t.Optional(gt),thresholds:Dt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(si)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),IH=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...oi,timeBucket:t.Optional(mn),normalizer:t.Optional(ft),precision:me,legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(ai),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),_H=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ii,timeBucket:t.Optional(mn),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae),thresholds:Dt,yAxisSettings:t.Optional(si),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),bH=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...oi,normalizer:t.Optional(ft),precision:me,conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),SH=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ii,normalizer:t.Optional(gt),precision:me,conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),OH=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...oi,normalizer:t.Optional(ft),precision:me,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPie",title:"Pie"}),AH=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ii,normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPie",title:"Pie"}),xH=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...rp,backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(ft),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),RH=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...np,backgroundMode:t.Optional(t.Enum(ti,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(pr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),CH=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...oi,timeBucket:t.Optional(mn),precision:me,normalizer:t.Optional(ft),thresholds:Dt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(ai)},{$id:"GraphVisualizationBar",title:"Bar"}),PH=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ii,timeBucket:t.Optional(mn),precision:me,normalizer:t.Optional(gt),thresholds:Dt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(si)},{$id:"InputGraphVisualizationBar",title:"Bar"}),UH=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...oi,precision:me,normalizer:t.Optional(ft),percentileMarkers:t.Optional(VF),boundsScale:t.Optional(wc)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),wH=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ii,precision:me,normalizer:t.Optional(gt),percentileMarkers:t.Optional(QF),boundsScale:t.Optional(wc)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),gC=["red","pink","violet","blue","cyan","green","yellow","orange"],yC=t.Enum(gC,{description:"Color palette used to render the heatmap intensity gradient"}),NH=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...oi,precision:me,normalizer:t.Optional(ft),palette:t.Optional(yC)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),LH=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ii,precision:me,normalizer:t.Optional(gt),palette:t.Optional(yC)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),hC=t.Object({from:t.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:t.Enum(gC,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold"}),vH=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...rp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(hC,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:t.Optional(ft)},{$id:"GraphVisualizationGauge",title:"Gauge"}),kH=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...np,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(hC,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:t.Optional(gt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),MH=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(BF,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Mo),defaultSorting:t.Optional(HF),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"})))},{$id:"GraphVisualizationTable",title:"Table"}),DH=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(FF,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Ir),defaultSorting:t.Optional(KF),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"})))},{$id:"InputGraphVisualizationTable",title:"Table"}),GH=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(t.String({description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(nC,{description:"Background color used to render the note"})),noteAlign:t.Optional(un),noteJustifyContent:t.Optional(un)},{$id:"GraphVisualizationNote",title:"Note"}),$H=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(nC,{description:"Background color used to render the note"})),noteAlign:t.Optional(un),noteJustifyContent:t.Optional(un)},{$id:"InputGraphVisualizationNote",title:"Note"}),jH=b("type",[WF,XF,eH,rH,oH,aH,uH,lH,fH,yH,TH,IH,bH,OH,xH,vH,CH,UH,NH,MH,zF,GH,cH],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),qH=b("type",[ZF,JF,tH,nH,iH,sH,mH,dH,gH,hH,EH,_H,SH,AH,RH,kH,PH,wH,LH,DH,YF,$H,pH],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),op=t.Object({id:t.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:t.Optional(t.String({description:"Display name of the graph widget."})),description:t.Optional(t.String({description:"Optional text shown with the graph widget."})),descriptionAlign:t.Optional(un),descriptionJustifyContent:t.Optional(un),visualization:jH,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Set by the dashboard author when arranging widgets. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph"}),ip=t.Object({id:p({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:t.Optional(p({description:"Display name of the graph widget."})),description:t.Optional(t.String({minLength:1,maxLength:800,description:"Optional text shown with the graph widget. Maximum length is 800 characters."})),descriptionAlign:t.Optional(un),descriptionJustifyContent:t.Optional(un),visualization:qH,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Set by the dashboard author when arranging widgets. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph"}),rC=10,BH=t.Array(t.Object({key:t.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(t.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter. Set by the dashboard author and returned as stored."}),exclude:t.Optional(t.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."}),FH=t.Array(t.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter. Set by the dashboard author."}),exclude:t.Optional(t.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:rC,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${rC} filters are allowed.`}),ci=t.Object({id:t.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:t.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:t.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:t.Array(op,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(BH),createdAt:T({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:T({description:"Timestamp when Tsuga last updated the dashboard."}),creator:t.Optional(ue),updater:t.Optional(ue),tags:ke,timePreset:t.Optional(t.Enum(zp,{description:"Relative time preset used when opening the dashboard."})),folderId:t.Optional(t.String({description:"Folder that contains the dashboard. Set from the dashboard\u2019s saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),ap=t.Object({name:p({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard. Set by the caller on create or update. Required and used for dashboard access control."}),graphs:t.Array(ip,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(FH),tags:Ve,timePreset:t.Optional(t.Enum(zp,{description:"Relative time preset used when opening the dashboard. Set by the caller or by Tsuga\u2019s default. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Set by the caller on create or update. 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."}))}),zt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},TC=[zt.OWNER,zt.TAGS,zt.WIDGET_COUNT,zt.UPDATED_AT,zt.NAME],sp=t.Partial(t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Set by the caller in dashboard query requests. Optional; omit to avoid text filtering."}),exclude:t.Optional(t.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Set by the caller in dashboard query requests. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:je(Ht.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Set by the caller in dashboard query requests. 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"})),HH=t.Partial(t.Object({...Q,filters:sp,sort:t.Object({by:t.Enum([zt.IS_FAVORITE,zt.OWNER,zt.TAGS,zt.WIDGET_COUNT,zt.UPDATED_AT,zt.NAME],{description:"Field to sort the returned dashboards by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),X9e=d({tags:["dashboards"],url:`${Ur}/query`,method:"POST",paginated:!0,response:t.Array(ci),body:HH}),J9e=d({tags:["dashboards"],url:`${Ur}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Omit(sp,["tags"]))}),response:Ft}),e3e=d({tags:["dashboards"],url:`${Ur}/:id`,method:"GET",params:t.Object({id:p()}),response:ci}),t3e=d({tags:["dashboards"],url:Ur,method:"POST",body:ap,response:ci}),r3e=d({tags:["dashboards"],url:`${Ur}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Partial(ap),response:ci}),n3e=d({tags:["dashboards"],url:`${Ur}/bulk-update`,method:"PUT",body:t.Object({dashboardIds:t.Array(p(),{description:"Dashboard IDs to update. Set by the caller. At least one dashboard ID is required."}),owner:t.Optional(p({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Set by the caller. Optional when folderId is provided; omit to keep the current owner."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain every dashboard. Set by the caller. 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:t.Object({})}),o3e=d({tags:["dashboards"],url:`${Ur}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),i3e=d({tags:["dashboards"],url:`${Ur}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:t.Omit(ip,["id"]),response:op}),a3e=d({tags:["dashboards"],url:`${Ur}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var pi=`/${"v1"}/dashboards`,ja=t.Pick(ci,["id","name","owner","graphs","filters","tags","timePreset","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)."}),KH={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"};Object.assign(ja,{examples:[KH]});var zH=t.Object({by:t.Enum([...TC],{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:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"}),EC=t.Object({...Q,filters:t.Optional(t.Pick(sp,["owners","searchQuery","tags","folderId"])),sort:t.Optional(zH)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),YH={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(EC,{examples:[YH]});var IC=d({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${pi}/query`,method:"POST",paginated:!0,body:EC,response:t.Array(ja)}),_C=d({description:"Retrieves one dashboard by ID when the authenticated operation key can read it. Use this before updating or cloning a dashboard definition.",operationId:"getDashboard",tags:["dashboards"],url:`${pi}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:ja}),Td=t.Pick(ap,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),VH={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",folderId:null};Object.assign(Td,{examples:[VH]});var QH=t.Omit(ip,["id"],{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; provide the replacement graph definition without an `id` field."}),bC=d({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:pi,method:"POST",body:Td,response:ja}),SC=d({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${pi}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:t.Partial(Td),response:ja}),WH=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),OC=d({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${pi}/:id`,method:"DELETE",params:WH,response:R}),f3e=d({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${pi}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:p({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:QH,response:op});var AC=100,xC=3,ui=t.Object({id:t.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:t.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:t.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:t.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Ft,teamOverrideFields:t.Optional(t.Array(t.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:T({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:T({description:"Timestamp when Tsuga created the key."}),creator:t.Optional(ue),updater:t.Optional(ue),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),qa=t.Object({name:t.String({format:Uo,minLength:1,maxLength:AC,description:`Kebab-case name for the ingestion API key. Maximum length is ${AC} characters.`}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Ht,teamOverrideFields:t.Union([t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:xC,description:`Array form. Up to ${xC} fields are allowed.`}),t.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."})}),Ba="/v0/ingestion-api-keys",S3e=d({tags:["ingestion-api-keys"],url:Ba,method:"POST",body:qa,response:t.Intersect([ui,t.Object({key:t.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."})})])}),O3e=d({tags:["ingestion-api-keys"],url:Ba,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(ui)}),A3e=d({tags:["ingestion-api-keys"],url:`${Ba}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:ui}),x3e=d({tags:["ingestion-api-keys"],url:`${Ba}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1})}),body:qa,response:ui}),R3e=d({tags:["ingestion-api-keys"],url:`${Ba}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var Fa=`/${"v1"}/ingestion-api-keys`,Ha=t.Pick(ui,["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)."}),RC={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Ha,{examples:[RC]});var CC=t.Pick(qa,["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."}),PC=t.Pick(qa,["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."}),UC={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(CC,{examples:[UC]});Object.assign(PC,{examples:[UC]});var ZH={...RC,key:"tsuga_in:v1:abc123xyx7Qm"},wC=d({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Fa,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Ha)}),k3e=d({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:`${Fa}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Ha}),XH=t.Intersect([t.Pick(Ha,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),t.Object({key:t.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:ZH}),NC=d({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:Fa,method:"POST",body:CC,response:XH}),LC=d({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:`${Fa}/:id`,method:"PUT",params:t.Object({id:p({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:PC,response:Ha}),vC=d({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:`${Fa}/:id`,method:"DELETE",params:t.Object({id:p({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:R});var JH={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"]}},[$3e,_d,Ka]=e2(JH);function e2(e){let r=[],n=[],o=[],i=Object.keys(e);for(let a of i){r.push(a);let c=e[a];for(let m in c){n.push(m);let l=c[m];Array.isArray(l)&&o.push(...l)}}return[Ed(r),Ed(n),Ed(o)]}function Ed(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var Id=t.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),t2=t.Object({versioningStatus:t.Optional(t.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),r2=t.Object({domainName:t.Optional(t.String()),origins:t.Optional(t.Array(t.String()))}),n2=t.Object({allocatedStorageGib:t.Optional(t.Number()),encryptedAtRest:t.Optional(t.Boolean()),engine:t.Optional(t.String()),dynamoDbItemCount:t.Optional(t.Number()),dynamoDbActualSizeGib:t.Optional(t.Number())}),o2=t.Object({version:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnets:t.Optional(t.Array(t.String()))}),i2=t.Object({artifactRegistryFormat:t.Optional(t.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:t.Optional(t.String()),tagMutability:t.Optional(t.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:t.Optional(t.Boolean()),encryptionType:t.Optional(t.String())}),a2=t.Object({status:t.Optional(t.String()),activeServices:t.Optional(t.Number()),pendingTasks:t.Optional(t.Number()),runningTasks:t.Optional(t.Number()),registeredContainerInstances:t.Optional(t.Number()),capacityProviders:t.Optional(t.Array(t.String()))}),s2=t.Object({status:t.Optional(t.String()),desiredStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String()),availabilityZone:t.Optional(t.String()),startedAt:t.Optional(T())}),c2=t.Object({isEncrypted:t.Optional(t.Boolean()),ownerId:t.Optional(t.String()),state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","updating"]))}),p2=t.Object({type:t.Optional(t.String()),osType:t.Optional(t.String()),subnetIds:t.Optional(t.Array(t.String())),nbContainers:t.Optional(t.Number())}),u2=t.Object({digest:t.String(),imageTags:t.Array(t.String()),imageSizeBytes:t.Optional(t.Number()),imagePushedAt:t.Optional(T()),mediaType:t.Optional(t.String()),repositoryName:t.String(),repositoryId:t.Optional(t.String()),scanStatus:t.Optional(t.String())}),m2=t.Object({url:t.Optional(t.String()),maxMessageSizeBytes:t.Optional(t.Number()),messageRetentionHours:t.Optional(t.Number())}),l2=t.Object({runtime:t.Optional(t.String()),memoryAllocationMib:t.Optional(t.Number()),timeoutMs:t.Optional(t.Number()),codeSha256:t.Optional(t.String())}),d2=t.Object({kind:t.Optional(t.String())}),f2=t.Object({instanceId:t.String(),architecture:t.Optional(t.String()),instanceType:t.Optional(t.String()),operatingSystem:t.Optional(t.String()),memoryMib:t.Optional(t.Number()),vCpus:t.Optional(t.Number()),vpcId:t.Optional(t.String()),k8sClusterId:t.Optional(t.String())}),g2=t.Object({id:t.Optional(t.String()),ipCidrBlocks:t.Array(t.String())}),y2=t.Object({protocol:t.Optional(Id),port:t.Optional(t.Number()),instanceProtocol:t.Optional(Id),instancePort:t.Optional(t.Number())}),h2=t.Object({protocol:t.Optional(t.String()),ports:t.Optional(t.Array(t.String())),portRange:t.Optional(t.String()),allPorts:t.Optional(t.Boolean())}),T2=t.Object({name:t.String(),ip:t.Optional(t.String()),type:t.Enum(["public","private"])}),E2=t.Object({type:t.String(),name:t.String()}),I2=t.Object({frontendIp:t.Optional(T2),backendIpPools:t.Array(E2)}),_2=t.Object({targetId:t.String(),targetPort:t.Optional(t.Number()),targetType:t.Optional(t.Enum(["instance","ip","lambda","alb"])),healthState:t.Optional(t.String()),healthReason:t.Optional(t.String()),healthDescription:t.Optional(t.String()),availabilityZone:t.Optional(t.String())}),b2=t.Object({protocol:t.Optional(Id),port:t.Optional(t.Number()),type:t.Optional(t.Enum(["alb","lambda","instance","ip"])),name:t.Optional(t.String()),targetGroupArn:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),healthCheckProtocol:t.Optional(t.String()),healthCheckPort:t.Optional(t.String()),healthCheckPath:t.Optional(t.String()),healthCheckIntervalSeconds:t.Optional(t.Number()),healthCheckTimeoutSeconds:t.Optional(t.Number()),healthyThresholdCount:t.Optional(t.Number()),unhealthyThresholdCount:t.Optional(t.Number()),targets:t.Optional(t.Array(_2)),targetCount:t.Optional(t.Number()),healthyTargetCount:t.Optional(t.Number()),loadBalancerArns:t.Optional(t.Array(t.String()))}),S2=t.Object({first:t.Optional(t.String()),last:t.Optional(t.String()),scope:t.Optional(t.Number())}),O2=t.Object({type:t.Optional(t.String()),name:t.Optional(t.String()),alwaysServe:t.Optional(t.Boolean()),subnets:t.Optional(t.Array(t.Union([t.Number(),S2]))),target:t.Optional(t.String()),weight:t.Optional(t.Number()),priority:t.Optional(t.Number()),status:t.Optional(t.String())}),A2=t.Object({instanceId:t.Optional(t.String()),state:t.Optional(t.String()),reasonCode:t.Optional(t.String()),description:t.Optional(t.String())}),x2=t.Object({loadBalancerType:t.Optional(t.String()),dnsName:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnetIds:t.Array(t.String()),scheme:t.Optional(t.String()),listeners:t.Optional(t.Union([t.Array(y2),t.Array(h2)])),targets:t.Optional(t.Union([t.Array(t.String()),t.Array(A2),t.Array(O2)])),azureLoadBalancingRules:t.Optional(t.Array(I2))}),R2=t.Object({domainName:t.Optional(t.String()),expiresAt:t.Optional(T()),inUseBy:t.Optional(t.Array(t.String())),renewalEligibility:t.Optional(t.String()),revokedAt:t.Optional(T()),status:t.Optional(t.String()),type:t.Optional(t.String())}),C2=t.Object({state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:t.Optional(t.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),P2=t.Object({osType:t.Optional(t.Enum(["Windows","Linux"]))}),U2=t.Object({state:t.Optional(t.String()),volumeType:t.Optional(t.String())}),w2=t.Intersect([t.Object({isEncrypted:t.Optional(t.Boolean()),sizeGib:t.Optional(t.Number())}),t.Union([C2,U2,P2])]),N2=t.Object({instanceCount:t.Optional(t.Number()),hostnames:t.Optional(t.Array(t.String())),runtime:t.Optional(t.String())}),cp=t.Union([t.Object({category:t.Literal("application"),resourceType:t.Literal("webService"),attributes:t.Optional(N2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("bucket"),attributes:t.Optional(t2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("messagingService"),attributes:t.Optional(m2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("fileSystem"),attributes:t.Optional(c2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("contentDeliveryNetwork"),attributes:t.Optional(r2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("database"),attributes:t.Optional(n2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("storageAccount"),attributes:t.Optional(d2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("volume"),attributes:t.Optional(w2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("virtualMachine"),attributes:t.Optional(f2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("serverless"),attributes:t.Optional(l2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("kubernetesCluster"),attributes:t.Optional(o2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerRepository"),attributes:t.Optional(i2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerCluster"),attributes:t.Optional(a2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerServiceTask"),attributes:t.Optional(s2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerService"),attributes:t.Optional(p2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerImage"),attributes:t.Optional(u2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("virtualNetwork"),attributes:t.Optional(g2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("loadBalancer"),attributes:x2}),t.Object({category:t.Literal("network"),resourceType:t.Literal("targetGroup"),attributes:t.Optional(b2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("certificate"),attributes:t.Optional(R2)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var Xn="/v0/inventory",za=["aws","gcp","azure"],kC=["scan_in_progress","success","failure","partial"],Sd=t.Object({id:t.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:t.Enum(za,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:t.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:t.Optional(t.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:t.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:t.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:t.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:t.Optional(T({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:t.Optional(T({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:T({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:ke,nativeAttributes:t.Optional(t.Unsafe({type:"object",additionalProperties:!0})),covered:t.Optional(t.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),mi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},MC=t.Object({cloudPlatforms:je(t.Enum(za),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:za.length}),cloudAccounts:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:je(t.Enum(Ka),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:Ka.length}),resourceTypes:je(t.Enum(_d),{description:"Restrict results to resources of any of these normalized resource types",maxItems:_d.length}),tags:je(Ht.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:t.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:t.Object({value:p({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:t.Optional(t.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"}),Od=t.Partial(t.Object({...Q,filters:t.Partial(MC),sort:t.Object({by:t.Enum([mi.DISPLAY_NAME,mi.CLOUD_ACCOUNT,mi.NATIVE_RESOURCE_TYPE,mi.CLOUD_REGION,mi.RESOURCE_TYPE,mi.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),Y3e=d({tags:["inventory"],method:"POST",url:`${Xn}/resources/query`,paginated:!0,body:Od,response:t.Array(t.Intersect([Sd,cp]))}),L2=["resourceType","cloudAccount","isIacManaged"],V3e=d({tags:["inventory"],method:"POST",url:`${Xn}/resources/counts`,body:t.Object({filters:t.Optional(t.Partial(MC)),groupBy:t.Enum(L2,{description:"Dimension to group the resource counts by."})}),response:t.Array(t.Object({value:t.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:t.Integer({description:"Number of resources in this group matching the requested filters."})}))}),Q3e=d({tags:["inventory"],method:"GET",url:`${Xn}/resources/filter-options`,response:t.Object({cloudRegions:t.Array(t.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:t.Array(t.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Ft})}),v2=b("type",[t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({description:"AWS account ID that Tsuga scans."}),externalId:t.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:t.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:t.String({description:"Workload identity provider resource name used for federated authentication."})}),t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:t.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:t.String({description:"Azure tenant ID that owns the subscription."})})]),k2="^[0-9]{12}$",M2="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",D2="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",G2="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",$2="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",bd="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",j2=t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({pattern:k2,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:p({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({pattern:M2,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"}),q2=t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({pattern:D2,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:t.String({pattern:G2,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:t.String({pattern:$2,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"}),B2=t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({pattern:bd,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:t.String({pattern:bd,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:t.String({pattern:bd,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),DC=b("type",[j2,q2,B2]),li=t.Object({id:t.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:t.Enum(za,{description:"Cloud provider of the account."}),cloudAccountId:t.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(t.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(t.String({description:"Cloud organization identifier, when known."})),connectionSettings:v2,createdBy:t.Optional(t.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:T({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:t.Optional(t.Enum(kC,{description:"Status of the most recent inventory scan."}))}),Ad=t.Object({cloudType:t.Enum(za,{description:"Cloud provider of the account."}),cloudAccountId:p({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:DC,lastScanStatus:t.Optional(t.Enum(kC,{description:"Status of the most recent inventory scan."}))}),Jn=`${Xn}/cloud-accounts`,W3e=d({tags:["inventory"],url:Jn,method:"GET",response:t.Array(li)}),Z3e=d({tags:["inventory"],url:`${Jn}/:id`,method:"GET",params:t.Object({id:p()}),response:li}),X3e=d({tags:["inventory"],url:Jn,method:"POST",body:Ad,response:li}),xd=t.Object({accountFriendlyName:p()}),J3e=d({tags:["inventory"],url:`${Jn}/:id`,method:"PUT",params:t.Object({id:p()}),body:xd,response:li}),e4e=d({tags:["inventory"],url:`${Jn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),t4e=d({tags:["inventory"],url:`${Xn}/trigger-scan`,method:"POST",body:t.Object({}),response:t.Object({success:t.Literal(!0)})}),r4e=d({tags:["inventory"],url:`${Jn}/azure/onboarding`,method:"POST",body:t.Object({tenantId:p()}),response:t.Object({subjectId:t.String(),audience:t.String()})}),n4e=d({tags:["inventory"],method:"POST",url:`${Jn}/validate/:type`,params:t.Object({type:p()}),body:t.Object({data:DC,id:t.Optional(p())}),response:t.Object({areAccountSettingsValid:t.Boolean(),message:t.Optional(t.String())})}),GC=`${Xn}/settings`,o4e=d({tags:["inventory"],url:GC,method:"GET",response:t.Object({settings:t.Optional(t.Object({id:t.String(),infrastructureIdentifiers:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))}))})}),F2=50,i4e=d({tags:["inventory"],url:GC,method:"POST",body:t.Object({infrastructureIdentifiers:t.Array(t.Object({name:p({allowEmpty:!1}),value:t.Optional(p({allowEmpty:!1}))}),{maxItems:F2})}),response:t.Object({})}),a4e=d({tags:["inventory"],url:`${Xn}/iac-tags-proposal`,method:"GET",response:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))});var $C=`/${"v1"}/inventory`,H2=t.Omit(Sd,["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)."}),jC=t.Intersect([H2,cp],{$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)."}),K2={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(jC,{examples:[K2]});var qC=d({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${$C}/resources/query`,method:"POST",paginated:!0,body:Od,response:t.Array(jC)}),Ya=`${$C}/cloud-accounts`,Va=t.Pick(li,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),z2={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(Va,{examples:[z2]});var BC=t.Pick(Ad,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),Y2={cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",connectionSettings:{type:"aws",accountId:"123456789012",externalId:"tsuga-external-id",roleArn:"arn:aws:iam::123456789012:role/tsuga-inventory"}};Object.assign(BC,{examples:[Y2]});var V2=t.Pick(xd,["accountFriendlyName"]),g4e=d({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:Ya,method:"GET",response:t.Array(Va)}),y4e=d({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${Ya}/:id`,method:"GET",params:t.Object({id:p()}),response:Va}),h4e=d({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:Ya,method:"POST",body:BC,response:Va}),T4e=d({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${Ya}/:id`,method:"PUT",params:t.Object({id:p()}),body:V2,response:Va}),E4e=d({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:`${Ya}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var Qa="/v0/investigations",Q2=["dashboard","monitor","service","slo","log-route"],W2=t.Object({type:t.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:t.String({description:"Identifier of the linked asset"})}),Z2=t.Object({type:t.Enum(Q2,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),wr=t.Object({id:t.String({description:"Identifier of the investigation"}),name:t.String({description:"Human readable name shown for the investigation"}),slug:t.Optional(t.String({description:'Immutable identifier supplied by the creating agent, e.g. "incident-2024-06-payments-5xx". Set once at creation and matched against the agent telemetry to link back to the run that created the investigation.'})),contentMd:t.Optional(t.String({description:"Markdown content capturing the investigation notes and findings"})),tags:ke,owner:t.String({description:"Team ID owning the investigation"}),env:t.Optional(t.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:t.Array(W2,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:T({description:"Timestamp the investigation was created at."}),updatedAt:T({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),pp=t.Object({name:p({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:p({type:"kebab-case",allowEmpty:!1,description:'Immutable, unique identifier supplied by the creating agent, used to link the investigation back to the agent run, e.g. "incident-2024-06-payments-5xx". The agent should also emit this value in its telemetry.'}),contentMd:t.Optional(p({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Ve,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:t.Optional(p({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:t.Optional(t.Array(Z2,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Rd=t.Object(t.Omit(pp,["slug"]).properties),R4e=d({tags:["investigations"],url:Qa,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(wr)}),C4e=d({tags:["investigations"],url:`${Qa}/:id`,params:t.Object({id:p()}),method:"GET",response:wr}),P4e=d({tags:["investigations"],url:Qa,method:"POST",body:pp,response:wr}),U4e=d({tags:["investigations"],url:`${Qa}/:id`,method:"PUT",body:Rd,params:t.Object({id:p()}),response:wr}),w4e=d({tags:["investigations"],url:`${Qa}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var Wa=`/${"v1"}/investigations`,FC=d({description:"Retrieve all investigations",tags:["private"],url:Wa,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(wr)}),HC=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${Wa}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:wr}),KC=d({description:"Create a new investigation",tags:["private"],url:Wa,method:"POST",body:pp,response:wr}),zC=d({description:"Update an investigation by its id",tags:["private"],url:`${Wa}/:id`,method:"PUT",body:Rd,params:t.Object({id:p({allowEmpty:!1})}),response:wr}),YC=d({description:"Delete an investigation by its id",tags:["private"],url:`${Wa}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var Za=`/${"v1"}/monitors`,Xa=t.Pick(Rr,["id","name","message","tags","configuration","priority","owner","dashboardId","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)."}),QC={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,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",permissions:"all",clusterIds:[]},WC={name:"High CPU Utilization By Service",message:"More than half of grouped services are above the CPU threshold.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,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",permissions:"all",clusterIds:[]},ZC={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",permissions:"all",clusterIds:[]},XC={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",service:"api-gateway"}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},X2={id:"123-456-abc",...QC},J2={id:"234-567-bcd",...WC},eK={id:"345-678-cde",...ZC},tK={id:"456-789-def",...XC};Object.assign(Xa,{examples:[X2,J2,eK,tK]});var VC=t.Pick(ql,["filters","sort","limit","offset"]),JC=t.Object({...VC.properties,filters:VC.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),rK={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(JC,{examples:[rK]});var eP=d({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${Za}/query`,method:"POST",paginated:!0,body:JC,response:t.Array(Xa)}),tP=d({description:"Retrieves one monitor definition by ID when the authenticated operation key can read it. Use this before updating, duplicating, or auditing a monitor.",operationId:"getMonitor",tags:["monitors"],url:`${Za}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Xa}),rP=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],nP=t.Pick(Ra,rP,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),oP=t.Pick(Ra,rP,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link."}),iP=QC,aP=WC,sP=ZC,cP=XC;Object.assign(nP,{examples:[iP,aP,sP,cP]});Object.assign(oP,{examples:[iP,aP,sP,cP]});var pP=d({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, or new error patterns depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:Za,method:"POST",body:nP,response:Xa}),uP=d({description:"Updates an existing monitor definition by ID. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link, and public updates clear any existing snooze because `pauseUntil` is not part of the public schema.",operationId:"updateMonitor",tags:["monitors"],url:`${Za}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:oP,response:Xa}),nK=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),mP=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${Za}/:id`,method:"DELETE",params:nK,response:R});var Ja=`/${"v1"}/notification-rules`,es=t.Pick(Xo,["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)."}),lP={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},renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30},config:{type:"email",addresses:["oncall@example.com"]}}]},oK={id:"123-456-abc",...lP};Object.assign(es,{examples:[oK]});var dP=d({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:Ja,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(es)}),fP=d({description:"Retrieves one notification rule by ID when the authenticated operation key can read it. Use this before updating routing or target configuration.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ja}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:es}),Cd=t.Pick(Ua,["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."}),iK=lP;Object.assign(Cd,{examples:[iK]});var gP=d({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:Ja,method:"POST",body:Cd,response:es}),yP=d({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:`${Ja}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:Cd,response:es}),aK=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),hP=d({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:`${Ja}/:id`,method:"DELETE",params:aK,response:R});var di=`${Wo}/silences`,TP=t.Union([t.Literal("monday"),t.Literal("tuesday"),t.Literal("wednesday"),t.Literal("thursday"),t.Literal("friday"),t.Literal("saturday"),t.Literal("sunday")]),sK=t.Partial(t.Record(TP,t.Array(t.Object({startTime:t.String({format:Du,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({format:Du,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:"Weekly recurring schedule keyed by day of week. Omitted days have no silence window, and at least one day must be defined."})),cK=t.Partial(t.Record(TP,t.Array(t.Object({startTime:t.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.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:"Weekly recurring schedule keyed by day of week. Omitted days have no silence window."})),up='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',EP="One-time silence schedule with specific start and end times",IP="Recurring weekly silence schedule",pK=b("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({format:Gu,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.String({format:Gu,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:t.Optional(t.String({format:Mu,description:up}))},{$id:"InputSilenceScheduleOneTime",description:EP}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:sK,timeZone:t.Optional(t.String({format:Mu,description:up}))},{$id:"InputSilenceScheduleRecurring",description:IP})],{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."}),uK=b("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.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:t.Optional(t.String({description:up}))},{$id:"OutputSilenceScheduleOneTime",description:EP}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:cK,timeZone:t.Optional(t.String({description:up}))},{$id:"OutputSilenceScheduleRecurring",description:IP})],{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."}),mp=t.Object({name:p({description:"Display name of the silence"}),reason:p({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Ve,isActive:t.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:pK,notificationRuleIds:t.Optional(t.Array(p(),{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:t.Optional(p({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:Wl,prioritiesFilter:t.Array(t.Enum(dt),{maxItems:dt.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Vn),{maxItems:Vn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),fi=t.Object({id:t.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:t.String({description:"Display name of the silence"}),reason:t.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:t.String({description:"Team ID that owns and manages the silence"}),tags:ke,isActive:t.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:uK,notificationRuleIds:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Ql,prioritiesFilter:t.Array(t.Enum(dt),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Vn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:T(),updatedAt:T(),creator:t.Optional(ue),updater:t.Optional(ue)}),pYe=d({tags:["notification-silences"],url:di,method:"GET",response:t.Array(fi)}),uYe=d({tags:["notification-silences"],url:`${di}/:id`,params:t.Object({id:p()}),method:"GET",response:fi}),mYe=d({tags:["notification-silences"],url:di,method:"POST",body:mp,response:fi}),lYe=d({tags:["notification-silences"],url:`${di}/:id`,method:"PUT",params:t.Object({id:p()}),body:mp,response:fi}),dYe=d({tags:["notification-silences"],url:`${di}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),fYe=d({tags:["notification-silences"],url:`${di}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var ts=`/${"v1"}/notification-silences`,rs=t.Pick(fi,["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)."}),mK={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"]},lK={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(rs,{examples:[mK,lK]});var _P=d({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:ts,method:"GET",response:t.Array(rs)}),bP=d({description:"Retrieves one notification silence by ID when the authenticated operation key can read it. Use this before updating a mute schedule or filter.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${ts}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:rs}),Pd=t.Pick(mp,["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."}),dK={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"]},fK={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(Pd,{examples:[dK,fK]});var SP=d({description:"Creates a notification silence. Matching notifications that have not yet been sent are suppressed as soon as the schedule becomes active, including ones already queued when the silence is created; monitor evaluation itself is not paused, so alerts still transition and are visible in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:ts,method:"POST",body:Pd,response:rs}),OP=d({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:`${ts}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Pd,response:rs}),gK=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),AP=d({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:`${ts}/:id`,method:"DELETE",params:gK,response:R});var yK={critical:3,important:2,normal:1},ie=e=>({label:e,weight:yK[e]}),hK={"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:ie("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:ie("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:ie("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"service-name-present":{key:"service-name-present",title:`${Fc} present`,summary:`Logs and spans must populate ${Fc} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("critical"),recommendation:`Populate ${Fc} 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:ie("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:ie("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:`${xa} presence`,summary:`Logs and spans must populate ${xa} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("important"),recommendation:`Populate ${xa} 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:ie("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"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:ie("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:ie("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:ie("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:ie("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:ie("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:ie("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:ie("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 ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:ie("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"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:ie("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:ie("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:ie("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:ie("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows 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:ie("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:ie("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:ie("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:ie("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:ie("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 k8sattributes 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:ie("important"),recommendation:"Enable the OpenTelemetry Collector k8sclusterreceiver (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:ie("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:ie("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"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:ie("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:ie("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:ie("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 ${Ox} 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:ie("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"},"db-server-metrics-collected":{key:"db-server-metrics-collected",title:"Database server metrics collected",summary:"Every database technology seen in client spans should have its OpenTelemetry server-metrics receiver configured.",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:ie("important"),recommendation:"Configure the matching OpenTelemetry server-metrics receiver for each detected database technology (for example postgresqlreceiver, mysqlreceiver, mongodbreceiver, redisreceiver).",scope:"global"}},TK=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),EK=Ka.filter(e=>e.startsWith("azure_")&&!TK.has(e)),xP={"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:EK,metricPrefixes:["azure_"]}},IK=Object.fromEntries(Object.keys(xP).map(e=>{let{label:r,source:n}=xP[e];return[e,{key:e,title:`${r} metrics collected`,summary:`${r} 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:ie("important"),recommendation:`Enable the ${n} metrics integration so ${r} metrics are ingested.`,scope:"global"}]})),_K={...hK,...IK},RP=Object.values(_K);var CP=["passed","failed","ignored"],bK=t.Enum(CP,{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."}),SK=["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"],wd=["unrouted-logs","no-over-routed-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","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","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation","db-server-metrics-collected",...SK],OK=t.Enum(wd),AK=["log","metric","resource","span","api-key","dashboard","monitor","route"],xK=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],RK=["critical","important","normal"],CK=["team","global"],Nd=t.Object({key:t.Enum(wd),title:t.String(),summary:t.String(),rationale:t.String(),objectType:t.Enum(AK),category:t.Enum(xK),impact:t.Object({label:t.Enum(RK),weight:t.Number()}),recommendation:t.String(),scope:t.Optional(t.Enum(CK))}),PP=t.Object({type:t.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:t.String({description:"Human-readable summary of the example"}),link:t.Object({to:t.String({description:"In-app route the example deep-links to"}),search:t.Optional(t.Unknown({description:"Search-query payload for the deep link"})),params:t.Optional(t.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),Ud=t.Intersect([Nd,t.Object({status:bK,normalizedScore:t.Number(),details:t.Optional(t.Record(t.String(),t.Unknown())),recommendation:t.Optional(t.String()),examples:t.Optional(t.Array(PP))})]),PK=t.Object({generatedAt:t.String(),overallScore:t.Optional(t.Number()),rules:t.Array(Nd),teamResults:t.Array(t.Object({teamId:t.String(),teamName:t.String(),teamWeight:t.Number(),score:t.Number(),weightedScore:t.Number(),totalWeight:t.Number(),ruleResults:t.Array(Ud)})),globalResults:t.Optional(t.Object({score:t.Optional(t.Number()),ruleResults:t.Array(Ud)}))}),Ld=t.Object({id:t.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:t.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:t.Enum(wd,{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:t.Optional(t.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:t.Enum(CP,{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:t.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:t.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule\u2019s impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:t.Number({description:"Aggregate score for this row\u2019s 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:t.Number({description:"Sum of non-ignored rule weights for this row\u2019s report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:t.Optional(t.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:t.Optional(t.Array(PP,{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."})),createdAt:t.String({description:"ISO timestamp the row was generated at"})}),UYe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:PK}),vd=t.Optional(p({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."})),wYe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:t.Object({clusterId:vd,team:t.Optional(p({allowEmpty:!1}))}),response:t.Array(Ld,{description:"Latest persisted rule evaluation rows for the cluster"})}),NYe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:t.Object({ruleKey:OK,teamId:t.Optional(p({allowEmpty:!1})),lookbackMinutes:t.Optional(t.Integer({minimum:1,maximum:60})),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({rule:Nd,result:Ud,teamId:t.Optional(t.String()),teamName:t.Optional(t.String())})}),LYe=new Map(RP.map(e=>[e.key,e]));var UK=`/${"v1"}/quality-reports`,UP=t.Pick(Ld,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","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)."}),wK={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(UP,{examples:[wK]});var NK=t.Object({clusterId:vd,team:t.Optional(p({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."}))},{description:"Latest quality report lookup query."}),wP=d({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${UK}/latest`,method:"GET",query:NK,response:t.Array(UP)});var ns="/v0/admin-center";var ur=`${ns}/retention-policies`,NP=3650,LK=t.Integer({description:"Number of days Tsuga retains matching telemetry."}),LP=t.Integer({minimum:1,maximum:NP,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${NP}.`}),Nr=t.Object({id:t.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:t.Optional(t.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:t.Optional(t.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:t.Enum(ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:LK,isEnabled:t.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:T({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the retention policy."})}),lp=t.Object({env:t.Optional(p({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:t.Optional(p({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:t.Enum(ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:LP,isEnabled:t.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),vP=t.Array(t.Object({env:p(),dataSource:t.Enum(ir),durationDays:t.Union([LP,t.Null()]),isEnabled:t.Boolean()})),kP=t.Object({inserted:t.Array(Nr),updated:t.Array(Nr),deleted:t.Array(Nr)}),VYe=d({tags:["retention-policies"],url:ur,method:"POST",body:lp,response:Nr}),QYe=d({tags:["retention-policies"],url:ur,method:"GET",response:t.Array(Nr)}),WYe=d({tags:["retention-policies"],url:`${ur}/:id`,method:"GET",params:t.Object({id:p()}),response:Nr}),ZYe=d({tags:["retention-policies"],url:`${ur}/:id`,method:"PUT",params:t.Object({id:p()}),body:lp,response:Nr}),XYe=d({tags:["retention-policies"],url:`${ur}/bulk-update`,method:"POST",body:vP,response:kP}),JYe=d({tags:["retention-policies"],url:`${ur}/bulk-update-for-team`,method:"POST",body:t.Object({teamId:p(),policies:vP}),response:kP}),eVe=d({tags:["retention-policies"],url:`${ur}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),os=["past-24-hours","past-7-days","past-30-days"],tVe=d({tags:["retention-policies"],url:`${ur}/requested-history-percentile/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({percentile:t.Number({minimum:0,maximum:1}),observationWindow:t.Enum(os),dataSource:t.Enum(ir)}),response:t.Object({percentile:t.Number(),observationWindow:t.Enum(os),dataSource:t.Enum(ir),teamId:t.String(),requestedHistoryDays:t.Number()})}),vK=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var kK=t.Array(t.Object({bucket:t.Enum(vK),count:t.Number()})),rVe=d({tags:["retention-policies"],url:`${ur}/requested-history-histogram/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({observationWindow:t.Enum(os),dataSource:t.Enum(ir)}),response:t.Object({observationWindow:t.Enum(os),dataSource:t.Enum(ir),teamId:t.String(),histogram:kK})}),nVe=d({tags:["retention-policies"],url:`${ur}/top-teams-with-retention-surplus`,method:"POST",body:t.Object({dataSource:t.Enum(ir),observationWindow:t.Enum(os),percentile:t.Number({minimum:0,maximum:1}),topN:t.Optional(t.Number({minimum:1,maximum:20}))}),response:t.Array(t.Object({teamId:t.String(),retentionSurplusDays:t.Number()}))});var is=`/${"v1"}/retention-policies`,as=t.Pick(Nr,["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)."}),MK={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(as,{examples:[MK]});var MP=d({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:is,method:"GET",response:t.Array(as)}),DP=d({description:"Retrieves one retention policy by ID when the authenticated operation key can read it. Use this before updating duration or enabled state.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${is}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:as}),kd=t.Pick(lp,["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."}),DK={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(kd,{examples:[DK]});var GP=d({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:is,method:"POST",body:kd,response:as}),$P=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${is}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:kd,response:as}),jP=d({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:`${is}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:R});var qP=15,dp={id:t.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:t.Optional(t.String({description:"Optional user-provided processor note."})),tags:ke,updatedAt:t.Optional(T({description:"Timestamp when Tsuga last updated the processor."}))},fp={id:p({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:t.Optional(p({type:"long",description:"Optional processor note."})),tags:Ve,updatedAt:t.Optional(T({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},BP={...dp,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},FP={...fp,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},GK=b("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the computed value"}),formula:t.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:t.Optional(t.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:t.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:t.Optional(t.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})]),$K=b("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:p({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("math-formula"),replaceMissingBy0:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:qP,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category")},{$id:"InputProcessorParamsCreatorCategory"})]),jK=t.Object({...BP,params:GK}),qK=t.Object({...FP,params:$K}),HP={...dp,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},KP={...fp,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},BK=b("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})]),FK=b("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),HK=t.Object({...KP,params:FK}),KK=t.Object({...HP,params:BK}),zP={...dp,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},YP={...fp,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},VP=5,zK=b("subtype",[t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the URL to parse"}),subtype:t.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:t.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:t.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:t.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),YK=b("subtype",[t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:VP,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok")}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:t.Literal("url")}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent")}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:p({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:p({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:p({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),VK=t.Object({...zP,params:zK}),QK=t.Object({...YP,params:YK}),WK=t.Object({...FP,params:b("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:qP,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),ZK=t.Object({...KP,params:t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes")})}),XK=t.Object({...YP,params:t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:VP,description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),yVe=b("type",[ZK,XK,WK]),JK=t.Object({...BP,params:b("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause."}),value:t.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:t.Optional(t.String({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),ez=t.Object({...HP,params:t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes")})}),tz=t.Object({...zP,params:t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),hVe=b("type",[ez,tz,JK]),rz=11,QP=t.Cyclic({OutputProcessor:t.Union([KK,VK,jK,t.Object({...dp,params:t.Object({items:t.Array(t.Object({query:t.String({description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),WP=t.Cyclic({InputProcessor:t.Union([HK,QK,qK,t.Object({...fp,params:t.Object({items:t.Array(t.Object({query:p({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:rz,description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var nz="/v0/logs",ln=`${nz}/routes`,dn=t.Object({id:t.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:t.String({description:"Human-readable route name shown in Tsuga."}),description:t.Optional(t.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:t.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:t.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:t.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:ke,owner:t.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 the `query` field or delete the route."}),processors:t.Array(QP,{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:t.Optional(ue),updater:t.Optional(ue),updatedAt:T({description:"Timestamp when Tsuga last updated the route."}),createdAt:T({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:T({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"Route"}),ss=t.Object({name:p({allowEmpty:!1,description:"Human-readable route name shown in Tsuga."}),description:t.Optional(p({type:"long",description:"Optional free-text note about the route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:t.Boolean({description:"Set to true for the route to process newly ingested matching logs. Set to false to save it without running it."}),query:p({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),tags:Ve,owner:p({allowEmpty:!1,description:"ID of the team that will own the 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 the `query` field or delete the route."}),processors:t.Array(WP,{maxItems:50,description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var xVe=d({tags:["routes"],url:ln,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(dn)}),RVe=d({tags:["routes"],url:`${ln}/:id`,params:t.Object({id:p()}),method:"GET",response:dn}),CVe=d({tags:["routes"],url:ln,method:"POST",body:ss,response:dn}),PVe=d({tags:["routes"],url:`${ln}/:id`,method:"PUT",body:ss,params:t.Object({id:p()}),response:dn}),UVe=d({tags:["routes"],url:`${ln}/:id/clone`,method:"POST",params:t.Object({id:p()}),body:ss,response:dn}),wVe=d({tags:["routes"],url:`${ln}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),NVe=d({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:`${ln}/:id/modify-ranking`,method:"PUT",params:t.Object({id:p()}),body:t.Object({rank:t.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:t.Object({})}),LVe=d({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:`${ln}/:id/enable`,method:"PUT",params:t.Object({id:p()}),body:t.Object({enable:t.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:dn});var cs=`/${"v1"}/routes`,ZP={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}"]}}]},XP={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}}]},ps=t.Pick(dn,["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)."}),oz={id:"123-456-abc",...ZP},iz={id:"456-789-def",...XP};Object.assign(ps,{examples:[oz,iz]});var JP=d({description:"Lists log routes visible to the authenticated public API caller. Returned routes are ordered by evaluation order, with earlier routes evaluated first. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:cs,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(ps)}),eU=d({description:"Retrieves one log route by ID when the authenticated public API caller can read it. Use this before updating processors or route metadata.",operationId:"getRoute",tags:["routes"],url:`${cs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:ps}),Md=t.Pick(ss,["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."}),az=ZP,sz=XP;Object.assign(Md,{examples:[az,sz]});var tU=d({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:cs,method:"POST",body:Md,response:ps}),rU=d({description:"Updates an existing log route by ID without changing its evaluation order. Required fields and submitted processors are overwritten; omitted optional fields keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${cs}/:id`,method:"PUT",body:Md,params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:ps}),nU=d({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:`${cs}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:R});var us=`/${"v1"}/slos`,cz=t.Pick(Kl,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),ms=t.Object({...t.Pick(Qo,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:t.Array(cz,{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"}),pz={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(ms,{examples:[pz]});var oU=t.Pick(Yl,["filters","sort","limit","offset"]),iU=t.Object({...oU.properties,filters:oU.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),uz={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(iU,{examples:[uz]});var aU=d({description:"Queries SLOs visible to the authenticated public API caller. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${us}/query`,method:"POST",paginated:!0,body:iU,response:t.Array(ms)}),sU=d({description:"Retrieves one SLO definition by ID when the authenticated public API caller can read it. Use this before updating or auditing an SLO.",operationId:"getSlo",tags:["slos"],url:`${us}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:ms}),cU=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],pU=t.Pick(Wc,cU,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),uU=t.Pick(zl,cU,{$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."}),mU={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(pU,{examples:[mU]});Object.assign(uU,{examples:[mU]});var lU=d({description:"Creates an SLO owned by the specified team. The SLO can be event-based (good/total queries) or time-based (a thresholded query over evaluation slices) depending on its configuration.",operationId:"createSlo",tags:["slos"],url:us,method:"POST",body:pU,response:ms}),dU=d({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 evaluated SLO state, so returned status and error budget are based on data evaluated after the update.",operationId:"updateSlo",tags:["slos"],url:`${us}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:uU,response:ms}),fU=d({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${us}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:R});var eo=`${ns}/tag-policies`;var mz=["logs","metrics","traces"],Dd=t.Array(t.Enum(mz,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),lz=t.Union([_c,Dd]),dz=t.Object({teamIds:t.Array(t.String(),{description:"Team IDs used by this policy scope."}),mode:t.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."}),fz=b("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:Dd,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:_c},{title:"TsugaAssetTagPolicy"})]),gz=b("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:Dd,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:_c},{title:"TsugaAssetTagPolicy"})]),gU="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",yz=t.Unsafe({...fz,description:gU}),hz=t.Unsafe({...gz,description:gU}),gi=t.Object({id:t.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:t.String({description:"Human-readable tag policy name."}),description:t.Optional(t.String({description:"Optional user-provided policy description."})),isActive:t.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:t.String({description:"Tag key enforced by this policy."}),allowedTagValues:t.Array(t.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:t.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:t.Optional(dz),configuration:yz,creator:t.Optional(ue),updater:t.Optional(ue),owner:t.Optional(t.String({description:"Team ID that owns and manages the policy."})),createdAt:T({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var ls=t.Object({name:p({description:"Human-readable tag policy name."}),description:t.Optional(p({description:"Optional policy description."})),isActive:t.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:p({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:t.Array(p({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:t.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:t.Optional(t.Object({teamIds:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:t.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:hz,owner:p({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),r5e=d({tags:["tag-policies"],url:eo,method:"GET",query:t.Object({teamIds:t.Optional(t.Array(p(),{maxItems:100})),assetTypes:t.Optional(lz),searchQuery:t.Optional(p())}),response:t.Array(gi)}),n5e=d({tags:["tag-policies"],url:`${eo}/:id`,method:"GET",params:t.Object({id:p()}),response:gi}),o5e=d({tags:["tag-policies"],url:eo,method:"POST",body:ls,response:gi}),i5e=d({tags:["tag-policies"],url:`${eo}/:id`,method:"PUT",params:t.Object({id:p()}),body:ls,response:gi}),a5e=d({tags:["tag-policies"],url:`${eo}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),s5e=d({tags:["tag-policies"],url:`${ns}/applicable-tag-rules`,method:"GET",query:t.Object({assetType:t.Enum(ia),teamId:p()}),response:t.Array(t.Object({tagKey:t.String(),allowedTagValues:t.Array(t.String()),isRequired:t.Boolean(),tagPolicyId:t.String()}))}),yU=t.Object({total:t.Number(),totalNonCompliant:t.Number(),idsNonCompliant:t.Array(t.String())}),hU=t.Union([t.Literal("ingestion-api-key"),t.Literal("operation-api-key"),t.Literal("rum-public-token"),t.Literal("dashboard"),t.Literal("log-route"),t.Literal("metric-route"),t.Literal("monitor"),t.Literal("notification-rule"),t.Literal("notification-silence"),t.Literal("slo")]),Tz=t.Object({total:t.Number(),totalNonCompliant:t.Number(),byAssetType:t.Record(hU,yU)}),Ez=t.Omit(yU,["total"]),Iz=t.Object({totalNonCompliant:t.Number(),byAssetType:t.Record(hU,Ez)}),TU=t.Object({totals:Tz,byTeam:t.Record(t.String(),Iz)}),c5e=d({tags:["tag-policies"],url:`${eo}/:id/stats`,method:"GET",params:t.Object({id:p()}),response:TU}),p5e=d({tags:["tag-policies"],url:`${eo}/new-policy-stats`,method:"POST",body:ls,response:TU});var ds=`/${"v1"}/tag-policies`,EU={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"},IU={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"},_z={id:"123-456-abc",...EU},bz={id:"456-789-def",...IU},fs=t.Pick(gi,["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)."}),Sz=_z,Oz=bz;Object.assign(fs,{examples:[Sz,Oz]});var Gd=t.Pick(ls,["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."}),Az=EU,xz=IU;Object.assign(Gd,{examples:[Az,xz]});var _U=d({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:ds,method:"GET",response:t.Array(fs)}),bU=d({description:"Retrieves one tag policy by ID when the authenticated operation key can read it. Use this before updating policy scope or enforcement settings.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${ds}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:fs}),SU=d({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:ds,method:"POST",body:Gd,response:fs}),OU=d({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:`${ds}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:Gd,response:fs}),AU=d({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:`${ds}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:R});var gs=`/${"v1"}/teams`,ys=t.Pick(zo,["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)."}),Rz={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ys,{examples:[Rz]});var xU=d({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:gs,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(ys)}),RU=d({description:"Retrieves one team by ID when the authenticated operation key can read it. Use this to resolve ownership metadata before creating or updating team-owned resources.",operationId:"getTeam",tags:["teams"],url:`${gs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:ys}),$d=t.Pick(zc,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),Cz={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign($d,{examples:[Cz]});var CU=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:gs,method:"POST",body:$d,response:ys}),PU=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${gs}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:$d,response:ys}),UU=d({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:`${gs}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:R});function jd(e){let r=e.params;if(r?.properties){let n=Object.keys(r.properties);if(n.length===1&&n[0])return n[0]}return"id"}function wU(e,r,n){let o=e.command(r.commandName).description(r.description),i=xx(r.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${r.commandName}`);if(r.listOptions)for(let c of r.listOptions)a.option(c.flag,c.description);if(r.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async c=>{if(c.generateSkeleton){W(Ko(r.endpoints.list));return}let m=await n()(r.endpoints.list,{body:c.data?Do({data:c.data}):{}});W(m)}):a.action(async c=>{let m={};if(r.listOptions)for(let f of r.listOptions){let y=c[f.queryParam];y!==void 0&&(m[f.queryParam]=y)}let l=await n()(r.endpoints.list,Object.keys(m).length>0?{query:m}:void 0);W(l)}),r.endpoints.get){let c=r.endpoints.get,m=jd(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});W(f)})}if(r.endpoints.create){let c=r.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async m=>{if(m.generateSkeleton){W(Ko(c));return}let l=Do(m),f=await n()(c,{body:l});W(f)})}if(r.endpoints.update){let c=r.endpoints.update,m=jd(c);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,f)=>{if(f.generateSkeleton){W(Ko(c));return}let y=Do(f),E=await n()(c,{params:{[m]:l},body:y});W(E)})}if(r.endpoints.delete){let c=r.endpoints.delete,m=jd(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});W(f)})}}var Pz=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:qC},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:IC,get:_C,create:bC,update:SC,delete:OC},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:wC,create:NC,update:LC,delete:vC}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:FC,get:HC,create:KC,update:zC,delete:YC}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:eP,get:tP,create:pP,update:uP,delete:mP},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:dP,get:fP,create:gP,update:yP,delete:hP}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:_P,get:bP,create:SP,update:OP,delete:AP}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster (pass --cluster <id> when the org has more than one cluster)",endpoints:{list:wP},listOptions:[{flag:"--team <name>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:MP,get:DP,create:GP,update:$P,delete:jP}},{commandName:"routes",description:"Manage routes",endpoints:{list:JP,get:eU,create:tU,update:rU,delete:nU}},{commandName:"services",description:"Manage services",endpoints:{list:gR,get:yR}},{commandName:"slos",description:"Manage SLOs",endpoints:{list:aU,get:sU,create:lU,update:dU,delete:fU},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:_U,get:bU,create:SU,update:OU,delete:AU}},{commandName:"teams",description:"Manage teams",endpoints:{list:xU,get:RU,create:CU,update:PU,delete:UU}}];function NU(e,r){for(let n of Pz)wU(e,n,r)}var LU=require("node:child_process");var gp="@tsuga/cli@latest";function Uz(){B(`Updating ${gp}`),B(` $ npm install -g ${gp}`);try{(0,LU.execFileSync)("npm",["install","-g",gp],{stdio:["ignore","inherit","inherit"]})}catch(e){let r=e.status??1;throw new Error(`npm install -g ${gp} exited ${r}`,{cause:e})}B("Updated. Run `tsuga --version` to confirm the new version.")}function vU(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{Uz()})}var Yd=require("node:fs"),zd=require("node:os"),hi=require("node:path");function wz(e,r){let n=e.slice(0,r).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function Nz(e,r,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(r+1)|0)+1;for(let c=r-1;c<=r+1;c++){let m=o[c-1];m&&(i+=c.toString().padEnd(a," "),i+=": ",i+=m,i+=`
|
|
131
|
+
`,c===r&&(i+=" ".repeat(a+n+2),i+=`^
|
|
132
|
+
`))}return i}var z=class extends Error{line;column;codeblock;constructor(r,n){let[o,i]=wz(n.toml,n.ptr),a=Nz(n.toml,o,i);super(`Invalid TOML document: ${r}
|
|
133
133
|
|
|
134
|
-
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function
|
|
135
|
-
`,
|
|
134
|
+
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function Lz(e,r){let n=0;for(;e[r-++n]==="\\";);return--n&&n%2}function yp(e,r=0,n=e.length){let o=e.indexOf(`
|
|
135
|
+
`,r);return e[o-1]==="\r"&&o--,o<=n?o:-1}function yi(e,r){for(let n=r;n<e.length;n++){let o=e[n];if(o===`
|
|
136
136
|
`)return n;if(o==="\r"&&e[n+1]===`
|
|
137
|
-
`)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new z("control characters are not allowed in comments",{toml:e,ptr:
|
|
138
|
-
`||i==="\r"&&e[
|
|
139
|
-
`);)
|
|
137
|
+
`)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new z("control characters are not allowed in comments",{toml:e,ptr:r})}return e.length}function Lt(e,r,n,o){let i;for(;;){for(;(i=e[r])===" "||i===" "||!n&&(i===`
|
|
138
|
+
`||i==="\r"&&e[r+1]===`
|
|
139
|
+
`);)r++;if(o||i!=="#")break;r=yi(e,r)}return r}function kU(e,r,n,o,i=!1){if(!o)return r=yp(e,r),r<0?e.length:r;for(let a=r;a<e.length;a++){let c=e[a];if(c==="#")a=yp(e,a);else{if(c===n)return a+1;if(c===o||i&&(c===`
|
|
140
140
|
`||c==="\r"&&e[a+1]===`
|
|
141
|
-
`))return a}}throw new z("cannot find end of structure",{toml:e,ptr:
|
|
142
|
-
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function
|
|
143
|
-
`&&
|
|
144
|
-
`||f==="\r"&&e[
|
|
145
|
-
`){if(!i)throw new z("newlines are not allowed in strings",{toml:e,ptr:
|
|
146
|
-
`||f===" "||f===" "||f==="\r")){if(
|
|
147
|
-
`&&e[
|
|
148
|
-
`&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[l,c]}c=
|
|
149
|
-
`&&c!=="\r"){let
|
|
150
|
-
`&&a!=="\r"){let c=
|
|
151
|
-
`&&e[
|
|
152
|
-
`}[[${
|
|
153
|
-
`,i+=
|
|
154
|
-
`)+
|
|
155
|
-
`)+
|
|
141
|
+
`))return a}}throw new z("cannot find end of structure",{toml:e,ptr:r})}function hp(e,r){let n=e[r],o=n===e[r+1]&&e[r+1]===e[r+2]?e.slice(r,r+3):n;r+=o.length-1;do r=e.indexOf(o,++r);while(r>-1&&n!=="'"&&Lz(e,r));return r>-1&&(r+=o.length,o.length>1&&(e[r]===n&&r++,e[r]===n&&r++)),r}var vz=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,hs=class e extends Date{#t=!1;#r=!1;#e=null;constructor(r){let n=!0,o=!0,i="Z";if(typeof r=="string"){let a=r.match(vz);a?(a[1]||(n=!1,r=`0000-01-01T${r}`),o=!!a[2],o&&r[10]===" "&&(r=r.replace(" ","T")),a[2]&&+a[2]>23?r="":(i=a[3]||null,r=r.toUpperCase(),!i&&o&&(r+="Z"))):r=""}super(r),isNaN(this.getTime())||(this.#t=n,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let r=super.toISOString();if(this.isDate())return r.slice(0,10);if(this.isTime())return r.slice(11,23);if(this.#e===null)return r.slice(0,-1);if(this.#e==="Z")return r;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(r,n="Z"){let o=new e(r);return o.#e=n,o}static wrapAsLocalDateTime(r){let n=new e(r);return n.#e=null,n}static wrapAsLocalDate(r){let n=new e(r);return n.#r=!1,n.#e=null,n}static wrapAsLocalTime(r){let n=new e(r);return n.#t=!1,n.#e=null,n}};var kz=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Mz=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Dz=/^[+-]?0[0-9_]/,Gz=/^[0-9a-f]{2,8}$/i,MU={b:"\b",t:" ",n:`
|
|
142
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Tp(e,r=0,n=e.length){let o=e[r]==="'",i=e[r++]===e[r]&&e[r]===e[r+1];i&&(n-=2,e[r+=2]==="\r"&&r++,e[r]===`
|
|
143
|
+
`&&r++);let a=0,c,m="",l=r;for(;r<n-1;){let f=e[r++];if(f===`
|
|
144
|
+
`||f==="\r"&&e[r]===`
|
|
145
|
+
`){if(!i)throw new z("newlines are not allowed in strings",{toml:e,ptr:r-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new z("control characters are not allowed in strings",{toml:e,ptr:r-1});if(c){if(c=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(r,r+=f==="x"?2:f==="u"?4:8);if(!Gz.test(y))throw new z("invalid unicode escape",{toml:e,ptr:a});try{m+=String.fromCodePoint(parseInt(y,16))}catch{throw new z("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
|
|
146
|
+
`||f===" "||f===" "||f==="\r")){if(r=Lt(e,r-1,!0),e[r]!==`
|
|
147
|
+
`&&e[r]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});r=Lt(e,r)}else if(f in MU)m+=MU[f];else throw new z("unrecognized escape sequence",{toml:e,ptr:a});l=r}else!o&&f==="\\"&&(a=r-1,c=!0,m+=e.slice(l,a))}return m+e.slice(l,n-1)}function DU(e,r,n,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=kz.test(e);if(i||Mz.test(e)){if(Dz.test(e))throw new z("leading zeroes are not allowed",{toml:r,ptr:n});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new z("invalid number",{toml:r,ptr:n});if(i){if((i=!Number.isSafeInteger(c))&&!o)throw new z("integer value cannot be represented losslessly",{toml:r,ptr:n});(i||o===!0)&&(c=BigInt(e))}return c}let a=new hs(e);if(!a.isValid())throw new z("invalid value",{toml:r,ptr:n});return a}function $z(e,r,n){let o=e.slice(r,n),i=o.indexOf("#");return i>-1&&(yi(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function Ts(e,r,n,o,i){if(o===0)throw new z("document contains excessively nested structures. aborting.",{toml:e,ptr:r});let a=e[r];if(a==="["||a==="{"){let[l,f]=a==="["?$U(e,r,o,i):GU(e,r,o,i);if(n){if(f=Lt(e,f),e[f]===",")f++;else if(e[f]!==n)throw new z("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let c;if(a==='"'||a==="'"){c=hp(e,r);let l=Tp(e,r,c);if(n){if(c=Lt(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
|
|
148
|
+
`&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[l,c]}c=kU(e,r,",",n);let m=$z(e,r,c-+(e[c-1]===","));if(!m[0])throw new z("incomplete key-value declaration: no value specified",{toml:e,ptr:r});return n&&m[1]>-1&&(c=Lt(e,r+m[1]),c+=+(e[c]===",")),[DU(m[0],e,r,i),c]}var jz=/^[a-zA-Z0-9-_]+[ \t]*$/;function Ep(e,r,n="="){let o=r-1,i=[],a=e.indexOf(n,r);if(a<0)throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:r});do{let c=e[r=++o];if(c!==" "&&c!==" ")if(c==='"'||c==="'"){if(c===e[r+1]&&c===e[r+2])throw new z("multiline strings are not allowed in keys",{toml:e,ptr:r});let m=hp(e,r);if(m<0)throw new z("unfinished string encountered",{toml:e,ptr:r});o=e.indexOf(".",m);let l=e.slice(m,o<0||o>a?a:o),f=yp(l);if(f>-1)throw new z("newlines are not allowed in keys",{toml:e,ptr:r+o+f});if(l.trimStart())throw new z("found extra tokens after the string part",{toml:e,ptr:m});if(a<m&&(a=e.indexOf(n,m),a<0))throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:r});i.push(Tp(e,r,m))}else{o=e.indexOf(".",r);let m=e.slice(r,o<0||o>a?a:o);if(!jz.test(m))throw new z("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:r});i.push(m.trimEnd())}}while(o+1&&o<a);return[i,Lt(e,a+1,!0,!0)]}function GU(e,r,n,o){let i={},a=new Set,c;for(r++;(c=e[r++])!=="}"&&c;){if(c===",")throw new z("expected value, found comma",{toml:e,ptr:r-1});if(c==="#")r=yi(e,r);else if(c!==" "&&c!==" "&&c!==`
|
|
149
|
+
`&&c!=="\r"){let m,l=i,f=!1,[y,E]=Ep(e,r-1);for(let Ue=0;Ue<y.length;Ue++){if(Ue&&(l=f?l[m]:l[m]={}),m=y[Ue],(f=Object.hasOwn(l,m))&&(typeof l[m]!="object"||a.has(l[m])))throw new z("trying to redefine an already defined value",{toml:e,ptr:r});!f&&m==="__proto__"&&Object.defineProperty(l,m,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new z("trying to redefine an already defined value",{toml:e,ptr:r});let[A,ye]=Ts(e,E,"}",n-1,o);a.add(A),l[m]=A,r=ye}}if(!c)throw new z("unfinished table encountered",{toml:e,ptr:r});return[i,r]}function $U(e,r,n,o){let i=[],a;for(r++;(a=e[r++])!=="]"&&a;){if(a===",")throw new z("expected value, found comma",{toml:e,ptr:r-1});if(a==="#")r=yi(e,r);else if(a!==" "&&a!==" "&&a!==`
|
|
150
|
+
`&&a!=="\r"){let c=Ts(e,r-1,"]",n-1,o);i.push(c[0]),r=c[1]}}if(!a)throw new z("unfinished array encountered",{toml:e,ptr:r});return[i,r]}function jU(e,r,n,o){let i=r,a=n,c,m=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=m?i[c]:i[c]={},a=(l=a[c]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(c=e[f],(m=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;m||(c==="__proto__"&&(Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,c,{enumerable:!0,configurable:!0,writable:!0})),a[c]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(l=a[c],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[c]=[]),i[c].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=m?i[c]:i[c]={};else if(o===0&&m)return null;return[c,i,l.c]}function qd(e,{maxDepth:r=1e3,integersAsBigInt:n}={}){let o={},i={},a=o,c=i;for(let m=Lt(e,0);m<e.length;){if(e[m]==="["){let l=e[++m]==="[",f=Ep(e,m+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new z("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=jU(f[0],o,i,l?2:1);if(!y)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:m});c=y[2],a=y[1],m=f[1]}else{let l=Ep(e,m),f=jU(l[0],a,c,0);if(!f)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:m});let y=Ts(e,l[1],void 0,r,n);f[1][f[0]]=y[0],m=y[1]}if(m=Lt(e,m,!0),e[m]&&e[m]!==`
|
|
151
|
+
`&&e[m]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:m});m=Lt(e,m)}return o}var qU=/^[a-z0-9-_]+$/i;function Es(e){let r=typeof e;if(r==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return r}function qz(e){for(let r=0;r<e.length;r++)if(Es(e[r])!=="object")return!1;return e.length!=0}function Bd(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function Fd(e,r,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(r==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(r==="bigint"||r==="boolean")return e.toString();if(r==="string")return Bd(e);if(r==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(r==="object")return Bz(e,n,o);if(r==="array")return Fz(e,n,o)}function Bz(e,r,n){let o=Object.keys(e);if(o.length===0)return"{}";let i="{ ";for(let a=0;a<o.length;a++){let c=o[a];a&&(i+=", "),i+=qU.test(c)?c:Bd(c),i+=" = ",i+=Fd(e[c],Es(e[c]),r-1,n)}return i+" }"}function Fz(e,r,n){if(e.length===0)return"[]";let o="[ ";for(let i=0;i<e.length;i++){if(i&&(o+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");o+=Fd(e[i],Es(e[i]),r-1,n)}return o+" ]"}function Hz(e,r,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let a=0;a<e.length;a++)i+=`${i&&`
|
|
152
|
+
`}[[${r}]]
|
|
153
|
+
`,i+=Hd(0,e[a],r,n,o);return i}function Hd(e,r,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",m=Object.keys(r);for(let l=0;l<m.length;l++){let f=m[l];if(r[f]!==null&&r[f]!==void 0){let y=Es(r[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let E=qU.test(f)?f:Bd(f);if(y==="array"&&qz(r[f]))c+=(c&&`
|
|
154
|
+
`)+Hz(r[f],n?`${n}.${E}`:E,o-1,i);else if(y==="object"){let A=n?`${n}.${E}`:E;c+=(c&&`
|
|
155
|
+
`)+Hd(A,r[f],A,o-1,i)}else a+=E,a+=" = ",a+=Fd(r[f],y,o,i),a+=`
|
|
156
156
|
`}}return e&&(a||!c)&&(a=a?`[${e}]
|
|
157
157
|
${a}`:`[${e}]`),a&&c?`${a}
|
|
158
|
-
${c}`:a||c}function
|
|
158
|
+
${c}`:a||c}function Kd(e,{maxDepth:r=1e3,numbersAsFloat:n=!1}={}){if(Es(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=Hd(0,e,"",r,n);return o[o.length-1]!==`
|
|
159
159
|
`?o+`
|
|
160
|
-
`:o}var
|
|
161
|
-
`),q(f===void 0?" created":` patched (backup: ${f})`)}function iB(e,t,n){return{environment:"dev",log_user_prompt:n,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}`}}}}}function aB(e,t,n,o){let i=(0,Zo.join)(e,".codex"),a=(0,Zo.join)(i,"config.toml");q(`Codex \u2192 ${a}`),(0,Pl.mkdirSync)(i,{recursive:!0});let c=ma(a),u=c===void 0?{}:Ol(c),l="otel"in u;delete u.otel,u.otel=iB(t,n,o);let f=ua(a,c);pa(a,Rl(u)),q(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function WR(){return new np("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function ZR(){return new np("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var XR="Restart your claude / codex session to load the new config.";function JR(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(WR()).addOption(ZR()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{oB((0,Cl.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),q(XR)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(WR()).addOption(ZR()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{aB((0,Cl.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),q(XR)})}var Mc="/v0/logs";var Ha=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var sB=0,cB=r.Object({__tsuga_metadata__:r.Object({id:r.String(),source:r.Optional(r.String())},{additionalProperties:!0}),context:r.Optional(r.Object({team:r.Optional(r.String()),tag_policy_warnings:r.Optional(r.Record(r.String(),r.String()))},{additionalProperties:!0})),message:r.Optional(r.Unknown()),timestamp:r.Number(),level:r.Enum(Ha)},{additionalProperties:!0});var pB="log_timestamp",mB=r.Union([r.Literal(pB)]),Hn=r.Partial(r.Object({..._t.properties,query:m({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:r.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:r.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:r.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:r.Number({minimum:sB,description:"Result offset used when fetching additional log rows."}),clusterId:m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:mB,sortDirection:r.Union([r.Literal("asc"),r.Literal("desc")],{description:"Timestamp sort direction for log results."})})),kze=d({tags:["logs"],url:`${Mc}/count`,method:"GET",query:r.Pick(Hn,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),Ul=r.Object({value:r.String(),priority:r.Number()}),wze=d({tags:["logs"],url:`${Mc}/search`,method:"GET",query:Hn,response:r.Object({logs:r.Optional(r.Array(cB)),attributesToHighlight:r.Optional(r.Array(Ul))},{additionalProperties:!0})}),uB=r.Cyclic({TokenOutput:r.Union([r.Object({type:r.Literal("top"),values:r.Array(r.String())}),r.Object({type:r.Literal("ip"),value:r.String()}),r.Object({type:r.Literal("range"),min:r.Number(),max:r.Number()}),r.Object({type:r.Literal("variable"),value:r.String()}),r.Object({type:r.Literal("text"),value:r.String()}),r.Object({type:r.Literal("date"),value:r.String()}),r.Object({type:r.Literal("url"),value:r.String()}),r.Object({type:r.Literal("structure"),key:r.Array(r.String()),value:r.Array(r.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),lB=r.Object({id:r.String(),pattern:r.Array(uB),size:r.Integer({description:"Number of logs that matched the pattern"}),examples:r.Array(r.Object({id:r.String(),timestampUnix:r.Number()})),timeDistribution:r.Array(r.Number()),staticFeatures:r.Array(r.Object({key:r.String(),value:r.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),Lze=d({tags:["logs"],url:`${Mc}/patterns`,method:"GET",query:r.Object({..._t.properties,query:m({type:"tsuga-query"}),clusteringThreshold:r.Optional(r.Number()),clusterId:r.Optional(m({allowEmpty:!1}))}),response:r.Object({patterns:r.Array(lB),sampleSize:r.Number()})}),Mze=d({tags:["logs"],url:`${Mc}/attributes`,method:"GET",query:r.Object({..._t.properties,clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({attributes:r.Array(r.String())})});var Ka=`/${"v1"}/logs`,Nl=r.Object({context:r.Optional(r.Object({team:r.Optional(r.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext"})),message:r.Optional(r.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:r.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:r.Enum(Ha,{description:"Normalized Tsuga log level."})},{additionalProperties:!0,$id:"LogEvent"}),dB={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Nl,{examples:[dB]});var fB={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},eC=r.Object({...r.Pick(Hn,["query","maxResults"]).properties,clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."})),...bt.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(eC,{examples:[fB]});var tC=d({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${Ka}/search`,method:"GET",query:eC,response:r.Object({logs:r.Array(Nl,{description:"Log events matching the query and time range."})})}),gB=r.Object({pattern:r.String({description:"Clustered log pattern formatted as a readable string."}),size:r.Integer({description:"Number of logs that matched the pattern"}),groups:r.Array(r.Object({key:r.String(),value:r.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),rC=r.Object({patterns:r.Array(gB,{description:"Log patterns clustered from logs matching the query."}),sampleSize:r.Number({description:"Number of logs sampled while computing patterns."})}),yB={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(rC,{examples:[yB]});var nC=d({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${Ka}/patterns`,method:"GET",query:r.Object({...bt.properties,query:m({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:rC}),hB=r.Object({exampleLog:r.Optional(Nl),team:r.String({description:"Team associated with the new error pattern."}),env:r.String({description:"Environment associated with the new error pattern."}),service:r.String({description:"Service associated with the new error pattern."}),firstSeen:r.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:r.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),oC=r.Object({newErrorPatterns:r.Array(hB,{description:"Error patterns first seen in the requested time range."})}),EB={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(oC,{examples:[EB]});var iC=d({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${Ka}/patterns/new`,method:"GET",query:r.Object({...bt.properties,team:r.Optional(m({description:"Team name to restrict pattern detection to."})),env:r.Optional(m({description:"Environment to restrict pattern detection to."})),service:r.Optional(m({description:"Service name to restrict pattern detection to."})),clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:oC}),TB=r.Object({team:r.String({description:"Team associated with the error pattern."}),env:r.String({description:"Environment associated with the error pattern."}),pattern:r.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:r.Array(r.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),aC=r.Object({errorPatternIncreases:r.Array(TB,{description:"Error patterns with increased occurrence in the requested time range."})}),IB={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(aC,{examples:[IB]});var sC=d({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${Ka}/patterns/increase`,method:"GET",query:r.Object({...bt.properties,team:m({description:"Team name to analyze for pattern increases."}),env:r.Optional(m({description:"Environment to restrict the analysis to."})),clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:aC}),cC=r.Object({attributes:r.Array(r.String(),{description:"Log attribute dot-paths observed in the time range"})}),_B={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(cC,{examples:[_B]});var bB=r.Object({...bt.properties,clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),pC=d({description:"Lists log attribute dot-paths observed in the requested time range. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${Ka}/attributes`,method:"GET",query:bB,response:cC});var Or="/v0/metrics",OB=r.Object({__tsuga_metadata__:r.Object({},{additionalProperties:!0}),context:r.Optional(r.Object({},{additionalProperties:!0})),message:r.Optional(r.String()),timestamp:r.Number(),level:r.Enum(Ha)},{additionalProperties:!0}),Qze=d({tags:["metrics"],url:`${Or}/count`,method:"GET",query:r.Pick(Hn,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),Wze=d({tags:["metrics"],url:`${Or}/search`,method:"GET",query:Hn,response:r.Object({logs:r.Optional(r.Array(OB)),totalHits:r.Optional(r.Number()),attributesToHighlight:r.Optional(r.Array(Ul))},{additionalProperties:!0})}),vc=r.Enum(["counter","gauge","histogram","summary"],{description:"Metric instrument type: counter, gauge, histogram, or summary."}),kl=r.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."}),AB=r.Object({capabilities:r.Optional(r.Array(r.String())),description:r.Optional(r.String()),tags:r.Optional(r.Array(r.String())),temporality:r.Optional(kl),type:r.Optional(vc),unit:r.Optional(r.String())}),Zze=d({url:`${Or}/metadata`,method:"GET",query:r.Object({..._t.properties,metricName:m({allowEmpty:!1}),clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:AB}),Xze=d({tags:["metrics"],url:Or,method:"GET",query:r.Object({..._t.properties,clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Array(r.String())}),wl=r.Array(r.Object({name:r.String({description:"Metric name observed by Tsuga."}),type:vc}),{description:"List of metric names and their types"}),Jze=d({tags:["metrics"],url:`${Or}/names-and-types`,method:"GET",query:r.Object({..._t.properties,clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:wl}),Dc=r.Array(r.String(),{description:"List of attribute names"}),e9e=d({tags:["metrics"],url:`${Or}/attributes`,method:"GET",query:r.Object({..._t.properties,metricName:m({allowEmpty:!1}),clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Dc}),t9e=d({tags:["metrics"],url:`${Or}/attributes/batch`,method:"GET",query:r.Object({..._t.properties,metricNames:r.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:r.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Dc}),Ll=r.Object({assets:r.Array(r.Object({type:r.Enum(["dashboard","monitor"]),id:r.String(),name:r.String(),owner:r.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),r9e=d({tags:["metrics"],url:`${Or}/assets-usage`,method:"GET",query:r.Object({metricName:m({allowEmpty:!1})}),response:Ll}),n9e=d({url:`${Or}/per-attribute`,method:"GET",query:r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number()),attribute:m(),clusterId:r.Optional(m({allowEmpty:!1}))}),response:r.Array(r.String())});var Ml=`/${"v1"}/metrics`,SB=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(wl,{examples:[SB]});var vl=r.Object({name:r.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:vc,description:r.Optional(r.String({description:"Human-readable description of the metric"})),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:r.Optional(kl),capabilities:r.Optional(r.Array(r.String(),{description:"Supported metric capabilities for query and visualization. An empty array means all capabilities are supported."})),attributes:r.Optional(r.Array(r.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),xB={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"]};Object.assign(vl,{examples:[xB]});var mC=r.Object({...bt.properties,clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),uC=d({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:Ml,method:"GET",query:mC,response:r.Array(vl)}),lC=d({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${Ml}/:name`,method:"GET",params:r.Object({name:m({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:mC,response:vl}),RB=["service","env","host","method","status_code"];Object.assign(Dc,{examples:[RB]});var dC=r.Pick(Ll,["assets"]),CB={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(dC,{examples:[CB]});var fC=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Ml}/assets-usage`,method:"GET",query:r.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:dC});var PB=`/${"v1"}/traces`,gC=r.Object({context:r.Optional(r.Object({service:r.Optional(r.Object({name:r.Optional(r.String({description:"Service name associated with the span."})),version:r.Optional(r.String({description:"Service version associated with the span."}))},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:r.Optional(r.String({description:"Parent span ID when this span has a parent in the trace."})),resourceAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes associated with the span."}),spanAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes."}),duration:r.Number({description:"In milliseconds."}),startTime:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:r.Optional(r.Object({message:r.String({description:"Error message associated with the span."})})),events:r.Optional(r.Array(r.Object({event_attributes:r.Object({},{additionalProperties:!0,description:"Attributes attached to the span event."}),event_name:r.String({description:"Name of the span event."}),event_timestamp_nanos:r.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})}),{description:"Events recorded on the span."})),spanId:r.String({description:"Unique span ID within the trace."}),span:r.Object({kind:r.String({description:"OpenTelemetry span kind."}),name:r.String({description:"Operation name recorded on the span."})}),statusCode:r.Optional(r.String({description:"OpenTelemetry span status code."})),traceId:r.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent"}),UB={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{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,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(gC,{examples:[UB]});var NB={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},yC=r.Object({...bt.properties,query:r.Optional(m({type:"tsuga-query",description:"Tsuga query selecting spans to return. Omit to search all spans in the range."})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e4,description:"Maximum number of spans to return. Valid values are 1 through 10000."})),clusterId:r.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(yC,{examples:[NB]});var hC=d({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${PB}/search`,method:"GET",query:yC,response:r.Object({spans:r.Array(gC,{description:"Spans matching the query and time range."})})});var IC=["timestamp","level","message"],_C=["count","ratio","team","level","pattern"];function St(e,t){let n=t??ur(e);if(!n)throw new Error(`--${e} is required`);return Xa(n)}function EC(e){let t={from:St("from",e.from),to:St("to",e.to)},n=e.query??ur("query");n!==void 0&&(t.query=n);let o=e.maxResults??ur("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function $e(e){let t=ur(e);return t===void 0?"":` (default: ${t})`}function kB(e){let t=cp(e.output),n=e.fields===void 0?void 0:pp(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??IC}}function wB(e){let t=cp(e.output),n=e.fields===void 0?void 0:pp(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??_C}}function TC(e,t){let n={count:e.size,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?n.team=i:n[o]=i;return n}function LB(e,t){if(t.format==="json"){if(t.fields===void 0){oe(e);return}let{fields:i}=t;oe({patterns:e.patterns.map(a=>TC(a,e.sampleSize)).map(a=>mp(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>TC(i,e.sampleSize)),o=up(t.format,n,t.fields);o.length>0&&q(o)}function MB(e,t){if(t.format==="json"){if(t.fields===void 0){oe(e);return}let{fields:o}=t;oe({logs:e.logs.map(i=>mp(i,o))});return}let n=up(t.format,e.logs,t.fields);n.length>0&&q(n)}function bC(e,t){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).option("--query <query>",`Search query${$e("query")}`).option("--max-results <n>",`Maximum number of results${$e("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${IC.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let u=kB(c),l=await t()(tC,{query:EC(c)});MB(l,u)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).action(async c=>{let u=await t()(pC,{query:{from:St("from",c.from),to:St("to",c.to)}});oe(u)}),n.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).option("--query <query>",`Search query${$e("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${_C.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let u=wB(c),l={from:St("from",c.from),to:St("to",c.to)},f=c.query??ur("query");f!==void 0&&(l.query=f);let y=await t()(nC,{query:l});LB(y,u)}),n.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async c=>{let u={from:St("from",c.from),to:St("to",c.to)};c.team!==void 0&&(u.team=c.team),c.env!==void 0&&(u.env=c.env),c.service!==void 0&&(u.service=c.service);let l=await t()(iC,{query:u});oe(l)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let u={from:St("from",c.from),to:St("to",c.to),team:c.team};c.env!==void 0&&(u.env=c.env);let l=await t()(sC,{query:u});oe(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).action(async c=>{let u=await t()(uC,{query:{from:St("from",c.from),to:St("to",c.to)}});oe(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).action(async(c,u)=>{let l=await t()(lC,{params:{name:c},query:{from:St("from",u.from),to:St("to",u.to)}});oe(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let u=await t()(fC,{query:{metricName:c}});oe(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${$e("from")}`).option("--to <timestamp>",`End of time range${$e("to")}`).option("--query <query>",`Search query${$e("query")}`).option("--max-results <n>",`Maximum number of results${$e("max-results")}`).action(async c=>{let u=await t()(hC,{query:EC(c)});oe(u)});let a=e.command("aggregation").description("Run aggregation queries");na(a,"scalar","Run aggregation queries and return scalar results",z_,t),na(a,"timeseries","Run aggregation queries and return timeseries results",V_,t)}var vB="x-tsuga-session-id",Dl="x-tsuga-source",$l="x-tsuga-source-version",Gl="x-tsuga-source-commit",jl="x-tsuga-source-date",ql="x-tsuga-rationale",DB="x-request-id",R9e={[vB]:"Session identifier for request correlation",[Dl]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[$l]:"SDK version",[Gl]:"SDK commit hash",[jl]:"SDK commit date",[ql]:"Optional caller-supplied rationale for this request, recorded for telemetry",[DB]:"Unique identifier for this API request, useful for debugging and support"};var tn=class e extends Error{constructor(n,o,i,a){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o)}};function OC(e){if(e instanceof tn){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
|
|
162
|
-
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function
|
|
160
|
+
`:o}var Kz={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"};function zz(e,r,n,o){let i=(0,hi.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${i}`),(0,Yd.mkdirSync)((0,hi.dirname)(i),{recursive:!0});let a=va(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!Zn(c))throw new Error(`${i} must contain a JSON object at the top level.`);let m=c.env??{};if(!Zn(m))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";c.env={...m,...Kz,OTEL_EXPORTER_OTLP_ENDPOINT:r,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${n}`};let f=ka(i,a);La(i,`${JSON.stringify(c,null,2)}
|
|
161
|
+
`),B(f===void 0?" created":` patched (backup: ${f})`)}function Yz(e,r,n){return{environment:"dev",log_user_prompt:n,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}}}}function Vz(e,r,n,o){let i=(0,hi.join)(e,".codex"),a=(0,hi.join)(i,"config.toml");B(`Codex \u2192 ${a}`),(0,Yd.mkdirSync)(i,{recursive:!0});let c=va(a),m=c===void 0?{}:qd(c),l="otel"in m;delete m.otel,m.otel=Yz(r,n,o);let f=ka(a,c);La(a,Kd(m)),B(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function BU(){return new Bp("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function FU(){return new Bp("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var HU="Restart your claude / codex session to load the new config.";function KU(e){let r=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");r.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(BU()).addOption(FU()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{zz((0,zd.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(HU)}),r.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(BU()).addOption(FU()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{Vz((0,zd.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(HU)})}var Ip="/v0/logs";var Vd=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Qd=0,Wd=t.Object({__tsuga_metadata__:t.Object({id:t.String(),source:t.Optional(t.String())},{additionalProperties:!0}),context:t.Optional(t.Object({team:t.Optional(t.String({description:"Team name associated with this log."})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.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:t.Optional(t.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:t.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:t.Enum(Vd,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."})},{additionalProperties:!0}),zU=100,Qz="timestamp",Wz=t.Union([t.Literal(Qz)]),to=t.Partial(t.Object({...He.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:t.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:t.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:t.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:t.Number({minimum:Qd,description:"Result offset used when fetching additional log rows."}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:Wz,sortDirection:t.Union([t.Literal("asc"),t.Literal("desc")],{description:"Timestamp sort direction for log results."})})),N6e=d({tags:["logs"],url:`${Ip}/count`,method:"GET",query:t.Pick(to,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),Is=t.Object({value:t.String(),priority:t.Number()}),L6e=d({tags:["logs"],url:`${Ip}/search`,method:"GET",query:to,response:t.Object({logs:t.Optional(t.Array(Wd)),attributesToHighlight:t.Optional(t.Array(Is))},{additionalProperties:!0})}),Zz=t.Cyclic({TokenOutput:t.Union([t.Object({type:t.Literal("top"),values:t.Array(t.String())}),t.Object({type:t.Literal("ip"),value:t.String()}),t.Object({type:t.Literal("range"),min:t.Number(),max:t.Number()}),t.Object({type:t.Literal("variable"),value:t.String()}),t.Object({type:t.Literal("text"),value:t.String()}),t.Object({type:t.Literal("date"),value:t.String()}),t.Object({type:t.Literal("url"),value:t.String()}),t.Object({type:t.Literal("structure"),key:t.Array(t.String()),value:t.Array(t.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),Xz=t.Object({id:t.String(),pattern:t.Array(Zz),size:t.Integer({description:"Number of logs that matched the pattern"}),examples:t.Array(t.Object({id:t.String(),timestampUnix:t.Number()})),timeDistribution:t.Array(t.Number()),staticFeatures:t.Array(t.Object({key:t.String(),value:t.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),v6e=d({tags:["logs"],url:`${Ip}/patterns`,method:"GET",query:t.Object({...He.properties,query:p({type:"tsuga-query"}),clusteringThreshold:t.Optional(t.Number()),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({patterns:t.Array(Xz),sampleSize:t.Number()})}),k6e=d({tags:["logs"],url:`${Ip}/attributes`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})});var _s=`/${"v1"}/logs`,Zd=t.Object({context:t.Optional(t.Object({team:t.Optional(t.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."})),...t.Pick(Wd,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),Jz={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Zd,{examples:[Jz]});var YU=t.Object({query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e3,default:zU,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...ut.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),e9={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(YU,{examples:[e9]});var VU=d({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${_s}/search`,method:"GET",query:YU,response:t.Object({logs:t.Array(Zd,{description:"Log events matching the query and time range."})})}),t9=t.Object({pattern:t.String({description:"Clustered log pattern formatted as a readable string."}),size:t.Integer({description:"Number of logs that matched the pattern"}),groups:t.Array(t.Object({key:t.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:t.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`."}))}),QU=t.Object({patterns:t.Array(t9,{description:"Log patterns clustered from logs matching the query."}),sampleSize:t.Number({description:"Number of logs sampled while computing patterns."})},{}),r9={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(QU,{examples:[r9]});var WU=d({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${_s}/patterns`,method:"GET",query:t.Object({...ut.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:QU}),n9=t.Object({exampleLog:t.Optional(Zd),team:t.String({description:"Team associated with the new error pattern."}),env:t.String({description:"Environment associated with the new error pattern."}),service:t.String({description:"Service associated with the new error pattern."}),firstSeen:t.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:t.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),ZU=t.Object({newErrorPatterns:t.Array(n9,{description:"Error patterns first seen in the requested time range."})},{}),o9={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(ZU,{examples:[o9]});var XU=d({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${_s}/patterns/new`,method:"GET",query:t.Object({...ut.properties,team:t.Optional(p({description:"Team name to restrict pattern detection to."})),env:t.Optional(p({description:"Environment to restrict pattern detection to."})),service:t.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:ZU}),i9=t.Object({team:t.String({description:"Team associated with the error pattern."}),env:t.String({description:"Environment associated with the error pattern."}),pattern:t.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:t.Array(t.Number({description:"Unix timestamp in milliseconds of a detected spike in occurrence of this pattern. One entry per spike detected in the requested time range."}))}),JU=t.Object({errorPatternIncreases:t.Array(i9,{description:"Error patterns with increased occurrence in the requested time range."})},{}),a9={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(JU,{examples:[a9]});var ew=d({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${_s}/patterns/increase`,method:"GET",query:t.Object({...ut.properties,team:p({description:"Team name to analyze for pattern increases."}),env:t.Optional(p({description:"Environment to restrict the analysis to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:JU}),tw=t.Object({attributes:t.Array(t.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),s9={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(tw,{examples:[s9]});var c9=t.Object({...ut.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),rw=d({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${_s}/attributes`,method:"GET",query:c9,response:tw});var Lr="/v0/metrics",p9=t.Object({__tsuga_metadata__:t.Object({},{additionalProperties:!0}),context:t.Optional(t.Object({},{additionalProperties:!0})),message:t.Optional(t.String()),timestamp:t.Number(),level:t.Enum(Vd)},{additionalProperties:!0}),Q6e=d({tags:["metrics"],url:`${Lr}/count`,method:"GET",query:t.Pick(to,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),W6e=d({tags:["metrics"],url:`${Lr}/search`,method:"GET",query:to,response:t.Object({logs:t.Optional(t.Array(p9)),totalHits:t.Optional(t.Number()),attributesToHighlight:t.Optional(t.Array(Is))},{additionalProperties:!0})}),_p=t.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."}),Xd=t.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."}),u9=t.Object({capabilities:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Human-readable description of the metric"})),tags:t.Optional(t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:t.Optional(Xd),type:t.Optional(_p),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),Z6e=d({url:`${Lr}/metadata`,method:"GET",query:t.Object({...He.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:u9}),X6e=d({tags:["metrics"],url:Lr,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Array(t.String())}),bp=t.Array(t.Object({name:t.String({description:"Metric name observed by Tsuga."}),type:_p}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),m9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(bp,{examples:[m9]});var J6e=d({tags:["metrics"],url:`${Lr}/names-and-types`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:bp}),bs=t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),l9=["service","env","host","method","status_code"];Object.assign(bs,{examples:[l9]});var eQe=d({tags:["metrics"],url:`${Lr}/attributes`,method:"GET",query:t.Object({...He.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:bs}),tQe=d({tags:["metrics"],url:`${Lr}/attributes/batch`,method:"GET",query:t.Object({...He.properties,metricNames:t.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:bs}),Jd=t.Object({assets:t.Array(t.Object({type:t.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:t.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:t.String({description:"Display name of the referencing dashboard or monitor."}),owner:t.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."})}),rQe=d({tags:["metrics"],url:`${Lr}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1})}),response:Jd}),nQe=d({url:`${Lr}/per-attribute`,method:"GET",query:t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number()),attribute:p(),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.String())});var ef=`/${"v1"}/metrics`,d9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(bp,{examples:[d9]});var tf=t.Object({name:t.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:_p,description:t.Optional(t.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:t.Optional(Xd),capabilities:t.Optional(t.Array(t.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:t.Optional(t.Array(t.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),f9={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"]};Object.assign(tf,{examples:[f9]});var nw=t.Object({...ut.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),ow=d({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:ef,method:"GET",query:nw,response:t.Array(tf)}),iw=d({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${ef}/:name`,method:"GET",params:t.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:nw,response:tf}),g9=["service","env","host","method","status_code"];Object.assign(bs,{examples:[g9]});var aw=t.Pick(Jd,["assets"]),y9={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(aw,{examples:[y9]});var sw=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${ef}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:aw});var Ss="/v0/traces",hQe=d({tags:["traces"],url:`${Ss}/count`,method:"GET",query:t.Pick(to,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),h9=["unset","ok","error"],T9=t.Enum(h9),E9=["unspecified","internal","server","client","producer","consumer"],I9=t.Enum(E9),cw=t.Object({__tsuga_metadata__:t.Optional(t.Object({},{additionalProperties:!0})),context:t.Optional(t.Object({telemetry:t.Optional(t.Object({sdk:t.Optional(t.Object({language:t.Optional(t.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.String())),service:t.Optional(t.Object({name:t.Optional(t.String()),version:t.Optional(t.String())},{additionalProperties:!0})),env:t.Optional(t.String())},{additionalProperties:!0})),parent_span_id:t.Optional(t.String()),resource_attributes:t.Object({},{additionalProperties:!0}),span_attributes:t.Object({},{additionalProperties:!0}),duration:t.Number({description:"In milliseconds."}),duration_ns:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:t.Optional(t.Object({message:t.String()})),events:t.Optional(t.Array(t.Object({event_attributes:t.Object({},{additionalProperties:!0}),event_name:t.String(),event_timestamp_nanos:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:t.Optional(t.Array(t.Object({},{additionalProperties:!0}))),span_id:t.String(),span:t.Object({kind:I9,name:t.String()}),status_code:t.Optional(T9),trace_id:t.String()}),pw=100,_9="start_time",b9="duration_ns",S9=t.Union([t.Literal(_9),t.Literal(b9)]),O9={...He.properties,query:t.Optional(p({type:"tsuga-query"})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:t.Optional(t.Boolean()),startOffset:t.Optional(t.Number({minimum:Qd})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:t.Optional(S9),sortDirection:t.Optional(t.Union([t.Literal("asc"),t.Literal("desc")]))},TQe=d({tags:["traces"],url:`${Ss}/search`,method:"GET",query:t.Object(O9),response:t.Object({spans:t.Optional(t.Array(cw)),attributesToHighlight:t.Optional(t.Array(Is))})});var A9=t.Object({groupByAttributes:t.Array(p({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:t.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:t.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:t.Array(t.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:t.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."})}),x9=t.Object({...He.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...t.Partial(A9).properties}),EQe=d({tags:["traces"],url:`${Ss}/summarize`,method:"GET",query:x9,response:t.Object({spans:t.Array(cw)})}),IQe=d({tags:["traces"],url:`${Ss}/attributes`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})}),R9=t.Object({key:t.String({description:"Opaque stable key identifying this service within the response. Referenced by `serviceKey` in contributions and serviceTotals."}),name:t.String({description:"Service name"}),env:t.Optional(t.String({description:"Service environment"})),id:t.Optional(t.String({description:"Service catalog id. Absent when the observed service is not in the catalog, or when multiple catalog entries match ambiguously."})),namespace:t.Optional(t.String({description:"Service namespace from the catalog entry. Absent when not in the catalog."}))}),C9=t.Object({fromNs:t.String({description:"Range start in nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),toNs:t.String({description:"Range end in nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),durationNs:t.String({description:"Range duration in nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),contributions:t.Array(t.Object({serviceKey:t.String({description:"References `services[].key`."}),weight:t.Number({description:"Share of this range attributed to the service. Weights inside a range sum to 1."}),durationNs:t.String({description:"Convenience: weight \xD7 range durationNs (rounded to integer nanoseconds). The server-aggregated value in serviceTotals is authoritative when totals do not exactly match due to rounding."})}),{description:"Services contributing to this range, with their weighted shares."}),spanIds:t.Array(t.String(),{description:"Leaf span IDs (under the leaf-only rule) that produced this range, across any merged sub-ranges."})}),P9=t.Object({serviceKey:t.String({description:"References `services[].key`."}),durationNs:t.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of weight \xD7 range durationNs over ranges. Authoritative. Transmitted as a string to avoid losing precision."}),share:t.Number({description:"Share of the trace duration attributed to this service, in the range 0..1 (multiply by 100 for a percentage). Convenience: durationNs / totalDurationNs."})}),rf=t.Optional(t.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."})),nf=t.Optional(t.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."})),of=t.Object({traceId:t.String({description:"Trace ID echoed from the request."}),startTimeNs:t.String({description:"Earliest `start_time` across the fetched spans, in nanoseconds. If the request specifies `from`/`to` and the window does not cover the full trace, this reflects the returned subset \u2014 not the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:t.String({description:"Latest `end_time` across the fetched spans, in nanoseconds. If the request specifies `from`/`to` and the window does not cover the full trace, this reflects the returned subset \u2014 not the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:t.String({description:"Trace total duration in nanoseconds (endTimeNs - startTimeNs). Transmitted as a string to avoid losing precision."}),truncated:t.Boolean({description:"True when the underlying span fetch hit its result cap and the trace may be incomplete."}),services:t.Array(R9,{description:"Unique services contributing to the trace, enriched with catalog ids. Referenced by `serviceKey` from contributions and serviceTotals."}),ranges:t.Array(C9,{description:"Sequential timeline of the trace, split into ranges wherever the set of active leaf spans changes. Empty when `includeRanges` is false."}),serviceTotals:t.Array(P9,{description:"Aggregated wall-clock contribution per service across the whole trace."})}),_Qe=d({tags:["traces"],url:`${Ss}/latency-summary`,method:"GET",query:t.Object({...He.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:rf,includeRanges:nf}),response:of});var af=`/${"v1"}/traces`,sf=t.Object({context:t.Optional(t.Object({service:t.Optional(t.Object({name:t.Optional(t.String({description:"Service name associated with the span."})),version:t.Optional(t.String({description:"Service version associated with the span."}))},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:t.Optional(t.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes:t.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."}),spanAttributes:t.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:t.Number({description:"Span duration in milliseconds, derived from the nanosecond `startTime` and `endTime` values."}),startTime:t.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime:t.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:t.Optional(t.Object({message:t.String({description:"Error message associated with the span."})})),events:t.Optional(t.Array(t.Object({event_attributes:t.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:t.String({description:"Name of the span event."}),event_timestamp_nanos:t.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})}),{description:"Events recorded on the span."})),spanId:t.String({description:"Unique span ID within the trace."}),span:t.Object({kind:t.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:t.String({description:"Operation name recorded on the span."})}),statusCode:t.Optional(t.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."})),traceId:t.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."}),U9={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{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,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(sf,{examples:[U9]});var w9={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},uw=t.Object({...ut.properties,query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4,default:pw,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:t.Optional(p({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(uw,{examples:[w9]});var mw=d({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${af}/search`,method:"GET",query:uw,response:t.Object({spans:t.Array(sf,{description:"Spans matching the query and time range."})})}),N9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},lw=t.Object({...ut.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:t.Optional(t.Array(p({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:t.Optional(t.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:t.Optional(t.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:t.Optional(t.Array(t.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:t.Optional(t.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(lw,{examples:[N9]});var dw=d({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `spanAttributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${af}/summarize`,method:"GET",query:lw,response:t.Object({spans:t.Array(sf,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `spanAttributes.aggregation.is_summary`."})})}),L9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},fw=t.Object({...ut.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:rf,includeRanges:nf},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(fw,{examples:[L9]});var gw=d({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${af}/latency-summary`,method:"GET",query:fw,response:of});var Tw=["timestamp","level","message"],Ew=["count","ratio","team","level","pattern"];function nt(e,r){let n=r??yr(e);if(!n)throw new Error(`--${e} is required`);return Us(n)}function yw(e){let r={from:nt("from",e.from),to:nt("to",e.to)},n=e.query??yr("query");n!==void 0&&(r.query=n);let o=e.maxResults??yr("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);r.maxResults=i}return r}function Ee(e){let r=yr(e);return r===void 0?"":` (default: ${r})`}function v9(e){let r=Yp(e.output),n=e.fields===void 0?void 0:Vp(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??Tw}}function k9(e){let r=Yp(e.output),n=e.fields===void 0?void 0:Vp(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??Ew}}function hw(e,r){let n={count:e.size,ratio:r>0?e.size/r:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?n.team=i:n[o]=i;return n}function M9(e,r){if(r.format==="json"){if(r.fields===void 0){W(e);return}let{fields:i}=r;W({patterns:e.patterns.map(a=>hw(a,e.sampleSize)).map(a=>Qp(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>hw(i,e.sampleSize)),o=Wp(r.format,n,r.fields);o.length>0&&B(o)}function D9(e,r){if(r.format==="json"){if(r.fields===void 0){W(e);return}let{fields:o}=r;W({logs:e.logs.map(i=>Qp(i,o))});return}let n=Wp(r.format,e.logs,r.fields);n.length>0&&B(n)}function Iw(e,r){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Tw.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=v9(c),l=await r()(VU,{query:yw(c)});D9(l,m)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(rw,{query:{from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),n.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${Ew.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=k9(c),l={from:nt("from",c.from),to:nt("to",c.to)},f=c.query??yr("query");f!==void 0&&(l.query=f);let y=await r()(WU,{query:l});M9(y,m)}),n.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async c=>{let m={from:nt("from",c.from),to:nt("to",c.to)};c.team!==void 0&&(m.team=c.team),c.env!==void 0&&(m.env=c.env),c.service!==void 0&&(m.service=c.service);let l=await r()(XU,{query:m});W(l)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let m={from:nt("from",c.from),to:nt("to",c.to),team:c.team};c.env!==void 0&&(m.env=c.env);let l=await r()(ew,{query:m});W(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(ow,{query:{from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async(c,m)=>{let l=await r()(iw,{params:{name:c},query:{from:nt("from",m.from),to:nt("to",m.to)}});W(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let m=await r()(sw,{query:{metricName:c}});W(m)});let i=e.command("traces").description("Search traces");i.command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).action(async c=>{let m=await r()(mw,{query:yw(c)});W(m)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <id>","Trace ID to summarize").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(dw,{query:{traceId:c.traceId,from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <id>","Trace ID to summarize").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--min-range-duration-ms <n>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let m={traceId:c.traceId,from:nt("from",c.from),to:nt("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);m.minRangeDurationMs=f}c.ranges||(m.includeRanges=!1);let l=await r()(gw,{query:m});W(l)});let a=e.command("aggregation").description("Run aggregation queries");Aa(a,"scalar","Run aggregation queries and return scalar results",hS,r),Aa(a,"timeseries","Run aggregation queries and return timeseries results",ES,r)}var G9="x-tsuga-session-id",cf="x-tsuga-source",pf="x-tsuga-source-version",uf="x-tsuga-source-commit",mf="x-tsuga-source-date",lf="x-tsuga-rationale",$9="x-tsuga-dashboard-id",j9="x-tsuga-widget-id",q9="x-request-id",$Qe={[G9]:"Session identifier for request correlation",[cf]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[pf]:"SDK version",[uf]:"SDK commit hash",[mf]:"SDK commit date",[lf]:"Optional caller-supplied rationale for this request, recorded for telemetry",[$9]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[j9]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[q9]:"Unique identifier for this API request, useful for debugging and support"};var fn=class e extends Error{constructor(n,o,i,a){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o)}};function _w(e){if(e instanceof fn){let r=[`Error: ${e.message}`];return e.code&&r.push(`Code: ${e.code}`),e.statusCode&&r.push(`Status: ${e.statusCode}`),e.requestId&&r.push(`Request ID: ${e.requestId}`),r.join(`
|
|
162
|
+
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function B9(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function bw(e,r,n,o){return async function(a,c={}){let{body:m,params:l,query:f}=c,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!l)throw new fn("Internal error: params required for this endpoint");y=a.buildUrl(l)}else throw new fn("Internal error: endpoint has neither url nor buildUrl");let E=n===void 0?f:{clusterId:n,...f},A=nb(`${e}${y}`,E),ye={Accept:"application/json",Authorization:`Bearer ${r}`,[cf]:"cli",[pf]:"1.3.0",[uf]:"12394ab",[mf]:"2026-07-22T12:11:21.772Z"};m&&(ye["Content-Type"]="application/json");let Ue=o?.(),vr=Ue?B9(Ue):"";vr&&(ye[lf]=vr);let ro=await fetch(A,{method:a.method,headers:ye,body:m?JSON.stringify(m):null}),yn;try{yn=await ro.json()}catch{throw new fn(ro.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${ro.status}).`,ro.status)}if(yn.error)throw fn.fromErrorResponse(yn.error,yn.requestId);return yn.data}}var F9=3e3,H9="https://registry.npmjs.org/@tsuga/cli/latest";function K9(e,r){let n=e.split(".").map(Number),o=r.split(".").map(Number);for(let i=0;i<Math.max(n.length,o.length);i++){let a=n[i]??0,c=o[i]??0;if(a>c)return!0;if(a<c)return!1}return!1}async function Sw(e){try{let r=Eb();if(r&&Date.now()-new Date(r).getTime()<Ps)return;let n=await fetch(H9,{signal:AbortSignal.timeout(F9)});if(!n.ok)return;let i=(await n.json()).version;K9(i,e)&&(process.stderr.write(`
|
|
163
163
|
Update available: ${e} \u2192 ${i}
|
|
164
|
-
`),process.stderr.write("Run `tsuga self-update` to update\n")),
|
|
164
|
+
`),process.stderr.write("Run `tsuga self-update` to update\n")),Ib(new Date().toISOString())}catch{}}var tt=new Rf().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.3.0").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Sp,Ow;function gn(){if(Sp)return Sp;let e=tt.opts(),r=vo({operationApiKey:e.operationApiKey,clusterId:e.cluster});Rs(r.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let n=ub(r);return n||(console.error("Error: no credentials. Authenticate with one of:"),console.error(" tsuga auth login # log in as a user (OAuth)"),console.error(" tsuga auth operation-key <operation-api-key> # save an operation API key"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),Sp=bw(r.apiUrl,n,r.clusterId,()=>Ow),Sp}bb(tt);Db(tt);var z9=new Set(tt.commands);NU(tt,gn);Iw(tt,gn);ER(tt,gn);tC(tt,gn);Fb(tt,gn);Ix(tt,gn);Lb(tt,gn);yx(tt,gn);KU(tt);SR(tt);vU(tt);Mb(tt);function Aw(e){for(let r of e.commands)r.commands.length===0&&r.option("--rationale <text>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.'),Aw(r)}for(let e of tt.commands)z9.has(e)||Aw(e);tt.hook("preAction",(e,r)=>{let{rationale:n}=r.opts();Ow=n});tt.parseAsync().then(()=>Sw("1.3.0")).catch(e=>{console.error(_w(e)),process.exitCode=1});
|
|
165
165
|
/**
|
|
166
166
|
* The following is a list of HTTP status codes and their meanings.
|
|
167
167
|
*
|