@tsuga/cli 1.0.1 → 1.0.2
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 +7 -20
- package/dist/cli.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,31 +14,26 @@ tsuga --help
|
|
|
14
14
|
|
|
15
15
|
## Authentication
|
|
16
16
|
|
|
17
|
-
Before authenticating, generate an API
|
|
17
|
+
Before authenticating, generate an Operation API key from your [Tsuga account settings](https://app.tsuga.com/settings/api-keys?operation=true).
|
|
18
18
|
|
|
19
|
-
The recommended way to authenticate is to save your
|
|
19
|
+
The recommended way to authenticate is to save your Operation API key once:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
tsuga auth <
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This writes your token to `~/.config/tsuga/config.json`. You can also optionally save an API URL override:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
tsuga auth <token> --url https://api.tsuga-staging.com
|
|
22
|
+
tsuga auth <operation-api-key>
|
|
29
23
|
```
|
|
30
24
|
|
|
25
|
+
This writes your operation-api-key to `~/.config/tsuga/config.json`.
|
|
31
26
|
Alternatively, set credentials per-session without saving:
|
|
32
27
|
|
|
33
28
|
```bash
|
|
34
29
|
# Environment variable
|
|
35
|
-
export TSUGA_OPERATION_API_KEY=<
|
|
30
|
+
export TSUGA_OPERATION_API_KEY=<operation-api-key>
|
|
36
31
|
|
|
37
32
|
# CLI flag (highest priority)
|
|
38
|
-
tsuga --api-
|
|
33
|
+
tsuga --operation-api-key <operation-api-key> dashboards list
|
|
39
34
|
```
|
|
40
35
|
|
|
41
|
-
Priority order: `--api-
|
|
36
|
+
Priority order: `--operation-api-key` flag → `TSUGA_OPERATION_API_KEY` env var → saved config.
|
|
42
37
|
|
|
43
38
|
## Configuration
|
|
44
39
|
|
|
@@ -48,14 +43,6 @@ Show current configuration:
|
|
|
48
43
|
tsuga config
|
|
49
44
|
```
|
|
50
45
|
|
|
51
|
-
Override the API URL:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
tsuga --api-url https://api.tsuga-staging.com dashboards list
|
|
55
|
-
# or
|
|
56
|
-
export TSUGA_API_URL=https://api.tsuga-staging.com
|
|
57
|
-
```
|
|
58
|
-
|
|
59
46
|
## Defaults
|
|
60
47
|
|
|
61
48
|
Telemetry commands have built-in defaults so you can omit common flags:
|
package/dist/cli.js
CHANGED
|
@@ -101,20 +101,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
101
101
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
102
102
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
103
103
|
-----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}"}],u9=$k.map(f=>f.key),che=new Set(u9),fhe=$k.map(f=>f.key);var i9=NA(jk());var Bk=["ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","URL_NOT_FOUND"],Hk=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"],l9=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],c9=[...Bk,...Hk,...l9],CEe=ge.Object({code:ge.Optional(ge.Enum(c9,{description:"Machine readable error code describing what went wrong"})),message:ge.String({description:"Human readable explanation of the error"}),statusCode:ge.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),yEe=ge.Object({code:ge.Optional(ge.Enum(Bk,{description:"Machine readable error code describing what went wrong"})),message:ge.String({description:"Human readable explanation of the error"}),statusCode:ge.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),LEe=ge.Object({code:ge.Optional(ge.Enum(Hk,{description:"Machine readable error code describing what went wrong"})),message:ge.String({description:"Human readable explanation of the error"}),statusCode:ge.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"});function ao({body:f,description:m,method:L,operationId:ne,params:Ue,tags:t,query:or,response:Fr,url:e}){return Ue?{body:f,buildUrl:Vn=>e.replace(/:[a-zA-Z_]+/g,Br=>Vn[Br.slice(1)]),description:m,method:L,operationId:ne,params:Ue,query:or,response:Fr,tags:t,templateUrl:e}:{body:f,description:m,method:L,operationId:ne,query:or,response:Fr,tags:t,url:e,templateUrl:e}}function qk(f,m){if(!m||typeof m!="object")return f;let L=new URLSearchParams;return Object.entries(m).forEach(([ne,Ue])=>{Array.isArray(Ue)?Ue.length>0&&Ue.forEach(t=>{t!==void 0&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean")&&L.append(ne,String(t))}):(typeof Ue=="boolean"||typeof Ue=="string"||typeof Ue=="number")&&L.append(ne,String(Ue))}),`${f}?${L.toString()}`}var f9="x-tsuga-session-id",Gg="x-tsuga-source",Fg="x-tsuga-source-version",jg="x-tsuga-source-commit",Bg="x-tsuga-source-date",p9="x-request-id",OEe={[f9]:"Session identifier for request correlation",[Gg]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Fg]:"SDK version",[jg]:"SDK commit hash",[Bg]:"SDK commit date",[p9]:"Unique identifier for this API request, useful for debugging and support"};var QL=class f extends Error{constructor(L,ne,Ue,t){super(L);this.statusCode=ne;this.code=Ue;this.requestId=t;this.name="CliError"}static fromErrorResponse(L,ne){return new f(L.message,L.statusCode,L.code,ne)}};function Kk(f){if(f instanceof QL){let m=[`Error: ${f.message}`];return f.code&&m.push(`Code: ${f.code}`),f.statusCode&&m.push(`Status: ${f.statusCode}`),f.requestId&&m.push(`Request ID: ${f.requestId}`),m.join(`
|
|
104
|
-
`)}return f instanceof Error?`Error: ${f.message}`:String(f)}function Yk(f,m){return async function(ne,Ue={}){let{body:t,params:or,query:Fr}=Ue,e;if("url"in ne)e=ne.url;else{if(!or)throw new QL("Internal error: params required for this endpoint");e=ne.buildUrl(or)}let Yn=qk(`${f}${e}`,Fr),Vn={Accept:"application/json",Authorization:`Bearer ${m}`,[Gg]:"cli",[Fg]:"1.0.1",[jg]:"3ae8524",[Bg]:"2026-02-24T10:19:57.660Z"};t&&(Vn["Content-Type"]="application/json");let Xr=await(await fetch(Yn,{method:ne.method,headers:Vn,body:t?JSON.stringify(t):void 0})).json();if(Xr.error)throw QL.fromErrorResponse(Xr.error,Xr.requestId);return Xr.data}}var m9=1e3,d9=60*m9,b9=60*d9,Xw=24*b9,$Ee=7*Xw,GEe=30*Xw;var Hg=["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 zk=ge.Object({type:ge.Literal("number"),number:ge.String()}),v9=ge.Object({type:ge.Literal("string"),string:ge.String()}),C9=ge.Object({type:ge.Literal("timestamp"),timestamp:ge.String()}),qg=Xf("type",[zk,v9,C9]),y9=ge.Object({by:ge.Record(ge.String(),qg),computed:ge.Record(ge.String(),zk)}),Vk=ge.Object({buckets:ge.Array(y9)});var oy=ge.Object({from:ge.Optional(ge.Number({description:"Start timestamp in seconds"})),to:ge.Optional(ge.Number({description:"End timestamp in seconds"}))},{title:"TimeRange",description:"Time range to query",examples:[{from:1704067200,to:1704067200}]}),wC=ge.Object({from:ge.Integer({description:"Start timestamp in seconds",examples:[1704067200]}),to:ge.Integer({description:"End timestamp in seconds",examples:[1704067200]})},{title:"TimeRange",description:"Time range to query",examples:[{from:1704067200,to:1704067200}]});var L9="/v0/aggregation",h9=ge.Union([ge.Literal("a"),ge.Literal("d"),ge.Literal("q"),ge.Literal("w"),ge.Literal("h")]),E9=ge.Object({parallelism:ge.Number(),engine:h9,recordBatchCache:ge.Optional(ge.Boolean()),includeNullGroups:ge.Optional(ge.Boolean()),shadow:ge.Optional(ge.Boolean())}),qC=["logs","metrics","traces"];var sE=ge.Enum(qC,{description:"Data source being queried for this aggregation"}),JL=ms({description:"Attribute containing the values to aggregate"}),w9=Xf("type",[ge.Object({type:ge.Literal("count",{description:"Counts the total number of records"})},{$id:"AggregateCount",title:"Count"}),ge.Object({type:ge.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:JL},{$id:"AggregateUniqueCount",title:"UniqueCount"}),ge.Object({type:ge.Literal("average",{description:"Calculates the average value of the selected field"}),field:JL},{$id:"AggregateAverage",title:"Average"}),ge.Object({type:ge.Literal("max",{description:"Finds the largest value of the field"}),field:JL},{$id:"AggregateMax",title:"Max"}),ge.Object({type:ge.Literal("min",{description:"Finds the smallest value of the field"}),field:JL},{$id:"AggregateMin",title:"Min"}),ge.Object({type:ge.Literal("sum",{description:"Sums the values of the selected field"}),field:JL},{$id:"AggregateSum",title:"Sum"}),ge.Object({type:ge.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:JL,percentile:ge.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),A9=Xf("type",[ge.Object({type:ge.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),ge.Object({type:ge.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),ge.Object({type:ge.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),ge.Object({type:ge.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),ge.Object({type:ge.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics automatically handling counter resets. When used with an aggregation like `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),ge.Object({type:ge.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:ms({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),ge.Object({type:ge.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:ge.Integer({description:"The base of the logarithm",minimum:2})},{$id:"FunctionLog",title:"Log"}),ge.Object({type:ge.Literal("power",{description:"Raises values to a specified power"}),exponent:ge.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),ge.Object({type:ge.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"})],{title:"Function"});var g9=Xf("type",[ge.Object({type:ge.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),ge.Object({type:ge.Literal("timeseries"),aggregationWindow:ms({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"})]),Kg=15,T9=["zero","null"],I9=ge.Enum(T9),_9=ge.Object({mode:ge.Object({type:I9})}),Wk={aggregate:w9,functions:ge.Optional(ge.Array(A9,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:ge.Optional(_9)},Xk={maxItems:Kg,description:"Aggregations that may be combined together in the same query"},oE=ge.Array(ge.Object({...Wk,filter:ge.Optional(ms({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),Xk),aE=ge.Array(ge.Object({...Wk,filter:ms({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),Xk);var uE=ms({type:"math-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),x9=ge.Object({fields:ge.Array(ms(),{maxItems:1}),limit:ge.Number()},{title:"AggregationGroupBy"}),S9=7,iE=ge.Array(x9,{maxItems:S9,description:"Fields used to group the results"}),twe=ao({tags:["aggregation"],url:`${L9}/multi-query`,method:"POST",body:ge.Object({timeRange:wC,queries:oE,groupBy:ge.Optional(iE),returnType:g9,dataSource:sE,formula:uE,executionOptions:E9,triggeredBy:ge.Optional(ge.Literal("refresh")),shouldStreamResults:ge.Optional(ge.Boolean()),clusterId:ge.Optional(ms({allowEmpty:!1}))}),response:Vk}),O9=["per-second","per-minute","per-hour","rate"],oL=ge.Enum(O9),rwe=Xf("type",[ge.Object({type:ge.Literal("count"),count:ge.Object({field:ge.Optional(ms()),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("average"),average:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("min"),min:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("max"),max:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("sum"),sum:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("percentile"),percentile:ge.Object({field:ms(),percentile:ge.Number(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("uniqueCount"),uniqueCount:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})})]),R9=ge.Object({type:ge.Literal("time"),time:ge.Object({interval:ms()})}),N9=ge.Object({type:ge.Literal("histogram"),histogram:ge.Object({field:ms(),interval:ge.Number(),bounds:ge.Optional(ge.Object({min:ge.Number(),max:ge.Number()}))})}),k9=ge.Object({type:ge.Literal("topList"),topList:ge.Object({field:ms(),size:ge.Number(),orderBy:ge.Optional(ge.Object({computeRef:ms(),order:ge.Union([ge.Literal("asc"),ge.Literal("desc")])}))})}),nwe=Xf("type",[R9,N9,k9]);var U9="^\\S(.*\\S)?$",M9=ge.Object({key:ge.String({maxLength:128}),value:ge.String({maxLength:256,pattern:U9})},{title:"Tag"}),P9=ge.Array(M9,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),iv=ge.Optional(P9);var Py="/v0/teams",Yg=["public","private"],Zk=ge.Object({color:ge.Enum(Dg),mode:ge.Enum($g),iconName:ge.Enum(Dk)}),zg=ge.Object({color:ge.Enum(Dg),mode:ge.Enum($g)}),D9=100,$9=250,eh=ge.Object({id:ge.String({description:"Identifier of the team"}),name:ge.String({description:"Human readable team name displayed throughout the app"}),description:ge.Optional(ge.String()),visibility:ge.Enum(Yg,{description:"Controls whether the resources of the team are discoverable by users"}),tags:iv,createdAt:jl(),updatedAt:jl(),memberCount:ge.Optional(ge.Number({description:"Number of members currently in the team"})),avatar:ge.Optional(Zk)}),Zw=ge.Object({name:ge.String({minLength:1,maxLength:D9,description:"Name to assign to the team"}),description:ge.Optional(ge.String({maxLength:$9})),visibility:ge.Enum(Yg,{description:"Controls whether the resources of the team are discoverable by users"}),tags:iv,avatar:ge.Optional(Zk)}),G9=ge.Object({id:ge.String(),name:ge.String(),email:ge.String(),role:ge.Enum(rE),joinedTeamAt:jl(),orgRole:ge.Enum(Uk),avatar:ge.Optional(zg)}),Cwe=ao({tags:["teams"],url:Py,method:"GET",response:ge.Array(eh),query:ge.Optional(ge.Object({includeMemberCount:ge.Optional(ge.Boolean())}))}),ywe=ao({tags:["teams"],url:`${Py}/:id`,method:"GET",params:ge.Object({id:ms()}),response:eh}),Lwe=ao({tags:["teams"],url:`${Py}/:id/members`,method:"GET",params:ge.Object({id:ms()}),response:ge.Array(G9)}),hwe=ao({tags:["teams"],url:`${Py}/:id/assets`,method:"GET",params:ge.Object({id:ms()}),response:ge.Object({apiKeyCount:ge.Number(),logRouteCount:ge.Number(),monitorCount:ge.Number(),notificationRuleCount:ge.Number(),dashboardCount:ge.Number()})}),Ewe=ao({tags:["teams"],url:Py,method:"POST",body:Zw,response:eh}),wwe=ao({tags:["teams"],url:`${Py}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:Zw,response:eh}),Awe=ao({tags:["teams"],url:`${Py}/bulk-update`,method:"POST",body:ge.Object({teamIds:ge.Array(ms(),{maxItems:100}),config:ge.Object({visibility:ge.Enum(Yg)})}),response:ge.Object({})}),gwe=ao({tags:["teams"],url:`${Py}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var F9=ge.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),wv=Xf("type",[ge.Object({type:ge.Literal("user"),id:ge.String(),name:ge.String(),avatar:ge.Optional(zg)}),ge.Object({type:ge.Literal("operation-api-key"),id:ge.String(),name:ge.String(),source:ge.Optional(F9)})]);var aL="/v0/dashboards",j9=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],B9=["timeseries","top-list","pie","query-value","bar","list"],jwe=[...B9,"note"],H9=["ns","us","ms","s","m","h","days"];var q9=["B","KB","MB","GB","TB","PB"];var th=Xf("type",[ge.Object({type:ge.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:ge.Enum(H9,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),ge.Object({type:ge.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:ge.Enum(q9,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),ge.Object({type:ge.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),ge.Object({type:ge.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),ge.Object({type:ge.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),ge.Object({type:ge.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:ge.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"})],{title:"Normalizer"}),K9=ge.Object({attribute:ge.String({description:"Attribute displayed as a column in the log list"}),normalizer:ge.Optional(th)},{title:"WidgetListColumn"}),Y9=["background","no-background"],z9=["table","legend-only","no-legend"];var V9=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],tU=["alert","warning","success"],W9=ge.Object({operator:ge.Enum(V9,{description:"Comparator used to evaluate the metric value"}),value:ge.Number({description:"Threshold value used when evaluating the operator"}),color:ge.Enum(tU,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),X9=ge.Object({value:ge.Number({description:"Y-axis value where the threshold marker is placed"}),level:ge.Enum(tU,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),Z9=["sec","min","hour","day"],Qk=ge.Object({time:ge.Number({description:"Number of units that make up each bar bucket"}),metric:ge.Enum(Z9,{description:"Unit used to measure the bucket width"})});var Jk=ge.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),rU={source:sE,queries:oE,formula:ge.Optional(uE),visibleSeries:ge.Optional(ge.Array(ge.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Qw={...rU,groupBy:ge.Optional(iE)},Jw=ge.Enum(z9,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),lE=ge.Optional(ge.Number({description:"Number of decimal places to display in the value"})),eU=ge.Optional(ge.Array(X9,{description:"Threshold markers displayed on the chart"})),Q9=Xf("type",[ge.Object({type:ge.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Qw,timeBucket:ge.Optional(Qk),normalizer:ge.Optional(th),precision:lE,legendMode:ge.Optional(Jw),thresholds:eU},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),ge.Object({type:ge.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Qw,normalizer:ge.Optional(th),precision:lE},{$id:"GraphVisualizationTopList",title:"TopList"}),ge.Object({type:ge.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Qw,normalizer:ge.Optional(th),precision:lE,legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationPie",title:"Pie"}),ge.Object({type:ge.Literal("query-value",{description:"Displays the aggregation as a single value"}),...rU,backgroundMode:ge.Optional(ge.Enum(Y9,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:ge.Optional(ge.Array(W9,{description:"Conditional formatting rules applied to the displayed value"})),precision:lE,normalizer:ge.Optional(th),legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),ge.Object({type:ge.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Qw,timeBucket:ge.Optional(Qk),precision:lE,normalizer:ge.Optional(th),thresholds:eU,legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationBar",title:"Bar"}),ge.Object({type:ge.Literal("list",{description:"Displays matching logs in a tabular list"}),source:ge.Literal("logs",{description:"Indicates that the widget queries logs"}),query:ms({type:"tsuga-query",description:"Log query that selects records for the list"}),listColumns:ge.Optional(ge.Array(K9,{description:"Custom columns to display for each log entry"}))},{$id:"GraphVisualizationList",title:"List"}),ge.Object({type:ge.Literal("note",{description:"Displays static text on the dashboard"}),note:ge.Optional(ms({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:ge.Optional(ge.Enum(j9,{description:"Background color used to render the note"})),noteAlign:ge.Optional(Jk),noteJustifyContent:ge.Optional(Jk)},{$id:"GraphVisualizationNote",title:"Note"})]),nU=ge.Object({id:ms({description:"Identifier of the graph widget"}),name:ge.Optional(ms({description:"Display name of the graph widget"})),description:ge.Optional(ge.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:Q9,layout:ge.Optional(ge.Object({x:ge.Number({description:"Horizontal grid position of the widget"}),y:ge.Number({description:"Vertical grid position of the widget"}),w:ge.Number({description:"Width of the widget in grid units"}),h:ge.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),J9=10,sU=ge.Array(ge.Object({key:ms({description:"Filter key"}),values:ge.Array(ms({description:"Filter value"}))}),{maxItems:J9,description:"Filters applied to every widget on the dashboard"}),rh=ge.Object({id:ge.String({description:"Identifier of the dashboard"}),name:ge.String({description:"Display name of the dashboard"}),owner:ge.String({description:"Team ID that owns and manages the dashboard"}),graphs:ge.Array(nU,{description:"Ordered widgets that compose the dashboard"}),filters:ge.Optional(sU),createdAt:jl(),updatedAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv),tags:iv,timePreset:ge.Optional(ge.Enum(Hg))}),eA=ge.Object({name:ms({description:"Display name of the dashboard"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:ge.Array(nU,{description:"Ordered widgets that compose the dashboard"}),filters:ge.Optional(sU),tags:iv,timePreset:ge.Optional(ge.Enum(Hg))}),Vg=ge.Object({owners:ge.Optional(ge.Array(ms({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),Bwe=ao({tags:["dashboards"],url:aL,method:"GET",query:Vg,response:ge.Array(rh)}),Hwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"GET",params:ge.Object({id:ms()}),response:rh}),qwe=ao({tags:["dashboards"],url:aL,method:"POST",body:eA,response:rh}),Kwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Partial(eA),response:rh}),Ywe=ao({tags:["dashboards"],url:`${aL}/bulk-update`,method:"PUT",body:ge.Object({dashboardIds:ge.Array(ms()),owner:ms({allowEmpty:!1})}),response:ge.Object({})}),zwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),Vwe=ao({tags:["dashboards"],url:`${aL}/bulk-delete`,method:"DELETE",body:ge.Object({ids:ge.Array(ms())}),response:ge.Object({})});var cE=`/${"v1"}/dashboards`,fE=ge.Pick(rh,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),eF={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(fE,{examples:[eF]});var tF=ge.Pick(Vg,["owners"]),oU=ao({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:cE,method:"GET",query:tF,response:ge.Array(fE)}),aU=ao({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:fE}),Wg=ge.Pick(eA,["name","owner","graphs","filters","tags","timePreset"]),rF={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(Wg,{examples:[rF]});var uU=ao({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:cE,method:"POST",body:Wg,response:fE}),iU=ao({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:ge.Partial(Wg),response:fE}),lU=ao({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var nF=100,sF=3,pE=ge.Object({id:ge.String(),name:ge.String(),keyLastCharacters:ge.String(),owner:ge.String(),tags:iv,teamOverrideFields:ge.Optional(ge.Array(ge.String())),updatedAt:jl(),createdAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv),lastSyncedAt:ge.Optional(jl()),assetUpdatedAt:jl()}),tA=ge.Object({name:ge.String({minLength:1,maxLength:nF}),owner:ms({allowEmpty:!1}),tags:iv,teamOverrideFields:ge.Optional(ge.Array(ms({allowEmpty:!1}),{minItems:1,maxItems:sF}))}),rA="/v0/ingestion-api-keys",mAe=ao({tags:["ingestion-api-keys"],url:rA,method:"POST",body:tA,response:ge.Intersect([pE,ge.Object({key:ge.String()})])}),dAe=ao({tags:["ingestion-api-keys"],url:rA,method:"GET",response:ge.Array(pE)}),bAe=ao({tags:["ingestion-api-keys"],url:`${rA}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:tA,response:pE}),vAe=ao({tags:["ingestion-api-keys"],url:`${rA}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var nA=`/${"v1"}/ingestion-api-keys`,sA=ge.Pick(pE,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),cU={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(sA,{examples:[cU]});var Xg=ge.Pick(tA,["name","owner","tags","teamOverrideFields"]),oF={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Xg,{examples:[oF]});var aF={...cU,key:"tsuga_in:v1:abc123xyx7Qm"},fU=ao({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:nA,method:"GET",response:ge.Array(sA)}),uF=ge.Omit(sA,["examples"]),pU=ao({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:nA,method:"POST",body:Xg,response:ge.Intersect([uF,ge.Object({key:ge.String()})],{example:aF})}),mU=ao({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${nA}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:Xg,response:sA}),dU=ao({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${nA}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var KC="/v0/monitors",iF=["all","owning-team-and-public","owning-team-only"],bU=ge.Enum(iF,{description:"This controls which data the monitor can see"}),vU=["alert","resolve","keep_last_status","consider_zero"],CU=["alert","resolve","keep_last_status"];var lF=["no_aggregation","all","any","each","proportion"],cF=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var yU=ge.Object({formula:ms({type:"math-formula"}),operator:ge.Enum(cF),threshold:ge.Number()}),LU=ge.Object({formula:ms({type:"math-formula"}),conditionType:ge.Enum(["rate","error","cpu","general","to_be_set"])}),fF=["rate","error","cpu","general"],PAe=ge.Enum(fF),YC=[1,2,3,4,5];var oA={timeframe:ge.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:ge.Array(ge.Object({fields:ge.Array(ms()),limit:ge.Number()}),{maxItems:1}),aggregationAlertLogic:ge.Optional(ge.Enum(lF)),proportionAlertThreshold:ge.Optional(ge.Integer({minimum:1,maximum:99}))},Zg=ge.Object({type:ge.Literal("metric"),condition:yU,noDataBehavior:ge.Enum(vU),...oA,queries:aE},{$id:"MonitorConfigurationMetric"}),Qg=ge.Object({type:ge.Literal("log"),condition:yU,noDataBehavior:ge.Enum(vU),...oA,queries:aE},{$id:"MonitorConfigurationLog"}),Jg=ge.Object({type:ge.Literal("anomaly-log"),condition:LU,noDataBehavior:ge.Enum(CU),...oA,queries:aE},{$id:"MonitorConfigurationAnomalyLog"}),eT=ge.Object({type:ge.Literal("anomaly-metric"),condition:LU,noDataBehavior:ge.Enum(CU),...oA,queries:aE},{$id:"MonitorConfigurationAnomalyMetric"}),hU=ge.Object({type:ge.Literal("certificate-expiry"),warnBeforeInDays:ge.Integer({minimum:1,maximum:365}),cloudAccounts:ge.Optional(ge.Array(ge.String(),{minItems:1})),aggregationAlertLogic:ge.Literal("each"),noDataBehavior:ge.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),pF=ge.Object({type:ge.Literal("log-error-pattern"),aggregationAlertLogic:ge.Literal("each"),noDataBehavior:ge.Literal("keep_last_status"),filter:ge.Object({teamIds:ge.Array(ge.String()),env:ge.String(),service:ge.Optional(ge.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),EU=Xf("type",[Zg,Qg,Jg,eT,pF,hU]),Dy=ge.Object({id:ge.String({description:"Identifier of the monitor"}),name:ge.String({description:"Display name of the monitor"}),owner:ge.String({description:"Team ID that owns and manages the monitor"}),message:ge.Optional(ge.String({description:"Message to be displayed if a notification is triggered"})),tags:iv,configuration:EU,priority:ge.Enum(YC,{description:"Priority of the monitor"}),permissions:bU,dashboardId:ge.Optional(ge.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:ge.Optional(jl()),creator:ge.Optional(wv),updater:ge.Optional(wv),createdAt:jl(),updatedAt:jl(),lastSyncedAt:ge.Optional(jl()),assetUpdatedAt:jl()},{title:"Monitor"}),mF=Xf("type",[Zg,Qg,Jg,eT,hU]),DAe=ge.Object({...Dy.properties,configuration:mF},{title:"Monitor"}),$Ae=ge.Object({...Dy.properties,configuration:Xf("type",[Zg,Qg,Jg,eT])},{title:"Monitor"}),aA=ge.Object({name:ms(),message:ge.Optional(ms({type:"long"})),tags:iv,configuration:EU,priority:ge.Enum(YC),owner:ms({allowEmpty:!1}),dashboardId:ge.Optional(ms()),pauseUntil:ge.Optional(ms({allowEmpty:!1,type:"date-time"})),permissions:bU});var GAe=ao({tags:["monitors"],url:KC,method:"GET",response:ge.Array(Dy),query:ge.Optional(ge.Object({owners:ge.Optional(ge.Array(ms({allowEmpty:!1})))}))}),FAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"GET",params:ge.Object({id:ms()}),response:Dy}),jAe=ao({tags:["monitors"],url:KC,method:"POST",body:aA,response:Dy}),BAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:aA,response:Dy}),HAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),dF=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],uL=ge.Enum(dF),bF=Xf("type",[ge.Object({type:ge.Literal("each"),subStates:ge.Record(ge.String(),ge.Object({stateValue:ge.Union([uL,ge.Null()]),lastChangedAt:jl()}))}),ge.Object({type:ge.Literal("no_aggregation"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("any"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("all"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("proportion"),stateValue:ge.Optional(uL)})]),vF=ge.Object({monitorId:ge.String(),currentState:bF,lastChangedAt:ge.Optional(jl())}),qAe=ao({tags:["monitors"],url:`${KC}/states/:id`,method:"GET",params:ge.Object({id:ms()}),response:vF}),KAe=ao({tags:["monitors"],url:`${KC}/:id/transitions`,method:"GET",params:ge.Object({id:ms()}),query:ge.Object({from:ge.Number(),to:ge.Number()}),response:ge.Array(ge.Object({id:ge.String(),createdAt:jl(),fromState:ge.Optional(uL),toState:ge.Optional(uL),dimension:ge.Optional(ge.String())}))}),CF=["unprocessed","processed","failed-to-process"],YAe=ao({tags:["monitors"],url:`${KC}/:id/results`,method:"GET",params:ge.Object({id:ms()}),query:ge.Object({from:ge.Number(),to:ge.Number()}),response:ge.Object({isTruncated:ge.Boolean(),results:ge.Array(ge.Object({id:ge.String(),evaluationAt:jl(),formulaResult:ge.Object({groups:ge.Array(ge.Object({groupKey:ge.Record(ge.String(),qg),result:ge.Union([ge.Number(),ge.Literal("NaN")]),conditionMet:ge.Enum(["true","false","nan-no-data"])}))}),createdAt:jl(),status:ge.Enum(CF)}))})});var mE=`/${"v1"}/monitors`,dE=ge.Pick(Dy,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),yF={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"}],condition:{formula:"q1",operator:"greater_than",threshold:100},noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all"};Object.assign(dE,{examples:[yF]});var wU=ao({description:"Retrieve all monitors",operationId:"listMonitors",tags:["monitors"],url:mE,method:"GET",response:ge.Array(dE)}),AU=ao({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${mE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:dE}),tT=ge.Pick(aA,["name","message","tags","configuration","priority","owner","dashboardId","permissions"]),LF={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"}],condition:{formula:"q1",operator:"greater_than",threshold:100},noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all"};Object.assign(tT,{examples:[LF]});var gU=ao({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:mE,method:"POST",body:tT,response:dE}),TU=ao({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${mE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:tT,response:dE}),IU=ao({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${mE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var bE="/v0/notifications",lL=`${bE}/rules`,_U=`${bE}/slack/setup`,uA=`${bE}/integrations`,iL=["triggered","resolved","no-data"],hF=["sent","stale","pending","rate-limited","failed","silenced"],xU=ge.Optional(ge.Object({maxMessages:ge.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:ge.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),SU=ge.Optional(ge.Object({mode:ge.Literal("each"),renotificationStates:ge.Array(ge.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:ge.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),EF=ge.Object({id:ms({description:"Identifier of the notification target"}),rateLimit:xU,config:Xf("type",[ge.Object({type:ge.Literal("slack"),channel:ms({description:"Slack channel ID that receives the notification"}),integrationId:ms({description:"Slack workspace ID that receives the notification"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Slack message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Slack message"}))},{$id:"RuleTargetInputSlack"}),ge.Object({type:ge.Literal("incident-io"),integrationId:ms({description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),ge.Object({type:ge.Literal("pagerduty"),integrationId:ms({description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),ge.Object({type:ge.Literal("email"),addresses:ge.Array(ms({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),ge.Object({type:ge.Literal("grafana-irm"),integrationId:ms({description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),ge.Object({type:ge.Literal("microsoft-teams"),integrationId:ms({description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),ge.Object({type:ge.Literal("webhook"),integrationId:ms({description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),ge.Object({type:ge.Literal("servicenow"),integrationId:ms({description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),ge.Object({type:ge.Literal("google-chat"),integrationId:ms({description:"Identifier of the Google Chat integration to use"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Google Chat message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Google Chat message"}))},{$id:"RuleTargetInputGoogleChat"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:SU}),wF=ge.Object({id:ge.String({description:"Identifier of the notification target"}),rateLimit:xU,renotifyConfig:SU,config:Xf("type",[ge.Object({type:ge.Literal("slack"),channel:ge.String({description:"Slack channel ID that receives the notification"}),integrationId:ge.String({description:"Slack workspace ID that receives the notification"}),integrationName:ge.String({description:"Human readable name of the Slack integration"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Slack message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Slack message"}))},{$id:"RuleTargetConfigSlack"}),ge.Object({type:ge.Literal("incident-io"),integrationId:ge.String({description:"Identifier of the incident.io integration to use"}),integrationName:ge.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),ge.Object({type:ge.Literal("email"),addresses:ge.Array(ge.String({format:"email"}),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),ge.Object({type:ge.Literal("grafana-irm"),integrationId:ge.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:ge.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),ge.Object({type:ge.Literal("pagerduty"),integrationId:ge.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:ge.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),ge.Object({type:ge.Literal("microsoft-teams"),integrationId:ge.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:ge.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),ge.Object({type:ge.Literal("webhook"),integrationId:ge.String({description:"Identifier of the webhook integration to use"}),integrationName:ge.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),ge.Object({type:ge.Literal("servicenow"),integrationId:ge.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:ge.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),ge.Object({type:ge.Literal("google-chat"),integrationId:ge.String({description:"Identifier of the Google Chat integration to use"}),integrationName:ge.String({description:"Human readable name of the Google Chat integration"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Google Chat message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Google Chat message"}))},{$id:"RuleTargetConfigGoogleChat"})],{description:"Configuration describing how the alert was delivered"})}),rT=Xf("type",[ge.Object({type:ge.Literal("specific-teams"),teams:ge.Array(ms(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),ge.Object({type:ge.Literal("all-teams")}),ge.Object({type:ge.Literal("all-public-teams")})]),vE=ge.Object({name:ms({description:"Display name of the notification rule"}),queryString:ge.Optional(ms({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:rT,prioritiesFilter:ge.Array(ge.Enum(YC),{maxItems:YC.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{maxItems:iL.length,description:"Alert state transitions that can trigger a notification"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:iv,isActive:ge.Boolean(),targets:ge.Array(EF,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),nT=Xf("type",[ge.Object({type:ge.Literal("specific-teams"),teams:ge.Array(ge.String(),{description:"Team IDs to select"})}),ge.Object({type:ge.Literal("all-teams")}),ge.Object({type:ge.Literal("all-public-teams")})]),nh=ge.Object({id:ge.String({description:"Identifier of the notification rule"}),name:ge.String({description:"Display name of the notification rule"}),queryString:ge.Optional(ge.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:nT,prioritiesFilter:ge.Array(ge.Enum(YC),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{description:"Alert state transitions that can trigger a notification"}),owner:ge.String({description:"Team ID that owns and manages the rule"}),createdAt:jl(),updatedAt:jl(),isActive:ge.Boolean(),tags:iv,targets:ge.Array(wF,{description:"Notification targets that can receive notifications when the rule matches"}),creator:ge.Optional(wv),updater:ge.Optional(wv)}),pge=ao({tags:["notification-rules"],url:lL,method:"GET",response:ge.Array(nh)}),mge=ao({tags:["notification-rules"],url:`${lL}/:id`,params:ge.Object({id:ms()}),method:"GET",response:nh}),dge=ao({tags:["notification-rules"],url:lL,method:"POST",body:vE,response:nh}),bge=ao({tags:["notification-rules"],url:`${lL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:vE,response:nh}),vge=ao({tags:["notification-rules"],url:`${lL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),Cge=ao({tags:["notification-integrations"],url:`${_U}/start`,method:"POST",response:ge.Object({redirectUrl:ge.String()})}),AF=ge.Object({id:ge.String(),name:ge.String(),type:ge.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat"]),createdAt:jl(),ruleCount:ge.Number(),creator:ge.Optional(wv)}),yge=ao({tags:["notification-integrations"],url:`${lL}/integrations`,method:"GET",response:ge.Array(AF)}),Lge=ao({tags:["notification-integrations"],url:`${_U}/callback`,method:"GET",query:ge.Object({code:ms()}),response:ge.Object({success:ge.Boolean()})}),sT=["POST","PUT"],gF=ge.Record(ge.String(),ge.String()),TF=ge.Record(ge.String(),ge.Unknown()),IF=ge.Record(ge.String(),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))])),_F=Xf("type",[ge.Object({type:ge.Literal("json"),value:TF}),ge.Object({type:ge.Literal("form"),value:IF})]),xF=ge.Object({ok:ge.String(),alert:ge.String()}),oT=ge.Object({id:ge.String(),name:ge.String(),setting:Xf("type",[ge.Object({type:ge.Literal("incident-io"),alertSourceConfigId:ge.String(),tokenLastChars:ge.String()}),ge.Object({type:ge.Literal("grafana-irm"),urlLastChars:ge.String()}),ge.Object({type:ge.Literal("pagerduty"),integrationKeyLastChars:ge.String()}),ge.Object({type:ge.Literal("microsoft-teams"),webhookUrlLastChars:ge.String()}),ge.Object({type:ge.Literal("webhook"),urlLastChars:ge.String(),method:ge.Enum(sT),authentication:Xf("type",[ge.Object({type:ge.Literal("bearer"),tokenLastChars:ge.String()}),ge.Object({type:ge.Literal("basic"),username:ge.String(),passwordLastChars:ge.String()}),ge.Object({type:ge.Literal("custom-header"),key:ge.String(),valueLastChars:ge.String()}),ge.Object({type:ge.Literal("none")})]),customHeaders:ge.Optional(gF),payloadTemplate:_F,eventNameMapping:ge.Optional(xF)}),ge.Object({type:ge.Literal("servicenow"),instanceName:ge.String(),username:ge.String(),passwordLastChars:ge.String()}),ge.Object({type:ge.Literal("google-chat"),webhookUrlLastChars:ge.String()})]),tags:iv}),SF=ge.Object({type:ge.Literal("webhook"),url:ms({type:"uri"}),method:ge.Enum(sT),authentication:Xf("type",[ge.Object({type:ge.Literal("bearer"),token:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("basic"),username:ms({allowEmpty:!1}),password:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("custom-header"),key:ms({allowEmpty:!1}),value:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("none")})]),customHeaders:ge.Record(ms({allowEmpty:!1}),ms()),payloadTemplate:Xf("type",[ge.Object({type:ge.Literal("json"),value:ge.Record(ms({allowEmpty:!1}),ge.Unknown())}),ge.Object({type:ge.Literal("form"),value:ge.Record(ms({allowEmpty:!1}),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))]))})]),eventNameMapping:ge.Optional(ge.Object({ok:ms({allowEmpty:!1}),alert:ms({allowEmpty:!1})}))}),OU=ge.Object({type:ge.Literal("incident-io"),alertSourceConfigId:ms(),token:ms()}),RU=ge.Object({type:ge.Literal("grafana-irm"),url:ms({type:"uri"})}),NU=ge.Object({type:ge.Literal("pagerduty"),integrationKey:ms()}),kU=ge.Object({type:ge.Literal("microsoft-teams"),webhookUrl:ms({type:"uri"})}),OF=ge.Object({type:ge.Literal("servicenow"),instanceName:ms({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:ms({allowEmpty:!1}),password:ms({allowEmpty:!1})}),RF=ge.Object({type:ge.Literal("google-chat"),webhookUrl:ms({type:"uri"})}),NF=ge.Object({name:ms(),setting:Xf("type",[OU,RU,NU,kU,SF,OF,RF]),tags:iv}),kF=ge.Object({type:ge.Literal("webhook"),url:ge.Optional(ms({type:"uri"})),method:ge.Optional(ge.Enum(sT)),authentication:ge.Optional(Xf("type",[ge.Object({type:ge.Literal("bearer"),token:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("basic"),username:ge.Optional(ms({allowEmpty:!1})),password:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("custom-header"),key:ge.Optional(ms({allowEmpty:!1})),value:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("none")})])),customHeaders:ge.Optional(ge.Record(ms({allowEmpty:!1}),ms())),payloadTemplate:ge.Optional(Xf("type",[ge.Object({type:ge.Literal("json"),value:ge.Record(ms({allowEmpty:!1}),ge.Unknown())}),ge.Object({type:ge.Literal("form"),value:ge.Record(ms({allowEmpty:!1}),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))]))})])),eventNameMapping:ge.Optional(ge.Object({ok:ge.Optional(ms({allowEmpty:!1})),alert:ge.Optional(ms({allowEmpty:!1}))}))}),UF=ge.Object({type:ge.Literal("servicenow"),instanceName:ge.Optional(ms({allowEmpty:!1})),username:ge.Optional(ms({allowEmpty:!1})),password:ge.Optional(ms({allowEmpty:!1}))}),MF=ge.Object({type:ge.Literal("google-chat"),webhookUrl:ms({type:"uri"})}),PF=ge.Object({name:ge.Optional(ms()),setting:ge.Optional(Xf("type",[OU,RU,NU,kU,kF,UF,MF]))}),hge=ao({tags:["notification-integrations"],url:uA,method:"POST",body:NF,response:oT}),Ege=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"GET",params:ge.Object({id:ms()}),response:oT}),wge=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:PF,response:oT}),Age=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),gge=ao({tags:["notification-rules"],url:`${KC}/:id/notifications`,method:"GET",params:ge.Object({id:ms()}),query:ge.Optional(ge.Object({from:ge.Optional(ge.Number()),to:ge.Optional(ge.Number())})),response:ge.Object({notifications:ge.Array(ge.Object({id:ge.String(),monitorId:ge.String(),monitorResultId:ge.String(),ruleId:ge.Optional(ge.String()),targetId:ge.Optional(ge.String()),status:ge.Enum(hF),tryCount:ge.Number(),nextTryAt:jl(),createdAt:jl(),updatedAt:jl(),sentAt:ge.Optional(jl())})),isTruncated:ge.Boolean()})}),DF=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat"],Tge=ao({tags:["notification-rules"],url:`${lL}/test`,method:"POST",body:ge.Object({notificationRule:vE,targetIds:ge.Optional(ge.Array(ms({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:Xf("success",[ge.Object({success:ge.Literal(!1),overallMessage:ge.String({description:"Message when there is an overall error"})}),ge.Object({success:ge.Boolean(),results:ge.Array(ge.Object({targetId:ge.String({description:"The ID of the target that was tested"}),targetType:ge.Enum(DF,{description:"The type of the target (e.g., slack, webhook)"}),status:ge.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:ge.Optional(ge.String({description:"Message if the notification failed for this specific target"}))}))})])});var CE=`/${"v1"}/notification-rules`,yE=ge.Pick(nh,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),$F={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],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(yE,{examples:[$F]});var UU=ao({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:CE,method:"GET",response:ge.Array(yE)}),MU=ao({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:yE}),aT=ge.Pick(vE,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","owner","tags","isActive","targets"]),GF={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],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(aT,{examples:[GF]});var PU=ao({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:CE,method:"POST",body:aT,response:yE}),DU=ao({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:aT,response:yE}),$U=ao({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var LE=`${bE}/silences`,FF=ge.Partial(ge.Record(ge.Union([ge.Literal("monday"),ge.Literal("tuesday"),ge.Literal("wednesday"),ge.Literal("thursday"),ge.Literal("friday"),ge.Literal("saturday"),ge.Literal("sunday")]),ge.Array(ge.Object({startTime:ge.String({format:"time"}),endTime:ge.String({format:"time"})}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),GU=Xf("type",[ge.Object({type:ge.Literal("one-time"),startTime:ge.String({format:"date-time"}),endTime:ge.String({format:"date-time"})},{description:"One-time silence schedule with specific start and end times"}),ge.Object({type:ge.Literal("recurring"),weeklySchedule:FF},{description:"Recurring weekly silence schedule"})],{description:"Schedule defining when the silence is active"}),iA=ge.Object({name:ms({description:"Display name of the silence"}),reason:ms({allowEmpty:!1,description:"Reason for the silence"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:iv,isActive:ge.Boolean({description:"Whether the silence is currently enabled"}),schedule:GU,notificationRuleIds:ge.Optional(ge.Array(ms(),{description:"Notification rule IDs this silence applies to"})),queryString:ge.Optional(ms({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:rT,prioritiesFilter:ge.Array(ge.Enum(YC),{maxItems:YC.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{maxItems:iL.length,description:"Transition types to filter which alerts this silence applies to"})}),sh=ge.Object({id:ge.String({description:"Unique identifier of the silence"}),name:ge.String({description:"Display name of the silence"}),reason:ge.String({description:"Reason for the silence"}),owner:ge.String({description:"Team ID that owns and manages the silence"}),tags:iv,isActive:ge.Boolean({description:"Whether the silence is currently enabled"}),schedule:GU,notificationRuleIds:ge.Optional(ge.Array(ge.String(),{description:"Notification rule IDs this silence applies to"})),queryString:ge.Optional(ge.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:nT,prioritiesFilter:ge.Array(ge.Enum(YC),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:jl(),updatedAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv)}),Kge=ao({tags:["notification-silences"],url:LE,method:"GET",response:ge.Array(sh)}),Yge=ao({tags:["notification-silences"],url:`${LE}/:id`,params:ge.Object({id:ms()}),method:"GET",response:sh}),zge=ao({tags:["notification-silences"],url:LE,method:"POST",body:iA,response:sh}),Vge=ao({tags:["notification-silences"],url:`${LE}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:iA,response:sh}),Wge=ao({tags:["notification-silences"],url:`${LE}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var hE=`/${"v1"}/notification-silences`,lA=ge.Pick(sh,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),FU=ao({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:hE,method:"GET",response:ge.Array(lA)}),jU=ao({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:lA}),BU=ge.Pick(iA,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),HU=ao({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:hE,method:"POST",body:BU,response:lA}),qU=ao({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:BU,response:lA}),KU=ao({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var EE="/v0/admin-center";var zC=`${EE}/retention-policies`,uT=["1-day","3-days","15-days","30-days","60-days","90-days","120-days","180-days","360-days","10-years"],ay=ge.Object({id:ge.String(),env:ge.Optional(ge.String()),teamId:ge.Optional(ge.String()),dataSource:ge.Enum(qC),durationDays:ge.Enum(uT),isEnabled:ge.Boolean(),createdAt:jl(),updatedAt:jl()}),cA=ge.Object({env:ge.Optional(ms()),teamId:ge.Optional(ms()),dataSource:ge.Enum(qC),durationDays:ge.Enum(uT),isEnabled:ge.Boolean()}),YU=ge.Array(ge.Object({env:ms(),dataSource:ge.Enum(qC),durationDays:ge.Enum([...uT,"default"]),isEnabled:ge.Boolean()})),zU=ge.Object({inserted:ge.Array(ay),updated:ge.Array(ay),deleted:ge.Array(ay)}),dTe=ao({tags:["retention-policies"],url:zC,method:"POST",body:cA,response:ay}),bTe=ao({tags:["retention-policies"],url:zC,method:"GET",response:ge.Array(ay)}),vTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"GET",params:ge.Object({id:ms()}),response:ay}),CTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:cA,response:ay}),yTe=ao({tags:["retention-policies"],url:`${zC}/bulk-update`,method:"POST",body:YU,response:zU}),LTe=ao({tags:["retention-policies"],url:`${zC}/bulk-update-for-team`,method:"POST",body:ge.Object({teamId:ms(),policies:YU}),response:zU}),hTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),wE=["past-24-hours","past-7-days","past-30-days"],ETe=ao({tags:["retention-policies"],url:`${zC}/requested-history-percentile/:teamId`,method:"POST",params:ge.Object({teamId:ms()}),body:ge.Object({percentile:ge.Number({minimum:0,maximum:1}),observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC)}),response:ge.Object({percentile:ge.Number({minimum:0,maximum:1}),observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC),teamId:ge.String(),requestedHistoryDays:ge.Number()})}),jF=["1-day","3-days","7-days","1-month","more-than-1-month"];var BF=ge.Array(ge.Object({bucket:ge.Enum(jF),count:ge.Number()})),wTe=ao({tags:["retention-policies"],url:`${zC}/requested-history-histogram/:teamId`,method:"POST",params:ge.Object({teamId:ms()}),body:ge.Object({observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC)}),response:ge.Object({observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC),teamId:ge.String(),histogram:BF})}),ATe=ao({tags:["retention-policies"],url:`${zC}/top-teams-with-retention-surplus`,method:"POST",body:ge.Object({dataSource:ge.Enum(qC),observationWindow:ge.Enum(wE),percentile:ge.Number({minimum:0,maximum:1}),topN:ge.Optional(ge.Number({minimum:1,maximum:20}))}),response:ge.Array(ge.Object({teamId:ge.String(),retentionSurplusDays:ge.Number()}))});var AE=`/${"v1"}/retention-policies`,gE=ge.Pick(ay,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),HF={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:"30-days",isEnabled:!0};Object.assign(gE,{examples:[HF]});var VU=ao({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:AE,method:"GET",response:ge.Array(gE)}),WU=ao({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:gE}),iT=ge.Pick(cA,["env","teamId","dataSource","durationDays","isEnabled"]),qF={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:"30-days",isEnabled:!0};Object.assign(iT,{examples:[qF]});var XU=ao({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:AE,method:"POST",body:iT,response:gE}),ZU=ao({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:iT,response:gE}),QU=ao({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var KF=ge.Object({manual:ge.Boolean()}),fA={id:ms({allowEmpty:!1,description:"Identifier of the processor"}),description:ge.Optional(ms({type:"long"})),example:ge.Optional(KF),tags:iv,updatedAt:ge.Optional(jl())},YF={...fA,type:ge.Literal("creator")},zF=Xf("subtype",[ge.Object({targetAttribute:ms({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:ms({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:ge.Optional(ge.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:ge.Literal("format-string"),replaceMissingByEmpty:ge.Optional(ge.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),ge.Object({targetAttribute:ms({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:ms({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:ge.Optional(ge.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:ge.Literal("math-formula"),replaceMissingBy0:ge.Optional(ge.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),VF=ge.Object({...YF,params:zF}),WF={...fA,type:ge.Literal("mapper")},XF=Xf("subtype",[ge.Object({attributes:ge.Array(ge.Object({originAttribute:ms({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:ge.Optional(ge.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:ge.Optional(ge.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:ms({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:ge.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:ge.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:ge.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),ZF=ge.Object({...WF,params:XF}),QF={...fA,type:ge.Literal("parse-attribute")},JF=5,ej=Xf("subtype",[ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:ge.Array(ms({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:ge.Optional(ge.Array(ms({type:"long"}),{maxItems:JF,description:"Example log lines for validation"})),subtype:ge.Literal("grok")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:ge.Literal("url")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:ge.Literal("user-agent")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:ms({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:ms({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:ms({allowEmpty:!1,description:"Delimiter separating each key/value pair"}),acceptStandaloneKey:ge.Boolean(),subtype:ge.Literal("key-value")})]),tj=ge.Object({...QF,params:ej}),rj=11,lT=ge.Cyclic({Processor:ge.Union([ZF,tj,VF,ge.Object({...fA,params:ge.Object({items:ge.Array(ge.Object({query:ms({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:ge.Array(ge.Ref("Processor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:rj,description:"Conditional branches evaluated in order before falling back to the default"})}),type:ge.Literal("split")})])},"Processor",{description:"Processing step executed sequentially on route logs"});var nj="/v0/logs",$y=`${nj}/routes`,cL=ge.Object({id:ge.String({description:"Identifier of the log route"}),name:ge.String({description:"Human readable name shown for the route"}),description:ge.Optional(ge.String()),isEnabled:ge.Boolean(),query:ge.String({description:"Query that selects which logs should enter the route"}),rank:ge.Number(),tags:iv,owner:ge.String({description:"Team ID owning and managing the route"}),processors:ge.Array(lT,{description:"Ordered processors applied to logs that match the route"}),creator:ge.Optional(wv),updater:ge.Optional(wv),updatedAt:jl(),createdAt:jl(),assetUpdatedAt:jl(),lastSyncedAt:ge.Optional(jl())},{title:"Route"}),TE=ge.Object({name:ms({allowEmpty:!1,description:"Human readable name shown for the route"}),description:ge.Optional(ms({type:"long"})),isEnabled:ge.Boolean(),query:ms({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:iv,owner:ms({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:ge.Array(lT,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),VTe=ao({tags:["routes"],url:$y,method:"GET",response:ge.Array(cL)}),WTe=ao({tags:["routes"],url:`${$y}/:id`,params:ge.Object({id:ms()}),method:"GET",response:cL}),XTe=ao({tags:["routes"],url:$y,method:"POST",body:TE,response:cL}),ZTe=ao({tags:["routes"],url:`${$y}/:id`,method:"PUT",body:TE,params:ge.Object({id:ms()}),response:cL}),QTe=ao({tags:["routes"],url:`${$y}/:id/clone`,method:"POST",params:ge.Object({id:ms()}),body:TE,response:cL}),JTe=ao({tags:["routes"],url:`${$y}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),eIe=ao({tags:["routes"],url:`${$y}/:id/modify-ranking`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Object({rank:ge.Number()}),response:ge.Object({})}),tIe=ao({tags:["routes"],url:`${$y}/:id/enable`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Object({enable:ge.Boolean()}),response:ge.Object({})});var IE=`/${"v1"}/routes`,_E=ge.Pick(cL,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),sj={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(_E,{examples:[sj]});var JU=ao({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:IE,method:"GET",response:ge.Array(_E)}),e4=ao({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${IE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:_E}),cT=ge.Pick(TE,["name","description","isEnabled","query","tags","owner","processors"]),oj={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(cT,{examples:[oj]});var t4=ao({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:IE,method:"POST",body:cT,response:_E}),r4=ao({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${IE}/:id`,method:"PUT",body:cT,params:ge.Object({id:ms({allowEmpty:!1})}),response:_E}),n4=ao({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${IE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var fL=`${EE}/tag-policies`;var s4=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence"],aj=["logs","metrics","traces"],o4=ge.Array(ge.Enum(s4)),a4=ge.Array(ge.Enum(aj)),uj=ge.Union([o4,a4]),u4=ge.Object({teamIds:ge.Array(ms(),{minItems:1,maxItems:100}),mode:ge.Enum(["include","exclude"])}),i4=Xf("type",[ge.Object({type:ge.Literal("telemetry"),assetTypes:a4,shouldInsertWarning:ge.Boolean(),dropSample:ge.Optional(ge.Number({minimum:0,maximum:100}))}),ge.Object({type:ge.Literal("tsuga_asset"),assetTypes:o4})]),oh=ge.Object({id:ge.String(),name:ge.String(),description:ge.Optional(ge.String()),isActive:ge.Boolean(),tagKey:ge.String(),allowedTagValues:ge.Array(ge.String()),isRequired:ge.Boolean(),teamScope:ge.Optional(u4),configuration:i4,creator:ge.Optional(wv),updater:ge.Optional(wv),owner:ge.Optional(ge.String()),createdAt:jl(),updatedAt:jl(),assetUpdatedAt:jl()});var xE=ge.Object({name:ms(),description:ge.Optional(ms()),isActive:ge.Boolean(),tagKey:ms({allowEmpty:!1}),allowedTagValues:ge.Array(ms({allowEmpty:!1}),{maxItems:100}),isRequired:ge.Boolean(),teamScope:ge.Optional(u4),configuration:i4,owner:ms({allowEmpty:!1})}),LIe=ao({tags:["tag-policies"],url:fL,method:"GET",query:ge.Object({teamIds:ge.Optional(ge.Array(ms(),{maxItems:100})),assetTypes:ge.Optional(uj),searchQuery:ge.Optional(ms())}),response:ge.Array(oh)}),hIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"GET",params:ge.Object({id:ms()}),response:oh}),EIe=ao({tags:["tag-policies"],url:fL,method:"POST",body:xE,response:oh}),wIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:xE,response:oh}),AIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),gIe=ao({tags:["tag-policies"],url:`${EE}/applicable-tag-rules`,method:"GET",query:ge.Object({assetType:ge.Enum(s4),teamId:ms()}),response:ge.Array(ge.Object({tagKey:ge.String(),allowedTagValues:ge.Array(ge.String()),isRequired:ge.Boolean()}))}),l4=ge.Object({total:ge.Number(),totalNonCompliant:ge.Number(),idsNonCompliant:ge.Array(ms())}),c4=ge.Union([ge.Literal("ingestion-api-key"),ge.Literal("operation-api-key"),ge.Literal("dashboard"),ge.Literal("log-route"),ge.Literal("monitor"),ge.Literal("notification-rule"),ge.Literal("notification-silence")]),ij=ge.Object({total:ge.Number(),totalNonCompliant:ge.Number(),byAssetType:ge.Record(c4,l4)}),lj=ge.Omit(l4,["total"]),cj=ge.Object({totalNonCompliant:ge.Number(),byAssetType:ge.Record(c4,lj)}),f4=ge.Object({totals:ij,byTeam:ge.Record(ge.String(),cj)}),TIe=ao({tags:["tag-policies"],url:`${fL}/:id/stats`,method:"GET",params:ge.Object({id:ms()}),response:f4}),IIe=ao({tags:["tag-policies"],url:`${fL}/new-policy-stats`,method:"POST",body:xE,response:f4});var SE=`/${"v1"}/tag-policies`,pA=ge.Pick(oh,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),p4=ge.Pick(xE,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),m4=ao({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:SE,method:"GET",response:ge.Array(pA)}),d4=ao({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:pA}),b4=ao({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:SE,method:"POST",body:p4,response:pA}),v4=ao({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:p4,response:pA}),C4=ao({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var OE=`/${"v1"}/teams`,RE=ge.Pick(eh,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),fj={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(RE,{examples:[fj]});var y4=ao({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:OE,method:"GET",response:ge.Array(RE)}),L4=ao({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${OE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:RE}),fT=ge.Pick(Zw,["name","description","visibility","tags"]),pj={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(fT,{examples:[pj]});var h4=ao({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:OE,method:"POST",body:fT,response:RE}),E4=ao({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${OE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:fT,response:RE}),w4=ao({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${OE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});function mj(f){return It.IsObject(f)&&It.HasPropertyKey(f,"check")&&It.HasPropertyKey(f,"errors")&&It.IsFunction(f.check)&&It.IsFunction(f.errors)}function pT(f){return It.HasPropertyKey(f,"~guard")&&mj(f["~guard"])}function mT(f){return It.HasPropertyKey(f,"~refine")&&It.IsArray(f["~refine"])&&It.Every(f["~refine"],0,m=>It.IsObject(m)&&It.HasPropertyKey(m,"refine")&&It.HasPropertyKey(m,"message")&&It.IsFunction(m.refine)&&It.IsString(m.message))}function uy(f){return It.IsObject(f)&&!It.IsArray(f)}function mA(f){return It.IsBoolean(f)}function mc(f){return uy(f)||mA(f)}function dT(f){return It.HasPropertyKey(f,"additionalItems")&&mc(f.additionalItems)}function iy(f){return It.HasPropertyKey(f,"additionalProperties")&&mc(f.additionalProperties)}function bT(f){return It.HasPropertyKey(f,"allOf")&&It.IsArray(f.allOf)&&f.allOf.every(m=>mc(m))}function NE(f){return It.HasPropertyKey(f,"$anchor")&&It.IsString(f.$anchor)}function vT(f){return It.HasPropertyKey(f,"anyOf")&&It.IsArray(f.anyOf)&&f.anyOf.every(m=>mc(m))}function CT(f){return It.HasPropertyKey(f,"const")}function pL(f){return It.HasPropertyKey(f,"contains")&&mc(f.contains)}function yC(f){return It.HasPropertyKey(f,"default")}function yT(f){return It.HasPropertyKey(f,"dependencies")&&It.IsObject(f.dependencies)&&Object.values(f.dependencies).every(m=>mc(m)||It.IsArray(m)&&m.every(L=>It.IsString(L)))}function LT(f){return It.HasPropertyKey(f,"dependentRequired")&&It.IsObject(f.dependentRequired)&&Object.values(f.dependentRequired).every(m=>It.IsArray(m)&&m.every(L=>It.IsString(L)))}function hT(f){return It.HasPropertyKey(f,"dependentSchemas")&&It.IsObject(f.dependentSchemas)&&Object.values(f.dependentSchemas).every(m=>mc(m))}function ET(f){return It.HasPropertyKey(f,"$dynamicAnchor")&&It.IsString(f.$dynamicAnchor)}function wT(f){return It.HasPropertyKey(f,"else")&&mc(f.else)}function AT(f){return It.HasPropertyKey(f,"enum")&&It.IsArray(f.enum)}function gT(f){return It.HasPropertyKey(f,"exclusiveMaximum")&&(It.IsNumber(f.exclusiveMaximum)||It.IsBigInt(f.exclusiveMaximum))}function ly(f){return It.HasPropertyKey(f,"exclusiveMinimum")&&(It.IsNumber(f.exclusiveMinimum)||It.IsBigInt(f.exclusiveMinimum))}function kE(f){return It.HasPropertyKey(f,"format")&&It.IsString(f.format)}function mL(f){return It.HasPropertyKey(f,"$id")&&It.IsString(f.$id)}function TT(f){return It.HasPropertyKey(f,"if")&&mc(f.if)}function ah(f){return It.HasPropertyKey(f,"items")&&(mc(f.items)||It.IsArray(f.items)&&f.items.every(m=>mc(m)))}function IT(f){return ah(f)&&It.IsArray(f.items)}function _T(f){return It.HasPropertyKey(f,"maximum")&&(It.IsNumber(f.maximum)||It.IsBigInt(f.maximum))}function xT(f){return It.HasPropertyKey(f,"maxContains")&&It.IsNumber(f.maxContains)}function dA(f){return It.HasPropertyKey(f,"maxItems")&&It.IsNumber(f.maxItems)}function ST(f){return It.HasPropertyKey(f,"maxLength")&&It.IsNumber(f.maxLength)}function OT(f){return It.HasPropertyKey(f,"maxProperties")&&It.IsNumber(f.maxProperties)}function cy(f){return It.HasPropertyKey(f,"minimum")&&(It.IsNumber(f.minimum)||It.IsBigInt(f.minimum))}function dL(f){return It.HasPropertyKey(f,"minContains")&&It.IsNumber(f.minContains)}function uh(f){return It.HasPropertyKey(f,"minItems")&&It.IsNumber(f.minItems)}function UE(f){return It.HasPropertyKey(f,"minLength")&&It.IsNumber(f.minLength)}function ME(f){return It.HasPropertyKey(f,"minProperties")&&It.IsNumber(f.minProperties)}function RT(f){return It.HasPropertyKey(f,"multipleOf")&&(It.IsNumber(f.multipleOf)||It.IsBigInt(f.multipleOf))}function NT(f){return It.HasPropertyKey(f,"not")&&mc(f.not)}function kT(f){return It.HasPropertyKey(f,"oneOf")&&It.IsArray(f.oneOf)&&f.oneOf.every(m=>mc(m))}function PE(f){return It.HasPropertyKey(f,"pattern")&&(It.IsString(f.pattern)||f.pattern instanceof RegExp)}function DE(f){return It.HasPropertyKey(f,"patternProperties")&&It.IsObject(f.patternProperties)&&Object.values(f.patternProperties).every(m=>mc(m))}function ih(f){return It.HasPropertyKey(f,"prefixItems")&&It.IsArray(f.prefixItems)&&f.prefixItems.every(m=>mc(m))}function $E(f){return It.HasPropertyKey(f,"properties")&&It.IsObject(f.properties)&&Object.values(f.properties).every(m=>mc(m))}function UT(f){return It.HasPropertyKey(f,"propertyNames")&&(It.IsObject(f.propertyNames)||mc(f.propertyNames))}function dj(f){return It.HasPropertyKey(f,"$recursiveAnchor")&&It.IsBoolean(f.$recursiveAnchor)}function bA(f){return dj(f)&&It.IsEqual(f.$recursiveAnchor,!0)}function MT(f){return It.HasPropertyKey(f,"$recursiveRef")&&It.IsString(f.$recursiveRef)}function PT(f){return It.HasPropertyKey(f,"$ref")&&It.IsString(f.$ref)}function bL(f){return It.HasPropertyKey(f,"required")&&It.IsArray(f.required)&&f.required.every(m=>It.IsString(m))}function DT(f){return It.HasPropertyKey(f,"then")&&mc(f.then)}function $T(f){return It.HasPropertyKey(f,"type")&&(It.IsString(f.type)||It.IsArray(f.type)&&f.type.every(m=>It.IsString(m)))}function lh(f){return It.HasPropertyKey(f,"uniqueItems")&&It.IsBoolean(f.uniqueItems)}function vA(f){return It.HasPropertyKey(f,"unevaluatedItems")&&mc(f.unevaluatedItems)}function CA(f){return It.HasPropertyKey(f,"unevaluatedProperties")&&mc(f.unevaluatedProperties)}var Qv=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(m){return this.indices.add(m),!0}AddKey(m){return this.keys.add(m),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(m){for(let L of m)L.indices.forEach(ne=>this.indices.add(ne)),L.keys.forEach(ne=>this.keys.add(ne));return!0}},GE=class extends Qv{constructor(m){super(),this.callback=m}AddError(m){return this.callback(m),!1}},Rv=class extends GE{constructor(){super(m=>this.errors.push(m)),this.errors=[]}AddError(m){return this.errors.push(m),!1}GetErrors(){return this.errors}};var bj="external_",vj=0,pOe={identifier:`${bj}${vj}`,variables:[]};function A4(f,m,L,ne){return L["~guard"].check(ne)}function g4(f,m,L,ne,Ue,t){return Ue["~guard"].check(t)||m.AddError({keyword:"~guard",schemaPath:L,instancePath:ne,params:{errors:Ue["~guard"].errors(t)}})}function T4(f,m,L,ne){return It.Every(L["~refine"],0,(Ue,t)=>Ue.refine(ne))}function I4(f,m,L,ne,Ue,t){return It.EveryAll(Ue["~refine"],0,(or,Fr)=>or.refine(t)||m.AddError({keyword:"~refine",schemaPath:L,instancePath:ne,params:{index:Fr,message:or.message}}))}function _4(f){return ah(f)&&It.IsArray(f.items)}function x4(f,m,L,ne){return _4(L)?ne.every((t,or)=>It.IsLessThan(or,L.items.length)||Bl(f,m,L.additionalItems,t)&&m.AddIndex(or)):!0}function S4(f,m,L,ne,Ue,t){return _4(Ue)?t.every((Fr,e)=>{let Yn=`${L}/additionalItems`,Vn=`${ne}/${e}`;return It.IsLessThan(e,Ue.items.length)||Dp(f,m,Yn,Vn,Ue.additionalItems,Fr)&&m.AddIndex(e)}):!0}function Cj(f){return`^${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function O4(f){let m=[];return DE(f)&&m.push(...It.Keys(f.patternProperties)),$E(f)&&m.push(...It.Keys(f.properties).map(Cj)),It.IsEqual(m.length,0)?"(?!)":`(${m.join("|")})`}function R4(f,m,L,ne){let Ue=new RegExp(O4(L));return It.Every(It.Keys(ne),0,(or,Fr)=>Ue.test(or)||Bl(f,m,L.additionalProperties,ne[or])&&m.AddKey(or))}function N4(f,m,L,ne,Ue,t){let or=new RegExp(O4(Ue)),Fr=[];return It.EveryAll(It.Keys(t),0,(Yn,Vn)=>{let Br=`${L}/additionalProperties`,Xr=`${ne}/${Yn}`,gs=new Rv,Yo=or.test(Yn)||Dp(f,gs,Br,Xr,Ue.additionalProperties,t[Yn])&&m.AddKey(Yn);return Yo||Fr.push(Yn),Yo})||m.AddError({keyword:"additionalProperties",schemaPath:L,instancePath:ne,params:{additionalProperties:Fr}})}function k4(f,m,L,ne){let Ue=L.allOf.reduce((t,or)=>{let Fr=new Qv;return Bl(f,Fr,or,ne)?[...t,Fr]:t},[]);return It.IsEqual(Ue.length,L.allOf.length)&&m.Merge(Ue)}function U4(f,m,L,ne,Ue,t){let or=[],Fr=Ue.allOf.reduce((Yn,Vn,Br)=>{let Xr=`${L}/allOf/${Br}`,gs=new Rv,Yo=Dp(f,gs,Xr,ne,Vn,t);return Yo||or.push(gs),Yo?[...Yn,gs]:Yn},[]),e=It.IsEqual(Fr.length,Ue.allOf.length)&&m.Merge(Fr);return e||or.forEach(Yn=>Yn.GetErrors().forEach(Vn=>m.AddError(Vn))),e}function M4(f,m,L,ne){let Ue=L.anyOf.reduce((t,or,Fr)=>{let e=new Qv;return Bl(f,e,or,ne)?[...t,e]:t},[]);return It.IsGreaterThan(Ue.length,0)&&m.Merge(Ue)}function P4(f,m,L,ne,Ue,t){let or=[],Fr=Ue.anyOf.reduce((Yn,Vn,Br)=>{let Xr=new Rv,gs=`${L}/anyOf/${Br}`,Yo=Dp(f,Xr,gs,ne,Vn,t);return Yo||or.push(Xr),Yo?[...Yn,Xr]:Yn},[]),e=It.IsGreaterThan(Fr.length,0)&&m.Merge(Fr);return e||or.forEach(Yn=>Yn.GetErrors().forEach(Vn=>m.AddError(Vn))),e||m.AddError({keyword:"anyOf",schemaPath:L,instancePath:ne,params:{}})}function FT(f,m,L,ne){return L}function D4(f,m,L,ne,Ue,t){return FT(f,m,Ue,t)||m.AddError({keyword:"boolean",schemaPath:L,instancePath:ne,params:{}})}function jT(f,m,L,ne){return It.IsValueLike(L.const)?It.IsEqual(ne,L.const):It.IsDeepEqual(ne,L.const)}function $4(f,m,L,ne,Ue,t){return jT(f,m,Ue,t)||m.AddError({keyword:"const",schemaPath:L,instancePath:ne,params:{allowedValue:Ue.const}})}function yj(f){return!(dL(f)&&It.IsEqual(f.minContains,0))}function BT(f,m,L,ne){return yj(L)?!It.IsEqual(ne.length,0)&&ne.some(Ue=>Bl(f,m,L.contains,Ue)):!0}function G4(f,m,L,ne,Ue,t){return BT(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:1}})}function F4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependencies),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||(It.IsArray(Fr)?Fr.every(e=>It.HasPropertyKey(ne,e)):Bl(f,m,Fr,ne)));return Ue||t}function j4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependencies),0,([e,Yn])=>{let Vn=`${L}/dependencies/${e}`;return!It.HasPropertyKey(t,e)||(It.IsArray(Yn)?Yn.every(Br=>It.HasPropertyKey(t,Br)||m.AddError({keyword:"dependencies",schemaPath:L,instancePath:ne,params:{property:e,dependencies:Yn}})):Dp(f,m,Vn,ne,Yn,t))});return or||Fr}function B4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependentRequired),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||Fr.every(e=>It.HasPropertyKey(ne,e)));return Ue||t}function H4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependentRequired),0,([e,Yn])=>!It.HasPropertyKey(t,e)||It.EveryAll(Yn,0,Vn=>It.HasPropertyKey(t,Vn)||m.AddError({keyword:"dependentRequired",schemaPath:L,instancePath:ne,params:{property:e,dependencies:Yn}})));return or||Fr}function q4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependentSchemas),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||Bl(f,m,Fr,ne));return Ue||t}function K4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependentSchemas),0,([e,Yn])=>{let Vn=`${L}/dependentSchemas/${e}`;return!It.HasPropertyKey(t,e)||Dp(f,m,Vn,ne,Yn,t)});return or||Fr}function HT(f,m,L,ne){return L.enum.some(Ue=>It.IsValueLike(Ue)?It.IsEqual(ne,Ue):It.IsDeepEqual(ne,Ue))}function Y4(f,m,L,ne,Ue,t){return HT(f,m,Ue,t)||m.AddError({keyword:"enum",schemaPath:L,instancePath:ne,params:{allowedValues:Ue.enum}})}function qT(f,m,L,ne){return It.IsLessThan(ne,L.exclusiveMaximum)}function z4(f,m,L,ne,Ue,t){return qT(f,m,Ue,t)||m.AddError({keyword:"exclusiveMaximum",schemaPath:L,instancePath:ne,params:{comparison:"<",limit:Ue.exclusiveMaximum}})}function KT(f,m,L,ne){return It.IsGreaterThan(ne,L.exclusiveMinimum)}function V4(f,m,L,ne,Ue,t){return KT(f,m,Ue,t)||m.AddError({keyword:"exclusiveMinimum",schemaPath:L,instancePath:ne,params:{comparison:">",limit:Ue.exclusiveMinimum}})}var fh={};hC(fh,{Clear:()=>X4,Entries:()=>Dj,Get:()=>Fj,Has:()=>Gj,IsDate:()=>FE,IsDateTime:()=>YT,IsDuration:()=>zT,IsEmail:()=>VT,IsHostname:()=>WT,IsIPv4:()=>JT,IsIPv6:()=>eI,IsIdnEmail:()=>XT,IsIdnHostname:()=>QT,IsIri:()=>rI,IsIriReference:()=>tI,IsJsonPointer:()=>sI,IsJsonPointerUriFragment:()=>nI,IsRegex:()=>oI,IsRelativeJsonPointer:()=>aI,IsTime:()=>jE,IsUri:()=>lI,IsUriReference:()=>uI,IsUriTemplate:()=>iI,IsUrl:()=>cI,IsUuid:()=>fI,Reset:()=>Z4,Set:()=>$j,Test:()=>jj});var Lj=[0,31,28,31,30,31,30,31,31,30,31,30,31],hj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Ej(f){return f%4===0&&(f%100!==0||f%400===0)}function FE(f){let m=hj.exec(f);if(!m)return!1;let L=+m[1],ne=+m[2],Ue=+m[3];return ne>=1&&ne<=12&&Ue>=1&&Ue<=(ne===2&&Ej(L)?29:Lj[ne])}var wj=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function jE(f,m=!0){let L=wj.exec(f);if(!L)return!1;let ne=+L[1],Ue=+L[2],t=+L[3],or=L[4]==="-"?-1:1,Fr=+(L[5]||0),e=+(L[6]||0);if(Fr>23||e>59||m&&!L[4]&&f.toLowerCase().indexOf("z")===-1)return!1;if(ne<=23&&Ue<=59&&t<60)return!0;let Yn=Ue-e*or,Vn=ne-Fr*or-(Yn<0?1:0);return(Vn===23||Vn===-1)&&(Yn===59||Yn===-1)&&t<61}function YT(f,m=!0){let L=f.split(/T/i);return L.length===2&&FE(L[0])&&jE(L[1],m)}var Aj=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function zT(f){return Aj.test(f)}var gj=/^(?!.*\.\.)[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 VT(f){return gj.test(f)}var Tj=/^(?=.{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 WT(f){return Tj.test(f)}var Ij=/^(?!.*\.\.)[\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 XT(f){return Ij.test(f)}function ZT(f){let m=f.codePointAt(0);return m===void 0?!1:m>=12352&&m<=12447||m>=12448&&m<=12543&&m!==12539||m>=19968&&m<=40959}function QT(f){if(f.length===0||f.includes(" "))return!1;let m=/[\u002E\u3002\uFF0E\uFF61]/g,L=f.normalize("NFC").replace(m,".");if(L.length>253)return!1;let ne=L.split(".");if(ne.some(Ue=>Ue.length===0))return!1;for(let Ue of ne){if(Ue.length>63||Ue.startsWith("-")||Ue.endsWith("-"))return!1;if(/^xn--/i.test(Ue)){let e=Ue.slice(4);if(e.length<2||e.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(Ue))return!1;let t=Ue.charAt(0);if(/[\u0903\u0300\u0488]/.test(t))return!1;for(let e=0;e<Ue.length;e++){let Yn=Ue.charAt(e);if(Yn==="\xB7"){if(e===0||e===Ue.length-1)return!1;let Vn=Ue.charAt(e-1),Br=Ue.charAt(e+1);if(!/^[lL]$/.test(Vn)||!/^[lL]$/.test(Br))return!1}if(Yn==="\u30FB"){if(Ue.length===1)return!1;if(e===0){let Vn=Ue.charAt(e+1);if(!ZT(Vn))return!1}else{let Vn=Ue.charAt(e-1),Br=Ue.charAt(e+1);if(!ZT(Vn)||!ZT(Br))return!1}}if(Yn==="\u0375"){if(e===Ue.length-1)return!1;let Vn=Ue.charAt(e+1);if(!/[\u0370-\u03FF]/.test(Vn))return!1}if(Yn==="\u05F3"||Yn==="\u05F4"){if(e===0)return!1;let Vn=Ue.charAt(e-1);if(!/[\u05D0-\u05EA]/.test(Vn))return!1}if(Yn==="\u200D"&&(e===0||Ue.charAt(e-1)!=="\u094D"))return!1}let or=!1,Fr=!1;for(let e=0;e<Ue.length;e++){let Yn=Ue.charAt(e);/[\u0660-\u0669]/.test(Yn)&&(or=!0),/[\u06F0-\u06F9]/.test(Yn)&&(Fr=!0)}if(or&&Fr)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 JT(f){return _j.test(f)}var xj=/^((([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 eI(f){return xj.test(f)}function W4(f){try{return new URL(f,"http://example.com"),!0}catch{return!1}}function tI(f){if(f.includes(" ")||f.includes("\\")||/[\x00-\x1F\x7F]/.test(f)||/%(?![0-9a-fA-F]{2})/.test(f))return!1;if(f==="")return!0;let m=f.indexOf(":");return m>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(f.substring(0,m))?W4(f):f.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&m===-1?!1:W4(f)}function rI(f){try{return new URL(f),!0}catch{return!1}}var Sj=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function nI(f){return Sj.test(f)}var Oj=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function sI(f){return Oj.test(f)}function oI(f){if(f.length===0)return!1;try{return new RegExp(f),!0}catch{return!1}}var Rj=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function aI(f){return Rj.test(f)}var Nj=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function uI(f){return Nj.test(f)}var kj=/^(?:(?:[^\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 iI(f){return kj.test(f)}var Uj=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function lI(f){return Uj.test(f)}var Mj=/^(?: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 cI(f){return Mj.test(f)}var Pj=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function fI(f){return Pj.test(f)}var sv=new Map;function X4(){sv.clear()}function Dj(){return[...sv.entries()]}function $j(f,m){sv.set(f,m)}function Gj(f){return sv.has(f)}function Fj(f){return sv.get(f)}function jj(f,m){return sv.get(f)?.(m)??!0}function Z4(){X4(),sv.set("date-time",YT),sv.set("date",FE),sv.set("duration",zT),sv.set("email",VT),sv.set("hostname",WT),sv.set("idn-email",XT),sv.set("idn-hostname",QT),sv.set("ipv4",JT),sv.set("ipv6",eI),sv.set("iri-reference",tI),sv.set("iri",rI),sv.set("json-pointer-uri-fragment",nI),sv.set("json-pointer",sI),sv.set("regex",oI),sv.set("relative-json-pointer",aI),sv.set("time",jE),sv.set("uri-reference",uI),sv.set("uri-template",iI),sv.set("uri",lI),sv.set("url",cI),sv.set("uuid",fI)}Z4();function pI(f,m,L,ne){return fh.Test(L.format,ne)}function Q4(f,m,L,ne,Ue,t){return pI(f,m,Ue,t)||m.AddError({keyword:"format",schemaPath:L,instancePath:ne,params:{format:Ue.format}})}function J4(f,m,L,ne){let Ue=DT(L)?L.then:!0,t=wT(L)?L.else:!0;return Bl(f,m,L.if,ne)?Bl(f,m,Ue,ne):Bl(f,m,t,ne)}function eM(f,m,L,ne,Ue,t){let or=DT(Ue)?Ue.then:!0,Fr=wT(Ue)?Ue.else:!0,e=new Rv,Yn=Dp(f,e,`${L}/if`,ne,Ue.if,t)?Dp(f,e,`${L}/then`,ne,or,t)||m.AddError({keyword:"if",schemaPath:L,instancePath:ne,params:{failingKeyword:"then"}}):Dp(f,m,`${L}/else`,ne,Fr,t)||m.AddError({keyword:"if",schemaPath:L,instancePath:ne,params:{failingKeyword:"else"}});return Yn&&m.Merge([e]),Yn}function Bj(f,m,L,ne){return It.Every(L.items,0,(Ue,t)=>It.IsLessEqualThan(ne.length,t)||Bl(f,m,Ue,ne[t])&&m.AddIndex(t))}function Hj(f,m,L,ne,Ue,t){return It.EveryAll(Ue.items,0,(or,Fr)=>{let e=`${L}/items/${Fr}`,Yn=`${ne}/${Fr}`;return It.IsLessEqualThan(t.length,Fr)||Dp(f,m,e,Yn,or,t[Fr])&&m.AddIndex(Fr)})}function qj(f,m,L,ne){let Ue=ih(L)?L.prefixItems.length:0;return It.Every(ne,Ue,(t,or)=>Bl(f,m,L.items,t)&&m.AddIndex(or))}function Kj(f,m,L,ne,Ue,t){let or=ih(Ue)?Ue.prefixItems.length:0;return It.EveryAll(t,or,(Fr,e)=>{let Yn=`${L}/items`,Vn=`${ne}/${e}`;return Dp(f,m,Yn,Vn,Ue.items,Fr)&&m.AddIndex(e)})}function tM(f,m,L,ne){return IT(L)?Bj(f,m,L,ne):qj(f,m,L,ne)}function rM(f,m,L,ne,Ue,t){return IT(Ue)?Hj(f,m,L,ne,Ue,t):Kj(f,m,L,ne,Ue,t)}function Yj(f){return pL(f)}function mI(f,m,L,ne){if(!Yj(L))return!0;let Ue=ne.reduce((t,or)=>Bl(f,m,L.contains,or)?++t:t,0);return It.IsLessEqualThan(Ue,L.maxContains)}function nM(f,m,L,ne,Ue,t){let or=dL(Ue)?Ue.minContains:1;return mI(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:or,maxContains:Ue.maxContains}})}function dI(f,m,L,ne){return It.IsLessEqualThan(ne,L.maximum)}function sM(f,m,L,ne,Ue,t){return dI(f,m,Ue,t)||m.AddError({keyword:"maximum",schemaPath:L,instancePath:ne,params:{comparison:"<=",limit:Ue.maximum}})}function bI(f,m,L,ne){return It.IsLessEqualThan(ne.length,L.maxItems)}function oM(f,m,L,ne,Ue,t){return bI(f,m,Ue,t)||m.AddError({keyword:"maxItems",schemaPath:L,instancePath:ne,params:{limit:Ue.maxItems}})}function vI(f,m,L,ne){return It.IsMaxLength(ne,L.maxLength)}function aM(f,m,L,ne,Ue,t){return vI(f,m,Ue,t)||m.AddError({keyword:"maxLength",schemaPath:L,instancePath:ne,params:{limit:Ue.maxLength}})}function CI(f,m,L,ne){return It.IsLessEqualThan(It.Keys(ne).length,L.maxProperties)}function uM(f,m,L,ne,Ue,t){return CI(f,m,Ue,t)||m.AddError({keyword:"maxProperties",schemaPath:L,instancePath:ne,params:{limit:Ue.maxProperties}})}function zj(f){return pL(f)}function yI(f,m,L,ne){if(!zj(L))return!0;let Ue=ne.reduce((t,or)=>Bl(f,m,L.contains,or)?++t:t,0);return It.IsGreaterEqualThan(Ue,L.minContains)}function iM(f,m,L,ne,Ue,t){return yI(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:Ue.minContains}})}function LI(f,m,L,ne){return It.IsGreaterEqualThan(ne,L.minimum)}function lM(f,m,L,ne,Ue,t){return LI(f,m,Ue,t)||m.AddError({keyword:"minimum",schemaPath:L,instancePath:ne,params:{comparison:">=",limit:Ue.minimum}})}function hI(f,m,L,ne){return It.IsGreaterEqualThan(ne.length,L.minItems)}function cM(f,m,L,ne,Ue,t){return hI(f,m,Ue,t)||m.AddError({keyword:"minItems",schemaPath:L,instancePath:ne,params:{limit:Ue.minItems}})}function EI(f,m,L,ne){return It.IsMinLength(ne,L.minLength)}function fM(f,m,L,ne,Ue,t){return EI(f,m,Ue,t)||m.AddError({keyword:"minLength",schemaPath:L,instancePath:ne,params:{limit:Ue.minLength}})}function wI(f,m,L,ne){return It.IsGreaterEqualThan(It.Keys(ne).length,L.minProperties)}function pM(f,m,L,ne,Ue,t){return wI(f,m,Ue,t)||m.AddError({keyword:"minProperties",schemaPath:L,instancePath:ne,params:{limit:Ue.minProperties}})}function AI(f,m,L,ne){return It.IsMultipleOf(ne,L.multipleOf)}function mM(f,m,L,ne,Ue,t){return AI(f,m,Ue,t)||m.AddError({keyword:"multipleOf",schemaPath:L,instancePath:ne,params:{multipleOf:Ue.multipleOf}})}function gI(f,m,L,ne){let Ue=new Qv;return!Bl(f,Ue,L.not,ne)&&m.Merge([Ue])}function dM(f,m,L,ne,Ue,t){return gI(f,m,Ue,t)||m.AddError({keyword:"not",schemaPath:L,instancePath:ne,params:{}})}function bM(f,m,L,ne){let Ue=L.oneOf.reduce((t,or)=>{let Fr=new Qv;return Bl(f,Fr,or,ne)?[...t,Fr]:t},[]);return It.IsEqual(Ue.length,1)&&m.Merge(Ue)}function vM(f,m,L,ne,Ue,t){let or=[],Fr=[],e=Ue.oneOf.reduce((Vn,Br,Xr)=>{let gs=new Rv,Yo=`${L}/oneOf/${Xr}`,rs=Dp(f,gs,Yo,ne,Br,t);return rs&&Fr.push(Xr),rs||or.push(gs),rs?[...Vn,gs]:Vn},[]),Yn=It.IsEqual(e.length,1)&&m.Merge(e);return!Yn&&It.IsEqual(Fr.length,0)&&or.forEach(Vn=>Vn.GetErrors().forEach(Br=>m.AddError(Br))),Yn||m.AddError({keyword:"oneOf",schemaPath:L,instancePath:ne,params:{passingSchemas:Fr}})}function TI(f,m,L,ne){return(It.IsString(L.pattern)?new RegExp(L.pattern):L.pattern).test(ne)}function CM(f,m,L,ne,Ue,t){return TI(f,m,Ue,t)||m.AddError({keyword:"pattern",schemaPath:L,instancePath:ne,params:{pattern:Ue.pattern}})}function yM(f,m,L,ne){return It.Every(It.Entries(L.patternProperties),0,([Ue,t])=>{let or=new RegExp(Ue);return It.Every(It.Entries(ne),0,([Fr,e])=>!or.test(Fr)||Bl(f,m,t,e)&&m.AddKey(Fr))})}function LM(f,m,L,ne,Ue,t){return It.EveryAll(It.Entries(Ue.patternProperties),0,([or,Fr])=>{let e=`${L}/patternProperties/${or}`,Yn=new RegExp(or);return It.EveryAll(It.Entries(t),0,([Vn,Br])=>{let Xr=`${ne}/${Vn}`;return!Yn.test(Vn)||Dp(f,m,e,Xr,Fr,Br)&&m.AddKey(Vn)})})}function hM(f,m,L,ne){return It.IsEqual(ne.length,0)||It.Every(L.prefixItems,0,(Ue,t)=>It.IsLessEqualThan(ne.length,t)||Bl(f,m,Ue,ne[t])&&m.AddIndex(t))}function EM(f,m,L,ne,Ue,t){return It.IsEqual(t.length,0)||It.EveryAll(Ue.prefixItems,0,(or,Fr)=>{let e=`${L}/prefixItems/${Fr}`,Yn=`${ne}/${Fr}`;return It.IsLessEqualThan(t.length,Fr)||Dp(f,m,e,Yn,or,t[Fr])&&m.AddIndex(Fr)})}function II(f,m){return f.includes(m)||dC.Get().exactOptionalPropertyTypes}function _I(f,m){return It.IsUndefined(f[m])}function wM(f,m,L,ne){let Ue=bL(L)?L.required:[];return It.Every(It.Entries(L.properties),0,([or,Fr])=>{let e=!It.HasPropertyKey(ne,or)||Bl(f,m,Fr,ne[or])&&m.AddKey(or);return II(Ue,or)?e:_I(ne,or)||e})}function AM(f,m,L,ne,Ue,t){let or=bL(Ue)?Ue.required:[];return It.EveryAll(It.Entries(Ue.properties),0,([e,Yn])=>{let Vn=`${L}/properties/${e}`,Br=`${ne}/${e}`,Xr=()=>!It.HasPropertyKey(t,e)||Dp(f,m,Vn,Br,Yn,t[e])&&m.AddKey(e);return II(or,e)?Xr():_I(t,e)||Xr()})}function gM(f,m,L,ne){return It.Every(It.Keys(ne),0,(Ue,t)=>Bl(f,m,L.propertyNames,Ue))}function TM(f,m,L,ne,Ue,t){let or=[];return It.EveryAll(It.Keys(t),0,(e,Yn)=>{let Vn=`${ne}/${e}`,Br=`${L}/propertyNames`,Xr=new Rv,gs=Dp(f,Xr,Br,Vn,Ue.propertyNames,e);return gs||or.push(e),gs})||m.AddError({keyword:"propertyNames",schemaPath:L,instancePath:ne,params:{propertyNames:or}})}function IM(f,m,L,ne){let Ue=f.RecursiveRef(L.$recursiveRef)??!1;return mc(Ue)&&Bl(f,m,Ue,ne)}function _M(f,m,L,ne,Ue,t){let or=f.RecursiveRef(Ue.$recursiveRef)??!1;return mc(or)&&Dp(f,m,"#",ne,or,t)}function OM(f,m,L,ne){let Ue=f.Ref(L.$ref)??!1,t=new Qv,or=mc(Ue)&&Bl(f,t,Ue,ne);return or&&m.Merge([t]),or}function RM(f,m,L,ne,Ue,t){let or=f.Ref(Ue.$ref)??!1,Fr=new Rv,e=mc(or)&&Dp(f,Fr,"#",ne,or,t);return e&&m.Merge([Fr]),e||Fr.GetErrors().forEach(Yn=>m.AddError(Yn)),e}function NM(f,m,L,ne){return It.Every(L.required,0,Ue=>It.HasPropertyKey(ne,Ue))}function kM(f,m,L,ne,Ue,t){let or=[];return It.EveryAll(Ue.required,0,e=>{let Yn=It.HasPropertyKey(t,e);return Yn||or.push(e),Yn})||m.AddError({keyword:"required",schemaPath:L,instancePath:ne,params:{requiredProperties:or}})}function xI(f,m,L,ne,Ue){return It.IsEqual(L,"object")?It.IsObjectNotArray(Ue):It.IsEqual(L,"array")?It.IsArray(Ue):It.IsEqual(L,"boolean")?It.IsBoolean(Ue):It.IsEqual(L,"integer")?It.IsInteger(Ue):It.IsEqual(L,"number")?It.IsNumber(Ue):It.IsEqual(L,"null")?It.IsNull(Ue):It.IsEqual(L,"string")?It.IsString(Ue):It.IsEqual(L,"asyncIterator")?It.IsAsyncIterator(Ue):It.IsEqual(L,"bigint")?It.IsBigInt(Ue):It.IsEqual(L,"constructor")?It.IsConstructor(Ue):It.IsEqual(L,"function")?It.IsFunction(Ue):It.IsEqual(L,"iterator")?It.IsIterator(Ue):It.IsEqual(L,"symbol")?It.IsSymbol(Ue):It.IsEqual(L,"undefined")?It.IsUndefined(Ue):It.IsEqual(L,"void")?It.IsUndefined(Ue):!0}function UM(f,m,L,ne,Ue){return L.some(t=>xI(f,m,t,ne,Ue))}function MM(f,m,L,ne){return It.IsArray(L.type)?UM(f,m,L.type,L,ne):xI(f,m,L.type,L,ne)}function PM(f,m,L,ne,Ue,t){return(It.IsArray(Ue.type)?UM(f,m,Ue.type,Ue,t):xI(f,m,Ue.type,Ue,t))||m.AddError({keyword:"type",schemaPath:L,instancePath:ne,params:{type:Ue.type}})}function DM(f,m,L,ne){let Ue=m.GetIndices();return It.Every(ne,0,(t,or)=>(Ue.has(or)||Bl(f,m,L.unevaluatedItems,t))&&m.AddIndex(or))}function $M(f,m,L,ne,Ue,t){let or=m.GetIndices(),Fr=[];return It.EveryAll(t,0,(Yn,Vn)=>{let Br=new Rv,Xr=(or.has(Vn)||Dp(f,Br,L,ne,Ue.unevaluatedItems,Yn))&&m.AddIndex(Vn);return Xr||Fr.push(Vn),Xr})||m.AddError({keyword:"unevaluatedItems",schemaPath:L,instancePath:ne,params:{unevaluatedItems:Fr}})}function GM(f,m,L,ne){let Ue=m.GetKeys();return It.Every(It.Entries(ne),0,([t,or])=>Ue.has(t)||Bl(f,m,L.unevaluatedProperties,or)&&m.AddKey(t))}function FM(f,m,L,ne,Ue,t){let or=m.GetKeys(),Fr=[];return It.EveryAll(It.Entries(t),0,([Yn,Vn])=>{let Br=new Rv,Xr=or.has(Yn)||Dp(f,Br,L,ne,Ue.unevaluatedProperties,Vn)&&m.AddKey(Yn);return Xr||Fr.push(Yn),Xr})||m.AddError({keyword:"unevaluatedProperties",schemaPath:L,instancePath:ne,params:{unevaluatedProperties:Fr}})}function jM(f){return!It.IsEqual(f.uniqueItems,!1)}function BM(f,m,L,ne){if(!jM(L))return!0;let Ue=new Set(ne.map(Ay.Hash)).size,t=ne.length;return It.IsEqual(Ue,t)}function HM(f,m,L,ne,Ue,t){if(!jM(Ue))return!0;let or=new Set,Fr=t.reduce((Yn,Vn,Br)=>{let Xr=Ay.Hash(Vn);return or.has(Xr)?[...Yn,Br]:(or.add(Xr),Yn)},[]);return It.IsEqual(Fr.length,0)||m.AddError({keyword:"uniqueItems",schemaPath:L,instancePath:ne,params:{duplicateItems:Fr}})}function Bl(f,m,L,ne){f.Push(L);let Ue=mA(L)?FT(f,m,L,ne):(!$T(L)||MM(f,m,L,ne))&&(!(It.IsObject(ne)&&!It.IsArray(ne))||(!bL(L)||NM(f,m,L,ne))&&(!iy(L)||R4(f,m,L,ne))&&(!yT(L)||F4(f,m,L,ne))&&(!LT(L)||B4(f,m,L,ne))&&(!hT(L)||q4(f,m,L,ne))&&(!DE(L)||yM(f,m,L,ne))&&(!$E(L)||wM(f,m,L,ne))&&(!UT(L)||gM(f,m,L,ne))&&(!ME(L)||wI(f,m,L,ne))&&(!OT(L)||CI(f,m,L,ne)))&&(!It.IsArray(ne)||(!dT(L)||x4(f,m,L,ne))&&(!pL(L)||BT(f,m,L,ne))&&(!ah(L)||tM(f,m,L,ne))&&(!xT(L)||mI(f,m,L,ne))&&(!dA(L)||bI(f,m,L,ne))&&(!dL(L)||yI(f,m,L,ne))&&(!uh(L)||hI(f,m,L,ne))&&(!ih(L)||hM(f,m,L,ne))&&(!lh(L)||BM(f,m,L,ne)))&&(!It.IsString(ne)||(!kE(L)||pI(f,m,L,ne))&&(!ST(L)||vI(f,m,L,ne))&&(!UE(L)||EI(f,m,L,ne))&&(!PE(L)||TI(f,m,L,ne)))&&(!(It.IsNumber(ne)||It.IsBigInt(ne))||(!gT(L)||qT(f,m,L,ne))&&(!ly(L)||KT(f,m,L,ne))&&(!_T(L)||dI(f,m,L,ne))&&(!cy(L)||LI(f,m,L,ne))&&(!RT(L)||AI(f,m,L,ne)))&&(!MT(L)||IM(f,m,L,ne))&&(!PT(L)||OM(f,m,L,ne))&&(!pT(L)||A4(f,m,L,ne))&&(!CT(L)||jT(f,m,L,ne))&&(!AT(L)||HT(f,m,L,ne))&&(!TT(L)||J4(f,m,L,ne))&&(!NT(L)||gI(f,m,L,ne))&&(!bT(L)||k4(f,m,L,ne))&&(!vT(L)||M4(f,m,L,ne))&&(!kT(L)||bM(f,m,L,ne))&&(!vA(L)||!It.IsArray(ne)||DM(f,m,L,ne))&&(!CA(L)||!It.IsObject(ne)||GM(f,m,L,ne))&&(!mT(L)||T4(f,m,L,ne));return f.Pop(L),Ue}function Dp(f,m,L,ne,Ue,t){f.Push(Ue);let or=mA(Ue)?D4(f,m,L,ne,Ue,t):!!(+(!$T(Ue)||PM(f,m,L,ne,Ue,t))&+(!(It.IsObject(t)&&!It.IsArray(t))||!!(+(!bL(Ue)||kM(f,m,L,ne,Ue,t))&+(!iy(Ue)||N4(f,m,L,ne,Ue,t))&+(!yT(Ue)||j4(f,m,L,ne,Ue,t))&+(!LT(Ue)||H4(f,m,L,ne,Ue,t))&+(!hT(Ue)||K4(f,m,L,ne,Ue,t))&+(!DE(Ue)||LM(f,m,L,ne,Ue,t))&+(!$E(Ue)||AM(f,m,L,ne,Ue,t))&+(!UT(Ue)||TM(f,m,L,ne,Ue,t))&+(!ME(Ue)||pM(f,m,L,ne,Ue,t))&+(!OT(Ue)||uM(f,m,L,ne,Ue,t))))&+(!It.IsArray(t)||!!(+(!dT(Ue)||S4(f,m,L,ne,Ue,t))&+(!pL(Ue)||G4(f,m,L,ne,Ue,t))&+(!ah(Ue)||rM(f,m,L,ne,Ue,t))&+(!xT(Ue)||nM(f,m,L,ne,Ue,t))&+(!dA(Ue)||oM(f,m,L,ne,Ue,t))&+(!dL(Ue)||iM(f,m,L,ne,Ue,t))&+(!uh(Ue)||cM(f,m,L,ne,Ue,t))&+(!ih(Ue)||EM(f,m,L,ne,Ue,t))&+(!lh(Ue)||HM(f,m,L,ne,Ue,t))))&+(!It.IsString(t)||!!(+(!kE(Ue)||Q4(f,m,L,ne,Ue,t))&+(!ST(Ue)||aM(f,m,L,ne,Ue,t))&+(!UE(Ue)||fM(f,m,L,ne,Ue,t))&+(!PE(Ue)||CM(f,m,L,ne,Ue,t))))&+(!(It.IsNumber(t)||It.IsBigInt(t))||!!(+(!gT(Ue)||z4(f,m,L,ne,Ue,t))&+(!ly(Ue)||V4(f,m,L,ne,Ue,t))&+(!_T(Ue)||sM(f,m,L,ne,Ue,t))&+(!cy(Ue)||lM(f,m,L,ne,Ue,t))&+(!RT(Ue)||mM(f,m,L,ne,Ue,t))))&+(!MT(Ue)||_M(f,m,L,ne,Ue,t))&+(!PT(Ue)||RM(f,m,L,ne,Ue,t))&+(!pT(Ue)||g4(f,m,L,ne,Ue,t))&+(!CT(Ue)||$4(f,m,L,ne,Ue,t))&+(!AT(Ue)||Y4(f,m,L,ne,Ue,t))&+(!TT(Ue)||eM(f,m,L,ne,Ue,t))&+(!NT(Ue)||dM(f,m,L,ne,Ue,t))&+(!bT(Ue)||U4(f,m,L,ne,Ue,t))&+(!vT(Ue)||P4(f,m,L,ne,Ue,t))&+(!kT(Ue)||vM(f,m,L,ne,Ue,t))&+(!vA(Ue)||!It.IsArray(t)||$M(f,m,L,ne,Ue,t))&+(!CA(Ue)||!It.IsObject(t)||FM(f,m,L,ne,Ue,t)))&&(!mT(Ue)||I4(f,m,L,ne,Ue,t));return f.Pop(Ue),or}var CL={};hC(CL,{Ref:()=>a8});var fy={};hC(fy,{Delete:()=>e8,Get:()=>Qj,Has:()=>Zj,Indices:()=>BE,Set:()=>Jj});function qM(f){if(f.length===0)throw Error("Cannot set root")}function KM(f){if(!It.IsObject(f))throw Error("Cannot set value")}function Vj(f){return/^(0|[1-9]\d*)$/.test(f)}function YM(f){return[f.slice(0,f.length-1),f.slice(f.length-1)[0]]}function Wj(f,m){return It.IsObject(m)&&It.HasPropertyKey(m,f)}function Xj(f,m){return It.IsObject(m)?m[f]:void 0}function SI(f,m){return f.reduce((L,ne)=>Xj(ne,L),m)}function BE(f){if(It.IsEqual(f.length,0))return[];let m=f.split("/").map(L=>L.replace(/~1/g,"/").replace(/~0/g,"~"));return m.length>0&&m[0]===""?m.slice(1):m}function Zj(f,m){let L=f;return BE(m).every(ne=>Wj(ne,L)?(L=L[ne],!0):!1)}function Qj(f,m){let L=BE(m);return SI(L,f)}function Jj(f,m,L){let ne=BE(m);qM(ne);let[Ue,t]=YM(ne),or=SI(Ue,f);return KM(or),or[t]=L,f}function e8(f,m){let L=BE(m);qM(L);let[ne,Ue]=YM(L),t=SI(ne,f);return KM(t),It.IsArray(t)&&Vj(Ue)?t.splice(+Ue,1):delete t[Ue],f}function t8(f,m,L){if(f.$id===L.hash)return f;let ne=new URL(f.$id,m.href),Ue=new URL(L.href,m.href);if(It.IsEqual(ne.pathname,Ue.pathname))return L.hash.startsWith("#")?zM(f,m,L):f}function r8(f,m,L){let ne=new URL(`#${f.$anchor}`,m.href),Ue=new URL(L.href,m.href);if(It.IsEqual(ne.href,Ue.href))return f}function zM(f,m,L){return L.href.endsWith("#")?f:L.hash.startsWith("#")?fy.Get(f,decodeURIComponent(L.hash.slice(1))):void 0}function n8(f,m,L){if(mL(f)){let ne=t8(f,m,L);if(!It.IsUndefined(ne))return ne}if(NE(f)){let ne=r8(f,m,L);if(!It.IsUndefined(ne))return ne}return zM(f,m,L)}function s8(f,m,L){return f.reduce((ne,Ue)=>{let t=OI(Ue,m,L);return It.IsUndefined(t)?ne:t},void 0)}function o8(f,m,L){return It.Keys(f).reduce((ne,Ue)=>{let t=OI(f[Ue],m,L);return It.IsUndefined(t)?ne:t},void 0)}function OI(f,m,L){if(m=uy(f)&&mL(f)?new URL(f.$id,m.href):m,uy(f)){let ne=n8(f,m,L);if(!It.IsUndefined(ne))return ne}if(It.IsArray(f))return s8(f,m,L);if(It.IsObject(f))return o8(f,m,L)}function a8(f,m){let L=new URL("http://unknown"),ne=mL(f)?new URL(f.$id,L.href):L,Ue=new URL(m,ne.href);return OI(f,ne,Ue)}var yL=class{constructor(m,L){this.context=m,this.schema=L,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((m,L)=>new URL(L.$id,m),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(m){uy(m)&&(mL(m)&&this.ids.push(m),NE(m)&&this.anchors.push(m),bA(m)&&this.recursiveAnchors.push(m),ET(m)&&this.dynamicAnchors.push(m))}Pop(m){uy(m)&&(mL(m)&&this.ids.pop(),NE(m)&&this.anchors.pop(),bA(m)&&this.recursiveAnchors.pop(),ET(m)&&this.dynamicAnchors.pop())}FromContext(m){return It.HasPropertyKey(this.context,m)?this.context[m]:void 0}FromRef(m){return m.startsWith("#")?CL.Ref(this.Base(),m):CL.Ref(this.schema,m)}Ref(m){return this.FromContext(m)??this.FromRef(m)}RecursiveRef(m){return bA(this.Base())?CL.Ref(this.recursiveAnchors[0],m):CL.Ref(this.Base(),m)}};function VM(...f){let[m,L,ne]=pd.Match(f,{3:(or,Fr,e)=>[or,Fr,e],2:(or,Fr)=>[{},or,Fr]}),Ue=new yL(m,L),t=new Qv;return Bl(Ue,t,L,ne)}function WM(...f){let[m,L,ne]=pd.Match(f,{3:(Vn,Br,Xr)=>[Vn,Br,Xr],2:(Vn,Br)=>[{},Vn,Br]}),Ue=dC.Get(),t=cx(),or=[],Fr=new yL(m,L),e=new GE(Vn=>{if(!It.IsGreaterEqualThan(or.length,Ue.maxErrors))return or.push({...Vn,message:t(Vn)})});return[Dp(Fr,e,"#","",L,ne),or]}function $b(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return VM(m,L,ne)}function Fy(...f){let[m,L,ne]=pd.Match(f,{3:(or,Fr,e)=>[or,Fr,e],2:(or,Fr)=>[{},or,Fr]}),[Ue,t]=WM(m,L,ne);return t}var jy=class extends Error{constructor(m,L,ne){super(m),Object.defineProperty(this,"cause",{value:{source:m,errors:ne,value:L},writable:!1,configurable:!1,enumerable:!1})}};function XM(f,m,L){return It.IsArray(L)?L.map(ne=>kv(f,m.items,ne)):L}function ZM(f,m,L){return m.Clean(L)}function QM(f,m,L){return kv({...f,...m.$defs},hv(m.$ref),L)}function i8(f){let m=It.HasPropertyKey(f,"unevaluatedProperties")?{additionalProperties:f.unevaluatedProperties}:{},L=OC(f);return Il(L)?Vw(L,m):L}function JM(f,m,L){let ne=i8(m);return kv(f,ne,L)}function yA(f){return It.HasPropertyKey(f,"additionalProperties")?f.additionalProperties:void 0}function e2(f,m,L){if(!It.IsObject(L)||It.IsArray(L))return L;let ne=yA(m);for(let Ue of It.Keys(L)){if(It.HasPropertyKey(m.properties,Ue)){L[Ue]=kv(f,m.properties[Ue],L[Ue]);continue}if(It.IsBoolean(ne)&&It.IsEqual(ne,!0)||Ou(ne)&&$b(f,ne,L[Ue])){L[Ue]=kv(f,ne,L[Ue]);continue}delete L[Ue]}return L}function t2(f,m,L){if(!It.IsObject(L))return L;let ne=yA(m),[Ue,t]=[new RegExp(cC(m)),Gv(m)];for(let or of It.Keys(L)){if(Ue.test(or)){L[or]=kv(f,t,L[or]);continue}if(It.IsBoolean(ne)&&It.IsEqual(ne,!0)||Ou(ne)&&$b(f,ne,L[or])){L[or]=kv(f,ne,L[or]);continue}delete L[or]}return L}function r2(f,m,L){return It.HasPropertyKey(f,m.$ref)?kv(f,f[m.$ref],L):L}function n2(f,m,L){if(!It.IsArray(L))return L;let ne=Math.min(L.length,m.items.length);for(let Ue=0;Ue<ne;Ue++)L[Ue]=kv(f,m.items[Ue],L[Ue]);return It.IsGreaterThan(L.length,ne)?L.slice(0,ne):L}function l8(f){let m={};for(let L of Object.getOwnPropertyNames(f))m[L]=tv(f[L]);for(let L of Object.getOwnPropertySymbols(f))m[L]=tv(f[L]);return m}function c8(f){return It.IsClassInstance(f)?f:l8(f)}function f8(f){return f.map(m=>tv(m))}function p8(f){return f.slice()}function m8(f){return new Map(tv([...f.entries()]))}function d8(f){return new Set(tv([...f.values()]))}function tv(f){return zv.IsTypeArray(f)?p8(f):zv.IsMap(f)?m8(f):zv.IsSet(f)?d8(f):It.IsArray(f)?f8(f):It.IsObject(f)?c8(f):f}function s2(f,m,L){for(let ne of m.anyOf){let Ue=kv(f,ne,tv(L));if($b(f,ne,Ue))return Ue}return L}function kv(f,m,L){return Z0(m)?XM(f,m,L):bC(m)?ZM(f,m,L):Db(m)?QM(f,m,L):Bi(m)?JM(f,m,L):Il(m)?e2(f,m,L):pv(m)?t2(f,m,L):hb(m)?r2(f,m,L):dp(m)?n2(f,m,L):yu(m)?s2(f,m,L):L}function hL(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return kv(m,L,ne)}function o2(f,m,L){return It.IsArray(L)?L.map(ne=>Av(f,m.items,ne)):L}function a2(f,m,L){return m.Convert(L)}var Am={};hC(Am,{Fail:()=>EL,IsOk:()=>NI,Ok:()=>Ai,TryBigInt:()=>kI,TryBoolean:()=>k8,TryNull:()=>F8,TryNumber:()=>W8,TryString:()=>rB,TryUndefined:()=>lB});function NI(f){return It.IsObject(f)&&It.HasPropertyKey(f,"value")}function Ai(f){return{value:f}}function EL(){}function b8(f){return Ai(f)}function v8(f){return It.IsEqual(f,!0)?Ai(BigInt(1)):Ai(BigInt(0))}function C8(f){return Ai(BigInt(Math.trunc(f)))}function y8(f){return Ai(BigInt(0))}var L8=/^-?(0|[1-9]\d*)n$/,h8=/^-?(0|[1-9]\d*)\.\d+$/,E8=/^-?(0|[1-9]\d*)$/;function w8(f){return L8.test(f)}function A8(f){return h8.test(f)}function g8(f){return E8.test(f)}function T8(f){let m=f.toLowerCase();return w8(f)?Ai(BigInt(f.slice(0,f.length-1))):A8(f)?Ai(BigInt(f.split(".")[0])):g8(f)?Ai(BigInt(f)):It.IsEqual(m,"false")?Ai(BigInt(0)):It.IsEqual(m,"true")?Ai(BigInt(1)):void 0}function I8(f){return Ai(BigInt(0))}function kI(f){return It.IsBigInt(f)?b8(f):It.IsBoolean(f)?v8(f):It.IsNumber(f)?C8(f):It.IsNull(f)?y8(f):It.IsString(f)?T8(f):It.IsUndefined(f)?I8(f):void 0}function _8(f){return It.IsEqual(f,BigInt(0))?Ai(!1):It.IsEqual(f,BigInt(1))?Ai(!0):void 0}function x8(f){return Ai(f)}function S8(f){return It.IsEqual(f,0)?Ai(!1):It.IsEqual(f,1)?Ai(!0):void 0}function O8(f){return Ai(!1)}function R8(f){return It.IsEqual(f.toLowerCase(),"false")?Ai(!1):It.IsEqual(f.toLowerCase(),"true")?Ai(!0):It.IsEqual(f,"0")?Ai(!1):It.IsEqual(f,"1")?Ai(!0):void 0}function N8(f){return Ai(!1)}function k8(f){return It.IsBigInt(f)?_8(f):It.IsBoolean(f)?x8(f):It.IsNumber(f)?S8(f):It.IsNull(f)?O8(f):It.IsString(f)?R8(f):It.IsUndefined(f)?N8(f):void 0}function U8(f){return It.IsEqual(f,BigInt(0))?Ai(null):void 0}function M8(f){return It.IsEqual(f,!1)?Ai(null):void 0}function P8(f){return It.IsEqual(f,0)?Ai(null):void 0}function D8(f){return Ai(null)}function $8(f){let m=f.toLowerCase();return It.IsEqual(m,"undefined")||It.IsEqual(m,"null")||It.IsEqual(f,"")||It.IsEqual(f,"0")?Ai(null):void 0}function G8(f){return Ai(null)}function F8(f){return It.IsBigInt(f)?U8(f):It.IsBoolean(f)?M8(f):It.IsNumber(f)?P8(f):It.IsNull(f)?D8(f):It.IsString(f)?$8(f):It.IsUndefined(f)?G8(f):void 0}var j8=BigInt(Number.MAX_SAFE_INTEGER),B8=BigInt(Number.MIN_SAFE_INTEGER);function H8(f){return f<=j8&&f>=B8}function u2(f){return H8(f)?Ai(Number(f)):void 0}function q8(f){return f?Ai(1):Ai(0)}function K8(f){return Ai(f)}function Y8(f){return Ai(0)}function z8(f){let m=+f;if(It.IsNumber(m))return Ai(m);let L=f.toLowerCase();if(It.IsEqual(L,"false"))return Ai(0);if(It.IsEqual(L,"true"))return Ai(1);let ne=kI(f);return NI(ne)?u2(ne.value):void 0}function V8(f){return Ai(0)}function W8(f){return It.IsBigInt(f)?u2(f):It.IsBoolean(f)?q8(f):It.IsNumber(f)?K8(f):It.IsNull(f)?Y8(f):It.IsString(f)?z8(f):It.IsUndefined(f)?V8(f):void 0}function X8(f){return Ai(f.toString())}function Z8(f){return Ai(f.toString())}function Q8(f){return Ai(f.toString())}function J8(f){return Ai("null")}function eB(f){return Ai(f)}function tB(f){return Ai("")}function rB(f){return It.IsBigInt(f)?X8(f):It.IsBoolean(f)?Z8(f):It.IsNumber(f)?Q8(f):It.IsNull(f)?J8(f):It.IsString(f)?eB(f):It.IsUndefined(f)?tB(f):void 0}function nB(f){return It.IsEqual(f,BigInt(0))?Ai(void 0):void 0}function sB(f){return It.IsEqual(f,!1)?Ai(void 0):void 0}function oB(f){return It.IsEqual(f,0)?Ai(void 0):void 0}function aB(f){return Ai(void 0)}function uB(f){let m=f.toLowerCase();return It.IsEqual(m,"undefined")||It.IsEqual(m,"null")||It.IsEqual(f,"")||It.IsEqual(f,"0")?Ai(void 0):void 0}function iB(f){return Ai(void 0)}function lB(f){return It.IsBigInt(f)?nB(f):It.IsBoolean(f)?sB(f):It.IsNumber(f)?oB(f):It.IsNull(f)?aB(f):It.IsString(f)?uB(f):It.IsUndefined(f)?iB(f):void 0}function i2(f,m,L){if(It.IsBigInt(L))return L;let ne=Am.TryBigInt(L);return Am.IsOk(ne)?ne.value:L}function l2(f,m,L){if(It.IsBoolean(L))return L;let ne=Am.TryBoolean(L);return Am.IsOk(ne)?ne.value:L}function c2(f,m,L){return Av({...f,...m.$defs},hv(m.$ref),L)}function LA(f,m,L){if(m.anyOf.some(or=>$b(f,or,L)))return L;let t=m.anyOf.map(or=>Av(f,or,tv(L))).find(or=>$b(f,m,or));return It.IsUndefined(t)?L:t}function f2(f,m,L){let ne=tL(m);return LA(f,ne,L)}function p2(f,m,L){if(It.IsInteger(L))return L;let ne=Am.TryNumber(L);return Am.IsOk(ne)?Math.trunc(ne.value):L}function m2(f,m,L){let ne=OC(m);return Av(f,ne,L)}function cB(f,m,L){let ne=Am.TryBigInt(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function fB(f,m,L){let ne=Am.TryBoolean(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function pB(f,m,L){let ne=Am.TryNumber(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function mB(f,m,L){let ne=Am.TryString(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function d2(f,m,L){return It.IsEqual(m.const,L)?L:yx(m)?cB(f,m,L):Lx(m)?fB(f,m,L):OL(m)?pB(f,m,L):RL(m)?mB(f,m,L):Vf()}function b2(f,m,L){if(It.IsNull(L))return L;let ne=Am.TryNull(L);return Am.IsOk(ne)?ne.value:L}function v2(f,m,L){if(It.IsNumber(L))return L;let ne=Am.TryNumber(L);return Am.IsOk(ne)?ne.value:L}function hA(f,m,L,ne){let Ue=It.Keys(ne);for(let[t,or]of m)for(let Fr of Ue)t.test(Fr)||(ne[Fr]=Av(f,L,ne[Fr]));return ne}function HE(f,m,L){return gv(f)&&It.IsUndefined(L[m])}function dB(f,m,L){let ne=It.EntriesRegExp(m.properties),Ue=It.Keys(L);for(let[t,or]of ne)for(let Fr of Ue)!t.test(Fr)||HE(or,Fr,L)||(L[Fr]=Av(f,or,L[Fr]));return It.HasPropertyKey(m,"additionalProperties")&&It.IsObject(m.additionalProperties)?hA(f,ne,m.additionalProperties,L):L}function C2(f,m,L){return It.IsObjectNotArray(L)?dB(f,m,L):L}function bB(f,m,L){let ne=It.EntriesRegExp(m.patternProperties),Ue=It.Keys(L);for(let[t,or]of ne)for(let Fr of Ue)t.test(Fr)&&(L[Fr]=Av(f,or,L[Fr]));return It.HasPropertyKey(m,"additionalProperties")&&It.IsObject(m.additionalProperties)?hA(f,ne,m.additionalProperties,L):L}function y2(f,m,L){return It.IsObjectNotArray(L)?bB(f,m,L):L}function L2(f,m,L){return It.HasPropertyKey(f,m.$ref)?Av(f,f[m.$ref],L):L}function h2(f,m,L){if(It.IsString(L))return L;let ne=Am.TryString(L);return Am.IsOk(ne)?ne.value:L}function E2(f,m,L){let ne=Fv(m.pattern);return Av(f,ne,L)}function w2(f,m,L){if(!It.IsArray(L))return L;for(let ne=0;ne<Math.min(m.items.length,L.length);ne++)L[ne]=Av(f,m.items[ne],L[ne]);return L}function A2(f,m,L){if(It.IsUndefined(L))return L;let ne=Am.TryUndefined(L);return Am.IsOk(ne)?ne.value:L}function g2(f,m,L){if(It.IsUndefined(L))return L;let ne=Am.TryUndefined(L);return Am.IsOk(ne)?void 0:L}function Av(f,m,L){return Z0(m)?o2(f,m,L):bC(m)?a2(f,m,L):lC(m)?i2(f,m,L):Xv(m)?l2(f,m,L):Db(m)?c2(f,m,L):Cv(m)?f2(f,m,L):Sv(m)?p2(f,m,L):Bi(m)?m2(f,m,L):_0(m)?d2(f,m,L):MC(m)?b2(f,m,L):fv(m)?v2(f,m,L):Il(m)?C2(f,m,L):pv(m)?y2(f,m,L):hb(m)?L2(f,m,L):Ev(m)?h2(f,m,L):yv(m)?E2(f,m,L):dp(m)?w2(f,m,L):GC(m)?A2(f,m,L):yu(m)?LA(f,m,L):fC(m)?g2(f,m,L):L}function By(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return Av(m,L,ne)}function T2(f,m,L){if(!It.IsArray(L))return L;for(let ne=0;ne<L.length;ne++)L[ne]=xv(f,m.items,L[ne]);return L}function I2(f,m,L){return m.Default(L)}function _2(f,m,L){return xv({...f,...m.$defs},hv(m.$ref),L)}function x2(f,m){return It.IsUndefined(m)?It.IsFunction(f.default)?f.default():tv(f.default):m}function S2(f,m,L){let ne=OC(m);return xv(f,ne,L)}function O2(f,m,L){if(!It.IsObject(L))return L;let ne=It.Keys(m.properties);for(let Ue of ne){let t=xv(f,m.properties[Ue],L[Ue]);It.IsUndefined(t)&&(gv(m.properties[Ue])||!It.HasPropertyKey(m.properties[Ue],"default"))||(L[Ue]=xv(f,m.properties[Ue],L[Ue]))}if(!iy(m)||It.IsBoolean(m.additionalProperties))return L;for(let Ue of It.Keys(L))ne.includes(Ue)||(L[Ue]=xv(f,m.additionalProperties,L[Ue]));return L}function R2(f,m,L){if(!It.IsObject(L))return L;let[ne,Ue]=[new RegExp(cC(m)),Gv(m)];for(let t of It.Keys(L))ne.test(t)&&yC(Ue)&&(L[t]=xv(f,Ue,L[t]));if(!iy(m))return L;for(let t of It.Keys(L))ne.test(t)||(L[t]=xv(f,m.additionalProperties,L[t]));return L}function N2(f,m,L){return It.HasPropertyKey(f,m.$ref)?xv(f,f[m.$ref],L):L}function k2(f,m,L){if(!It.IsArray(L))return L;let[ne,Ue]=[m.items,Math.max(m.items.length,L.length)];for(let t=0;t<Ue;t++)t<ne.length&&(L[t]=xv(f,ne[t],L[t]));return L}function U2(f,m,L){for(let ne of m.anyOf){let Ue=xv(f,ne,tv(L));if($b(f,ne,Ue))return Ue}return L}function xv(f,m,L){let ne=yC(m)?x2(m,L):L;return Z0(m)?T2(f,m,ne):bC(m)?I2(f,m,ne):Db(m)?_2(f,m,ne):Bi(m)?S2(f,m,ne):Il(m)?O2(f,m,ne):pv(m)?R2(f,m,ne):hb(m)?N2(f,m,ne):dp(m)?k2(f,m,ne):yu(m)?U2(f,m,ne):ne}function wL(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return xv(m,L,ne)}function ph(f){return(...m)=>{let[L,ne,Ue]=pd.Match(m,{3:(t,or,Fr)=>[t,or,Fr],2:(t,or)=>[{},t,or]});return f.reduce((t,or)=>or(L,ne,t),Ue)}}function vB(f,m,L){return m["~codec"].decode(L)}function CB(f,m,L){return m["~codec"].encode(L)}function bv(f,m,L,ne){return Xy(L)?It.IsEqual(f,"Decode")?vB(m,L,ne):CB(m,L,ne):ne}function yB(f,m,L,ne){if(!It.IsArray(ne))return Vf();for(let Ue=0;Ue<ne.length;Ue++)ne[Ue]=ov(f,m,L.items,ne[Ue]);return bv(f,m,L,ne)}function LB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsArray(Ue))return Ue;for(let t=0;t<Ue.length;t++)Ue[t]=ov(f,m,L.items,Ue[t]);return Ue}function M2(f,m,L,ne){return It.IsEqual(f,"Decode")?yB(f,m,L,ne):LB(f,m,L,ne)}function P2(f,m,L,ne){return ne=ov(f,{...m,...L.$defs},hv(L.$ref),ne),bv(f,m,L,ne)}function hB(f,m,L,ne){for(let Ue of L.allOf)ne=ov(f,m,Ue,ne);return bv(f,m,L,ne)}function EB(f,m,L,ne){let Ue=bv(f,m,L,ne);for(let t of L.allOf)Ue=ov(f,m,t,Ue);return Ue}function D2(f,m,L,ne){return It.IsEqual(f,"Decode")?hB(f,m,L,ne):EB(f,m,L,ne)}function wB(f,m,L,ne){if(!It.IsObjectNotArray(ne))return Vf();for(let Ue of It.Keys(L.properties))!It.HasPropertyKey(ne,Ue)||HE(L.properties[Ue],Ue,ne)||(ne[Ue]=ov(f,m,L.properties[Ue],ne[Ue]));return bv(f,m,L,ne)}function AB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsObjectNotArray(Ue))return Ue;for(let t of It.Keys(L.properties))!It.HasPropertyKey(Ue,t)||HE(L.properties[t],t,Ue)||(Ue[t]=ov(f,m,L.properties[t],Ue[t]));return Ue}function $2(f,m,L,ne){return It.IsEqual(f,"Decode")?wB(f,m,L,ne):AB(f,m,L,ne)}function gB(f,m,L,ne){if(!It.IsObjectNotArray(ne))return Vf();let Ue=new RegExp(cC(L));for(let t of It.Keys(ne))Ue.test(t)||Vf(),ne[t]=ov(f,m,Gv(L),ne[t]);return bv(f,m,L,ne)}function TB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsObjectNotArray(Ue))return Ue;let t=new RegExp(cC(L));for(let or of It.Keys(Ue))t.test(or)&&(Ue[or]=ov(f,m,Gv(L),Ue[or]));return Ue}function G2(f,m,L,ne){return It.IsEqual(f,"Decode")?gB(f,m,L,ne):TB(f,m,L,ne)}function F2(f,m,L,ne){return ne=It.HasPropertyKey(m,L.$ref)?ov(f,m,m[L.$ref],ne):ne,bv(f,m,L,ne)}function IB(f,m,L,ne){if(!It.IsArray(ne))return Vf();for(let Ue=0;Ue<Math.min(L.items.length,ne.length);Ue++)ne[Ue]=ov(f,m,L.items[Ue],ne[Ue]);return bv(f,m,L,ne)}function _B(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsArray(Ue))return ne;for(let t=0;t<Math.min(L.items.length,Ue.length);t++)Ue[t]=ov(f,m,L.items[t],Ue[t]);return Ue}function j2(f,m,L,ne){return It.IsEqual(f,"Decode")?IB(f,m,L,ne):_B(f,m,L,ne)}function xB(f,m,L,ne){for(let Ue of L.anyOf){if(!$b(m,Ue,ne))continue;let t=ov(f,m,Ue,ne);return bv(f,m,L,t)}return Vf()}function SB(f,m,L,ne){let Ue=bv(f,m,L,ne);for(let t of L.anyOf){let or=ov(f,m,t,tv(Ue));if($b(m,t,or))return or}return Ue}function B2(f,m,L,ne){return It.IsEqual(f,"Decode")?xB(f,m,L,ne):SB(f,m,L,ne)}function ov(f,m,L,ne){return Z0(L)?M2(f,m,L,ne):Db(L)?P2(f,m,L,ne):Bi(L)?D2(f,m,L,ne):Il(L)?$2(f,m,L,ne):pv(L)?G2(f,m,L,ne):hb(L)?F2(f,m,L,ne):dp(L)?j2(f,m,L,ne):yu(L)?B2(f,m,L,ne):bv(f,m,L,ne)}var UI=class extends jy{constructor(m,L){super("Decode",m,L)}};function OB(f,m,L){if(!$b(f,m,L))throw new UI(L,Fy(f,m,L));return L}function RB(f,m,L){return ov("Decode",f,m,L)}var E$e=ph([(f,m,L)=>tv(L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>OB(f,m,L),(f,m,L)=>RB(f,m,L)]);var MI=class extends jy{constructor(m,L){super("Encode",m,L)}};function NB(f,m,L){if(!$b(f,m,L))throw new MI(L,Fy(f,m,L));return L}function kB(f,m,L){return ov("Encode",f,m,L)}var k$e=ph([(f,m,L)=>tv(L),(f,m,L)=>kB(f,m,L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>NB(f,m,L)]);var AC=class extends Error{constructor(m,L){super(L),this.type=m}};function H2(f,m){return It.IsFunction(m.default)?m.default(m):It.IsObject(m.default)?tv(m.default):m.default}function q2(f,m){if(lh(m)&&!yC(m))throw new AC(m,"Arrays with uniqueItems constraints must specify a default annotation");let L=uh(m)?m.minItems:0;return Array.from({length:L},()=>av(f,m.items))}async function*UB(){}function K2(f,m){return UB()}function Y2(f,m){return m.Create()}function z2(f,m){return ly(m)?BigInt(m.exclusiveMinimum)+BigInt(1):cy(m)?BigInt(m.minimum):BigInt(0)}function V2(f,m){return!1}function W2(f,m){let L=av(f,m.instanceType);return class{constructor(){Object.assign(this,L)}}}function X2(f,m){return av({...f,...m.$defs},hv(m.$ref))}function Z2(f,m){return av(f,tL(m))}function Q2(f,m){let L=av(f,m.returnType);return()=>L}function J2(f,m){return ly(m)&&It.IsNumber(m.exclusiveMinimum)?m.exclusiveMinimum+1:cy(m)?m.minimum:0}function eP(f,m){return av(f,OC(m))}function*MB(){}function tP(f,m){return MB()}function rP(f,m){return m.const}function nP(f,m){throw new AC(m,"Cannot create TNever types")}function sP(f,m){return null}function oP(f,m){return ly(m)&&It.IsNumber(m.exclusiveMinimum)?m.exclusiveMinimum+1:cy(m)?m.minimum:0}function aP(f,m){return(It.IsUndefined(m.required)?[]:m.required).reduce((ne,Ue)=>({...ne,[Ue]:av(f,m.properties[Ue])}),{})}function uP(f,m){return Promise.resolve(av(f,m.item))}function iP(f,m){if(ME(m)&&!yC(m))throw new AC(m,"Record with the minProperties constraint must have a default annotation");return{}}function lP(f,m){return It.HasPropertyKey(f,m.$ref)?av(f,f[m.$ref]):(()=>{throw new AC(m,"Unable to deref Ref")})()}function cP(f,m){if((PE(m)||kE(m))&&!yC(m))throw Error("Strings with format or pattern constraints must specify default");let ne=UE(m)?m.minLength:0;return"".padEnd(ne)}function fP(f,m){return Symbol()}function pP(f,m){let L=Fv(m.pattern);if(Ev(L))throw new AC(m,"Unable to create TemplateLiteral due to infinite type expansion");return av(f,L)}function mP(f,m){return Array.from({length:m.minItems},(L,ne)=>av(f,m.items[ne]))}function dP(f,m){if(It.IsEqual(m.anyOf.length,0))throw Error("Unable to create Union with no variants");return av(f,m.anyOf[0])}function av(f,m){return yC(m)?H2(f,m):Z0(m)?q2(f,m):Kv(m)?K2(f,m):bC(m)?Y2(f,m):lC(m)?z2(f,m):Xv(m)?V2(f,m):Tv(m)?W2(f,m):Db(m)?X2(f,m):Cv(m)?Z2(f,m):Iv(m)?Q2(f,m):Sv(m)?J2(f,m):Bi(m)?eP(f,m):Yv(m)?tP(f,m):_0(m)?rP(f,m):ty(m)?nP(f,m):MC(m)?sP(f,m):fv(m)?oP(f,m):Il(m)?aP(f,m):$v(m)?uP(f,m):pv(m)?iP(f,m):hb(m)?lP(f,m):Ev(m)?cP(f,m):PC(m)?fP(f,m):yv(m)?pP(f,m):dp(m)?mP(f,m):GC(m)?void 0:yu(m)?dP(f,m):fC(m)?void 0:void 0}function VC(...f){let[m,L]=pd.Match(f,{2:(ne,Ue)=>[ne,Ue],1:ne=>[{},ne]});return av(m,L)}var PI=class extends jy{constructor(m,L){super("Parse",m,L)}};function PB(f,m,L){if(!$b(f,m,L))throw new PI(L,Fy(f,m,L));return L}var $Ge=ph([(f,m,L)=>tv(L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>PB(f,m,L)]);var $B=ul({type:mp("insert"),path:sC(),value:Pv()}),GB=Object({type:mp("update"),path:sC(),value:Pv()}),FB=ul({type:mp("delete"),path:sC()}),KGe=xc([$B,GB,FB]);function qE(f){if(!f.body)throw new Error("This command does not accept a request body");let m=f.body;return m.examples?.length?m.examples[0]:VC(m)}var CP=NA(require("node:fs"));function KE(f){if(f.file){let m=CP.default.readFileSync(f.file==="-"?0:f.file,"utf-8");return JSON.parse(m)}if(f.data)return JSON.parse(f.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function uC(f){process.stdout.write(`${JSON.stringify(f,null,2)}
|
|
104
|
+
`)}return f instanceof Error?`Error: ${f.message}`:String(f)}function Yk(f,m){return async function(ne,Ue={}){let{body:t,params:or,query:Fr}=Ue,e;if("url"in ne)e=ne.url;else{if(!or)throw new QL("Internal error: params required for this endpoint");e=ne.buildUrl(or)}let Yn=qk(`${f}${e}`,Fr),Vn={Accept:"application/json",Authorization:`Bearer ${m}`,[Gg]:"cli",[Fg]:"1.0.2",[jg]:"55b4428",[Bg]:"2026-02-24T10:36:21.051Z"};t&&(Vn["Content-Type"]="application/json");let Xr=await(await fetch(Yn,{method:ne.method,headers:Vn,body:t?JSON.stringify(t):void 0})).json();if(Xr.error)throw QL.fromErrorResponse(Xr.error,Xr.requestId);return Xr.data}}var m9=1e3,d9=60*m9,b9=60*d9,Xw=24*b9,$Ee=7*Xw,GEe=30*Xw;var Hg=["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 zk=ge.Object({type:ge.Literal("number"),number:ge.String()}),v9=ge.Object({type:ge.Literal("string"),string:ge.String()}),C9=ge.Object({type:ge.Literal("timestamp"),timestamp:ge.String()}),qg=Xf("type",[zk,v9,C9]),y9=ge.Object({by:ge.Record(ge.String(),qg),computed:ge.Record(ge.String(),zk)}),Vk=ge.Object({buckets:ge.Array(y9)});var oy=ge.Object({from:ge.Optional(ge.Number({description:"Start timestamp in seconds"})),to:ge.Optional(ge.Number({description:"End timestamp in seconds"}))},{title:"TimeRange",description:"Time range to query",examples:[{from:1704067200,to:1704067200}]}),wC=ge.Object({from:ge.Integer({description:"Start timestamp in seconds",examples:[1704067200]}),to:ge.Integer({description:"End timestamp in seconds",examples:[1704067200]})},{title:"TimeRange",description:"Time range to query",examples:[{from:1704067200,to:1704067200}]});var L9="/v0/aggregation",h9=ge.Union([ge.Literal("a"),ge.Literal("d"),ge.Literal("q"),ge.Literal("w"),ge.Literal("h")]),E9=ge.Object({parallelism:ge.Number(),engine:h9,recordBatchCache:ge.Optional(ge.Boolean()),includeNullGroups:ge.Optional(ge.Boolean()),shadow:ge.Optional(ge.Boolean())}),qC=["logs","metrics","traces"];var sE=ge.Enum(qC,{description:"Data source being queried for this aggregation"}),JL=ms({description:"Attribute containing the values to aggregate"}),w9=Xf("type",[ge.Object({type:ge.Literal("count",{description:"Counts the total number of records"})},{$id:"AggregateCount",title:"Count"}),ge.Object({type:ge.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:JL},{$id:"AggregateUniqueCount",title:"UniqueCount"}),ge.Object({type:ge.Literal("average",{description:"Calculates the average value of the selected field"}),field:JL},{$id:"AggregateAverage",title:"Average"}),ge.Object({type:ge.Literal("max",{description:"Finds the largest value of the field"}),field:JL},{$id:"AggregateMax",title:"Max"}),ge.Object({type:ge.Literal("min",{description:"Finds the smallest value of the field"}),field:JL},{$id:"AggregateMin",title:"Min"}),ge.Object({type:ge.Literal("sum",{description:"Sums the values of the selected field"}),field:JL},{$id:"AggregateSum",title:"Sum"}),ge.Object({type:ge.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:JL,percentile:ge.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),A9=Xf("type",[ge.Object({type:ge.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),ge.Object({type:ge.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),ge.Object({type:ge.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),ge.Object({type:ge.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),ge.Object({type:ge.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics automatically handling counter resets. When used with an aggregation like `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),ge.Object({type:ge.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:ms({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),ge.Object({type:ge.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:ge.Integer({description:"The base of the logarithm",minimum:2})},{$id:"FunctionLog",title:"Log"}),ge.Object({type:ge.Literal("power",{description:"Raises values to a specified power"}),exponent:ge.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),ge.Object({type:ge.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"})],{title:"Function"});var g9=Xf("type",[ge.Object({type:ge.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),ge.Object({type:ge.Literal("timeseries"),aggregationWindow:ms({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"})]),Kg=15,T9=["zero","null"],I9=ge.Enum(T9),_9=ge.Object({mode:ge.Object({type:I9})}),Wk={aggregate:w9,functions:ge.Optional(ge.Array(A9,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:ge.Optional(_9)},Xk={maxItems:Kg,description:"Aggregations that may be combined together in the same query"},oE=ge.Array(ge.Object({...Wk,filter:ge.Optional(ms({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),Xk),aE=ge.Array(ge.Object({...Wk,filter:ms({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),Xk);var uE=ms({type:"math-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),x9=ge.Object({fields:ge.Array(ms(),{maxItems:1}),limit:ge.Number()},{title:"AggregationGroupBy"}),S9=7,iE=ge.Array(x9,{maxItems:S9,description:"Fields used to group the results"}),twe=ao({tags:["aggregation"],url:`${L9}/multi-query`,method:"POST",body:ge.Object({timeRange:wC,queries:oE,groupBy:ge.Optional(iE),returnType:g9,dataSource:sE,formula:uE,executionOptions:E9,triggeredBy:ge.Optional(ge.Literal("refresh")),shouldStreamResults:ge.Optional(ge.Boolean()),clusterId:ge.Optional(ms({allowEmpty:!1}))}),response:Vk}),O9=["per-second","per-minute","per-hour","rate"],oL=ge.Enum(O9),rwe=Xf("type",[ge.Object({type:ge.Literal("count"),count:ge.Object({field:ge.Optional(ms()),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("average"),average:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("min"),min:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("max"),max:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("sum"),sum:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("percentile"),percentile:ge.Object({field:ms(),percentile:ge.Number(),timeNormalization:ge.Optional(oL)})}),ge.Object({type:ge.Literal("uniqueCount"),uniqueCount:ge.Object({field:ms(),timeNormalization:ge.Optional(oL)})})]),R9=ge.Object({type:ge.Literal("time"),time:ge.Object({interval:ms()})}),N9=ge.Object({type:ge.Literal("histogram"),histogram:ge.Object({field:ms(),interval:ge.Number(),bounds:ge.Optional(ge.Object({min:ge.Number(),max:ge.Number()}))})}),k9=ge.Object({type:ge.Literal("topList"),topList:ge.Object({field:ms(),size:ge.Number(),orderBy:ge.Optional(ge.Object({computeRef:ms(),order:ge.Union([ge.Literal("asc"),ge.Literal("desc")])}))})}),nwe=Xf("type",[R9,N9,k9]);var U9="^\\S(.*\\S)?$",M9=ge.Object({key:ge.String({maxLength:128}),value:ge.String({maxLength:256,pattern:U9})},{title:"Tag"}),P9=ge.Array(M9,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),iv=ge.Optional(P9);var Py="/v0/teams",Yg=["public","private"],Zk=ge.Object({color:ge.Enum(Dg),mode:ge.Enum($g),iconName:ge.Enum(Dk)}),zg=ge.Object({color:ge.Enum(Dg),mode:ge.Enum($g)}),D9=100,$9=250,eh=ge.Object({id:ge.String({description:"Identifier of the team"}),name:ge.String({description:"Human readable team name displayed throughout the app"}),description:ge.Optional(ge.String()),visibility:ge.Enum(Yg,{description:"Controls whether the resources of the team are discoverable by users"}),tags:iv,createdAt:jl(),updatedAt:jl(),memberCount:ge.Optional(ge.Number({description:"Number of members currently in the team"})),avatar:ge.Optional(Zk)}),Zw=ge.Object({name:ge.String({minLength:1,maxLength:D9,description:"Name to assign to the team"}),description:ge.Optional(ge.String({maxLength:$9})),visibility:ge.Enum(Yg,{description:"Controls whether the resources of the team are discoverable by users"}),tags:iv,avatar:ge.Optional(Zk)}),G9=ge.Object({id:ge.String(),name:ge.String(),email:ge.String(),role:ge.Enum(rE),joinedTeamAt:jl(),orgRole:ge.Enum(Uk),avatar:ge.Optional(zg)}),Cwe=ao({tags:["teams"],url:Py,method:"GET",response:ge.Array(eh),query:ge.Optional(ge.Object({includeMemberCount:ge.Optional(ge.Boolean())}))}),ywe=ao({tags:["teams"],url:`${Py}/:id`,method:"GET",params:ge.Object({id:ms()}),response:eh}),Lwe=ao({tags:["teams"],url:`${Py}/:id/members`,method:"GET",params:ge.Object({id:ms()}),response:ge.Array(G9)}),hwe=ao({tags:["teams"],url:`${Py}/:id/assets`,method:"GET",params:ge.Object({id:ms()}),response:ge.Object({apiKeyCount:ge.Number(),logRouteCount:ge.Number(),monitorCount:ge.Number(),notificationRuleCount:ge.Number(),dashboardCount:ge.Number()})}),Ewe=ao({tags:["teams"],url:Py,method:"POST",body:Zw,response:eh}),wwe=ao({tags:["teams"],url:`${Py}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:Zw,response:eh}),Awe=ao({tags:["teams"],url:`${Py}/bulk-update`,method:"POST",body:ge.Object({teamIds:ge.Array(ms(),{maxItems:100}),config:ge.Object({visibility:ge.Enum(Yg)})}),response:ge.Object({})}),gwe=ao({tags:["teams"],url:`${Py}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var F9=ge.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),wv=Xf("type",[ge.Object({type:ge.Literal("user"),id:ge.String(),name:ge.String(),avatar:ge.Optional(zg)}),ge.Object({type:ge.Literal("operation-api-key"),id:ge.String(),name:ge.String(),source:ge.Optional(F9)})]);var aL="/v0/dashboards",j9=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],B9=["timeseries","top-list","pie","query-value","bar","list"],jwe=[...B9,"note"],H9=["ns","us","ms","s","m","h","days"];var q9=["B","KB","MB","GB","TB","PB"];var th=Xf("type",[ge.Object({type:ge.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:ge.Enum(H9,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),ge.Object({type:ge.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:ge.Enum(q9,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),ge.Object({type:ge.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),ge.Object({type:ge.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),ge.Object({type:ge.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),ge.Object({type:ge.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:ge.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"})],{title:"Normalizer"}),K9=ge.Object({attribute:ge.String({description:"Attribute displayed as a column in the log list"}),normalizer:ge.Optional(th)},{title:"WidgetListColumn"}),Y9=["background","no-background"],z9=["table","legend-only","no-legend"];var V9=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],tU=["alert","warning","success"],W9=ge.Object({operator:ge.Enum(V9,{description:"Comparator used to evaluate the metric value"}),value:ge.Number({description:"Threshold value used when evaluating the operator"}),color:ge.Enum(tU,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),X9=ge.Object({value:ge.Number({description:"Y-axis value where the threshold marker is placed"}),level:ge.Enum(tU,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),Z9=["sec","min","hour","day"],Qk=ge.Object({time:ge.Number({description:"Number of units that make up each bar bucket"}),metric:ge.Enum(Z9,{description:"Unit used to measure the bucket width"})});var Jk=ge.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),rU={source:sE,queries:oE,formula:ge.Optional(uE),visibleSeries:ge.Optional(ge.Array(ge.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Qw={...rU,groupBy:ge.Optional(iE)},Jw=ge.Enum(z9,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),lE=ge.Optional(ge.Number({description:"Number of decimal places to display in the value"})),eU=ge.Optional(ge.Array(X9,{description:"Threshold markers displayed on the chart"})),Q9=Xf("type",[ge.Object({type:ge.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Qw,timeBucket:ge.Optional(Qk),normalizer:ge.Optional(th),precision:lE,legendMode:ge.Optional(Jw),thresholds:eU},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),ge.Object({type:ge.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Qw,normalizer:ge.Optional(th),precision:lE},{$id:"GraphVisualizationTopList",title:"TopList"}),ge.Object({type:ge.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Qw,normalizer:ge.Optional(th),precision:lE,legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationPie",title:"Pie"}),ge.Object({type:ge.Literal("query-value",{description:"Displays the aggregation as a single value"}),...rU,backgroundMode:ge.Optional(ge.Enum(Y9,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:ge.Optional(ge.Array(W9,{description:"Conditional formatting rules applied to the displayed value"})),precision:lE,normalizer:ge.Optional(th),legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),ge.Object({type:ge.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Qw,timeBucket:ge.Optional(Qk),precision:lE,normalizer:ge.Optional(th),thresholds:eU,legendMode:ge.Optional(Jw)},{$id:"GraphVisualizationBar",title:"Bar"}),ge.Object({type:ge.Literal("list",{description:"Displays matching logs in a tabular list"}),source:ge.Literal("logs",{description:"Indicates that the widget queries logs"}),query:ms({type:"tsuga-query",description:"Log query that selects records for the list"}),listColumns:ge.Optional(ge.Array(K9,{description:"Custom columns to display for each log entry"}))},{$id:"GraphVisualizationList",title:"List"}),ge.Object({type:ge.Literal("note",{description:"Displays static text on the dashboard"}),note:ge.Optional(ms({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:ge.Optional(ge.Enum(j9,{description:"Background color used to render the note"})),noteAlign:ge.Optional(Jk),noteJustifyContent:ge.Optional(Jk)},{$id:"GraphVisualizationNote",title:"Note"})]),nU=ge.Object({id:ms({description:"Identifier of the graph widget"}),name:ge.Optional(ms({description:"Display name of the graph widget"})),description:ge.Optional(ge.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:Q9,layout:ge.Optional(ge.Object({x:ge.Number({description:"Horizontal grid position of the widget"}),y:ge.Number({description:"Vertical grid position of the widget"}),w:ge.Number({description:"Width of the widget in grid units"}),h:ge.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),J9=10,sU=ge.Array(ge.Object({key:ms({description:"Filter key"}),values:ge.Array(ms({description:"Filter value"}))}),{maxItems:J9,description:"Filters applied to every widget on the dashboard"}),rh=ge.Object({id:ge.String({description:"Identifier of the dashboard"}),name:ge.String({description:"Display name of the dashboard"}),owner:ge.String({description:"Team ID that owns and manages the dashboard"}),graphs:ge.Array(nU,{description:"Ordered widgets that compose the dashboard"}),filters:ge.Optional(sU),createdAt:jl(),updatedAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv),tags:iv,timePreset:ge.Optional(ge.Enum(Hg))}),eA=ge.Object({name:ms({description:"Display name of the dashboard"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:ge.Array(nU,{description:"Ordered widgets that compose the dashboard"}),filters:ge.Optional(sU),tags:iv,timePreset:ge.Optional(ge.Enum(Hg))}),Vg=ge.Object({owners:ge.Optional(ge.Array(ms({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),Bwe=ao({tags:["dashboards"],url:aL,method:"GET",query:Vg,response:ge.Array(rh)}),Hwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"GET",params:ge.Object({id:ms()}),response:rh}),qwe=ao({tags:["dashboards"],url:aL,method:"POST",body:eA,response:rh}),Kwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Partial(eA),response:rh}),Ywe=ao({tags:["dashboards"],url:`${aL}/bulk-update`,method:"PUT",body:ge.Object({dashboardIds:ge.Array(ms()),owner:ms({allowEmpty:!1})}),response:ge.Object({})}),zwe=ao({tags:["dashboards"],url:`${aL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),Vwe=ao({tags:["dashboards"],url:`${aL}/bulk-delete`,method:"DELETE",body:ge.Object({ids:ge.Array(ms())}),response:ge.Object({})});var cE=`/${"v1"}/dashboards`,fE=ge.Pick(rh,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),eF={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(fE,{examples:[eF]});var tF=ge.Pick(Vg,["owners"]),oU=ao({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:cE,method:"GET",query:tF,response:ge.Array(fE)}),aU=ao({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:fE}),Wg=ge.Pick(eA,["name","owner","graphs","filters","tags","timePreset"]),rF={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(Wg,{examples:[rF]});var uU=ao({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:cE,method:"POST",body:Wg,response:fE}),iU=ao({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:ge.Partial(Wg),response:fE}),lU=ao({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${cE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var nF=100,sF=3,pE=ge.Object({id:ge.String(),name:ge.String(),keyLastCharacters:ge.String(),owner:ge.String(),tags:iv,teamOverrideFields:ge.Optional(ge.Array(ge.String())),updatedAt:jl(),createdAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv),lastSyncedAt:ge.Optional(jl()),assetUpdatedAt:jl()}),tA=ge.Object({name:ge.String({minLength:1,maxLength:nF}),owner:ms({allowEmpty:!1}),tags:iv,teamOverrideFields:ge.Optional(ge.Array(ms({allowEmpty:!1}),{minItems:1,maxItems:sF}))}),rA="/v0/ingestion-api-keys",mAe=ao({tags:["ingestion-api-keys"],url:rA,method:"POST",body:tA,response:ge.Intersect([pE,ge.Object({key:ge.String()})])}),dAe=ao({tags:["ingestion-api-keys"],url:rA,method:"GET",response:ge.Array(pE)}),bAe=ao({tags:["ingestion-api-keys"],url:`${rA}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:tA,response:pE}),vAe=ao({tags:["ingestion-api-keys"],url:`${rA}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var nA=`/${"v1"}/ingestion-api-keys`,sA=ge.Pick(pE,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),cU={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(sA,{examples:[cU]});var Xg=ge.Pick(tA,["name","owner","tags","teamOverrideFields"]),oF={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Xg,{examples:[oF]});var aF={...cU,key:"tsuga_in:v1:abc123xyx7Qm"},fU=ao({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:nA,method:"GET",response:ge.Array(sA)}),uF=ge.Omit(sA,["examples"]),pU=ao({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:nA,method:"POST",body:Xg,response:ge.Intersect([uF,ge.Object({key:ge.String()})],{example:aF})}),mU=ao({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${nA}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:Xg,response:sA}),dU=ao({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${nA}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var KC="/v0/monitors",iF=["all","owning-team-and-public","owning-team-only"],bU=ge.Enum(iF,{description:"This controls which data the monitor can see"}),vU=["alert","resolve","keep_last_status","consider_zero"],CU=["alert","resolve","keep_last_status"];var lF=["no_aggregation","all","any","each","proportion"],cF=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var yU=ge.Object({formula:ms({type:"math-formula"}),operator:ge.Enum(cF),threshold:ge.Number()}),LU=ge.Object({formula:ms({type:"math-formula"}),conditionType:ge.Enum(["rate","error","cpu","general","to_be_set"])}),fF=["rate","error","cpu","general"],PAe=ge.Enum(fF),YC=[1,2,3,4,5];var oA={timeframe:ge.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:ge.Array(ge.Object({fields:ge.Array(ms()),limit:ge.Number()}),{maxItems:1}),aggregationAlertLogic:ge.Optional(ge.Enum(lF)),proportionAlertThreshold:ge.Optional(ge.Integer({minimum:1,maximum:99}))},Zg=ge.Object({type:ge.Literal("metric"),condition:yU,noDataBehavior:ge.Enum(vU),...oA,queries:aE},{$id:"MonitorConfigurationMetric"}),Qg=ge.Object({type:ge.Literal("log"),condition:yU,noDataBehavior:ge.Enum(vU),...oA,queries:aE},{$id:"MonitorConfigurationLog"}),Jg=ge.Object({type:ge.Literal("anomaly-log"),condition:LU,noDataBehavior:ge.Enum(CU),...oA,queries:aE},{$id:"MonitorConfigurationAnomalyLog"}),eT=ge.Object({type:ge.Literal("anomaly-metric"),condition:LU,noDataBehavior:ge.Enum(CU),...oA,queries:aE},{$id:"MonitorConfigurationAnomalyMetric"}),hU=ge.Object({type:ge.Literal("certificate-expiry"),warnBeforeInDays:ge.Integer({minimum:1,maximum:365}),cloudAccounts:ge.Optional(ge.Array(ge.String(),{minItems:1})),aggregationAlertLogic:ge.Literal("each"),noDataBehavior:ge.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),pF=ge.Object({type:ge.Literal("log-error-pattern"),aggregationAlertLogic:ge.Literal("each"),noDataBehavior:ge.Literal("keep_last_status"),filter:ge.Object({teamIds:ge.Array(ge.String()),env:ge.String(),service:ge.Optional(ge.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),EU=Xf("type",[Zg,Qg,Jg,eT,pF,hU]),Dy=ge.Object({id:ge.String({description:"Identifier of the monitor"}),name:ge.String({description:"Display name of the monitor"}),owner:ge.String({description:"Team ID that owns and manages the monitor"}),message:ge.Optional(ge.String({description:"Message to be displayed if a notification is triggered"})),tags:iv,configuration:EU,priority:ge.Enum(YC,{description:"Priority of the monitor"}),permissions:bU,dashboardId:ge.Optional(ge.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:ge.Optional(jl()),creator:ge.Optional(wv),updater:ge.Optional(wv),createdAt:jl(),updatedAt:jl(),lastSyncedAt:ge.Optional(jl()),assetUpdatedAt:jl()},{title:"Monitor"}),mF=Xf("type",[Zg,Qg,Jg,eT,hU]),DAe=ge.Object({...Dy.properties,configuration:mF},{title:"Monitor"}),$Ae=ge.Object({...Dy.properties,configuration:Xf("type",[Zg,Qg,Jg,eT])},{title:"Monitor"}),aA=ge.Object({name:ms(),message:ge.Optional(ms({type:"long"})),tags:iv,configuration:EU,priority:ge.Enum(YC),owner:ms({allowEmpty:!1}),dashboardId:ge.Optional(ms()),pauseUntil:ge.Optional(ms({allowEmpty:!1,type:"date-time"})),permissions:bU});var GAe=ao({tags:["monitors"],url:KC,method:"GET",response:ge.Array(Dy),query:ge.Optional(ge.Object({owners:ge.Optional(ge.Array(ms({allowEmpty:!1})))}))}),FAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"GET",params:ge.Object({id:ms()}),response:Dy}),jAe=ao({tags:["monitors"],url:KC,method:"POST",body:aA,response:Dy}),BAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:aA,response:Dy}),HAe=ao({tags:["monitors"],url:`${KC}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),dF=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],uL=ge.Enum(dF),bF=Xf("type",[ge.Object({type:ge.Literal("each"),subStates:ge.Record(ge.String(),ge.Object({stateValue:ge.Union([uL,ge.Null()]),lastChangedAt:jl()}))}),ge.Object({type:ge.Literal("no_aggregation"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("any"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("all"),stateValue:ge.Optional(uL)}),ge.Object({type:ge.Literal("proportion"),stateValue:ge.Optional(uL)})]),vF=ge.Object({monitorId:ge.String(),currentState:bF,lastChangedAt:ge.Optional(jl())}),qAe=ao({tags:["monitors"],url:`${KC}/states/:id`,method:"GET",params:ge.Object({id:ms()}),response:vF}),KAe=ao({tags:["monitors"],url:`${KC}/:id/transitions`,method:"GET",params:ge.Object({id:ms()}),query:ge.Object({from:ge.Number(),to:ge.Number()}),response:ge.Array(ge.Object({id:ge.String(),createdAt:jl(),fromState:ge.Optional(uL),toState:ge.Optional(uL),dimension:ge.Optional(ge.String())}))}),CF=["unprocessed","processed","failed-to-process"],YAe=ao({tags:["monitors"],url:`${KC}/:id/results`,method:"GET",params:ge.Object({id:ms()}),query:ge.Object({from:ge.Number(),to:ge.Number()}),response:ge.Object({isTruncated:ge.Boolean(),results:ge.Array(ge.Object({id:ge.String(),evaluationAt:jl(),formulaResult:ge.Object({groups:ge.Array(ge.Object({groupKey:ge.Record(ge.String(),qg),result:ge.Union([ge.Number(),ge.Literal("NaN")]),conditionMet:ge.Enum(["true","false","nan-no-data"])}))}),createdAt:jl(),status:ge.Enum(CF)}))})});var mE=`/${"v1"}/monitors`,dE=ge.Pick(Dy,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),yF={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"}],condition:{formula:"q1",operator:"greater_than",threshold:100},noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all"};Object.assign(dE,{examples:[yF]});var wU=ao({description:"Retrieve all monitors",operationId:"listMonitors",tags:["monitors"],url:mE,method:"GET",response:ge.Array(dE)}),AU=ao({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${mE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:dE}),tT=ge.Pick(aA,["name","message","tags","configuration","priority","owner","dashboardId","permissions"]),LF={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"}],condition:{formula:"q1",operator:"greater_than",threshold:100},noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all"};Object.assign(tT,{examples:[LF]});var gU=ao({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:mE,method:"POST",body:tT,response:dE}),TU=ao({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${mE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:tT,response:dE}),IU=ao({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${mE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var bE="/v0/notifications",lL=`${bE}/rules`,_U=`${bE}/slack/setup`,uA=`${bE}/integrations`,iL=["triggered","resolved","no-data"],hF=["sent","stale","pending","rate-limited","failed","silenced"],xU=ge.Optional(ge.Object({maxMessages:ge.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:ge.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),SU=ge.Optional(ge.Object({mode:ge.Literal("each"),renotificationStates:ge.Array(ge.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:ge.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),EF=ge.Object({id:ms({description:"Identifier of the notification target"}),rateLimit:xU,config:Xf("type",[ge.Object({type:ge.Literal("slack"),channel:ms({description:"Slack channel ID that receives the notification"}),integrationId:ms({description:"Slack workspace ID that receives the notification"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Slack message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Slack message"}))},{$id:"RuleTargetInputSlack"}),ge.Object({type:ge.Literal("incident-io"),integrationId:ms({description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),ge.Object({type:ge.Literal("pagerduty"),integrationId:ms({description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),ge.Object({type:ge.Literal("email"),addresses:ge.Array(ms({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),ge.Object({type:ge.Literal("grafana-irm"),integrationId:ms({description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),ge.Object({type:ge.Literal("microsoft-teams"),integrationId:ms({description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),ge.Object({type:ge.Literal("webhook"),integrationId:ms({description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),ge.Object({type:ge.Literal("servicenow"),integrationId:ms({description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),ge.Object({type:ge.Literal("google-chat"),integrationId:ms({description:"Identifier of the Google Chat integration to use"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Google Chat message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Google Chat message"}))},{$id:"RuleTargetInputGoogleChat"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:SU}),wF=ge.Object({id:ge.String({description:"Identifier of the notification target"}),rateLimit:xU,renotifyConfig:SU,config:Xf("type",[ge.Object({type:ge.Literal("slack"),channel:ge.String({description:"Slack channel ID that receives the notification"}),integrationId:ge.String({description:"Slack workspace ID that receives the notification"}),integrationName:ge.String({description:"Human readable name of the Slack integration"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Slack message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Slack message"}))},{$id:"RuleTargetConfigSlack"}),ge.Object({type:ge.Literal("incident-io"),integrationId:ge.String({description:"Identifier of the incident.io integration to use"}),integrationName:ge.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),ge.Object({type:ge.Literal("email"),addresses:ge.Array(ge.String({format:"email"}),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),ge.Object({type:ge.Literal("grafana-irm"),integrationId:ge.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:ge.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),ge.Object({type:ge.Literal("pagerduty"),integrationId:ge.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:ge.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),ge.Object({type:ge.Literal("microsoft-teams"),integrationId:ge.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:ge.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),ge.Object({type:ge.Literal("webhook"),integrationId:ge.String({description:"Identifier of the webhook integration to use"}),integrationName:ge.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),ge.Object({type:ge.Literal("servicenow"),integrationId:ge.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:ge.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),ge.Object({type:ge.Literal("google-chat"),integrationId:ge.String({description:"Identifier of the Google Chat integration to use"}),integrationName:ge.String({description:"Human readable name of the Google Chat integration"}),hideTransition:ge.Optional(ge.Boolean({description:'When true, the transition info (e.g., "from ok to alert") is hidden from the Google Chat message'})),hideTime:ge.Optional(ge.Boolean({description:"When true, the timestamp is hidden from the Google Chat message"}))},{$id:"RuleTargetConfigGoogleChat"})],{description:"Configuration describing how the alert was delivered"})}),rT=Xf("type",[ge.Object({type:ge.Literal("specific-teams"),teams:ge.Array(ms(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),ge.Object({type:ge.Literal("all-teams")}),ge.Object({type:ge.Literal("all-public-teams")})]),vE=ge.Object({name:ms({description:"Display name of the notification rule"}),queryString:ge.Optional(ms({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:rT,prioritiesFilter:ge.Array(ge.Enum(YC),{maxItems:YC.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{maxItems:iL.length,description:"Alert state transitions that can trigger a notification"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:iv,isActive:ge.Boolean(),targets:ge.Array(EF,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),nT=Xf("type",[ge.Object({type:ge.Literal("specific-teams"),teams:ge.Array(ge.String(),{description:"Team IDs to select"})}),ge.Object({type:ge.Literal("all-teams")}),ge.Object({type:ge.Literal("all-public-teams")})]),nh=ge.Object({id:ge.String({description:"Identifier of the notification rule"}),name:ge.String({description:"Display name of the notification rule"}),queryString:ge.Optional(ge.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:nT,prioritiesFilter:ge.Array(ge.Enum(YC),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{description:"Alert state transitions that can trigger a notification"}),owner:ge.String({description:"Team ID that owns and manages the rule"}),createdAt:jl(),updatedAt:jl(),isActive:ge.Boolean(),tags:iv,targets:ge.Array(wF,{description:"Notification targets that can receive notifications when the rule matches"}),creator:ge.Optional(wv),updater:ge.Optional(wv)}),pge=ao({tags:["notification-rules"],url:lL,method:"GET",response:ge.Array(nh)}),mge=ao({tags:["notification-rules"],url:`${lL}/:id`,params:ge.Object({id:ms()}),method:"GET",response:nh}),dge=ao({tags:["notification-rules"],url:lL,method:"POST",body:vE,response:nh}),bge=ao({tags:["notification-rules"],url:`${lL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:vE,response:nh}),vge=ao({tags:["notification-rules"],url:`${lL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),Cge=ao({tags:["notification-integrations"],url:`${_U}/start`,method:"POST",response:ge.Object({redirectUrl:ge.String()})}),AF=ge.Object({id:ge.String(),name:ge.String(),type:ge.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat"]),createdAt:jl(),ruleCount:ge.Number(),creator:ge.Optional(wv)}),yge=ao({tags:["notification-integrations"],url:`${lL}/integrations`,method:"GET",response:ge.Array(AF)}),Lge=ao({tags:["notification-integrations"],url:`${_U}/callback`,method:"GET",query:ge.Object({code:ms()}),response:ge.Object({success:ge.Boolean()})}),sT=["POST","PUT"],gF=ge.Record(ge.String(),ge.String()),TF=ge.Record(ge.String(),ge.Unknown()),IF=ge.Record(ge.String(),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))])),_F=Xf("type",[ge.Object({type:ge.Literal("json"),value:TF}),ge.Object({type:ge.Literal("form"),value:IF})]),xF=ge.Object({ok:ge.String(),alert:ge.String()}),oT=ge.Object({id:ge.String(),name:ge.String(),setting:Xf("type",[ge.Object({type:ge.Literal("incident-io"),alertSourceConfigId:ge.String(),tokenLastChars:ge.String()}),ge.Object({type:ge.Literal("grafana-irm"),urlLastChars:ge.String()}),ge.Object({type:ge.Literal("pagerduty"),integrationKeyLastChars:ge.String()}),ge.Object({type:ge.Literal("microsoft-teams"),webhookUrlLastChars:ge.String()}),ge.Object({type:ge.Literal("webhook"),urlLastChars:ge.String(),method:ge.Enum(sT),authentication:Xf("type",[ge.Object({type:ge.Literal("bearer"),tokenLastChars:ge.String()}),ge.Object({type:ge.Literal("basic"),username:ge.String(),passwordLastChars:ge.String()}),ge.Object({type:ge.Literal("custom-header"),key:ge.String(),valueLastChars:ge.String()}),ge.Object({type:ge.Literal("none")})]),customHeaders:ge.Optional(gF),payloadTemplate:_F,eventNameMapping:ge.Optional(xF)}),ge.Object({type:ge.Literal("servicenow"),instanceName:ge.String(),username:ge.String(),passwordLastChars:ge.String()}),ge.Object({type:ge.Literal("google-chat"),webhookUrlLastChars:ge.String()})]),tags:iv}),SF=ge.Object({type:ge.Literal("webhook"),url:ms({type:"uri"}),method:ge.Enum(sT),authentication:Xf("type",[ge.Object({type:ge.Literal("bearer"),token:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("basic"),username:ms({allowEmpty:!1}),password:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("custom-header"),key:ms({allowEmpty:!1}),value:ms({allowEmpty:!1})}),ge.Object({type:ge.Literal("none")})]),customHeaders:ge.Record(ms({allowEmpty:!1}),ms()),payloadTemplate:Xf("type",[ge.Object({type:ge.Literal("json"),value:ge.Record(ms({allowEmpty:!1}),ge.Unknown())}),ge.Object({type:ge.Literal("form"),value:ge.Record(ms({allowEmpty:!1}),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))]))})]),eventNameMapping:ge.Optional(ge.Object({ok:ms({allowEmpty:!1}),alert:ms({allowEmpty:!1})}))}),OU=ge.Object({type:ge.Literal("incident-io"),alertSourceConfigId:ms(),token:ms()}),RU=ge.Object({type:ge.Literal("grafana-irm"),url:ms({type:"uri"})}),NU=ge.Object({type:ge.Literal("pagerduty"),integrationKey:ms()}),kU=ge.Object({type:ge.Literal("microsoft-teams"),webhookUrl:ms({type:"uri"})}),OF=ge.Object({type:ge.Literal("servicenow"),instanceName:ms({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:ms({allowEmpty:!1}),password:ms({allowEmpty:!1})}),RF=ge.Object({type:ge.Literal("google-chat"),webhookUrl:ms({type:"uri"})}),NF=ge.Object({name:ms(),setting:Xf("type",[OU,RU,NU,kU,SF,OF,RF]),tags:iv}),kF=ge.Object({type:ge.Literal("webhook"),url:ge.Optional(ms({type:"uri"})),method:ge.Optional(ge.Enum(sT)),authentication:ge.Optional(Xf("type",[ge.Object({type:ge.Literal("bearer"),token:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("basic"),username:ge.Optional(ms({allowEmpty:!1})),password:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("custom-header"),key:ge.Optional(ms({allowEmpty:!1})),value:ge.Optional(ms({allowEmpty:!1}))}),ge.Object({type:ge.Literal("none")})])),customHeaders:ge.Optional(ge.Record(ms({allowEmpty:!1}),ms())),payloadTemplate:ge.Optional(Xf("type",[ge.Object({type:ge.Literal("json"),value:ge.Record(ms({allowEmpty:!1}),ge.Unknown())}),ge.Object({type:ge.Literal("form"),value:ge.Record(ms({allowEmpty:!1}),ge.Union([ge.String(),ge.Number(),ge.Boolean(),ge.Null(),ge.Array(ge.Union([ge.String(),ge.Number(),ge.Boolean()]))]))})])),eventNameMapping:ge.Optional(ge.Object({ok:ge.Optional(ms({allowEmpty:!1})),alert:ge.Optional(ms({allowEmpty:!1}))}))}),UF=ge.Object({type:ge.Literal("servicenow"),instanceName:ge.Optional(ms({allowEmpty:!1})),username:ge.Optional(ms({allowEmpty:!1})),password:ge.Optional(ms({allowEmpty:!1}))}),MF=ge.Object({type:ge.Literal("google-chat"),webhookUrl:ms({type:"uri"})}),PF=ge.Object({name:ge.Optional(ms()),setting:ge.Optional(Xf("type",[OU,RU,NU,kU,kF,UF,MF]))}),hge=ao({tags:["notification-integrations"],url:uA,method:"POST",body:NF,response:oT}),Ege=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"GET",params:ge.Object({id:ms()}),response:oT}),wge=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:PF,response:oT}),Age=ao({tags:["notification-integrations"],url:`${uA}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),gge=ao({tags:["notification-rules"],url:`${KC}/:id/notifications`,method:"GET",params:ge.Object({id:ms()}),query:ge.Optional(ge.Object({from:ge.Optional(ge.Number()),to:ge.Optional(ge.Number())})),response:ge.Object({notifications:ge.Array(ge.Object({id:ge.String(),monitorId:ge.String(),monitorResultId:ge.String(),ruleId:ge.Optional(ge.String()),targetId:ge.Optional(ge.String()),status:ge.Enum(hF),tryCount:ge.Number(),nextTryAt:jl(),createdAt:jl(),updatedAt:jl(),sentAt:ge.Optional(jl())})),isTruncated:ge.Boolean()})}),DF=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat"],Tge=ao({tags:["notification-rules"],url:`${lL}/test`,method:"POST",body:ge.Object({notificationRule:vE,targetIds:ge.Optional(ge.Array(ms({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:Xf("success",[ge.Object({success:ge.Literal(!1),overallMessage:ge.String({description:"Message when there is an overall error"})}),ge.Object({success:ge.Boolean(),results:ge.Array(ge.Object({targetId:ge.String({description:"The ID of the target that was tested"}),targetType:ge.Enum(DF,{description:"The type of the target (e.g., slack, webhook)"}),status:ge.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:ge.Optional(ge.String({description:"Message if the notification failed for this specific target"}))}))})])});var CE=`/${"v1"}/notification-rules`,yE=ge.Pick(nh,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),$F={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],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(yE,{examples:[$F]});var UU=ao({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:CE,method:"GET",response:ge.Array(yE)}),MU=ao({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:yE}),aT=ge.Pick(vE,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","owner","tags","isActive","targets"]),GF={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],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(aT,{examples:[GF]});var PU=ao({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:CE,method:"POST",body:aT,response:yE}),DU=ao({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:aT,response:yE}),$U=ao({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${CE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var LE=`${bE}/silences`,FF=ge.Partial(ge.Record(ge.Union([ge.Literal("monday"),ge.Literal("tuesday"),ge.Literal("wednesday"),ge.Literal("thursday"),ge.Literal("friday"),ge.Literal("saturday"),ge.Literal("sunday")]),ge.Array(ge.Object({startTime:ge.String({format:"time"}),endTime:ge.String({format:"time"})}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),GU=Xf("type",[ge.Object({type:ge.Literal("one-time"),startTime:ge.String({format:"date-time"}),endTime:ge.String({format:"date-time"})},{description:"One-time silence schedule with specific start and end times"}),ge.Object({type:ge.Literal("recurring"),weeklySchedule:FF},{description:"Recurring weekly silence schedule"})],{description:"Schedule defining when the silence is active"}),iA=ge.Object({name:ms({description:"Display name of the silence"}),reason:ms({allowEmpty:!1,description:"Reason for the silence"}),owner:ms({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:iv,isActive:ge.Boolean({description:"Whether the silence is currently enabled"}),schedule:GU,notificationRuleIds:ge.Optional(ge.Array(ms(),{description:"Notification rule IDs this silence applies to"})),queryString:ge.Optional(ms({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:rT,prioritiesFilter:ge.Array(ge.Enum(YC),{maxItems:YC.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{maxItems:iL.length,description:"Transition types to filter which alerts this silence applies to"})}),sh=ge.Object({id:ge.String({description:"Unique identifier of the silence"}),name:ge.String({description:"Display name of the silence"}),reason:ge.String({description:"Reason for the silence"}),owner:ge.String({description:"Team ID that owns and manages the silence"}),tags:iv,isActive:ge.Boolean({description:"Whether the silence is currently enabled"}),schedule:GU,notificationRuleIds:ge.Optional(ge.Array(ge.String(),{description:"Notification rule IDs this silence applies to"})),queryString:ge.Optional(ge.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:nT,prioritiesFilter:ge.Array(ge.Enum(YC),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:ge.Array(ge.Enum(iL),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:jl(),updatedAt:jl(),creator:ge.Optional(wv),updater:ge.Optional(wv)}),Kge=ao({tags:["notification-silences"],url:LE,method:"GET",response:ge.Array(sh)}),Yge=ao({tags:["notification-silences"],url:`${LE}/:id`,params:ge.Object({id:ms()}),method:"GET",response:sh}),zge=ao({tags:["notification-silences"],url:LE,method:"POST",body:iA,response:sh}),Vge=ao({tags:["notification-silences"],url:`${LE}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:iA,response:sh}),Wge=ao({tags:["notification-silences"],url:`${LE}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp});var hE=`/${"v1"}/notification-silences`,lA=ge.Pick(sh,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),FU=ao({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:hE,method:"GET",response:ge.Array(lA)}),jU=ao({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:lA}),BU=ge.Pick(iA,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),HU=ao({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:hE,method:"POST",body:BU,response:lA}),qU=ao({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:BU,response:lA}),KU=ao({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${hE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var EE="/v0/admin-center";var zC=`${EE}/retention-policies`,uT=["1-day","3-days","15-days","30-days","60-days","90-days","120-days","180-days","360-days","10-years"],ay=ge.Object({id:ge.String(),env:ge.Optional(ge.String()),teamId:ge.Optional(ge.String()),dataSource:ge.Enum(qC),durationDays:ge.Enum(uT),isEnabled:ge.Boolean(),createdAt:jl(),updatedAt:jl()}),cA=ge.Object({env:ge.Optional(ms()),teamId:ge.Optional(ms()),dataSource:ge.Enum(qC),durationDays:ge.Enum(uT),isEnabled:ge.Boolean()}),YU=ge.Array(ge.Object({env:ms(),dataSource:ge.Enum(qC),durationDays:ge.Enum([...uT,"default"]),isEnabled:ge.Boolean()})),zU=ge.Object({inserted:ge.Array(ay),updated:ge.Array(ay),deleted:ge.Array(ay)}),dTe=ao({tags:["retention-policies"],url:zC,method:"POST",body:cA,response:ay}),bTe=ao({tags:["retention-policies"],url:zC,method:"GET",response:ge.Array(ay)}),vTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"GET",params:ge.Object({id:ms()}),response:ay}),CTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:cA,response:ay}),yTe=ao({tags:["retention-policies"],url:`${zC}/bulk-update`,method:"POST",body:YU,response:zU}),LTe=ao({tags:["retention-policies"],url:`${zC}/bulk-update-for-team`,method:"POST",body:ge.Object({teamId:ms(),policies:YU}),response:zU}),hTe=ao({tags:["retention-policies"],url:`${zC}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),wE=["past-24-hours","past-7-days","past-30-days"],ETe=ao({tags:["retention-policies"],url:`${zC}/requested-history-percentile/:teamId`,method:"POST",params:ge.Object({teamId:ms()}),body:ge.Object({percentile:ge.Number({minimum:0,maximum:1}),observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC)}),response:ge.Object({percentile:ge.Number({minimum:0,maximum:1}),observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC),teamId:ge.String(),requestedHistoryDays:ge.Number()})}),jF=["1-day","3-days","7-days","1-month","more-than-1-month"];var BF=ge.Array(ge.Object({bucket:ge.Enum(jF),count:ge.Number()})),wTe=ao({tags:["retention-policies"],url:`${zC}/requested-history-histogram/:teamId`,method:"POST",params:ge.Object({teamId:ms()}),body:ge.Object({observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC)}),response:ge.Object({observationWindow:ge.Enum(wE),dataSource:ge.Enum(qC),teamId:ge.String(),histogram:BF})}),ATe=ao({tags:["retention-policies"],url:`${zC}/top-teams-with-retention-surplus`,method:"POST",body:ge.Object({dataSource:ge.Enum(qC),observationWindow:ge.Enum(wE),percentile:ge.Number({minimum:0,maximum:1}),topN:ge.Optional(ge.Number({minimum:1,maximum:20}))}),response:ge.Array(ge.Object({teamId:ge.String(),retentionSurplusDays:ge.Number()}))});var AE=`/${"v1"}/retention-policies`,gE=ge.Pick(ay,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),HF={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:"30-days",isEnabled:!0};Object.assign(gE,{examples:[HF]});var VU=ao({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:AE,method:"GET",response:ge.Array(gE)}),WU=ao({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:gE}),iT=ge.Pick(cA,["env","teamId","dataSource","durationDays","isEnabled"]),qF={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:"30-days",isEnabled:!0};Object.assign(iT,{examples:[qF]});var XU=ao({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:AE,method:"POST",body:iT,response:gE}),ZU=ao({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:iT,response:gE}),QU=ao({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${AE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var KF=ge.Object({manual:ge.Boolean()}),fA={id:ms({allowEmpty:!1,description:"Identifier of the processor"}),description:ge.Optional(ms({type:"long"})),example:ge.Optional(KF),tags:iv,updatedAt:ge.Optional(jl())},YF={...fA,type:ge.Literal("creator")},zF=Xf("subtype",[ge.Object({targetAttribute:ms({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:ms({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:ge.Optional(ge.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:ge.Literal("format-string"),replaceMissingByEmpty:ge.Optional(ge.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),ge.Object({targetAttribute:ms({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:ms({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:ge.Optional(ge.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:ge.Literal("math-formula"),replaceMissingBy0:ge.Optional(ge.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),VF=ge.Object({...YF,params:zF}),WF={...fA,type:ge.Literal("mapper")},XF=Xf("subtype",[ge.Object({attributes:ge.Array(ge.Object({originAttribute:ms({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:ge.Optional(ge.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:ge.Optional(ge.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:ms({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:ge.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:ge.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:ge.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),ZF=ge.Object({...WF,params:XF}),QF={...fA,type:ge.Literal("parse-attribute")},JF=5,ej=Xf("subtype",[ge.Object({attributeName:ms({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:ge.Array(ms({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:ge.Optional(ge.Array(ms({type:"long"}),{maxItems:JF,description:"Example log lines for validation"})),subtype:ge.Literal("grok")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:ge.Literal("url")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:ge.Literal("user-agent")}),ge.Object({sourceAttribute:ms({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:ms({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:ms({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:ms({allowEmpty:!1,description:"Delimiter separating each key/value pair"}),acceptStandaloneKey:ge.Boolean(),subtype:ge.Literal("key-value")})]),tj=ge.Object({...QF,params:ej}),rj=11,lT=ge.Cyclic({Processor:ge.Union([ZF,tj,VF,ge.Object({...fA,params:ge.Object({items:ge.Array(ge.Object({query:ms({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:ge.Array(ge.Ref("Processor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:rj,description:"Conditional branches evaluated in order before falling back to the default"})}),type:ge.Literal("split")})])},"Processor",{description:"Processing step executed sequentially on route logs"});var nj="/v0/logs",$y=`${nj}/routes`,cL=ge.Object({id:ge.String({description:"Identifier of the log route"}),name:ge.String({description:"Human readable name shown for the route"}),description:ge.Optional(ge.String()),isEnabled:ge.Boolean(),query:ge.String({description:"Query that selects which logs should enter the route"}),rank:ge.Number(),tags:iv,owner:ge.String({description:"Team ID owning and managing the route"}),processors:ge.Array(lT,{description:"Ordered processors applied to logs that match the route"}),creator:ge.Optional(wv),updater:ge.Optional(wv),updatedAt:jl(),createdAt:jl(),assetUpdatedAt:jl(),lastSyncedAt:ge.Optional(jl())},{title:"Route"}),TE=ge.Object({name:ms({allowEmpty:!1,description:"Human readable name shown for the route"}),description:ge.Optional(ms({type:"long"})),isEnabled:ge.Boolean(),query:ms({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:iv,owner:ms({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:ge.Array(lT,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),VTe=ao({tags:["routes"],url:$y,method:"GET",response:ge.Array(cL)}),WTe=ao({tags:["routes"],url:`${$y}/:id`,params:ge.Object({id:ms()}),method:"GET",response:cL}),XTe=ao({tags:["routes"],url:$y,method:"POST",body:TE,response:cL}),ZTe=ao({tags:["routes"],url:`${$y}/:id`,method:"PUT",body:TE,params:ge.Object({id:ms()}),response:cL}),QTe=ao({tags:["routes"],url:`${$y}/:id/clone`,method:"POST",params:ge.Object({id:ms()}),body:TE,response:cL}),JTe=ao({tags:["routes"],url:`${$y}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),eIe=ao({tags:["routes"],url:`${$y}/:id/modify-ranking`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Object({rank:ge.Number()}),response:ge.Object({})}),tIe=ao({tags:["routes"],url:`${$y}/:id/enable`,method:"PUT",params:ge.Object({id:ms()}),body:ge.Object({enable:ge.Boolean()}),response:ge.Object({})});var IE=`/${"v1"}/routes`,_E=ge.Pick(cL,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),sj={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(_E,{examples:[sj]});var JU=ao({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:IE,method:"GET",response:ge.Array(_E)}),e4=ao({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${IE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:_E}),cT=ge.Pick(TE,["name","description","isEnabled","query","tags","owner","processors"]),oj={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(cT,{examples:[oj]});var t4=ao({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:IE,method:"POST",body:cT,response:_E}),r4=ao({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${IE}/:id`,method:"PUT",body:cT,params:ge.Object({id:ms({allowEmpty:!1})}),response:_E}),n4=ao({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${IE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var fL=`${EE}/tag-policies`;var s4=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence"],aj=["logs","metrics","traces"],o4=ge.Array(ge.Enum(s4)),a4=ge.Array(ge.Enum(aj)),uj=ge.Union([o4,a4]),u4=ge.Object({teamIds:ge.Array(ms(),{minItems:1,maxItems:100}),mode:ge.Enum(["include","exclude"])}),i4=Xf("type",[ge.Object({type:ge.Literal("telemetry"),assetTypes:a4,shouldInsertWarning:ge.Boolean(),dropSample:ge.Optional(ge.Number({minimum:0,maximum:100}))}),ge.Object({type:ge.Literal("tsuga_asset"),assetTypes:o4})]),oh=ge.Object({id:ge.String(),name:ge.String(),description:ge.Optional(ge.String()),isActive:ge.Boolean(),tagKey:ge.String(),allowedTagValues:ge.Array(ge.String()),isRequired:ge.Boolean(),teamScope:ge.Optional(u4),configuration:i4,creator:ge.Optional(wv),updater:ge.Optional(wv),owner:ge.Optional(ge.String()),createdAt:jl(),updatedAt:jl(),assetUpdatedAt:jl()});var xE=ge.Object({name:ms(),description:ge.Optional(ms()),isActive:ge.Boolean(),tagKey:ms({allowEmpty:!1}),allowedTagValues:ge.Array(ms({allowEmpty:!1}),{maxItems:100}),isRequired:ge.Boolean(),teamScope:ge.Optional(u4),configuration:i4,owner:ms({allowEmpty:!1})}),LIe=ao({tags:["tag-policies"],url:fL,method:"GET",query:ge.Object({teamIds:ge.Optional(ge.Array(ms(),{maxItems:100})),assetTypes:ge.Optional(uj),searchQuery:ge.Optional(ms())}),response:ge.Array(oh)}),hIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"GET",params:ge.Object({id:ms()}),response:oh}),EIe=ao({tags:["tag-policies"],url:fL,method:"POST",body:xE,response:oh}),wIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"PUT",params:ge.Object({id:ms()}),body:xE,response:oh}),AIe=ao({tags:["tag-policies"],url:`${fL}/:id`,method:"DELETE",params:ge.Object({id:ms()}),response:Pp}),gIe=ao({tags:["tag-policies"],url:`${EE}/applicable-tag-rules`,method:"GET",query:ge.Object({assetType:ge.Enum(s4),teamId:ms()}),response:ge.Array(ge.Object({tagKey:ge.String(),allowedTagValues:ge.Array(ge.String()),isRequired:ge.Boolean()}))}),l4=ge.Object({total:ge.Number(),totalNonCompliant:ge.Number(),idsNonCompliant:ge.Array(ms())}),c4=ge.Union([ge.Literal("ingestion-api-key"),ge.Literal("operation-api-key"),ge.Literal("dashboard"),ge.Literal("log-route"),ge.Literal("monitor"),ge.Literal("notification-rule"),ge.Literal("notification-silence")]),ij=ge.Object({total:ge.Number(),totalNonCompliant:ge.Number(),byAssetType:ge.Record(c4,l4)}),lj=ge.Omit(l4,["total"]),cj=ge.Object({totalNonCompliant:ge.Number(),byAssetType:ge.Record(c4,lj)}),f4=ge.Object({totals:ij,byTeam:ge.Record(ge.String(),cj)}),TIe=ao({tags:["tag-policies"],url:`${fL}/:id/stats`,method:"GET",params:ge.Object({id:ms()}),response:f4}),IIe=ao({tags:["tag-policies"],url:`${fL}/new-policy-stats`,method:"POST",body:xE,response:f4});var SE=`/${"v1"}/tag-policies`,pA=ge.Pick(oh,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),p4=ge.Pick(xE,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),m4=ao({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:SE,method:"GET",response:ge.Array(pA)}),d4=ao({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:pA}),b4=ao({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:SE,method:"POST",body:p4,response:pA}),v4=ao({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:p4,response:pA}),C4=ao({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${SE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});var OE=`/${"v1"}/teams`,RE=ge.Pick(eh,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),fj={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(RE,{examples:[fj]});var y4=ao({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:OE,method:"GET",response:ge.Array(RE)}),L4=ao({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${OE}/:id`,method:"GET",params:ge.Object({id:ms({allowEmpty:!1})}),response:RE}),fT=ge.Pick(Zw,["name","description","visibility","tags"]),pj={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(fT,{examples:[pj]});var h4=ao({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:OE,method:"POST",body:fT,response:RE}),E4=ao({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${OE}/:id`,method:"PUT",params:ge.Object({id:ms({allowEmpty:!1})}),body:fT,response:RE}),w4=ao({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${OE}/:id`,method:"DELETE",params:ge.Object({id:ms({allowEmpty:!1})}),response:Pp});function mj(f){return It.IsObject(f)&&It.HasPropertyKey(f,"check")&&It.HasPropertyKey(f,"errors")&&It.IsFunction(f.check)&&It.IsFunction(f.errors)}function pT(f){return It.HasPropertyKey(f,"~guard")&&mj(f["~guard"])}function mT(f){return It.HasPropertyKey(f,"~refine")&&It.IsArray(f["~refine"])&&It.Every(f["~refine"],0,m=>It.IsObject(m)&&It.HasPropertyKey(m,"refine")&&It.HasPropertyKey(m,"message")&&It.IsFunction(m.refine)&&It.IsString(m.message))}function uy(f){return It.IsObject(f)&&!It.IsArray(f)}function mA(f){return It.IsBoolean(f)}function mc(f){return uy(f)||mA(f)}function dT(f){return It.HasPropertyKey(f,"additionalItems")&&mc(f.additionalItems)}function iy(f){return It.HasPropertyKey(f,"additionalProperties")&&mc(f.additionalProperties)}function bT(f){return It.HasPropertyKey(f,"allOf")&&It.IsArray(f.allOf)&&f.allOf.every(m=>mc(m))}function NE(f){return It.HasPropertyKey(f,"$anchor")&&It.IsString(f.$anchor)}function vT(f){return It.HasPropertyKey(f,"anyOf")&&It.IsArray(f.anyOf)&&f.anyOf.every(m=>mc(m))}function CT(f){return It.HasPropertyKey(f,"const")}function pL(f){return It.HasPropertyKey(f,"contains")&&mc(f.contains)}function yC(f){return It.HasPropertyKey(f,"default")}function yT(f){return It.HasPropertyKey(f,"dependencies")&&It.IsObject(f.dependencies)&&Object.values(f.dependencies).every(m=>mc(m)||It.IsArray(m)&&m.every(L=>It.IsString(L)))}function LT(f){return It.HasPropertyKey(f,"dependentRequired")&&It.IsObject(f.dependentRequired)&&Object.values(f.dependentRequired).every(m=>It.IsArray(m)&&m.every(L=>It.IsString(L)))}function hT(f){return It.HasPropertyKey(f,"dependentSchemas")&&It.IsObject(f.dependentSchemas)&&Object.values(f.dependentSchemas).every(m=>mc(m))}function ET(f){return It.HasPropertyKey(f,"$dynamicAnchor")&&It.IsString(f.$dynamicAnchor)}function wT(f){return It.HasPropertyKey(f,"else")&&mc(f.else)}function AT(f){return It.HasPropertyKey(f,"enum")&&It.IsArray(f.enum)}function gT(f){return It.HasPropertyKey(f,"exclusiveMaximum")&&(It.IsNumber(f.exclusiveMaximum)||It.IsBigInt(f.exclusiveMaximum))}function ly(f){return It.HasPropertyKey(f,"exclusiveMinimum")&&(It.IsNumber(f.exclusiveMinimum)||It.IsBigInt(f.exclusiveMinimum))}function kE(f){return It.HasPropertyKey(f,"format")&&It.IsString(f.format)}function mL(f){return It.HasPropertyKey(f,"$id")&&It.IsString(f.$id)}function TT(f){return It.HasPropertyKey(f,"if")&&mc(f.if)}function ah(f){return It.HasPropertyKey(f,"items")&&(mc(f.items)||It.IsArray(f.items)&&f.items.every(m=>mc(m)))}function IT(f){return ah(f)&&It.IsArray(f.items)}function _T(f){return It.HasPropertyKey(f,"maximum")&&(It.IsNumber(f.maximum)||It.IsBigInt(f.maximum))}function xT(f){return It.HasPropertyKey(f,"maxContains")&&It.IsNumber(f.maxContains)}function dA(f){return It.HasPropertyKey(f,"maxItems")&&It.IsNumber(f.maxItems)}function ST(f){return It.HasPropertyKey(f,"maxLength")&&It.IsNumber(f.maxLength)}function OT(f){return It.HasPropertyKey(f,"maxProperties")&&It.IsNumber(f.maxProperties)}function cy(f){return It.HasPropertyKey(f,"minimum")&&(It.IsNumber(f.minimum)||It.IsBigInt(f.minimum))}function dL(f){return It.HasPropertyKey(f,"minContains")&&It.IsNumber(f.minContains)}function uh(f){return It.HasPropertyKey(f,"minItems")&&It.IsNumber(f.minItems)}function UE(f){return It.HasPropertyKey(f,"minLength")&&It.IsNumber(f.minLength)}function ME(f){return It.HasPropertyKey(f,"minProperties")&&It.IsNumber(f.minProperties)}function RT(f){return It.HasPropertyKey(f,"multipleOf")&&(It.IsNumber(f.multipleOf)||It.IsBigInt(f.multipleOf))}function NT(f){return It.HasPropertyKey(f,"not")&&mc(f.not)}function kT(f){return It.HasPropertyKey(f,"oneOf")&&It.IsArray(f.oneOf)&&f.oneOf.every(m=>mc(m))}function PE(f){return It.HasPropertyKey(f,"pattern")&&(It.IsString(f.pattern)||f.pattern instanceof RegExp)}function DE(f){return It.HasPropertyKey(f,"patternProperties")&&It.IsObject(f.patternProperties)&&Object.values(f.patternProperties).every(m=>mc(m))}function ih(f){return It.HasPropertyKey(f,"prefixItems")&&It.IsArray(f.prefixItems)&&f.prefixItems.every(m=>mc(m))}function $E(f){return It.HasPropertyKey(f,"properties")&&It.IsObject(f.properties)&&Object.values(f.properties).every(m=>mc(m))}function UT(f){return It.HasPropertyKey(f,"propertyNames")&&(It.IsObject(f.propertyNames)||mc(f.propertyNames))}function dj(f){return It.HasPropertyKey(f,"$recursiveAnchor")&&It.IsBoolean(f.$recursiveAnchor)}function bA(f){return dj(f)&&It.IsEqual(f.$recursiveAnchor,!0)}function MT(f){return It.HasPropertyKey(f,"$recursiveRef")&&It.IsString(f.$recursiveRef)}function PT(f){return It.HasPropertyKey(f,"$ref")&&It.IsString(f.$ref)}function bL(f){return It.HasPropertyKey(f,"required")&&It.IsArray(f.required)&&f.required.every(m=>It.IsString(m))}function DT(f){return It.HasPropertyKey(f,"then")&&mc(f.then)}function $T(f){return It.HasPropertyKey(f,"type")&&(It.IsString(f.type)||It.IsArray(f.type)&&f.type.every(m=>It.IsString(m)))}function lh(f){return It.HasPropertyKey(f,"uniqueItems")&&It.IsBoolean(f.uniqueItems)}function vA(f){return It.HasPropertyKey(f,"unevaluatedItems")&&mc(f.unevaluatedItems)}function CA(f){return It.HasPropertyKey(f,"unevaluatedProperties")&&mc(f.unevaluatedProperties)}var Qv=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(m){return this.indices.add(m),!0}AddKey(m){return this.keys.add(m),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(m){for(let L of m)L.indices.forEach(ne=>this.indices.add(ne)),L.keys.forEach(ne=>this.keys.add(ne));return!0}},GE=class extends Qv{constructor(m){super(),this.callback=m}AddError(m){return this.callback(m),!1}},Rv=class extends GE{constructor(){super(m=>this.errors.push(m)),this.errors=[]}AddError(m){return this.errors.push(m),!1}GetErrors(){return this.errors}};var bj="external_",vj=0,pOe={identifier:`${bj}${vj}`,variables:[]};function A4(f,m,L,ne){return L["~guard"].check(ne)}function g4(f,m,L,ne,Ue,t){return Ue["~guard"].check(t)||m.AddError({keyword:"~guard",schemaPath:L,instancePath:ne,params:{errors:Ue["~guard"].errors(t)}})}function T4(f,m,L,ne){return It.Every(L["~refine"],0,(Ue,t)=>Ue.refine(ne))}function I4(f,m,L,ne,Ue,t){return It.EveryAll(Ue["~refine"],0,(or,Fr)=>or.refine(t)||m.AddError({keyword:"~refine",schemaPath:L,instancePath:ne,params:{index:Fr,message:or.message}}))}function _4(f){return ah(f)&&It.IsArray(f.items)}function x4(f,m,L,ne){return _4(L)?ne.every((t,or)=>It.IsLessThan(or,L.items.length)||Bl(f,m,L.additionalItems,t)&&m.AddIndex(or)):!0}function S4(f,m,L,ne,Ue,t){return _4(Ue)?t.every((Fr,e)=>{let Yn=`${L}/additionalItems`,Vn=`${ne}/${e}`;return It.IsLessThan(e,Ue.items.length)||Dp(f,m,Yn,Vn,Ue.additionalItems,Fr)&&m.AddIndex(e)}):!0}function Cj(f){return`^${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function O4(f){let m=[];return DE(f)&&m.push(...It.Keys(f.patternProperties)),$E(f)&&m.push(...It.Keys(f.properties).map(Cj)),It.IsEqual(m.length,0)?"(?!)":`(${m.join("|")})`}function R4(f,m,L,ne){let Ue=new RegExp(O4(L));return It.Every(It.Keys(ne),0,(or,Fr)=>Ue.test(or)||Bl(f,m,L.additionalProperties,ne[or])&&m.AddKey(or))}function N4(f,m,L,ne,Ue,t){let or=new RegExp(O4(Ue)),Fr=[];return It.EveryAll(It.Keys(t),0,(Yn,Vn)=>{let Br=`${L}/additionalProperties`,Xr=`${ne}/${Yn}`,gs=new Rv,Yo=or.test(Yn)||Dp(f,gs,Br,Xr,Ue.additionalProperties,t[Yn])&&m.AddKey(Yn);return Yo||Fr.push(Yn),Yo})||m.AddError({keyword:"additionalProperties",schemaPath:L,instancePath:ne,params:{additionalProperties:Fr}})}function k4(f,m,L,ne){let Ue=L.allOf.reduce((t,or)=>{let Fr=new Qv;return Bl(f,Fr,or,ne)?[...t,Fr]:t},[]);return It.IsEqual(Ue.length,L.allOf.length)&&m.Merge(Ue)}function U4(f,m,L,ne,Ue,t){let or=[],Fr=Ue.allOf.reduce((Yn,Vn,Br)=>{let Xr=`${L}/allOf/${Br}`,gs=new Rv,Yo=Dp(f,gs,Xr,ne,Vn,t);return Yo||or.push(gs),Yo?[...Yn,gs]:Yn},[]),e=It.IsEqual(Fr.length,Ue.allOf.length)&&m.Merge(Fr);return e||or.forEach(Yn=>Yn.GetErrors().forEach(Vn=>m.AddError(Vn))),e}function M4(f,m,L,ne){let Ue=L.anyOf.reduce((t,or,Fr)=>{let e=new Qv;return Bl(f,e,or,ne)?[...t,e]:t},[]);return It.IsGreaterThan(Ue.length,0)&&m.Merge(Ue)}function P4(f,m,L,ne,Ue,t){let or=[],Fr=Ue.anyOf.reduce((Yn,Vn,Br)=>{let Xr=new Rv,gs=`${L}/anyOf/${Br}`,Yo=Dp(f,Xr,gs,ne,Vn,t);return Yo||or.push(Xr),Yo?[...Yn,Xr]:Yn},[]),e=It.IsGreaterThan(Fr.length,0)&&m.Merge(Fr);return e||or.forEach(Yn=>Yn.GetErrors().forEach(Vn=>m.AddError(Vn))),e||m.AddError({keyword:"anyOf",schemaPath:L,instancePath:ne,params:{}})}function FT(f,m,L,ne){return L}function D4(f,m,L,ne,Ue,t){return FT(f,m,Ue,t)||m.AddError({keyword:"boolean",schemaPath:L,instancePath:ne,params:{}})}function jT(f,m,L,ne){return It.IsValueLike(L.const)?It.IsEqual(ne,L.const):It.IsDeepEqual(ne,L.const)}function $4(f,m,L,ne,Ue,t){return jT(f,m,Ue,t)||m.AddError({keyword:"const",schemaPath:L,instancePath:ne,params:{allowedValue:Ue.const}})}function yj(f){return!(dL(f)&&It.IsEqual(f.minContains,0))}function BT(f,m,L,ne){return yj(L)?!It.IsEqual(ne.length,0)&&ne.some(Ue=>Bl(f,m,L.contains,Ue)):!0}function G4(f,m,L,ne,Ue,t){return BT(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:1}})}function F4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependencies),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||(It.IsArray(Fr)?Fr.every(e=>It.HasPropertyKey(ne,e)):Bl(f,m,Fr,ne)));return Ue||t}function j4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependencies),0,([e,Yn])=>{let Vn=`${L}/dependencies/${e}`;return!It.HasPropertyKey(t,e)||(It.IsArray(Yn)?Yn.every(Br=>It.HasPropertyKey(t,Br)||m.AddError({keyword:"dependencies",schemaPath:L,instancePath:ne,params:{property:e,dependencies:Yn}})):Dp(f,m,Vn,ne,Yn,t))});return or||Fr}function B4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependentRequired),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||Fr.every(e=>It.HasPropertyKey(ne,e)));return Ue||t}function H4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependentRequired),0,([e,Yn])=>!It.HasPropertyKey(t,e)||It.EveryAll(Yn,0,Vn=>It.HasPropertyKey(t,Vn)||m.AddError({keyword:"dependentRequired",schemaPath:L,instancePath:ne,params:{property:e,dependencies:Yn}})));return or||Fr}function q4(f,m,L,ne){let Ue=It.IsEqual(It.Keys(ne).length,0),t=It.Every(It.Entries(L.dependentSchemas),0,([or,Fr])=>!It.HasPropertyKey(ne,or)||Bl(f,m,Fr,ne));return Ue||t}function K4(f,m,L,ne,Ue,t){let or=It.IsEqual(It.Keys(t).length,0),Fr=It.EveryAll(It.Entries(Ue.dependentSchemas),0,([e,Yn])=>{let Vn=`${L}/dependentSchemas/${e}`;return!It.HasPropertyKey(t,e)||Dp(f,m,Vn,ne,Yn,t)});return or||Fr}function HT(f,m,L,ne){return L.enum.some(Ue=>It.IsValueLike(Ue)?It.IsEqual(ne,Ue):It.IsDeepEqual(ne,Ue))}function Y4(f,m,L,ne,Ue,t){return HT(f,m,Ue,t)||m.AddError({keyword:"enum",schemaPath:L,instancePath:ne,params:{allowedValues:Ue.enum}})}function qT(f,m,L,ne){return It.IsLessThan(ne,L.exclusiveMaximum)}function z4(f,m,L,ne,Ue,t){return qT(f,m,Ue,t)||m.AddError({keyword:"exclusiveMaximum",schemaPath:L,instancePath:ne,params:{comparison:"<",limit:Ue.exclusiveMaximum}})}function KT(f,m,L,ne){return It.IsGreaterThan(ne,L.exclusiveMinimum)}function V4(f,m,L,ne,Ue,t){return KT(f,m,Ue,t)||m.AddError({keyword:"exclusiveMinimum",schemaPath:L,instancePath:ne,params:{comparison:">",limit:Ue.exclusiveMinimum}})}var fh={};hC(fh,{Clear:()=>X4,Entries:()=>Dj,Get:()=>Fj,Has:()=>Gj,IsDate:()=>FE,IsDateTime:()=>YT,IsDuration:()=>zT,IsEmail:()=>VT,IsHostname:()=>WT,IsIPv4:()=>JT,IsIPv6:()=>eI,IsIdnEmail:()=>XT,IsIdnHostname:()=>QT,IsIri:()=>rI,IsIriReference:()=>tI,IsJsonPointer:()=>sI,IsJsonPointerUriFragment:()=>nI,IsRegex:()=>oI,IsRelativeJsonPointer:()=>aI,IsTime:()=>jE,IsUri:()=>lI,IsUriReference:()=>uI,IsUriTemplate:()=>iI,IsUrl:()=>cI,IsUuid:()=>fI,Reset:()=>Z4,Set:()=>$j,Test:()=>jj});var Lj=[0,31,28,31,30,31,30,31,31,30,31,30,31],hj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Ej(f){return f%4===0&&(f%100!==0||f%400===0)}function FE(f){let m=hj.exec(f);if(!m)return!1;let L=+m[1],ne=+m[2],Ue=+m[3];return ne>=1&&ne<=12&&Ue>=1&&Ue<=(ne===2&&Ej(L)?29:Lj[ne])}var wj=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function jE(f,m=!0){let L=wj.exec(f);if(!L)return!1;let ne=+L[1],Ue=+L[2],t=+L[3],or=L[4]==="-"?-1:1,Fr=+(L[5]||0),e=+(L[6]||0);if(Fr>23||e>59||m&&!L[4]&&f.toLowerCase().indexOf("z")===-1)return!1;if(ne<=23&&Ue<=59&&t<60)return!0;let Yn=Ue-e*or,Vn=ne-Fr*or-(Yn<0?1:0);return(Vn===23||Vn===-1)&&(Yn===59||Yn===-1)&&t<61}function YT(f,m=!0){let L=f.split(/T/i);return L.length===2&&FE(L[0])&&jE(L[1],m)}var Aj=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function zT(f){return Aj.test(f)}var gj=/^(?!.*\.\.)[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 VT(f){return gj.test(f)}var Tj=/^(?=.{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 WT(f){return Tj.test(f)}var Ij=/^(?!.*\.\.)[\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 XT(f){return Ij.test(f)}function ZT(f){let m=f.codePointAt(0);return m===void 0?!1:m>=12352&&m<=12447||m>=12448&&m<=12543&&m!==12539||m>=19968&&m<=40959}function QT(f){if(f.length===0||f.includes(" "))return!1;let m=/[\u002E\u3002\uFF0E\uFF61]/g,L=f.normalize("NFC").replace(m,".");if(L.length>253)return!1;let ne=L.split(".");if(ne.some(Ue=>Ue.length===0))return!1;for(let Ue of ne){if(Ue.length>63||Ue.startsWith("-")||Ue.endsWith("-"))return!1;if(/^xn--/i.test(Ue)){let e=Ue.slice(4);if(e.length<2||e.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(Ue))return!1;let t=Ue.charAt(0);if(/[\u0903\u0300\u0488]/.test(t))return!1;for(let e=0;e<Ue.length;e++){let Yn=Ue.charAt(e);if(Yn==="\xB7"){if(e===0||e===Ue.length-1)return!1;let Vn=Ue.charAt(e-1),Br=Ue.charAt(e+1);if(!/^[lL]$/.test(Vn)||!/^[lL]$/.test(Br))return!1}if(Yn==="\u30FB"){if(Ue.length===1)return!1;if(e===0){let Vn=Ue.charAt(e+1);if(!ZT(Vn))return!1}else{let Vn=Ue.charAt(e-1),Br=Ue.charAt(e+1);if(!ZT(Vn)||!ZT(Br))return!1}}if(Yn==="\u0375"){if(e===Ue.length-1)return!1;let Vn=Ue.charAt(e+1);if(!/[\u0370-\u03FF]/.test(Vn))return!1}if(Yn==="\u05F3"||Yn==="\u05F4"){if(e===0)return!1;let Vn=Ue.charAt(e-1);if(!/[\u05D0-\u05EA]/.test(Vn))return!1}if(Yn==="\u200D"&&(e===0||Ue.charAt(e-1)!=="\u094D"))return!1}let or=!1,Fr=!1;for(let e=0;e<Ue.length;e++){let Yn=Ue.charAt(e);/[\u0660-\u0669]/.test(Yn)&&(or=!0),/[\u06F0-\u06F9]/.test(Yn)&&(Fr=!0)}if(or&&Fr)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 JT(f){return _j.test(f)}var xj=/^((([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 eI(f){return xj.test(f)}function W4(f){try{return new URL(f,"http://example.com"),!0}catch{return!1}}function tI(f){if(f.includes(" ")||f.includes("\\")||/[\x00-\x1F\x7F]/.test(f)||/%(?![0-9a-fA-F]{2})/.test(f))return!1;if(f==="")return!0;let m=f.indexOf(":");return m>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(f.substring(0,m))?W4(f):f.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&m===-1?!1:W4(f)}function rI(f){try{return new URL(f),!0}catch{return!1}}var Sj=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function nI(f){return Sj.test(f)}var Oj=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function sI(f){return Oj.test(f)}function oI(f){if(f.length===0)return!1;try{return new RegExp(f),!0}catch{return!1}}var Rj=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function aI(f){return Rj.test(f)}var Nj=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function uI(f){return Nj.test(f)}var kj=/^(?:(?:[^\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 iI(f){return kj.test(f)}var Uj=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function lI(f){return Uj.test(f)}var Mj=/^(?: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 cI(f){return Mj.test(f)}var Pj=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function fI(f){return Pj.test(f)}var sv=new Map;function X4(){sv.clear()}function Dj(){return[...sv.entries()]}function $j(f,m){sv.set(f,m)}function Gj(f){return sv.has(f)}function Fj(f){return sv.get(f)}function jj(f,m){return sv.get(f)?.(m)??!0}function Z4(){X4(),sv.set("date-time",YT),sv.set("date",FE),sv.set("duration",zT),sv.set("email",VT),sv.set("hostname",WT),sv.set("idn-email",XT),sv.set("idn-hostname",QT),sv.set("ipv4",JT),sv.set("ipv6",eI),sv.set("iri-reference",tI),sv.set("iri",rI),sv.set("json-pointer-uri-fragment",nI),sv.set("json-pointer",sI),sv.set("regex",oI),sv.set("relative-json-pointer",aI),sv.set("time",jE),sv.set("uri-reference",uI),sv.set("uri-template",iI),sv.set("uri",lI),sv.set("url",cI),sv.set("uuid",fI)}Z4();function pI(f,m,L,ne){return fh.Test(L.format,ne)}function Q4(f,m,L,ne,Ue,t){return pI(f,m,Ue,t)||m.AddError({keyword:"format",schemaPath:L,instancePath:ne,params:{format:Ue.format}})}function J4(f,m,L,ne){let Ue=DT(L)?L.then:!0,t=wT(L)?L.else:!0;return Bl(f,m,L.if,ne)?Bl(f,m,Ue,ne):Bl(f,m,t,ne)}function eM(f,m,L,ne,Ue,t){let or=DT(Ue)?Ue.then:!0,Fr=wT(Ue)?Ue.else:!0,e=new Rv,Yn=Dp(f,e,`${L}/if`,ne,Ue.if,t)?Dp(f,e,`${L}/then`,ne,or,t)||m.AddError({keyword:"if",schemaPath:L,instancePath:ne,params:{failingKeyword:"then"}}):Dp(f,m,`${L}/else`,ne,Fr,t)||m.AddError({keyword:"if",schemaPath:L,instancePath:ne,params:{failingKeyword:"else"}});return Yn&&m.Merge([e]),Yn}function Bj(f,m,L,ne){return It.Every(L.items,0,(Ue,t)=>It.IsLessEqualThan(ne.length,t)||Bl(f,m,Ue,ne[t])&&m.AddIndex(t))}function Hj(f,m,L,ne,Ue,t){return It.EveryAll(Ue.items,0,(or,Fr)=>{let e=`${L}/items/${Fr}`,Yn=`${ne}/${Fr}`;return It.IsLessEqualThan(t.length,Fr)||Dp(f,m,e,Yn,or,t[Fr])&&m.AddIndex(Fr)})}function qj(f,m,L,ne){let Ue=ih(L)?L.prefixItems.length:0;return It.Every(ne,Ue,(t,or)=>Bl(f,m,L.items,t)&&m.AddIndex(or))}function Kj(f,m,L,ne,Ue,t){let or=ih(Ue)?Ue.prefixItems.length:0;return It.EveryAll(t,or,(Fr,e)=>{let Yn=`${L}/items`,Vn=`${ne}/${e}`;return Dp(f,m,Yn,Vn,Ue.items,Fr)&&m.AddIndex(e)})}function tM(f,m,L,ne){return IT(L)?Bj(f,m,L,ne):qj(f,m,L,ne)}function rM(f,m,L,ne,Ue,t){return IT(Ue)?Hj(f,m,L,ne,Ue,t):Kj(f,m,L,ne,Ue,t)}function Yj(f){return pL(f)}function mI(f,m,L,ne){if(!Yj(L))return!0;let Ue=ne.reduce((t,or)=>Bl(f,m,L.contains,or)?++t:t,0);return It.IsLessEqualThan(Ue,L.maxContains)}function nM(f,m,L,ne,Ue,t){let or=dL(Ue)?Ue.minContains:1;return mI(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:or,maxContains:Ue.maxContains}})}function dI(f,m,L,ne){return It.IsLessEqualThan(ne,L.maximum)}function sM(f,m,L,ne,Ue,t){return dI(f,m,Ue,t)||m.AddError({keyword:"maximum",schemaPath:L,instancePath:ne,params:{comparison:"<=",limit:Ue.maximum}})}function bI(f,m,L,ne){return It.IsLessEqualThan(ne.length,L.maxItems)}function oM(f,m,L,ne,Ue,t){return bI(f,m,Ue,t)||m.AddError({keyword:"maxItems",schemaPath:L,instancePath:ne,params:{limit:Ue.maxItems}})}function vI(f,m,L,ne){return It.IsMaxLength(ne,L.maxLength)}function aM(f,m,L,ne,Ue,t){return vI(f,m,Ue,t)||m.AddError({keyword:"maxLength",schemaPath:L,instancePath:ne,params:{limit:Ue.maxLength}})}function CI(f,m,L,ne){return It.IsLessEqualThan(It.Keys(ne).length,L.maxProperties)}function uM(f,m,L,ne,Ue,t){return CI(f,m,Ue,t)||m.AddError({keyword:"maxProperties",schemaPath:L,instancePath:ne,params:{limit:Ue.maxProperties}})}function zj(f){return pL(f)}function yI(f,m,L,ne){if(!zj(L))return!0;let Ue=ne.reduce((t,or)=>Bl(f,m,L.contains,or)?++t:t,0);return It.IsGreaterEqualThan(Ue,L.minContains)}function iM(f,m,L,ne,Ue,t){return yI(f,m,Ue,t)||m.AddError({keyword:"contains",schemaPath:L,instancePath:ne,params:{minContains:Ue.minContains}})}function LI(f,m,L,ne){return It.IsGreaterEqualThan(ne,L.minimum)}function lM(f,m,L,ne,Ue,t){return LI(f,m,Ue,t)||m.AddError({keyword:"minimum",schemaPath:L,instancePath:ne,params:{comparison:">=",limit:Ue.minimum}})}function hI(f,m,L,ne){return It.IsGreaterEqualThan(ne.length,L.minItems)}function cM(f,m,L,ne,Ue,t){return hI(f,m,Ue,t)||m.AddError({keyword:"minItems",schemaPath:L,instancePath:ne,params:{limit:Ue.minItems}})}function EI(f,m,L,ne){return It.IsMinLength(ne,L.minLength)}function fM(f,m,L,ne,Ue,t){return EI(f,m,Ue,t)||m.AddError({keyword:"minLength",schemaPath:L,instancePath:ne,params:{limit:Ue.minLength}})}function wI(f,m,L,ne){return It.IsGreaterEqualThan(It.Keys(ne).length,L.minProperties)}function pM(f,m,L,ne,Ue,t){return wI(f,m,Ue,t)||m.AddError({keyword:"minProperties",schemaPath:L,instancePath:ne,params:{limit:Ue.minProperties}})}function AI(f,m,L,ne){return It.IsMultipleOf(ne,L.multipleOf)}function mM(f,m,L,ne,Ue,t){return AI(f,m,Ue,t)||m.AddError({keyword:"multipleOf",schemaPath:L,instancePath:ne,params:{multipleOf:Ue.multipleOf}})}function gI(f,m,L,ne){let Ue=new Qv;return!Bl(f,Ue,L.not,ne)&&m.Merge([Ue])}function dM(f,m,L,ne,Ue,t){return gI(f,m,Ue,t)||m.AddError({keyword:"not",schemaPath:L,instancePath:ne,params:{}})}function bM(f,m,L,ne){let Ue=L.oneOf.reduce((t,or)=>{let Fr=new Qv;return Bl(f,Fr,or,ne)?[...t,Fr]:t},[]);return It.IsEqual(Ue.length,1)&&m.Merge(Ue)}function vM(f,m,L,ne,Ue,t){let or=[],Fr=[],e=Ue.oneOf.reduce((Vn,Br,Xr)=>{let gs=new Rv,Yo=`${L}/oneOf/${Xr}`,rs=Dp(f,gs,Yo,ne,Br,t);return rs&&Fr.push(Xr),rs||or.push(gs),rs?[...Vn,gs]:Vn},[]),Yn=It.IsEqual(e.length,1)&&m.Merge(e);return!Yn&&It.IsEqual(Fr.length,0)&&or.forEach(Vn=>Vn.GetErrors().forEach(Br=>m.AddError(Br))),Yn||m.AddError({keyword:"oneOf",schemaPath:L,instancePath:ne,params:{passingSchemas:Fr}})}function TI(f,m,L,ne){return(It.IsString(L.pattern)?new RegExp(L.pattern):L.pattern).test(ne)}function CM(f,m,L,ne,Ue,t){return TI(f,m,Ue,t)||m.AddError({keyword:"pattern",schemaPath:L,instancePath:ne,params:{pattern:Ue.pattern}})}function yM(f,m,L,ne){return It.Every(It.Entries(L.patternProperties),0,([Ue,t])=>{let or=new RegExp(Ue);return It.Every(It.Entries(ne),0,([Fr,e])=>!or.test(Fr)||Bl(f,m,t,e)&&m.AddKey(Fr))})}function LM(f,m,L,ne,Ue,t){return It.EveryAll(It.Entries(Ue.patternProperties),0,([or,Fr])=>{let e=`${L}/patternProperties/${or}`,Yn=new RegExp(or);return It.EveryAll(It.Entries(t),0,([Vn,Br])=>{let Xr=`${ne}/${Vn}`;return!Yn.test(Vn)||Dp(f,m,e,Xr,Fr,Br)&&m.AddKey(Vn)})})}function hM(f,m,L,ne){return It.IsEqual(ne.length,0)||It.Every(L.prefixItems,0,(Ue,t)=>It.IsLessEqualThan(ne.length,t)||Bl(f,m,Ue,ne[t])&&m.AddIndex(t))}function EM(f,m,L,ne,Ue,t){return It.IsEqual(t.length,0)||It.EveryAll(Ue.prefixItems,0,(or,Fr)=>{let e=`${L}/prefixItems/${Fr}`,Yn=`${ne}/${Fr}`;return It.IsLessEqualThan(t.length,Fr)||Dp(f,m,e,Yn,or,t[Fr])&&m.AddIndex(Fr)})}function II(f,m){return f.includes(m)||dC.Get().exactOptionalPropertyTypes}function _I(f,m){return It.IsUndefined(f[m])}function wM(f,m,L,ne){let Ue=bL(L)?L.required:[];return It.Every(It.Entries(L.properties),0,([or,Fr])=>{let e=!It.HasPropertyKey(ne,or)||Bl(f,m,Fr,ne[or])&&m.AddKey(or);return II(Ue,or)?e:_I(ne,or)||e})}function AM(f,m,L,ne,Ue,t){let or=bL(Ue)?Ue.required:[];return It.EveryAll(It.Entries(Ue.properties),0,([e,Yn])=>{let Vn=`${L}/properties/${e}`,Br=`${ne}/${e}`,Xr=()=>!It.HasPropertyKey(t,e)||Dp(f,m,Vn,Br,Yn,t[e])&&m.AddKey(e);return II(or,e)?Xr():_I(t,e)||Xr()})}function gM(f,m,L,ne){return It.Every(It.Keys(ne),0,(Ue,t)=>Bl(f,m,L.propertyNames,Ue))}function TM(f,m,L,ne,Ue,t){let or=[];return It.EveryAll(It.Keys(t),0,(e,Yn)=>{let Vn=`${ne}/${e}`,Br=`${L}/propertyNames`,Xr=new Rv,gs=Dp(f,Xr,Br,Vn,Ue.propertyNames,e);return gs||or.push(e),gs})||m.AddError({keyword:"propertyNames",schemaPath:L,instancePath:ne,params:{propertyNames:or}})}function IM(f,m,L,ne){let Ue=f.RecursiveRef(L.$recursiveRef)??!1;return mc(Ue)&&Bl(f,m,Ue,ne)}function _M(f,m,L,ne,Ue,t){let or=f.RecursiveRef(Ue.$recursiveRef)??!1;return mc(or)&&Dp(f,m,"#",ne,or,t)}function OM(f,m,L,ne){let Ue=f.Ref(L.$ref)??!1,t=new Qv,or=mc(Ue)&&Bl(f,t,Ue,ne);return or&&m.Merge([t]),or}function RM(f,m,L,ne,Ue,t){let or=f.Ref(Ue.$ref)??!1,Fr=new Rv,e=mc(or)&&Dp(f,Fr,"#",ne,or,t);return e&&m.Merge([Fr]),e||Fr.GetErrors().forEach(Yn=>m.AddError(Yn)),e}function NM(f,m,L,ne){return It.Every(L.required,0,Ue=>It.HasPropertyKey(ne,Ue))}function kM(f,m,L,ne,Ue,t){let or=[];return It.EveryAll(Ue.required,0,e=>{let Yn=It.HasPropertyKey(t,e);return Yn||or.push(e),Yn})||m.AddError({keyword:"required",schemaPath:L,instancePath:ne,params:{requiredProperties:or}})}function xI(f,m,L,ne,Ue){return It.IsEqual(L,"object")?It.IsObjectNotArray(Ue):It.IsEqual(L,"array")?It.IsArray(Ue):It.IsEqual(L,"boolean")?It.IsBoolean(Ue):It.IsEqual(L,"integer")?It.IsInteger(Ue):It.IsEqual(L,"number")?It.IsNumber(Ue):It.IsEqual(L,"null")?It.IsNull(Ue):It.IsEqual(L,"string")?It.IsString(Ue):It.IsEqual(L,"asyncIterator")?It.IsAsyncIterator(Ue):It.IsEqual(L,"bigint")?It.IsBigInt(Ue):It.IsEqual(L,"constructor")?It.IsConstructor(Ue):It.IsEqual(L,"function")?It.IsFunction(Ue):It.IsEqual(L,"iterator")?It.IsIterator(Ue):It.IsEqual(L,"symbol")?It.IsSymbol(Ue):It.IsEqual(L,"undefined")?It.IsUndefined(Ue):It.IsEqual(L,"void")?It.IsUndefined(Ue):!0}function UM(f,m,L,ne,Ue){return L.some(t=>xI(f,m,t,ne,Ue))}function MM(f,m,L,ne){return It.IsArray(L.type)?UM(f,m,L.type,L,ne):xI(f,m,L.type,L,ne)}function PM(f,m,L,ne,Ue,t){return(It.IsArray(Ue.type)?UM(f,m,Ue.type,Ue,t):xI(f,m,Ue.type,Ue,t))||m.AddError({keyword:"type",schemaPath:L,instancePath:ne,params:{type:Ue.type}})}function DM(f,m,L,ne){let Ue=m.GetIndices();return It.Every(ne,0,(t,or)=>(Ue.has(or)||Bl(f,m,L.unevaluatedItems,t))&&m.AddIndex(or))}function $M(f,m,L,ne,Ue,t){let or=m.GetIndices(),Fr=[];return It.EveryAll(t,0,(Yn,Vn)=>{let Br=new Rv,Xr=(or.has(Vn)||Dp(f,Br,L,ne,Ue.unevaluatedItems,Yn))&&m.AddIndex(Vn);return Xr||Fr.push(Vn),Xr})||m.AddError({keyword:"unevaluatedItems",schemaPath:L,instancePath:ne,params:{unevaluatedItems:Fr}})}function GM(f,m,L,ne){let Ue=m.GetKeys();return It.Every(It.Entries(ne),0,([t,or])=>Ue.has(t)||Bl(f,m,L.unevaluatedProperties,or)&&m.AddKey(t))}function FM(f,m,L,ne,Ue,t){let or=m.GetKeys(),Fr=[];return It.EveryAll(It.Entries(t),0,([Yn,Vn])=>{let Br=new Rv,Xr=or.has(Yn)||Dp(f,Br,L,ne,Ue.unevaluatedProperties,Vn)&&m.AddKey(Yn);return Xr||Fr.push(Yn),Xr})||m.AddError({keyword:"unevaluatedProperties",schemaPath:L,instancePath:ne,params:{unevaluatedProperties:Fr}})}function jM(f){return!It.IsEqual(f.uniqueItems,!1)}function BM(f,m,L,ne){if(!jM(L))return!0;let Ue=new Set(ne.map(Ay.Hash)).size,t=ne.length;return It.IsEqual(Ue,t)}function HM(f,m,L,ne,Ue,t){if(!jM(Ue))return!0;let or=new Set,Fr=t.reduce((Yn,Vn,Br)=>{let Xr=Ay.Hash(Vn);return or.has(Xr)?[...Yn,Br]:(or.add(Xr),Yn)},[]);return It.IsEqual(Fr.length,0)||m.AddError({keyword:"uniqueItems",schemaPath:L,instancePath:ne,params:{duplicateItems:Fr}})}function Bl(f,m,L,ne){f.Push(L);let Ue=mA(L)?FT(f,m,L,ne):(!$T(L)||MM(f,m,L,ne))&&(!(It.IsObject(ne)&&!It.IsArray(ne))||(!bL(L)||NM(f,m,L,ne))&&(!iy(L)||R4(f,m,L,ne))&&(!yT(L)||F4(f,m,L,ne))&&(!LT(L)||B4(f,m,L,ne))&&(!hT(L)||q4(f,m,L,ne))&&(!DE(L)||yM(f,m,L,ne))&&(!$E(L)||wM(f,m,L,ne))&&(!UT(L)||gM(f,m,L,ne))&&(!ME(L)||wI(f,m,L,ne))&&(!OT(L)||CI(f,m,L,ne)))&&(!It.IsArray(ne)||(!dT(L)||x4(f,m,L,ne))&&(!pL(L)||BT(f,m,L,ne))&&(!ah(L)||tM(f,m,L,ne))&&(!xT(L)||mI(f,m,L,ne))&&(!dA(L)||bI(f,m,L,ne))&&(!dL(L)||yI(f,m,L,ne))&&(!uh(L)||hI(f,m,L,ne))&&(!ih(L)||hM(f,m,L,ne))&&(!lh(L)||BM(f,m,L,ne)))&&(!It.IsString(ne)||(!kE(L)||pI(f,m,L,ne))&&(!ST(L)||vI(f,m,L,ne))&&(!UE(L)||EI(f,m,L,ne))&&(!PE(L)||TI(f,m,L,ne)))&&(!(It.IsNumber(ne)||It.IsBigInt(ne))||(!gT(L)||qT(f,m,L,ne))&&(!ly(L)||KT(f,m,L,ne))&&(!_T(L)||dI(f,m,L,ne))&&(!cy(L)||LI(f,m,L,ne))&&(!RT(L)||AI(f,m,L,ne)))&&(!MT(L)||IM(f,m,L,ne))&&(!PT(L)||OM(f,m,L,ne))&&(!pT(L)||A4(f,m,L,ne))&&(!CT(L)||jT(f,m,L,ne))&&(!AT(L)||HT(f,m,L,ne))&&(!TT(L)||J4(f,m,L,ne))&&(!NT(L)||gI(f,m,L,ne))&&(!bT(L)||k4(f,m,L,ne))&&(!vT(L)||M4(f,m,L,ne))&&(!kT(L)||bM(f,m,L,ne))&&(!vA(L)||!It.IsArray(ne)||DM(f,m,L,ne))&&(!CA(L)||!It.IsObject(ne)||GM(f,m,L,ne))&&(!mT(L)||T4(f,m,L,ne));return f.Pop(L),Ue}function Dp(f,m,L,ne,Ue,t){f.Push(Ue);let or=mA(Ue)?D4(f,m,L,ne,Ue,t):!!(+(!$T(Ue)||PM(f,m,L,ne,Ue,t))&+(!(It.IsObject(t)&&!It.IsArray(t))||!!(+(!bL(Ue)||kM(f,m,L,ne,Ue,t))&+(!iy(Ue)||N4(f,m,L,ne,Ue,t))&+(!yT(Ue)||j4(f,m,L,ne,Ue,t))&+(!LT(Ue)||H4(f,m,L,ne,Ue,t))&+(!hT(Ue)||K4(f,m,L,ne,Ue,t))&+(!DE(Ue)||LM(f,m,L,ne,Ue,t))&+(!$E(Ue)||AM(f,m,L,ne,Ue,t))&+(!UT(Ue)||TM(f,m,L,ne,Ue,t))&+(!ME(Ue)||pM(f,m,L,ne,Ue,t))&+(!OT(Ue)||uM(f,m,L,ne,Ue,t))))&+(!It.IsArray(t)||!!(+(!dT(Ue)||S4(f,m,L,ne,Ue,t))&+(!pL(Ue)||G4(f,m,L,ne,Ue,t))&+(!ah(Ue)||rM(f,m,L,ne,Ue,t))&+(!xT(Ue)||nM(f,m,L,ne,Ue,t))&+(!dA(Ue)||oM(f,m,L,ne,Ue,t))&+(!dL(Ue)||iM(f,m,L,ne,Ue,t))&+(!uh(Ue)||cM(f,m,L,ne,Ue,t))&+(!ih(Ue)||EM(f,m,L,ne,Ue,t))&+(!lh(Ue)||HM(f,m,L,ne,Ue,t))))&+(!It.IsString(t)||!!(+(!kE(Ue)||Q4(f,m,L,ne,Ue,t))&+(!ST(Ue)||aM(f,m,L,ne,Ue,t))&+(!UE(Ue)||fM(f,m,L,ne,Ue,t))&+(!PE(Ue)||CM(f,m,L,ne,Ue,t))))&+(!(It.IsNumber(t)||It.IsBigInt(t))||!!(+(!gT(Ue)||z4(f,m,L,ne,Ue,t))&+(!ly(Ue)||V4(f,m,L,ne,Ue,t))&+(!_T(Ue)||sM(f,m,L,ne,Ue,t))&+(!cy(Ue)||lM(f,m,L,ne,Ue,t))&+(!RT(Ue)||mM(f,m,L,ne,Ue,t))))&+(!MT(Ue)||_M(f,m,L,ne,Ue,t))&+(!PT(Ue)||RM(f,m,L,ne,Ue,t))&+(!pT(Ue)||g4(f,m,L,ne,Ue,t))&+(!CT(Ue)||$4(f,m,L,ne,Ue,t))&+(!AT(Ue)||Y4(f,m,L,ne,Ue,t))&+(!TT(Ue)||eM(f,m,L,ne,Ue,t))&+(!NT(Ue)||dM(f,m,L,ne,Ue,t))&+(!bT(Ue)||U4(f,m,L,ne,Ue,t))&+(!vT(Ue)||P4(f,m,L,ne,Ue,t))&+(!kT(Ue)||vM(f,m,L,ne,Ue,t))&+(!vA(Ue)||!It.IsArray(t)||$M(f,m,L,ne,Ue,t))&+(!CA(Ue)||!It.IsObject(t)||FM(f,m,L,ne,Ue,t)))&&(!mT(Ue)||I4(f,m,L,ne,Ue,t));return f.Pop(Ue),or}var CL={};hC(CL,{Ref:()=>a8});var fy={};hC(fy,{Delete:()=>e8,Get:()=>Qj,Has:()=>Zj,Indices:()=>BE,Set:()=>Jj});function qM(f){if(f.length===0)throw Error("Cannot set root")}function KM(f){if(!It.IsObject(f))throw Error("Cannot set value")}function Vj(f){return/^(0|[1-9]\d*)$/.test(f)}function YM(f){return[f.slice(0,f.length-1),f.slice(f.length-1)[0]]}function Wj(f,m){return It.IsObject(m)&&It.HasPropertyKey(m,f)}function Xj(f,m){return It.IsObject(m)?m[f]:void 0}function SI(f,m){return f.reduce((L,ne)=>Xj(ne,L),m)}function BE(f){if(It.IsEqual(f.length,0))return[];let m=f.split("/").map(L=>L.replace(/~1/g,"/").replace(/~0/g,"~"));return m.length>0&&m[0]===""?m.slice(1):m}function Zj(f,m){let L=f;return BE(m).every(ne=>Wj(ne,L)?(L=L[ne],!0):!1)}function Qj(f,m){let L=BE(m);return SI(L,f)}function Jj(f,m,L){let ne=BE(m);qM(ne);let[Ue,t]=YM(ne),or=SI(Ue,f);return KM(or),or[t]=L,f}function e8(f,m){let L=BE(m);qM(L);let[ne,Ue]=YM(L),t=SI(ne,f);return KM(t),It.IsArray(t)&&Vj(Ue)?t.splice(+Ue,1):delete t[Ue],f}function t8(f,m,L){if(f.$id===L.hash)return f;let ne=new URL(f.$id,m.href),Ue=new URL(L.href,m.href);if(It.IsEqual(ne.pathname,Ue.pathname))return L.hash.startsWith("#")?zM(f,m,L):f}function r8(f,m,L){let ne=new URL(`#${f.$anchor}`,m.href),Ue=new URL(L.href,m.href);if(It.IsEqual(ne.href,Ue.href))return f}function zM(f,m,L){return L.href.endsWith("#")?f:L.hash.startsWith("#")?fy.Get(f,decodeURIComponent(L.hash.slice(1))):void 0}function n8(f,m,L){if(mL(f)){let ne=t8(f,m,L);if(!It.IsUndefined(ne))return ne}if(NE(f)){let ne=r8(f,m,L);if(!It.IsUndefined(ne))return ne}return zM(f,m,L)}function s8(f,m,L){return f.reduce((ne,Ue)=>{let t=OI(Ue,m,L);return It.IsUndefined(t)?ne:t},void 0)}function o8(f,m,L){return It.Keys(f).reduce((ne,Ue)=>{let t=OI(f[Ue],m,L);return It.IsUndefined(t)?ne:t},void 0)}function OI(f,m,L){if(m=uy(f)&&mL(f)?new URL(f.$id,m.href):m,uy(f)){let ne=n8(f,m,L);if(!It.IsUndefined(ne))return ne}if(It.IsArray(f))return s8(f,m,L);if(It.IsObject(f))return o8(f,m,L)}function a8(f,m){let L=new URL("http://unknown"),ne=mL(f)?new URL(f.$id,L.href):L,Ue=new URL(m,ne.href);return OI(f,ne,Ue)}var yL=class{constructor(m,L){this.context=m,this.schema=L,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((m,L)=>new URL(L.$id,m),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(m){uy(m)&&(mL(m)&&this.ids.push(m),NE(m)&&this.anchors.push(m),bA(m)&&this.recursiveAnchors.push(m),ET(m)&&this.dynamicAnchors.push(m))}Pop(m){uy(m)&&(mL(m)&&this.ids.pop(),NE(m)&&this.anchors.pop(),bA(m)&&this.recursiveAnchors.pop(),ET(m)&&this.dynamicAnchors.pop())}FromContext(m){return It.HasPropertyKey(this.context,m)?this.context[m]:void 0}FromRef(m){return m.startsWith("#")?CL.Ref(this.Base(),m):CL.Ref(this.schema,m)}Ref(m){return this.FromContext(m)??this.FromRef(m)}RecursiveRef(m){return bA(this.Base())?CL.Ref(this.recursiveAnchors[0],m):CL.Ref(this.Base(),m)}};function VM(...f){let[m,L,ne]=pd.Match(f,{3:(or,Fr,e)=>[or,Fr,e],2:(or,Fr)=>[{},or,Fr]}),Ue=new yL(m,L),t=new Qv;return Bl(Ue,t,L,ne)}function WM(...f){let[m,L,ne]=pd.Match(f,{3:(Vn,Br,Xr)=>[Vn,Br,Xr],2:(Vn,Br)=>[{},Vn,Br]}),Ue=dC.Get(),t=cx(),or=[],Fr=new yL(m,L),e=new GE(Vn=>{if(!It.IsGreaterEqualThan(or.length,Ue.maxErrors))return or.push({...Vn,message:t(Vn)})});return[Dp(Fr,e,"#","",L,ne),or]}function $b(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return VM(m,L,ne)}function Fy(...f){let[m,L,ne]=pd.Match(f,{3:(or,Fr,e)=>[or,Fr,e],2:(or,Fr)=>[{},or,Fr]}),[Ue,t]=WM(m,L,ne);return t}var jy=class extends Error{constructor(m,L,ne){super(m),Object.defineProperty(this,"cause",{value:{source:m,errors:ne,value:L},writable:!1,configurable:!1,enumerable:!1})}};function XM(f,m,L){return It.IsArray(L)?L.map(ne=>kv(f,m.items,ne)):L}function ZM(f,m,L){return m.Clean(L)}function QM(f,m,L){return kv({...f,...m.$defs},hv(m.$ref),L)}function i8(f){let m=It.HasPropertyKey(f,"unevaluatedProperties")?{additionalProperties:f.unevaluatedProperties}:{},L=OC(f);return Il(L)?Vw(L,m):L}function JM(f,m,L){let ne=i8(m);return kv(f,ne,L)}function yA(f){return It.HasPropertyKey(f,"additionalProperties")?f.additionalProperties:void 0}function e2(f,m,L){if(!It.IsObject(L)||It.IsArray(L))return L;let ne=yA(m);for(let Ue of It.Keys(L)){if(It.HasPropertyKey(m.properties,Ue)){L[Ue]=kv(f,m.properties[Ue],L[Ue]);continue}if(It.IsBoolean(ne)&&It.IsEqual(ne,!0)||Ou(ne)&&$b(f,ne,L[Ue])){L[Ue]=kv(f,ne,L[Ue]);continue}delete L[Ue]}return L}function t2(f,m,L){if(!It.IsObject(L))return L;let ne=yA(m),[Ue,t]=[new RegExp(cC(m)),Gv(m)];for(let or of It.Keys(L)){if(Ue.test(or)){L[or]=kv(f,t,L[or]);continue}if(It.IsBoolean(ne)&&It.IsEqual(ne,!0)||Ou(ne)&&$b(f,ne,L[or])){L[or]=kv(f,ne,L[or]);continue}delete L[or]}return L}function r2(f,m,L){return It.HasPropertyKey(f,m.$ref)?kv(f,f[m.$ref],L):L}function n2(f,m,L){if(!It.IsArray(L))return L;let ne=Math.min(L.length,m.items.length);for(let Ue=0;Ue<ne;Ue++)L[Ue]=kv(f,m.items[Ue],L[Ue]);return It.IsGreaterThan(L.length,ne)?L.slice(0,ne):L}function l8(f){let m={};for(let L of Object.getOwnPropertyNames(f))m[L]=tv(f[L]);for(let L of Object.getOwnPropertySymbols(f))m[L]=tv(f[L]);return m}function c8(f){return It.IsClassInstance(f)?f:l8(f)}function f8(f){return f.map(m=>tv(m))}function p8(f){return f.slice()}function m8(f){return new Map(tv([...f.entries()]))}function d8(f){return new Set(tv([...f.values()]))}function tv(f){return zv.IsTypeArray(f)?p8(f):zv.IsMap(f)?m8(f):zv.IsSet(f)?d8(f):It.IsArray(f)?f8(f):It.IsObject(f)?c8(f):f}function s2(f,m,L){for(let ne of m.anyOf){let Ue=kv(f,ne,tv(L));if($b(f,ne,Ue))return Ue}return L}function kv(f,m,L){return Z0(m)?XM(f,m,L):bC(m)?ZM(f,m,L):Db(m)?QM(f,m,L):Bi(m)?JM(f,m,L):Il(m)?e2(f,m,L):pv(m)?t2(f,m,L):hb(m)?r2(f,m,L):dp(m)?n2(f,m,L):yu(m)?s2(f,m,L):L}function hL(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return kv(m,L,ne)}function o2(f,m,L){return It.IsArray(L)?L.map(ne=>Av(f,m.items,ne)):L}function a2(f,m,L){return m.Convert(L)}var Am={};hC(Am,{Fail:()=>EL,IsOk:()=>NI,Ok:()=>Ai,TryBigInt:()=>kI,TryBoolean:()=>k8,TryNull:()=>F8,TryNumber:()=>W8,TryString:()=>rB,TryUndefined:()=>lB});function NI(f){return It.IsObject(f)&&It.HasPropertyKey(f,"value")}function Ai(f){return{value:f}}function EL(){}function b8(f){return Ai(f)}function v8(f){return It.IsEqual(f,!0)?Ai(BigInt(1)):Ai(BigInt(0))}function C8(f){return Ai(BigInt(Math.trunc(f)))}function y8(f){return Ai(BigInt(0))}var L8=/^-?(0|[1-9]\d*)n$/,h8=/^-?(0|[1-9]\d*)\.\d+$/,E8=/^-?(0|[1-9]\d*)$/;function w8(f){return L8.test(f)}function A8(f){return h8.test(f)}function g8(f){return E8.test(f)}function T8(f){let m=f.toLowerCase();return w8(f)?Ai(BigInt(f.slice(0,f.length-1))):A8(f)?Ai(BigInt(f.split(".")[0])):g8(f)?Ai(BigInt(f)):It.IsEqual(m,"false")?Ai(BigInt(0)):It.IsEqual(m,"true")?Ai(BigInt(1)):void 0}function I8(f){return Ai(BigInt(0))}function kI(f){return It.IsBigInt(f)?b8(f):It.IsBoolean(f)?v8(f):It.IsNumber(f)?C8(f):It.IsNull(f)?y8(f):It.IsString(f)?T8(f):It.IsUndefined(f)?I8(f):void 0}function _8(f){return It.IsEqual(f,BigInt(0))?Ai(!1):It.IsEqual(f,BigInt(1))?Ai(!0):void 0}function x8(f){return Ai(f)}function S8(f){return It.IsEqual(f,0)?Ai(!1):It.IsEqual(f,1)?Ai(!0):void 0}function O8(f){return Ai(!1)}function R8(f){return It.IsEqual(f.toLowerCase(),"false")?Ai(!1):It.IsEqual(f.toLowerCase(),"true")?Ai(!0):It.IsEqual(f,"0")?Ai(!1):It.IsEqual(f,"1")?Ai(!0):void 0}function N8(f){return Ai(!1)}function k8(f){return It.IsBigInt(f)?_8(f):It.IsBoolean(f)?x8(f):It.IsNumber(f)?S8(f):It.IsNull(f)?O8(f):It.IsString(f)?R8(f):It.IsUndefined(f)?N8(f):void 0}function U8(f){return It.IsEqual(f,BigInt(0))?Ai(null):void 0}function M8(f){return It.IsEqual(f,!1)?Ai(null):void 0}function P8(f){return It.IsEqual(f,0)?Ai(null):void 0}function D8(f){return Ai(null)}function $8(f){let m=f.toLowerCase();return It.IsEqual(m,"undefined")||It.IsEqual(m,"null")||It.IsEqual(f,"")||It.IsEqual(f,"0")?Ai(null):void 0}function G8(f){return Ai(null)}function F8(f){return It.IsBigInt(f)?U8(f):It.IsBoolean(f)?M8(f):It.IsNumber(f)?P8(f):It.IsNull(f)?D8(f):It.IsString(f)?$8(f):It.IsUndefined(f)?G8(f):void 0}var j8=BigInt(Number.MAX_SAFE_INTEGER),B8=BigInt(Number.MIN_SAFE_INTEGER);function H8(f){return f<=j8&&f>=B8}function u2(f){return H8(f)?Ai(Number(f)):void 0}function q8(f){return f?Ai(1):Ai(0)}function K8(f){return Ai(f)}function Y8(f){return Ai(0)}function z8(f){let m=+f;if(It.IsNumber(m))return Ai(m);let L=f.toLowerCase();if(It.IsEqual(L,"false"))return Ai(0);if(It.IsEqual(L,"true"))return Ai(1);let ne=kI(f);return NI(ne)?u2(ne.value):void 0}function V8(f){return Ai(0)}function W8(f){return It.IsBigInt(f)?u2(f):It.IsBoolean(f)?q8(f):It.IsNumber(f)?K8(f):It.IsNull(f)?Y8(f):It.IsString(f)?z8(f):It.IsUndefined(f)?V8(f):void 0}function X8(f){return Ai(f.toString())}function Z8(f){return Ai(f.toString())}function Q8(f){return Ai(f.toString())}function J8(f){return Ai("null")}function eB(f){return Ai(f)}function tB(f){return Ai("")}function rB(f){return It.IsBigInt(f)?X8(f):It.IsBoolean(f)?Z8(f):It.IsNumber(f)?Q8(f):It.IsNull(f)?J8(f):It.IsString(f)?eB(f):It.IsUndefined(f)?tB(f):void 0}function nB(f){return It.IsEqual(f,BigInt(0))?Ai(void 0):void 0}function sB(f){return It.IsEqual(f,!1)?Ai(void 0):void 0}function oB(f){return It.IsEqual(f,0)?Ai(void 0):void 0}function aB(f){return Ai(void 0)}function uB(f){let m=f.toLowerCase();return It.IsEqual(m,"undefined")||It.IsEqual(m,"null")||It.IsEqual(f,"")||It.IsEqual(f,"0")?Ai(void 0):void 0}function iB(f){return Ai(void 0)}function lB(f){return It.IsBigInt(f)?nB(f):It.IsBoolean(f)?sB(f):It.IsNumber(f)?oB(f):It.IsNull(f)?aB(f):It.IsString(f)?uB(f):It.IsUndefined(f)?iB(f):void 0}function i2(f,m,L){if(It.IsBigInt(L))return L;let ne=Am.TryBigInt(L);return Am.IsOk(ne)?ne.value:L}function l2(f,m,L){if(It.IsBoolean(L))return L;let ne=Am.TryBoolean(L);return Am.IsOk(ne)?ne.value:L}function c2(f,m,L){return Av({...f,...m.$defs},hv(m.$ref),L)}function LA(f,m,L){if(m.anyOf.some(or=>$b(f,or,L)))return L;let t=m.anyOf.map(or=>Av(f,or,tv(L))).find(or=>$b(f,m,or));return It.IsUndefined(t)?L:t}function f2(f,m,L){let ne=tL(m);return LA(f,ne,L)}function p2(f,m,L){if(It.IsInteger(L))return L;let ne=Am.TryNumber(L);return Am.IsOk(ne)?Math.trunc(ne.value):L}function m2(f,m,L){let ne=OC(m);return Av(f,ne,L)}function cB(f,m,L){let ne=Am.TryBigInt(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function fB(f,m,L){let ne=Am.TryBoolean(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function pB(f,m,L){let ne=Am.TryNumber(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function mB(f,m,L){let ne=Am.TryString(L);return Am.IsOk(ne)&&It.IsEqual(m.const,ne.value)?ne.value:L}function d2(f,m,L){return It.IsEqual(m.const,L)?L:yx(m)?cB(f,m,L):Lx(m)?fB(f,m,L):OL(m)?pB(f,m,L):RL(m)?mB(f,m,L):Vf()}function b2(f,m,L){if(It.IsNull(L))return L;let ne=Am.TryNull(L);return Am.IsOk(ne)?ne.value:L}function v2(f,m,L){if(It.IsNumber(L))return L;let ne=Am.TryNumber(L);return Am.IsOk(ne)?ne.value:L}function hA(f,m,L,ne){let Ue=It.Keys(ne);for(let[t,or]of m)for(let Fr of Ue)t.test(Fr)||(ne[Fr]=Av(f,L,ne[Fr]));return ne}function HE(f,m,L){return gv(f)&&It.IsUndefined(L[m])}function dB(f,m,L){let ne=It.EntriesRegExp(m.properties),Ue=It.Keys(L);for(let[t,or]of ne)for(let Fr of Ue)!t.test(Fr)||HE(or,Fr,L)||(L[Fr]=Av(f,or,L[Fr]));return It.HasPropertyKey(m,"additionalProperties")&&It.IsObject(m.additionalProperties)?hA(f,ne,m.additionalProperties,L):L}function C2(f,m,L){return It.IsObjectNotArray(L)?dB(f,m,L):L}function bB(f,m,L){let ne=It.EntriesRegExp(m.patternProperties),Ue=It.Keys(L);for(let[t,or]of ne)for(let Fr of Ue)t.test(Fr)&&(L[Fr]=Av(f,or,L[Fr]));return It.HasPropertyKey(m,"additionalProperties")&&It.IsObject(m.additionalProperties)?hA(f,ne,m.additionalProperties,L):L}function y2(f,m,L){return It.IsObjectNotArray(L)?bB(f,m,L):L}function L2(f,m,L){return It.HasPropertyKey(f,m.$ref)?Av(f,f[m.$ref],L):L}function h2(f,m,L){if(It.IsString(L))return L;let ne=Am.TryString(L);return Am.IsOk(ne)?ne.value:L}function E2(f,m,L){let ne=Fv(m.pattern);return Av(f,ne,L)}function w2(f,m,L){if(!It.IsArray(L))return L;for(let ne=0;ne<Math.min(m.items.length,L.length);ne++)L[ne]=Av(f,m.items[ne],L[ne]);return L}function A2(f,m,L){if(It.IsUndefined(L))return L;let ne=Am.TryUndefined(L);return Am.IsOk(ne)?ne.value:L}function g2(f,m,L){if(It.IsUndefined(L))return L;let ne=Am.TryUndefined(L);return Am.IsOk(ne)?void 0:L}function Av(f,m,L){return Z0(m)?o2(f,m,L):bC(m)?a2(f,m,L):lC(m)?i2(f,m,L):Xv(m)?l2(f,m,L):Db(m)?c2(f,m,L):Cv(m)?f2(f,m,L):Sv(m)?p2(f,m,L):Bi(m)?m2(f,m,L):_0(m)?d2(f,m,L):MC(m)?b2(f,m,L):fv(m)?v2(f,m,L):Il(m)?C2(f,m,L):pv(m)?y2(f,m,L):hb(m)?L2(f,m,L):Ev(m)?h2(f,m,L):yv(m)?E2(f,m,L):dp(m)?w2(f,m,L):GC(m)?A2(f,m,L):yu(m)?LA(f,m,L):fC(m)?g2(f,m,L):L}function By(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return Av(m,L,ne)}function T2(f,m,L){if(!It.IsArray(L))return L;for(let ne=0;ne<L.length;ne++)L[ne]=xv(f,m.items,L[ne]);return L}function I2(f,m,L){return m.Default(L)}function _2(f,m,L){return xv({...f,...m.$defs},hv(m.$ref),L)}function x2(f,m){return It.IsUndefined(m)?It.IsFunction(f.default)?f.default():tv(f.default):m}function S2(f,m,L){let ne=OC(m);return xv(f,ne,L)}function O2(f,m,L){if(!It.IsObject(L))return L;let ne=It.Keys(m.properties);for(let Ue of ne){let t=xv(f,m.properties[Ue],L[Ue]);It.IsUndefined(t)&&(gv(m.properties[Ue])||!It.HasPropertyKey(m.properties[Ue],"default"))||(L[Ue]=xv(f,m.properties[Ue],L[Ue]))}if(!iy(m)||It.IsBoolean(m.additionalProperties))return L;for(let Ue of It.Keys(L))ne.includes(Ue)||(L[Ue]=xv(f,m.additionalProperties,L[Ue]));return L}function R2(f,m,L){if(!It.IsObject(L))return L;let[ne,Ue]=[new RegExp(cC(m)),Gv(m)];for(let t of It.Keys(L))ne.test(t)&&yC(Ue)&&(L[t]=xv(f,Ue,L[t]));if(!iy(m))return L;for(let t of It.Keys(L))ne.test(t)||(L[t]=xv(f,m.additionalProperties,L[t]));return L}function N2(f,m,L){return It.HasPropertyKey(f,m.$ref)?xv(f,f[m.$ref],L):L}function k2(f,m,L){if(!It.IsArray(L))return L;let[ne,Ue]=[m.items,Math.max(m.items.length,L.length)];for(let t=0;t<Ue;t++)t<ne.length&&(L[t]=xv(f,ne[t],L[t]));return L}function U2(f,m,L){for(let ne of m.anyOf){let Ue=xv(f,ne,tv(L));if($b(f,ne,Ue))return Ue}return L}function xv(f,m,L){let ne=yC(m)?x2(m,L):L;return Z0(m)?T2(f,m,ne):bC(m)?I2(f,m,ne):Db(m)?_2(f,m,ne):Bi(m)?S2(f,m,ne):Il(m)?O2(f,m,ne):pv(m)?R2(f,m,ne):hb(m)?N2(f,m,ne):dp(m)?k2(f,m,ne):yu(m)?U2(f,m,ne):ne}function wL(...f){let[m,L,ne]=pd.Match(f,{3:(Ue,t,or)=>[Ue,t,or],2:(Ue,t)=>[{},Ue,t]});return xv(m,L,ne)}function ph(f){return(...m)=>{let[L,ne,Ue]=pd.Match(m,{3:(t,or,Fr)=>[t,or,Fr],2:(t,or)=>[{},t,or]});return f.reduce((t,or)=>or(L,ne,t),Ue)}}function vB(f,m,L){return m["~codec"].decode(L)}function CB(f,m,L){return m["~codec"].encode(L)}function bv(f,m,L,ne){return Xy(L)?It.IsEqual(f,"Decode")?vB(m,L,ne):CB(m,L,ne):ne}function yB(f,m,L,ne){if(!It.IsArray(ne))return Vf();for(let Ue=0;Ue<ne.length;Ue++)ne[Ue]=ov(f,m,L.items,ne[Ue]);return bv(f,m,L,ne)}function LB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsArray(Ue))return Ue;for(let t=0;t<Ue.length;t++)Ue[t]=ov(f,m,L.items,Ue[t]);return Ue}function M2(f,m,L,ne){return It.IsEqual(f,"Decode")?yB(f,m,L,ne):LB(f,m,L,ne)}function P2(f,m,L,ne){return ne=ov(f,{...m,...L.$defs},hv(L.$ref),ne),bv(f,m,L,ne)}function hB(f,m,L,ne){for(let Ue of L.allOf)ne=ov(f,m,Ue,ne);return bv(f,m,L,ne)}function EB(f,m,L,ne){let Ue=bv(f,m,L,ne);for(let t of L.allOf)Ue=ov(f,m,t,Ue);return Ue}function D2(f,m,L,ne){return It.IsEqual(f,"Decode")?hB(f,m,L,ne):EB(f,m,L,ne)}function wB(f,m,L,ne){if(!It.IsObjectNotArray(ne))return Vf();for(let Ue of It.Keys(L.properties))!It.HasPropertyKey(ne,Ue)||HE(L.properties[Ue],Ue,ne)||(ne[Ue]=ov(f,m,L.properties[Ue],ne[Ue]));return bv(f,m,L,ne)}function AB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsObjectNotArray(Ue))return Ue;for(let t of It.Keys(L.properties))!It.HasPropertyKey(Ue,t)||HE(L.properties[t],t,Ue)||(Ue[t]=ov(f,m,L.properties[t],Ue[t]));return Ue}function $2(f,m,L,ne){return It.IsEqual(f,"Decode")?wB(f,m,L,ne):AB(f,m,L,ne)}function gB(f,m,L,ne){if(!It.IsObjectNotArray(ne))return Vf();let Ue=new RegExp(cC(L));for(let t of It.Keys(ne))Ue.test(t)||Vf(),ne[t]=ov(f,m,Gv(L),ne[t]);return bv(f,m,L,ne)}function TB(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsObjectNotArray(Ue))return Ue;let t=new RegExp(cC(L));for(let or of It.Keys(Ue))t.test(or)&&(Ue[or]=ov(f,m,Gv(L),Ue[or]));return Ue}function G2(f,m,L,ne){return It.IsEqual(f,"Decode")?gB(f,m,L,ne):TB(f,m,L,ne)}function F2(f,m,L,ne){return ne=It.HasPropertyKey(m,L.$ref)?ov(f,m,m[L.$ref],ne):ne,bv(f,m,L,ne)}function IB(f,m,L,ne){if(!It.IsArray(ne))return Vf();for(let Ue=0;Ue<Math.min(L.items.length,ne.length);Ue++)ne[Ue]=ov(f,m,L.items[Ue],ne[Ue]);return bv(f,m,L,ne)}function _B(f,m,L,ne){let Ue=bv(f,m,L,ne);if(!It.IsArray(Ue))return ne;for(let t=0;t<Math.min(L.items.length,Ue.length);t++)Ue[t]=ov(f,m,L.items[t],Ue[t]);return Ue}function j2(f,m,L,ne){return It.IsEqual(f,"Decode")?IB(f,m,L,ne):_B(f,m,L,ne)}function xB(f,m,L,ne){for(let Ue of L.anyOf){if(!$b(m,Ue,ne))continue;let t=ov(f,m,Ue,ne);return bv(f,m,L,t)}return Vf()}function SB(f,m,L,ne){let Ue=bv(f,m,L,ne);for(let t of L.anyOf){let or=ov(f,m,t,tv(Ue));if($b(m,t,or))return or}return Ue}function B2(f,m,L,ne){return It.IsEqual(f,"Decode")?xB(f,m,L,ne):SB(f,m,L,ne)}function ov(f,m,L,ne){return Z0(L)?M2(f,m,L,ne):Db(L)?P2(f,m,L,ne):Bi(L)?D2(f,m,L,ne):Il(L)?$2(f,m,L,ne):pv(L)?G2(f,m,L,ne):hb(L)?F2(f,m,L,ne):dp(L)?j2(f,m,L,ne):yu(L)?B2(f,m,L,ne):bv(f,m,L,ne)}var UI=class extends jy{constructor(m,L){super("Decode",m,L)}};function OB(f,m,L){if(!$b(f,m,L))throw new UI(L,Fy(f,m,L));return L}function RB(f,m,L){return ov("Decode",f,m,L)}var E$e=ph([(f,m,L)=>tv(L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>OB(f,m,L),(f,m,L)=>RB(f,m,L)]);var MI=class extends jy{constructor(m,L){super("Encode",m,L)}};function NB(f,m,L){if(!$b(f,m,L))throw new MI(L,Fy(f,m,L));return L}function kB(f,m,L){return ov("Encode",f,m,L)}var k$e=ph([(f,m,L)=>tv(L),(f,m,L)=>kB(f,m,L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>NB(f,m,L)]);var AC=class extends Error{constructor(m,L){super(L),this.type=m}};function H2(f,m){return It.IsFunction(m.default)?m.default(m):It.IsObject(m.default)?tv(m.default):m.default}function q2(f,m){if(lh(m)&&!yC(m))throw new AC(m,"Arrays with uniqueItems constraints must specify a default annotation");let L=uh(m)?m.minItems:0;return Array.from({length:L},()=>av(f,m.items))}async function*UB(){}function K2(f,m){return UB()}function Y2(f,m){return m.Create()}function z2(f,m){return ly(m)?BigInt(m.exclusiveMinimum)+BigInt(1):cy(m)?BigInt(m.minimum):BigInt(0)}function V2(f,m){return!1}function W2(f,m){let L=av(f,m.instanceType);return class{constructor(){Object.assign(this,L)}}}function X2(f,m){return av({...f,...m.$defs},hv(m.$ref))}function Z2(f,m){return av(f,tL(m))}function Q2(f,m){let L=av(f,m.returnType);return()=>L}function J2(f,m){return ly(m)&&It.IsNumber(m.exclusiveMinimum)?m.exclusiveMinimum+1:cy(m)?m.minimum:0}function eP(f,m){return av(f,OC(m))}function*MB(){}function tP(f,m){return MB()}function rP(f,m){return m.const}function nP(f,m){throw new AC(m,"Cannot create TNever types")}function sP(f,m){return null}function oP(f,m){return ly(m)&&It.IsNumber(m.exclusiveMinimum)?m.exclusiveMinimum+1:cy(m)?m.minimum:0}function aP(f,m){return(It.IsUndefined(m.required)?[]:m.required).reduce((ne,Ue)=>({...ne,[Ue]:av(f,m.properties[Ue])}),{})}function uP(f,m){return Promise.resolve(av(f,m.item))}function iP(f,m){if(ME(m)&&!yC(m))throw new AC(m,"Record with the minProperties constraint must have a default annotation");return{}}function lP(f,m){return It.HasPropertyKey(f,m.$ref)?av(f,f[m.$ref]):(()=>{throw new AC(m,"Unable to deref Ref")})()}function cP(f,m){if((PE(m)||kE(m))&&!yC(m))throw Error("Strings with format or pattern constraints must specify default");let ne=UE(m)?m.minLength:0;return"".padEnd(ne)}function fP(f,m){return Symbol()}function pP(f,m){let L=Fv(m.pattern);if(Ev(L))throw new AC(m,"Unable to create TemplateLiteral due to infinite type expansion");return av(f,L)}function mP(f,m){return Array.from({length:m.minItems},(L,ne)=>av(f,m.items[ne]))}function dP(f,m){if(It.IsEqual(m.anyOf.length,0))throw Error("Unable to create Union with no variants");return av(f,m.anyOf[0])}function av(f,m){return yC(m)?H2(f,m):Z0(m)?q2(f,m):Kv(m)?K2(f,m):bC(m)?Y2(f,m):lC(m)?z2(f,m):Xv(m)?V2(f,m):Tv(m)?W2(f,m):Db(m)?X2(f,m):Cv(m)?Z2(f,m):Iv(m)?Q2(f,m):Sv(m)?J2(f,m):Bi(m)?eP(f,m):Yv(m)?tP(f,m):_0(m)?rP(f,m):ty(m)?nP(f,m):MC(m)?sP(f,m):fv(m)?oP(f,m):Il(m)?aP(f,m):$v(m)?uP(f,m):pv(m)?iP(f,m):hb(m)?lP(f,m):Ev(m)?cP(f,m):PC(m)?fP(f,m):yv(m)?pP(f,m):dp(m)?mP(f,m):GC(m)?void 0:yu(m)?dP(f,m):fC(m)?void 0:void 0}function VC(...f){let[m,L]=pd.Match(f,{2:(ne,Ue)=>[ne,Ue],1:ne=>[{},ne]});return av(m,L)}var PI=class extends jy{constructor(m,L){super("Parse",m,L)}};function PB(f,m,L){if(!$b(f,m,L))throw new PI(L,Fy(f,m,L));return L}var $Ge=ph([(f,m,L)=>tv(L),(f,m,L)=>wL(f,m,L),(f,m,L)=>By(f,m,L),(f,m,L)=>hL(f,m,L),(f,m,L)=>PB(f,m,L)]);var $B=ul({type:mp("insert"),path:sC(),value:Pv()}),GB=Object({type:mp("update"),path:sC(),value:Pv()}),FB=ul({type:mp("delete"),path:sC()}),KGe=xc([$B,GB,FB]);function qE(f){if(!f.body)throw new Error("This command does not accept a request body");let m=f.body;return m.examples?.length?m.examples[0]:VC(m)}var CP=NA(require("node:fs"));function KE(f){if(f.file){let m=CP.default.readFileSync(f.file==="-"?0:f.file,"utf-8");return JSON.parse(m)}if(f.data)return JSON.parse(f.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function uC(f){process.stdout.write(`${JSON.stringify(f,null,2)}
|
|
105
105
|
`)}function qB(f){return f.replace(/-/g," ").replace(/ies$/,"y").replace(/s$/,"")}function yP(f,m,L){let ne=f.command(m.commandName).description(m.description),Ue=qB(m.commandName),t=ne.command("list").description(`List all ${m.commandName}`);if(m.listOptions)for(let or of m.listOptions)t.option(or.flag,or.description);if(t.action(async or=>{let Fr={};if(m.listOptions)for(let Yn of m.listOptions){let Vn=or[Yn.queryParam];Vn!==void 0&&(Fr[Yn.queryParam]=Vn)}let e=await L()(m.endpoints.list,Object.keys(Fr).length>0?{query:Fr}:void 0);uC(e)}),m.endpoints.get){let or=m.endpoints.get;ne.command("get <id>").description(`Get a ${Ue} by ID`).action(async Fr=>{let e=await L()(or,{params:{id:Fr}});uC(e)})}ne.command("create").description(`Create a new ${Ue}`).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 or=>{if(or.generateSkeleton){uC(qE(m.endpoints.create));return}let Fr=KE(or),e=await L()(m.endpoints.create,{body:Fr});uC(e)}),ne.command("update <id>").description(`Update a ${Ue} 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(or,Fr)=>{if(Fr.generateSkeleton){uC(qE(m.endpoints.update));return}let e=KE(Fr),Yn=await L()(m.endpoints.update,{params:{id:or},body:e});uC(Yn)}),ne.command("delete <id>").description(`Delete a ${Ue} by ID`).action(async or=>{let Fr=await L()(m.endpoints.delete,{params:{id:or}});uC(Fr)})}var KB=[{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:oU,get:aU,create:uU,update:iU,delete:lU},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:fU,create:pU,update:mU,delete:dU}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:wU,get:AU,create:gU,update:TU,delete:IU}},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:UU,get:MU,create:PU,update:DU,delete:$U}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:FU,get:jU,create:HU,update:qU,delete:KU}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:VU,get:WU,create:XU,update:ZU,delete:QU}},{commandName:"routes",description:"Manage routes",endpoints:{list:JU,get:e4,create:t4,update:r4,delete:n4}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:m4,get:d4,create:b4,update:v4,delete:C4}},{commandName:"teams",description:"Manage teams",endpoints:{list:y4,get:L4,create:h4,update:E4,delete:w4}}];function LP(f,m){for(let L of KB)yP(f,L,m)}var hP=`/${"v1"}/aggregation`,EP=ge.Object({id:ge.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:ge.Record(ge.String(),ge.Union([ge.String(),ge.Number()]),{description:"Group-by field values"})}),YB={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},wP=ge.Object({results:ge.Array(ge.Object({...EP.properties,value:ge.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(wP,{examples:[YB]});var zB={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},AP=ge.Object({series:ge.Array(ge.Object({...EP.properties,points:ge.Array(ge.Object({timestamp:ge.Integer({description:"Timestamp in milliseconds"}),value:ge.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(AP,{examples:[zB]});var gP={timeRange:wC,queries:ge.Array(ge.Omit(oE.items,["fill"],{title:"AggregationQuery"}),{maxItems:Kg,description:"Aggregations that may be combined together in the same query"}),groupBy:ge.Optional(iE),dataSource:sE,formula:ge.Optional(uE)},VB=ge.Object(gP),TP=ao({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${hP}/multi-query/scalar`,method:"POST",body:VB,response:wP}),WB=ge.Object({...gP,aggregationWindow:ms({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),IP=ao({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${hP}/multi-query/timeseries`,method:"POST",body:WB,response:AP});var EA="/v0/logs";var YE=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var XB=0,ZB=ge.Object({__tsuga_metadata__:ge.Object({id:ge.String(),source:ge.Optional(ge.String())},{additionalProperties:!0}),context:ge.Optional(ge.Object({team:ge.Optional(ge.String()),tag_policy_warnings:ge.Optional(ge.Record(ge.String(),ge.String()))},{additionalProperties:!0})),message:ge.Optional(ge.String()),timestamp:ge.Number(),level:ge.Enum(YE)},{additionalProperties:!0});var AL={...oy.properties,query:ge.Optional(ms({type:"tsuga-query"})),maxResults:ge.Optional(ge.Number({minimum:1,maximum:1e3})),shouldRecommendAttributes:ge.Optional(ge.Boolean()),defaultAttributesToHighlight:ge.Optional(ge.Array(ms(),{maxItems:50})),triggeredBy:ge.Optional(ge.Literal("refresh")),startOffset:ge.Optional(ge.Number({minimum:XB})),clusterId:ge.Optional(ms({allowEmpty:!1}))},Jje=ao({tags:["logs"],url:`${EA}/count`,method:"GET",query:ge.Pick(ge.Object(AL),["from","to","query","clusterId"]),response:ge.Object({count:ge.Number()})}),$I=ge.Object({value:ge.String(),priority:ge.Number({minimum:0,maximum:1})}),e8e=ao({tags:["logs"],url:`${EA}/search`,method:"GET",query:ge.Object(AL),response:ge.Object({logs:ge.Optional(ge.Array(ZB)),attributesToHighlight:ge.Optional(ge.Array($I))},{additionalProperties:!0})}),GI=ge.Cyclic({TokenOutput:ge.Union([ge.Object({type:ge.Literal("top"),values:ge.Array(ge.String())}),ge.Object({type:ge.Literal("ip"),value:ge.String()}),ge.Object({type:ge.Literal("range"),min:ge.Number(),max:ge.Number()}),ge.Object({type:ge.Literal("variable"),value:ge.String()}),ge.Object({type:ge.Literal("text"),value:ge.String()}),ge.Object({type:ge.Literal("date"),value:ge.String()}),ge.Object({type:ge.Literal("url"),value:ge.String()}),ge.Object({type:ge.Literal("structure"),key:ge.Array(ge.String()),value:ge.Array(ge.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),QB=ge.Object({id:ge.String(),pattern:ge.Array(GI),size:ge.Integer({description:"Number of logs that matched the pattern"}),examples:ge.Array(ge.Object({id:ge.Any(),timestampUnix:ge.Number()})),timeDistribution:ge.Array(ge.Number()),staticFeatures:ge.Array(ge.Object({key:ge.String(),value:ge.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),t8e=ao({tags:["logs"],url:`${EA}/patterns`,method:"GET",query:ge.Object({...oy.properties,query:ms({type:"tsuga-query"}),clusteringThreshold:ge.Optional(ge.Number()),clusterId:ge.Optional(ms({allowEmpty:!1}))}),response:ge.Object({patterns:ge.Array(QB),sampleSize:ge.Number()})}),r8e=ao({tags:["logs"],url:`${EA}/attributes`,method:"GET",query:ge.Object({...oy.properties,clusterId:ge.Optional(ms({allowEmpty:!1,description:"Cluster ID"}))}),response:ge.Object({attributes:ge.Array(ge.String())})});var _P=`/${"v1"}/logs`,xP=ge.Object({context:ge.Optional(ge.Object({team:ge.Optional(ge.String())},{additionalProperties:!0})),message:ge.Optional(ge.String()),timestamp:ge.Number(),level:ge.Enum(YE)},{additionalProperties:!0,$id:"LogEvent"}),JB={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(xP,{examples:[JB]});var eH={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},SP=ge.Object({...ge.Pick(ge.Object(AL),["query","maxResults"]).properties,...wC.properties});Object.assign(SP,{examples:[eH]});var OP=ao({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${_P}/search`,method:"GET",query:SP,response:ge.Object({logs:ge.Array(xP)})}),tH=ge.Object({pattern:ge.Array(GI),size:ge.Integer({description:"Number of logs that matched the pattern"}),groups:ge.Array(ge.Object({key:ge.String(),value:ge.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),RP=ge.Object({patterns:ge.Array(tH),sampleSize:ge.Number()}),rH={patterns:[{pattern:[{type:"text",value:"Resolved"},{type:"text",value:" "},{type:"text",value:"segment"},{type:"text",value:" "},{type:"text",value:"SegmentId("},{type:"range",min:0,max:1},{type:"text",value:")"},{type:"text",value:" "},{type:"text",value:"from"},{type:"text",value:" "},{type:"text",value:"cache"}],size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(RP,{examples:[rH]});var f8e=ao({description:"Get log patterns",operationId:"getLogPatterns",tags:["private"],url:`${_P}/patterns`,method:"GET",query:ge.Object({...wC.properties,query:ms({type:"tsuga-query"})}),response:RP});var Hy="/v0/metrics",nH=ge.Object({__tsuga_metadata__:ge.Object({id:ge.Optional(ge.String())},{additionalProperties:!0}),context:ge.Optional(ge.Object({},{additionalProperties:!0})),message:ge.Optional(ge.String()),timestamp:ge.Number(),level:ge.Enum(YE)},{additionalProperties:!0}),h8e=ao({tags:["metrics"],url:`${Hy}/count`,method:"GET",query:ge.Pick(ge.Object(AL),["from","to","query"]),response:ge.Object({count:ge.Number()})}),E8e=ao({tags:["metrics"],url:`${Hy}/search`,method:"GET",query:ge.Object(AL),response:ge.Object({logs:ge.Optional(ge.Array(nH)),totalHits:ge.Optional(ge.Number()),attributesToHighlight:ge.Optional(ge.Array($I))},{additionalProperties:!0})}),wA=ge.Enum(["counter","gauge","histogram","summary"]),FI=ge.Enum(["delta","cumulative","none"]),sH=ge.Object({capabilities:ge.Optional(ge.Array(ge.String())),description:ge.Optional(ge.String()),tags:ge.Optional(ge.Array(ge.String())),temporality:ge.Optional(FI),type:ge.Optional(wA),unit:ge.Optional(ge.String())}),w8e=ao({url:`${Hy}/metadata`,method:"GET",query:ge.Object({...oy.properties,metricName:ms({allowEmpty:!1}),clusterId:ge.Optional(ms({allowEmpty:!1,description:"Cluster ID"}))}),response:sH}),A8e=ao({tags:["metrics"],url:Hy,method:"GET",query:ge.Object({...oy.properties,clusterId:ge.Optional(ms({allowEmpty:!1,description:"Cluster ID"}))}),response:ge.Array(ge.String())}),jI=ge.Array(ge.Object({name:ge.String(),type:wA}),{description:"List of metric names and their types"}),g8e=ao({tags:["metrics"],url:`${Hy}/names-and-types`,method:"GET",query:ge.Object({...oy.properties,clusterId:ge.Optional(ms({allowEmpty:!1,description:"Cluster ID"}))}),response:jI}),BI=ge.Array(ge.String(),{description:"List of attribute names"}),T8e=ao({tags:["metrics"],url:`${Hy}/attributes`,method:"GET",query:ge.Object({...oy.properties,metricName:ms({allowEmpty:!1}),clusterId:ge.Optional(ms({allowEmpty:!1,description:"Cluster ID"}))}),response:BI}),HI=ge.Object({assets:ge.Array(ge.Object({type:ge.Enum(["dashboard","monitor"]),id:ge.String(),name:ge.String(),owner:ge.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),I8e=ao({tags:["metrics"],url:`${Hy}/assets-usage`,method:"GET",query:ge.Object({metricName:ms({allowEmpty:!1})}),response:HI}),_8e=ao({url:`${Hy}/per-attribute`,method:"GET",query:ge.Object({from:ge.Optional(ge.Number()),to:ge.Optional(ge.Number()),attribute:ms(),clusterId:ge.Optional(ms({allowEmpty:!1}))}),response:ge.Array(ge.String())});var qI=`/${"v1"}/metrics`,oH=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(jI,{examples:[oH]});var KI=ge.Object({name:ge.String({description:"Name of the metric"}),type:wA,description:ge.Optional(ge.String({description:"Human-readable description of the metric"})),unit:ge.Optional(ge.String({description:"Unit of the metric"})),temporality:ge.Optional(FI),capabilities:ge.Optional(ge.Array(ge.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:ge.Optional(ge.Array(ge.String(),{description:"Metric attributes"}))}),aH={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(KI,{examples:[aH]});var NP=ao({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:qI,method:"GET",query:wC,response:ge.Array(KI)}),kP=ao({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${qI}/:name`,method:"GET",params:ge.Object({name:ms({allowEmpty:!1,description:"The metric name"})}),query:wC,response:KI}),uH=["service","env","host","method","status_code"];Object.assign(BI,{examples:[uH]});var UP=ge.Pick(HI,["assets"]),iH={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(UP,{examples:[iH]});var P8e=ao({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${qI}/assets-usage`,method:"GET",query:ge.Object({metricName:ms({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:UP});var lH=`/${"v1"}/traces`,MP=ge.Object({context:ge.Optional(ge.Object({service:ge.Optional(ge.Object({name:ge.Optional(ge.String()),version:ge.Optional(ge.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:ge.Optional(ge.String()),resourceAttributes:ge.Object({},{additionalProperties:!0}),spanAttributes:ge.Object({},{additionalProperties:!0}),duration:ge.Number({description:"In milliseconds."}),startTime:ge.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:ge.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:ge.Optional(ge.Object({message:ge.String()})),events:ge.Optional(ge.Array(ge.Object({event_attributes:ge.Object({},{additionalProperties:!0}),event_name:ge.String(),event_timestamp_nanos:ge.String()}))),spanId:ge.String(),span:ge.Object({kind:ge.String(),name:ge.String()}),statusCode:ge.Optional(ge.String()),traceId:ge.String()},{additionalProperties:!0,$id:"SpanEvent"}),cH={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(MP,{examples:[cH]});var fH={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},PP=ge.Object({...wC.properties,query:ge.Optional(ms({type:"tsuga-query"})),maxResults:ge.Optional(ge.Integer({minimum:1,maximum:1e4}))});Object.assign(PP,{examples:[fH]});var DP=ao({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${lH}/search`,method:"GET",query:PP,response:ge.Object({spans:ge.Array(MP)})});var my=require("node:fs"),$P=require("node:os"),YI=require("node:path"),GP=(0,YI.join)((0,$P.homedir)(),".config","tsuga"),mh=(0,YI.join)(GP,"config.json"),pH="https://api.tsuga.com";function gL(){if(!(0,my.existsSync)(mh))return{};try{return JSON.parse((0,my.readFileSync)(mh,"utf-8"))}catch{throw new Error(`Config file corrupted: ${mh}
|
|
106
106
|
Re-run: tsuga auth <token>`)}}function zI(f){(0,my.mkdirSync)(GP,{recursive:!0,mode:448}),(0,my.writeFileSync)(mh,`${JSON.stringify(f,null,2)}
|
|
107
|
-
`,{mode:384})}function VI(f){let m=gL(),L=f.apiToken??process.env.TSUGA_OPERATION_API_KEY??m.
|
|
107
|
+
`,{mode:384})}function VI(f){let m=gL(),L=f.apiToken??process.env.TSUGA_OPERATION_API_KEY??m.operationApiKey;return{apiUrl:pH,apiToken:L}}function WI(f){let m={};try{m=gL()}catch{}zI({...m,...f})}function FP(){return(0,my.existsSync)(mh)||!!process.env.TSUGA_OPERATION_API_KEY}function XI(){return mh}var ZI={from:"-30m",to:"now",query:"*","max-results":"100"};function jP(){return gL().defaults??{}}function zE(f){return(gL().defaults??{})[f]??ZI[f]}function BP(f,m){let L={};try{L=gL()}catch{}let ne={...L.defaults??{},[f]:m};zI({...L,defaults:ne})}function HP(){let f={};try{f=gL()}catch{}let{defaults:m,...L}=f;zI(L)}function qP(){return gL().lastUpdateCheck}function KP(f){WI({lastUpdateCheck:f})}var mH={s:1,m:60,h:3600,d:86400};function YP(f){for(let m=0;m<f.length;m++){let L=f.charCodeAt(m);if(L<48||L>57)return!1}return!0}function zP(){return Math.floor(Date.now()/1e3)}function VP(f){if(f==="now")return zP();if(f.startsWith("-")&&f.length>=3){let L=f.at(-1),ne=L?mH[L]:void 0;if(ne){let Ue=f.slice(1,-1);if(Ue.length>0&&YP(Ue))return zP()-parseInt(Ue,10)*ne}}if(YP(f)&&f.length>0)return parseInt(f,10);let m=Date.parse(f);if(!Number.isNaN(m))return Math.floor(m/1e3);throw new Error(`Invalid time value: ${f}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}function dh(f,m){let L=m??zE(f);if(!L)throw new Error(`--${f} is required`);return VP(L)}function WP(f){let m={from:dh("from",f.from),to:dh("to",f.to)},L=f.query??zE("query");L!==void 0&&(m.query=L);let ne=f.maxResults??zE("max-results");if(ne!==void 0){let Ue=Number(ne);if(Number.isNaN(Ue))throw new Error(`--max-results must be a number (got: ${ne})`);m.maxResults=Ue}return m}function XP(f,m,L,ne,Ue){f.command(m).description(L).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 t=>{if(t.generateSkeleton){uC(qE(ne));return}let or=KE(t),Fr=await Ue()(ne,{body:or});uC(Fr)})}function gC(f){let m=zE(f);return m===void 0?"":` (default: ${m})`}function ZP(f,m){f.command("logs").description("Search and analyze logs").command("search").description("Search logs").option("--from <timestamp>",`Start of time range${gC("from")}`).option("--to <timestamp>",`End of time range${gC("to")}`).option("--query <query>",`Search query${gC("query")}`).option("--max-results <n>",`Maximum number of results${gC("max-results")}`).action(async or=>{let Fr=await m()(OP,{query:WP(or)});uC(Fr)});let ne=f.command("metrics").description("List and inspect metrics");ne.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${gC("from")}`).option("--to <timestamp>",`End of time range${gC("to")}`).action(async or=>{let Fr=await m()(NP,{query:{from:dh("from",or.from),to:dh("to",or.to)}});uC(Fr)}),ne.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${gC("from")}`).option("--to <timestamp>",`End of time range${gC("to")}`).action(async(or,Fr)=>{let e=await m()(kP,{params:{name:or},query:{from:dh("from",Fr.from),to:dh("to",Fr.to)}});uC(e)}),f.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${gC("from")}`).option("--to <timestamp>",`End of time range${gC("to")}`).option("--query <query>",`Search query${gC("query")}`).option("--max-results <n>",`Maximum number of results${gC("max-results")}`).action(async or=>{let Fr=await m()(DP,{query:WP(or)});uC(Fr)});let t=f.command("aggregation").description("Run aggregation queries");XP(t,"scalar","Run aggregation queries and return scalar results",TP,m),XP(t,"timeseries","Run aggregation queries and return timeseries results",IP,m)}var dH=3e3,bH="https://registry.npmjs.org/@tsuga/cli/latest";function vH(f,m){let L=f.split(".").map(Number),ne=m.split(".").map(Number);for(let Ue=0;Ue<Math.max(L.length,ne.length);Ue++){let t=L[Ue]??0,or=ne[Ue]??0;if(t>or)return!0;if(t<or)return!1}return!1}async function QP(f){try{let m=qP();if(m&&Date.now()-m<Xw)return;let L=await fetch(bH,{signal:AbortSignal.timeout(dH)});if(!L.ok)return;let Ue=(await L.json()).version;vH(Ue,f)&&(process.stderr.write(`
|
|
108
108
|
Update available: ${f} \u2192 ${Ue}
|
|
109
|
-
`),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),KP(Date.now())}catch{}}var qy=new g_().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.
|
|
110
|
-
`)});qy.command("config").description("Show current configuration").action(()=>{if(!FP()){process.stdout.write(`No config found. Run: tsuga auth <
|
|
111
|
-
`);return}let f=qy.opts(),m=VI({
|
|
109
|
+
`),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),KP(Date.now())}catch{}}var qy=new g_().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.2").option("--operation-api-key <operation-api-key>","Operation API key"),QI;function JP(){if(!QI){let f=qy.opts(),m=VI({apiToken:f.apiToken});m.apiToken||(console.error("Error: API token is required. Set it with one of:"),console.error(" tsuga auth <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)),QI=Yk(m.apiUrl,m.apiToken)}return QI}qy.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(f=>{WI({operationApiKey:f}),process.stdout.write(`Operation API key saved to ${XI()}
|
|
110
|
+
`)});qy.command("config").description("Show current configuration").action(()=>{if(!FP()){process.stdout.write(`No config found. Run: tsuga auth <operation-api-key>
|
|
111
|
+
`);return}let f=qy.opts(),m=VI({apiToken:f.apiToken}),L=[`API URL: ${m.apiUrl}`];m.apiToken?L.push(`API Token: ${m.apiToken.slice(0,12)}...${m.apiToken.slice(-4)}`):L.push("API Token: (not set)"),L.push(`Config: ${XI()}`),process.stdout.write(`${L.join(`
|
|
112
112
|
`)}
|
|
113
113
|
`)});var e3=qy.command("defaults").description("Show or manage default values for command flags").action(()=>{let f=jP(),m={...ZI,...f},L=["Defaults (custom overrides marked with *):"];for(let[ne,Ue]of Object.entries(m)){let t=ne in f?" *":"";L.push(` ${ne}: ${Ue}${t}`)}process.stdout.write(`${L.join(`
|
|
114
114
|
`)}
|
|
115
115
|
`)});e3.command("set <key> <value>").description("Set a custom default value").action((f,m)=>{BP(f,m),process.stdout.write(`Default set: ${f} = ${m}
|
|
116
116
|
`)});e3.command("reset").description("Clear all custom defaults").action(()=>{HP(),process.stdout.write(`Custom defaults cleared
|
|
117
|
-
`)});LP(qy,JP);ZP(qy,JP);qy.parseAsync().then(()=>QP("1.0.
|
|
117
|
+
`)});LP(qy,JP);ZP(qy,JP);qy.parseAsync().then(()=>QP("1.0.2")).catch(f=>{console.error(Kk(f)),process.exitCode=1});
|
|
118
118
|
/**
|
|
119
119
|
* The following is a list of HTTP status codes and their meanings.
|
|
120
120
|
*
|