/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * Wire types for the runtime-rule REST surface and the cluster-status
 * query. Mirrors `reference_runtime_rule_api.md` in Claude memory; the
 * authoritative source is the upstream
 * `RuntimeRuleRestHandler.java` + `RuntimeRuleService.java` on
 * `feature/runtime-rule-hot-update` (squashed tip in
 * `~/github/skywalking`).
 *
 * v1 binds to MAL + LAL only. OAL is permanently excluded from
 * hot-update.
 */
// ── Catalogs ───────────────────────────────────────────────────────
export const CATALOGS = ['otel-rules', 'log-mal-rules', 'telegraf-rules', 'lal'];
export function isCatalog(value) {
    return typeof value === 'string' && CATALOGS.includes(value);
}
// ── /runtime/rule/delete ───────────────────────────────────────────
export const DELETE_MODES = ['', 'revertToBundled'];
// ── Errors ─────────────────────────────────────────────────────────
/** Thrown by the client for any HTTP response outside the expected
 *  set. Exposes the parsed body so callers can switch on
 *  `applyStatus`. */
export class RuntimeRuleApiError extends Error {
    status;
    body;
    url;
    constructor(status, body, url) {
        const detail = typeof body === 'string' ? body : `${body.applyStatus}: ${body.message}`;
        super(`${status} on ${url} — ${detail}`);
        this.status = status;
        this.body = body;
        this.url = url;
        this.name = 'RuntimeRuleApiError';
    }
}
//# sourceMappingURL=types.js.map